runpane 2.4.220 → 2.4.222

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +26 -2
  2. package/dist/agentContext.d.ts.map +1 -1
  3. package/dist/agentContext.js +6 -0
  4. package/dist/agentContext.js.map +1 -1
  5. package/dist/agentTasks.d.ts +1 -1
  6. package/dist/agentTasks.js +1 -1
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +11 -4
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands.d.ts.map +1 -1
  11. package/dist/commands.js +4 -1
  12. package/dist/commands.js.map +1 -1
  13. package/dist/daemonClient.d.ts +4 -0
  14. package/dist/daemonClient.d.ts.map +1 -1
  15. package/dist/daemonClient.js +44 -7
  16. package/dist/daemonClient.js.map +1 -1
  17. package/dist/docs-index.json +1 -1
  18. package/dist/doctor.d.ts +3 -0
  19. package/dist/doctor.d.ts.map +1 -1
  20. package/dist/doctor.js +5 -0
  21. package/dist/doctor.js.map +1 -1
  22. package/dist/errors.d.ts +2 -0
  23. package/dist/errors.d.ts.map +1 -1
  24. package/dist/errors.js +6 -1
  25. package/dist/errors.js.map +1 -1
  26. package/dist/forwardedChild.d.ts +13 -0
  27. package/dist/forwardedChild.d.ts.map +1 -0
  28. package/dist/forwardedChild.js +34 -0
  29. package/dist/forwardedChild.js.map +1 -0
  30. package/dist/generated/contract.d.ts +136 -33
  31. package/dist/generated/contract.d.ts.map +1 -1
  32. package/dist/generated/contract.js +216 -39
  33. package/dist/generated/contract.js.map +1 -1
  34. package/dist/handoff.js +1 -1
  35. package/dist/handoff.js.map +1 -1
  36. package/dist/localControl.d.ts +1 -0
  37. package/dist/localControl.d.ts.map +1 -1
  38. package/dist/localControl.js +25 -0
  39. package/dist/localControl.js.map +1 -1
  40. package/dist/managedCli.d.ts.map +1 -1
  41. package/dist/managedCli.js +5 -27
  42. package/dist/managedCli.js.map +1 -1
  43. package/dist/mcp.d.ts +37 -0
  44. package/dist/mcp.d.ts.map +1 -1
  45. package/dist/mcp.js +45 -26
  46. package/dist/mcp.js.map +1 -1
  47. package/dist/mcpHttp.d.ts +17 -0
  48. package/dist/mcpHttp.d.ts.map +1 -0
  49. package/dist/mcpHttp.js +23 -0
  50. package/dist/mcpHttp.js.map +1 -0
  51. package/dist/mcpSdk.d.ts +1 -1
  52. package/dist/mcpSdk.d.ts.map +1 -1
  53. package/dist/mcpSdk.js +75 -47
  54. package/dist/paneIntro.d.ts +20 -0
  55. package/dist/paneIntro.d.ts.map +1 -0
  56. package/dist/paneIntro.js +65 -0
  57. package/dist/paneIntro.js.map +1 -0
  58. package/dist/relay.d.ts +8 -0
  59. package/dist/relay.d.ts.map +1 -0
  60. package/dist/relay.js +39 -0
  61. package/dist/relay.js.map +1 -0
  62. package/dist/secrets.d.ts.map +1 -1
  63. package/dist/secrets.js +3 -24
  64. package/dist/secrets.js.map +1 -1
  65. package/dist/updateCapacity.d.ts +2 -2
  66. package/dist/updateCapacity.d.ts.map +1 -1
  67. package/dist/updateCapacity.js +3 -1
  68. package/dist/updateCapacity.js.map +1 -1
  69. package/dist/workspace.d.ts +12 -0
  70. package/dist/workspace.d.ts.map +1 -1
  71. package/dist/workspace.js +78 -4
  72. package/dist/workspace.js.map +1 -1
  73. package/package.json +3 -2
package/dist/mcpSdk.js CHANGED
@@ -1,41 +1,41 @@
1
- "use strict";var A$=Object.create;var si=Object.defineProperty;var M$=Object.getOwnPropertyDescriptor;var q$=Object.getOwnPropertyNames;var Z$=Object.getPrototypeOf,L$=Object.prototype.hasOwnProperty;var mo=(e,t)=>{for(var r in t)si(e,r,{get:t[r],enumerable:!0})},Sm=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of q$(t))!L$.call(e,n)&&n!==r&&si(e,n,{get:()=>t[n],enumerable:!(o=M$(t,n))||o.enumerable});return e};var D$=(e,t,r)=>(r=e!=null?A$(Z$(e)):{},Sm(t||!e||!e.__esModule?si(r,"default",{value:e,enumerable:!0}):r,e)),U$=e=>Sm(si({},"__esModule",{value:!0}),e);var uT={};mo(uT,{ProtocolError:()=>ee,ProtocolErrorCode:()=>J,Server:()=>xu,serveStdio:()=>N$});module.exports=U$(uT);var F$=Object.create,ii=Object.defineProperty,V$=Object.getOwnPropertyDescriptor,J$=Object.getOwnPropertyNames,H$=Object.getPrototypeOf,B$=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bm=(e,t)=>{let r={};for(var o in e)ii(r,o,{get:e[o],enumerable:!0});return t&&ii(r,Symbol.toStringTag,{value:"Module"}),r},K$=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=J$(t),s=0,i=n.length,a;s<i;s++)a=n[s],!B$.call(e,a)&&a!==r&&ii(e,a,{get:(c=>t[c]).bind(null,a),enumerable:!(o=V$(t,a))||o.enumerable});return e},ai=(e,t,r)=>(r=e!=null?F$(H$(e)):{},K$(t||!e||!e.__esModule?ii(r,"default",{value:e,enumerable:!0}):r,e));var G$=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),zm=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),W$=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),Y$=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function $m(e){return typeof e=="string"&&zm.has(e.replace(/#$/,""))}function wm(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(G$.has(r))return"2020-12";if(zm.has(r))return"2019-09";if(W$.has(r)||Y$.has(r))return"draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var ae={};mo(ae,{BIGINT_FORMAT_RANGES:()=>di,CONSTANT_CATCH:()=>jm,Class:()=>Cu,NUMBER_FORMAT_RANGES:()=>xn,aborted:()=>Ct,allowsEval:()=>Zu,assert:()=>r0,assertEqual:()=>X$,assertIs:()=>e0,assertNever:()=>t0,assertNotEqual:()=>Q$,assignProp:()=>zt,attachSchema:()=>Tn,base64ToUint8Array:()=>Cm,base64urlToUint8Array:()=>b0,cached:()=>_o,captureStackTrace:()=>ui,cleanEnum:()=>S0,cleanRegex:()=>kn,clone:()=>kt,cloneDef:()=>s0,codePointLength:()=>In,constantCatch:()=>Am,createTransparentProxy:()=>d0,defineLazy:()=>Au,defineLazyInternal:()=>Se,derived:()=>R0,esc:()=>Mu,escapeRegex:()=>Bt,explicitlyAborted:()=>Uu,extend:()=>f0,finalizeIssue:()=>Nt,floatSafeRemainder:()=>ju,getElementAtPath:()=>i0,getEnumValues:()=>ho,getLengthableOrigin:()=>On,getParsedType:()=>l0,getSizableOrigin:()=>Om,hexToUint8Array:()=>$0,hide:()=>fi,installLazyProp:()=>x0,isObject:()=>Vr,isPlainObject:()=>pr,issue:()=>yo,joinValues:()=>ci,jsonStringifyReplacer:()=>go,members:()=>Vu,merge:()=>g0,mergeDefs:()=>Ht,normalizeParams:()=>re,nullish:()=>Nu,numKeys:()=>u0,objectClone:()=>o0,omit:()=>m0,optionalKeys:()=>Du,own:()=>dr,parsedType:()=>Fu,partial:()=>_0,pick:()=>p0,prefixIssues:()=>Kt,primitiveTypes:()=>Tm,promiseAllObject:()=>a0,propertyKeyTypes:()=>Lu,randomString:()=>c0,rawShape:()=>vo,required:()=>v0,safeExtend:()=>h0,shallowClone:()=>xm,sizeCaps:()=>mi,slugify:()=>qu,stringifyPrimitive:()=>li,toZod:()=>Pm,uint8ArrayToBase64:()=>Nm,uint8ArrayToBase64url:()=>z0,uint8ArrayToHex:()=>w0,unwrapMessage:()=>fo});function X$(e){return e}function Q$(e){return e}function Pm(){return e=>e}function e0(e){}function t0(e){throw new Error("Unexpected value in exhaustive check")}function r0(e){}function ho(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function ci(e,t="|"){return e.map(r=>li(r)).join(t)}function go(e,t){return typeof t=="bigint"?t.toString():t}var Ou=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function _o(e){return new Ou(e)}function Nu(e){return e==null}function kn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ju(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Rm=Symbol("evaluating");function Au(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Rm)return o===void 0&&(o=Rm,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function o0(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function zt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function vo(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Jt(e){return vo(e._zod.def)??e._zod.def.shape}function Em(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return zt(this,t,o),o},enumerable:!0,configurable:!0})}function km(e,t,r){t in e?zt(e,t,r):e[t]=r}function Fr(e,t,r,o){let n=Jt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);i.enumerable&&(i.get?Em(e,s,()=>{let a=t._zod.def.shape[s];return o?o(a,s):a}):km(e,s,o?o(i.value,s):i.value))}}function n0(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?Em(e,r,()=>t[r]):km(e,r,o.value))}}function Ht(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function s0(e){return Ht(e._zod.def)}function i0(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function a0(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function c0(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Mu(e){return JSON.stringify(e)}function qu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ui="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Vr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Zu=_o(()=>{if(_t.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function pr(e){if(Vr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Vr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function xm(e){return pr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function u0(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var l0=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Lu=new Set(["string","number","symbol"]),Tm=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Bt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kt(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function re(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function d0(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function li(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Du(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var xn={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]},di={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function p0(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return Fr(s,e,pi(e,t)),kt(e,Ht(r,{shape:s,checks:[]}))}function pi(e,t){let r=Jt(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);t[n]&&o.push(n)}return o}function m0(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(pi(e,t)),i={};return Fr(i,e,Reflect.ownKeys(Jt(e)).filter(a=>!s.has(a))),kt(e,Ht(r,{shape:i,checks:[]}))}function f0(e,t){if(!pr(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=Jt(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return kt(e,Ht(e._zod.def,{shape:Im(e,t)}))}function Im(e,t){let r={};return Fr(r,e,Reflect.ownKeys(Jt(e))),n0(r,t),r}function h0(e,t){if(!pr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return kt(e,Ht(e._zod.def,{shape:Im(e,t)}))}function g0(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Fr(r,e,Reflect.ownKeys(Jt(e))),Fr(r,t,Reflect.ownKeys(Jt(t)));let o=Ht(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return kt(e,o)}function _0(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let a=r?new Set(pi(t,r)):void 0,c={};return Fr(c,t,Reflect.ownKeys(Jt(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),kt(t,Ht(t._zod.def,{shape:c,checks:[]}))}function v0(e,t,r){let o=r?new Set(pi(t,r)):void 0,n={};return Fr(n,t,Reflect.ownKeys(Jt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),kt(t,Ht(t._zod.def,{shape:n}))}function Ct(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Uu(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Kt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function fo(e){return typeof e=="string"?e:e?.message}function mi(e){let t=[];for(let r of e??[]){let o=r._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;let n=o.maximum??o.length??o.size;n>=0&&t.push([n,r])}return t}function Tn(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function Nt(e,t,r){var o;let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:fo(e.inst?._zod.def?.error?.(e))??fo(s?.(e))??fo(t?.error?.(e))??fo(r.customError?.(e))??fo(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=e.input),a}function Om(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var y0=/[\uD800-\uDBFF]/;function In(e){let t=e.length;if(!y0.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(r--,o++);return r}function On(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Fu(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function yo(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function S0(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Cm(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Nm(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function b0(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Cm(t+r)}function z0(e){return Nm(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function $0(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function w0(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Cu=class{constructor(...t){}};function Vu(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):P0(e,r,o.value)}}function dr(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function fi(e,t,r){return dr(e,t,r,!1)}function R0(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return dr(this,r,o(this))},set(n){dr(this,r,n)}})}return t}function P0(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:dr(this,t,r.bind(this))},set(o){dr(this,t,o)}})}function E0(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Iu,lr=!1,k0={configurable:!0,get(){lr=!0}};function Se(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&Iu!==e._zod){Iu=void 0;return}Iu=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,k0);let n=lr;lr=!1;try{let s=r(this);return lr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),lr=lr||n,s}catch(s){throw delete this[t],lr=lr||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function x0(e,t,r,o){let n=E0(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var jm="~constantCatch";function Am(e){let t=()=>e;return t[jm]=!0,t}var Mm,Hu=Object.freeze({status:"aborted"}),Ju={value:void 0,enumerable:!1},qm="captureStackTrace"in Error?Error:null;function T0(e){let t=qm;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return qm=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function M(e,t,r,o){let n={};function s(p){this.def=p,this.constr=d,this.traits=new Set}s.prototype=n;let i=r,a=i&&new WeakSet;function c(p,g){if(p._zod){if(p._zod.traits.has(e))return}else{Ju.value=new s(g);try{Object.defineProperty(p,"_zod",Ju)}finally{Ju.value=void 0}}if(p._zod.traits.add(e),t(p,g),a){let v=Object.getPrototypeOf(p),h=p._zod.constr.prototype,f=v;for(;f&&f!==h;)f=Object.getPrototypeOf(f);let z=f??v;a.has(z)||(a.add(z),Vu(z,i))}let m=d.prototype;for(let v in m)Object.prototype.hasOwnProperty.call(m,v)&&(v in p||(p[v]=m[v].bind(p)))}let u=o?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(p){let g=o?.Parent?T0(l):this;c(g,p);let m=g._zod.deferred;if(m){for(let h of m)h();g._zod.deferred=void 0}let v=globalThis.__zod_globalConfig?.postProcessor;return v&&v(g),g}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:p=>o?.Parent&&p instanceof o.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var jt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},So=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Mm=globalThis).__zod_globalConfig??(Mm.__zod_globalConfig={});var _t=globalThis.__zod_globalConfig;function vt(e){return e&&Object.assign(_t,e),_t}function I0(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,go,2)),e.message}function O0(e){this._zod.message=e}var C0={get:I0,set:O0,enumerable:!0,configurable:!0},Ku={value:void 0,enumerable:!1},Zm=new WeakSet([Object.prototype,Error.prototype]),Lm=(e,t)=>{e.name="$ZodError",Ku.value=t,Object.defineProperty(e,"issues",Ku),Ku.value=void 0,Object.defineProperty(e,"message",C0);let r=Object.getPrototypeOf(e);Zm.has(r)||(Zm.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},Dm=M("$ZodError",Lm),gT=M("$ZodError",Lm,void 0,{Parent:Error});function N0(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Gu(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?N0(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Wu(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u],d=u===a.length-1;if(l==="_errors"){d&&c._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let p=c[l];d&&p._errors.push(t(i)),c=p,u++}}}};return o(e),r}function hi(e,t){return{callee:t?.callee??e,Err:t?.Err}}var gi=e=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)throw new jt;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>Nt(u,i,vt())));throw ui(c,s?.callee??t),c}return a.value};return t};var _i=e=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>Nt(u,i,vt())));throw ui(c,s?.callee??t),c}return a.value};return t};var vi=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new jt;return s.issues.length?Um(e,s.issues,n):{success:!0,data:s.value}};function Um(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>Nt(n,r,vt()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var yi=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?Um(e,s.issues,n):{success:!0,data:s.value}};var j0=Symbol.for("zod.compile.invalid"),A0=Symbol.for("zod.compile.fallback"),Yu=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==j0)return!0;if(o.definite===!0&&r===void 0)return!1}return M0(e,t,r)};function M0(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[A0]=!0,s=n({value:t,issues:[]},o)):s=e._zod.run({value:t,issues:[]},o),s instanceof Promise)throw new jt;return s.issues.length===0}var Xu=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);return n instanceof Promise&&(n=await n),n.issues.length===0},Fm=e=>{let t=gi(e),r=(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,a,hi(r,i))};return r};var Vm=e=>{let t=gi(e),r=(o,n,s,i)=>t(o,n,s,hi(r,i));return r};var Jm=e=>{let t=_i(e),r=async(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,a,hi(r,i))};return r};var Hm=e=>{let t=_i(e),r=async(o,n,s,i)=>await t(o,n,s,hi(r,i));return r};var Bm=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return vi(e)(t,r,n)};var Km=e=>(t,r,o)=>vi(e)(t,r,o);var Gm=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return yi(e)(t,r,n)};var Wm=e=>async(t,r,o)=>yi(e)(t,r,o);var Ym=/^[cC][0-9a-z]{6,}$/,Xm=/^[0-9a-z]+$/,Qm=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ef=/^[0-9a-vA-V]{20}$/,tf=/^[A-Za-z0-9]{27}$/,rf=/^[a-zA-Z0-9_-]{21}$/;function of(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var nf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var sf=/^([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})$/,el=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var af=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var q0="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function cf(){return new RegExp(q0,"u")}var uf=/^(?:(?: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])$/,lf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var df=/^((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])$/,pf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ff=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var hf=/^https?$/,gf=/^\+[1-9]\d{6,14}$/;var _f="(?:(?:\\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])))";function Z0(e){return new RegExp(`^${e}$`)}var vf=Z0(_f);function Qu(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function yf(e){return new RegExp(`^${Qu(e)}$`)}function Sf(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Qu({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Qu({precision:e.precision})}`:r;return new RegExp(`^${_f}T(?:${o})$`)}var bf=/^[\s\S]{0,}$/;var zf=/^-?\d+n?$/,tl=/^-?\d+$/,Cn=/^-?\d+(?:\.\d+)?$/,$f=/^(?:true|false)$/i,wf=/^null$/i;var Rf=/^[^A-Z]*$/,Pf=/^[^a-z]*$/;var nt=M("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var rl=e=>{let t=e.value;return!Nu(t)&&t.length!==void 0},Si={number:"number",bigint:"bigint",object:"date"},ol=M("$ZodCheckLessThan",(e,t)=>{nt.init(e,t);let r=Si[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:Si[typeof o.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nl=M("$ZodCheckGreaterThan",(e,t)=>{nt.init(e,t);let r=Si[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:Si[typeof o.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ef=M("$ZodCheckMultipleOf",(e,t)=>{nt.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):ju(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),kf=M("$ZodCheckNumberFormat",(e,t)=>{nt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=xn[t.format];e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<n&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var xf=M("$ZodCheckMaxLength",(e,t)=>{var r;nt.init(e,t),(r=e._zod.def).when??(r.when=rl),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?In(n):s)<=t.maximum)return;let a=On(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Tf=M("$ZodCheckMinLength",(e,t)=>{var r;nt.init(e,t),(r=e._zod.def).when??(r.when=rl),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?In(n):s)>=t.minimum)return;let a=On(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),If=M("$ZodCheckLengthEquals",(e,t)=>{var r;nt.init(e,t),(r=e._zod.def).when??(r.when=rl),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?In(n):s;if(i===t.length)return;let a=On(n),c=i>t.length;o.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Nn=M("$ZodCheckStringFormat",(e,t)=>{var r,o;nt.init(e,t),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Of=M("$ZodCheckRegex",(e,t)=>{Nn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Cf=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Rf),Nn.init(e,t)}),Nf=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Pf),Nn.init(e,t)}),jf=M("$ZodCheckIncludes",(e,t)=>{nt.init(e,t);let r=Bt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Af=M("$ZodCheckStartsWith",(e,t)=>{nt.init(e,t);let r=new RegExp(`^${Bt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Mf=M("$ZodCheckEndsWith",(e,t)=>{nt.init(e,t);let r=new RegExp(`.*${Bt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var qf=M("$ZodCheckOverwrite",(e,t)=>{nt.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var bi=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
1
+ "use strict";var S0=Object.create;var zi=Object.defineProperty;var b0=Object.getOwnPropertyDescriptor;var z0=Object.getOwnPropertyNames;var $0=Object.getPrototypeOf,w0=Object.prototype.hasOwnProperty;var Ro=(e,t)=>{for(var r in t)zi(e,r,{get:t[r],enumerable:!0})},Mm=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of z0(t))!w0.call(e,n)&&n!==r&&zi(e,n,{get:()=>t[n],enumerable:!(o=b0(t,n))||o.enumerable});return e};var R0=(e,t,r)=>(r=e!=null?S0($0(e)):{},Mm(t||!e||!e.__esModule?zi(r,"default",{value:e,enumerable:!0}):r,e)),P0=e=>Mm(zi({},"__esModule",{value:!0}),e);var uI={};Ro(uI,{ProtocolError:()=>Q,ProtocolErrorCode:()=>V,Server:()=>Ju,createMcpHandler:()=>p0,hostHeaderValidationResponse:()=>f0,localhostAllowedHostnames:()=>m0,localhostAllowedOrigins:()=>h0,originValidationResponse:()=>g0,serveStdio:()=>v0});module.exports=P0(uI);var E0=Object.create,$i=Object.defineProperty,k0=Object.getOwnPropertyDescriptor,x0=Object.getOwnPropertyNames,T0=Object.getPrototypeOf,I0=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qm=(e,t)=>{let r={};for(var o in e)$i(r,o,{get:e[o],enumerable:!0});return t&&$i(r,Symbol.toStringTag,{value:"Module"}),r},O0=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=x0(t),s=0,i=n.length,a;s<i;s++)a=n[s],!I0.call(e,a)&&a!==r&&$i(e,a,{get:(c=>t[c]).bind(null,a),enumerable:!(o=k0(t,a))||o.enumerable});return e},wi=(e,t,r)=>(r=e!=null?E0(T0(e)):{},O0(t||!e||!e.__esModule?$i(r,"default",{value:e,enumerable:!0}):r,e));var C0=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Zm=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),N0=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),j0=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Lm(e){return typeof e=="string"&&Zm.has(e.replace(/#$/,""))}function Dm(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(C0.has(r))return"2020-12";if(Zm.has(r))return"2019-09";if(N0.has(r)||j0.has(r))return"draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var ae={};Ro(ae,{BIGINT_FORMAT_RANGES:()=>ki,CONSTANT_CATCH:()=>Xm,Class:()=>Xu,NUMBER_FORMAT_RANGES:()=>Un,aborted:()=>At,allowsEval:()=>nl,assert:()=>L0,assertEqual:()=>A0,assertIs:()=>q0,assertNever:()=>Z0,assertNotEqual:()=>M0,assignProp:()=>$t,attachSchema:()=>Fn,base64ToUint8Array:()=>Wm,base64urlToUint8Array:()=>sw,cached:()=>xo,captureStackTrace:()=>Pi,cleanEnum:()=>nw,cleanRegex:()=>Dn,clone:()=>xt,cloneDef:()=>F0,codePointLength:()=>Vn,constantCatch:()=>Qm,createTransparentProxy:()=>G0,defineLazy:()=>tl,defineLazyInternal:()=>Se,derived:()=>uw,esc:()=>rl,escapeRegex:()=>rr,explicitlyAborted:()=>al,extend:()=>X0,finalizeIssue:()=>Mt,floatSafeRemainder:()=>el,getElementAtPath:()=>V0,getEnumValues:()=>Eo,getLengthableOrigin:()=>Jn,getParsedType:()=>K0,getSizableOrigin:()=>Gm,hexToUint8Array:()=>aw,hide:()=>Ii,installLazyProp:()=>mw,isObject:()=>Qr,isPlainObject:()=>Sr,issue:()=>Io,joinValues:()=>Ri,jsonStringifyReplacer:()=>ko,members:()=>ul,merge:()=>ew,mergeDefs:()=>tr,normalizeParams:()=>re,nullish:()=>Qu,numKeys:()=>B0,objectClone:()=>D0,omit:()=>Y0,optionalKeys:()=>il,own:()=>yr,parsedType:()=>cl,partial:()=>tw,pick:()=>W0,prefixIssues:()=>or,primitiveTypes:()=>Bm,promiseAllObject:()=>J0,propertyKeyTypes:()=>sl,randomString:()=>H0,rawShape:()=>To,required:()=>rw,safeExtend:()=>Q0,shallowClone:()=>Hm,sizeCaps:()=>Ti,slugify:()=>ol,stringifyPrimitive:()=>Ei,toZod:()=>Fm,uint8ArrayToBase64:()=>Ym,uint8ArrayToBase64url:()=>iw,uint8ArrayToHex:()=>cw,unwrapMessage:()=>Po});function A0(e){return e}function M0(e){return e}function Fm(){return e=>e}function q0(e){}function Z0(e){throw new Error("Unexpected value in exhaustive check")}function L0(e){}function Eo(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function Ri(e,t="|"){return e.map(r=>Ei(r)).join(t)}function ko(e,t){return typeof t=="bigint"?t.toString():t}var Yu=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function xo(e){return new Yu(e)}function Qu(e){return e==null}function Dn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function el(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Um=Symbol("evaluating");function tl(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Um)return o===void 0&&(o=Um,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function D0(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function $t(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function To(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function er(e){return To(e._zod.def)??e._zod.def.shape}function Vm(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return $t(this,t,o),o},enumerable:!0,configurable:!0})}function Jm(e,t,r){t in e?$t(e,t,r):e[t]=r}function Xr(e,t,r,o){let n=er(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);i.enumerable&&(i.get?Vm(e,s,()=>{let a=t._zod.def.shape[s];return o?o(a,s):a}):Jm(e,s,o?o(i.value,s):i.value))}}function U0(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?Vm(e,r,()=>t[r]):Jm(e,r,o.value))}}function tr(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function F0(e){return tr(e._zod.def)}function V0(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function J0(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function H0(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function rl(e){return JSON.stringify(e)}function ol(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Pi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var nl=xo(()=>{if(vt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Sr(e){if(Qr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Qr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Hm(e){return Sr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function B0(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var K0=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},sl=new Set(["string","number","symbol"]),Bm=new Set(["string","number","bigint","boolean","symbol","undefined"]);function rr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xt(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function re(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function G0(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function Ei(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function il(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Un={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]},ki={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function W0(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return Xr(s,e,xi(e,t)),xt(e,tr(r,{shape:s,checks:[]}))}function xi(e,t){let r=er(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);t[n]&&o.push(n)}return o}function Y0(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(xi(e,t)),i={};return Xr(i,e,Reflect.ownKeys(er(e)).filter(a=>!s.has(a))),xt(e,tr(r,{shape:i,checks:[]}))}function X0(e,t){if(!Sr(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=er(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return xt(e,tr(e._zod.def,{shape:Km(e,t)}))}function Km(e,t){let r={};return Xr(r,e,Reflect.ownKeys(er(e))),U0(r,t),r}function Q0(e,t){if(!Sr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return xt(e,tr(e._zod.def,{shape:Km(e,t)}))}function ew(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Xr(r,e,Reflect.ownKeys(er(e))),Xr(r,t,Reflect.ownKeys(er(t)));let o=tr(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return xt(e,o)}function tw(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let a=r?new Set(xi(t,r)):void 0,c={};return Xr(c,t,Reflect.ownKeys(er(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),xt(t,tr(t._zod.def,{shape:c,checks:[]}))}function rw(e,t,r){let o=r?new Set(xi(t,r)):void 0,n={};return Xr(n,t,Reflect.ownKeys(er(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),xt(t,tr(t._zod.def,{shape:n}))}function At(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function al(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function or(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Po(e){return typeof e=="string"?e:e?.message}function Ti(e){let t=[];for(let r of e??[]){let o=r._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;let n=o.maximum??o.length??o.size;n>=0&&t.push([n,r])}return t}function Fn(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function Mt(e,t,r){var o;let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Po(e.inst?._zod.def?.error?.(e))??Po(s?.(e))??Po(t?.error?.(e))??Po(r.customError?.(e))??Po(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=e.input),a}function Gm(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var ow=/[\uD800-\uDBFF]/;function Vn(e){let t=e.length;if(!ow.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(r--,o++);return r}function Jn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function cl(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Io(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function nw(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Wm(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Ym(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function sw(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Wm(t+r)}function iw(e){return Ym(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function aw(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function cw(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Xu=class{constructor(...t){}};function ul(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):lw(e,r,o.value)}}function yr(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Ii(e,t,r){return yr(e,t,r,!1)}function uw(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return yr(this,r,o(this))},set(n){yr(this,r,n)}})}return t}function lw(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:yr(this,t,r.bind(this))},set(o){yr(this,t,o)}})}function dw(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Wu,vr=!1,pw={configurable:!0,get(){vr=!0}};function Se(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&Wu!==e._zod){Wu=void 0;return}Wu=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,pw);let n=vr;vr=!1;try{let s=r(this);return vr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),vr=vr||n,s}catch(s){throw delete this[t],vr=vr||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function mw(e,t,r,o){let n=dw(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var Xm="~constantCatch";function Qm(e){let t=()=>e;return t[Xm]=!0,t}var ef,dl=Object.freeze({status:"aborted"}),ll={value:void 0,enumerable:!1},tf="captureStackTrace"in Error?Error:null;function fw(e){let t=tf;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return tf=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function q(e,t,r,o){let n={};function s(p){this.def=p,this.constr=d,this.traits=new Set}s.prototype=n;let i=r,a=i&&new WeakSet;function c(p,g){if(p._zod){if(p._zod.traits.has(e))return}else{ll.value=new s(g);try{Object.defineProperty(p,"_zod",ll)}finally{ll.value=void 0}}if(p._zod.traits.add(e),t(p,g),a){let _=Object.getPrototypeOf(p),m=p._zod.constr.prototype,h=_;for(;h&&h!==m;)h=Object.getPrototypeOf(h);let z=h??_;a.has(z)||(a.add(z),ul(z,i))}let f=d.prototype;for(let _ in f)Object.prototype.hasOwnProperty.call(f,_)&&(_ in p||(p[_]=f[_].bind(p)))}let u=o?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(p){let g=o?.Parent?fw(l):this;c(g,p);let f=g._zod.deferred;if(f){for(let m of f)m();g._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(g),g}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:p=>o?.Parent&&p instanceof o.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var qt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Oo=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(ef=globalThis).__zod_globalConfig??(ef.__zod_globalConfig={});var vt=globalThis.__zod_globalConfig;function yt(e){return e&&Object.assign(vt,e),vt}function hw(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ko,2)),e.message}function gw(e){this._zod.message=e}var _w={get:hw,set:gw,enumerable:!0,configurable:!0},ml={value:void 0,enumerable:!1},rf=new WeakSet([Object.prototype,Error.prototype]),of=(e,t)=>{e.name="$ZodError",ml.value=t,Object.defineProperty(e,"issues",ml),ml.value=void 0,Object.defineProperty(e,"message",_w);let r=Object.getPrototypeOf(e);rf.has(r)||(rf.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},nf=q("$ZodError",of),gI=q("$ZodError",of,void 0,{Parent:Error});function vw(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function fl(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?vw(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function hl(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u],d=u===a.length-1;if(l==="_errors"){d&&c._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let p=c[l];d&&p._errors.push(t(i)),c=p,u++}}}};return o(e),r}function Oi(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Ci=e=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)throw new qt;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>Mt(u,i,yt())));throw Pi(c,s?.callee??t),c}return a.value};return t};var Ni=e=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>Mt(u,i,yt())));throw Pi(c,s?.callee??t),c}return a.value};return t};var ji=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new qt;return s.issues.length?sf(e,s.issues,n):{success:!0,data:s.value}};function sf(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>Mt(n,r,yt()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var Ai=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?sf(e,s.issues,n):{success:!0,data:s.value}};var yw=Symbol.for("zod.compile.invalid"),Sw=Symbol.for("zod.compile.fallback"),gl=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==yw)return!0;if(o.definite===!0&&r===void 0)return!1}return bw(e,t,r)};function bw(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[Sw]=!0,s=n({value:t,issues:[]},o)):s=e._zod.run({value:t,issues:[]},o),s instanceof Promise)throw new qt;return s.issues.length===0}var _l=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);return n instanceof Promise&&(n=await n),n.issues.length===0},af=e=>{let t=Ci(e),r=(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,a,Oi(r,i))};return r};var cf=e=>{let t=Ci(e),r=(o,n,s,i)=>t(o,n,s,Oi(r,i));return r};var uf=e=>{let t=Ni(e),r=async(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,a,Oi(r,i))};return r};var lf=e=>{let t=Ni(e),r=async(o,n,s,i)=>await t(o,n,s,Oi(r,i));return r};var df=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return ji(e)(t,r,n)};var pf=e=>(t,r,o)=>ji(e)(t,r,o);var mf=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ai(e)(t,r,n)};var ff=e=>async(t,r,o)=>Ai(e)(t,r,o);var hf=/^[cC][0-9a-z]{6,}$/,gf=/^[0-9a-z]+$/,_f=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,vf=/^[0-9a-vA-V]{20}$/,yf=/^[A-Za-z0-9]{27}$/,Sf=/^[a-zA-Z0-9_-]{21}$/;function bf(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var zf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var $f=/^([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})$/,yl=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var wf=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var zw="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Rf(){return new RegExp(zw,"u")}var Pf=/^(?:(?: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])$/,Ef=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var kf=/^((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])$/,xf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Tf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,If=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Of=/^https?$/,Cf=/^\+[1-9]\d{6,14}$/;var Nf="(?:(?:\\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])))";function $w(e){return new RegExp(`^${e}$`)}var jf=$w(Nf);function vl(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Af(e){return new RegExp(`^${vl(e)}$`)}function Mf(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${vl({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${vl({precision:e.precision})}`:r;return new RegExp(`^${Nf}T(?:${o})$`)}var qf=/^[\s\S]{0,}$/;var Zf=/^-?\d+n?$/,Sl=/^-?\d+$/,Hn=/^-?\d+(?:\.\d+)?$/,Lf=/^(?:true|false)$/i,Df=/^null$/i;var Uf=/^[^A-Z]*$/,Ff=/^[^a-z]*$/;var st=q("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var bl=e=>{let t=e.value;return!Qu(t)&&t.length!==void 0},Mi={number:"number",bigint:"bigint",object:"date"},zl=q("$ZodCheckLessThan",(e,t)=>{st.init(e,t);let r=Mi[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:Mi[typeof o.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$l=q("$ZodCheckGreaterThan",(e,t)=>{st.init(e,t);let r=Mi[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:Mi[typeof o.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Vf=q("$ZodCheckMultipleOf",(e,t)=>{st.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):el(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Jf=q("$ZodCheckNumberFormat",(e,t)=>{st.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Un[t.format];e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<n&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Hf=q("$ZodCheckMaxLength",(e,t)=>{var r;st.init(e,t),(r=e._zod.def).when??(r.when=bl),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Vn(n):s)<=t.maximum)return;let a=Jn(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Bf=q("$ZodCheckMinLength",(e,t)=>{var r;st.init(e,t),(r=e._zod.def).when??(r.when=bl),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Vn(n):s)>=t.minimum)return;let a=Jn(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Kf=q("$ZodCheckLengthEquals",(e,t)=>{var r;st.init(e,t),(r=e._zod.def).when??(r.when=bl),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Vn(n):s;if(i===t.length)return;let a=Jn(n),c=i>t.length;o.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Bn=q("$ZodCheckStringFormat",(e,t)=>{var r,o;st.init(e,t),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Gf=q("$ZodCheckRegex",(e,t)=>{Bn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Wf=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Uf),Bn.init(e,t)}),Yf=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ff),Bn.init(e,t)}),Xf=q("$ZodCheckIncludes",(e,t)=>{st.init(e,t);let r=rr(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Qf=q("$ZodCheckStartsWith",(e,t)=>{st.init(e,t);let r=new RegExp(`^${rr(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),eh=q("$ZodCheckEndsWith",(e,t)=>{st.init(e,t);let r=new RegExp(`.*${rr(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var th=q("$ZodCheckOverwrite",(e,t)=>{st.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var qi=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
2
2
  `).filter(i=>i),n=Math.min(...o.map(i=>i.length-i.trimStart().length)),s=o.map(i=>i.slice(n)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
3
3
  ${r.join(`
4
4
  `)}
5
- };`)(...Object.values(this.closed))}};var Lf={major:4,minor:6,patch:7};var ke=M("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Lf;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let s of n)for(let i of s._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(a,c,u)=>{if(a.memo)return a;let l=Ct(a),d;for(let p of c){if(p._zod.def.when){if(Uu(a)||!p._zod.def.when(a))continue}else if(l)continue;let g=a.issues.length,m=p._zod.check(a);if(m instanceof Promise&&u?.async===!1)throw new jt;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,a.issues.length!==g&&(Tn(a.issues,g,e),l||(l=Ct(a,g)))});else{if(a.issues.length===g)continue;Tn(a.issues,g,e),l||(l=Ct(a,g))}}return d?d.then(()=>a):a},i=(a,c,u)=>{if(Ct(a))return a.aborted=!0,a;let l=s(c,n,u);if(l instanceof Promise){if(u.async===!1)throw new jt;return l.then(d=>e._zod.parse(d,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return l instanceof Promise?l.then(d=>i(d,a,c)):i(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new jt;return u.then(l=>s(l,n,c))}return s(u,n,c)}}},{get"~standard"(){return fi(this,"~standard",il(this))},set"~standard"(e){dr(this,"~standard",e)}}),Yf=(e,t)=>e.issues.length?{issues:e.issues.map(r=>Nt(r,t,vt()))}:{value:e.value};async function L0(e,t){let r={async:!0};return Yf(await e._zod.run({value:t,issues:[]},r),r)}function il(e){return{validate:t=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Yf(o,r)}catch{}return L0(e,t)},vendor:"zod",version:1}}var Ri=M("$ZodString",(e,t)=>{ke.init(e,t),e._zod.pattern=t.pattern??bf,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),je=M("$ZodStringFormat",(e,t)=>{Nn.init(e,t),Ri.init(e,t)}),Xf=M("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=sf),je.init(e,t)}),Qf=M("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=el(o))}else t.pattern??(t.pattern=el());je.init(e,t)}),eh=M("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=af),je.init(e,t)}),th=1,$i=2;function rh(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function D0(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?rh(e)||$i:U0(e,t)}function U0(e,t){if(!t.normalize&&t.protocol?.source===hf.source&&!/^https?:\/\//i.test(e))return th;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??$i}return new URL(e)}catch{return $i}}var F0=/[\t\n\r]/g;function Df(e){return e.replace(F0,"")}function V0(e,t){return t.lastIndex=0,t.test(e.hostname)}function J0(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var oh=M("$ZodURL",(e,t)=>{je.init(e,t),e._zod.check=r=>{try{let o=r.value.trim(),n=D0(o,t);if(n===th){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===$i){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=Df(o);return}t.hostname&&!V0(n,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!J0(n,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?n.href:Df(o);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),nh=M("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=cf()),je.init(e,t)}),sh=M("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?rf:of(t.length)),je.init(e,t)}),ih=M("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ym),je.init(e,t)}),ah=M("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Xm),je.init(e,t)}),ch=M("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Qm),je.init(e,t)}),uh=M("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ef),je.init(e,t)}),lh=M("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=tf),je.init(e,t)}),dh=M("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Sf(t)),je.init(e,t)}),ph=M("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=vf),je.init(e,t)}),mh=M("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=yf(t)),je.init(e,t)}),fh=M("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=nf),je.init(e,t)}),hh=M("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=uf),je.init(e,t)}),H0=/^[0-9a-fA-F:.]+$/;function gh(e){return H0.test(e)?rh(`http://[${e}]`):!1}var _h=M("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=lf),je.init(e,t),e._zod.check=r=>{gh(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var vh=M("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=df),je.init(e,t)});function B0(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);return`${n}`!==o||n<0||n>128?!1:gh(r)}var yh=M("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=pf),je.init(e,t),e._zod.check=r=>{B0(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function Sh(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var al=/^[0-9a-zA-Z+/]*={0,2}$/,bh=M("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=al),je.init(e,t),e._zod.check=r=>{Sh(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Pi=/^[A-Za-z0-9_-]*$/;function K0(e){if(!Pi.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Sh(r)}var zh=M("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Pi),je.init(e,t),e._zod.check=r=>{K0(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),$h=M("$ZodE164",(e,t)=>{t.pattern??(t.pattern=gf),je.init(e,t)});function G0(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var wh=M("$ZodJWT",(e,t)=>{je.init(e,t),e._zod.check=r=>{G0(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var cl=M("$ZodNumber",(e,t)=>{ke.init(e,t),e._zod.pattern=Cn,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:String(n):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),Rh=M("$ZodNumberFormat",(e,t)=>{kf.init(e,t),cl.init(e,t)}),Ph=M("$ZodBoolean",(e,t)=>{ke.init(e,t),e._zod.pattern=$f,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Eh=M("$ZodBigInt",(e,t)=>{ke.init(e,t),e._zod.pattern=zf,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var kh=M("$ZodNull",(e,t)=>{ke.init(e,t),e._zod.pattern=wf,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),xh=M("$ZodAny",(e,t)=>{ke.init(e,t),e._zod.parse=r=>r}),Th=M("$ZodUnknown",(e,t)=>{ke.init(e,t),e._zod.parse=r=>r}),Ih=M("$ZodNever",(e,t)=>{ke.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});var Oh=M("$ZodDate",(e,t)=>{ke.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),r}});function W0(e,t){let r=mi(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map(s=>s[0])),n=e._zod.parse;e._zod.parse=(s,i)=>{let a=t(s.value);if(a>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[c,u]of mi(e._zod.def.checks))if(a>c&&u._zod.def.when(s)){let l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Tn(s.issues,l,e),s}}return n(s,i)}}var Y0=e=>Array.isArray(e)?e.length:-1;function Uf(e,t,r){e.issues.length&&t.issues.push(...Kt(r,e.issues)),t.value[r]=e.value}var Ch=M("$ZodArray",(e,t)=>{ke.init(e,t);let r=_t.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=r?r.alloc(e,o,Array(s.length),n):Array(s.length);let i=[],a=n?.abortEarly;for(let c=0;c<s.length;c++){let u=s[c],l=t.element._zod.run({value:u,issues:[]},n);if(l instanceof Promise)i.push(l.then(d=>Uf(d,o,c)));else if(Uf(l,o,c),a&&l.issues.length!==0&&Ct(l))break}return i.length?Promise.all(i).then(()=>o):o},W0(e,Y0)});function wi(e,t,r,o,n,s){let i=r in o,a=s==="optional";if(!(!i&&a&&n==="optional")){if(e.issues.length){if(n!==void 0&&a&&!i)return;t.issues.push(...Kt(r,e.issues))}if(!i&&n===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(i||n==="defaulted"&&!a)&&(t.value[r]=void 0):t.value[r]=e.value}}var X0=[];function Nh(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:X0,n=o.length?[...t,...o]:t;for(let i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=Du(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function jh(e,t,r,o,n,s,i){let a=[],c=n.keySet,u=n.catchall._zod,l=u.def.type,d=u.optin,p=u.optout,g=0;for(let m in t){if(i&&r.issues.length!==g){if(Ct(r,g))break;g=r.issues.length}if(c.has(m))continue;if(m==="__proto__"){l==="never"&&a.push(m);continue}if(l==="never"){a.push(m);continue}let v=u.run({value:t[m],issues:[]},o);v instanceof Promise?e.push(v.then(h=>wi(h,r,m,t,d,p))):wi(v,r,m,t,d,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var Q0=M("$ZodObject",(e,t)=>{ke.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let l={...o};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=_o(()=>Nh(t));Se(e,"propValues",u=>{let l=u.def.shape,d={};for(let p in l){let g=l[p]._zod;if(g.values){Object.prototype.hasOwnProperty.call(d,p)||zt(d,p,new Set);for(let m of g.values)d[p].add(m);g.optin!==void 0&&d[p].add(void 0)}}return d});let s=Vr,i=t.catchall,a,c=_t.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=n.value);let d=u.value;if(!s(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let p=[],g=a.shape,m=l?.abortEarly,v=u.issues.length;for(let h of a.allKeys){if(m&&u.issues.length!==v){if(Ct(u,v))break;v=u.issues.length}if(h==="__proto__")continue;let f=g[h],z=f._zod.optin,_=f._zod.optout,b=f._zod.run({value:d[h],issues:[]},l);b instanceof Promise?p.push(b.then(R=>wi(R,u,h,d,z,_))):wi(b,u,h,d,z,_)}return i?jh(p,d,u,l,n.value,e,m===!0):p.length?Promise.all(p).then(()=>u):u}}),Ah=M("$ZodObjectJIT",(e,t)=>{Q0.init(e,t);let r=e._zod.parse,o=_o(()=>Nh(t)),n=_t.memoizer,s=g=>{let m=o.value,v=m.symbolKeys,h=new bi(["payload","ctx"],{shape:g,inst:e,memo:n,syms:v}),f=R=>`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`,z=(R,S)=>`
5
+ };`)(...Object.values(this.closed))}};var oh={major:4,minor:6,patch:7};var ke=q("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=oh;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let s of n)for(let i of s._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(a,c,u)=>{if(a.memo)return a;let l=At(a),d;for(let p of c){if(p._zod.def.when){if(al(a)||!p._zod.def.when(a))continue}else if(l)continue;let g=a.issues.length,f=p._zod.check(a);if(f instanceof Promise&&u?.async===!1)throw new qt;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,a.issues.length!==g&&(Fn(a.issues,g,e),l||(l=At(a,g)))});else{if(a.issues.length===g)continue;Fn(a.issues,g,e),l||(l=At(a,g))}}return d?d.then(()=>a):a},i=(a,c,u)=>{if(At(a))return a.aborted=!0,a;let l=s(c,n,u);if(l instanceof Promise){if(u.async===!1)throw new qt;return l.then(d=>e._zod.parse(d,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return l instanceof Promise?l.then(d=>i(d,a,c)):i(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new qt;return u.then(l=>s(l,n,c))}return s(u,n,c)}}},{get"~standard"(){return Ii(this,"~standard",Rl(this))},set"~standard"(e){yr(this,"~standard",e)}}),fh=(e,t)=>e.issues.length?{issues:e.issues.map(r=>Mt(r,t,yt()))}:{value:e.value};async function ww(e,t){let r={async:!0};return fh(await e._zod.run({value:t,issues:[]},r),r)}function Rl(e){return{validate:t=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return fh(o,r)}catch{}return ww(e,t)},vendor:"zod",version:1}}var Ui=q("$ZodString",(e,t)=>{ke.init(e,t),e._zod.pattern=t.pattern??qf,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),je=q("$ZodStringFormat",(e,t)=>{Bn.init(e,t),Ui.init(e,t)}),hh=q("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=$f),je.init(e,t)}),gh=q("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=yl(o))}else t.pattern??(t.pattern=yl());je.init(e,t)}),_h=q("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=wf),je.init(e,t)}),vh=1,Li=2;function yh(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Rw(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?yh(e)||Li:Pw(e,t)}function Pw(e,t){if(!t.normalize&&t.protocol?.source===Of.source&&!/^https?:\/\//i.test(e))return vh;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??Li}return new URL(e)}catch{return Li}}var Ew=/[\t\n\r]/g;function nh(e){return e.replace(Ew,"")}function kw(e,t){return t.lastIndex=0,t.test(e.hostname)}function xw(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Sh=q("$ZodURL",(e,t)=>{je.init(e,t),e._zod.check=r=>{try{let o=r.value.trim(),n=Rw(o,t);if(n===vh){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===Li){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=nh(o);return}t.hostname&&!kw(n,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!xw(n,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?n.href:nh(o);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),bh=q("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Rf()),je.init(e,t)}),zh=q("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Sf:bf(t.length)),je.init(e,t)}),$h=q("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=hf),je.init(e,t)}),wh=q("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=gf),je.init(e,t)}),Rh=q("$ZodULID",(e,t)=>{t.pattern??(t.pattern=_f),je.init(e,t)}),Ph=q("$ZodXID",(e,t)=>{t.pattern??(t.pattern=vf),je.init(e,t)}),Eh=q("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=yf),je.init(e,t)}),kh=q("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Mf(t)),je.init(e,t)}),xh=q("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=jf),je.init(e,t)}),Th=q("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Af(t)),je.init(e,t)}),Ih=q("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=zf),je.init(e,t)}),Oh=q("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Pf),je.init(e,t)}),Tw=/^[0-9a-fA-F:.]+$/;function Ch(e){return Tw.test(e)?yh(`http://[${e}]`):!1}var Nh=q("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ef),je.init(e,t),e._zod.check=r=>{Ch(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var jh=q("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=kf),je.init(e,t)});function Iw(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);return`${n}`!==o||n<0||n>128?!1:Ch(r)}var Ah=q("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=xf),je.init(e,t),e._zod.check=r=>{Iw(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function Mh(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Pl=/^[0-9a-zA-Z+/]*={0,2}$/,qh=q("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Pl),je.init(e,t),e._zod.check=r=>{Mh(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Fi=/^[A-Za-z0-9_-]*$/;function Ow(e){if(!Fi.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Mh(r)}var Zh=q("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Fi),je.init(e,t),e._zod.check=r=>{Ow(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Lh=q("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Cf),je.init(e,t)});function Cw(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var Dh=q("$ZodJWT",(e,t)=>{je.init(e,t),e._zod.check=r=>{Cw(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var El=q("$ZodNumber",(e,t)=>{ke.init(e,t),e._zod.pattern=Hn,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:String(n):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),Uh=q("$ZodNumberFormat",(e,t)=>{Jf.init(e,t),El.init(e,t)}),Fh=q("$ZodBoolean",(e,t)=>{ke.init(e,t),e._zod.pattern=Lf,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Vh=q("$ZodBigInt",(e,t)=>{ke.init(e,t),e._zod.pattern=Zf,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Jh=q("$ZodNull",(e,t)=>{ke.init(e,t),e._zod.pattern=Df,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Hh=q("$ZodAny",(e,t)=>{ke.init(e,t),e._zod.parse=r=>r}),Bh=q("$ZodUnknown",(e,t)=>{ke.init(e,t),e._zod.parse=r=>r}),Kh=q("$ZodNever",(e,t)=>{ke.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});var Gh=q("$ZodDate",(e,t)=>{ke.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Nw(e,t){let r=Ti(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map(s=>s[0])),n=e._zod.parse;e._zod.parse=(s,i)=>{let a=t(s.value);if(a>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[c,u]of Ti(e._zod.def.checks))if(a>c&&u._zod.def.when(s)){let l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Fn(s.issues,l,e),s}}return n(s,i)}}var jw=e=>Array.isArray(e)?e.length:-1;function sh(e,t,r){e.issues.length&&t.issues.push(...or(r,e.issues)),t.value[r]=e.value}var Wh=q("$ZodArray",(e,t)=>{ke.init(e,t);let r=vt.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=r?r.alloc(e,o,Array(s.length),n):Array(s.length);let i=[],a=n?.abortEarly;for(let c=0;c<s.length;c++){let u=s[c],l=t.element._zod.run({value:u,issues:[]},n);if(l instanceof Promise)i.push(l.then(d=>sh(d,o,c)));else if(sh(l,o,c),a&&l.issues.length!==0&&At(l))break}return i.length?Promise.all(i).then(()=>o):o},Nw(e,jw)});function Di(e,t,r,o,n,s){let i=r in o,a=s==="optional";if(!(!i&&a&&n==="optional")){if(e.issues.length){if(n!==void 0&&a&&!i)return;t.issues.push(...or(r,e.issues))}if(!i&&n===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(i||n==="defaulted"&&!a)&&(t.value[r]=void 0):t.value[r]=e.value}}var Aw=[];function Yh(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:Aw,n=o.length?[...t,...o]:t;for(let i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=il(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Xh(e,t,r,o,n,s,i){let a=[],c=n.keySet,u=n.catchall._zod,l=u.def.type,d=u.optin,p=u.optout,g=0;for(let f in t){if(i&&r.issues.length!==g){if(At(r,g))break;g=r.issues.length}if(c.has(f))continue;if(f==="__proto__"){l==="never"&&a.push(f);continue}if(l==="never"){a.push(f);continue}let _=u.run({value:t[f],issues:[]},o);_ instanceof Promise?e.push(_.then(m=>Di(m,r,f,t,d,p))):Di(_,r,f,t,d,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var Mw=q("$ZodObject",(e,t)=>{ke.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let l={...o};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=xo(()=>Yh(t));Se(e,"propValues",u=>{let l=u.def.shape,d={};for(let p in l){let g=l[p]._zod;if(g.values){Object.prototype.hasOwnProperty.call(d,p)||$t(d,p,new Set);for(let f of g.values)d[p].add(f);g.optin!==void 0&&d[p].add(void 0)}}return d});let s=Qr,i=t.catchall,a,c=vt.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=n.value);let d=u.value;if(!s(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let p=[],g=a.shape,f=l?.abortEarly,_=u.issues.length;for(let m of a.allKeys){if(f&&u.issues.length!==_){if(At(u,_))break;_=u.issues.length}if(m==="__proto__")continue;let h=g[m],z=h._zod.optin,v=h._zod.optout,S=h._zod.run({value:d[m],issues:[]},l);S instanceof Promise?p.push(S.then(R=>Di(R,u,m,d,z,v))):Di(S,u,m,d,z,v)}return i?Xh(p,d,u,l,n.value,e,f===!0):p.length?Promise.all(p).then(()=>u):u}}),Qh=q("$ZodObjectJIT",(e,t)=>{Mw.init(e,t);let r=e._zod.parse,o=xo(()=>Yh(t)),n=vt.memoizer,s=g=>{let f=o.value,_=f.symbolKeys,m=new qi(["payload","ctx"],{shape:g,inst:e,memo:n,syms:_}),h=R=>`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`,z=(R,b)=>`
6
6
  let ${R}_ab = false;
7
7
  for (let i = 0; i < ${R}.issues.length; i++) {
8
8
  const iss = ${R}.issues[i];
9
- iss.path = iss.path ? [${S}, ...iss.path] : [${S}];
9
+ iss.path = iss.path ? [${b}, ...iss.path] : [${b}];
10
10
  payload.issues.push(iss);
11
11
  if (iss.continue !== true) ${R}_ab = true;
12
12
  }
13
13
  if (${R}_ab && ctx && ctx.abortEarly) {
14
14
  payload.value = newResult;
15
15
  return payload;
16
- }`;h.write("const input = payload.value;");let _=Object.create(null),b=0;for(let R of m.allKeys)_[R]=`key_${b++}`;h.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let R of m.allKeys){if(R==="__proto__")continue;let S=_[R],y=typeof R=="symbol"?`syms[${v.indexOf(R)}]`:Mu(R),$=`${y} in input`,I=g[R],q=I?._zod?.optin,O=q!==void 0,L=I?._zod?.optout==="optional";if(h.write(`const ${S} = ${f(y)};`),O&&L){let K=q==="optional"?`${S}_present`:`${S}.value !== undefined || ${S}_present`;h.write(`
17
- const ${S}_present = ${$};
18
- if (!${S}.issues.length || ${S}_present) {
19
- if (${S}.issues.length) {${z(S,y)}
16
+ }`;m.write("const input = payload.value;");let v=Object.create(null),S=0;for(let R of f.allKeys)v[R]=`key_${S++}`;m.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let R of f.allKeys){if(R==="__proto__")continue;let b=v[R],y=typeof R=="symbol"?`syms[${_.indexOf(R)}]`:rl(R),$=`${y} in input`,T=g[R],C=T?._zod?.optin,O=C!==void 0,L=T?._zod?.optout==="optional";if(m.write(`const ${b} = ${h(y)};`),O&&L){let H=C==="optional"?`${b}_present`:`${b}.value !== undefined || ${b}_present`;m.write(`
17
+ const ${b}_present = ${$};
18
+ if (!${b}.issues.length || ${b}_present) {
19
+ if (${b}.issues.length) {${z(b,y)}
20
20
  }
21
21
 
22
- if (${K}) {
23
- newResult[${y}] = ${S}.value;
22
+ if (${H}) {
23
+ newResult[${y}] = ${b}.value;
24
24
  }
25
25
  }
26
26
 
27
- `)}else O?(h.write(`
28
- if (${S}.issues.length) {${z(S,y)}
27
+ `)}else O?(m.write(`
28
+ if (${b}.issues.length) {${z(b,y)}
29
29
  }
30
- `),q==="defaulted"?h.write(`newResult[${y}] = ${S}.value;`):h.write(`
31
- if (${S}.value !== undefined || ${$}) {
32
- newResult[${y}] = ${S}.value;
30
+ `),C==="defaulted"?m.write(`newResult[${y}] = ${b}.value;`):m.write(`
31
+ if (${b}.value !== undefined || ${$}) {
32
+ newResult[${y}] = ${b}.value;
33
33
  }
34
- `)):h.write(`
35
- const ${S}_present = ${$};
36
- if (${S}.issues.length) {${z(S,y)}
34
+ `)):m.write(`
35
+ const ${b}_present = ${$};
36
+ if (${b}.issues.length) {${z(b,y)}
37
37
  }
38
- if (!${S}_present && !${S}.issues.length) {
38
+ if (!${b}_present && !${b}.issues.length) {
39
39
  payload.issues.push({
40
40
  code: "invalid_type",
41
41
  expected: "nonoptional",
@@ -48,57 +48,57 @@ ${r.join(`
48
48
  }
49
49
  }
50
50
 
51
- if (${S}_present) {
52
- newResult[${y}] = ${S}.value;
51
+ if (${b}_present) {
52
+ newResult[${y}] = ${b}.value;
53
53
  }
54
54
 
55
- `)}return h.write("payload.value = newResult;"),h.write("return payload;"),h.compile()},i,a=Vr,c=!_t.jitless,l=c&&Zu.value,d=t.catchall,p;e._zod.parse=(g,m)=>{p??(p=o.value);let v=g.value;return a(v)?c&&l&&m?.async===!1&&m.jitless!==!0?(i||(i=s(t.shape)),g=i(g,m),d?jh([],v,g,m,p,e,m?.abortEarly===!0):g):r(g,m):(g.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),g)}});function Ff(e,t,r,o){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter(s=>!Ct(s));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>Nt(i,o,vt())))}),t)}var ul=M("$ZodUnion",(e,t)=>{ke.init(e,t),Se(e,"optin",o=>o.def.options.some(n=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some(n=>n._zod.optin!==void 0)?"optional":void 0),Se(e,"optout",o=>o.def.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Se(e,"values",o=>{if(o.def.options.every(n=>n._zod.values))return new Set(o.def.options.flatMap(n=>Array.from(n._zod.values)))}),Se(e,"pattern",o=>{if(o.def.options.every(n=>n._zod.pattern)){let n=o.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${n.map(s=>kn(s.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,i=[];for(let a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>Ff(a,o,e,n)):Ff(i,o,e,n)}});function ew(e){let t=new Map;for(let r of e.options){let o=r._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let n of o)if(t.has(n)){if(n!==void 0)throw new Error(`Duplicate discriminator value "${String(n)}"`);t.set(n,null)}else t.set(n,r)}return t}var Mh=M("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ul.init(e,t);let r=e._zod.parse;Se(e,"propValues",n=>{let s={},i=0;for(let a of n.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${n.def.options.indexOf(a)}"`);c[n.def.discriminator]?.has(void 0)&&i++;for(let[u,l]of Object.entries(c)){Object.prototype.hasOwnProperty.call(s,u)||zt(s,u,new Set);for(let d of l)s[u].add(d)}}return!n.def.unionFallback&&i>1&&s[n.def.discriminator]?.delete(void 0),s}),t.options.forEach((n,s)=>{let i=vo(n._zod.def);if(i&&!Object.prototype.hasOwnProperty.call(i,t.discriminator))throw new Error(`Invalid discriminated union option at index "${s}"`)});let o=_o(()=>ew(t));e._zod.parse=(n,s)=>{let i=n.value;if(!Vr(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let a=i?.[t.discriminator],c=o.value.get(a);return c&&(a!==void 0||s.direction!=="backward")?c._zod.run(n,s):t.unionFallback||s.direction==="backward"?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()).filter(u=>o.value.get(u)!==null),input:i,path:[t.discriminator],inst:e}),n)}}),qh=M("$ZodIntersection",(e,t)=>{ke.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,s=t.left._zod.run({value:n,issues:[]},o),i=t.right._zod.run({value:n,issues:[]},o);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>Vf(r,c,u)):Vf(r,s,i)}});function sl(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(pr(e)&&pr(t)){let r=Object.keys(t),o=Object.keys(e).filter(s=>r.indexOf(s)!==-1),n={...e,...t};Object.prototype.hasOwnProperty.call(n,"__proto__")&&delete n.__proto__;for(let s of o){if(s==="__proto__")continue;let i=sl(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],s=t[o],i=sl(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Vf(e,t,r){let o=new Map,n,s=new Map,i=(u,l)=>{let d;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let p=String(u.path[0]);s.has(p)||s.set(p,u),d=[p]}else return!1;for(let p of d)o.has(p)||o.set(p,{}),o.get(p)[l]=!0;return!0};for(let u of t.issues)i(u,"l")||e.issues.push(u);for(let u of r.issues)i(u,"r")||e.issues.push(u);let a=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=n?a.filter(l=>n.keys.includes(l)):[];u.length&&e.issues.push({...n,keys:u});for(let l of a)!u.includes(l)&&s.has(l)&&e.issues.push(s.get(l))}let c=sl(t.value,r.value);if(!c.valid){if(Ct(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Zh=M("$ZodRecord",(e,t)=>{ke.init(e,t);let r=_t.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!pr(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;let i=[],a=t.keyType._zod.values;if(a&&!t.partial){o.value=r?r.alloc(e,o,{},n):{};let c=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(c.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;let d=t.keyType._zod.run({value:l,issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Nt(m,n,vt())),input:l,path:[l],inst:e});continue}let p=d.value;if(p==="__proto__")continue;let g=t.valueType._zod.run({value:s[l],issues:[]},n);g instanceof Promise?i.push(g.then(m=>{m.issues.length&&o.issues.push(...Kt(l,m.issues)),o.value[p]=m.value})):(g.issues.length&&o.issues.push(...Kt(l,g.issues)),o.value[p]=g.value)}let u;for(let l in s)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;o.value[l]=s[l]}else u=u??[],u.push(l);u&&u.length>0&&o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u,continue:!0})}else{o.value=r?r.alloc(e,o,{},n):{};let c;for(let u of Reflect.ownKeys(s)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Cn.test(u)&&l.issues.length){let m=t.keyType._zod.run({value:Number(u),issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(l=m)}if(l.issues.length){t.mode==="loose"?o.value[u]=s[u]:a?(c=c??[],c.push(u)):o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(m=>Nt(m,n,vt())),input:u,path:[u],inst:e});continue}let p=l.value;if(p==="__proto__")continue;let g=t.valueType._zod.run({value:s[u],issues:[]},n);g instanceof Promise?i.push(g.then(m=>{m.issues.length&&o.issues.push(...Kt(u,m.issues)),o.value[p]=m.value})):(g.issues.length&&o.issues.push(...Kt(u,g.issues)),o.value[p]=g.value)}c&&c.length>0&&o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c,continue:!0})}return i.length?Promise.all(i).then(()=>o):o}});var Lh=M("$ZodEnum",(e,t)=>{ke.init(e,t);let r=ho(t.entries),o=new Set(r);e._zod.values=o,Se(e,"pattern",n=>{let s=ho(n.def.entries).filter(i=>Lu.has(typeof i));return new RegExp(s.length?`^(${s.map(i=>Bt(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let i=n.value;return o.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),Dh=M("$ZodLiteral",(e,t)=>{ke.init(e,t);let r=new Set(t.values);e._zod.values=r,Se(e,"pattern",o=>{let n=o.def.values;return new RegExp(n.length?`^(${n.map(s=>typeof s=="string"?Bt(s):s?Bt(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,n)=>{let s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var Uh=M("$ZodTransform",(e,t)=>{ke.init(e,t),e._zod.optin="optional",_t.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new So(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(r.value=i,r));if(n instanceof Promise)throw new jt;return r.value=n,r}});function Jf(e,t){return e.value=t.issues.length?void 0:t.value,e}var ll=M("$ZodOptional",(e,t)=>{ke.init(e,t),Se(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Se(e,"values",r=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),Se(e,"pattern",r=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${kn(o.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let n=t.innerType._zod.run({value:r.value,issues:[]},o);return n instanceof Promise?n.then(s=>Jf(r,s)):Jf(r,n)}return t.innerType._zod.run(r,o)}}),Fh=M("$ZodExactOptional",(e,t)=>{ll.init(e,t),Se(e,"values",r=>r.def.innerType._zod.values),Se(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Vh=M("$ZodNullable",(e,t)=>{ke.init(e,t),Se(e,"optin",r=>r.def.innerType._zod.optin),Se(e,"optout",r=>r.def.innerType._zod.optout),Se(e,"pattern",r=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${kn(o.source)}|null)$`):void 0}),Se(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),Jh=M("$ZodDefault",(e,t)=>{ke.init(e,t),e._zod.optin="defaulted",Se(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>Hf(s,t)):Hf(n,t)}});function Hf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Hh=M("$ZodPrefault",(e,t)=>{ke.init(e,t),e._zod.optin="defaulted",Se(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),Bh=M("$ZodNonOptional",(e,t)=>{ke.init(e,t),Se(e,"values",r=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>Bf(s,e)):Bf(n,e)}});function Bf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Kf(e,t,r,o){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(n=>Nt(n,o,vt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Kh=M("$ZodCatch",(e,t)=>{ke.init(e,t),Se(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Se(e,"optout",r=>r.def.innerType._zod.optout),Se(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);return n instanceof Promise?n.then(s=>Kf(r,s,t,o)):Kf(r,n,t,o)}});var dl=M("$ZodPipe",(e,t)=>{ke.init(e,t),Se(e,"values",r=>r.def.in._zod.values),Se(e,"optin",r=>r.def.in._zod.optin),Se(e,"optout",r=>r.def.out._zod.optout),Se(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);return s instanceof Promise?s.then(i=>zi(i,t.in,o)):zi(s,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(s=>zi(s,t.out,o)):zi(n,t.out,o)}});function zi(e,t,r){return e.issues.some(o=>o.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var Gh=M("$ZodPreprocess",(e,t)=>{dl.init(e,t)}),Wh=M("$ZodReadonly",(e,t)=>{ke.init(e,t),Se(e,"propValues",r=>r.def.innerType._zod.propValues),Se(e,"values",r=>r.def.innerType._zod.values),Se(e,"optin",r=>r.def.innerType?._zod?.optin),Se(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Gf):Gf(n)}});function Gf(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Yh=M("$ZodLazy",(e,t)=>{ke.init(e,t),Au(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),Se(e,"pattern",r=>r.innerType?._zod?.pattern),Se(e,"propValues",r=>r.innerType?._zod?.propValues),Se(e,"optin",r=>r.innerType?._zod?.optin??void 0),Se(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Xh=M("$ZodCustom",(e,t)=>{nt.init(e,t),ke.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(s=>Wf(s,r,o,e));Wf(n,r,o,e)}});function Wf(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(yo(n))}}var ml=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},fl="~memo",Qh=[];function eg(e){return e!==null&&typeof e=="object"}function pl(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var tg=new WeakMap,jn=0,xi=1,An=2;function Ti(e,t,r){let o=tg.get(e);if(o!==void 0)return o?An:jn;if(t.has(e))return An;t.add(e);let n=jn,s=l=>{if(n!==An&&l?._zod){let d=Ti(l,t,r);d>n&&(n=d)}},i=(l,d)=>{let p=jn;for(let g of Reflect.ownKeys(l)){let m=Object.getOwnPropertyDescriptor(l,g);if(d&&!m.enumerable)continue;let v=m.get?xi:m.value?._zod?Ti(m.value,t,r):jn;v>p&&(p=v)}return p},a=l=>{l>n&&(n=l)},c=e._zod.def,u=c.type;switch(u){case"object":{let l=vo(c);a(l?i(l,!0):xi),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(let l of c.items)s(l);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(let l of c.options)s(l);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?Ti(l,t,!1):xi);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let l in c){let d=Object.getOwnPropertyDescriptor(c,l);if(!d||d.get)continue;let p=d.value;if(!(!p||typeof p!="object")){if(p._zod)s(p);else if(Array.isArray(p))for(let g of p)s(g)}}}return t.delete(e),tw(e,n)}function tw(e,t){return t!==xi&&tg.set(e,t===An),t}function rw(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var Ei,ki=[],ow={alloc(e,t,r){let o=Ei;if(!o)return r;Ei=void 0;let n={value:r,issues:null};return o.set(t.value,n),ki.push(n),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,o=(n,s)=>{if(s.direction!=="backward"&&nw(s,n.value))throw new ml;return r(n,s)};e._zod.parse=o,e._zod.run===r&&(e._zod.run=o)})},attach(e){var t;let r,o=!1,n,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let i=e._zod.parse,a=(c,u)=>{if(r===void 0){let f=Ti(e,new Set,!1);if(f===jn)return e._zod.parse=i,e._zod.run===a&&(e._zod.run=i),i(c,u);f===An||o?r=!0:o=!0}let l=c.value;if(!eg(l))return i(c,u);let d=u[fl];d||(d={buckets:new WeakMap,backEdges:void 0},u[fl]=d);let p;n===u?p=s:(p=rw(d,e),n=u,s=p);let g=p.get(l);if(g)return c.value=g.value,g.issues?g.issues.length&&c.issues.push(...pl(g.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(g.value)),c;Ei=p;let m=ki.length,v=i(c,u);Ei=void 0;let h=ki.length>m?ki.pop():void 0;return v instanceof Promise?v.then(f=>(h&&(h.issues=f.issues.length?pl(f.issues):Qh),f)):(h&&(h.issues=v.issues.length?pl(v.issues):Qh),v)};e._zod.parse=a,e._zod.run===i&&(e._zod.run=a)})}};function hl(){return ow}function nw(e,t){let r=e[fl]?.backEdges;return r!==void 0&&eg(t)&&r.has(t)}var sw=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};function n(s,i){return s==="number"&&typeof i=="number"&&!Number.isFinite(i)?String(i):o[s]??s}return s=>{switch(s.code){case"invalid_type":{let i=n(s.expected),a=Fu(s.input),c=n(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${li(s.values[0])}`:`Invalid option: expected one of ${ci(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",a=t(s.origin);return a?`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",a=t(s.origin);return a?`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`:`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${ci(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(a=>`'${a}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function rg(){return{localeError:sw()}}var og;var gl=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ng(){return new gl}(og=globalThis).__zod_globalRegistry??(og.__zod_globalRegistry=ng());var mr=globalThis.__zod_globalRegistry;function Ii(e){return e.checks&&(e.checks=[...e.checks]),e}function sg(e,t){return new e(Ii({type:"string",...re(t)}))}function ig(e,t){return new e(Ii({type:"string",coerce:!0,...re(t)}))}function ag(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...re(t)})}function cg(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...re(t)})}function ug(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...re(t)})}function lg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...re(t)})}function dg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...re(t)})}function pg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...re(t)})}function _l(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...re(t)})}function mg(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...re(t)})}function fg(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...re(t)})}function hg(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...re(t)})}function gg(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...re(t)})}function _g(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...re(t)})}function vg(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...re(t)})}function yg(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...re(t)})}function Sg(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...re(t)})}function bg(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...re(t)})}function zg(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...re(t)})}function $g(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...re(t)})}function wg(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...re(t)})}function Rg(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...re(t)})}function Pg(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...re(t)})}function Eg(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...re(t)})}function Oi(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...re(t)})}function Ci(e,t){return new e({type:"string",format:"date",check:"string_format",...re(t)})}function Ni(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...re(t)})}function ji(e,t){return new e({type:"string",format:"duration",check:"string_format",...re(t)})}function kg(e,t){return new e(Ii({type:"number",checks:[],...re(t)}))}function xg(e,t){return new e(Ii({type:"number",coerce:!0,checks:[],...re(t)}))}function Tg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...re(t)})}function Ig(e,t){return new e({type:"boolean",...re(t)})}function Og(e,t){return new e({type:"boolean",coerce:!0,...re(t)})}function Cg(e,t){return new e({type:"bigint",coerce:!0,...re(t)})}function Ng(e,t){return new e({type:"null",...re(t)})}function jg(e){return new e({type:"any"})}function Ag(e){return new e({type:"unknown"})}function Mg(e,t){return new e({type:"never",...re(t)})}function qg(e,t){return new e({type:"date",coerce:!0,...re(t)})}function zo(e,t){return new ol({check:"less_than",...re(t),value:e,inclusive:!1})}function Gt(e,t){return new ol({check:"less_than",...re(t),value:e,inclusive:!0})}function $o(e,t){return new nl({check:"greater_than",...re(t),value:e,inclusive:!1})}function Wt(e,t){return new nl({check:"greater_than",...re(t),value:e,inclusive:!0})}function Mn(e,t){return new Ef({check:"multiple_of",...re(t),value:e})}function Ai(e,t){return new xf({check:"max_length",...re(t),maximum:e})}function wo(e,t){return new Tf({check:"min_length",...re(t),minimum:e})}function Mi(e,t){return new If({check:"length_equals",...re(t),length:e})}function vl(e,t){return new Of({check:"string_format",format:"regex",...re(t),pattern:e})}function yl(e){return new Cf({check:"string_format",format:"lowercase",...re(e)})}function Sl(e){return new Nf({check:"string_format",format:"uppercase",...re(e)})}function bl(e,t){return new jf({check:"string_format",format:"includes",...re(t),includes:e})}function zl(e,t){return new Af({check:"string_format",format:"starts_with",...re(t),prefix:e})}function $l(e,t){return new Mf({check:"string_format",format:"ends_with",...re(t),suffix:e})}function fr(e){return new qf({check:"overwrite",tx:e})}function wl(e){return fr(t=>t.normalize(e))}function Rl(){return fr(e=>e.trim())}function Pl(){return fr(e=>e.toLowerCase())}function El(){return fr(e=>e.toUpperCase())}function kl(){return fr(e=>qu(e))}function Zg(e,t,r){return new e({type:"array",element:t,...re(r)})}function Lg(e,t,r){return new e({type:"custom",check:"custom",fn:t,...re(r)})}function Dg(e,t){let r=iw(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(yo(n,o.value,r._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=o.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(yo(s))}},e(o.value,o)),t);return r}function iw(e,t){let r=new nt({check:"custom",...re(t)});return r._zod.check=e,r}function qn(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,o)&&zt(e,o,r[o]);return e}function Tl(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??mr,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function At(e,t,r,o,n){let s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:o.path,message:n}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(n);return Object.assign(r,s),!0}function Je(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{let p=i.schema,g=t.processors[n.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);g(e,t,p,l)}let d=e._zod.parent;d&&(i.ref||(i.ref=d),Je(d,t,l),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&qn(i.schema,c),t.io==="input"&&mt(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Ug(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Il(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let i of e.seen.entries()){let a=e.metadataRegistry.get(i[0])?.id;if(a){let c=o.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}let n=i=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(i[0])?.id,p=e.external.uri??(m=>m);if(d)return{ref:p(d)};let g=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=g,{defId:g,ref:`${p("__shared")}#/${a}/${Ug(g)}`}}let c="#",u=`${c}/${a}/`;if(i[1]===r&&!i[1].schema.id)return{ref:c};let l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+Ug(l)}},s=i=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=n(i);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
55
+ `)}return m.write("payload.value = newResult;"),m.write("return payload;"),m.compile()},i,a=Qr,c=!vt.jitless,l=c&&nl.value,d=t.catchall,p;e._zod.parse=(g,f)=>{p??(p=o.value);let _=g.value;return a(_)?c&&l&&f?.async===!1&&f.jitless!==!0?(i||(i=s(t.shape)),g=i(g,f),d?Xh([],_,g,f,p,e,f?.abortEarly===!0):g):r(g,f):(g.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),g)}});function ih(e,t,r,o){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter(s=>!At(s));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>Mt(i,o,yt())))}),t)}var kl=q("$ZodUnion",(e,t)=>{ke.init(e,t),Se(e,"optin",o=>o.def.options.some(n=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some(n=>n._zod.optin!==void 0)?"optional":void 0),Se(e,"optout",o=>o.def.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Se(e,"values",o=>{if(o.def.options.every(n=>n._zod.values))return new Set(o.def.options.flatMap(n=>Array.from(n._zod.values)))}),Se(e,"pattern",o=>{if(o.def.options.every(n=>n._zod.pattern)){let n=o.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${n.map(s=>Dn(s.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,i=[];for(let a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>ih(a,o,e,n)):ih(i,o,e,n)}});function qw(e){let t=new Map;for(let r of e.options){let o=r._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let n of o)if(t.has(n)){if(n!==void 0)throw new Error(`Duplicate discriminator value "${String(n)}"`);t.set(n,null)}else t.set(n,r)}return t}var eg=q("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,kl.init(e,t);let r=e._zod.parse;Se(e,"propValues",n=>{let s={},i=0;for(let a of n.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${n.def.options.indexOf(a)}"`);c[n.def.discriminator]?.has(void 0)&&i++;for(let[u,l]of Object.entries(c)){Object.prototype.hasOwnProperty.call(s,u)||$t(s,u,new Set);for(let d of l)s[u].add(d)}}return!n.def.unionFallback&&i>1&&s[n.def.discriminator]?.delete(void 0),s}),t.options.forEach((n,s)=>{let i=To(n._zod.def);if(i&&!Object.prototype.hasOwnProperty.call(i,t.discriminator))throw new Error(`Invalid discriminated union option at index "${s}"`)});let o=xo(()=>qw(t));e._zod.parse=(n,s)=>{let i=n.value;if(!Qr(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let a=i?.[t.discriminator],c=o.value.get(a);return c&&(a!==void 0||s.direction!=="backward")?c._zod.run(n,s):t.unionFallback||s.direction==="backward"?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()).filter(u=>o.value.get(u)!==null),input:i,path:[t.discriminator],inst:e}),n)}}),tg=q("$ZodIntersection",(e,t)=>{ke.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,s=t.left._zod.run({value:n,issues:[]},o),i=t.right._zod.run({value:n,issues:[]},o);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>ah(r,c,u)):ah(r,s,i)}});function wl(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Sr(e)&&Sr(t)){let r=Object.keys(t),o=Object.keys(e).filter(s=>r.indexOf(s)!==-1),n={...e,...t};Object.prototype.hasOwnProperty.call(n,"__proto__")&&delete n.__proto__;for(let s of o){if(s==="__proto__")continue;let i=wl(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],s=t[o],i=wl(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function ah(e,t,r){let o=new Map,n,s=new Map,i=(u,l)=>{let d;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let p=String(u.path[0]);s.has(p)||s.set(p,u),d=[p]}else return!1;for(let p of d)o.has(p)||o.set(p,{}),o.get(p)[l]=!0;return!0};for(let u of t.issues)i(u,"l")||e.issues.push(u);for(let u of r.issues)i(u,"r")||e.issues.push(u);let a=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=n?a.filter(l=>n.keys.includes(l)):[];u.length&&e.issues.push({...n,keys:u});for(let l of a)!u.includes(l)&&s.has(l)&&e.issues.push(s.get(l))}let c=wl(t.value,r.value);if(!c.valid){if(At(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var rg=q("$ZodRecord",(e,t)=>{ke.init(e,t);let r=vt.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Sr(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;let i=[],a=t.keyType._zod.values;if(a&&!t.partial){o.value=r?r.alloc(e,o,{},n):{};let c=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(c.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;let d=t.keyType._zod.run({value:l,issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>Mt(f,n,yt())),input:l,path:[l],inst:e});continue}let p=d.value;if(p==="__proto__")continue;let g=t.valueType._zod.run({value:s[l],issues:[]},n);g instanceof Promise?i.push(g.then(f=>{f.issues.length&&o.issues.push(...or(l,f.issues)),o.value[p]=f.value})):(g.issues.length&&o.issues.push(...or(l,g.issues)),o.value[p]=g.value)}let u;for(let l in s)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;o.value[l]=s[l]}else u=u??[],u.push(l);u&&u.length>0&&o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u,continue:!0})}else{o.value=r?r.alloc(e,o,{},n):{};let c;for(let u of Reflect.ownKeys(s)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Hn.test(u)&&l.issues.length){let f=t.keyType._zod.run({value:Number(u),issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(l=f)}if(l.issues.length){t.mode==="loose"?o.value[u]=s[u]:a?(c=c??[],c.push(u)):o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>Mt(f,n,yt())),input:u,path:[u],inst:e});continue}let p=l.value;if(p==="__proto__")continue;let g=t.valueType._zod.run({value:s[u],issues:[]},n);g instanceof Promise?i.push(g.then(f=>{f.issues.length&&o.issues.push(...or(u,f.issues)),o.value[p]=f.value})):(g.issues.length&&o.issues.push(...or(u,g.issues)),o.value[p]=g.value)}c&&c.length>0&&o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c,continue:!0})}return i.length?Promise.all(i).then(()=>o):o}});var og=q("$ZodEnum",(e,t)=>{ke.init(e,t);let r=Eo(t.entries),o=new Set(r);e._zod.values=o,Se(e,"pattern",n=>{let s=Eo(n.def.entries).filter(i=>sl.has(typeof i));return new RegExp(s.length?`^(${s.map(i=>rr(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let i=n.value;return o.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),ng=q("$ZodLiteral",(e,t)=>{ke.init(e,t);let r=new Set(t.values);e._zod.values=r,Se(e,"pattern",o=>{let n=o.def.values;return new RegExp(n.length?`^(${n.map(s=>typeof s=="string"?rr(s):s?rr(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,n)=>{let s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var sg=q("$ZodTransform",(e,t)=>{ke.init(e,t),e._zod.optin="optional",vt.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Oo(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(r.value=i,r));if(n instanceof Promise)throw new qt;return r.value=n,r}});function ch(e,t){return e.value=t.issues.length?void 0:t.value,e}var xl=q("$ZodOptional",(e,t)=>{ke.init(e,t),Se(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Se(e,"values",r=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),Se(e,"pattern",r=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${Dn(o.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let n=t.innerType._zod.run({value:r.value,issues:[]},o);return n instanceof Promise?n.then(s=>ch(r,s)):ch(r,n)}return t.innerType._zod.run(r,o)}}),ig=q("$ZodExactOptional",(e,t)=>{xl.init(e,t),Se(e,"values",r=>r.def.innerType._zod.values),Se(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),ag=q("$ZodNullable",(e,t)=>{ke.init(e,t),Se(e,"optin",r=>r.def.innerType._zod.optin),Se(e,"optout",r=>r.def.innerType._zod.optout),Se(e,"pattern",r=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${Dn(o.source)}|null)$`):void 0}),Se(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),cg=q("$ZodDefault",(e,t)=>{ke.init(e,t),e._zod.optin="defaulted",Se(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>uh(s,t)):uh(n,t)}});function uh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ug=q("$ZodPrefault",(e,t)=>{ke.init(e,t),e._zod.optin="defaulted",Se(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),lg=q("$ZodNonOptional",(e,t)=>{ke.init(e,t),Se(e,"values",r=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>lh(s,e)):lh(n,e)}});function lh(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function dh(e,t,r,o){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(n=>Mt(n,o,yt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var dg=q("$ZodCatch",(e,t)=>{ke.init(e,t),Se(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Se(e,"optout",r=>r.def.innerType._zod.optout),Se(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);return n instanceof Promise?n.then(s=>dh(r,s,t,o)):dh(r,n,t,o)}});var Tl=q("$ZodPipe",(e,t)=>{ke.init(e,t),Se(e,"values",r=>r.def.in._zod.values),Se(e,"optin",r=>r.def.in._zod.optin),Se(e,"optout",r=>r.def.out._zod.optout),Se(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);return s instanceof Promise?s.then(i=>Zi(i,t.in,o)):Zi(s,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(s=>Zi(s,t.out,o)):Zi(n,t.out,o)}});function Zi(e,t,r){return e.issues.some(o=>o.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var pg=q("$ZodPreprocess",(e,t)=>{Tl.init(e,t)}),mg=q("$ZodReadonly",(e,t)=>{ke.init(e,t),Se(e,"propValues",r=>r.def.innerType._zod.propValues),Se(e,"values",r=>r.def.innerType._zod.values),Se(e,"optin",r=>r.def.innerType?._zod?.optin),Se(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(ph):ph(n)}});function ph(e){return e.memo||(e.value=Object.freeze(e.value)),e}var fg=q("$ZodLazy",(e,t)=>{ke.init(e,t),tl(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),Se(e,"pattern",r=>r.innerType?._zod?.pattern),Se(e,"propValues",r=>r.innerType?._zod?.propValues),Se(e,"optin",r=>r.innerType?._zod?.optin??void 0),Se(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),hg=q("$ZodCustom",(e,t)=>{st.init(e,t),ke.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(s=>mh(s,r,o,e));mh(n,r,o,e)}});function mh(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(Io(n))}}var Ol=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Cl="~memo",gg=[];function _g(e){return e!==null&&typeof e=="object"}function Il(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var vg=new WeakMap,Kn=0,Hi=1,Gn=2;function Bi(e,t,r){let o=vg.get(e);if(o!==void 0)return o?Gn:Kn;if(t.has(e))return Gn;t.add(e);let n=Kn,s=l=>{if(n!==Gn&&l?._zod){let d=Bi(l,t,r);d>n&&(n=d)}},i=(l,d)=>{let p=Kn;for(let g of Reflect.ownKeys(l)){let f=Object.getOwnPropertyDescriptor(l,g);if(d&&!f.enumerable)continue;let _=f.get?Hi:f.value?._zod?Bi(f.value,t,r):Kn;_>p&&(p=_)}return p},a=l=>{l>n&&(n=l)},c=e._zod.def,u=c.type;switch(u){case"object":{let l=To(c);a(l?i(l,!0):Hi),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(let l of c.items)s(l);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(let l of c.options)s(l);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?Bi(l,t,!1):Hi);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let l in c){let d=Object.getOwnPropertyDescriptor(c,l);if(!d||d.get)continue;let p=d.value;if(!(!p||typeof p!="object")){if(p._zod)s(p);else if(Array.isArray(p))for(let g of p)s(g)}}}return t.delete(e),Zw(e,n)}function Zw(e,t){return t!==Hi&&vg.set(e,t===Gn),t}function Lw(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var Vi,Ji=[],Dw={alloc(e,t,r){let o=Vi;if(!o)return r;Vi=void 0;let n={value:r,issues:null};return o.set(t.value,n),Ji.push(n),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,o=(n,s)=>{if(s.direction!=="backward"&&Uw(s,n.value))throw new Ol;return r(n,s)};e._zod.parse=o,e._zod.run===r&&(e._zod.run=o)})},attach(e){var t;let r,o=!1,n,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let i=e._zod.parse,a=(c,u)=>{if(r===void 0){let h=Bi(e,new Set,!1);if(h===Kn)return e._zod.parse=i,e._zod.run===a&&(e._zod.run=i),i(c,u);h===Gn||o?r=!0:o=!0}let l=c.value;if(!_g(l))return i(c,u);let d=u[Cl];d||(d={buckets:new WeakMap,backEdges:void 0},u[Cl]=d);let p;n===u?p=s:(p=Lw(d,e),n=u,s=p);let g=p.get(l);if(g)return c.value=g.value,g.issues?g.issues.length&&c.issues.push(...Il(g.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(g.value)),c;Vi=p;let f=Ji.length,_=i(c,u);Vi=void 0;let m=Ji.length>f?Ji.pop():void 0;return _ instanceof Promise?_.then(h=>(m&&(m.issues=h.issues.length?Il(h.issues):gg),h)):(m&&(m.issues=_.issues.length?Il(_.issues):gg),_)};e._zod.parse=a,e._zod.run===i&&(e._zod.run=a)})}};function Nl(){return Dw}function Uw(e,t){let r=e[Cl]?.backEdges;return r!==void 0&&_g(t)&&r.has(t)}var Fw=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};function n(s,i){return s==="number"&&typeof i=="number"&&!Number.isFinite(i)?String(i):o[s]??s}return s=>{switch(s.code){case"invalid_type":{let i=n(s.expected),a=cl(s.input),c=n(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${Ei(s.values[0])}`:`Invalid option: expected one of ${Ri(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",a=t(s.origin);return a?`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",a=t(s.origin);return a?`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`:`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${Ri(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(a=>`'${a}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function yg(){return{localeError:Fw()}}var Sg;var jl=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function bg(){return new jl}(Sg=globalThis).__zod_globalRegistry??(Sg.__zod_globalRegistry=bg());var br=globalThis.__zod_globalRegistry;function Ki(e){return e.checks&&(e.checks=[...e.checks]),e}function zg(e,t){return new e(Ki({type:"string",...re(t)}))}function $g(e,t){return new e(Ki({type:"string",coerce:!0,...re(t)}))}function wg(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...re(t)})}function Rg(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...re(t)})}function Pg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...re(t)})}function Eg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...re(t)})}function kg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...re(t)})}function xg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...re(t)})}function Al(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...re(t)})}function Tg(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...re(t)})}function Ig(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...re(t)})}function Og(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...re(t)})}function Cg(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...re(t)})}function Ng(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...re(t)})}function jg(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...re(t)})}function Ag(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...re(t)})}function Mg(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...re(t)})}function qg(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...re(t)})}function Zg(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...re(t)})}function Lg(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...re(t)})}function Dg(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...re(t)})}function Ug(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...re(t)})}function Fg(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...re(t)})}function Vg(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...re(t)})}function Gi(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...re(t)})}function Wi(e,t){return new e({type:"string",format:"date",check:"string_format",...re(t)})}function Yi(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...re(t)})}function Xi(e,t){return new e({type:"string",format:"duration",check:"string_format",...re(t)})}function Jg(e,t){return new e(Ki({type:"number",checks:[],...re(t)}))}function Hg(e,t){return new e(Ki({type:"number",coerce:!0,checks:[],...re(t)}))}function Bg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...re(t)})}function Kg(e,t){return new e({type:"boolean",...re(t)})}function Gg(e,t){return new e({type:"boolean",coerce:!0,...re(t)})}function Wg(e,t){return new e({type:"bigint",coerce:!0,...re(t)})}function Yg(e,t){return new e({type:"null",...re(t)})}function Xg(e){return new e({type:"any"})}function Qg(e){return new e({type:"unknown"})}function e_(e,t){return new e({type:"never",...re(t)})}function t_(e,t){return new e({type:"date",coerce:!0,...re(t)})}function No(e,t){return new zl({check:"less_than",...re(t),value:e,inclusive:!1})}function nr(e,t){return new zl({check:"less_than",...re(t),value:e,inclusive:!0})}function jo(e,t){return new $l({check:"greater_than",...re(t),value:e,inclusive:!1})}function sr(e,t){return new $l({check:"greater_than",...re(t),value:e,inclusive:!0})}function Wn(e,t){return new Vf({check:"multiple_of",...re(t),value:e})}function Qi(e,t){return new Hf({check:"max_length",...re(t),maximum:e})}function Ao(e,t){return new Bf({check:"min_length",...re(t),minimum:e})}function ea(e,t){return new Kf({check:"length_equals",...re(t),length:e})}function Ml(e,t){return new Gf({check:"string_format",format:"regex",...re(t),pattern:e})}function ql(e){return new Wf({check:"string_format",format:"lowercase",...re(e)})}function Zl(e){return new Yf({check:"string_format",format:"uppercase",...re(e)})}function Ll(e,t){return new Xf({check:"string_format",format:"includes",...re(t),includes:e})}function Dl(e,t){return new Qf({check:"string_format",format:"starts_with",...re(t),prefix:e})}function Ul(e,t){return new eh({check:"string_format",format:"ends_with",...re(t),suffix:e})}function zr(e){return new th({check:"overwrite",tx:e})}function Fl(e){return zr(t=>t.normalize(e))}function Vl(){return zr(e=>e.trim())}function Jl(){return zr(e=>e.toLowerCase())}function Hl(){return zr(e=>e.toUpperCase())}function Bl(){return zr(e=>ol(e))}function r_(e,t,r){return new e({type:"array",element:t,...re(r)})}function o_(e,t,r){return new e({type:"custom",check:"custom",fn:t,...re(r)})}function n_(e,t){let r=Vw(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Io(n,o.value,r._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=o.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(Io(s))}},e(o.value,o)),t);return r}function Vw(e,t){let r=new st({check:"custom",...re(t)});return r._zod.check=e,r}function Yn(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,o)&&$t(e,o,r[o]);return e}function Gl(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??br,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Zt(e,t,r,o,n){let s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:o.path,message:n}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(n);return Object.assign(r,s),!0}function Je(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{let p=i.schema,g=t.processors[n.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);g(e,t,p,l)}let d=e._zod.parent;d&&(i.ref||(i.ref=d),Je(d,t,l),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Yn(i.schema,c),t.io==="input"&&ft(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function s_(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Wl(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let i of e.seen.entries()){let a=e.metadataRegistry.get(i[0])?.id;if(a){let c=o.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}let n=i=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(i[0])?.id,p=e.external.uri??(f=>f);if(d)return{ref:p(d)};let g=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=g,{defId:g,ref:`${p("__shared")}#/${a}/${s_(g)}`}}let c="#",u=`${c}/${a}/`;if(i[1]===r&&!i[1].schema.id)return{ref:c};let l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+s_(l)}},s=i=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=n(i);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
56
56
 
57
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}a.count>1&&e.reused==="ref"&&s(i)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Jg(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let o of t){if(!o||typeof o!="object")return;Jg(o);let n=Object.keys(o);if(n.length!==1||n[0]!=="type")return;let s=o.type;for(let i of Array.isArray(s)?s:[s]){if(typeof i!="string")return;r.includes(i)||r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Hg=new Set(["type","properties","required","additionalProperties"]),Fg=["oneOf","anyOf"];function Vg(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function xl(e){let t=[];for(let s of e){if(typeof s!="object"||s.type!=="object")return null;for(let i in s)if(!Hg.has(i))return null;t.push(s)}let r={},o=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let a=[];for(let u of t){let l=u.properties?.[i]??Vg(u);l!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(l))||a.push(l))}let c=a.length===1?a[0]:xl(a)??{allOf:a};zt(r,i,c)}for(let i of s.required??[])o.add(i)}let n={type:"object",properties:r};if(o.size&&(n.required=[...o]),t.every(s=>s.additionalProperties===!1))n.additionalProperties=!1;else{let s=[];for(let i of t){let a=Vg(i);a&&!s.some(c=>JSON.stringify(c)===JSON.stringify(a))&&s.push(a)}s.length===1?n.additionalProperties=s[0]:s.length>1&&(n.additionalProperties={allOf:s})}return n}function aw(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of Hg)if(n in e)return;let r=t.filter(n=>Fg.some(s=>Array.isArray(n[s]))),o=null;if(!r.length)o=xl(t);else{let n=r[0],s=Fg.find(c=>Array.isArray(n[c]));if(Object.keys(n).length!==1)return;let i=t.filter(c=>c!==n),a=n[s].map(c=>xl([...i,c]));if(a.some(c=>!c))return;o={[s]:a}}o&&(delete e.allOf,qn(e,o))}function Ol(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);let g=e.seen.get(d),m=g.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):qn(u,m),qn(u,l),a._zod.parent===d)for(let h in u)h==="$ref"||h==="allOf"||h in l||delete u[h];if(m.$ref&&g.def)for(let h in u)h==="$ref"||h==="allOf"||h in g.def&&JSON.stringify(u[h])===JSON.stringify(g.def[h])&&delete u[h]}let p=a._zod.parent;if(p&&p!==d){o(p);let g=e.seen.get(p);if(g?.schema.$ref&&(u.$ref=g.schema.$ref,g.def))for(let m in u)m==="$ref"||m==="allOf"||m in g.def&&JSON.stringify(u[m])===JSON.stringify(g.def[m])&&delete u[m]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())o(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())Jg(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=a.get(l);d?d.push(u):a.set(l,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])aw(u)}}let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}qn(n,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;s!==void 0&&n.id===s&&delete n.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,zt(i,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Zn(t,"input",e.processors),output:Zn(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function mt(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return mt(o.element,r);if(o.type==="set")return mt(o.valueType,r);if(o.type==="lazy")return mt(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return mt(o.innerType,r);if(o.type==="intersection")return mt(o.left,r)||mt(o.right,r);if(o.type==="record"||o.type==="map")return mt(o.keyType,r)||mt(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:mt(o.in,r)||mt(o.out,r);if(o.type==="object"){for(let n in o.shape)if(mt(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(mt(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(mt(n,r))return!0;return!!(o.rest&&mt(o.rest,r))}return!1}var Bg=(e,t={})=>r=>{let o=Tl({...r,processors:t});return Je(e,o),Il(o,e),Ol(o,e)},Zn=(e,t,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=Tl({...n??{},target:s,io:t,processors:r});return Je(e,i),Il(i,e),Ol(i,e)};var Ro=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},Po=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},Kg=(e,t)=>{Ro(e,"minimum",t),Po(e,"maximum",t)},Xg=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},Qg=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},e_=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},t_=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},Gg=(e,t)=>Ro(e,"minimum",t.minimum),Wg=(e,t)=>Po(e,"maximum",t.maximum),Yg=e=>(t,r)=>{t_(t,r.format);let[o,n]=e[r.format];Ro(t,"minimum",o),Po(t,"maximum",n)},cw={greater_than:(e,t)=>Ro(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Po(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Xg(e,t.value),number_format:Yg(xn),bigint_format:Yg(di),min_length:Gg,max_length:Wg,length_equals:(e,t)=>Kg(e,t.length),min_size:Gg,max_size:Wg,size_equals:(e,t)=>Kg(e,t.size),string_format:(e,t)=>{t_(e,t.format),t.pattern&&Qg(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>e_(e,t.mime)};function st(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)cw[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;n.minimum!==void 0&&Ro(t,"minimum",n.minimum),n.exclusiveMinimum!==void 0&&Ro(t,"exclusiveMinimum",n.exclusiveMinimum),n.maximum!==void 0&&Po(t,"maximum",n.maximum),n.exclusiveMaximum!==void 0&&Po(t,"exclusiveMaximum",n.exclusiveMaximum),n.multipleOf!==void 0&&Xg(t,n.multipleOf),n.format!==void 0&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&e_(t,n.mime);for(let s of n.patterns??[])Qg(t,s);return t}var uw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lw=new Map([[al,mf],[Pi,ff]]),r_=e=>lw.get(e)??e,o_=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:l}=st(e);if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),a&&(n.format=uw[a]??a,n.format===""&&delete n.format,(a==="time"||l)&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let d=[...c].map(r_);d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},n_=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=st(e);n.type=l?"integer":"number";let d=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(i??Number.POSITIVE_INFINITY),g=t.target==="draft-04"||t.target==="openapi-3.0";if(d?g?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof s=="number"&&(n.minimum=s),p?g?(n.maximum=c,n.exclusiveMaximum=!0):n.exclusiveMaximum=c:typeof i=="number"&&(n.maximum=i),a){let m=new Set;for(let f of a)Number.isFinite(f)&&f!==0?m.add(Math.abs(f)):At(e,t,n,o,`A multipleOf divisor of ${f} cannot be represented in JSON Schema`);let[v,...h]=m;v!==void 0&&(n.multipleOf=v),h.length&&(n.allOf=[...n.allOf??[],...h.map(f=>({multipleOf:f}))])}},s_=(e,t,r,o)=>{r.type="boolean"},i_=(e,t,r,o)=>{At(e,t,r,o,"BigInt cannot be represented in JSON Schema")};var a_=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var c_=(e,t,r,o)=>{r.not={}},u_=(e,t,r,o)=>{},l_=(e,t,r,o)=>{},d_=(e,t,r,o)=>{At(e,t,r,o,"Date cannot be represented in JSON Schema")},p_=(e,t,r,o)=>{let n=e._zod.def,s=ho(n.entries);if(s.length===0){r.not={};return}s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},m_=(e,t,r,o)=>{let n=e._zod.def;if(n.values.length===0){r.not={};return}let s=[];for(let i of n.values)if(i===void 0){if(At(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i=="bigint"){if(At(e,t,r,o,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s};var f_=(e,t,r,o)=>{At(e,t,r,o,"Custom types cannot be represented in JSON Schema")};var h_=(e,t,r,o)=>{At(e,t,r,o,"Transforms cannot be represented in JSON Schema")};var g_=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:a}=st(e);typeof i=="number"&&(n.minItems=i),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=Je(s.element,t,{...o,path:[...o.path,"items"]})};function qi(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?qi(t.out):t.type==="catch"?qi(t.innerType):e._zod.optin}var __=(e,t,r,o)=>{let n=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&At(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in i)zt(n.properties,u,Je(i[u],t,{...o,path:[...o.path,"properties",u]}));let c=[];for(let u of Object.keys(i)){let l=s.shape[u];(t.io==="input"?qi(l)===void 0:l._zod.optout===void 0)&&c.push(u)}c.length>0&&(n.required=c),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=Je(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},v_=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>Je(a,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},y_=(e,t,r,o)=>{let n=e._zod.def,s=Je(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=Je(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c,t.intersections.push(c)};function Cl(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let m=e.get(t)?.def;if(!m)return t;let v=Cl(e,m,r);return v===m?t:v}for(let m of["anyOf","oneOf"]){let v=t[m];if(!Array.isArray(v))continue;let h=v.map(f=>Cl(e,f,r));h.some((f,z)=>f!==v[z])&&(t={...t,[m]:h})}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some(m=>m==="number"||m==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some(m=>typeof m=="number"))return t;let{minimum:i,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:p,...g}=t;return g.enum?g.enum=g.enum.map(m=>typeof m=="number"?String(m):m):typeof g.const=="number"&&(g.const=String(g.const)),n&&(g.type="string",s||(g.pattern=(o.includes("number")?Cn:tl).source)),g}var Nl=new WeakMap;function dw(e){let t=new Map;for(let o of e.seen.values())o.def&&!t.has(o.schema)&&t.set(o.schema,o);let r=new Map;for(let o of Nl.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=Cl(t,s,new Set);i!==s&&r.set(s,i)}if(r.size)for(let o of e.seen.values())for(let n of[o.schema,o.def]){let s=n&&r.get(n.propertyNames);s&&(n.propertyNames=s)}}var S_=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,a=st(i).patterns;if(s.mode==="loose"&&a&&a.size>0){let l=Je(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of a)zt(n.patternProperties,r_(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=Je(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});let l=Nl.get(t);l||(l=[],Nl.set(t,l),t.deferred.push(()=>dw(t))),l.push(e)}n.additionalProperties=Je(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let c=i._zod.values,u=t.io==="input"&&qi(s.valueType)!==void 0;if(c&&!s.partial&&!u){let l=[...c].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l.map(String))}},b_=(e,t,r,o)=>{let n=e._zod.def,s=Je(n.innerType,t,o),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},z_=(e,t,r,o)=>{let n=e._zod.def;Je(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},jl=Symbol();function $_(e,t,r,o,n){let s=!1,i=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(s=!0,null));return s?(At(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),jl):JSON.parse(i)}var w_=(e,t,r,o)=>{let n=e._zod.def;Je(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i=$_(n.defaultValue,e,t,r,o);i!==jl&&(r.default=i)},R_=(e,t,r,o)=>{let n=e._zod.def;Je(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io!=="input")return;let i=$_(n.defaultValue,e,t,r,o);i!==jl&&(r._prefault=i)},P_=(e,t,r,o)=>{let n=e._zod.def;Je(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{At(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},E_=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;Je(i,t,o);let a=t.seen.get(e);a.ref=i},k_=(e,t,r,o)=>{let n=e._zod.def;Je(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0};var Al=(e,t,r,o)=>{let n=e._zod.def;Je(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},x_=(e,t,r,o)=>{let n=e._zod.innerType;Je(n,t,o);let s=t.seen.get(e);s.ref=n};var T_=new WeakSet([Object.prototype,Error.prototype]);function Zi(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let o=r(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}var Sw=(e,t)=>{Dm.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);T_.has(r)||(T_.add(r),Zi(r,"format",o=>n=>Wu(o,n)),Zi(r,"flatten",o=>n=>Gu(o,n)),Zi(r,"addIssue",o=>n=>{o.issues.push(n),o.message=JSON.stringify(o.issues,go,2)}),Zi(r,"addIssues",o=>n=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,go,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))};var $t=M("ZodError",Sw,void 0,{Parent:Error});var I_=gi($t),O_=_i($t),C_=vi($t),N_=yi($t),j_=Fm($t),A_=Vm($t),M_=Jm($t),q_=Hm($t),Z_=Bm($t),L_=Km($t),D_=Gm($t),U_=Wm($t);function zw(){_t.localeError||vt(rg())}function Di(){_t.memoizer||vt({memoizer:hl()})}var xe=M("ZodType",(e,t)=>(zw(),ke.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ae.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return kt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(dR(e,t))},superRefine(e,t){return this.check(pR(e,t))},overwrite(e){return this.check(fr(e))},optional(){return Ze(this)},exactOptional(){return Yw(this)},nullable(){return J_(this)},nullish(){return Ze(J_(this))},nonoptional(e){return oR(this,e)},array(){return B(this)},or(e){return Ce([this,e])},and(e){return Fi(this,e)},transform(e){return H_(this,tv(e))},default(e){return eR(this,e)},prefault(e){return rR(this,e)},catch(e){return sR(this,e)},pipe(e){return H_(this,e)},readonly(){return cR(this)},describe(e){let t=this.clone();return mr.add(t,{description:e}),t},meta(...e){if(e.length===0)return mr.get(this);let t=this.clone();return mr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return ae.hide(this,"~standard",{...il(this),jsonSchema:{input:Zn(this,"input"),output:Zn(this,"output")}})},set"~standard"(e){ae.own(this,"~standard",e)},parse:function e(t,r){return I_(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await O_(this,t,r,{callee:e})},safeParse(e,t){return C_(this,e,t)},async safeParseAsync(e,t){return N_(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ae.own(this,"spa",e)},validate(e,t){return Yu(this,e,t)},validateAsync(e,t){return Xu(this,e,t)},encode:function e(t,r){return j_(this,t,r,{callee:e})},decode:function e(t,r){return A_(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await M_(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await q_(this,t,r,{callee:e})},safeEncode(e,t){return Z_(this,e,t)},safeDecode(e,t){return L_(this,e,t)},async safeEncodeAsync(e,t){return D_(this,e,t)},async safeDecodeAsync(e,t){return U_(this,e,t)},toJSONSchema(e){return Bg(this,{})(e)},get description(){return mr.get(this)?.description},get _def(){return this._zod.def}}),B_=M("_ZodString",(e,t)=>{Ri.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>o_(e,r,o,n)},ae.derived({format:e=>st(e).format??null,minLength:e=>st(e).minimum??null,maxLength:e=>st(e).maximum??null},{regex(...e){return this.check(vl(...e))},includes(...e){return this.check(bl(...e))},startsWith(...e){return this.check(zl(...e))},endsWith(...e){return this.check($l(...e))},min(...e){return this.check(wo(...e))},max(...e){return this.check(Ai(...e))},length(...e){return this.check(Mi(...e))},nonempty(...e){return this.check(wo(1,...e))},lowercase(e){return this.check(yl(e))},uppercase(e){return this.check(Sl(e))},trim(){return this.check(Rl())},normalize(...e){return this.check(wl(...e))},toLowerCase(){return this.check(Pl())},toUpperCase(){return this.check(El())},slugify(){return this.check(kl())}})),ql=M("ZodString",(e,t)=>{Ri.init(e,t),B_.init(e,t)},{email(e){return this.check(ag($w,e))},url(e){return this.check(_l(K_,e))},jwt(e){return this.check(Eg(Zw,e))},emoji(e){return this.check(mg(Rw,e))},guid(e){return this.check(cg(ww,e))},uuid(e){return this.check(ug(Li,e))},uuidv4(e){return this.check(lg(Li,e))},uuidv6(e){return this.check(dg(Li,e))},uuidv7(e){return this.check(pg(Li,e))},nanoid(e){return this.check(fg(Pw,e))},cuid(e){return this.check(hg(Ew,e))},cuid2(e){return this.check(gg(kw,e))},ulid(e){return this.check(_g(xw,e))},base64(e){return this.check(wg(Aw,e))},base64url(e){return this.check(Rg(Mw,e))},xid(e){return this.check(vg(Tw,e))},ksuid(e){return this.check(yg(Iw,e))},ipv4(e){return this.check(Sg(Ow,e))},ipv6(e){return this.check(bg(Cw,e))},cidrv4(e){return this.check(zg(Nw,e))},cidrv6(e){return this.check($g(jw,e))},e164(e){return this.check(Pg(qw,e))},datetime(e){return this.check(Oi(Ln,e))},date(e){return this.check(Ci(Dn,e))},time(e){return this.check(Ni(Un,e))},duration(e){return this.check(ji(Fn,e))}});function k(e){return sg(ql,e)}var Ve=M("ZodStringFormat",(e,t)=>{je.init(e,t),B_.init(e,t)}),Ln=M("ZodISODateTime",(e,t)=>{dh.init(e,t),Ve.init(e,t)}),Dn=M("ZodISODate",(e,t)=>{ph.init(e,t),Ve.init(e,t)}),Un=M("ZodISOTime",(e,t)=>{mh.init(e,t),Ve.init(e,t)}),Fn=M("ZodISODuration",(e,t)=>{fh.init(e,t),Ve.init(e,t)}),$w=M("ZodEmail",(e,t)=>{eh.init(e,t),Ve.init(e,t)});var ww=M("ZodGUID",(e,t)=>{Xf.init(e,t),Ve.init(e,t)});var Li=M("ZodUUID",(e,t)=>{Qf.init(e,t),Ve.init(e,t)});var K_=M("ZodURL",(e,t)=>{oh.init(e,t),Ve.init(e,t)});function G_(e){return _l(K_,e)}var Rw=M("ZodEmoji",(e,t)=>{nh.init(e,t),Ve.init(e,t)});var Pw=M("ZodNanoID",(e,t)=>{sh.init(e,t),Ve.init(e,t)});var Ew=M("ZodCUID",(e,t)=>{ih.init(e,t),Ve.init(e,t)});var kw=M("ZodCUID2",(e,t)=>{ah.init(e,t),Ve.init(e,t)});var xw=M("ZodULID",(e,t)=>{ch.init(e,t),Ve.init(e,t)});var Tw=M("ZodXID",(e,t)=>{uh.init(e,t),Ve.init(e,t)});var Iw=M("ZodKSUID",(e,t)=>{lh.init(e,t),Ve.init(e,t)});var Ow=M("ZodIPv4",(e,t)=>{hh.init(e,t),Ve.init(e,t)});var Cw=M("ZodIPv6",(e,t)=>{_h.init(e,t),Ve.init(e,t)});var Nw=M("ZodCIDRv4",(e,t)=>{vh.init(e,t),Ve.init(e,t)});var jw=M("ZodCIDRv6",(e,t)=>{yh.init(e,t),Ve.init(e,t)});var Aw=M("ZodBase64",(e,t)=>{bh.init(e,t),Ve.init(e,t)});var Mw=M("ZodBase64URL",(e,t)=>{zh.init(e,t),Ve.init(e,t)});var qw=M("ZodE164",(e,t)=>{$h.init(e,t),Ve.init(e,t)});var Zw=M("ZodJWT",(e,t)=>{wh.init(e,t),Ve.init(e,t)});var Ui=M("ZodNumber",(e,t)=>{cl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>n_(e,r,o,n),e.isFinite=!0},ae.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=st(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=st(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=st(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>st(e).format??null},{gt(e,t){return this.check($o(e,t))},gte(e,t){return this.check(Wt(e,t))},min(e,t){return this.check(Wt(e,t))},lt(e,t){return this.check(zo(e,t))},lte(e,t){return this.check(Gt(e,t))},max(e,t){return this.check(Gt(e,t))},int(e){return this.check(F_(e))},safe(e){return this.check(F_(e))},positive(e){return this.check($o(0,e))},nonnegative(e){return this.check(Wt(0,e))},negative(e){return this.check(zo(0,e))},nonpositive(e){return this.check(Gt(0,e))},multipleOf(e,t){return this.check(Mn(e,t))},step(e,t){return this.check(Mn(e,t))},finite(){return this}}));function Re(e){return kg(Ui,e)}var Lw=M("ZodNumberFormat",(e,t)=>{Rh.init(e,t),Ui.init(e,t)});function F_(e){return Tg(Lw,e)}var Zl=M("ZodBoolean",(e,t)=>{Ph.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>s_(e,r,o,n)});function Ee(e){return Ig(Zl,e)}var W_=M("ZodBigInt",(e,t)=>{Eh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>i_(e,r,o,n)},ae.derived({minValue:e=>st(e).minimum??null,maxValue:e=>st(e).maximum??null,format:e=>st(e).format??null},{gte(e,t){return this.check(Wt(e,t))},min(e,t){return this.check(Wt(e,t))},gt(e,t){return this.check($o(e,t))},lt(e,t){return this.check(zo(e,t))},lte(e,t){return this.check(Gt(e,t))},max(e,t){return this.check(Gt(e,t))},positive(e){return this.check($o(BigInt(0),e))},negative(e){return this.check(zo(BigInt(0),e))},nonpositive(e){return this.check(Gt(BigInt(0),e))},nonnegative(e){return this.check(Wt(BigInt(0),e))},multipleOf(e,t){return this.check(Mn(e,t))}}));var Dw=M("ZodNull",(e,t)=>{kh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>a_(e,r,o,n)});function Ll(e){return Ng(Dw,e)}var Uw=M("ZodAny",(e,t)=>{xh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>u_(e,r,o,n)});function Y_(){return jg(Uw)}var Fw=M("ZodUnknown",(e,t)=>{Th.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>l_(e,r,o,n)});function Fe(){return Ag(Fw)}var Vw=M("ZodNever",(e,t)=>{Ih.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>c_(e,r,o,n)});function Jw(e){return Mg(Vw,e)}var X_=M("ZodDate",(e,t)=>{Oh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>d_(e,r,o,n),e.min=(r,o)=>e.check(Wt(r,o)),e.max=(r,o)=>e.check(Gt(r,o))},ae.derived({minDate:e=>{let{minimum:t}=st(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=st(e);return t?new Date(t):null}},{}));var Hw=M("ZodArray",(e,t)=>{Di(),Ch.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>g_(e,r,o,n),e.element=t.element},{min(e,t){return this.check(wo(e,t))},nonempty(e){return this.check(wo(1,e))},max(e,t){return this.check(Ai(e,t))},length(e,t){return this.check(Mi(e,t))},unwrap(){return this.element}});function B(e,t){return Zg(Hw,e,t)}var Q_=M("ZodObject",(e,t)=>{Di(),Ah.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>__(e,r,o,n),ae.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return yt(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ae.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Fe()}))},loose(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Fe()}))},strict(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Jw()}))},strip(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return ae.extend(this,e)},safeExtend(e){return ae.safeExtend(this,e)},merge(e){return ae.merge(this,e)},pick(e){return ae.pick(this,e)},omit(e){return ae.omit(this,e)},partial(...e){return ae.partial(rv,this,e[0])},exactPartial(...e){return ae.partial(ov,this,e[0],"exactPartial")},required(...e){return ae.required(nv,this,e[0])}});function W(e,t){let r={type:"object",shape:e??{},...ae.normalizeParams(t)};return new Q_(r)}function Qe(e,t){return new Q_({type:"object",shape:e,catchall:Fe(),...ae.normalizeParams(t)})}var ev=M("ZodUnion",(e,t)=>{ul.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>v_(e,r,o,n),e.options=t.options});function Ce(e,t){return new ev({type:"union",options:e,...ae.normalizeParams(t)})}var Bw=M("ZodDiscriminatedUnion",(e,t)=>{ev.init(e,t),Mh.init(e,t)});function Dl(e,t,r){return new Bw({type:"union",options:t,discriminator:e,...ae.normalizeParams(r)})}var Kw=M("ZodIntersection",(e,t)=>{qh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>y_(e,r,o,n)});function Fi(e,t){return new Kw({type:"intersection",left:e,right:t})}var V_=M("ZodRecord",(e,t)=>{Di(),Zh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>S_(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function Le(e,t,r){return!t||!t._zod?new V_({type:"record",keyType:k(),valueType:e,...ae.normalizeParams(t)}):new V_({type:"record",keyType:e,valueType:t,...ae.normalizeParams(r)})}var Ml=M("ZodEnum",(e,t)=>{Lh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(o,n,s)=>p_(e,o,n,s),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Ml({...t,checks:[],...ae.normalizeParams(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let i of o)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Ml({...t,checks:[],...ae.normalizeParams(n),entries:s})}});function yt(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Ml({type:"enum",entries:r,...ae.normalizeParams(t)})}var Gw=M("ZodLiteral",(e,t)=>{Dh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>m_(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Q(e,t){return new Gw({type:"literal",values:Array.isArray(e)?e:[e],...ae.normalizeParams(t)})}var Ww=M("ZodTransform",(e,t)=>{Di(),Uh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>h_(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new So(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(ae.issue(s,r.value,t));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=e),r.issues.push(ae.issue(i))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r)):(r.value=n,r)}});function tv(e){return new Ww({type:"transform",transform:e})}var rv=M("ZodOptional",(e,t)=>{ll.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Al(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ze(e){return new rv({type:"optional",innerType:e})}var ov=M("ZodExactOptional",(e,t)=>{Fh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Al(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Yw(e){return new ov({type:"optional",innerType:e})}var Xw=M("ZodNullable",(e,t)=>{Vh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>b_(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function J_(e){return new Xw({type:"nullable",innerType:e})}var Qw=M("ZodDefault",(e,t)=>{Jh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>w_(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eR(e,t){return new Qw({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ae.shallowClone(t)}})}var tR=M("ZodPrefault",(e,t)=>{Hh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>R_(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function rR(e,t){return new tR({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ae.shallowClone(t)}})}var nv=M("ZodNonOptional",(e,t)=>{Bh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>z_(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function oR(e,t){return new nv({type:"nonoptional",innerType:e,...ae.normalizeParams(t)})}var nR=M("ZodCatch",(e,t)=>{Kh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>P_(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function sR(e,t){return new nR({type:"catch",innerType:e,catchValue:typeof t=="function"?t:ae.constantCatch(t)})}var sv=M("ZodPipe",(e,t)=>{dl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>E_(e,r,o,n),e.in=t.in,e.out=t.out});function H_(e,t){return new sv({type:"pipe",in:e,out:t})}var iR=M("ZodPreprocess",(e,t)=>{sv.init(e,t),Gh.init(e,t)}),aR=M("ZodReadonly",(e,t)=>{Wh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>k_(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function cR(e){return new aR({type:"readonly",innerType:e})}var uR=M("ZodLazy",(e,t)=>{Yh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>x_(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function iv(e){return new uR({type:"lazy",getter:e})}var lR=M("ZodCustom",(e,t)=>{Xh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>f_(e,r,o,n)});function dR(e,t={}){return Lg(lR,e,t)}function pR(e,t){return Dg(e,t)}function Ul(e,t){return new iR({type:"pipe",in:tv(e),out:t})}var cv={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var av;av||(av={});var Vi={};mo(Vi,{ZodISODate:()=>Dn,ZodISODateTime:()=>Ln,ZodISODuration:()=>Fn,ZodISOTime:()=>Un,date:()=>hR,datetime:()=>fR,duration:()=>_R,time:()=>gR});function fR(e){return Oi(Ln,e)}function hR(e){return Ci(Dn,e)}function gR(e){return Ni(Un,e)}function _R(e){return ji(Fn,e)}var Ji={};mo(Ji,{bigint:()=>bR,boolean:()=>SR,date:()=>zR,number:()=>yR,string:()=>vR});function vR(e){return ig(ql,e)}function yR(e){return xg(Ui,e)}function SR(e){return Og(Zl,e)}function bR(e){return Cg(W_,e)}function zR(e){return qg(X_,e)}var Hr="2025-11-25";var Hi=[Hr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Bi="io.modelcontextprotocol/related-task",Xt="io.modelcontextprotocol/protocolVersion",ko="io.modelcontextprotocol/clientInfo",Dt="io.modelcontextprotocol/serverInfo",Qt="io.modelcontextprotocol/clientCapabilities",Br="io.modelcontextprotocol/subscriptionId",gr="io.modelcontextprotocol/logLevel";var Kr="2.0";var hr=iv(()=>Ce([k(),Re(),Ee(),Ll(),Le(k(),hr),B(hr)])),He=Le(k(),hr),Vl=B(hr),Vn=Ce([k(),Re().int()]),Jn=k(),Ki=W({ttl:Re().optional()}),Gi=W({taskId:k()}),Hn=Qe({progressToken:Vn.optional(),[Bi]:Gi.optional()}),ot=W({_meta:Hn.optional()}),Gr=ot.extend({task:Ki.optional()}),Be=W({method:k(),params:ot.loose().optional()}),lt=W({_meta:Hn.optional()}),dt=W({method:k(),params:lt.loose().optional()}),Bn=Qe({get[Dt](){return Io.optional().catch(void 0)}}),Ke=Qe({_meta:Bn.optional()}),_r=Ce([k(),Re().int()]),Kn=W({jsonrpc:Q(Kr),id:_r,...Be.shape}).strict(),Gn=W({jsonrpc:Q(Kr),...dt.shape}).strict(),xo=W({jsonrpc:Q(Kr),id:_r,result:Ke}).strict(),To=W({jsonrpc:Q(Kr),id:_r.optional(),error:W({code:Re().int(),message:k(),data:Fe().optional()})}).strict(),Wn=Ce([Kn,Gn,xo,To]),Jl=Ce([xo,To]),Yn=Ke.strict(),Wi=lt.extend({requestId:_r.optional(),reason:k().optional()}),Xn=dt.extend({method:Q("notifications/cancelled"),params:Wi}),Yi=W({src:k(),mimeType:k().optional(),sizes:B(k()).optional(),theme:yt(["light","dark"]).optional()}),vr=W({icons:B(Yi).optional()}),Yt=W({name:k(),title:k().optional()}),Io=Yt.extend({...Yt.shape,...vr.shape,version:k(),websiteUrl:k().optional(),description:k().optional()}),$R=Fi(W({applyDefaults:Ee().optional()}),He),wR=Ul(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Fi(W({form:$R.optional(),url:He.optional()}),He.optional())),Xi=Qe({list:He.optional(),cancel:He.optional(),requests:Qe({sampling:Qe({createMessage:He.optional()}).optional(),elicitation:Qe({create:He.optional()}).optional()}).optional()}),Qi=Qe({list:He.optional(),cancel:He.optional(),requests:Qe({tools:Qe({call:He.optional()}).optional()}).optional()}),ea=W({experimental:Le(k(),He).optional(),sampling:W({context:He.optional(),tools:He.optional()}).optional(),elicitation:wR.optional(),roots:W({listChanged:Ee().optional()}).optional(),tasks:Xi.optional(),extensions:Le(k(),He).optional()}),ta=ot.extend({protocolVersion:k(),capabilities:ea,clientInfo:Io}),ra=Be.extend({method:Q("initialize"),params:ta}),Qn=W({experimental:Le(k(),He).optional(),logging:He.optional(),completions:He.optional(),prompts:W({listChanged:Ee().optional()}).optional(),resources:W({subscribe:Ee().optional(),listChanged:Ee().optional()}).optional(),tools:W({listChanged:Ee().optional()}).optional(),tasks:Qi.optional(),extensions:Le(k(),He).optional()}),oa=Ke.extend({protocolVersion:k(),capabilities:Qn,serverInfo:Io,instructions:k().optional()}),na=dt.extend({method:Q("notifications/initialized"),params:lt.optional()}),sa=Be.extend({method:Q("server/discover"),params:ot.optional()}),ia=Ke.extend({supportedVersions:B(k()),capabilities:Qn,instructions:k().optional()}),es=Be.extend({method:Q("ping"),params:ot.optional()}),aa=W({progress:Re(),total:Ze(Re()),message:Ze(k())}),ca=W({...lt.shape,...aa.shape,progressToken:Vn}),ts=dt.extend({method:Q("notifications/progress"),params:ca}),ua=ot.extend({cursor:Jn.optional()}),yr=Be.extend({params:ua.optional()}),Sr=Ke.extend({nextCursor:Jn.optional()}),rs=W({uri:k(),mimeType:Ze(k()),_meta:Le(k(),Fe()).optional()}),os=rs.extend({text:k()}),Hl=k().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),ns=rs.extend({blob:Hl}),br=yt(["user","assistant"]),er=W({audience:B(br).optional(),priority:Re().min(0).max(1).optional(),lastModified:Vi.datetime({offset:!0}).optional()}),ss=W({...Yt.shape,...vr.shape,uri:k(),description:Ze(k()),mimeType:Ze(k()),size:Ze(Re()),annotations:er.optional(),_meta:Ze(Qe({}))}),la=W({...Yt.shape,...vr.shape,uriTemplate:k(),description:Ze(k()),mimeType:Ze(k()),annotations:er.optional(),_meta:Ze(Qe({}))}),da=yr.extend({method:Q("resources/list")}),pa=Sr.extend({resources:B(ss)}),ma=yr.extend({method:Q("resources/templates/list")}),fa=Sr.extend({resourceTemplates:B(la)}),Oo=ot.extend({uri:k()}),ha=Oo,ga=Be.extend({method:Q("resources/read"),params:ha}),_a=Ke.extend({contents:B(Ce([os,ns]))}),va=dt.extend({method:Q("notifications/resources/list_changed"),params:lt.optional()}),ya=Oo,Sa=Be.extend({method:Q("resources/subscribe"),params:ya}),ba=Oo,za=Be.extend({method:Q("resources/unsubscribe"),params:ba}),is=W({toolsListChanged:Ee().optional(),promptsListChanged:Ee().optional(),resourcesListChanged:Ee().optional(),resourceSubscriptions:B(k()).optional()}),$a=ot.extend({notifications:is}),wa=Be.extend({method:Q("subscriptions/listen"),params:$a}),Ra=lt.extend({notifications:is}),Pa=dt.extend({method:Q("notifications/subscriptions/acknowledged"),params:Ra}),Ea=Bn.extend({[Br]:_r}),ka=Ke.extend({_meta:Ea}),xa=lt.extend({uri:k()}),Ta=dt.extend({method:Q("notifications/resources/updated"),params:xa}),Ia=W({name:k(),description:Ze(k()),required:Ze(Ee())}),Oa=W({...Yt.shape,...vr.shape,description:Ze(k()),arguments:Ze(B(Ia)),_meta:Ze(Qe({}))}),Ca=yr.extend({method:Q("prompts/list")}),Na=Sr.extend({prompts:B(Oa)}),ja=ot.extend({name:k(),arguments:Le(k(),k()).optional()}),Aa=Be.extend({method:Q("prompts/get"),params:ja}),Co=W({type:Q("text"),text:k(),annotations:er.optional(),_meta:Le(k(),Fe()).optional()}),No=W({type:Q("image"),data:Hl,mimeType:k(),annotations:er.optional(),_meta:Le(k(),Fe()).optional()}),jo=W({type:Q("audio"),data:Hl,mimeType:k(),annotations:er.optional(),_meta:Le(k(),Fe()).optional()}),Ma=W({type:Q("tool_use"),name:k(),id:k(),input:Le(k(),Fe()),_meta:Le(k(),Fe()).optional()}),qa=W({type:Q("resource"),resource:Ce([os,ns]),annotations:er.optional(),_meta:Le(k(),Fe()).optional()}),Za=ss.extend({type:Q("resource_link")}),Ao=Ce([Co,No,jo,Za,qa]),La=W({role:br,content:Ao}),Da=Ke.extend({description:k().optional(),messages:B(La)}),Ua=dt.extend({method:Q("notifications/prompts/list_changed"),params:lt.optional()}),Fa=W({title:k().optional(),readOnlyHint:Ee().optional(),destructiveHint:Ee().optional(),idempotentHint:Ee().optional(),openWorldHint:Ee().optional()}),Va=W({taskSupport:yt(["required","optional","forbidden"]).optional()}),as=W({...Yt.shape,...vr.shape,description:k().optional(),inputSchema:W({type:Q("object"),properties:Le(k(),hr).optional(),required:B(k()).optional()}).catchall(Fe()),outputSchema:Qe({$schema:k().optional()}).optional(),annotations:Fa.optional(),execution:Va.optional(),_meta:Le(k(),Fe()).optional()}),Ja=yr.extend({method:Q("tools/list")}),Ha=Sr.extend({tools:B(as)}),cs=Ke.extend({content:B(Ao).default([]),structuredContent:Fe().optional(),isError:Ee().optional()}),Bl=cs.or(Ke.extend({toolResult:Fe()})),Ba=Gr.extend({name:k(),arguments:Le(k(),Fe()).optional()}),Ka=Be.extend({method:Q("tools/call"),params:Ba}),Ga=dt.extend({method:Q("notifications/tools/list_changed"),params:lt.optional()}),Kl=W({autoRefresh:Ee().default(!0),debounceMs:Re().int().nonnegative().default(300)}),zr=yt(["debug","info","notice","warning","error","critical","alert","emergency"]),Wa=ot.extend({level:zr}),Ya=Be.extend({method:Q("logging/setLevel"),params:Wa}),Xa=lt.extend({level:zr,logger:k().optional(),data:Fe()}),Qa=dt.extend({method:Q("notifications/message"),params:Xa}),ec=W({name:k().optional()}),tc=W({hints:B(ec).optional(),costPriority:Re().min(0).max(1).optional(),speedPriority:Re().min(0).max(1).optional(),intelligencePriority:Re().min(0).max(1).optional()}),rc=W({mode:yt(["auto","required","none"]).optional()}),oc=W({type:Q("tool_result"),toolUseId:k().describe("The unique identifier for the corresponding tool call."),content:B(Ao),structuredContent:Fe().optional(),isError:Ee().optional(),_meta:Le(k(),Fe()).optional()}),nc=Dl("type",[Co,No,jo]),Jr=Dl("type",[Co,No,jo,Ma,oc]),sc=W({role:br,content:Ce([Jr,B(Jr)]),_meta:Le(k(),Fe()).optional()}),ic=Gr.extend({messages:B(sc),modelPreferences:tc.optional(),systemPrompt:k().optional(),includeContext:yt(["none","thisServer","allServers"]).optional(),temperature:Re().optional(),maxTokens:Re().int(),stopSequences:B(k()).optional(),metadata:He.optional(),tools:B(as).optional(),toolChoice:rc.optional()}),ac=Be.extend({method:Q("sampling/createMessage"),params:ic}),cc=Ke.extend({model:k(),stopReason:Ze(yt(["endTurn","stopSequence","maxTokens"]).or(k())),role:br,content:nc}),uc=Ke.extend({model:k(),stopReason:Ze(yt(["endTurn","stopSequence","maxTokens","toolUse"]).or(k())),role:br,content:Ce([Jr,B(Jr)])}),us=W({type:Q("boolean"),title:k().optional(),description:k().optional(),default:Ee().optional()}),Mo=W({type:Q("string"),title:k().optional(),description:k().optional(),minLength:Re().optional(),maxLength:Re().optional(),format:yt(["email","uri","date","date-time"]).optional(),default:k().optional()}),qo=W({type:yt(["number","integer"]),title:k().optional(),description:k().optional(),minimum:Re().optional(),maximum:Re().optional(),default:Re().optional()}),ls=W({type:Q("string"),title:k().optional(),description:k().optional(),enum:B(k()),default:k().optional()}),ds=W({type:Q("string"),title:k().optional(),description:k().optional(),oneOf:B(W({const:k(),title:k()})),default:k().optional()}),ps=W({type:Q("string"),title:k().optional(),description:k().optional(),enum:B(k()),enumNames:B(k()).optional(),default:k().optional()}),lc=Ce([ls,ds]),ms=W({type:Q("array"),title:k().optional(),description:k().optional(),minItems:Re().optional(),maxItems:Re().optional(),items:W({type:Q("string"),enum:B(k())}),default:B(k()).optional()}),fs=W({type:Q("array"),title:k().optional(),description:k().optional(),minItems:Re().optional(),maxItems:Re().optional(),items:W({anyOf:B(W({const:k(),title:k()}))}),default:B(k()).optional()}),dc=Ce([ms,fs]),pc=Ce([ps,lc,dc]),hs=Ce([pc,us,Mo,qo]),Zo=Gr.extend({mode:Q("form").optional(),message:k(),requestedSchema:W({type:Q("object"),properties:Le(k(),hs),required:B(k()).optional()}).catchall(Fe())}),mc=Gr.extend({mode:Q("url"),message:k(),elicitationId:k(),url:k().url()}),fc=Ce([Zo,mc]),hc=Be.extend({method:Q("elicitation/create"),params:fc}),gc=lt.extend({elicitationId:k()}),_c=dt.extend({method:Q("notifications/elicitation/complete"),params:gc}),vc=Ke.extend({action:yt(["accept","decline","cancel"]),content:Ul(e=>e===null?void 0:e,Le(k(),Ce([k(),Re(),Ee(),B(k())])).optional())}),yc=W({type:Q("ref/resource"),uri:k()}),Sc=W({type:Q("ref/prompt"),name:k()}),bc=ot.extend({ref:Ce([Sc,yc]),argument:W({name:k(),value:k()}),context:W({arguments:Le(k(),k()).optional()}).optional()}),zc=Be.extend({method:Q("completion/complete"),params:bc}),$c=Ke.extend({completion:Qe({values:B(k()).max(100),total:Ze(Re().int()),hasMore:Ze(Ee())})}),wc=W({uri:k().startsWith("file://"),name:k().optional(),_meta:Le(k(),Fe()).optional()}),Rc=Be.extend({method:Q("roots/list"),params:ot.optional()}),Pc=Ke.extend({roots:B(wc)}),Ec=dt.extend({method:Q("notifications/roots/list_changed"),params:lt.optional()}),Gl=Qe({ttl:Re().optional(),pollInterval:Re().optional()}),kc=yt(["working","input_required","completed","failed","cancelled"]),$r=W({taskId:k(),status:kc,ttl:Ce([Re(),Ll()]),createdAt:k(),lastUpdatedAt:k(),pollInterval:Ze(Re()),statusMessage:Ze(k())}),Wl=Ke.extend({task:$r}),xc=lt.merge($r),Yl=dt.extend({method:Q("notifications/tasks/status"),params:xc}),Xl=Be.extend({method:Q("tasks/get"),params:ot.extend({taskId:k()})}),Ql=Ke.merge($r),ed=Be.extend({method:Q("tasks/result"),params:ot.extend({taskId:k()})}),td=Ke.loose(),rd=yr.extend({method:Q("tasks/list")}),od=Sr.extend({tasks:B($r)}),nd=Be.extend({method:Q("tasks/cancel"),params:ot.extend({taskId:k()})}),sd=Ke.merge($r),id=Ce([es,ra,sa,zc,Ya,Aa,Ca,da,ma,ga,Sa,za,wa,Ka,Ja]),ad=Ce([Xn,ts,na,Ec]),cd=Ce([Yn,cc,uc,vc,Pc]),ud=Ce([es,ac,hc,Rc]),ld=Ce([Xn,ts,Qa,Ta,va,Ga,Ua,Pa,_c]),dd=Ce([Yn,oa,ia,$c,Da,Na,pa,fa,_a,cs,Ha,ka]),rt=G_().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:cv.custom,message:"URL must be parseable",fatal:!0}),Hu}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),pd=Qe({resource:k().url(),authorization_servers:B(rt).optional(),jwks_uri:k().url().optional(),scopes_supported:B(k()).optional(),bearer_methods_supported:B(k()).optional(),resource_signing_alg_values_supported:B(k()).optional(),resource_name:k().optional(),resource_documentation:k().optional(),resource_policy_uri:k().url().optional(),resource_tos_uri:k().url().optional(),tls_client_certificate_bound_access_tokens:Ee().optional(),authorization_details_types_supported:B(k()).optional(),dpop_signing_alg_values_supported:B(k()).optional(),dpop_bound_access_tokens_required:Ee().optional()}),Tc=Qe({issuer:k(),authorization_endpoint:rt,token_endpoint:rt,registration_endpoint:rt.optional(),scopes_supported:B(k()).optional(),response_types_supported:B(k()),response_modes_supported:B(k()).optional(),grant_types_supported:B(k()).optional(),token_endpoint_auth_methods_supported:B(k()).optional(),token_endpoint_auth_signing_alg_values_supported:B(k()).optional(),service_documentation:rt.optional(),revocation_endpoint:rt.optional(),revocation_endpoint_auth_methods_supported:B(k()).optional(),revocation_endpoint_auth_signing_alg_values_supported:B(k()).optional(),introspection_endpoint:k().optional(),introspection_endpoint_auth_methods_supported:B(k()).optional(),introspection_endpoint_auth_signing_alg_values_supported:B(k()).optional(),code_challenge_methods_supported:B(k()).optional(),client_id_metadata_document_supported:Ee().optional(),authorization_response_iss_parameter_supported:Ee().optional().catch(void 0)}),Ic=Qe({issuer:k(),authorization_endpoint:rt,token_endpoint:rt,userinfo_endpoint:rt.optional(),jwks_uri:rt,registration_endpoint:rt.optional(),scopes_supported:B(k()).optional(),response_types_supported:B(k()),response_modes_supported:B(k()).optional(),grant_types_supported:B(k()).optional(),acr_values_supported:B(k()).optional(),subject_types_supported:B(k()),id_token_signing_alg_values_supported:B(k()),id_token_encryption_alg_values_supported:B(k()).optional(),id_token_encryption_enc_values_supported:B(k()).optional(),userinfo_signing_alg_values_supported:B(k()).optional(),userinfo_encryption_alg_values_supported:B(k()).optional(),userinfo_encryption_enc_values_supported:B(k()).optional(),request_object_signing_alg_values_supported:B(k()).optional(),request_object_encryption_alg_values_supported:B(k()).optional(),request_object_encryption_enc_values_supported:B(k()).optional(),token_endpoint_auth_methods_supported:B(k()).optional(),token_endpoint_auth_signing_alg_values_supported:B(k()).optional(),display_values_supported:B(k()).optional(),claim_types_supported:B(k()).optional(),claims_supported:B(k()).optional(),service_documentation:k().optional(),claims_locales_supported:B(k()).optional(),ui_locales_supported:B(k()).optional(),claims_parameter_supported:Ee().optional(),request_parameter_supported:Ee().optional(),request_uri_parameter_supported:Ee().optional(),require_request_uri_registration:Ee().optional(),op_policy_uri:rt.optional(),op_tos_uri:rt.optional(),client_id_metadata_document_supported:Ee().optional(),authorization_response_iss_parameter_supported:Ee().optional().catch(void 0)}),md=W({...Ic.shape,...Tc.pick({code_challenge_methods_supported:!0}).shape}),fd=W({access_token:k(),id_token:k().optional(),token_type:k(),expires_in:Ji.number().optional(),scope:k().optional(),refresh_token:k().optional()}).strip(),hd=W({issued_token_type:Q("urn:ietf:params:oauth:token-type:id-jag"),access_token:k(),token_type:k().optional(),expires_in:Re().optional(),scope:k().optional()}).strip(),gd=W({error:k(),error_description:k().optional(),error_uri:k().optional()}),Fl=rt.optional().or(Q("").transform(()=>{})),Oc=W({redirect_uris:B(rt),token_endpoint_auth_method:k().optional(),grant_types:B(k()).optional(),response_types:B(k()).optional(),application_type:k().optional(),client_name:k().optional(),client_uri:rt.optional(),logo_uri:Fl,scope:k().optional(),contacts:B(k()).optional(),tos_uri:Fl,policy_uri:k().optional(),jwks_uri:rt.optional(),jwks:Y_().optional(),software_id:k().optional(),software_version:k().optional(),software_statement:k().optional()}).strip(),Cc=W({client_id:k(),client_secret:k().optional(),client_id_issued_at:Re().optional(),client_secret_expires_at:Re().optional()}).strip(),_d=Oc.merge(Cc),vd=W({error:k(),error_description:k().optional()}).strip(),yd=W({token:k(),token_type_hint:k().optional()}).strip();var vv;function Z(e,t,r){function o(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=i.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let p=l[d];p in a||(a[p]=u[p].bind(a))}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(a){var c;let u=r?.Parent?new s:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}var FO=Symbol("zod_brand"),Ut=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Lo=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(vv=globalThis).__zod_globalConfig??(vv.__zod_globalConfig={});var Do=globalThis.__zod_globalConfig;function wt(e){return e&&Object.assign(Do,e),Do}var Pe={};mo(Pe,{BIGINT_FORMAT_RANGES:()=>zv,Class:()=>bd,NUMBER_FORMAT_RANGES:()=>Ed,aborted:()=>Pr,allowsEval:()=>wd,assert:()=>xR,assertEqual:()=>RR,assertIs:()=>ER,assertNever:()=>kR,assertNotEqual:()=>PR,assignProp:()=>wr,base64ToUint8Array:()=>wv,base64urlToUint8Array:()=>HR,cached:()=>Fo,captureStackTrace:()=>Ac,cleanEnum:()=>JR,cleanRegex:()=>ys,clone:()=>Mt,cloneDef:()=>IR,createTransparentProxy:()=>MR,defineLazy:()=>$e,esc:()=>jc,escapeRegex:()=>rr,explicitlyAborted:()=>kd,extend:()=>LR,finalizeIssue:()=>xt,floatSafeRemainder:()=>zd,getElementAtPath:()=>OR,getEnumValues:()=>_s,getLengthableOrigin:()=>Ss,getParsedType:()=>AR,getSizableOrigin:()=>$v,hexToUint8Array:()=>KR,isObject:()=>Wr,isPlainObject:()=>Rr,issue:()=>Vo,joinValues:()=>Nc,jsonStringifyReplacer:()=>Uo,merge:()=>UR,mergeDefs:()=>tr,normalizeParams:()=>ce,nullish:()=>vs,numKeys:()=>jR,objectClone:()=>TR,omit:()=>ZR,optionalKeys:()=>Pd,parsedType:()=>xd,partial:()=>FR,pick:()=>qR,prefixIssues:()=>or,primitiveTypes:()=>bv,promiseAllObject:()=>CR,propertyKeyTypes:()=>Rd,randomString:()=>NR,required:()=>VR,safeExtend:()=>DR,shallowClone:()=>Sv,slugify:()=>$d,stringifyPrimitive:()=>Mc,uint8ArrayToBase64:()=>Rv,uint8ArrayToBase64url:()=>BR,uint8ArrayToHex:()=>GR,unwrapMessage:()=>gs});function RR(e){return e}function PR(e){return e}function ER(e){}function kR(e){throw new Error("Unexpected value in exhaustive check")}function xR(e){}function _s(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function Nc(e,t="|"){return e.map(r=>Mc(r)).join(t)}function Uo(e,t){return typeof t=="bigint"?t.toString():t}function Fo(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function vs(e){return e==null}function ys(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function zd(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var yv=Symbol("evaluating");function $e(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==yv)return o===void 0&&(o=yv,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function TR(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function wr(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function tr(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function IR(e){return tr(e._zod.def)}function OR(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function CR(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function NR(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function jc(e){return JSON.stringify(e)}function $d(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ac="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Wr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var wd=Fo(()=>{if(Do.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Rr(e){if(Wr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Wr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Sv(e){return Rr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function jR(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var AR=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Rd=new Set(["string","number","symbol"]),bv=new Set(["string","number","bigint","boolean","symbol","undefined"]);function rr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Mt(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function ce(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function MR(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function Mc(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Pd(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Ed={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]},zv={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function qR(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=tr(e._zod.def,{get shape(){let i={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=r.shape[a])}return wr(this,"shape",i),i},checks:[]});return Mt(e,s)}function ZR(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=tr(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return wr(this,"shape",i),i},checks:[]});return Mt(e,s)}function LR(e,t){if(!Rr(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let s=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=tr(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return wr(this,"shape",s),s}});return Mt(e,n)}function DR(e,t){if(!Rr(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=tr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return wr(this,"shape",o),o}});return Mt(e,r)}function UR(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=tr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return wr(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Mt(e,r)}function FR(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=tr(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return wr(this,"shape",c),c},checks:[]});return Mt(t,i)}function VR(e,t,r){let o=tr(t._zod.def,{get shape(){let n=t._zod.def.shape,s={...n};if(r)for(let i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)s[i]=new e({type:"nonoptional",innerType:n[i]});return wr(this,"shape",s),s}});return Mt(t,o)}function Pr(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function kd(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function or(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function gs(e){return typeof e=="string"?e:e?.message}function xt(e,t,r){let o=e.message?e.message:gs(e.inst?._zod.def?.error?.(e))??gs(t?.error?.(e))??gs(r.customError?.(e))??gs(r.localeError?.(e))??"Invalid input",{inst:n,continue:s,input:i,...a}=e;return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=i),a}function $v(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Ss(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function xd(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Vo(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function JR(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function wv(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Rv(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function HR(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return wv(t+r)}function BR(e){return Rv(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function KR(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function GR(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var bd=class{constructor(...t){}};var Pv=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Uo,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},qc=Z("$ZodError",Pv),Td=Z("$ZodError",Pv,{Parent:Error});function Ev(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function kv(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(t(i))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return o(e),r}var Zc=e=>(t,r,o,n)=>{let s=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Ut;if(i.issues.length){let a=new(n?.Err??e)(i.issues.map(c=>xt(c,s,wt())));throw Ac(a,n?.callee),a}return i.value};var Lc=e=>async(t,r,o,n)=>{let s=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(n?.Err??e)(i.issues.map(c=>xt(c,s,wt())));throw Ac(a,n?.callee),a}return i.value};var bs=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new Ut;return s.issues.length?{success:!1,error:new(e??qc)(s.issues.map(i=>xt(i,n,wt())))}:{success:!0,data:s.value}},xv=bs(Td),zs=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>xt(i,n,wt())))}:{success:!0,data:s.value}},Tv=zs(Td),Iv=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Zc(e)(t,r,n)};var Ov=e=>(t,r,o)=>Zc(e)(t,r,o);var Cv=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Lc(e)(t,r,n)};var Nv=e=>async(t,r,o)=>Lc(e)(t,r,o);var jv=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return bs(e)(t,r,n)};var Av=e=>(t,r,o)=>bs(e)(t,r,o);var Mv=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return zs(e)(t,r,n)};var qv=e=>async(t,r,o)=>zs(e)(t,r,o);var Zv=/^[cC][0-9a-z]{6,}$/,Lv=/^[0-9a-z]+$/,Dv=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Uv=/^[0-9a-vA-V]{20}$/,Fv=/^[A-Za-z0-9]{27}$/,Vv=/^[a-zA-Z0-9_-]{21}$/,Jv=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Hv=/^([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})$/,Id=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var Bv=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var YR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Kv(){return new RegExp(YR,"u")}var Gv=/^(?:(?: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])$/,Wv=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Yv=/^((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])$/,Xv=/^(([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])$/,Qv=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Od=/^[A-Za-z0-9_-]*$/;var ey=/^https?$/,ty=/^\+[1-9]\d{6,14}$/,ry="(?:(?:\\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])))",oy=new RegExp(`^${ry}$`);function ny(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sy(e){return new RegExp(`^${ny(e)}$`)}function iy(e){let t=ny({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${ry}T(?:${o})$`)}var ay=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var cy=/^-?\d+$/,Cd=/^-?\d+(?:\.\d+)?$/,uy=/^(?:true|false)$/i,ly=/^null$/i;var dy=/^[^A-Z]*$/,py=/^[^a-z]*$/;var it=Z("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),my={number:"number",bigint:"bigint",object:"date"},Nd=Z("$ZodCheckLessThan",(e,t)=>{it.init(e,t);let r=my[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),jd=Z("$ZodCheckGreaterThan",(e,t)=>{it.init(e,t);let r=my[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fy=Z("$ZodCheckMultipleOf",(e,t)=>{it.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):zd(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),hy=Z("$ZodCheckNumberFormat",(e,t)=>{it.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Ed[t.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,a.minimum=n,a.maximum=s,r&&(a.pattern=cy)}),e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<n&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var gy=Z("$ZodCheckMaxLength",(e,t)=>{var r;it.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!vs(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let i=Ss(n);o.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),_y=Z("$ZodCheckMinLength",(e,t)=>{var r;it.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!vs(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let i=Ss(n);o.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),vy=Z("$ZodCheckLengthEquals",(e,t)=>{var r;it.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!vs(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,s=n.length;if(s===t.length)return;let i=Ss(n),a=s>t.length;o.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),$s=Z("$ZodCheckStringFormat",(e,t)=>{var r,o;it.init(e,t),e._zod.onattach.push(n=>{let s=n._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),yy=Z("$ZodCheckRegex",(e,t)=>{$s.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Sy=Z("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=dy),$s.init(e,t)}),by=Z("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=py),$s.init(e,t)}),zy=Z("$ZodCheckIncludes",(e,t)=>{it.init(e,t);let r=rr(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),$y=Z("$ZodCheckStartsWith",(e,t)=>{it.init(e,t);let r=new RegExp(`^${rr(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),wy=Z("$ZodCheckEndsWith",(e,t)=>{it.init(e,t);let r=new RegExp(`.*${rr(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Ry=Z("$ZodCheckOverwrite",(e,t)=>{it.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Uc=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
57
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}a.count>1&&e.reused==="ref"&&s(i)}e.external&&(e.sharedDefsExtractedFor=e.external)}function c_(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let o of t){if(!o||typeof o!="object")return;c_(o);let n=Object.keys(o);if(n.length!==1||n[0]!=="type")return;let s=o.type;for(let i of Array.isArray(s)?s:[s]){if(typeof i!="string")return;r.includes(i)||r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var u_=new Set(["type","properties","required","additionalProperties"]),i_=["oneOf","anyOf"];function a_(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Kl(e){let t=[];for(let s of e){if(typeof s!="object"||s.type!=="object")return null;for(let i in s)if(!u_.has(i))return null;t.push(s)}let r={},o=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let a=[];for(let u of t){let l=u.properties?.[i]??a_(u);l!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(l))||a.push(l))}let c=a.length===1?a[0]:Kl(a)??{allOf:a};$t(r,i,c)}for(let i of s.required??[])o.add(i)}let n={type:"object",properties:r};if(o.size&&(n.required=[...o]),t.every(s=>s.additionalProperties===!1))n.additionalProperties=!1;else{let s=[];for(let i of t){let a=a_(i);a&&!s.some(c=>JSON.stringify(c)===JSON.stringify(a))&&s.push(a)}s.length===1?n.additionalProperties=s[0]:s.length>1&&(n.additionalProperties={allOf:s})}return n}function Jw(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of u_)if(n in e)return;let r=t.filter(n=>i_.some(s=>Array.isArray(n[s]))),o=null;if(!r.length)o=Kl(t);else{let n=r[0],s=i_.find(c=>Array.isArray(n[c]));if(Object.keys(n).length!==1)return;let i=t.filter(c=>c!==n),a=n[s].map(c=>Kl([...i,c]));if(a.some(c=>!c))return;o={[s]:a}}o&&(delete e.allOf,Yn(e,o))}function Yl(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);let g=e.seen.get(d),f=g.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(f)):Yn(u,f),Yn(u,l),a._zod.parent===d)for(let m in u)m==="$ref"||m==="allOf"||m in l||delete u[m];if(f.$ref&&g.def)for(let m in u)m==="$ref"||m==="allOf"||m in g.def&&JSON.stringify(u[m])===JSON.stringify(g.def[m])&&delete u[m]}let p=a._zod.parent;if(p&&p!==d){o(p);let g=e.seen.get(p);if(g?.schema.$ref&&(u.$ref=g.schema.$ref,g.def))for(let f in u)f==="$ref"||f==="allOf"||f in g.def&&JSON.stringify(u[f])===JSON.stringify(g.def[f])&&delete u[f]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())o(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())c_(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=a.get(l);d?d.push(u):a.set(l,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])Jw(u)}}let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Yn(n,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;s!==void 0&&n.id===s&&delete n.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,$t(i,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Xn(t,"input",e.processors),output:Xn(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function ft(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return ft(o.element,r);if(o.type==="set")return ft(o.valueType,r);if(o.type==="lazy")return ft(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return ft(o.innerType,r);if(o.type==="intersection")return ft(o.left,r)||ft(o.right,r);if(o.type==="record"||o.type==="map")return ft(o.keyType,r)||ft(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ft(o.in,r)||ft(o.out,r);if(o.type==="object"){for(let n in o.shape)if(ft(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(ft(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(ft(n,r))return!0;return!!(o.rest&&ft(o.rest,r))}return!1}var l_=(e,t={})=>r=>{let o=Gl({...r,processors:t});return Je(e,o),Wl(o,e),Yl(o,e)},Xn=(e,t,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=Gl({...n??{},target:s,io:t,processors:r});return Je(e,i),Wl(i,e),Yl(i,e)};var Mo=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},qo=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},d_=(e,t)=>{Mo(e,"minimum",t),qo(e,"maximum",t)},h_=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},g_=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},__=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},v_=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},p_=(e,t)=>Mo(e,"minimum",t.minimum),m_=(e,t)=>qo(e,"maximum",t.maximum),f_=e=>(t,r)=>{v_(t,r.format);let[o,n]=e[r.format];Mo(t,"minimum",o),qo(t,"maximum",n)},Hw={greater_than:(e,t)=>Mo(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>qo(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>h_(e,t.value),number_format:f_(Un),bigint_format:f_(ki),min_length:p_,max_length:m_,length_equals:(e,t)=>d_(e,t.length),min_size:p_,max_size:m_,size_equals:(e,t)=>d_(e,t.size),string_format:(e,t)=>{v_(e,t.format),t.pattern&&g_(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>__(e,t.mime)};function it(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)Hw[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;n.minimum!==void 0&&Mo(t,"minimum",n.minimum),n.exclusiveMinimum!==void 0&&Mo(t,"exclusiveMinimum",n.exclusiveMinimum),n.maximum!==void 0&&qo(t,"maximum",n.maximum),n.exclusiveMaximum!==void 0&&qo(t,"exclusiveMaximum",n.exclusiveMaximum),n.multipleOf!==void 0&&h_(t,n.multipleOf),n.format!==void 0&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&__(t,n.mime);for(let s of n.patterns??[])g_(t,s);return t}var Bw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Kw=new Map([[Pl,Tf],[Fi,If]]),y_=e=>Kw.get(e)??e,S_=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:l}=it(e);if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),a&&(n.format=Bw[a]??a,n.format===""&&delete n.format,(a==="time"||l)&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let d=[...c].map(y_);d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},b_=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=it(e);n.type=l?"integer":"number";let d=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(i??Number.POSITIVE_INFINITY),g=t.target==="draft-04"||t.target==="openapi-3.0";if(d?g?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof s=="number"&&(n.minimum=s),p?g?(n.maximum=c,n.exclusiveMaximum=!0):n.exclusiveMaximum=c:typeof i=="number"&&(n.maximum=i),a){let f=new Set;for(let h of a)Number.isFinite(h)&&h!==0?f.add(Math.abs(h)):Zt(e,t,n,o,`A multipleOf divisor of ${h} cannot be represented in JSON Schema`);let[_,...m]=f;_!==void 0&&(n.multipleOf=_),m.length&&(n.allOf=[...n.allOf??[],...m.map(h=>({multipleOf:h}))])}},z_=(e,t,r,o)=>{r.type="boolean"},$_=(e,t,r,o)=>{Zt(e,t,r,o,"BigInt cannot be represented in JSON Schema")};var w_=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var R_=(e,t,r,o)=>{r.not={}},P_=(e,t,r,o)=>{},E_=(e,t,r,o)=>{},k_=(e,t,r,o)=>{Zt(e,t,r,o,"Date cannot be represented in JSON Schema")},x_=(e,t,r,o)=>{let n=e._zod.def,s=Eo(n.entries);if(s.length===0){r.not={};return}s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},T_=(e,t,r,o)=>{let n=e._zod.def;if(n.values.length===0){r.not={};return}let s=[];for(let i of n.values)if(i===void 0){if(Zt(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i=="bigint"){if(Zt(e,t,r,o,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s};var I_=(e,t,r,o)=>{Zt(e,t,r,o,"Custom types cannot be represented in JSON Schema")};var O_=(e,t,r,o)=>{Zt(e,t,r,o,"Transforms cannot be represented in JSON Schema")};var C_=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:a}=it(e);typeof i=="number"&&(n.minItems=i),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=Je(s.element,t,{...o,path:[...o.path,"items"]})};function ta(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?ta(t.out):t.type==="catch"?ta(t.innerType):e._zod.optin}var N_=(e,t,r,o)=>{let n=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Zt(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in i)$t(n.properties,u,Je(i[u],t,{...o,path:[...o.path,"properties",u]}));let c=[];for(let u of Object.keys(i)){let l=s.shape[u];(t.io==="input"?ta(l)===void 0:l._zod.optout===void 0)&&c.push(u)}c.length>0&&(n.required=c),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=Je(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},j_=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>Je(a,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},A_=(e,t,r,o)=>{let n=e._zod.def,s=Je(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=Je(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c,t.intersections.push(c)};function Xl(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let f=e.get(t)?.def;if(!f)return t;let _=Xl(e,f,r);return _===f?t:_}for(let f of["anyOf","oneOf"]){let _=t[f];if(!Array.isArray(_))continue;let m=_.map(h=>Xl(e,h,r));m.some((h,z)=>h!==_[z])&&(t={...t,[f]:m})}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some(f=>f==="number"||f==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some(f=>typeof f=="number"))return t;let{minimum:i,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:p,...g}=t;return g.enum?g.enum=g.enum.map(f=>typeof f=="number"?String(f):f):typeof g.const=="number"&&(g.const=String(g.const)),n&&(g.type="string",s||(g.pattern=(o.includes("number")?Hn:Sl).source)),g}var Ql=new WeakMap;function Gw(e){let t=new Map;for(let o of e.seen.values())o.def&&!t.has(o.schema)&&t.set(o.schema,o);let r=new Map;for(let o of Ql.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=Xl(t,s,new Set);i!==s&&r.set(s,i)}if(r.size)for(let o of e.seen.values())for(let n of[o.schema,o.def]){let s=n&&r.get(n.propertyNames);s&&(n.propertyNames=s)}}var M_=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,a=it(i).patterns;if(s.mode==="loose"&&a&&a.size>0){let l=Je(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of a)$t(n.patternProperties,y_(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=Je(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});let l=Ql.get(t);l||(l=[],Ql.set(t,l),t.deferred.push(()=>Gw(t))),l.push(e)}n.additionalProperties=Je(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let c=i._zod.values,u=t.io==="input"&&ta(s.valueType)!==void 0;if(c&&!s.partial&&!u){let l=[...c].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l.map(String))}},q_=(e,t,r,o)=>{let n=e._zod.def,s=Je(n.innerType,t,o),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},Z_=(e,t,r,o)=>{let n=e._zod.def;Je(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},ed=Symbol();function L_(e,t,r,o,n){let s=!1,i=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(s=!0,null));return s?(Zt(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),ed):JSON.parse(i)}var D_=(e,t,r,o)=>{let n=e._zod.def;Je(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i=L_(n.defaultValue,e,t,r,o);i!==ed&&(r.default=i)},U_=(e,t,r,o)=>{let n=e._zod.def;Je(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io!=="input")return;let i=L_(n.defaultValue,e,t,r,o);i!==ed&&(r._prefault=i)},F_=(e,t,r,o)=>{let n=e._zod.def;Je(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{Zt(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},V_=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;Je(i,t,o);let a=t.seen.get(e);a.ref=i},J_=(e,t,r,o)=>{let n=e._zod.def;Je(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0};var td=(e,t,r,o)=>{let n=e._zod.def;Je(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},H_=(e,t,r,o)=>{let n=e._zod.innerType;Je(n,t,o);let s=t.seen.get(e);s.ref=n};var B_=new WeakSet([Object.prototype,Error.prototype]);function ra(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let o=r(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}var nR=(e,t)=>{nf.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);B_.has(r)||(B_.add(r),ra(r,"format",o=>n=>hl(o,n)),ra(r,"flatten",o=>n=>fl(o,n)),ra(r,"addIssue",o=>n=>{o.issues.push(n),o.message=JSON.stringify(o.issues,ko,2)}),ra(r,"addIssues",o=>n=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,ko,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))};var wt=q("ZodError",nR,void 0,{Parent:Error});var K_=Ci(wt),G_=Ni(wt),W_=ji(wt),Y_=Ai(wt),X_=af(wt),Q_=cf(wt),ev=uf(wt),tv=lf(wt),rv=df(wt),ov=pf(wt),nv=mf(wt),sv=ff(wt);function iR(){vt.localeError||yt(yg())}function na(){vt.memoizer||yt({memoizer:Nl()})}var xe=q("ZodType",(e,t)=>(iR(),ke.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ae.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return xt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(GR(e,t))},superRefine(e,t){return this.check(WR(e,t))},overwrite(e){return this.check(zr(e))},optional(){return Ze(this)},exactOptional(){return jR(this)},nullable(){return cv(this)},nullish(){return Ze(cv(this))},nonoptional(e){return DR(this,e)},array(){return K(this)},or(e){return Ce([this,e])},and(e){return ia(this,e)},transform(e){return uv(this,vv(e))},default(e){return qR(this,e)},prefault(e){return LR(this,e)},catch(e){return FR(this,e)},pipe(e){return uv(this,e)},readonly(){return HR(this)},describe(e){let t=this.clone();return br.add(t,{description:e}),t},meta(...e){if(e.length===0)return br.get(this);let t=this.clone();return br.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return ae.hide(this,"~standard",{...Rl(this),jsonSchema:{input:Xn(this,"input"),output:Xn(this,"output")}})},set"~standard"(e){ae.own(this,"~standard",e)},parse:function e(t,r){return K_(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await G_(this,t,r,{callee:e})},safeParse(e,t){return W_(this,e,t)},async safeParseAsync(e,t){return Y_(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ae.own(this,"spa",e)},validate(e,t){return gl(this,e,t)},validateAsync(e,t){return _l(this,e,t)},encode:function e(t,r){return X_(this,t,r,{callee:e})},decode:function e(t,r){return Q_(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ev(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await tv(this,t,r,{callee:e})},safeEncode(e,t){return rv(this,e,t)},safeDecode(e,t){return ov(this,e,t)},async safeEncodeAsync(e,t){return nv(this,e,t)},async safeDecodeAsync(e,t){return sv(this,e,t)},toJSONSchema(e){return l_(this,{})(e)},get description(){return br.get(this)?.description},get _def(){return this._zod.def}}),lv=q("_ZodString",(e,t)=>{Ui.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>S_(e,r,o,n)},ae.derived({format:e=>it(e).format??null,minLength:e=>it(e).minimum??null,maxLength:e=>it(e).maximum??null},{regex(...e){return this.check(Ml(...e))},includes(...e){return this.check(Ll(...e))},startsWith(...e){return this.check(Dl(...e))},endsWith(...e){return this.check(Ul(...e))},min(...e){return this.check(Ao(...e))},max(...e){return this.check(Qi(...e))},length(...e){return this.check(ea(...e))},nonempty(...e){return this.check(Ao(1,...e))},lowercase(e){return this.check(ql(e))},uppercase(e){return this.check(Zl(e))},trim(){return this.check(Vl())},normalize(...e){return this.check(Fl(...e))},toLowerCase(){return this.check(Jl())},toUpperCase(){return this.check(Hl())},slugify(){return this.check(Bl())}})),od=q("ZodString",(e,t)=>{Ui.init(e,t),lv.init(e,t)},{email(e){return this.check(wg(aR,e))},url(e){return this.check(Al(dv,e))},jwt(e){return this.check(Vg($R,e))},emoji(e){return this.check(Tg(uR,e))},guid(e){return this.check(Rg(cR,e))},uuid(e){return this.check(Pg(oa,e))},uuidv4(e){return this.check(Eg(oa,e))},uuidv6(e){return this.check(kg(oa,e))},uuidv7(e){return this.check(xg(oa,e))},nanoid(e){return this.check(Ig(lR,e))},cuid(e){return this.check(Og(dR,e))},cuid2(e){return this.check(Cg(pR,e))},ulid(e){return this.check(Ng(mR,e))},base64(e){return this.check(Dg(SR,e))},base64url(e){return this.check(Ug(bR,e))},xid(e){return this.check(jg(fR,e))},ksuid(e){return this.check(Ag(hR,e))},ipv4(e){return this.check(Mg(gR,e))},ipv6(e){return this.check(qg(_R,e))},cidrv4(e){return this.check(Zg(vR,e))},cidrv6(e){return this.check(Lg(yR,e))},e164(e){return this.check(Fg(zR,e))},datetime(e){return this.check(Gi(Qn,e))},date(e){return this.check(Wi(es,e))},time(e){return this.check(Yi(ts,e))},duration(e){return this.check(Xi(rs,e))}});function k(e){return zg(od,e)}var Ve=q("ZodStringFormat",(e,t)=>{je.init(e,t),lv.init(e,t)}),Qn=q("ZodISODateTime",(e,t)=>{kh.init(e,t),Ve.init(e,t)}),es=q("ZodISODate",(e,t)=>{xh.init(e,t),Ve.init(e,t)}),ts=q("ZodISOTime",(e,t)=>{Th.init(e,t),Ve.init(e,t)}),rs=q("ZodISODuration",(e,t)=>{Ih.init(e,t),Ve.init(e,t)}),aR=q("ZodEmail",(e,t)=>{_h.init(e,t),Ve.init(e,t)});var cR=q("ZodGUID",(e,t)=>{hh.init(e,t),Ve.init(e,t)});var oa=q("ZodUUID",(e,t)=>{gh.init(e,t),Ve.init(e,t)});var dv=q("ZodURL",(e,t)=>{Sh.init(e,t),Ve.init(e,t)});function pv(e){return Al(dv,e)}var uR=q("ZodEmoji",(e,t)=>{bh.init(e,t),Ve.init(e,t)});var lR=q("ZodNanoID",(e,t)=>{zh.init(e,t),Ve.init(e,t)});var dR=q("ZodCUID",(e,t)=>{$h.init(e,t),Ve.init(e,t)});var pR=q("ZodCUID2",(e,t)=>{wh.init(e,t),Ve.init(e,t)});var mR=q("ZodULID",(e,t)=>{Rh.init(e,t),Ve.init(e,t)});var fR=q("ZodXID",(e,t)=>{Ph.init(e,t),Ve.init(e,t)});var hR=q("ZodKSUID",(e,t)=>{Eh.init(e,t),Ve.init(e,t)});var gR=q("ZodIPv4",(e,t)=>{Oh.init(e,t),Ve.init(e,t)});var _R=q("ZodIPv6",(e,t)=>{Nh.init(e,t),Ve.init(e,t)});var vR=q("ZodCIDRv4",(e,t)=>{jh.init(e,t),Ve.init(e,t)});var yR=q("ZodCIDRv6",(e,t)=>{Ah.init(e,t),Ve.init(e,t)});var SR=q("ZodBase64",(e,t)=>{qh.init(e,t),Ve.init(e,t)});var bR=q("ZodBase64URL",(e,t)=>{Zh.init(e,t),Ve.init(e,t)});var zR=q("ZodE164",(e,t)=>{Lh.init(e,t),Ve.init(e,t)});var $R=q("ZodJWT",(e,t)=>{Dh.init(e,t),Ve.init(e,t)});var sa=q("ZodNumber",(e,t)=>{El.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>b_(e,r,o,n),e.isFinite=!0},ae.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=it(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=it(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=it(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>it(e).format??null},{gt(e,t){return this.check(jo(e,t))},gte(e,t){return this.check(sr(e,t))},min(e,t){return this.check(sr(e,t))},lt(e,t){return this.check(No(e,t))},lte(e,t){return this.check(nr(e,t))},max(e,t){return this.check(nr(e,t))},int(e){return this.check(iv(e))},safe(e){return this.check(iv(e))},positive(e){return this.check(jo(0,e))},nonnegative(e){return this.check(sr(0,e))},negative(e){return this.check(No(0,e))},nonpositive(e){return this.check(nr(0,e))},multipleOf(e,t){return this.check(Wn(e,t))},step(e,t){return this.check(Wn(e,t))},finite(){return this}}));function Re(e){return Jg(sa,e)}var wR=q("ZodNumberFormat",(e,t)=>{Uh.init(e,t),sa.init(e,t)});function iv(e){return Bg(wR,e)}var nd=q("ZodBoolean",(e,t)=>{Fh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>z_(e,r,o,n)});function Ee(e){return Kg(nd,e)}var mv=q("ZodBigInt",(e,t)=>{Vh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$_(e,r,o,n)},ae.derived({minValue:e=>it(e).minimum??null,maxValue:e=>it(e).maximum??null,format:e=>it(e).format??null},{gte(e,t){return this.check(sr(e,t))},min(e,t){return this.check(sr(e,t))},gt(e,t){return this.check(jo(e,t))},lt(e,t){return this.check(No(e,t))},lte(e,t){return this.check(nr(e,t))},max(e,t){return this.check(nr(e,t))},positive(e){return this.check(jo(BigInt(0),e))},negative(e){return this.check(No(BigInt(0),e))},nonpositive(e){return this.check(nr(BigInt(0),e))},nonnegative(e){return this.check(sr(BigInt(0),e))},multipleOf(e,t){return this.check(Wn(e,t))}}));var RR=q("ZodNull",(e,t)=>{Jh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>w_(e,r,o,n)});function sd(e){return Yg(RR,e)}var PR=q("ZodAny",(e,t)=>{Hh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>P_(e,r,o,n)});function fv(){return Xg(PR)}var ER=q("ZodUnknown",(e,t)=>{Bh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>E_(e,r,o,n)});function Fe(){return Qg(ER)}var kR=q("ZodNever",(e,t)=>{Kh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>R_(e,r,o,n)});function xR(e){return e_(kR,e)}var hv=q("ZodDate",(e,t)=>{Gh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>k_(e,r,o,n),e.min=(r,o)=>e.check(sr(r,o)),e.max=(r,o)=>e.check(nr(r,o))},ae.derived({minDate:e=>{let{minimum:t}=it(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=it(e);return t?new Date(t):null}},{}));var TR=q("ZodArray",(e,t)=>{na(),Wh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>C_(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Ao(e,t))},nonempty(e){return this.check(Ao(1,e))},max(e,t){return this.check(Qi(e,t))},length(e,t){return this.check(ea(e,t))},unwrap(){return this.element}});function K(e,t){return r_(TR,e,t)}var gv=q("ZodObject",(e,t)=>{na(),Qh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>N_(e,r,o,n),ae.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return St(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ae.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Fe()}))},loose(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Fe()}))},strict(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:xR()}))},strip(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return ae.extend(this,e)},safeExtend(e){return ae.safeExtend(this,e)},merge(e){return ae.merge(this,e)},pick(e){return ae.pick(this,e)},omit(e){return ae.omit(this,e)},partial(...e){return ae.partial(yv,this,e[0])},exactPartial(...e){return ae.partial(Sv,this,e[0],"exactPartial")},required(...e){return ae.required(bv,this,e[0])}});function Y(e,t){let r={type:"object",shape:e??{},...ae.normalizeParams(t)};return new gv(r)}function Qe(e,t){return new gv({type:"object",shape:e,catchall:Fe(),...ae.normalizeParams(t)})}var _v=q("ZodUnion",(e,t)=>{kl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>j_(e,r,o,n),e.options=t.options});function Ce(e,t){return new _v({type:"union",options:e,...ae.normalizeParams(t)})}var IR=q("ZodDiscriminatedUnion",(e,t)=>{_v.init(e,t),eg.init(e,t)});function id(e,t,r){return new IR({type:"union",options:t,discriminator:e,...ae.normalizeParams(r)})}var OR=q("ZodIntersection",(e,t)=>{tg.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>A_(e,r,o,n)});function ia(e,t){return new OR({type:"intersection",left:e,right:t})}var av=q("ZodRecord",(e,t)=>{na(),rg.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>M_(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function Le(e,t,r){return!t||!t._zod?new av({type:"record",keyType:k(),valueType:e,...ae.normalizeParams(t)}):new av({type:"record",keyType:e,valueType:t,...ae.normalizeParams(r)})}var rd=q("ZodEnum",(e,t)=>{og.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(o,n,s)=>x_(e,o,n,s),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new rd({...t,checks:[],...ae.normalizeParams(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let i of o)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new rd({...t,checks:[],...ae.normalizeParams(n),entries:s})}});function St(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new rd({type:"enum",entries:r,...ae.normalizeParams(t)})}var CR=q("ZodLiteral",(e,t)=>{ng.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>T_(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ee(e,t){return new CR({type:"literal",values:Array.isArray(e)?e:[e],...ae.normalizeParams(t)})}var NR=q("ZodTransform",(e,t)=>{na(),sg.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>O_(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Oo(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(ae.issue(s,r.value,t));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=e),r.issues.push(ae.issue(i))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r)):(r.value=n,r)}});function vv(e){return new NR({type:"transform",transform:e})}var yv=q("ZodOptional",(e,t)=>{xl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>td(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ze(e){return new yv({type:"optional",innerType:e})}var Sv=q("ZodExactOptional",(e,t)=>{ig.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>td(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function jR(e){return new Sv({type:"optional",innerType:e})}var AR=q("ZodNullable",(e,t)=>{ag.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>q_(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function cv(e){return new AR({type:"nullable",innerType:e})}var MR=q("ZodDefault",(e,t)=>{cg.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>D_(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qR(e,t){return new MR({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ae.shallowClone(t)}})}var ZR=q("ZodPrefault",(e,t)=>{ug.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>U_(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function LR(e,t){return new ZR({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ae.shallowClone(t)}})}var bv=q("ZodNonOptional",(e,t)=>{lg.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Z_(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function DR(e,t){return new bv({type:"nonoptional",innerType:e,...ae.normalizeParams(t)})}var UR=q("ZodCatch",(e,t)=>{dg.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>F_(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function FR(e,t){return new UR({type:"catch",innerType:e,catchValue:typeof t=="function"?t:ae.constantCatch(t)})}var zv=q("ZodPipe",(e,t)=>{Tl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>V_(e,r,o,n),e.in=t.in,e.out=t.out});function uv(e,t){return new zv({type:"pipe",in:e,out:t})}var VR=q("ZodPreprocess",(e,t)=>{zv.init(e,t),pg.init(e,t)}),JR=q("ZodReadonly",(e,t)=>{mg.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>J_(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function HR(e){return new JR({type:"readonly",innerType:e})}var BR=q("ZodLazy",(e,t)=>{fg.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>H_(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function $v(e){return new BR({type:"lazy",getter:e})}var KR=q("ZodCustom",(e,t)=>{hg.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>I_(e,r,o,n)});function GR(e,t={}){return o_(KR,e,t)}function WR(e,t){return n_(e,t)}function ad(e,t){return new VR({type:"pipe",in:vv(e),out:t})}var Rv={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var wv;wv||(wv={});var aa={};Ro(aa,{ZodISODate:()=>es,ZodISODateTime:()=>Qn,ZodISODuration:()=>rs,ZodISOTime:()=>ts,date:()=>QR,datetime:()=>XR,duration:()=>tP,time:()=>eP});function XR(e){return Gi(Qn,e)}function QR(e){return Wi(es,e)}function eP(e){return Yi(ts,e)}function tP(e){return Xi(rs,e)}var ca={};Ro(ca,{bigint:()=>sP,boolean:()=>nP,date:()=>iP,number:()=>oP,string:()=>rP});function rP(e){return $g(od,e)}function oP(e){return Hg(sa,e)}function nP(e){return Gg(nd,e)}function sP(e){return Wg(mv,e)}function iP(e){return t_(hv,e)}var to="2025-11-25",ua="2025-03-26",os=[to,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],la="io.modelcontextprotocol/related-task",Tt="io.modelcontextprotocol/protocolVersion",ro="io.modelcontextprotocol/clientInfo",Lt="io.modelcontextprotocol/serverInfo",Kt="io.modelcontextprotocol/clientCapabilities",wr="io.modelcontextprotocol/subscriptionId",Rr="io.modelcontextprotocol/logLevel";var oo="2.0";var $r=$v(()=>Ce([k(),Re(),Ee(),sd(),Le(k(),$r),K($r)])),He=Le(k(),$r),ud=K($r),ns=Ce([k(),Re().int()]),ss=k(),da=Y({ttl:Re().optional()}),pa=Y({taskId:k()}),is=Qe({progressToken:ns.optional(),[la]:pa.optional()}),nt=Y({_meta:is.optional()}),no=nt.extend({task:da.optional()}),Be=Y({method:k(),params:nt.loose().optional()}),dt=Y({_meta:is.optional()}),pt=Y({method:k(),params:dt.loose().optional()}),as=Qe({get[Lt](){return Uo.optional().catch(void 0)}}),Ke=Qe({_meta:as.optional()}),Pr=Ce([k(),Re().int()]),cs=Y({jsonrpc:ee(oo),id:Pr,...Be.shape}).strict(),us=Y({jsonrpc:ee(oo),...pt.shape}).strict(),Lo=Y({jsonrpc:ee(oo),id:Pr,result:Ke}).strict(),Do=Y({jsonrpc:ee(oo),id:Pr.optional(),error:Y({code:Re().int(),message:k(),data:Fe().optional()})}).strict(),so=Ce([cs,us,Lo,Do]),ld=Ce([Lo,Do]),ls=Ke.strict(),ma=dt.extend({requestId:Pr.optional(),reason:k().optional()}),ds=pt.extend({method:ee("notifications/cancelled"),params:ma}),fa=Y({src:k(),mimeType:k().optional(),sizes:K(k()).optional(),theme:St(["light","dark"]).optional()}),Er=Y({icons:K(fa).optional()}),ir=Y({name:k(),title:k().optional()}),Uo=ir.extend({...ir.shape,...Er.shape,version:k(),websiteUrl:k().optional(),description:k().optional()}),aP=ia(Y({applyDefaults:Ee().optional()}),He),cP=ad(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ia(Y({form:aP.optional(),url:He.optional()}),He.optional())),ha=Qe({list:He.optional(),cancel:He.optional(),requests:Qe({sampling:Qe({createMessage:He.optional()}).optional(),elicitation:Qe({create:He.optional()}).optional()}).optional()}),ga=Qe({list:He.optional(),cancel:He.optional(),requests:Qe({tools:Qe({call:He.optional()}).optional()}).optional()}),_a=Y({experimental:Le(k(),He).optional(),sampling:Y({context:He.optional(),tools:He.optional()}).optional(),elicitation:cP.optional(),roots:Y({listChanged:Ee().optional()}).optional(),tasks:ha.optional(),extensions:Le(k(),He).optional()}),va=nt.extend({protocolVersion:k(),capabilities:_a,clientInfo:Uo}),ps=Be.extend({method:ee("initialize"),params:va}),ms=Y({experimental:Le(k(),He).optional(),logging:He.optional(),completions:He.optional(),prompts:Y({listChanged:Ee().optional()}).optional(),resources:Y({subscribe:Ee().optional(),listChanged:Ee().optional()}).optional(),tools:Y({listChanged:Ee().optional()}).optional(),tasks:ga.optional(),extensions:Le(k(),He).optional()}),ya=Ke.extend({protocolVersion:k(),capabilities:ms,serverInfo:Uo,instructions:k().optional()}),Sa=pt.extend({method:ee("notifications/initialized"),params:dt.optional()}),ba=Be.extend({method:ee("server/discover"),params:nt.optional()}),za=Ke.extend({supportedVersions:K(k()),capabilities:ms,instructions:k().optional()}),fs=Be.extend({method:ee("ping"),params:nt.optional()}),$a=Y({progress:Re(),total:Ze(Re()),message:Ze(k())}),wa=Y({...dt.shape,...$a.shape,progressToken:ns}),hs=pt.extend({method:ee("notifications/progress"),params:wa}),Ra=nt.extend({cursor:ss.optional()}),kr=Be.extend({params:Ra.optional()}),xr=Ke.extend({nextCursor:ss.optional()}),gs=Y({uri:k(),mimeType:Ze(k()),_meta:Le(k(),Fe()).optional()}),_s=gs.extend({text:k()}),dd=k().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),vs=gs.extend({blob:dd}),Tr=St(["user","assistant"]),ar=Y({audience:K(Tr).optional(),priority:Re().min(0).max(1).optional(),lastModified:aa.datetime({offset:!0}).optional()}),ys=Y({...ir.shape,...Er.shape,uri:k(),description:Ze(k()),mimeType:Ze(k()),size:Ze(Re()),annotations:ar.optional(),_meta:Ze(Qe({}))}),Pa=Y({...ir.shape,...Er.shape,uriTemplate:k(),description:Ze(k()),mimeType:Ze(k()),annotations:ar.optional(),_meta:Ze(Qe({}))}),Ea=kr.extend({method:ee("resources/list")}),ka=xr.extend({resources:K(ys)}),xa=kr.extend({method:ee("resources/templates/list")}),Ta=xr.extend({resourceTemplates:K(Pa)}),Fo=nt.extend({uri:k()}),Ia=Fo,Oa=Be.extend({method:ee("resources/read"),params:Ia}),Ca=Ke.extend({contents:K(Ce([_s,vs]))}),Na=pt.extend({method:ee("notifications/resources/list_changed"),params:dt.optional()}),ja=Fo,Aa=Be.extend({method:ee("resources/subscribe"),params:ja}),Ma=Fo,qa=Be.extend({method:ee("resources/unsubscribe"),params:Ma}),Ss=Y({toolsListChanged:Ee().optional(),promptsListChanged:Ee().optional(),resourcesListChanged:Ee().optional(),resourceSubscriptions:K(k()).optional()}),Za=nt.extend({notifications:Ss}),La=Be.extend({method:ee("subscriptions/listen"),params:Za}),Da=dt.extend({notifications:Ss}),Ua=pt.extend({method:ee("notifications/subscriptions/acknowledged"),params:Da}),Fa=as.extend({[wr]:Pr}),Va=Ke.extend({_meta:Fa}),Ja=dt.extend({uri:k()}),Ha=pt.extend({method:ee("notifications/resources/updated"),params:Ja}),Ba=Y({name:k(),description:Ze(k()),required:Ze(Ee())}),Ka=Y({...ir.shape,...Er.shape,description:Ze(k()),arguments:Ze(K(Ba)),_meta:Ze(Qe({}))}),Ga=kr.extend({method:ee("prompts/list")}),Wa=xr.extend({prompts:K(Ka)}),Ya=nt.extend({name:k(),arguments:Le(k(),k()).optional()}),Xa=Be.extend({method:ee("prompts/get"),params:Ya}),Vo=Y({type:ee("text"),text:k(),annotations:ar.optional(),_meta:Le(k(),Fe()).optional()}),Jo=Y({type:ee("image"),data:dd,mimeType:k(),annotations:ar.optional(),_meta:Le(k(),Fe()).optional()}),Ho=Y({type:ee("audio"),data:dd,mimeType:k(),annotations:ar.optional(),_meta:Le(k(),Fe()).optional()}),Qa=Y({type:ee("tool_use"),name:k(),id:k(),input:Le(k(),Fe()),_meta:Le(k(),Fe()).optional()}),ec=Y({type:ee("resource"),resource:Ce([_s,vs]),annotations:ar.optional(),_meta:Le(k(),Fe()).optional()}),tc=ys.extend({type:ee("resource_link")}),Bo=Ce([Vo,Jo,Ho,tc,ec]),rc=Y({role:Tr,content:Bo}),oc=Ke.extend({description:k().optional(),messages:K(rc)}),nc=pt.extend({method:ee("notifications/prompts/list_changed"),params:dt.optional()}),sc=Y({title:k().optional(),readOnlyHint:Ee().optional(),destructiveHint:Ee().optional(),idempotentHint:Ee().optional(),openWorldHint:Ee().optional()}),ic=Y({taskSupport:St(["required","optional","forbidden"]).optional()}),bs=Y({...ir.shape,...Er.shape,description:k().optional(),inputSchema:Y({type:ee("object"),properties:Le(k(),$r).optional(),required:K(k()).optional()}).catchall(Fe()),outputSchema:Qe({$schema:k().optional()}).optional(),annotations:sc.optional(),execution:ic.optional(),_meta:Le(k(),Fe()).optional()}),ac=kr.extend({method:ee("tools/list")}),cc=xr.extend({tools:K(bs)}),zs=Ke.extend({content:K(Bo).default([]),structuredContent:Fe().optional(),isError:Ee().optional()}),pd=zs.or(Ke.extend({toolResult:Fe()})),uc=no.extend({name:k(),arguments:Le(k(),Fe()).optional()}),lc=Be.extend({method:ee("tools/call"),params:uc}),dc=pt.extend({method:ee("notifications/tools/list_changed"),params:dt.optional()}),md=Y({autoRefresh:Ee().default(!0),debounceMs:Re().int().nonnegative().default(300)}),Ir=St(["debug","info","notice","warning","error","critical","alert","emergency"]),pc=nt.extend({level:Ir}),mc=Be.extend({method:ee("logging/setLevel"),params:pc}),fc=dt.extend({level:Ir,logger:k().optional(),data:Fe()}),hc=pt.extend({method:ee("notifications/message"),params:fc}),gc=Y({name:k().optional()}),_c=Y({hints:K(gc).optional(),costPriority:Re().min(0).max(1).optional(),speedPriority:Re().min(0).max(1).optional(),intelligencePriority:Re().min(0).max(1).optional()}),vc=Y({mode:St(["auto","required","none"]).optional()}),yc=Y({type:ee("tool_result"),toolUseId:k().describe("The unique identifier for the corresponding tool call."),content:K(Bo),structuredContent:Fe().optional(),isError:Ee().optional(),_meta:Le(k(),Fe()).optional()}),Sc=id("type",[Vo,Jo,Ho]),eo=id("type",[Vo,Jo,Ho,Qa,yc]),bc=Y({role:Tr,content:Ce([eo,K(eo)]),_meta:Le(k(),Fe()).optional()}),zc=no.extend({messages:K(bc),modelPreferences:_c.optional(),systemPrompt:k().optional(),includeContext:St(["none","thisServer","allServers"]).optional(),temperature:Re().optional(),maxTokens:Re().int(),stopSequences:K(k()).optional(),metadata:He.optional(),tools:K(bs).optional(),toolChoice:vc.optional()}),$c=Be.extend({method:ee("sampling/createMessage"),params:zc}),wc=Ke.extend({model:k(),stopReason:Ze(St(["endTurn","stopSequence","maxTokens"]).or(k())),role:Tr,content:Sc}),Rc=Ke.extend({model:k(),stopReason:Ze(St(["endTurn","stopSequence","maxTokens","toolUse"]).or(k())),role:Tr,content:Ce([eo,K(eo)])}),$s=Y({type:ee("boolean"),title:k().optional(),description:k().optional(),default:Ee().optional()}),Ko=Y({type:ee("string"),title:k().optional(),description:k().optional(),minLength:Re().optional(),maxLength:Re().optional(),format:St(["email","uri","date","date-time"]).optional(),default:k().optional()}),Go=Y({type:St(["number","integer"]),title:k().optional(),description:k().optional(),minimum:Re().optional(),maximum:Re().optional(),default:Re().optional()}),ws=Y({type:ee("string"),title:k().optional(),description:k().optional(),enum:K(k()),default:k().optional()}),Rs=Y({type:ee("string"),title:k().optional(),description:k().optional(),oneOf:K(Y({const:k(),title:k()})),default:k().optional()}),Ps=Y({type:ee("string"),title:k().optional(),description:k().optional(),enum:K(k()),enumNames:K(k()).optional(),default:k().optional()}),Pc=Ce([ws,Rs]),Es=Y({type:ee("array"),title:k().optional(),description:k().optional(),minItems:Re().optional(),maxItems:Re().optional(),items:Y({type:ee("string"),enum:K(k())}),default:K(k()).optional()}),ks=Y({type:ee("array"),title:k().optional(),description:k().optional(),minItems:Re().optional(),maxItems:Re().optional(),items:Y({anyOf:K(Y({const:k(),title:k()}))}),default:K(k()).optional()}),Ec=Ce([Es,ks]),kc=Ce([Ps,Pc,Ec]),xs=Ce([kc,$s,Ko,Go]),Wo=no.extend({mode:ee("form").optional(),message:k(),requestedSchema:Y({type:ee("object"),properties:Le(k(),xs),required:K(k()).optional()}).catchall(Fe())}),xc=no.extend({mode:ee("url"),message:k(),elicitationId:k(),url:k().url()}),Tc=Ce([Wo,xc]),Ic=Be.extend({method:ee("elicitation/create"),params:Tc}),Oc=dt.extend({elicitationId:k()}),Cc=pt.extend({method:ee("notifications/elicitation/complete"),params:Oc}),Nc=Ke.extend({action:St(["accept","decline","cancel"]),content:ad(e=>e===null?void 0:e,Le(k(),Ce([k(),Re(),Ee(),K(k())])).optional())}),jc=Y({type:ee("ref/resource"),uri:k()}),Ac=Y({type:ee("ref/prompt"),name:k()}),Mc=nt.extend({ref:Ce([Ac,jc]),argument:Y({name:k(),value:k()}),context:Y({arguments:Le(k(),k()).optional()}).optional()}),qc=Be.extend({method:ee("completion/complete"),params:Mc}),Zc=Ke.extend({completion:Qe({values:K(k()).max(100),total:Ze(Re().int()),hasMore:Ze(Ee())})}),Lc=Y({uri:k().startsWith("file://"),name:k().optional(),_meta:Le(k(),Fe()).optional()}),Dc=Be.extend({method:ee("roots/list"),params:nt.optional()}),Uc=Ke.extend({roots:K(Lc)}),Fc=pt.extend({method:ee("notifications/roots/list_changed"),params:dt.optional()}),fd=Qe({ttl:Re().optional(),pollInterval:Re().optional()}),Vc=St(["working","input_required","completed","failed","cancelled"]),Or=Y({taskId:k(),status:Vc,ttl:Ce([Re(),sd()]),createdAt:k(),lastUpdatedAt:k(),pollInterval:Ze(Re()),statusMessage:Ze(k())}),hd=Ke.extend({task:Or}),Jc=dt.merge(Or),gd=pt.extend({method:ee("notifications/tasks/status"),params:Jc}),_d=Be.extend({method:ee("tasks/get"),params:nt.extend({taskId:k()})}),vd=Ke.merge(Or),yd=Be.extend({method:ee("tasks/result"),params:nt.extend({taskId:k()})}),Sd=Ke.loose(),bd=kr.extend({method:ee("tasks/list")}),zd=xr.extend({tasks:K(Or)}),$d=Be.extend({method:ee("tasks/cancel"),params:nt.extend({taskId:k()})}),wd=Ke.merge(Or),Rd=Ce([fs,ps,ba,qc,mc,Xa,Ga,Ea,xa,Oa,Aa,qa,La,lc,ac]),Pd=Ce([ds,hs,Sa,Fc]),Ed=Ce([ls,wc,Rc,Nc,Uc]),kd=Ce([fs,$c,Ic,Dc]),xd=Ce([ds,hs,hc,Ha,Na,dc,nc,Ua,Cc]),Td=Ce([ls,ya,za,Zc,oc,Wa,ka,Ta,Ca,zs,cc,Va]),ot=pv().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Rv.custom,message:"URL must be parseable",fatal:!0}),dl}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Id=Qe({resource:k().url(),authorization_servers:K(ot).optional(),jwks_uri:k().url().optional(),scopes_supported:K(k()).optional(),bearer_methods_supported:K(k()).optional(),resource_signing_alg_values_supported:K(k()).optional(),resource_name:k().optional(),resource_documentation:k().optional(),resource_policy_uri:k().url().optional(),resource_tos_uri:k().url().optional(),tls_client_certificate_bound_access_tokens:Ee().optional(),authorization_details_types_supported:K(k()).optional(),dpop_signing_alg_values_supported:K(k()).optional(),dpop_bound_access_tokens_required:Ee().optional()}),Hc=Qe({issuer:k(),authorization_endpoint:ot,token_endpoint:ot,registration_endpoint:ot.optional(),scopes_supported:K(k()).optional(),response_types_supported:K(k()),response_modes_supported:K(k()).optional(),grant_types_supported:K(k()).optional(),token_endpoint_auth_methods_supported:K(k()).optional(),token_endpoint_auth_signing_alg_values_supported:K(k()).optional(),service_documentation:ot.optional(),revocation_endpoint:ot.optional(),revocation_endpoint_auth_methods_supported:K(k()).optional(),revocation_endpoint_auth_signing_alg_values_supported:K(k()).optional(),introspection_endpoint:k().optional(),introspection_endpoint_auth_methods_supported:K(k()).optional(),introspection_endpoint_auth_signing_alg_values_supported:K(k()).optional(),code_challenge_methods_supported:K(k()).optional(),client_id_metadata_document_supported:Ee().optional(),authorization_response_iss_parameter_supported:Ee().optional().catch(void 0)}),Bc=Qe({issuer:k(),authorization_endpoint:ot,token_endpoint:ot,userinfo_endpoint:ot.optional(),jwks_uri:ot,registration_endpoint:ot.optional(),scopes_supported:K(k()).optional(),response_types_supported:K(k()),response_modes_supported:K(k()).optional(),grant_types_supported:K(k()).optional(),acr_values_supported:K(k()).optional(),subject_types_supported:K(k()),id_token_signing_alg_values_supported:K(k()),id_token_encryption_alg_values_supported:K(k()).optional(),id_token_encryption_enc_values_supported:K(k()).optional(),userinfo_signing_alg_values_supported:K(k()).optional(),userinfo_encryption_alg_values_supported:K(k()).optional(),userinfo_encryption_enc_values_supported:K(k()).optional(),request_object_signing_alg_values_supported:K(k()).optional(),request_object_encryption_alg_values_supported:K(k()).optional(),request_object_encryption_enc_values_supported:K(k()).optional(),token_endpoint_auth_methods_supported:K(k()).optional(),token_endpoint_auth_signing_alg_values_supported:K(k()).optional(),display_values_supported:K(k()).optional(),claim_types_supported:K(k()).optional(),claims_supported:K(k()).optional(),service_documentation:k().optional(),claims_locales_supported:K(k()).optional(),ui_locales_supported:K(k()).optional(),claims_parameter_supported:Ee().optional(),request_parameter_supported:Ee().optional(),request_uri_parameter_supported:Ee().optional(),require_request_uri_registration:Ee().optional(),op_policy_uri:ot.optional(),op_tos_uri:ot.optional(),client_id_metadata_document_supported:Ee().optional(),authorization_response_iss_parameter_supported:Ee().optional().catch(void 0)}),Od=Y({...Bc.shape,...Hc.pick({code_challenge_methods_supported:!0}).shape}),Cd=Y({access_token:k(),id_token:k().optional(),token_type:k(),expires_in:ca.number().optional(),scope:k().optional(),refresh_token:k().optional()}).strip(),Nd=Y({issued_token_type:ee("urn:ietf:params:oauth:token-type:id-jag"),access_token:k(),token_type:k().optional(),expires_in:Re().optional(),scope:k().optional()}).strip(),jd=Y({error:k(),error_description:k().optional(),error_uri:k().optional()}),cd=ot.optional().or(ee("").transform(()=>{})),Kc=Y({redirect_uris:K(ot),token_endpoint_auth_method:k().optional(),grant_types:K(k()).optional(),response_types:K(k()).optional(),application_type:k().optional(),client_name:k().optional(),client_uri:ot.optional(),logo_uri:cd,scope:k().optional(),contacts:K(k()).optional(),tos_uri:cd,policy_uri:k().optional(),jwks_uri:ot.optional(),jwks:fv().optional(),software_id:k().optional(),software_version:k().optional(),software_statement:k().optional()}).strip(),Gc=Y({client_id:k(),client_secret:k().optional(),client_id_issued_at:Re().optional(),client_secret_expires_at:Re().optional()}).strip(),Ad=Kc.merge(Gc),Md=Y({error:k(),error_description:k().optional()}).strip(),qd=Y({token:k(),token_type_hint:k().optional()}).strip();var Nv;function Z(e,t,r){function o(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=i.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let p=l[d];p in a||(a[p]=u[p].bind(a))}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(a){var c;let u=r?.Parent?new s:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}var FC=Symbol("zod_brand"),Gt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Yo=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Nv=globalThis).__zod_globalConfig??(Nv.__zod_globalConfig={});var Xo=globalThis.__zod_globalConfig;function Rt(e){return e&&Object.assign(Xo,e),Xo}var Pe={};Ro(Pe,{BIGINT_FORMAT_RANGES:()=>qv,Class:()=>Ld,NUMBER_FORMAT_RANGES:()=>Hd,aborted:()=>jr,allowsEval:()=>Fd,assert:()=>mP,assertEqual:()=>uP,assertIs:()=>dP,assertNever:()=>pP,assertNotEqual:()=>lP,assignProp:()=>Cr,base64ToUint8Array:()=>Lv,base64urlToUint8Array:()=>TP,cached:()=>en,captureStackTrace:()=>Xc,cleanEnum:()=>xP,cleanRegex:()=>Cs,clone:()=>Dt,cloneDef:()=>hP,createTransparentProxy:()=>bP,defineLazy:()=>$e,esc:()=>Yc,escapeRegex:()=>ur,explicitlyAborted:()=>Bd,extend:()=>wP,finalizeIssue:()=>It,floatSafeRemainder:()=>Dd,getElementAtPath:()=>gP,getEnumValues:()=>Is,getLengthableOrigin:()=>Ns,getParsedType:()=>SP,getSizableOrigin:()=>Zv,hexToUint8Array:()=>OP,isObject:()=>io,isPlainObject:()=>Nr,issue:()=>tn,joinValues:()=>Wc,jsonStringifyReplacer:()=>Qo,merge:()=>PP,mergeDefs:()=>cr,normalizeParams:()=>ce,nullish:()=>Os,numKeys:()=>yP,objectClone:()=>fP,omit:()=>$P,optionalKeys:()=>Jd,parsedType:()=>Kd,partial:()=>EP,pick:()=>zP,prefixIssues:()=>lr,primitiveTypes:()=>Mv,promiseAllObject:()=>_P,propertyKeyTypes:()=>Vd,randomString:()=>vP,required:()=>kP,safeExtend:()=>RP,shallowClone:()=>Av,slugify:()=>Ud,stringifyPrimitive:()=>Qc,uint8ArrayToBase64:()=>Dv,uint8ArrayToBase64url:()=>IP,uint8ArrayToHex:()=>CP,unwrapMessage:()=>Ts});function uP(e){return e}function lP(e){return e}function dP(e){}function pP(e){throw new Error("Unexpected value in exhaustive check")}function mP(e){}function Is(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function Wc(e,t="|"){return e.map(r=>Qc(r)).join(t)}function Qo(e,t){return typeof t=="bigint"?t.toString():t}function en(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Os(e){return e==null}function Cs(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Dd(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var jv=Symbol("evaluating");function $e(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==jv)return o===void 0&&(o=jv,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function fP(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Cr(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function cr(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function hP(e){return cr(e._zod.def)}function gP(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function _P(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function vP(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Yc(e){return JSON.stringify(e)}function Ud(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Xc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function io(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Fd=en(()=>{if(Xo.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Nr(e){if(io(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(io(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Av(e){return Nr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function yP(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var SP=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Vd=new Set(["string","number","symbol"]),Mv=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ur(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Dt(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function ce(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function bP(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function Qc(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Jd(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Hd={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]},qv={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zP(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=cr(e._zod.def,{get shape(){let i={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=r.shape[a])}return Cr(this,"shape",i),i},checks:[]});return Dt(e,s)}function $P(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=cr(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return Cr(this,"shape",i),i},checks:[]});return Dt(e,s)}function wP(e,t){if(!Nr(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let s=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=cr(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return Cr(this,"shape",s),s}});return Dt(e,n)}function RP(e,t){if(!Nr(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=cr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Cr(this,"shape",o),o}});return Dt(e,r)}function PP(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=cr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Cr(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Dt(e,r)}function EP(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=cr(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return Cr(this,"shape",c),c},checks:[]});return Dt(t,i)}function kP(e,t,r){let o=cr(t._zod.def,{get shape(){let n=t._zod.def.shape,s={...n};if(r)for(let i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)s[i]=new e({type:"nonoptional",innerType:n[i]});return Cr(this,"shape",s),s}});return Dt(t,o)}function jr(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Bd(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function lr(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Ts(e){return typeof e=="string"?e:e?.message}function It(e,t,r){let o=e.message?e.message:Ts(e.inst?._zod.def?.error?.(e))??Ts(t?.error?.(e))??Ts(r.customError?.(e))??Ts(r.localeError?.(e))??"Invalid input",{inst:n,continue:s,input:i,...a}=e;return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=i),a}function Zv(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Ns(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Kd(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function tn(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function xP(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Lv(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Dv(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function TP(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Lv(t+r)}function IP(e){return Dv(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function OP(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function CP(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ld=class{constructor(...t){}};var Uv=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Qo,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},eu=Z("$ZodError",Uv),Gd=Z("$ZodError",Uv,{Parent:Error});function Fv(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Vv(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(t(i))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return o(e),r}var tu=e=>(t,r,o,n)=>{let s=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Gt;if(i.issues.length){let a=new(n?.Err??e)(i.issues.map(c=>It(c,s,Rt())));throw Xc(a,n?.callee),a}return i.value};var ru=e=>async(t,r,o,n)=>{let s=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(n?.Err??e)(i.issues.map(c=>It(c,s,Rt())));throw Xc(a,n?.callee),a}return i.value};var js=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new Gt;return s.issues.length?{success:!1,error:new(e??eu)(s.issues.map(i=>It(i,n,Rt())))}:{success:!0,data:s.value}},Jv=js(Gd),As=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>It(i,n,Rt())))}:{success:!0,data:s.value}},Hv=As(Gd),Bv=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return tu(e)(t,r,n)};var Kv=e=>(t,r,o)=>tu(e)(t,r,o);var Gv=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return ru(e)(t,r,n)};var Wv=e=>async(t,r,o)=>ru(e)(t,r,o);var Yv=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return js(e)(t,r,n)};var Xv=e=>(t,r,o)=>js(e)(t,r,o);var Qv=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return As(e)(t,r,n)};var ey=e=>async(t,r,o)=>As(e)(t,r,o);var ty=/^[cC][0-9a-z]{6,}$/,ry=/^[0-9a-z]+$/,oy=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ny=/^[0-9a-vA-V]{20}$/,sy=/^[A-Za-z0-9]{27}$/,iy=/^[a-zA-Z0-9_-]{21}$/,ay=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var cy=/^([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})$/,Wd=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var uy=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var jP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ly(){return new RegExp(jP,"u")}var dy=/^(?:(?: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])$/,py=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var my=/^((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])$/,fy=/^(([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])$/,hy=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yd=/^[A-Za-z0-9_-]*$/;var gy=/^https?$/,_y=/^\+[1-9]\d{6,14}$/,vy="(?:(?:\\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])))",yy=new RegExp(`^${vy}$`);function Sy(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function by(e){return new RegExp(`^${Sy(e)}$`)}function zy(e){let t=Sy({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${vy}T(?:${o})$`)}var $y=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var wy=/^-?\d+$/,Xd=/^-?\d+(?:\.\d+)?$/,Ry=/^(?:true|false)$/i,Py=/^null$/i;var Ey=/^[^A-Z]*$/,ky=/^[^a-z]*$/;var at=Z("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),xy={number:"number",bigint:"bigint",object:"date"},Qd=Z("$ZodCheckLessThan",(e,t)=>{at.init(e,t);let r=xy[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ep=Z("$ZodCheckGreaterThan",(e,t)=>{at.init(e,t);let r=xy[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ty=Z("$ZodCheckMultipleOf",(e,t)=>{at.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Dd(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Iy=Z("$ZodCheckNumberFormat",(e,t)=>{at.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Hd[t.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,a.minimum=n,a.maximum=s,r&&(a.pattern=wy)}),e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<n&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Oy=Z("$ZodCheckMaxLength",(e,t)=>{var r;at.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Os(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let i=Ns(n);o.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Cy=Z("$ZodCheckMinLength",(e,t)=>{var r;at.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Os(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let i=Ns(n);o.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ny=Z("$ZodCheckLengthEquals",(e,t)=>{var r;at.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Os(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,s=n.length;if(s===t.length)return;let i=Ns(n),a=s>t.length;o.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Ms=Z("$ZodCheckStringFormat",(e,t)=>{var r,o;at.init(e,t),e._zod.onattach.push(n=>{let s=n._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),jy=Z("$ZodCheckRegex",(e,t)=>{Ms.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ay=Z("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ey),Ms.init(e,t)}),My=Z("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ky),Ms.init(e,t)}),qy=Z("$ZodCheckIncludes",(e,t)=>{at.init(e,t);let r=ur(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Zy=Z("$ZodCheckStartsWith",(e,t)=>{at.init(e,t);let r=new RegExp(`^${ur(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Ly=Z("$ZodCheckEndsWith",(e,t)=>{at.init(e,t);let r=new RegExp(`.*${ur(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Dy=Z("$ZodCheckOverwrite",(e,t)=>{at.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var nu=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
58
58
  `).filter(i=>i),n=Math.min(...o.map(i=>i.length-i.trimStart().length)),s=o.map(i=>i.slice(n)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...r,n.join(`
59
- `))}};var Ey={major:4,minor:4,patch:3};var Ne=Z("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ey;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let s of n._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(i,a,c)=>{let u=Pr(i),l;for(let d of a){if(d._zod.def.when){if(kd(i)||!d._zod.def.when(i))continue}else if(u)continue;let p=i.issues.length,g=d._zod.check(i);if(g instanceof Promise&&c?.async===!1)throw new Ut;if(l||g instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await g,i.issues.length!==p&&(u||(u=Pr(i,p)))});else{if(i.issues.length===p)continue;u||(u=Pr(i,p))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(Pr(i))return i.aborted=!0,i;let u=n(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new Ut;return u.then(l=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){let u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>s(l,i,a)):s(u,i,a)}let c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Ut;return c.then(u=>n(u,o,a))}return n(c,o,a)}}$e(e,"~standard",()=>({validate:n=>{try{let s=xv(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Tv(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Jc=Z("$ZodString",(e,t)=>{Ne.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ay(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ae=Z("$ZodStringFormat",(e,t)=>{$s.init(e,t),Jc.init(e,t)}),Ay=Z("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Hv),Ae.init(e,t)}),My=Z("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Id(o))}else t.pattern??(t.pattern=Id());Ae.init(e,t)}),qy=Z("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Bv),Ae.init(e,t)}),Zy=Z("$ZodURL",(e,t)=>{Ae.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===ey.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Ly=Z("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Kv()),Ae.init(e,t)}),Dy=Z("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Vv),Ae.init(e,t)}),Uy=Z("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Zv),Ae.init(e,t)}),Fy=Z("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Lv),Ae.init(e,t)}),Vy=Z("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Dv),Ae.init(e,t)}),Jy=Z("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Uv),Ae.init(e,t)}),Hy=Z("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Fv),Ae.init(e,t)}),By=Z("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=iy(t)),Ae.init(e,t)}),Ky=Z("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=oy),Ae.init(e,t)}),Gy=Z("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=sy(t)),Ae.init(e,t)}),Wy=Z("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Jv),Ae.init(e,t)}),Yy=Z("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Gv),Ae.init(e,t),e._zod.bag.format="ipv4"}),Xy=Z("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Wv),Ae.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}});var Qy=Z("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Yv),Ae.init(e,t)}),eS=Z("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Xv),Ae.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,s]=o;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function tS(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var rS=Z("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Qv),Ae.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{tS(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function XR(e){if(!Od.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return tS(r)}var oS=Z("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Od),Ae.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{XR(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),nS=Z("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ty),Ae.init(e,t)});function QR(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var sS=Z("$ZodJWT",(e,t)=>{Ae.init(e,t),e._zod.check=r=>{QR(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Md=Z("$ZodNumber",(e,t)=>{Ne.init(e,t),e._zod.pattern=e._zod.bag.pattern??Cd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),iS=Z("$ZodNumberFormat",(e,t)=>{hy.init(e,t),Md.init(e,t)}),aS=Z("$ZodBoolean",(e,t)=>{Ne.init(e,t),e._zod.pattern=uy,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}});var cS=Z("$ZodNull",(e,t)=>{Ne.init(e,t),e._zod.pattern=ly,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}});var uS=Z("$ZodUnknown",(e,t)=>{Ne.init(e,t),e._zod.parse=r=>r}),lS=Z("$ZodNever",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function ky(e,t,r){e.issues.length&&t.issues.push(...or(r,e.issues)),t.value[r]=e.value}var dS=Z("$ZodArray",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let s=[];for(let i=0;i<n.length;i++){let a=n[i],c=t.element._zod.run({value:a,issues:[]},o);c instanceof Promise?s.push(c.then(u=>ky(u,r,i))):ky(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function Vc(e,t,r,o,n,s){let i=r in o;if(e.issues.length){if(n&&s&&!i)return;t.issues.push(...or(r,e.issues))}if(!i&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?i&&(t.value[r]=void 0):t.value[r]=e.value}function pS(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=Pd(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function mS(e,t,r,o,n,s){let i=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optin==="optional",d=c.optout==="optional";for(let p in t){if(p==="__proto__"||a.has(p))continue;if(u==="never"){i.push(p);continue}let g=c.run({value:t[p],issues:[]},o);g instanceof Promise?e.push(g.then(m=>Vc(m,r,p,t,l,d))):Vc(g,r,p,t,l,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}var eP=Z("$ZodObject",(e,t)=>{if(Ne.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=Fo(()=>pS(t));$e(e._zod,"propValues",()=>{let a=t.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let n=Wr,s=t.catchall,i;e._zod.parse=(a,c)=>{i??(i=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let l=[],d=i.shape;for(let p of i.keys){let g=d[p],m=g._zod.optin==="optional",v=g._zod.optout==="optional",h=g._zod.run({value:u[p],issues:[]},c);h instanceof Promise?l.push(h.then(f=>Vc(f,a,p,u,m,v))):Vc(h,a,p,u,m,v)}return s?mS(l,u,a,c,o.value,e):l.length?Promise.all(l).then(()=>a):a}}),fS=Z("$ZodObjectJIT",(e,t)=>{eP.init(e,t);let r=e._zod.parse,o=Fo(()=>pS(t)),n=p=>{let g=new Uc(["shape","payload","ctx"]),m=o.value,v=_=>{let b=jc(_);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};g.write("const input = payload.value;");let h=Object.create(null),f=0;for(let _ of m.keys)h[_]=`key_${f++}`;g.write("const newResult = {};");for(let _ of m.keys){let b=h[_],R=jc(_),S=p[_],y=S?._zod?.optin==="optional",$=S?._zod?.optout==="optional";g.write(`const ${b} = ${v(_)};`),y&&$?g.write(`
60
- if (${b}.issues.length) {
59
+ `))}};var Fy={major:4,minor:4,patch:3};var Ne=Z("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fy;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let s of n._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(i,a,c)=>{let u=jr(i),l;for(let d of a){if(d._zod.def.when){if(Bd(i)||!d._zod.def.when(i))continue}else if(u)continue;let p=i.issues.length,g=d._zod.check(i);if(g instanceof Promise&&c?.async===!1)throw new Gt;if(l||g instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await g,i.issues.length!==p&&(u||(u=jr(i,p)))});else{if(i.issues.length===p)continue;u||(u=jr(i,p))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(jr(i))return i.aborted=!0,i;let u=n(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new Gt;return u.then(l=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){let u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>s(l,i,a)):s(u,i,a)}let c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Gt;return c.then(u=>n(u,o,a))}return n(c,o,a)}}$e(e,"~standard",()=>({validate:n=>{try{let s=Jv(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Hv(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),au=Z("$ZodString",(e,t)=>{Ne.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$y(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ae=Z("$ZodStringFormat",(e,t)=>{Ms.init(e,t),au.init(e,t)}),Xy=Z("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=cy),Ae.init(e,t)}),Qy=Z("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Wd(o))}else t.pattern??(t.pattern=Wd());Ae.init(e,t)}),eS=Z("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=uy),Ae.init(e,t)}),tS=Z("$ZodURL",(e,t)=>{Ae.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===gy.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),rS=Z("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ly()),Ae.init(e,t)}),oS=Z("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=iy),Ae.init(e,t)}),nS=Z("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ty),Ae.init(e,t)}),sS=Z("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ry),Ae.init(e,t)}),iS=Z("$ZodULID",(e,t)=>{t.pattern??(t.pattern=oy),Ae.init(e,t)}),aS=Z("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ny),Ae.init(e,t)}),cS=Z("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=sy),Ae.init(e,t)}),uS=Z("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=zy(t)),Ae.init(e,t)}),lS=Z("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=yy),Ae.init(e,t)}),dS=Z("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=by(t)),Ae.init(e,t)}),pS=Z("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ay),Ae.init(e,t)}),mS=Z("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=dy),Ae.init(e,t),e._zod.bag.format="ipv4"}),fS=Z("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=py),Ae.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}});var hS=Z("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=my),Ae.init(e,t)}),gS=Z("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=fy),Ae.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,s]=o;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function _S(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var vS=Z("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=hy),Ae.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{_S(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function AP(e){if(!Yd.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return _S(r)}var yS=Z("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Yd),Ae.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{AP(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),SS=Z("$ZodE164",(e,t)=>{t.pattern??(t.pattern=_y),Ae.init(e,t)});function MP(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var bS=Z("$ZodJWT",(e,t)=>{Ae.init(e,t),e._zod.check=r=>{MP(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var rp=Z("$ZodNumber",(e,t)=>{Ne.init(e,t),e._zod.pattern=e._zod.bag.pattern??Xd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),zS=Z("$ZodNumberFormat",(e,t)=>{Iy.init(e,t),rp.init(e,t)}),$S=Z("$ZodBoolean",(e,t)=>{Ne.init(e,t),e._zod.pattern=Ry,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}});var wS=Z("$ZodNull",(e,t)=>{Ne.init(e,t),e._zod.pattern=Py,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}});var RS=Z("$ZodUnknown",(e,t)=>{Ne.init(e,t),e._zod.parse=r=>r}),PS=Z("$ZodNever",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Vy(e,t,r){e.issues.length&&t.issues.push(...lr(r,e.issues)),t.value[r]=e.value}var ES=Z("$ZodArray",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let s=[];for(let i=0;i<n.length;i++){let a=n[i],c=t.element._zod.run({value:a,issues:[]},o);c instanceof Promise?s.push(c.then(u=>Vy(u,r,i))):Vy(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function iu(e,t,r,o,n,s){let i=r in o;if(e.issues.length){if(n&&s&&!i)return;t.issues.push(...lr(r,e.issues))}if(!i&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?i&&(t.value[r]=void 0):t.value[r]=e.value}function kS(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=Jd(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function xS(e,t,r,o,n,s){let i=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optin==="optional",d=c.optout==="optional";for(let p in t){if(p==="__proto__"||a.has(p))continue;if(u==="never"){i.push(p);continue}let g=c.run({value:t[p],issues:[]},o);g instanceof Promise?e.push(g.then(f=>iu(f,r,p,t,l,d))):iu(g,r,p,t,l,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}var qP=Z("$ZodObject",(e,t)=>{if(Ne.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=en(()=>kS(t));$e(e._zod,"propValues",()=>{let a=t.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let n=io,s=t.catchall,i;e._zod.parse=(a,c)=>{i??(i=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let l=[],d=i.shape;for(let p of i.keys){let g=d[p],f=g._zod.optin==="optional",_=g._zod.optout==="optional",m=g._zod.run({value:u[p],issues:[]},c);m instanceof Promise?l.push(m.then(h=>iu(h,a,p,u,f,_))):iu(m,a,p,u,f,_)}return s?xS(l,u,a,c,o.value,e):l.length?Promise.all(l).then(()=>a):a}}),TS=Z("$ZodObjectJIT",(e,t)=>{qP.init(e,t);let r=e._zod.parse,o=en(()=>kS(t)),n=p=>{let g=new nu(["shape","payload","ctx"]),f=o.value,_=v=>{let S=Yc(v);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};g.write("const input = payload.value;");let m=Object.create(null),h=0;for(let v of f.keys)m[v]=`key_${h++}`;g.write("const newResult = {};");for(let v of f.keys){let S=m[v],R=Yc(v),b=p[v],y=b?._zod?.optin==="optional",$=b?._zod?.optout==="optional";g.write(`const ${S} = ${_(v)};`),y&&$?g.write(`
60
+ if (${S}.issues.length) {
61
61
  if (${R} in input) {
62
- payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
62
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
63
63
  ...iss,
64
64
  path: iss.path ? [${R}, ...iss.path] : [${R}]
65
65
  })));
66
66
  }
67
67
  }
68
68
 
69
- if (${b}.value === undefined) {
69
+ if (${S}.value === undefined) {
70
70
  if (${R} in input) {
71
71
  newResult[${R}] = undefined;
72
72
  }
73
73
  } else {
74
- newResult[${R}] = ${b}.value;
74
+ newResult[${R}] = ${S}.value;
75
75
  }
76
76
 
77
77
  `):y?g.write(`
78
- if (${b}.issues.length) {
79
- payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
78
+ if (${S}.issues.length) {
79
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
80
80
  ...iss,
81
81
  path: iss.path ? [${R}, ...iss.path] : [${R}]
82
82
  })));
83
83
  }
84
84
 
85
- if (${b}.value === undefined) {
85
+ if (${S}.value === undefined) {
86
86
  if (${R} in input) {
87
87
  newResult[${R}] = undefined;
88
88
  }
89
89
  } else {
90
- newResult[${R}] = ${b}.value;
90
+ newResult[${R}] = ${S}.value;
91
91
  }
92
92
 
93
93
  `):g.write(`
94
- const ${b}_present = ${R} in input;
95
- if (${b}.issues.length) {
96
- payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
94
+ const ${S}_present = ${R} in input;
95
+ if (${S}.issues.length) {
96
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
97
97
  ...iss,
98
98
  path: iss.path ? [${R}, ...iss.path] : [${R}]
99
99
  })));
100
100
  }
101
- if (!${b}_present && !${b}.issues.length) {
101
+ if (!${S}_present && !${S}.issues.length) {
102
102
  payload.issues.push({
103
103
  code: "invalid_type",
104
104
  expected: "nonoptional",
@@ -107,24 +107,52 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
107
107
  });
108
108
  }
109
109
 
110
- if (${b}_present) {
111
- if (${b}.value === undefined) {
110
+ if (${S}_present) {
111
+ if (${S}.value === undefined) {
112
112
  newResult[${R}] = undefined;
113
113
  } else {
114
- newResult[${R}] = ${b}.value;
114
+ newResult[${R}] = ${S}.value;
115
115
  }
116
116
  }
117
117
 
118
- `)}g.write("payload.value = newResult;"),g.write("return payload;");let z=g.compile();return(_,b)=>z(p,_,b)},s,i=Wr,a=!Do.jitless,u=a&&wd.value,l=t.catchall,d;e._zod.parse=(p,g)=>{d??(d=o.value);let m=p.value;return i(m)?a&&u&&g?.async===!1&&g.jitless!==!0?(s||(s=n(t.shape)),p=s(p,g),l?mS([],m,p,g,d,e):p):r(p,g):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),p)}});function xy(e,t,r,o){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter(s=>!Pr(s));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>xt(i,o,wt())))}),t)}var qd=Z("$ZodUnion",(e,t)=>{Ne.init(e,t),$e(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),$e(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),$e(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),$e(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>ys(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,i=[];for(let a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>xy(a,o,e,n)):xy(i,o,e,n)}});var hS=Z("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,qd.init(e,t);let r=e._zod.parse;$e(e._zod,"propValues",()=>{let n={};for(let s of t.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[a,c]of Object.entries(i)){n[a]||(n[a]=new Set);for(let u of c)n[a].add(u)}}return n});let o=Fo(()=>{let n=t.options,s=new Map;for(let i of n){let a=i._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});e._zod.parse=(n,s)=>{let i=n.value;if(!Wr(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let a=o.value.get(i?.[t.discriminator]);return a?a._zod.run(n,s):t.unionFallback||s.direction==="backward"?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:i,path:[t.discriminator],inst:e}),n)}}),gS=Z("$ZodIntersection",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,s=t.left._zod.run({value:n,issues:[]},o),i=t.right._zod.run({value:n,issues:[]},o);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>Ty(r,c,u)):Ty(r,s,i)}});function Ad(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Rr(e)&&Rr(t)){let r=Object.keys(t),o=Object.keys(e).filter(s=>r.indexOf(s)!==-1),n={...e,...t};for(let s of o){let i=Ad(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],s=t[o],i=Ad(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Ty(e,t,r){let o=new Map,n;for(let a of t.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let c of a.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else e.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else e.issues.push(a);let s=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&n&&e.issues.push({...n,keys:s}),Pr(e))return e;let i=Ad(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var _S=Z("$ZodRecord",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Rr(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let s=[],i=t.keyType._zod.values;if(i){r.value={};let a=new Set;for(let u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let l=t.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(g=>xt(g,o,wt())),input:u,path:[u],inst:e});continue}let d=l.value,p=t.valueType._zod.run({value:n[u],issues:[]},o);p instanceof Promise?s.push(p.then(g=>{g.issues.length&&r.issues.push(...or(u,g.issues)),r.value[d]=g.value})):(p.issues.length&&r.issues.push(...or(u,p.issues)),r.value[d]=p.value)}let c;for(let u in n)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=t.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Cd.test(a)&&c.issues.length){let d=t.keyType._zod.run({value:Number(a),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){t.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>xt(d,o,wt())),input:a,path:[a],inst:e});continue}let l=t.valueType._zod.run({value:n[a],issues:[]},o);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&r.issues.push(...or(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...or(a,l.issues)),r.value[c.value]=l.value)}}return s.length?Promise.all(s).then(()=>r):r}});var vS=Z("$ZodEnum",(e,t)=>{Ne.init(e,t);let r=_s(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Rd.has(typeof n)).map(n=>typeof n=="string"?rr(n):n.toString()).join("|")})$`),e._zod.parse=(n,s)=>{let i=n.value;return o.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),yS=Z("$ZodLiteral",(e,t)=>{if(Ne.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?rr(o):o?rr(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var SS=Z("$ZodTransform",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Lo(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(r.value=i,r.fallback=!0,r));if(n instanceof Promise)throw new Ut;return r.value=n,r.fallback=!0,r}});function Iy(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Zd=Z("$ZodOptional",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",e._zod.optout="optional",$e(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),$e(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ys(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,s=t.innerType._zod.run(r,o);return s instanceof Promise?s.then(i=>Iy(i,n)):Iy(s,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),bS=Z("$ZodExactOptional",(e,t)=>{Zd.init(e,t),$e(e._zod,"values",()=>t.innerType._zod.values),$e(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),zS=Z("$ZodNullable",(e,t)=>{Ne.init(e,t),$e(e._zod,"optin",()=>t.innerType._zod.optin),$e(e._zod,"optout",()=>t.innerType._zod.optout),$e(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ys(r.source)}|null)$`):void 0}),$e(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),$S=Z("$ZodDefault",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",$e(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>Oy(s,t)):Oy(n,t)}});function Oy(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var wS=Z("$ZodPrefault",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",$e(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),RS=Z("$ZodNonOptional",(e,t)=>{Ne.init(e,t),$e(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>Cy(s,e)):Cy(n,e)}});function Cy(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var PS=Z("$ZodCatch",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",$e(e._zod,"optout",()=>t.innerType._zod.optout),$e(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>xt(i,o,wt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(s=>xt(s,o,wt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}});var Ld=Z("$ZodPipe",(e,t)=>{Ne.init(e,t),$e(e._zod,"values",()=>t.in._zod.values),$e(e._zod,"optin",()=>t.in._zod.optin),$e(e._zod,"optout",()=>t.out._zod.optout),$e(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);return s instanceof Promise?s.then(i=>Fc(i,t.in,o)):Fc(s,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(s=>Fc(s,t.out,o)):Fc(n,t.out,o)}});function Fc(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var ES=Z("$ZodPreprocess",(e,t)=>{Ld.init(e,t)}),kS=Z("$ZodReadonly",(e,t)=>{Ne.init(e,t),$e(e._zod,"propValues",()=>t.innerType._zod.propValues),$e(e._zod,"values",()=>t.innerType._zod.values),$e(e._zod,"optin",()=>t.innerType?._zod?.optin),$e(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Ny):Ny(n)}});function Ny(e){return e.value=Object.freeze(e.value),e}var xS=Z("$ZodLazy",(e,t)=>{Ne.init(e,t),$e(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),$e(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),$e(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),$e(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),$e(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),TS=Z("$ZodCustom",(e,t)=>{it.init(e,t),Ne.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(s=>jy(s,r,o,e));jy(n,r,o,e)}});function jy(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(Vo(n))}}var tP=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=o[n.expected]??n.expected,i=xd(n.input),a=o[i]??i;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${Mc(n.values[0])}`:`Invalid option: expected one of ${Nc(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",i=t(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",i=t(n.origin);return i?`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Nc(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function IS(){return{localeError:tP()}}var OS,aC=Symbol("ZodOutput"),cC=Symbol("ZodInput"),Dd=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function rP(){return new Dd}(OS=globalThis).__zod_globalRegistry??(OS.__zod_globalRegistry=rP());var Yr=globalThis.__zod_globalRegistry;function CS(e,t){return new e({type:"string",...ce(t)})}function Ud(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ce(t)})}function Fd(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ce(t)})}function NS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ce(t)})}function jS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ce(t)})}function AS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ce(t)})}function MS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ce(t)})}function Vd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ce(t)})}function qS(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ce(t)})}function ZS(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ce(t)})}function LS(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ce(t)})}function DS(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ce(t)})}function US(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ce(t)})}function FS(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ce(t)})}function VS(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ce(t)})}function JS(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ce(t)})}function HS(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ce(t)})}function BS(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ce(t)})}function KS(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ce(t)})}function GS(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ce(t)})}function WS(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ce(t)})}function YS(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ce(t)})}function XS(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ce(t)})}function QS(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ce(t)})}function eb(e,t){return new e({type:"string",format:"date",check:"string_format",...ce(t)})}function tb(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ce(t)})}function rb(e,t){return new e({type:"string",format:"duration",check:"string_format",...ce(t)})}function ob(e,t){return new e({type:"number",checks:[],...ce(t)})}function nb(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ce(t)})}function sb(e,t){return new e({type:"boolean",...ce(t)})}function ib(e,t){return new e({type:"null",...ce(t)})}function ab(e){return new e({type:"unknown"})}function cb(e,t){return new e({type:"never",...ce(t)})}function Hc(e,t){return new Nd({check:"less_than",...ce(t),value:e,inclusive:!1})}function ws(e,t){return new Nd({check:"less_than",...ce(t),value:e,inclusive:!0})}function Bc(e,t){return new jd({check:"greater_than",...ce(t),value:e,inclusive:!1})}function Rs(e,t){return new jd({check:"greater_than",...ce(t),value:e,inclusive:!0})}function Kc(e,t){return new fy({check:"multiple_of",...ce(t),value:e})}function Gc(e,t){return new gy({check:"max_length",...ce(t),maximum:e})}function Jo(e,t){return new _y({check:"min_length",...ce(t),minimum:e})}function Wc(e,t){return new vy({check:"length_equals",...ce(t),length:e})}function Jd(e,t){return new yy({check:"string_format",format:"regex",...ce(t),pattern:e})}function Hd(e){return new Sy({check:"string_format",format:"lowercase",...ce(e)})}function Bd(e){return new by({check:"string_format",format:"uppercase",...ce(e)})}function Kd(e,t){return new zy({check:"string_format",format:"includes",...ce(t),includes:e})}function Gd(e,t){return new $y({check:"string_format",format:"starts_with",...ce(t),prefix:e})}function Wd(e,t){return new wy({check:"string_format",format:"ends_with",...ce(t),suffix:e})}function Er(e){return new Ry({check:"overwrite",tx:e})}function Yd(e){return Er(t=>t.normalize(e))}function Xd(){return Er(e=>e.trim())}function Qd(){return Er(e=>e.toLowerCase())}function ep(){return Er(e=>e.toUpperCase())}function tp(){return Er(e=>$d(e))}function ub(e,t,r){return new e({type:"array",element:t,...ce(r)})}function lb(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ce(r)})}function db(e,t){let r=oP(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Vo(n,o.value,r._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=o.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(Vo(s))}},e(o.value,o)),t);return r}function oP(e,t){let r=new it({check:"custom",...ce(t)});return r._zod.check=e,r}function Es(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Yr,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Te(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);let a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{let p=i.schema,g=t.processors[n.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);g(e,t,p,l)}let d=e._zod.parent;d&&(i.ref||(i.ref=d),Te(d,t,l),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&ft(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function ks(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let i of e.seen.entries()){let a=e.metadataRegistry.get(i[0])?.id;if(a){let c=o.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}let n=i=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(i[0])?.id,p=e.external.uri??(m=>m);if(d)return{ref:p(d)};let g=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=g,{defId:g,ref:`${p("__shared")}#/${a}/${g}`}}if(i[1]===r)return{ref:"#"};let u=`#/${a}/`,l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},s=i=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=n(i);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
118
+ `)}g.write("payload.value = newResult;"),g.write("return payload;");let z=g.compile();return(v,S)=>z(p,v,S)},s,i=io,a=!Xo.jitless,u=a&&Fd.value,l=t.catchall,d;e._zod.parse=(p,g)=>{d??(d=o.value);let f=p.value;return i(f)?a&&u&&g?.async===!1&&g.jitless!==!0?(s||(s=n(t.shape)),p=s(p,g),l?xS([],f,p,g,d,e):p):r(p,g):(p.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),p)}});function Jy(e,t,r,o){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter(s=>!jr(s));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>It(i,o,Rt())))}),t)}var op=Z("$ZodUnion",(e,t)=>{Ne.init(e,t),$e(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),$e(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),$e(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),$e(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>Cs(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,i=[];for(let a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>Jy(a,o,e,n)):Jy(i,o,e,n)}});var IS=Z("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,op.init(e,t);let r=e._zod.parse;$e(e._zod,"propValues",()=>{let n={};for(let s of t.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[a,c]of Object.entries(i)){n[a]||(n[a]=new Set);for(let u of c)n[a].add(u)}}return n});let o=en(()=>{let n=t.options,s=new Map;for(let i of n){let a=i._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});e._zod.parse=(n,s)=>{let i=n.value;if(!io(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let a=o.value.get(i?.[t.discriminator]);return a?a._zod.run(n,s):t.unionFallback||s.direction==="backward"?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:i,path:[t.discriminator],inst:e}),n)}}),OS=Z("$ZodIntersection",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,s=t.left._zod.run({value:n,issues:[]},o),i=t.right._zod.run({value:n,issues:[]},o);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>Hy(r,c,u)):Hy(r,s,i)}});function tp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Nr(e)&&Nr(t)){let r=Object.keys(t),o=Object.keys(e).filter(s=>r.indexOf(s)!==-1),n={...e,...t};for(let s of o){let i=tp(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],s=t[o],i=tp(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Hy(e,t,r){let o=new Map,n;for(let a of t.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let c of a.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else e.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else e.issues.push(a);let s=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&n&&e.issues.push({...n,keys:s}),jr(e))return e;let i=tp(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var CS=Z("$ZodRecord",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Nr(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let s=[],i=t.keyType._zod.values;if(i){r.value={};let a=new Set;for(let u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let l=t.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(g=>It(g,o,Rt())),input:u,path:[u],inst:e});continue}let d=l.value,p=t.valueType._zod.run({value:n[u],issues:[]},o);p instanceof Promise?s.push(p.then(g=>{g.issues.length&&r.issues.push(...lr(u,g.issues)),r.value[d]=g.value})):(p.issues.length&&r.issues.push(...lr(u,p.issues)),r.value[d]=p.value)}let c;for(let u in n)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=t.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Xd.test(a)&&c.issues.length){let d=t.keyType._zod.run({value:Number(a),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){t.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>It(d,o,Rt())),input:a,path:[a],inst:e});continue}let l=t.valueType._zod.run({value:n[a],issues:[]},o);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&r.issues.push(...lr(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...lr(a,l.issues)),r.value[c.value]=l.value)}}return s.length?Promise.all(s).then(()=>r):r}});var NS=Z("$ZodEnum",(e,t)=>{Ne.init(e,t);let r=Is(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Vd.has(typeof n)).map(n=>typeof n=="string"?ur(n):n.toString()).join("|")})$`),e._zod.parse=(n,s)=>{let i=n.value;return o.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),jS=Z("$ZodLiteral",(e,t)=>{if(Ne.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?ur(o):o?ur(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var AS=Z("$ZodTransform",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Yo(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(r.value=i,r.fallback=!0,r));if(n instanceof Promise)throw new Gt;return r.value=n,r.fallback=!0,r}});function By(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var np=Z("$ZodOptional",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",e._zod.optout="optional",$e(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),$e(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Cs(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,s=t.innerType._zod.run(r,o);return s instanceof Promise?s.then(i=>By(i,n)):By(s,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),MS=Z("$ZodExactOptional",(e,t)=>{np.init(e,t),$e(e._zod,"values",()=>t.innerType._zod.values),$e(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),qS=Z("$ZodNullable",(e,t)=>{Ne.init(e,t),$e(e._zod,"optin",()=>t.innerType._zod.optin),$e(e._zod,"optout",()=>t.innerType._zod.optout),$e(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Cs(r.source)}|null)$`):void 0}),$e(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),ZS=Z("$ZodDefault",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",$e(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>Ky(s,t)):Ky(n,t)}});function Ky(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var LS=Z("$ZodPrefault",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",$e(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),DS=Z("$ZodNonOptional",(e,t)=>{Ne.init(e,t),$e(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>Gy(s,e)):Gy(n,e)}});function Gy(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var US=Z("$ZodCatch",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",$e(e._zod,"optout",()=>t.innerType._zod.optout),$e(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>It(i,o,Rt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(s=>It(s,o,Rt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}});var sp=Z("$ZodPipe",(e,t)=>{Ne.init(e,t),$e(e._zod,"values",()=>t.in._zod.values),$e(e._zod,"optin",()=>t.in._zod.optin),$e(e._zod,"optout",()=>t.out._zod.optout),$e(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);return s instanceof Promise?s.then(i=>su(i,t.in,o)):su(s,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(s=>su(s,t.out,o)):su(n,t.out,o)}});function su(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var FS=Z("$ZodPreprocess",(e,t)=>{sp.init(e,t)}),VS=Z("$ZodReadonly",(e,t)=>{Ne.init(e,t),$e(e._zod,"propValues",()=>t.innerType._zod.propValues),$e(e._zod,"values",()=>t.innerType._zod.values),$e(e._zod,"optin",()=>t.innerType?._zod?.optin),$e(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Wy):Wy(n)}});function Wy(e){return e.value=Object.freeze(e.value),e}var JS=Z("$ZodLazy",(e,t)=>{Ne.init(e,t),$e(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),$e(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),$e(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),$e(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),$e(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),HS=Z("$ZodCustom",(e,t)=>{at.init(e,t),Ne.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(s=>Yy(s,r,o,e));Yy(n,r,o,e)}});function Yy(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(tn(n))}}var ZP=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=o[n.expected]??n.expected,i=Kd(n.input),a=o[i]??i;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${Qc(n.values[0])}`:`Invalid option: expected one of ${Wc(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",i=t(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",i=t(n.origin);return i?`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Wc(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function BS(){return{localeError:ZP()}}var KS,aN=Symbol("ZodOutput"),cN=Symbol("ZodInput"),ip=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function LP(){return new ip}(KS=globalThis).__zod_globalRegistry??(KS.__zod_globalRegistry=LP());var ao=globalThis.__zod_globalRegistry;function GS(e,t){return new e({type:"string",...ce(t)})}function ap(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ce(t)})}function cp(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ce(t)})}function WS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ce(t)})}function YS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ce(t)})}function XS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ce(t)})}function QS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ce(t)})}function up(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ce(t)})}function eb(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ce(t)})}function tb(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ce(t)})}function rb(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ce(t)})}function ob(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ce(t)})}function nb(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ce(t)})}function sb(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ce(t)})}function ib(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ce(t)})}function ab(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ce(t)})}function cb(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ce(t)})}function ub(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ce(t)})}function lb(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ce(t)})}function db(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ce(t)})}function pb(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ce(t)})}function mb(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ce(t)})}function fb(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ce(t)})}function hb(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ce(t)})}function gb(e,t){return new e({type:"string",format:"date",check:"string_format",...ce(t)})}function _b(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ce(t)})}function vb(e,t){return new e({type:"string",format:"duration",check:"string_format",...ce(t)})}function yb(e,t){return new e({type:"number",checks:[],...ce(t)})}function Sb(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ce(t)})}function bb(e,t){return new e({type:"boolean",...ce(t)})}function zb(e,t){return new e({type:"null",...ce(t)})}function $b(e){return new e({type:"unknown"})}function wb(e,t){return new e({type:"never",...ce(t)})}function cu(e,t){return new Qd({check:"less_than",...ce(t),value:e,inclusive:!1})}function qs(e,t){return new Qd({check:"less_than",...ce(t),value:e,inclusive:!0})}function uu(e,t){return new ep({check:"greater_than",...ce(t),value:e,inclusive:!1})}function Zs(e,t){return new ep({check:"greater_than",...ce(t),value:e,inclusive:!0})}function lu(e,t){return new Ty({check:"multiple_of",...ce(t),value:e})}function du(e,t){return new Oy({check:"max_length",...ce(t),maximum:e})}function rn(e,t){return new Cy({check:"min_length",...ce(t),minimum:e})}function pu(e,t){return new Ny({check:"length_equals",...ce(t),length:e})}function lp(e,t){return new jy({check:"string_format",format:"regex",...ce(t),pattern:e})}function dp(e){return new Ay({check:"string_format",format:"lowercase",...ce(e)})}function pp(e){return new My({check:"string_format",format:"uppercase",...ce(e)})}function mp(e,t){return new qy({check:"string_format",format:"includes",...ce(t),includes:e})}function fp(e,t){return new Zy({check:"string_format",format:"starts_with",...ce(t),prefix:e})}function hp(e,t){return new Ly({check:"string_format",format:"ends_with",...ce(t),suffix:e})}function Ar(e){return new Dy({check:"overwrite",tx:e})}function gp(e){return Ar(t=>t.normalize(e))}function _p(){return Ar(e=>e.trim())}function vp(){return Ar(e=>e.toLowerCase())}function yp(){return Ar(e=>e.toUpperCase())}function Sp(){return Ar(e=>Ud(e))}function Rb(e,t,r){return new e({type:"array",element:t,...ce(r)})}function Pb(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ce(r)})}function Eb(e,t){let r=DP(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(tn(n,o.value,r._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=o.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(tn(s))}},e(o.value,o)),t);return r}function DP(e,t){let r=new at({check:"custom",...ce(t)});return r._zod.check=e,r}function Ds(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ao,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Te(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);let a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{let p=i.schema,g=t.processors[n.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);g(e,t,p,l)}let d=e._zod.parent;d&&(i.ref||(i.ref=d),Te(d,t,l),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&ht(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Us(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let i of e.seen.entries()){let a=e.metadataRegistry.get(i[0])?.id;if(a){let c=o.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}let n=i=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(i[0])?.id,p=e.external.uri??(f=>f);if(d)return{ref:p(d)};let g=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=g,{defId:g,ref:`${p("__shared")}#/${a}/${g}`}}if(i[1]===r)return{ref:"#"};let u=`#/${a}/`,l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},s=i=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=n(i);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
119
119
 
120
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&e.reused==="ref"){s(i);continue}}}function xs(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);let g=e.seen.get(d),m=g.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):Object.assign(u,m),Object.assign(u,l),a._zod.parent===d)for(let h in u)h==="$ref"||h==="allOf"||h in l||delete u[h];if(m.$ref&&g.def)for(let h in u)h==="$ref"||h==="allOf"||h in g.def&&JSON.stringify(u[h])===JSON.stringify(g.def[h])&&delete u[h]}let p=a._zod.parent;if(p&&p!==d){o(p);let g=e.seen.get(p);if(g?.schema.$ref&&(u.$ref=g.schema.$ref,g.def))for(let m in u)m==="$ref"||m==="allOf"||m in g.def&&JSON.stringify(u[m])===JSON.stringify(g.def[m])&&delete u[m]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...e.seen.entries()].reverse())o(a[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Object.assign(n,r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;s!==void 0&&n.id===s&&delete n.id;let i=e.external?.defs??{};for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,i[c.defId]=c.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ps(t,"input",e.processors),output:Ps(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function ft(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return ft(o.element,r);if(o.type==="set")return ft(o.valueType,r);if(o.type==="lazy")return ft(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return ft(o.innerType,r);if(o.type==="intersection")return ft(o.left,r)||ft(o.right,r);if(o.type==="record"||o.type==="map")return ft(o.keyType,r)||ft(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ft(o.in,r)||ft(o.out,r);if(o.type==="object"){for(let n in o.shape)if(ft(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(ft(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(ft(n,r))return!0;return!!(o.rest&&ft(o.rest,r))}return!1}var pb=(e,t={})=>r=>{let o=Es({...r,processors:t});return Te(e,o),ks(o,e),xs(o,e)},Ps=(e,t,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=Es({...n??{},target:s,io:t,processors:r});return Te(e,i),ks(i,e),xs(i,e)};var nP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},rp=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),a&&(n.format=nP[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},op=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number";let d=typeof l=="number"&&l>=(s??Number.NEGATIVE_INFINITY),p=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),g=t.target==="draft-04"||t.target==="openapi-3.0";d?g?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:typeof s=="number"&&(n.minimum=s),p?g?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof i=="number"&&(n.maximum=i),typeof c=="number"&&(n.multipleOf=c)},np=(e,t,r,o)=>{r.type="boolean"},fb=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},hb=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},sp=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},gb=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},_b=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},ip=(e,t,r,o)=>{r.not={}},vb=(e,t,r,o)=>{},ap=(e,t,r,o)=>{},yb=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},cp=(e,t,r,o)=>{let n=e._zod.def,s=_s(n.entries);s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},up=(e,t,r,o)=>{let n=e._zod.def,s=[];for(let i of n.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s},Sb=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},bb=(e,t,r,o)=>{let n=r,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},zb=(e,t,r,o)=>{let n=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:a,mime:c}=e._zod.bag;i!==void 0&&(s.minLength=i),a!==void 0&&(s.maxLength=a),c?c.length===1?(s.contentMediaType=c[0],Object.assign(n,s)):(Object.assign(n,s),n.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(n,s)},$b=(e,t,r,o)=>{r.type="boolean"},lp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},wb=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},dp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Rb=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Pb=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},pp=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(n.minItems=i),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=Te(s.element,t,{...o,path:[...o.path,"items"]})},mp=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object",n.properties={};let i=s.shape;for(let u in i)n.properties[u]=Te(i[u],t,{...o,path:[...o.path,"properties",u]});let a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{let l=s.shape[u]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(n.required=Array.from(c)),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=Te(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},fp=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>Te(a,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},hp=(e,t,r,o)=>{let n=e._zod.def,s=Te(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=Te(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c},Eb=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((p,g)=>Te(p,t,{...o,path:[...o.path,i,g]})),u=s.rest?Te(s.rest,t,{...o,path:[...o.path,a,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=c,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:c},u&&n.items.anyOf.push(u),n.minItems=c.length,u||(n.maxItems=c.length)):(n.items=c,u&&(n.additionalItems=u));let{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(n.minItems=l),typeof d=="number"&&(n.maxItems=d)},gp=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,c=i._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let l=Te(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of c)n.patternProperties[d.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=Te(s.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=Te(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let u=i._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l)}},_p=(e,t,r,o)=>{let n=e._zod.def,s=Te(n.innerType,t,o),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},vp=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},yp=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Sp=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},bp=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},zp=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;Te(i,t,o);let a=t.seen.get(e);a.ref=i},$p=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},kb=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Yc=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},wp=(e,t,r,o)=>{let n=e._zod.innerType;Te(n,t,o);let s=t.seen.get(e);s.ref=n},mb={string:rp,number:op,boolean:np,bigint:fb,symbol:hb,null:sp,undefined:gb,void:_b,never:ip,any:vb,unknown:ap,date:yb,enum:cp,literal:up,nan:Sb,template_literal:bb,file:zb,success:$b,custom:lp,function:wb,transform:dp,map:Rb,set:Pb,array:pp,object:mp,union:fp,intersection:hp,tuple:Eb,record:gp,nullable:_p,nonoptional:vp,default:yp,prefault:Sp,catch:bp,pipe:zp,readonly:$p,promise:kb,optional:Yc,lazy:wp};function Xc(e,t){if("_idmap"in e){let o=e,n=Es({...t,processors:mb}),s={};for(let c of o._idmap.entries()){let[u,l]=c;Te(l,n)}let i={},a={registry:o,uri:t?.uri,defs:s};n.external=a;for(let c of o._idmap.entries()){let[u,l]=c;ks(n,l),i[u]=xs(n,l)}if(Object.keys(s).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:s}}return{schemas:i}}let r=Es({...t,processors:mb});return Te(e,r),ks(r,e),xs(r,e)}var kr={};mo(kr,{ZodISODate:()=>Tb,ZodISODateTime:()=>xb,ZodISODuration:()=>Ob,ZodISOTime:()=>Ib,date:()=>Pp,datetime:()=>Rp,duration:()=>kp,time:()=>Ep});var xb=Z("ZodISODateTime",(e,t)=>{By.init(e,t),De.init(e,t)});function Rp(e){return QS(xb,e)}var Tb=Z("ZodISODate",(e,t)=>{Ky.init(e,t),De.init(e,t)});function Pp(e){return eb(Tb,e)}var Ib=Z("ZodISOTime",(e,t)=>{Gy.init(e,t),De.init(e,t)});function Ep(e){return tb(Ib,e)}var Ob=Z("ZodISODuration",(e,t)=>{Wy.init(e,t),De.init(e,t)});function kp(e){return rb(Ob,e)}var mP=(e,t)=>{qc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>kv(e,r)},flatten:{value:r=>Ev(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Uo,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Uo,2)}},isEmpty:{get(){return e.issues.length===0}}})};var Rt=Z("ZodError",mP,{Parent:Error});var Cb=Zc(Rt),Nb=Lc(Rt),Qc=bs(Rt),jb=zs(Rt),Ab=Iv(Rt),Mb=Ov(Rt),qb=Cv(Rt),Zb=Nv(Rt),Lb=jv(Rt),Db=Av(Rt),Ub=Mv(Rt),Fb=qv(Rt);var Vb=new WeakMap;function Is(e,t,r){let o=Object.getPrototypeOf(e),n=Vb.get(o);if(n||(n=new Set,Vb.set(o,n)),!n.has(t)){n.add(t);for(let s in r){let i=r[s];Object.defineProperty(o,s,{configurable:!0,enumerable:!1,get(){let a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var Me=Z("ZodType",(e,t)=>(Ne.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ps(e,"input"),output:Ps(e,"output")}}),e.toJSONSchema=pb(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>Cb(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Qc(e,r,o),e.parseAsync=async(r,o)=>Nb(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>jb(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Ab(e,r,o),e.decode=(r,o)=>Mb(e,r,o),e.encodeAsync=async(r,o)=>qb(e,r,o),e.decodeAsync=async(r,o)=>Zb(e,r,o),e.safeEncode=(r,o)=>Lb(e,r,o),e.safeDecode=(r,o)=>Db(e,r,o),e.safeEncodeAsync=async(r,o)=>Ub(e,r,o),e.safeDecodeAsync=async(r,o)=>Fb(e,r,o),Is(e,"ZodType",{check(...r){let o=this.def;return this.clone(Pe.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Mt(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(oE(r,o))},superRefine(r,o){return this.check(nE(r,o))},overwrite(r){return this.check(Er(r))},optional(){return ve(this)},exactOptional(){return FP(this)},nullable(){return Kb(this)},nullish(){return ve(Kb(this))},nonoptional(r){return GP(this,r)},array(){return G(this)},or(r){return ue([this,r])},and(r){return Ho(this,r)},transform(r){return Gb(this,nz(r))},default(r){return HP(this,r)},prefault(r){return KP(this,r)},catch(r){return YP(this,r)},pipe(r){return Gb(this,r)},readonly(){return eE(this)},describe(r){let o=this.clone();return Yr.add(o,{description:r}),o},meta(...r){if(r.length===0)return Yr.get(this);let o=this.clone();return Yr.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Yr.get(e)?.description},configurable:!0}),e)),Wb=Z("_ZodString",(e,t)=>{Jc.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(o,n,s)=>rp(e,o,n,s);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Is(e,"_ZodString",{regex(...o){return this.check(Jd(...o))},includes(...o){return this.check(Kd(...o))},startsWith(...o){return this.check(Gd(...o))},endsWith(...o){return this.check(Wd(...o))},min(...o){return this.check(Jo(...o))},max(...o){return this.check(Gc(...o))},length(...o){return this.check(Wc(...o))},nonempty(...o){return this.check(Jo(1,...o))},lowercase(o){return this.check(Hd(o))},uppercase(o){return this.check(Bd(o))},trim(){return this.check(Xd())},normalize(...o){return this.check(Yd(...o))},toLowerCase(){return this.check(Qd())},toUpperCase(){return this.check(ep())},slugify(){return this.check(tp())}})}),hP=Z("ZodString",(e,t)=>{Jc.init(e,t),Wb.init(e,t),e.email=r=>e.check(Ud(Yb,r)),e.url=r=>e.check(Vd(Qb,r)),e.jwt=r=>e.check(XS(TP,r)),e.emoji=r=>e.check(qS(gP,r)),e.guid=r=>e.check(Fd(Jb,r)),e.uuid=r=>e.check(NS(eu,r)),e.uuidv4=r=>e.check(jS(eu,r)),e.uuidv6=r=>e.check(AS(eu,r)),e.uuidv7=r=>e.check(MS(eu,r)),e.nanoid=r=>e.check(ZS(_P,r)),e.guid=r=>e.check(Fd(Jb,r)),e.cuid=r=>e.check(LS(vP,r)),e.cuid2=r=>e.check(DS(yP,r)),e.ulid=r=>e.check(US(SP,r)),e.base64=r=>e.check(GS(EP,r)),e.base64url=r=>e.check(WS(kP,r)),e.xid=r=>e.check(FS(bP,r)),e.ksuid=r=>e.check(VS(zP,r)),e.ipv4=r=>e.check(JS($P,r)),e.ipv6=r=>e.check(HS(wP,r)),e.cidrv4=r=>e.check(BS(RP,r)),e.cidrv6=r=>e.check(KS(PP,r)),e.e164=r=>e.check(YS(xP,r)),e.datetime=r=>e.check(Rp(r)),e.date=r=>e.check(Pp(r)),e.time=r=>e.check(Ep(r)),e.duration=r=>e.check(kp(r))});function P(e){return CS(hP,e)}var De=Z("ZodStringFormat",(e,t)=>{Ae.init(e,t),Wb.init(e,t)}),Yb=Z("ZodEmail",(e,t)=>{qy.init(e,t),De.init(e,t)});function Xb(e){return Ud(Yb,e)}var Jb=Z("ZodGUID",(e,t)=>{Ay.init(e,t),De.init(e,t)});var eu=Z("ZodUUID",(e,t)=>{My.init(e,t),De.init(e,t)});var Qb=Z("ZodURL",(e,t)=>{Zy.init(e,t),De.init(e,t)});function ez(e){return Vd(Qb,e)}var gP=Z("ZodEmoji",(e,t)=>{Ly.init(e,t),De.init(e,t)});var _P=Z("ZodNanoID",(e,t)=>{Dy.init(e,t),De.init(e,t)});var vP=Z("ZodCUID",(e,t)=>{Uy.init(e,t),De.init(e,t)});var yP=Z("ZodCUID2",(e,t)=>{Fy.init(e,t),De.init(e,t)});var SP=Z("ZodULID",(e,t)=>{Vy.init(e,t),De.init(e,t)});var bP=Z("ZodXID",(e,t)=>{Jy.init(e,t),De.init(e,t)});var zP=Z("ZodKSUID",(e,t)=>{Hy.init(e,t),De.init(e,t)});var $P=Z("ZodIPv4",(e,t)=>{Yy.init(e,t),De.init(e,t)});var wP=Z("ZodIPv6",(e,t)=>{Xy.init(e,t),De.init(e,t)});var RP=Z("ZodCIDRv4",(e,t)=>{Qy.init(e,t),De.init(e,t)});var PP=Z("ZodCIDRv6",(e,t)=>{eS.init(e,t),De.init(e,t)});var EP=Z("ZodBase64",(e,t)=>{rS.init(e,t),De.init(e,t)});var kP=Z("ZodBase64URL",(e,t)=>{oS.init(e,t),De.init(e,t)});var xP=Z("ZodE164",(e,t)=>{nS.init(e,t),De.init(e,t)});var TP=Z("ZodJWT",(e,t)=>{sS.init(e,t),De.init(e,t)});var tz=Z("ZodNumber",(e,t)=>{Md.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(o,n,s)=>op(e,o,n,s),Is(e,"ZodNumber",{gt(o,n){return this.check(Bc(o,n))},gte(o,n){return this.check(Rs(o,n))},min(o,n){return this.check(Rs(o,n))},lt(o,n){return this.check(Hc(o,n))},lte(o,n){return this.check(ws(o,n))},max(o,n){return this.check(ws(o,n))},int(o){return this.check(Hb(o))},safe(o){return this.check(Hb(o))},positive(o){return this.check(Bc(0,o))},nonnegative(o){return this.check(Rs(0,o))},negative(o){return this.check(Hc(0,o))},nonpositive(o){return this.check(ws(0,o))},multipleOf(o,n){return this.check(Kc(o,n))},step(o,n){return this.check(Kc(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function X(e){return ob(tz,e)}var IP=Z("ZodNumberFormat",(e,t)=>{iS.init(e,t),tz.init(e,t)});function Hb(e){return nb(IP,e)}var OP=Z("ZodBoolean",(e,t)=>{aS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>np(e,r,o,n)});function ge(e){return sb(OP,e)}var CP=Z("ZodNull",(e,t)=>{cS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sp(e,r,o,n)});function tu(e){return ib(CP,e)}var NP=Z("ZodUnknown",(e,t)=>{uS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ap(e,r,o,n)});function he(){return ab(NP)}var jP=Z("ZodNever",(e,t)=>{lS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ip(e,r,o,n)});function AP(e){return cb(jP,e)}var MP=Z("ZodArray",(e,t)=>{dS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pp(e,r,o,n),e.element=t.element,Is(e,"ZodArray",{min(r,o){return this.check(Jo(r,o))},nonempty(r){return this.check(Jo(1,r))},max(r,o){return this.check(Gc(r,o))},length(r,o){return this.check(Wc(r,o))},unwrap(){return this.element}})});function G(e,t){return ub(MP,e,t)}var rz=Z("ZodObject",(e,t)=>{fS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mp(e,r,o,n),Pe.defineLazy(e,"shape",()=>t.shape),Is(e,"ZodObject",{keyof(){return we(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:he()})},loose(){return this.clone({...this._zod.def,catchall:he()})},strict(){return this.clone({...this._zod.def,catchall:AP()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return Pe.extend(this,r)},safeExtend(r){return Pe.safeExtend(this,r)},merge(r){return Pe.merge(this,r)},pick(r){return Pe.pick(this,r)},omit(r){return Pe.omit(this,r)},partial(...r){return Pe.partial(sz,this,r[0])},required(...r){return Pe.required(iz,this,r[0])}})});function N(e,t){let r={type:"object",shape:e??{},...Pe.normalizeParams(t)};return new rz(r)}function ze(e,t){return new rz({type:"object",shape:e,catchall:he(),...Pe.normalizeParams(t)})}var oz=Z("ZodUnion",(e,t)=>{qd.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fp(e,r,o,n),e.options=t.options});function ue(e,t){return new oz({type:"union",options:e,...Pe.normalizeParams(t)})}var qP=Z("ZodDiscriminatedUnion",(e,t)=>{oz.init(e,t),hS.init(e,t)});function Tp(e,t,r){return new qP({type:"union",options:t,discriminator:e,...Pe.normalizeParams(r)})}var ZP=Z("ZodIntersection",(e,t)=>{gS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hp(e,r,o,n)});function Ho(e,t){return new ZP({type:"intersection",left:e,right:t})}var Bb=Z("ZodRecord",(e,t)=>{_S.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gp(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function ie(e,t,r){return!t||!t._zod?new Bb({type:"record",keyType:P(),valueType:e,...Pe.normalizeParams(t)}):new Bb({type:"record",keyType:e,valueType:t,...Pe.normalizeParams(r)})}var xp=Z("ZodEnum",(e,t)=>{vS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(o,n,s)=>cp(e,o,n,s),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new xp({...t,checks:[],...Pe.normalizeParams(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let i of o)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new xp({...t,checks:[],...Pe.normalizeParams(n),entries:s})}});function we(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new xp({type:"enum",entries:r,...Pe.normalizeParams(t)})}var LP=Z("ZodLiteral",(e,t)=>{yS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>up(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function V(e,t){return new LP({type:"literal",values:Array.isArray(e)?e:[e],...Pe.normalizeParams(t)})}var DP=Z("ZodTransform",(e,t)=>{SS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dp(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Lo(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Pe.issue(s,r.value,t));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(Pe.issue(i))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function nz(e){return new DP({type:"transform",transform:e})}var sz=Z("ZodOptional",(e,t)=>{Zd.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ve(e){return new sz({type:"optional",innerType:e})}var UP=Z("ZodExactOptional",(e,t)=>{bS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function FP(e){return new UP({type:"optional",innerType:e})}var VP=Z("ZodNullable",(e,t)=>{zS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_p(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Kb(e){return new VP({type:"nullable",innerType:e})}var JP=Z("ZodDefault",(e,t)=>{$S.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function HP(e,t){return new JP({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Pe.shallowClone(t)}})}var BP=Z("ZodPrefault",(e,t)=>{wS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function KP(e,t){return new BP({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Pe.shallowClone(t)}})}var iz=Z("ZodNonOptional",(e,t)=>{RS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function GP(e,t){return new iz({type:"nonoptional",innerType:e,...Pe.normalizeParams(t)})}var WP=Z("ZodCatch",(e,t)=>{PS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function YP(e,t){return new WP({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var az=Z("ZodPipe",(e,t)=>{Ld.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zp(e,r,o,n),e.in=t.in,e.out=t.out});function Gb(e,t){return new az({type:"pipe",in:e,out:t})}var XP=Z("ZodPreprocess",(e,t)=>{az.init(e,t),ES.init(e,t)}),QP=Z("ZodReadonly",(e,t)=>{kS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$p(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function eE(e){return new QP({type:"readonly",innerType:e})}var tE=Z("ZodLazy",(e,t)=>{xS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wp(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Ip(e){return new tE({type:"lazy",getter:e})}var rE=Z("ZodCustom",(e,t)=>{TS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lp(e,r,o,n)});function oE(e,t={}){return lb(rE,e,t)}function nE(e,t){return db(e,t)}function ru(e,t){return new XP({type:"pipe",in:nz(e),out:t})}wt(IS());var jp=Symbol.for("mcp.sdk.errorBrands");function Zp(e,t){let r=new Set,o=t;for(;typeof o=="function";){let n=o.mcpBrand;Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof n=="string"&&r.add(n),o=Object.getPrototypeOf(o)}r.size!==0&&Object.defineProperty(e,jp,{value:r,enumerable:!1,configurable:!0})}function Ko(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,jp)){let r=t[jp];if(r&&typeof r.has=="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var sE=class Sz extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Ko(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Ko(this,t)}constructor(t,r,o){super(r),this.code=t,this.errorUri=o,this.name="OAuthError",Zp(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}static fromResponse(t){return new Sz(t.error,t.error_description??t.error,t.error_uri)}},_e=function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e}({}),le=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return Ko(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Ko(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="SdkError",Zp(this,new.target)}},iE=class extends le{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r){super(e,t,r),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function cz(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function aE(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function bz(e){switch(e.method){case"elicitation/create":return e.params?.mode==="url"?{elicitation:{url:{}}}:{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;return t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0)?{sampling:{tools:{}}}:{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function lu(e,t){let r={};for(let[o,n]of Object.entries(e)){if(n===void 0)continue;let s=t===void 0?void 0:t[o];if(s===void 0){r[o]=n;continue}if(cz(n)&&cz(s)){let i={};for(let[a,c]of Object.entries(n))c!==void 0&&s[a]===void 0&&!aE(o,a,s)&&(i[a]=c);Object.keys(i).length>0&&(r[o]=i)}}return Object.keys(r).length>0?r:void 0}var zz="2026-07-28",Tr=[zz];function Wo(e){return e>=zz}function $z(e){return e.filter(t=>!Wo(t))}function Lp(e){return e.filter(t=>Wo(t))}function wz(e){let t=e.structuredContent;return t===void 0||!(typeof t!="object"||t===null||Array.isArray(t))||(e.content?.some(r=>r.type==="text")??!1)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var Rz=["task","inputRequests","requestState"];function Dp(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||Rz.some(t=>t in e)?e:{...e,content:[]}}function cE(){let e=Ip(()=>ue([P(),X(),ge(),tu(),ie(P(),e),G(e)])),t=ie(P(),e),r=ue([P(),X().int()]),o=P(),n=N({ttl:X().optional()}),s=N({taskId:P()}),i=ze({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),a=N({_meta:i.optional()}),c=a.extend({task:n.optional()}),u=N({method:P(),params:a.loose().optional()}),l=N({_meta:i.optional()}),d=N({method:P(),params:l.loose().optional()}),p=ze({_meta:i.optional()}),g=ue([P(),X().int()]),m=p.strict(),v=l.extend({requestId:g.optional(),reason:P().optional()}),h=d.extend({method:V("notifications/cancelled"),params:v}),f=N({src:P(),mimeType:P().optional(),sizes:G(P()).optional(),theme:we(["light","dark"]).optional()}),z=N({icons:G(f).optional()}),_=N({name:P(),title:P().optional()}),b=_.extend({..._.shape,...z.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),R=Ho(N({applyDefaults:ge().optional()}),t),S=ru(ut=>ut&&typeof ut=="object"&&!Array.isArray(ut)&&Object.keys(ut).length===0?{form:{}}:ut,Ho(N({form:R.optional(),url:t.optional()}),t.optional())),y=ze({list:t.optional(),cancel:t.optional(),requests:ze({sampling:ze({createMessage:t.optional()}).optional(),elicitation:ze({create:t.optional()}).optional()}).optional()}),$=ze({list:t.optional(),cancel:t.optional(),requests:ze({tools:ze({call:t.optional()}).optional()}).optional()}),I=N({experimental:ie(P(),t).optional(),sampling:N({context:t.optional(),tools:t.optional()}).optional(),elicitation:S.optional(),roots:N({listChanged:ge().optional()}).optional(),tasks:y.optional(),extensions:ie(P(),t).optional()}),q=a.extend({protocolVersion:P(),capabilities:I,clientInfo:b}),O=u.extend({method:V("initialize"),params:q}),L=N({experimental:ie(P(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:N({listChanged:ge().optional()}).optional(),resources:N({subscribe:ge().optional(),listChanged:ge().optional()}).optional(),tools:N({listChanged:ge().optional()}).optional(),tasks:$.optional(),extensions:ie(P(),t).optional()}),K=p.extend({protocolVersion:P(),capabilities:L,serverInfo:b,instructions:P().optional()}),Y=d.extend({method:V("notifications/initialized"),params:l.optional()}),fe=u.extend({method:V("ping"),params:a.optional()}),qe=N({progress:X(),total:ve(X()),message:ve(P())}),Ie=N({...l.shape,...qe.shape,progressToken:r}),Ye=d.extend({method:V("notifications/progress"),params:Ie}),ye=a.extend({cursor:o.optional()}),T=u.extend({params:ye.optional()}),j=p.extend({nextCursor:o.optional()}),F=N({uri:P(),mimeType:ve(P()),_meta:ie(P(),he()).optional()}),w=F.extend({text:P()}),x=P().refine(ut=>{try{return atob(ut),!0}catch{return!1}},{message:"Invalid Base64 string"}),C=F.extend({blob:x}),H=we(["user","assistant"]),te=N({audience:G(H).optional(),priority:X().min(0).max(1).optional(),lastModified:kr.datetime({offset:!0}).optional()}),me=N({..._.shape,...z.shape,uri:P(),description:ve(P()),mimeType:ve(P()),size:ve(X()),annotations:te.optional(),_meta:ve(ze({}))}),se=N({..._.shape,...z.shape,uriTemplate:P(),description:ve(P()),mimeType:ve(P()),annotations:te.optional(),_meta:ve(ze({}))}),Oe=T.extend({method:V("resources/list")}),pt=j.extend({resources:G(me)}),E=T.extend({method:V("resources/templates/list")}),A=j.extend({resourceTemplates:G(se)}),D=a.extend({uri:P()}),oe=D,ne=u.extend({method:V("resources/read"),params:oe}),pe=p.extend({contents:G(ue([w,C]))}),Ge=d.extend({method:V("notifications/resources/list_changed"),params:l.optional()}),et=D,at=u.extend({method:V("resources/subscribe"),params:et}),Xe=D,Ue=u.extend({method:V("resources/unsubscribe"),params:Xe}),Pt=l.extend({uri:P()}),tt=d.extend({method:V("notifications/resources/updated"),params:Pt}),Ft=N({name:P(),description:ve(P()),required:ve(ge())}),It=N({..._.shape,...z.shape,description:ve(P()),arguments:ve(G(Ft)),_meta:ve(ze({}))}),Vt=T.extend({method:V("prompts/list")}),sr=j.extend({prompts:G(It)}),ir=a.extend({name:P(),arguments:ie(P(),P()).optional()}),Cr=u.extend({method:V("prompts/get"),params:ir}),Nr=N({type:V("text"),text:P(),annotations:te.optional(),_meta:ie(P(),he()).optional()}),jr=N({type:V("image"),data:x,mimeType:P(),annotations:te.optional(),_meta:ie(P(),he()).optional()}),Ar=N({type:V("audio"),data:x,mimeType:P(),annotations:te.optional(),_meta:ie(P(),he()).optional()}),en=N({type:V("tool_use"),name:P(),id:P(),input:ie(P(),he()),_meta:ie(P(),he()).optional()}),ar=N({type:V("resource"),resource:ue([w,C]),annotations:te.optional(),_meta:ie(P(),he()).optional()}),tn=me.extend({type:V("resource_link")}),Et=ue([Nr,jr,Ar,tn,ar]),to=N({role:H,content:Et}),ro=p.extend({description:P().optional(),messages:G(to)}),Mr=d.extend({method:V("notifications/prompts/list_changed"),params:l.optional()}),rn=N({title:P().optional(),readOnlyHint:ge().optional(),destructiveHint:ge().optional(),idempotentHint:ge().optional(),openWorldHint:ge().optional()}),oo=N({taskSupport:we(["required","optional","forbidden"]).optional()}),qr=N({..._.shape,...z.shape,description:P().optional(),inputSchema:N({type:V("object"),properties:ie(P(),e).optional(),required:G(P()).optional()}).catchall(he()),outputSchema:N({type:V("object"),properties:ie(P(),e).optional(),required:G(P()).optional()}).catchall(he()).optional(),annotations:rn.optional(),execution:oo.optional(),_meta:ie(P(),he()).optional()}),no=T.extend({method:V("tools/list")}),so=j.extend({tools:G(qr)}),io=p.extend({content:G(Et),structuredContent:ie(P(),he()).optional(),isError:ge().optional()}),ct=c.extend({name:P(),arguments:ie(P(),he()).optional()}),on=u.extend({method:V("tools/call"),params:ct}),Us=d.extend({method:V("notifications/tools/list_changed"),params:l.optional()}),ao=we(["debug","info","notice","warning","error","critical","alert","emergency"]),nn=a.extend({level:ao}),sn=u.extend({method:V("logging/setLevel"),params:nn}),an=l.extend({level:ao,logger:P().optional(),data:he()}),cn=d.extend({method:V("notifications/message"),params:an}),un=N({name:P().optional()}),ln=N({hints:G(un).optional(),costPriority:X().min(0).max(1).optional(),speedPriority:X().min(0).max(1).optional(),intelligencePriority:X().min(0).max(1).optional()}),dn=N({mode:we(["auto","required","none"]).optional()}),Fs=N({type:V("tool_result"),toolUseId:P().describe("The unique identifier for the corresponding tool call."),content:G(Et),structuredContent:N({}).loose().optional(),isError:ge().optional(),_meta:ie(P(),he()).optional()}),pn=Tp("type",[Nr,jr,Ar]),cr=Tp("type",[Nr,jr,Ar,en,Fs]),mn=N({role:H,content:ue([cr,G(cr)]),_meta:ie(P(),he()).optional()}),fn=c.extend({messages:G(mn),modelPreferences:ln.optional(),systemPrompt:P().optional(),includeContext:we(["none","thisServer","allServers"]).optional(),temperature:X().optional(),maxTokens:X().int(),stopSequences:G(P()).optional(),metadata:t.optional(),tools:G(qr).optional(),toolChoice:dn.optional()}),hn=u.extend({method:V("sampling/createMessage"),params:fn}),gn=p.extend({model:P(),stopReason:ve(we(["endTurn","stopSequence","maxTokens"]).or(P())),role:H,content:pn}),_n=p.extend({model:P(),stopReason:ve(we(["endTurn","stopSequence","maxTokens","toolUse"]).or(P())),role:H,content:ue([cr,G(cr)])}),vn=N({type:V("boolean"),title:P().optional(),description:P().optional(),default:ge().optional()}),yn=N({type:V("string"),title:P().optional(),description:P().optional(),minLength:X().optional(),maxLength:X().optional(),format:we(["email","uri","date","date-time"]).optional(),default:P().optional()}),Sn=N({type:we(["number","integer"]),title:P().optional(),description:P().optional(),minimum:X().optional(),maximum:X().optional(),default:X().optional()}),bn=N({type:V("string"),title:P().optional(),description:P().optional(),enum:G(P()),default:P().optional()}),zn=N({type:V("string"),title:P().optional(),description:P().optional(),oneOf:G(N({const:P(),title:P()})),default:P().optional()}),$n=N({type:V("string"),title:P().optional(),description:P().optional(),enum:G(P()),enumNames:G(P()).optional(),default:P().optional()}),wn=ue([bn,zn]),Zr=N({type:V("array"),title:P().optional(),description:P().optional(),minItems:X().optional(),maxItems:X().optional(),items:N({type:V("string"),enum:G(P())}),default:G(P()).optional()}),Lr=N({type:V("array"),title:P().optional(),description:P().optional(),minItems:X().optional(),maxItems:X().optional(),items:N({anyOf:G(N({const:P(),title:P()}))}),default:G(P()).optional()}),Vs=ue([Zr,Lr]),Js=ue([$n,wn,Vs]),St=ue([Js,vn,yn,Sn]),bt=c.extend({mode:V("form").optional(),message:P(),requestedSchema:N({type:V("object"),properties:ie(P(),St),required:G(P()).optional()}).catchall(he())}),Rn=c.extend({mode:V("url"),message:P(),elicitationId:P(),url:P().url()}),Ot=ue([bt,Rn]),Hs=u.extend({method:V("elicitation/create"),params:Ot}),Bs=l.extend({elicitationId:P()}),Ks=d.extend({method:V("notifications/elicitation/complete"),params:Bs}),Gs=p.extend({action:we(["accept","decline","cancel"]),content:ru(ut=>ut===null?void 0:ut,ie(P(),ue([P(),X(),ge(),G(P())])).optional())}),Ws=N({type:V("ref/resource"),uri:P()}),Ys=N({type:V("ref/prompt"),name:P()}),Xs=a.extend({ref:ue([Ys,Ws]),argument:N({name:P(),value:P()}),context:N({arguments:ie(P(),P()).optional()}).optional()}),Pn=u.extend({method:V("completion/complete"),params:Xs}),Qs=p.extend({completion:ze({values:G(P()).max(100),total:ve(X().int()),hasMore:ve(ge())})}),ei=N({uri:P().startsWith("file://"),name:P().optional(),_meta:ie(P(),he()).optional()}),co=u.extend({method:V("roots/list"),params:a.optional()}),En=p.extend({roots:G(ei)}),ti=d.extend({method:V("notifications/roots/list_changed"),params:l.optional()}),ri=ze({ttl:X().optional(),pollInterval:X().optional()}),oi=we(["working","input_required","completed","failed","cancelled"]),ur=N({taskId:P(),status:oi,ttl:ue([X(),tu()]),createdAt:P(),lastUpdatedAt:P(),pollInterval:ve(X()),statusMessage:ve(P())}),ht=p.extend({task:ur}),ni=l.merge(ur),Dr=d.extend({method:V("notifications/tasks/status"),params:ni}),uo=u.extend({method:V("tasks/get"),params:a.extend({taskId:P()})}),lo=p.merge(ur),po=u.extend({method:V("tasks/result"),params:a.extend({taskId:P()})}),Tu=p.loose(),gt=T.extend({method:V("tasks/list")}),We=j.extend({tasks:G(ur)}),Ur=u.extend({method:V("tasks/cancel"),params:a.extend({taskId:P()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:a,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:l,NotificationSchema:d,ResultSchema:p,RequestIdSchema:g,EmptyResultSchema:m,CancelledNotificationParamsSchema:v,CancelledNotificationSchema:h,IconSchema:f,IconsSchema:z,BaseMetadataSchema:_,ImplementationSchema:b,ClientTasksCapabilitySchema:y,ServerTasksCapabilitySchema:$,ClientCapabilitiesSchema:I,InitializeRequestParamsSchema:q,InitializeRequestSchema:O,ServerCapabilitiesSchema:L,InitializeResultSchema:K,InitializedNotificationSchema:Y,PingRequestSchema:fe,ProgressSchema:qe,ProgressNotificationParamsSchema:Ie,ProgressNotificationSchema:Ye,PaginatedRequestParamsSchema:ye,PaginatedRequestSchema:T,PaginatedResultSchema:j,ResourceContentsSchema:F,TextResourceContentsSchema:w,BlobResourceContentsSchema:C,RoleSchema:H,AnnotationsSchema:te,ResourceSchema:me,ResourceTemplateSchema:se,ListResourcesRequestSchema:Oe,ListResourcesResultSchema:pt,ListResourceTemplatesRequestSchema:E,ListResourceTemplatesResultSchema:A,ResourceRequestParamsSchema:D,ReadResourceRequestParamsSchema:oe,ReadResourceRequestSchema:ne,ReadResourceResultSchema:pe,ResourceListChangedNotificationSchema:Ge,SubscribeRequestParamsSchema:et,SubscribeRequestSchema:at,UnsubscribeRequestParamsSchema:Xe,UnsubscribeRequestSchema:Ue,ResourceUpdatedNotificationParamsSchema:Pt,ResourceUpdatedNotificationSchema:tt,PromptArgumentSchema:Ft,PromptSchema:It,ListPromptsRequestSchema:Vt,ListPromptsResultSchema:sr,GetPromptRequestParamsSchema:ir,GetPromptRequestSchema:Cr,TextContentSchema:Nr,ImageContentSchema:jr,AudioContentSchema:Ar,ToolUseContentSchema:en,EmbeddedResourceSchema:ar,ResourceLinkSchema:tn,ContentBlockSchema:Et,PromptMessageSchema:to,GetPromptResultSchema:ro,PromptListChangedNotificationSchema:Mr,ToolAnnotationsSchema:rn,ToolExecutionSchema:oo,ToolSchema:qr,ListToolsRequestSchema:no,ListToolsResultSchema:so,CallToolResultSchema:io,CallToolRequestParamsSchema:ct,CallToolRequestSchema:on,ToolListChangedNotificationSchema:Us,LoggingLevelSchema:ao,SetLevelRequestParamsSchema:nn,SetLevelRequestSchema:sn,LoggingMessageNotificationParamsSchema:an,LoggingMessageNotificationSchema:cn,ModelHintSchema:un,ModelPreferencesSchema:ln,ToolChoiceSchema:dn,ToolResultContentSchema:Fs,SamplingContentSchema:pn,SamplingMessageContentBlockSchema:cr,SamplingMessageSchema:mn,CreateMessageRequestParamsSchema:fn,CreateMessageRequestSchema:hn,CreateMessageResultSchema:gn,CreateMessageResultWithToolsSchema:_n,BooleanSchemaSchema:vn,StringSchemaSchema:yn,NumberSchemaSchema:Sn,UntitledSingleSelectEnumSchemaSchema:bn,TitledSingleSelectEnumSchemaSchema:zn,LegacyTitledEnumSchemaSchema:$n,SingleSelectEnumSchemaSchema:wn,UntitledMultiSelectEnumSchemaSchema:Zr,TitledMultiSelectEnumSchemaSchema:Lr,MultiSelectEnumSchemaSchema:Vs,EnumSchemaSchema:Js,PrimitiveSchemaDefinitionSchema:St,ElicitRequestFormParamsSchema:bt,ElicitRequestURLParamsSchema:Rn,ElicitRequestParamsSchema:Ot,ElicitRequestSchema:Hs,ElicitationCompleteNotificationParamsSchema:Bs,ElicitationCompleteNotificationSchema:Ks,ElicitResultSchema:Gs,ResourceTemplateReferenceSchema:Ws,PromptReferenceSchema:Ys,CompleteRequestParamsSchema:Xs,CompleteRequestSchema:Pn,CompleteResultSchema:Qs,RootSchema:ei,ListRootsRequestSchema:co,ListRootsResultSchema:En,RootsListChangedNotificationSchema:ti,TaskCreationParamsSchema:ri,TaskStatusSchema:oi,TaskSchema:ur,CreateTaskResultSchema:ht,TaskStatusNotificationParamsSchema:ni,TaskStatusNotificationSchema:Dr,GetTaskRequestSchema:uo,GetTaskResultSchema:lo,GetTaskPayloadRequestSchema:po,GetTaskPayloadResultSchema:Tu,ListTasksRequestSchema:gt,ListTasksResultSchema:We,CancelTaskRequestSchema:Ur,CancelTaskResultSchema:p.merge(ur),ClientRequestSchema:ue([fe,O,Pn,sn,Cr,Vt,Oe,E,ne,at,Ue,on,no,uo,po,gt,Ur]),ClientNotificationSchema:ue([h,Ye,Y,ti,Dr]),ClientResultSchema:ue([m,gn,_n,Gs,En,lo,We,ht]),ServerRequestSchema:ue([fe,hn,Hs,co,uo,po,gt,Ur]),ServerNotificationSchema:ue([h,Ye,cn,tt,Ge,Us,Mr,Dr,Ks]),ServerResultSchema:ue([m,K,Qs,ro,sr,pt,A,pe,io,so,lo,We,ht]),CallToolResultWireSchema:he().superRefine((ut,j$)=>{if(!(typeof ut!="object"||ut===null||Array.isArray(ut)||ut.content!==void 0)){for(let ym of Rz)if(ym in ut){j$.addIssue({code:"custom",message:`content is required when the body carries '${ym}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Dp).pipe(io)}}var uE;function Pz(){return uE??=cE()}function Ez(e){return e.type!=="object"}var lE=new Set(["const","enum","default","examples"]),dE=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function uz(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function pE(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(uz(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=$m(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,s)=>{if(Array.isArray(n))return n.map(c=>o(c,!1));if(n===null||typeof n!="object"||!s&&uz(n.$id))return n;let i={},a=!1;for(let[c,u]of Object.entries(n))s?i[c]=o(u,!1):(c==="$ref"||c==="$dynamicRef")&&typeof u=="string"?i[c]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u:c==="$recursiveRef"&&u==="#"&&r?a=!0:lE.has(c)?i[c]=u:dE.has(c)?i[c]=o(u,!0):i[c]=o(u,!1);return a&&("$ref"in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:"#/properties/result"}]:i.$ref="#/properties/result"),i};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var kz={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},xz={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},mE={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},ou;function Up(){if(ou)return ou;let e=Pz();return ou={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},ou}function Tz(e){return Object.prototype.hasOwnProperty.call(kz,e)}function Iz(e){return Object.prototype.hasOwnProperty.call(xz,e)}function fE(e){return Object.prototype.hasOwnProperty.call(mE,e)}function hE(e){return fE(e)?Up().resultSchemas[e]:void 0}function gE(e){return Tz(e)?Up().requestSchemas[e]:void 0}function _E(e){return Iz(e)?Up().notificationSchemas[e]:void 0}var UN=Object.keys(kz),FN=Object.keys(xz);function Ap(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function nu(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var lz={ok:!1,reason:"not-in-era"};function dz(e){return Ap(e)&&Ap(e.outputSchema)&&Ez(e.outputSchema)}var Fp={era:"2025-11-25",hasRequestMethod:Tz,hasNotificationMethod:Iz,validateRequest:(e,t)=>nu(gE(e),t),validateResult:(e,t)=>nu(hE(e),t),validateNotification:(e,t)=>nu(_E(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>lz,validateInputResponse:()=>lz,samplingResultVariant:(e,t)=>{let r=Pz();return nu(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=wz(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!="object"||o===null||Array.isArray(o),s=t!==void 0&&Ez(t);return!n&&!s?r:{...r,structuredContent:{result:o}}},decodeResult(e,t){if(Ap(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:r}}return{kind:"complete",result:t}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;return!Array.isArray(r)||!r.some(o=>dz(o))?t:{...t,tools:r.map(o=>dz(o)?{...o,outputSchema:pE(o.outputSchema)}:o)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function vE(){let e=Ip(()=>ue([P(),X(),ge(),tu(),ie(P(),e),G(e)])),t=ie(P(),e),r=ue([P(),X().int()]),o=P(),n=ue([P(),X().int()]),s=we(["user","assistant"]),i=we(["debug","info","notice","warning","error","critical","alert","emergency"]),a=P().refine(We=>{try{return atob(We),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=N({ttl:X().optional()}),u=N({taskId:P()}),l=ze({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),d=N({_meta:l.optional()}),p=d.extend({task:c.optional()}),g=N({_meta:l.optional()}),m=N({method:P(),params:g.loose().optional()}),v=N({src:P(),mimeType:P().optional(),sizes:G(P()).optional(),theme:we(["light","dark"]).optional()}),h=N({icons:G(v).optional()}),f=N({name:P(),title:P().optional()}),z=f.extend({...f.shape,...h.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),_=Ho(N({applyDefaults:ge().optional()}),t),b=ru(We=>We&&typeof We=="object"&&!Array.isArray(We)&&Object.keys(We).length===0?{form:{}}:We,Ho(N({form:_.optional(),url:t.optional()}),t.optional())),R=ze({list:t.optional(),cancel:t.optional(),requests:ze({sampling:ze({createMessage:t.optional()}).optional(),elicitation:ze({create:t.optional()}).optional()}).optional()}),S=ze({list:t.optional(),cancel:t.optional(),requests:ze({tools:ze({call:t.optional()}).optional()}).optional()}),y=N({experimental:ie(P(),t).optional(),sampling:N({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:N({listChanged:ge().optional()}).optional(),tasks:R.optional(),extensions:ie(P(),t).optional()}),$=N({experimental:ie(P(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:N({listChanged:ge().optional()}).optional(),resources:N({subscribe:ge().optional(),listChanged:ge().optional()}).optional(),tools:N({listChanged:ge().optional()}).optional(),tasks:S.optional(),extensions:ie(P(),t).optional()}),I=N({progress:X(),total:ve(X()),message:ve(P())}),q=N({...g.shape,...I.shape,progressToken:r}),O=m.extend({method:V("notifications/progress"),params:q}),L=g.extend({level:i,logger:P().optional(),data:he()}),K=m.extend({method:V("notifications/message"),params:L}),Y=N({uri:P(),mimeType:ve(P()),_meta:ie(P(),he()).optional()}),fe=Y.extend({text:P()}),qe=Y.extend({blob:a}),Ie=N({audience:G(s).optional(),priority:X().min(0).max(1).optional(),lastModified:kr.datetime({offset:!0}).optional()}),Ye=N({...f.shape,...h.shape,uri:P(),description:ve(P()),mimeType:ve(P()),size:ve(X()),annotations:Ie.optional(),_meta:ve(ze({}))}),ye=N({...f.shape,...h.shape,uriTemplate:P(),description:ve(P()),mimeType:ve(P()),annotations:Ie.optional(),_meta:ve(ze({}))}),T=m.extend({method:V("notifications/resources/list_changed"),params:g.optional()}),j=g.extend({uri:P()}),F=m.extend({method:V("notifications/resources/updated"),params:j}),w=N({name:P(),description:ve(P()),required:ve(ge())}),x=N({...f.shape,...h.shape,description:ve(P()),arguments:ve(G(w)),_meta:ve(ze({}))}),C=m.extend({method:V("notifications/prompts/list_changed"),params:g.optional()}),H=N({type:V("text"),text:P(),annotations:Ie.optional(),_meta:ie(P(),he()).optional()}),te=N({type:V("image"),data:a,mimeType:P(),annotations:Ie.optional(),_meta:ie(P(),he()).optional()}),me=N({type:V("audio"),data:a,mimeType:P(),annotations:Ie.optional(),_meta:ie(P(),he()).optional()}),se=N({type:V("tool_use"),name:P(),id:P(),input:ie(P(),he()),_meta:ie(P(),he()).optional()}),Oe=N({type:V("resource"),resource:ue([fe,qe]),annotations:Ie.optional(),_meta:ie(P(),he()).optional()}),pt=Ye.extend({type:V("resource_link")}),E=ue([H,te,me,pt,Oe]),A=N({role:s,content:E}),D=N({title:P().optional(),readOnlyHint:ge().optional(),destructiveHint:ge().optional(),idempotentHint:ge().optional(),openWorldHint:ge().optional()}),oe=m.extend({method:V("notifications/tools/list_changed"),params:g.optional()}),ne=N({name:P().optional()}),pe=N({hints:G(ne).optional(),costPriority:X().min(0).max(1).optional(),speedPriority:X().min(0).max(1).optional(),intelligencePriority:X().min(0).max(1).optional()}),Ge=N({mode:we(["auto","required","none"]).optional()}),et=N({type:V("boolean"),title:P().optional(),description:P().optional(),default:ge().optional()}),at=N({type:V("string"),title:P().optional(),description:P().optional(),minLength:X().optional(),maxLength:X().optional(),format:we(["email","uri","date","date-time"]).optional(),default:P().optional()}),Xe=N({type:we(["number","integer"]),title:P().optional(),description:P().optional(),minimum:X().optional(),maximum:X().optional(),default:X().optional()}),Ue=N({type:V("string"),title:P().optional(),description:P().optional(),enum:G(P()),default:P().optional()}),Pt=N({type:V("string"),title:P().optional(),description:P().optional(),oneOf:G(N({const:P(),title:P()})),default:P().optional()}),tt=N({type:V("string"),title:P().optional(),description:P().optional(),enum:G(P()),enumNames:G(P()).optional(),default:P().optional()}),Ft=ue([Ue,Pt]),It=N({type:V("array"),title:P().optional(),description:P().optional(),minItems:X().optional(),maxItems:X().optional(),items:N({type:V("string"),enum:G(P())}),default:G(P()).optional()}),Vt=N({type:V("array"),title:P().optional(),description:P().optional(),minItems:X().optional(),maxItems:X().optional(),items:N({anyOf:G(N({const:P(),title:P()}))}),default:G(P()).optional()}),sr=ue([It,Vt]),ir=ue([tt,Ft,sr]),Cr=ue([ir,et,at,Xe]),Nr=p.extend({mode:V("form").optional(),message:P(),requestedSchema:N({type:V("object"),properties:ie(P(),Cr),required:G(P()).optional()}).catchall(he())}),jr=N({type:V("ref/resource"),uri:P()}),Ar=N({type:V("ref/prompt"),name:P()}),en=N({uri:P().startsWith("file://"),name:P().optional(),_meta:ie(P(),he()).optional()}),ar=y.shape,tn=N({experimental:ar.experimental,sampling:ar.sampling,elicitation:ar.elicitation,roots:ar.roots,extensions:ar.extensions}),Et=$.shape,to=N({experimental:Et.experimental,logging:Et.logging,completions:Et.completions,prompts:Et.prompts,resources:Et.resources,tools:Et.tools,extensions:Et.extensions}),ro=ze({progressToken:r.optional(),[Xt]:P(),[ko]:z.optional(),[Qt]:tn,[gr]:i.optional()}),Mr=N({...f.shape,...h.shape,description:P().optional(),inputSchema:ze({$schema:P().optional(),type:V("object")}),outputSchema:ze({$schema:P().optional()}).optional(),annotations:D.optional(),_meta:ie(P(),he()).optional()}),rn=N({type:V("tool_result"),toolUseId:P(),content:G(E),structuredContent:he().optional(),isError:ge().optional(),_meta:ie(P(),he()).optional()}),oo=ue([H,te,me,se,rn]),qr=N({role:s,content:ue([oo,G(oo)]),_meta:ie(P(),he()).optional()}),no=P(),so=ze({[Dt]:z.optional().catch(void 0)}),io=so.optional();function ct(We){return ze({_meta:io,resultType:no.default("complete"),...We})}let on=ct({}),Us=ct({nextCursor:o.optional()}),ao=ct({content:G(E),structuredContent:he().optional(),isError:ge().optional()}),nn=ct({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),tools:G(Mr),nextCursor:o.optional()}),sn=ct({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),prompts:G(x),nextCursor:o.optional()}),an=ct({description:P().optional(),messages:G(A)}),cn=ct({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),resources:G(Ye),nextCursor:o.optional()}),un=ct({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),resourceTemplates:G(ye),nextCursor:o.optional()}),ln=ct({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),contents:G(ue([fe,qe]))}),dn=ct({completion:N({values:G(P()).max(100),total:X().int().optional(),hasMore:ge().optional()}).loose()}),Fs=ct({ttlMs:X().int().min(0),cacheScope:we(["public","private"])}),pn=ct({ttlMs:X().int().min(0).catch(0),cacheScope:we(["public","private"]).catch("private"),supportedVersions:G(P()),capabilities:to,instructions:P().optional()}),cr=N({messages:G(qr),modelPreferences:pe.optional(),systemPrompt:P().optional(),includeContext:we(["none","thisServer","allServers"]).optional(),temperature:X().optional(),maxTokens:X().int(),stopSequences:G(P()).optional(),metadata:t.optional(),tools:G(Mr).optional(),toolChoice:Ge.optional()}),mn=N({method:V("sampling/createMessage"),params:cr}),fn=N({method:V("roots/list"),params:N({_meta:ie(P(),he()).optional()}).optional()}),hn=N({...qr.shape,model:P(),stopReason:P().optional()}),gn=N({roots:G(en)}),_n=N({action:we(["accept","decline","cancel"]),content:ie(P(),ue([P(),X(),ge(),G(P())])).optional()}),vn=N({mode:V("url"),message:P(),url:P().url()}),yn=ue([Nr,vn]),Sn=N({method:V("elicitation/create"),params:yn}),bn=ue([mn,fn,Sn]),zn=ue([hn,gn,_n]),$n=ie(P(),bn),wn=ie(P(),zn),Zr=ct({inputRequests:$n.optional(),requestState:P().optional()}),Lr={inputResponses:wn.optional(),requestState:P().optional()},Vs=N({_meta:ro,...Lr}),Js=ze({progressToken:r.optional()});function St(We,Ur){return N({method:V(We),params:N({_meta:ro,...Ur})})}function bt(We,Ur){return N({method:V(We),params:N({_meta:Js.optional(),...Ur}).optional()})}let Rn={name:P(),arguments:ie(P(),he()).optional(),...Lr},Ot={cursor:o.optional()},Hs=St("tools/call",Rn),Bs=St("tools/list",Ot),Ks=St("prompts/list",Ot),Gs=St("prompts/get",{name:P(),arguments:ie(P(),P()).optional(),...Lr}),Ws=St("resources/list",Ot),Ys=St("resources/templates/list",Ot),Xs=St("resources/read",{uri:P(),...Lr}),Pn={ref:ue([Ar,jr]),argument:N({name:P(),value:P()}),context:N({arguments:ie(P(),P()).optional()}).optional()},Qs=St("completion/complete",Pn),ei=St("server/discover",{}),co=N({toolsListChanged:ge().optional(),promptsListChanged:ge().optional(),resourcesListChanged:ge().optional(),resourceSubscriptions:G(P()).optional()}),En={notifications:co},ti=St("subscriptions/listen",En),ri=so.extend({"io.modelcontextprotocol/subscriptionId":n}),oi=ze({_meta:ri,resultType:no.default("complete")}),ur={"tools/call":bt("tools/call",Rn),"tools/list":bt("tools/list",Ot),"prompts/get":bt("prompts/get",{name:P(),arguments:ie(P(),P()).optional()}),"prompts/list":bt("prompts/list",Ot),"resources/list":bt("resources/list",Ot),"resources/templates/list":bt("resources/templates/list",Ot),"resources/read":bt("resources/read",{uri:P()}),"completion/complete":bt("completion/complete",Pn),"server/discover":bt("server/discover",{}),"subscriptions/listen":bt("subscriptions/listen",En)};function ht(We){return ze({_meta:io,...We})}let ni={"tools/call":ht({content:G(E),structuredContent:he().optional(),isError:ge().optional()}),"tools/list":ht({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),tools:G(Mr),nextCursor:o.optional()}),"prompts/get":ht({description:P().optional(),messages:G(A)}),"prompts/list":ht({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),prompts:G(x),nextCursor:o.optional()}),"resources/list":ht({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),resources:G(Ye),nextCursor:o.optional()}),"resources/templates/list":ht({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),resourceTemplates:G(ye),nextCursor:o.optional()}),"resources/read":ht({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),contents:G(ue([fe,qe]))}),"completion/complete":ht({completion:N({values:G(P()).max(100),total:X().int().optional(),hasMore:ge().optional()}).loose()}),"server/discover":ht({ttlMs:X().int().min(0).catch(0),cacheScope:we(["public","private"]).catch("private"),supportedVersions:G(P()),capabilities:to,instructions:P().optional()}),"subscriptions/listen":ht({})},Dr=ze({"io.modelcontextprotocol/subscriptionId":n.optional()}),uo=N({method:V("notifications/subscriptions/acknowledged"),params:N({_meta:Dr.optional(),notifications:co})}),lo=N({_meta:Dr.optional(),requestId:n,reason:P().optional()}),po=N({method:V("notifications/cancelled"),params:lo}),Tu={"notifications/cancelled":po,"notifications/progress":O,"notifications/message":K,"notifications/resources/updated":F,"notifications/resources/list_changed":T,"notifications/tools/list_changed":oe,"notifications/prompts/list_changed":C,"notifications/subscriptions/acknowledged":uo},gt=We=>N({jsonrpc:V("2.0"),id:ue([P(),X().int()]),result:We}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:c,RelatedTaskMetadataSchema:u,RequestMetaSchema:l,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:p,NotificationsParamsSchema:g,NotificationSchema:m,IconSchema:v,IconsSchema:h,BaseMetadataSchema:f,ImplementationSchema:z,ClientTasksCapabilitySchema:R,ServerTasksCapabilitySchema:S,ClientCapabilitiesSchema:y,ServerCapabilitiesSchema:$,ProgressSchema:I,ProgressNotificationParamsSchema:q,ProgressNotificationSchema:O,LoggingMessageNotificationParamsSchema:L,LoggingMessageNotificationSchema:K,ResourceContentsSchema:Y,TextResourceContentsSchema:fe,BlobResourceContentsSchema:qe,AnnotationsSchema:Ie,ResourceSchema:Ye,ResourceTemplateSchema:ye,ResourceListChangedNotificationSchema:T,ResourceUpdatedNotificationParamsSchema:j,ResourceUpdatedNotificationSchema:F,PromptArgumentSchema:w,PromptSchema:x,PromptListChangedNotificationSchema:C,TextContentSchema:H,ImageContentSchema:te,AudioContentSchema:me,ToolUseContentSchema:se,EmbeddedResourceSchema:Oe,ResourceLinkSchema:pt,ContentBlockSchema:E,PromptMessageSchema:A,ToolAnnotationsSchema:D,ToolListChangedNotificationSchema:oe,ModelHintSchema:ne,ModelPreferencesSchema:pe,ToolChoiceSchema:Ge,BooleanSchemaSchema:et,StringSchemaSchema:at,NumberSchemaSchema:Xe,UntitledSingleSelectEnumSchemaSchema:Ue,TitledSingleSelectEnumSchemaSchema:Pt,LegacyTitledEnumSchemaSchema:tt,SingleSelectEnumSchemaSchema:Ft,UntitledMultiSelectEnumSchemaSchema:It,TitledMultiSelectEnumSchemaSchema:Vt,MultiSelectEnumSchemaSchema:sr,EnumSchemaSchema:ir,PrimitiveSchemaDefinitionSchema:Cr,ElicitRequestFormParamsSchema:Nr,ResourceTemplateReferenceSchema:jr,PromptReferenceSchema:Ar,RootSchema:en,ClientCapabilities2026Schema:tn,ServerCapabilities2026Schema:to,RequestMetaEnvelopeSchema:ro,ToolSchema:Mr,ToolResultContentSchema:rn,SamplingMessageContentBlockSchema:oo,SamplingMessageSchema:qr,ResultTypeSchema:no,ResultMetaSchema:so,ResultSchema:on,PaginatedResultSchema:Us,CallToolResultSchema:ao,ListToolsResultSchema:nn,ListPromptsResultSchema:sn,GetPromptResultSchema:an,ListResourcesResultSchema:cn,ListResourceTemplatesResultSchema:un,ReadResourceResultSchema:ln,CompleteResultSchema:dn,CacheableResultSchema:Fs,DiscoverResultSchema:pn,CreateMessageRequestParamsSchema:cr,CreateMessageRequestSchema:mn,ListRootsRequestSchema:fn,CreateMessageResultSchema:hn,ListRootsResultSchema:gn,ElicitResultSchema:_n,ElicitRequestURLParamsSchema:vn,ElicitRequestParamsSchema:yn,ElicitRequestSchema:Sn,InputRequestSchema:bn,InputResponseSchema:zn,InputRequestsSchema:$n,InputResponsesSchema:wn,InputRequiredResultSchema:Zr,InputResponseRequestParamsSchema:Vs,CallToolRequestSchema:Hs,ListToolsRequestSchema:Bs,ListPromptsRequestSchema:Ks,GetPromptRequestSchema:Gs,ListResourcesRequestSchema:Ws,ListResourceTemplatesRequestSchema:Ys,ReadResourceRequestSchema:Xs,CompleteRequestSchema:Qs,DiscoverRequestSchema:ei,SubscriptionFilterSchema:co,SubscriptionsListenRequestSchema:ti,SubscriptionsListenResultMetaSchema:ri,SubscriptionsListenResultSchema:oi,dispatchRequestSchemas:ur,dispatchResultSchemas:ni,NotificationMetaSchema:Dr,SubscriptionsAcknowledgedNotificationSchema:uo,CancelledNotificationParamsSchema:lo,CancelledNotificationSchema:po,notificationSchemas2026:Tu,JSONRPCResultResponseSchema:gt(on),CallToolResultResponseSchema:gt(ue([ao,Zr])),ListToolsResultResponseSchema:gt(nn),ListPromptsResultResponseSchema:gt(sn),GetPromptResultResponseSchema:gt(ue([an,Zr])),ListResourcesResultResponseSchema:gt(cn),ListResourceTemplatesResultResponseSchema:gt(un),ReadResourceResultResponseSchema:gt(ue([ln,Zr])),CompleteResultResponseSchema:gt(dn),DiscoverResultResponseSchema:gt(pn)}}var yE;function Qr(){return yE??=vE()}var SE=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function bE(e){return SE.includes(e)}var Bo=Symbol("modelcontextprotocol.resultCacheHintFallback");function du(e,t){if(t===void 0)return e;let r=e[Bo];if(r===void 0)return{...e,[Bo]:t};let o={},n=r.ttlMs??t.ttlMs;n!==void 0&&(o.ttlMs=n);let s=r.cacheScope??t.cacheScope;return s!==void 0&&(o.cacheScope=s),{...e,[Bo]:o}}function zE(e){return e[Bo]}function Vp(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Jp(e){return e==="public"||e==="private"}function Hp(e,t){if(e.ttlMs!==void 0&&!Vp(e.ttlMs))throw new RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!Jp(e.cacheScope))throw new RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var J=function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e}({}),ee=class Oz extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Ko(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Ko(this,t)}constructor(t,r,o){super(r),this.code=t,this.data=o,this.name="ProtocolError",Zp(this,new.target)}static fromError(t,r,o){if(t===J.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Cz(n.elicitations,r)}if(t===J.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new Yo({supported:n.supported,requested:n.requested},r)}if(t===J.InvalidParams||t===J.ResourceNotFound){let n=o;if(typeof n?.uri=="string"&&(t===J.ResourceNotFound||Object.keys(n).length===1))return new pu(n.uri,r)}if(t===J.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new mu({requiredCapabilities:n.requiredCapabilities},r)}return new Oz(t,r,o)}},pu=class extends ee{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(J.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Cz=class extends ee{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(J.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Yo=class extends ee{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(J.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},mu=class extends ee{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(J.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},$E=0,wE="private",RE=["tools/call","prompts/get","resources/read"];function PE(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete"||RE.includes(e))return t;throw new ee(J.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function EE(e,t){let r=zE(t);if(t.resultType!=="complete"||!bE(e))return r===void 0?t:OE(t);let o=t,n=Vp(o.ttlMs)?o.ttlMs:TE(r),s=Jp(o.cacheScope)?o.cacheScope:IE(r),i={...o,ttlMs:n,cacheScope:s};return delete i[Bo],i}function kE(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function xE(e,t){if(t===void 0)return e;let r=e._meta;return r===void 0?{...e,_meta:{[Dt]:t}}:!kE(r)||r[Dt]!==void 0?e:{...e,_meta:{...r,[Dt]:t}}}function TE(e){return e!==void 0&&Vp(e.ttlMs)?e.ttlMs:$E}function IE(e){return e!==void 0&&Jp(e.cacheScope)?e.cacheScope:wE}function OE(e){let t={...e};return delete t[Bo],t}var CE=["elicitation/create","sampling/createMessage","roots/list"],su;function Nz(){if(su)return su;let e=Qr();return su={request:{"elicitation/create":N({method:V("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":N({method:V("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":N({method:V("roots/list"),params:ze({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},su}function jz(e){return CE.includes(e)}function Op(e){return jz(e)?Nz().request[e]:void 0}function NE(e){return jz(e)?Nz().response[e]:void 0}var Bp={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},Az={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function Mz(e){return Object.prototype.hasOwnProperty.call(Bp,e)}function qz(e){return Object.prototype.hasOwnProperty.call(Az,e)}function jE(e){return Object.prototype.hasOwnProperty.call(Bp,e)}function AE(e){return Mz(e)?Qr().dispatchRequestSchemas[e]:void 0}function ME(e){return jE(e)?Qr().dispatchResultSchemas[e]:void 0}function qE(e){return qz(e)?Qr().notificationSchemas2026[e]:void 0}var VN=Object.keys(Bp),JN=Object.keys(Az);function Ns(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Os(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var ZE={ok:!1,reason:"not-in-era"},LE=[Xt,Qt];function DE(e,t){let r=t,o=!1,n=()=>(o||(r={...r},o=!0),r),s=t.tools;e==="tools/list"&&Array.isArray(s)&&s.some(a=>Ns(a)&&"execution"in a)&&(n().tools=s.map(a=>{if(!Ns(a)||!("execution"in a))return a;let c={...a};return delete c.execution,c}));let i=t.capabilities;if(Ns(i)&&"tasks"in i){let a={...i};delete a.tasks,n().capabilities=a}return r}var Kp={era:"2026-07-28",hasRequestMethod:Mz,hasNotificationMethod:qz,hasInputRequestMethod:e=>Op(e)!==void 0,validateRequest:(e,t)=>Os(AE(e),t),validateResult:(e,t)=>Os(ME(e),t),validateNotification:(e,t)=>Os(qE(e),t),validateInputRequest:(e,t)=>Os(Op(e),t),validateInputResponse:(e,t)=>Os(NE(e),t),samplingResultVariant:()=>ZE,outboundEnvelope(e){return{[Xt]:e.protocolVersion,[ko]:e.clientInfo,[Qt]:e.clientCapabilities,...e.logLevel!==void 0&&{[gr]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of LE)o in e||t.push({key:o,problem:"missing"});let r=Qr().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let o of r.error.issues){let n=o.path.map(String),s=n.length>0?n.join("."):"_meta";n.length===1&&t.some(i=>i.key===s&&i.problem==="missing")||t.push({key:s,problem:o.message})}return t},projectCallToolResult:e=>wz(e),inputRequestSchema:Op,decodeResult(e,t){if(!Ns(t))return{kind:"invalid",error:new le(_e.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new le(_e.InvalidResult,`Invalid result for ${e}: missing required resultType \u2014 servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof r!="string")return{kind:"invalid",error:new le(_e.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let i=t.inputRequests,a=Ns(i)?i:{},c=t.requestState;return Object.keys(a).length===0&&typeof c!="string"?{kind:"invalid",error:new le(_e.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:a,...typeof c=="string"&&{requestState:c}}}if(r!=="complete")return{kind:"invalid",error:new le(_e.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=UE(),n=Object.hasOwn(o,e)?o[e]:void 0;if(n!==void 0){let i=n.safeParse(t);if(!i.success)return{kind:"invalid",error:new le(_e.InvalidResult,`Invalid result for ${e}: ${i.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,r){return xE(EE(e,PE(e,DE(e,t))),r)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=Qr().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(r=>r.message).join("; ")}`}},iu;function UE(){if(iu)return iu;let e=Qr();return iu={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},iu}var qs="2026-07-28";function xr(e){return e!==void 0&&Wo(e)?Kp:Fp}function pz(e){return e.revision!==void 0?xr(e.revision).era:e.era==="modern"?Kp.era:Fp.era}function Cp(e){return Zz.some(t=>t.hasRequestMethod(e))}function Np(e){return Zz.some(t=>t.hasNotificationMethod(e))}var Zz=[Fp,Kp];function mz(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function eo(e){if(!mz(e))return;let t=e._meta;return mz(t)?t:void 0}function fu(e){let t=eo(e);return t!==void 0&&Xt in t}function hu(e){let t=eo(e)?.[Xt];return typeof t=="string"?t:void 0}function gu(e){return xr(qs).validateEnvelopeMeta(e)}var FE=bm({AnnotationsSchema:()=>er,AudioContentSchema:()=>jo,BaseMetadataSchema:()=>Yt,BaseRequestParamsSchema:()=>ot,BlobResourceContentsSchema:()=>ns,BooleanSchemaSchema:()=>us,CallToolRequestParamsSchema:()=>Ba,CallToolRequestSchema:()=>Ka,CallToolResultSchema:()=>cs,CancelTaskRequestSchema:()=>nd,CancelTaskResultSchema:()=>sd,CancelledNotificationParamsSchema:()=>Wi,CancelledNotificationSchema:()=>Xn,ClientCapabilitiesSchema:()=>ea,ClientNotificationSchema:()=>ad,ClientRequestSchema:()=>id,ClientResultSchema:()=>cd,ClientTasksCapabilitySchema:()=>Xi,CompatibilityCallToolResultSchema:()=>Bl,CompleteRequestParamsSchema:()=>bc,CompleteRequestSchema:()=>zc,CompleteResultSchema:()=>$c,ContentBlockSchema:()=>Ao,CreateMessageRequestParamsSchema:()=>ic,CreateMessageRequestSchema:()=>ac,CreateMessageResultSchema:()=>cc,CreateMessageResultWithToolsSchema:()=>uc,CreateTaskResultSchema:()=>Wl,CursorSchema:()=>Jn,DiscoverRequestSchema:()=>sa,DiscoverResultSchema:()=>ia,ElicitRequestFormParamsSchema:()=>Zo,ElicitRequestParamsSchema:()=>fc,ElicitRequestSchema:()=>hc,ElicitRequestURLParamsSchema:()=>mc,ElicitResultSchema:()=>vc,ElicitationCompleteNotificationParamsSchema:()=>gc,ElicitationCompleteNotificationSchema:()=>_c,EmbeddedResourceSchema:()=>qa,EmptyResultSchema:()=>Yn,EnumSchemaSchema:()=>pc,GetPromptRequestParamsSchema:()=>ja,GetPromptRequestSchema:()=>Aa,GetPromptResultSchema:()=>Da,GetTaskPayloadRequestSchema:()=>ed,GetTaskPayloadResultSchema:()=>td,GetTaskRequestSchema:()=>Xl,GetTaskResultSchema:()=>Ql,IconSchema:()=>Yi,IconsSchema:()=>vr,ImageContentSchema:()=>No,ImplementationSchema:()=>Io,InitializeRequestParamsSchema:()=>ta,InitializeRequestSchema:()=>ra,InitializeResultSchema:()=>oa,InitializedNotificationSchema:()=>na,JSONArraySchema:()=>Vl,JSONObjectSchema:()=>He,JSONRPCErrorResponseSchema:()=>To,JSONRPCMessageSchema:()=>Wn,JSONRPCNotificationSchema:()=>Gn,JSONRPCRequestSchema:()=>Kn,JSONRPCResponseSchema:()=>Jl,JSONRPCResultResponseSchema:()=>xo,JSONValueSchema:()=>hr,LegacyTitledEnumSchemaSchema:()=>ps,ListChangedOptionsBaseSchema:()=>Kl,ListPromptsRequestSchema:()=>Ca,ListPromptsResultSchema:()=>Na,ListResourceTemplatesRequestSchema:()=>ma,ListResourceTemplatesResultSchema:()=>fa,ListResourcesRequestSchema:()=>da,ListResourcesResultSchema:()=>pa,ListRootsRequestSchema:()=>Rc,ListRootsResultSchema:()=>Pc,ListTasksRequestSchema:()=>rd,ListTasksResultSchema:()=>od,ListToolsRequestSchema:()=>Ja,ListToolsResultSchema:()=>Ha,LoggingLevelSchema:()=>zr,LoggingMessageNotificationParamsSchema:()=>Xa,LoggingMessageNotificationSchema:()=>Qa,ModelHintSchema:()=>ec,ModelPreferencesSchema:()=>tc,MultiSelectEnumSchemaSchema:()=>dc,NotificationSchema:()=>dt,NotificationsParamsSchema:()=>lt,NumberSchemaSchema:()=>qo,PaginatedRequestParamsSchema:()=>ua,PaginatedRequestSchema:()=>yr,PaginatedResultSchema:()=>Sr,PingRequestSchema:()=>es,PrimitiveSchemaDefinitionSchema:()=>hs,ProgressNotificationParamsSchema:()=>ca,ProgressNotificationSchema:()=>ts,ProgressSchema:()=>aa,ProgressTokenSchema:()=>Vn,PromptArgumentSchema:()=>Ia,PromptListChangedNotificationSchema:()=>Ua,PromptMessageSchema:()=>La,PromptReferenceSchema:()=>Sc,PromptSchema:()=>Oa,ReadResourceRequestParamsSchema:()=>ha,ReadResourceRequestSchema:()=>ga,ReadResourceResultSchema:()=>_a,RelatedTaskMetadataSchema:()=>Gi,RequestIdSchema:()=>_r,RequestMetaSchema:()=>Hn,RequestSchema:()=>Be,ResourceContentsSchema:()=>rs,ResourceLinkSchema:()=>Za,ResourceListChangedNotificationSchema:()=>va,ResourceRequestParamsSchema:()=>Oo,ResourceSchema:()=>ss,ResourceTemplateReferenceSchema:()=>yc,ResourceTemplateSchema:()=>la,ResourceUpdatedNotificationParamsSchema:()=>xa,ResourceUpdatedNotificationSchema:()=>Ta,ResultMetaObjectSchema:()=>Bn,ResultSchema:()=>Ke,RoleSchema:()=>br,RootSchema:()=>wc,RootsListChangedNotificationSchema:()=>Ec,SamplingContentSchema:()=>nc,SamplingMessageContentBlockSchema:()=>Jr,SamplingMessageSchema:()=>sc,ServerCapabilitiesSchema:()=>Qn,ServerNotificationSchema:()=>ld,ServerRequestSchema:()=>ud,ServerResultSchema:()=>dd,ServerTasksCapabilitySchema:()=>Qi,SetLevelRequestParamsSchema:()=>Wa,SetLevelRequestSchema:()=>Ya,SingleSelectEnumSchemaSchema:()=>lc,StringSchemaSchema:()=>Mo,SubscribeRequestParamsSchema:()=>ya,SubscribeRequestSchema:()=>Sa,SubscriptionFilterSchema:()=>is,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Ra,SubscriptionsAcknowledgedNotificationSchema:()=>Pa,SubscriptionsListenRequestParamsSchema:()=>$a,SubscriptionsListenRequestSchema:()=>wa,SubscriptionsListenResultMetaSchema:()=>Ea,SubscriptionsListenResultSchema:()=>ka,TaskAugmentedRequestParamsSchema:()=>Gr,TaskCreationParamsSchema:()=>Gl,TaskMetadataSchema:()=>Ki,TaskSchema:()=>$r,TaskStatusNotificationParamsSchema:()=>xc,TaskStatusNotificationSchema:()=>Yl,TaskStatusSchema:()=>kc,TextContentSchema:()=>Co,TextResourceContentsSchema:()=>os,TitledMultiSelectEnumSchemaSchema:()=>fs,TitledSingleSelectEnumSchemaSchema:()=>ds,ToolAnnotationsSchema:()=>Fa,ToolChoiceSchema:()=>rc,ToolExecutionSchema:()=>Va,ToolListChangedNotificationSchema:()=>Ga,ToolResultContentSchema:()=>oc,ToolSchema:()=>as,ToolUseContentSchema:()=>Ma,UnsubscribeRequestParamsSchema:()=>ba,UnsubscribeRequestSchema:()=>za,UntitledMultiSelectEnumSchemaSchema:()=>ms,UntitledSingleSelectEnumSchemaSchema:()=>ls});var Tt=e=>Kn.safeParse(e).success,Ir=e=>Gn.safeParse(e).success,As=e=>xo.safeParse(e).success,_u=e=>To.safeParse(e).success;var nr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";function Gp(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Wp(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var fz="x-mcp-header",VE=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,JE=new Set(["string","integer","boolean","number"]);function Yp(e){let t=[],r=new Map,o=(s,i,a)=>{if(s===null||typeof s!="object")return;let c=s;if(fz in c){if(!a||i.length===0)return`${au(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let l=c[fz];if(typeof l!="string"||l.length===0)return`${au(i)}: x-mcp-header MUST be a non-empty string`;if(!VE.test(l))return`${au(i)}: x-mcp-header '${l}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let d=typeof c.type=="string"?c.type:void 0;if(d===void 0||!JE.has(d))return`${au(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${d??"<none>"}`;let p=l.toLowerCase(),g=r.get(p);if(g!==void 0)return`x-mcp-header '${l}' is not case-insensitively unique (also declared as '${g}')`;r.set(p,l),t.push({path:i,headerName:l,type:d})}let u=c.properties;if(u!==null&&typeof u=="object")for(let[l,d]of Object.entries(u)){let p=o(d,[...i,l],a);if(p!==void 0)return p}for(let l of HE){let d=c[l];if(d===void 0)continue;let p=Array.isArray(d)?d:d!==null&&typeof d=="object"&&BE.has(l)?Object.values(d):[d];for(let g of p){let m=o(g,[...i,`<${l}>`],!1);if(m!==void 0)return m}}},n=o(e,[],!0);return n===void 0?{valid:!0,declarations:t}:{valid:!1,reason:n}}var HE=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],BE=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function au(e){return e.length===0?"<root>":e.join(".")}var uu=-32020,HN=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32e3],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[J.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[uu,J.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[J.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope \u2014 and a missing envelope on a request whose protocol-version header names a modern revision \u2014 is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[J.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision\u2019s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[J.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[uu],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[J.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced \u2014 pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[uu],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],KE={[J.ParseError]:400,[J.InvalidRequest]:400,[J.MethodNotFound]:404,[J.UnsupportedProtocolVersion]:400,[J.MissingRequiredClientCapability]:400,[uu]:400};function cu(e,t,r,o,n){return{kind:"reject",rung:e,cell:t,httpStatus:r,code:o.code,message:o.message,...o.data!==void 0&&{data:o.data},settled:n}}function Xp(e){if(!fu(e))return!1;let t=hu(e);if(t===void 0||!Wo(t))return!1;let r=eo(e);return r!==void 0&&gu(r).length===0}function Qp(e,t){switch(e.reason){case"http-method":return cu("http-method","modern-only-method-not-allowed",405,new ee(-32e3,"Method not allowed."),!0);case"batch":return cu("jsonrpc-shape","modern-only-batch-not-supported",400,new ee(J.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return cu("jsonrpc-shape","modern-only-response-post",400,new ee(J.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let r=e.requestedVersion;return cu("era-classification","modern-only-missing-envelope",400,r===void 0?new ee(J.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...t]}):new Yo({supported:[...t],requested:r}),!0)}}}function vu(e,t){return Qc(e,t)}function Cs(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function Go(e){if(e==null)return!1;let t=typeof e;return t!=="object"&&t!=="function"||!("~standard"in e)?!1:typeof e["~standard"]?.validate=="function"}var hz=!1,Mp="draft-2020-12";function Or(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:Mp});else if(r.vendor==="zod"){if(!("_zod"in e))throw new Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");hz||(hz=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),o=Xc(e,{target:Mp,io:t})}else throw new Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output")return o.type!==void 0?o:Lz(o)?{type:"object",...o}:o;if(o.type!==void 0&&o.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}function Lz(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let r=e[t];if(Array.isArray(r)&&r.length>0)return r.every(o=>o!==null&&typeof o=="object"&&(o.type==="object"||Lz(o)))}return!1}function GE(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function Xr(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(o=>GE(o)).join(", ")}:{success:!0,data:r.value}}function WE(e){let t=Xc(e,{target:Mp,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var YE=/\\\.\\d\{(\d+)\}/;function XE(e){let t=YE.exec(e),r=[void 0,-1,0];return t&&r.push(Number(t[1])),[!1,!0].flatMap(o=>[!1,!0].flatMap(n=>r.map(s=>kr.datetime({local:o,offset:n,precision:s}))))}function QE(e,t){let r;switch(e){case"email":r=[Xb()];break;case"uri":r=[ez()];break;case"date":r=[kr.date()];break;case"date-time":r=XE(t);break}return new Set(r.map(o=>WE(o)).filter(o=>o!==void 0))}function ek(e,t,r){return r!=="zod"?!0:QE(e,t).has(t)}function Dz(e){let t=Or(e,"input"),r=t.properties||{},o=t.required||[];return Object.entries(r).map(([n,s])=>({name:n,description:s?.description,required:o.includes(n)}))}function Ms(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function tk(e){try{return Or(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new ee(J.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var rk=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function em(e){return rk.has(e)||e.startsWith("x-")}var ok=new Set(["$schema",...Object.keys(Zo.shape.requestedSchema.shape)]),gz={string:Cs([Mo,ls,ds,ps]),number:Cs([qo]),integer:Cs([qo]),boolean:Cs([us]),array:Cs([ms,fs])},nk=new Set(Mo.shape.format.unwrap().options);function sk(e,t,r,o){if(!Ms(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(gz,e.type)?gz[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,a]of Object.entries(e))n.has(i)||em(i)?s[i]=a:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?nk.has(e.format)?(typeof a!="string"||!ek(e.format,a,r))&&o.push(`${t}.${i}`):s[i]=a:o.push(`${t}.${i}`);return s}function ik(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))n==="properties"&&Ms(s)?r[n]=Object.fromEntries(Object.entries(s).map(([i,a])=>[i,sk(a,`properties.${i}`,t,o)])):ok.has(n)?r[n]=s:em(n)||o.push(n);if(o.length>0)throw new ee(J.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function ak(e,t){if(!Ms(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!vu(hs,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function qp(e,t,r=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((o,n)=>qp(o,t[n],`${r}[${n}]`)):!Ms(e)||!Ms(t)?[]:Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;return Object.prototype.hasOwnProperty.call(t,o)?qp(n,t[o],s):em(o)?[]:[s]})}function ck(e){if(!Go(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=ik(tk(e.requestedSchema),t),o=vu(Zo.shape.requestedSchema,r);if(!o.success)throw new ee(J.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${ak(r,o.error.message)}`);let n=qp(r,o.data);if(n.length>0)throw new ee(J.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(o.data.required??[]).filter(i=>!Object.prototype.hasOwnProperty.call(o.data.properties,i));if(s.length>0)throw new ee(J.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function uk(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState=="string";if(!t&&!r)throw new TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}var lk=Object.assign(uk,{elicit(e){try{return{method:"elicitation/create",params:ck(e)}}catch(t){throw t instanceof ee?new TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var Uz=250;function Fz(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Vz(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof le?t.reason:new le(_e.RequestTimeout,String(t.reason)));return}let n=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(n),o(t?.reason instanceof le?t.reason:new le(_e.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function Jz(e){let t=new AbortController,r=()=>t.abort(e?.reason);return e?.addEventListener("abort",r,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:o=>t.abort(o),dispose:()=>e?.removeEventListener("abort",r)}}var dk=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],pk={IdJagTokenExchangeResponseSchema:hd,OAuthClientInformationFullSchema:_d,OAuthClientInformationSchema:Cc,OAuthClientMetadataSchema:Oc,OAuthClientRegistrationErrorSchema:vd,OAuthErrorResponseSchema:gd,OAuthMetadataSchema:Tc,OAuthProtectedResourceMetadataSchema:pd,OAuthTokenRevocationRequestSchema:yd,OAuthTokensSchema:fd,OpenIdProviderDiscoveryMetadataSchema:md,OpenIdProviderMetadataSchema:Ic},Hz={},Bz={};function Kz(e,t){let r=e.slice(0,-6);Hz[r]=t,Bz[r]=o=>t.safeParse(o).success}for(let e of dk)Kz(e,FE[e]);for(let[e,t]of Object.entries(pk))Kz(e,t);var mk=Object.freeze(Hz),fk=Object.freeze(Bz);function hk(e){switch(e){case"initialize":case"notifications/initialized":return xr(void 0);case"server/discover":return xr(qs);default:return}}var Gz=6e4,gk=[Xt,ko,Qt,gr],_k=["inputResponses","requestState"];function _z(e,t){let r=e.params;if(!js(r))return{message:e,lifted:{}};let o=r._meta,n=js(o)?gk.filter(c=>c in o):[],s=t==="request"?_k.filter(c=>c in r):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},a={...r};if(n.length>0&&js(o)){let c={},u={...o};for(let l of n)c[l]=o[l],delete u[l];i.envelope=c,Object.keys(u).length>0?a._meta=u:delete a._meta}for(let c of s)c==="inputResponses"&&(i.inputResponses=a[c]),c==="requestState"&&(i.requestState=a[c]),delete a[c];return{message:{...e,params:a},lifted:i}}function vz(e,t){let r=e.validateResult(t,void 0);if(!(!r.ok&&r.reason==="not-in-era"))return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let n=e.validateResult(t,o);return n.ok?{value:n.value}:{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function Zs(e){return()=>e}var vk=Zs(void 0);function tm(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:Zs(t)}}}var Wz;function rm(e,t){Wz(e,t)}var om=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{Wz=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Hi,this.setNotificationHandler("notifications/cancelled",t=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",t=>{this._onprogress(t)}),this.setRequestHandler("ping",t=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new le(_e.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new le(_e.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let r=this.transport?.onerror;this._transport.onerror=n=>{r?.(n),this._onerror(n)};let o=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{o?.(n,s),As(n)||_u(n)?this._onresponse(n):Tt(n)?this._onrequest(n,s):Ir(n)?this._onnotification(n,s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new le(_e.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let o of e.values())o(r);for(let o of t.values())o.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=_z(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=pz(t.classification);if(i!==o.era){this._onerror(new Error(`Era mismatch on inbound notification '${r.method}': classified as ${i} but this instance serves ${o.era}`));return}}if(Np(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;n===void 0&&s===void 0||Promise.resolve().then(()=>n===void 0?s(r):n(r,o)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,t){let{message:r,lifted:o}=_z(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(new Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,i=(v,h,f)=>{let z={jsonrpc:"2.0",id:r.id,error:{code:v,message:h,...f!==void 0&&{data:f}}};s?.send(z).catch(_=>this._onerror(new Error(`Failed to send an error response: ${_}`)))};if(t?.classification!==void 0){let v=pz(t.classification);if(v!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${r.method}': classified as ${v} but this instance serves ${n.era}`));let h=t.classification.revision??v;i(J.UnsupportedProtocolVersion,`Unsupported protocol version: ${h}`,{supported:this._supportedProtocolVersions,requested:h});return}}if(Cp(r.method)&&!n.hasRequestMethod(r.method)){i(J.MethodNotFound,"Method not found");return}let a=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(a===void 0){i(J.MethodNotFound,"Method not found");return}let c=n.checkInboundEnvelope(o);if(c!==void 0){i(J.InvalidParams,c);return}let u=(v,h)=>this._notificationViaCodec(this._resolveOutboundCodec(v.method),v,{...h,relatedRequestId:r.id}),l=(v,h,f)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(v.method),v,h,{...f,relatedRequestId:r.id}),d=new AbortController;this._requestHandlerAbortControllers.set(r.id,d);let p=o.inputResponses===void 0?void 0:yk(o.inputResponses),g={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...p!==void 0&&{inputResponses:p.accepted},...p!==void 0&&p.droppedKeys.length>0&&{droppedInputResponseKeys:p.droppedKeys},requestState:o.requestState===void 0?vk:Zs(o.requestState),signal:d.signal,send:(v,h,f)=>{let z=this._resolveOutboundCodec(v.method);if(this._assertOutboundRequestInEra(z,v.method),Go(h))return l(v,h,f);let _=vz(z,v.method);if(_===void 0)throw new TypeError(`'${v.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return l(v,_,h)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(g,t);Promise.resolve().then(()=>a(r,m)).then(async v=>{if(d.signal.aborted)return;let h;try{h=n.encodeResult(r.method,v,this._outboundServerInfo())}catch(z){this._onerror(new Error(`Failed to encode result for ${r.method}: ${z}`)),i(J.InternalError,"Internal error");return}let f={result:h,jsonrpc:"2.0",id:r.id};await s?.send(f)},async v=>{if(d.signal.aborted)return;let h=Number.isSafeInteger(v.code)?v.code:J.InternalError,f={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(h),message:v.message??"Internal error",...v.data!==void 0&&{data:v.data}}};await s?.send(f)}).catch(v=>this._onerror(new Error(`Failed to send response: ${v}`))).finally(()=>{this._requestHandlerAbortControllers.get(r.id)===d&&this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,o=Number(t),n=this._progressHandlers.get(o);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(o),i=this._timeoutInfo.get(o);if(i&&s&&i.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(a){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(a);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),As(e)?r(e):r(ee.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let o=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(o,e.method),Go(t))return this._requestWithSchemaViaCodec(o,e,t,r);let n=vz(o,e.method);if(n===void 0)throw new TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(o,e,n,t)}_negotiatedWireCodec(){return xr(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=hk(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Cp(t)&&!e.hasRequestMethod(t))throw new le(_e.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:a}=o??{},c=Date.now(),u,l;return new Promise((d,p)=>{let g=S=>{p(S)};if(!this._transport){g(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(S){g(S);return}if(o?.signal?.aborted){let S=o.signal.reason;throw S instanceof le?S:new le(_e.RequestTimeout,String(S))}let m=e.era===qs&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,v=this._requestMessageId++;l=v;let h={...t,jsonrpc:"2.0",id:v};o?.onprogress&&(this._progressHandlers.set(v,o.onprogress),h.params={...t.params,_meta:{...t.params?._meta,progressToken:v}});let f=this._envelopeOutbound(h),z=!1,_=S=>{z||(this._progressHandlers.delete(v),m===void 0?this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:v,reason:String(S)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(y=>this._onerror(new Error(`Failed to send cancellation: ${y}`))):m.abort(),p(S instanceof le?S:new le(_e.RequestTimeout,String(S))))};this._responseHandlers.set(v,S=>{if(o?.signal?.aborted)return;if(z=!0,S instanceof Error)return p(S);let y;try{y=e.decodeResult(t.method,S.result)}catch(I){return p(I instanceof Error?I:new Error(String(I)))}if(y.kind==="invalid")return p(y.error);if(y.kind==="input_required"){if(o?.allowInputRequired===!0)return d(Sk(y));let I={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:c,retry:(q,O)=>this._requestWithSchemaViaCodec(e,q===void 0?{method:t.method}:{method:t.method,params:q},r,O)};return d(this._resolveNonCompleteResult(y,I))}let $=y.result;Xr(r,$).then(I=>{I.success?d(I.data):p(new le(_e.InvalidResult,`Invalid result for ${t.method}: ${I.error}`))},p)}),u=()=>_(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let b=o?.timeout??Gz,R=()=>_(new le(_e.RequestTimeout,"Request timed out",{timeout:b}));this._setupTimeout(v,b,o?.maxTotalTimeout,R,o?.resetTimeoutOnProgress??!1),this._transport.send(f,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:a,requestSignal:m?.signal}).catch(S=>{this._progressHandlers.delete(v),p(S)})}).finally(()=>{u&&o?.signal?.removeEventListener("abort",u),l!==void 0&&(this._responseHandlers.delete(l),this._cleanupTimeout(l))})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new le(_e.NotConnected,"Not connected");if(Np(t.method)&&!e.hasNotificationMethod(t.method))throw new le(_e.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(o,r).catch(n=>this._onerror(n))});return}await this._transport.send(o,r)}setRequestHandler(e,t,r){this.assertRequestHandlerCapability(e);let o;if(typeof t=="function"){if(!Cp(e))throw new TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,s)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason==="not-in-era"&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason==="not-in-era"?new ee(J.InternalError,`No wire schema for ${e} in the resolved era`):new Error(a.message);return Promise.resolve(t(a.value,s))}}else if(r)o=async(n,s)=>{let i=await Xr(t.params,{...n.params});if(!i.success)throw new ee(J.InvalidParams,`Invalid params for ${e}: ${i.error}`);return r(i.data,s)};else throw new TypeError("setRequestHandler: handler is required");this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if(typeof t=="function"){if(!Np(e))throw new TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(o,n)=>{let s=n.validateNotification(e,o);if(!s.ok)throw s.reason==="not-in-era"?new ee(J.InternalError,`No wire schema for ${e} in the resolved era`):new Error(s.message);return Promise.resolve(t(s.value))});return}if(!r)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async o=>{let n=await Xr(t.params,{...o.params});if(!n.success)throw new ee(J.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function js(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function nm(e,t){let r={...e};for(let o in t){let n=o,s=t[n];if(s===void 0)continue;let i=r[n];r[n]=js(i)&&js(s)?{...i,...s}:s}return r}function yz(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function yk(e){let t={},r=[];if(!yz(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!yz(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function Sk(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}var bk=U(e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(a){if(!a)throw new TypeError("argument string is required");var c=typeof a=="object"?s(a):a;if(typeof c!="string")throw new TypeError("argument string is required to be a string");var u=c.indexOf(";"),l=u!==-1?c.slice(0,u).trim():c.trim();if(!o.test(l))throw new TypeError("invalid media type");var d=new i(l.toLowerCase());if(u!==-1){var p,g,m;for(t.lastIndex=u;g=t.exec(c);){if(g.index!==u)throw new TypeError("invalid parameter format");u+=g[0].length,p=g[1].toLowerCase(),m=g[2],m.charCodeAt(0)===34&&(m=m.slice(1,-1),m.indexOf("\\")!==-1&&(m=m.replace(r,"$1"))),d.parameters[p]=m}if(u!==c.length)throw new TypeError("invalid parameter format")}return d}function s(a){var c;if(typeof a.getHeader=="function"?c=a.getHeader("content-type"):typeof a.headers=="object"&&(c=a.headers&&a.headers["content-type"]),typeof c!="string")throw new TypeError("content-type header is missing from object");return c}function i(a){this.parameters=Object.create(null),this.type=a}}),BN=ai(bk(),1);var Yz=10*1024*1024,sm=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??Yz}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){for(;this._buffer;){let e=this._buffer.indexOf(`
121
- `);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return Xz(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};function Xz(e){return Wn.parse(JSON.parse(e))}function im(e){return JSON.stringify(e)+`
122
- `}var zk=/^[A-Za-z0-9._-]{1,128}$/;function $k(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!zk.test(e)){let r=[...e].filter(o=>!/[A-Za-z0-9._-]/.test(o)).filter((o,n,s)=>s.indexOf(o)===n);return t.push(`Tool name contains invalid characters: ${r.map(o=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function wk(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function am(e){let t=$k(e);return wk(e,t.warnings),t.isValid}function Rk(e){return typeof e=="object"&&e!==null&&"_zod"in e}function Pk(e){return typeof e=="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName=="string"}function Ek(e){if(typeof e!="object"||e===null||Go(e))return!1;let t=Object.getPrototypeOf(e);return t!==Object.prototype&&t!==null?!1:Object.values(e).every(r=>Rk(r))}function yu(e){if(e!==void 0){if(Ek(e))return N(e);if(typeof e=="object"&&e!==null&&!Go(e)&&Object.values(e).some(t=>Pk(t)))throw new TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!Go(e))throw new TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return e}}var bu=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(f){if(super(),!e.IDENTIFIER.test(f))throw new Error("CodeGen: name must be a valid identifier");this.str=f}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(f){super(),this._items=typeof f=="string"?[f]:f}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let f=this._items[0];return f===""||f==='""'}get str(){var f;return(f=this._str)!==null&&f!==void 0?f:this._str=this._items.reduce((z,_)=>`${z}${_}`,"")}get names(){var f;return(f=this._names)!==null&&f!==void 0?f:this._names=this._items.reduce((z,_)=>(_ instanceof r&&(z[_.str]=(z[_.str]||0)+1),z),{})}};e._Code=o,e.nil=new o("");function n(f,...z){let _=[f[0]],b=0;for(;b<z.length;)a(_,z[b]),_.push(f[++b]);return new o(_)}e._=n;let s=new o("+");function i(f,...z){let _=[g(f[0])],b=0;for(;b<z.length;)_.push(s),a(_,z[b]),_.push(s,g(f[++b]));return c(_),new o(_)}e.str=i;function a(f,z){z instanceof o?f.push(...z._items):z instanceof r?f.push(z):f.push(d(z))}e.addCodeArg=a;function c(f){let z=1;for(;z<f.length-1;){if(f[z]===s){let _=u(f[z-1],f[z+1]);if(_!==void 0){f.splice(z-1,3,_);continue}f[z++]="+"}z++}}function u(f,z){if(z==='""')return f;if(f==='""')return z;if(typeof f=="string")return z instanceof r||f[f.length-1]!=='"'?void 0:typeof z!="string"?`${f.slice(0,-1)}${z}"`:z[0]==='"'?f.slice(0,-1)+z.slice(1):void 0;if(typeof z=="string"&&z[0]==='"'&&!(f instanceof r))return`"${f}${z.slice(1)}`}function l(f,z){return z.emptyStr()?f:f.emptyStr()?z:i`${f}${z}`}e.strConcat=l;function d(f){return typeof f=="number"||typeof f=="boolean"||f===null?f:g(Array.isArray(f)?f.join(","):f)}function p(f){return new o(g(f))}e.stringify=p;function g(f){return JSON.stringify(f).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function m(f){return typeof f=="string"&&e.IDENTIFIER.test(f)?new o(`.${f}`):n`[${f}]`}e.getProperty=m;function v(f){if(typeof f=="string"&&e.IDENTIFIER.test(f))return new o(`${f}`);throw new Error(`CodeGen: invalid export name: ${f}, use explicit $id name mapping`)}e.getEsmExportName=v;function h(f){return new o(f.toString())}e.regexpCode=h}),Qz=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=bu();var r=class extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value}},o;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var n=class{constructor({prefixes:c,parent:u}={}){this._names={},this._prefixes=c,this._parent=u}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){let u=this._names[c]||this._nameGroup(c);return`${c}${u.index++}`}_nameGroup(c){var u,l;if(!((l=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||l===void 0)&&l.has(c)||this._prefixes&&!this._prefixes.has(c))throw new Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}};e.Scope=n;var s=class extends t.Name{constructor(c,u){super(u),this.prefix=c}setValue(c,{property:u,itemIndex:l}){this.value=c,this.scopePath=(0,t._)`.${new t.Name(u)}[${l}]`}};e.ValueScopeName=s;let i=(0,t._)`\n`;var a=class extends n{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?i:t.nil}}get(){return this._scope}name(c){return new s(c,this._newName(c))}value(c,u){var l;if(u.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let d=this.toName(c),{prefix:p}=d,g=(l=u.key)!==null&&l!==void 0?l:u.ref,m=this._values[p];if(m){let f=m.get(g);if(f)return f}else m=this._values[p]=new Map;m.set(g,d);let v=this._scope[p]||(this._scope[p]=[]),h=v.length;return v[h]=u.ref,d.setValue(u,{property:p,itemIndex:h}),d}getValue(c,u){let l=this._values[c];if(l)return l.get(u)}scopeRefs(c,u=this._values){return this._reduceValues(u,l=>{if(l.scopePath===void 0)throw new Error(`CodeGen: name "${l}" has no value`);return(0,t._)`${c}${l.scopePath}`})}scopeCode(c=this._values,u,l){return this._reduceValues(c,d=>{if(d.value===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return d.value.code},u,l)}_reduceValues(c,u,l={},d){let p=t.nil;for(let g in c){let m=c[g];if(!m)continue;let v=l[g]=l[g]||new Map;m.forEach(h=>{if(v.has(h))return;v.set(h,o.Started);let f=u(h);if(f){let z=this.opts.es5?e.varKinds.var:e.varKinds.const;p=(0,t._)`${p}${z} ${h} = ${f};${this.opts._n}`}else if(f=d?.(h))p=(0,t._)`${p}${f}${this.opts._n}`;else throw new r(h);v.set(h,o.Completed)})}return p}};e.ValueScope=a}),de=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=bu(),r=Qz();var o=bu();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var n=Qz();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var s=class{optimizeNodes(){return this}optimizeNames(w,x){return this}},i=class extends s{constructor(w,x,C){super(),this.varKind=w,this.name=x,this.rhs=C}render({es5:w,_n:x}){let C=w?r.varKinds.var:this.varKind,H=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${H};`+x}optimizeNames(w,x){if(w[this.name.str])return this.rhs&&(this.rhs=Y(this.rhs,w,x)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},a=class extends s{constructor(w,x,C){super(),this.lhs=w,this.rhs=x,this.sideEffects=C}render({_n:w}){return`${this.lhs} = ${this.rhs};`+w}optimizeNames(w,x){if(!(this.lhs instanceof t.Name&&!w[this.lhs.str]&&!this.sideEffects))return this.rhs=Y(this.rhs,w,x),this}get names(){return K(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends a{constructor(w,x,C,H){super(w,C,H),this.op=x}render({_n:w}){return`${this.lhs} ${this.op}= ${this.rhs};`+w}},u=class extends s{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`${this.label}:`+w}},l=class extends s{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`break${this.label?` ${this.label}`:""};`+w}},d=class extends s{constructor(w){super(),this.error=w}render({_n:w}){return`throw ${this.error};`+w}get names(){return this.error.names}},p=class extends s{constructor(w){super(),this.code=w}render({_n:w}){return`${this.code};`+w}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(w,x){return this.code=Y(this.code,w,x),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},g=class extends s{constructor(w=[]){super(),this.nodes=w}render(w){return this.nodes.reduce((x,C)=>x+C.render(w),"")}optimizeNodes(){let{nodes:w}=this,x=w.length;for(;x--;){let C=w[x].optimizeNodes();Array.isArray(C)?w.splice(x,1,...C):C?w[x]=C:w.splice(x,1)}return w.length>0?this:void 0}optimizeNames(w,x){let{nodes:C}=this,H=C.length;for(;H--;){let te=C[H];te.optimizeNames(w,x)||(fe(w,te.names),C.splice(H,1))}return C.length>0?this:void 0}get names(){return this.nodes.reduce((w,x)=>L(w,x.names),{})}},m=class extends g{render(w){return"{"+w._n+super.render(w)+"}"+w._n}},v=class extends g{},h=class extends m{};h.kind="else";var f=class Su extends m{constructor(x,C){super(C),this.condition=x}render(x){let C=`if(${this.condition})`+super.render(x);return this.else&&(C+="else "+this.else.render(x)),C}optimizeNodes(){super.optimizeNodes();let x=this.condition;if(x===!0)return this.nodes;let C=this.else;if(C){let H=C.optimizeNodes();C=this.else=Array.isArray(H)?new h(H):H}if(C)return x===!1?C instanceof Su?C:C.nodes:this.nodes.length?this:new Su(qe(x),C instanceof Su?[C]:C.nodes);if(!(x===!1||!this.nodes.length))return this}optimizeNames(x,C){var H;if(this.else=(H=this.else)===null||H===void 0?void 0:H.optimizeNames(x,C),!!(super.optimizeNames(x,C)||this.else))return this.condition=Y(this.condition,x,C),this}get names(){let x=super.names;return K(x,this.condition),this.else&&L(x,this.else.names),x}};f.kind="if";var z=class extends m{};z.kind="for";var _=class extends z{constructor(w){super(),this.iteration=w}render(w){return`for(${this.iteration})`+super.render(w)}optimizeNames(w,x){if(super.optimizeNames(w,x))return this.iteration=Y(this.iteration,w,x),this}get names(){return L(super.names,this.iteration.names)}},b=class extends z{constructor(w,x,C,H){super(),this.varKind=w,this.name=x,this.from=C,this.to=H}render(w){let x=w.es5?r.varKinds.var:this.varKind,{name:C,from:H,to:te}=this;return`for(${x} ${C}=${H}; ${C}<${te}; ${C}++)`+super.render(w)}get names(){return K(K(super.names,this.from),this.to)}},R=class extends z{constructor(w,x,C,H){super(),this.loop=w,this.varKind=x,this.name=C,this.iterable=H}render(w){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(w)}optimizeNames(w,x){if(super.optimizeNames(w,x))return this.iterable=Y(this.iterable,w,x),this}get names(){return L(super.names,this.iterable.names)}},S=class extends m{constructor(w,x,C){super(),this.name=w,this.args=x,this.async=C}render(w){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(w)}};S.kind="func";var y=class extends g{render(w){return"return "+super.render(w)}};y.kind="return";var $=class extends m{render(w){let x="try"+super.render(w);return this.catch&&(x+=this.catch.render(w)),this.finally&&(x+=this.finally.render(w)),x}optimizeNodes(){var w,x;return super.optimizeNodes(),(w=this.catch)===null||w===void 0||w.optimizeNodes(),(x=this.finally)===null||x===void 0||x.optimizeNodes(),this}optimizeNames(w,x){var C,H;return super.optimizeNames(w,x),(C=this.catch)===null||C===void 0||C.optimizeNames(w,x),(H=this.finally)===null||H===void 0||H.optimizeNames(w,x),this}get names(){let w=super.names;return this.catch&&L(w,this.catch.names),this.finally&&L(w,this.finally.names),w}},I=class extends m{constructor(w){super(),this.error=w}render(w){return`catch(${this.error})`+super.render(w)}};I.kind="catch";var q=class extends m{render(w){return"finally"+super.render(w)}};q.kind="finally";var O=class{constructor(w,x={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...x,_n:x.lines?`
123
- `:""},this._extScope=w,this._scope=new r.Scope({parent:w}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(w){return this._scope.name(w)}scopeName(w){return this._extScope.name(w)}scopeValue(w,x){let C=this._extScope.value(w,x);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(w,x){return this._extScope.getValue(w,x)}scopeRefs(w){return this._extScope.scopeRefs(w,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(w,x,C,H){let te=this._scope.toName(x);return C!==void 0&&H&&(this._constants[te.str]=C),this._leafNode(new i(w,te,C)),te}const(w,x,C){return this._def(r.varKinds.const,w,x,C)}let(w,x,C){return this._def(r.varKinds.let,w,x,C)}var(w,x,C){return this._def(r.varKinds.var,w,x,C)}assign(w,x,C){return this._leafNode(new a(w,x,C))}add(w,x){return this._leafNode(new c(w,e.operators.ADD,x))}code(w){return typeof w=="function"?w():w!==t.nil&&this._leafNode(new p(w)),this}object(...w){let x=["{"];for(let[C,H]of w)x.length>1&&x.push(","),x.push(C),(C!==H||this.opts.es5)&&(x.push(":"),(0,t.addCodeArg)(x,H));return x.push("}"),new t._Code(x)}if(w,x,C){if(this._blockNode(new f(w)),x&&C)this.code(x).else().code(C).endIf();else if(x)this.code(x).endIf();else if(C)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(w){return this._elseNode(new f(w))}else(){return this._elseNode(new h)}endIf(){return this._endBlockNode(f,h)}_for(w,x){return this._blockNode(w),x&&this.code(x).endFor(),this}for(w,x){return this._for(new _(w),x)}forRange(w,x,C,H,te=this.opts.es5?r.varKinds.var:r.varKinds.let){let me=this._scope.toName(w);return this._for(new b(te,me,x,C),()=>H(me))}forOf(w,x,C,H=r.varKinds.const){let te=this._scope.toName(w);if(this.opts.es5){let me=x instanceof t.Name?x:this.var("_arr",x);return this.forRange("_i",0,(0,t._)`${me}.length`,se=>{this.var(te,(0,t._)`${me}[${se}]`),C(te)})}return this._for(new R("of",H,te,x),()=>C(te))}forIn(w,x,C,H=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(w,(0,t._)`Object.keys(${x})`,C);let te=this._scope.toName(w);return this._for(new R("in",H,te,x),()=>C(te))}endFor(){return this._endBlockNode(z)}label(w){return this._leafNode(new u(w))}break(w){return this._leafNode(new l(w))}return(w){let x=new y;if(this._blockNode(x),this.code(w),x.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(y)}try(w,x,C){if(!x&&!C)throw new Error('CodeGen: "try" without "catch" and "finally"');let H=new $;if(this._blockNode(H),this.code(w),x){let te=this.name("e");this._currNode=H.catch=new I(te),x(te)}return C&&(this._currNode=H.finally=new q,this.code(C)),this._endBlockNode(I,q)}throw(w){return this._leafNode(new d(w))}block(w,x){return this._blockStarts.push(this._nodes.length),w&&this.code(w).endBlock(x),this}endBlock(w){let x=this._blockStarts.pop();if(x===void 0)throw new Error("CodeGen: not in self-balancing block");let C=this._nodes.length-x;if(C<0||w!==void 0&&C!==w)throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${w} expected`);return this._nodes.length=x,this}func(w,x=t.nil,C,H){return this._blockNode(new S(w,x,C)),H&&this.code(H).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(w=1){for(;w-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(w){return this._currNode.nodes.push(w),this}_blockNode(w){this._currNode.nodes.push(w),this._nodes.push(w)}_endBlockNode(w,x){let C=this._currNode;if(C instanceof w||x&&C instanceof x)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${x?`${w.kind}/${x.kind}`:w.kind}"`)}_elseNode(w){let x=this._currNode;if(!(x instanceof f))throw new Error('CodeGen: "else" without "if"');return this._currNode=x.else=w,this}get _root(){return this._nodes[0]}get _currNode(){let w=this._nodes;return w[w.length-1]}set _currNode(w){let x=this._nodes;x[x.length-1]=w}};e.CodeGen=O;function L(w,x){for(let C in x)w[C]=(w[C]||0)+(x[C]||0);return w}function K(w,x){return x instanceof t._CodeOrName?L(w,x.names):w}function Y(w,x,C){if(w instanceof t.Name)return H(w);if(!te(w))return w;return new t._Code(w._items.reduce((me,se)=>(se instanceof t.Name&&(se=H(se)),se instanceof t._Code?me.push(...se._items):me.push(se),me),[]));function H(me){let se=C[me.str];return se===void 0||x[me.str]!==1?me:(delete x[me.str],se)}function te(me){return me instanceof t._Code&&me._items.some(se=>se instanceof t.Name&&x[se.str]===1&&C[se.str]!==void 0)}}function fe(w,x){for(let C in x)w[C]=(w[C]||0)-(x[C]||0)}function qe(w){return typeof w=="boolean"||typeof w=="number"||w===null?!w:(0,t._)`!${F(w)}`}e.not=qe;let Ie=j(e.operators.AND);function Ye(...w){return w.reduce(Ie)}e.and=Ye;let ye=j(e.operators.OR);function T(...w){return w.reduce(ye)}e.or=T;function j(w){return(x,C)=>x===t.nil?C:C===t.nil?x:(0,t._)`${F(x)} ${w} ${F(C)}`}function F(w){return w instanceof t.Name?w:(0,t._)`(${w})`}}),be=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let t=de(),r=bu();function o(S){let y={};for(let $ of S)y[$]=!0;return y}e.toHash=o;function n(S,y){return typeof y=="boolean"?y:Object.keys(y).length===0?!0:(s(S,y),!i(y,S.self.RULES.all))}e.alwaysValidSchema=n;function s(S,y=S.schema){let{opts:$,self:I}=S;if(!$.strictSchema||typeof y=="boolean")return;let q=I.RULES.keywords;for(let O in y)q[O]||R(S,`unknown keyword: "${O}"`)}e.checkUnknownRules=s;function i(S,y){if(typeof S=="boolean")return!S;for(let $ in S)if(y[$])return!0;return!1}e.schemaHasRules=i;function a(S,y){if(typeof S=="boolean")return!S;for(let $ in S)if($!=="$ref"&&y.all[$])return!0;return!1}e.schemaHasRulesButRef=a;function c({topSchemaRef:S,schemaPath:y},$,I,q){if(!q){if(typeof $=="number"||typeof $=="boolean")return $;if(typeof $=="string")return(0,t._)`${$}`}return(0,t._)`${S}${y}${(0,t.getProperty)(I)}`}e.schemaRefOrVal=c;function u(S){return p(decodeURIComponent(S))}e.unescapeFragment=u;function l(S){return encodeURIComponent(d(S))}e.escapeFragment=l;function d(S){return typeof S=="number"?`${S}`:S.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=d;function p(S){return S.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=p;function g(S,y){if(Array.isArray(S))for(let $ of S)y($);else y(S)}e.eachItem=g;function m({mergeNames:S,mergeToName:y,mergeValues:$,resultToName:I}){return(q,O,L,K)=>{let Y=L===void 0?O:L instanceof t.Name?(O instanceof t.Name?S(q,O,L):y(q,O,L),L):O instanceof t.Name?(y(q,L,O),O):$(O,L);return K===t.Name&&!(Y instanceof t.Name)?I(q,Y):Y}}e.mergeEvaluated={props:m({mergeNames:(S,y,$)=>S.if((0,t._)`${$} !== true && ${y} !== undefined`,()=>{S.if((0,t._)`${y} === true`,()=>S.assign($,!0),()=>S.assign($,(0,t._)`${$} || {}`).code((0,t._)`Object.assign(${$}, ${y})`))}),mergeToName:(S,y,$)=>S.if((0,t._)`${$} !== true`,()=>{y===!0?S.assign($,!0):(S.assign($,(0,t._)`${$} || {}`),h(S,$,y))}),mergeValues:(S,y)=>S===!0?!0:{...S,...y},resultToName:v}),items:m({mergeNames:(S,y,$)=>S.if((0,t._)`${$} !== true && ${y} !== undefined`,()=>S.assign($,(0,t._)`${y} === true ? true : ${$} > ${y} ? ${$} : ${y}`)),mergeToName:(S,y,$)=>S.if((0,t._)`${$} !== true`,()=>S.assign($,y===!0?!0:(0,t._)`${$} > ${y} ? ${$} : ${y}`)),mergeValues:(S,y)=>S===!0?!0:Math.max(S,y),resultToName:(S,y)=>S.var("items",y)})};function v(S,y){if(y===!0)return S.var("props",!0);let $=S.var("props",(0,t._)`{}`);return y!==void 0&&h(S,$,y),$}e.evaluatedPropsToName=v;function h(S,y,$){Object.keys($).forEach(I=>S.assign((0,t._)`${y}${(0,t.getProperty)(I)}`,!0))}e.setEvaluated=h;let f={};function z(S,y){return S.scopeValue("func",{ref:y,code:f[y.code]||(f[y.code]=new r._Code(y.code))})}e.useFunc=z;var _;(function(S){S[S.Num=0]="Num",S[S.Str=1]="Str"})(_||(e.Type=_={}));function b(S,y,$){if(S instanceof t.Name){let I=y===_.Num;return $?I?(0,t._)`"[" + ${S} + "]"`:(0,t._)`"['" + ${S} + "']"`:I?(0,t._)`"/" + ${S}`:(0,t._)`"/" + ${S}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return $?(0,t.getProperty)(S).toString():"/"+d(S)}e.getErrorPath=b;function R(S,y,$=S.opts.strictSchema){if($){if(y=`strict mode: ${y}`,$===!0)throw new Error(y);S.self.logger.warn(y)}}e.checkStrictMode=R}),qt=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};e.default=r}),$u=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=de(),r=be(),o=qt();e.keywordError={message:({keyword:h})=>(0,t.str)`must pass "${h}" keyword validation`},e.keyword$DataError={message:({keyword:h,schemaType:f})=>f?(0,t.str)`"${h}" keyword must be ${f} ($data)`:(0,t.str)`"${h}" keyword is invalid ($data)`};function n(h,f=e.keywordError,z,_){let{it:b}=h,{gen:R,compositeRule:S,allErrors:y}=b,$=d(h,f,z);_??(S||y)?c(R,$):u(b,(0,t._)`[${$}]`)}e.reportError=n;function s(h,f=e.keywordError,z){let{it:_}=h,{gen:b,compositeRule:R,allErrors:S}=_;c(b,d(h,f,z)),R||S||u(_,o.default.vErrors)}e.reportExtraError=s;function i(h,f){h.assign(o.default.errors,f),h.if((0,t._)`${o.default.vErrors} !== null`,()=>h.if(f,()=>h.assign((0,t._)`${o.default.vErrors}.length`,f),()=>h.assign(o.default.vErrors,null)))}e.resetErrorsCount=i;function a({gen:h,keyword:f,schemaValue:z,data:_,errsCount:b,it:R}){if(b===void 0)throw new Error("ajv implementation error");let S=h.name("err");h.forRange("i",b,o.default.errors,y=>{h.const(S,(0,t._)`${o.default.vErrors}[${y}]`),h.if((0,t._)`${S}.instancePath === undefined`,()=>h.assign((0,t._)`${S}.instancePath`,(0,t.strConcat)(o.default.instancePath,R.errorPath))),h.assign((0,t._)`${S}.schemaPath`,(0,t.str)`${R.errSchemaPath}/${f}`),R.opts.verbose&&(h.assign((0,t._)`${S}.schema`,z),h.assign((0,t._)`${S}.data`,_))})}e.extendErrors=a;function c(h,f){let z=h.const("err",f);h.if((0,t._)`${o.default.vErrors} === null`,()=>h.assign(o.default.vErrors,(0,t._)`[${z}]`),(0,t._)`${o.default.vErrors}.push(${z})`),h.code((0,t._)`${o.default.errors}++`)}function u(h,f){let{gen:z,validateName:_,schemaEnv:b}=h;b.$async?z.throw((0,t._)`new ${h.ValidationError}(${f})`):(z.assign((0,t._)`${_}.errors`,f),z.return(!1))}let l={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function d(h,f,z){let{createErrors:_}=h.it;return _===!1?(0,t._)`{}`:p(h,f,z)}function p(h,f,z={}){let{gen:_,it:b}=h,R=[g(b,z),m(h,z)];return v(h,f,R),_.object(...R)}function g({errorPath:h},{instancePath:f}){let z=f?(0,t.str)`${h}${(0,r.getErrorPath)(f,r.Type.Str)}`:h;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,z)]}function m({keyword:h,it:{errSchemaPath:f}},{schemaPath:z,parentSchema:_}){let b=_?f:(0,t.str)`${f}/${h}`;return z&&(b=(0,t.str)`${b}${(0,r.getErrorPath)(z,r.Type.Str)}`),[l.schemaPath,b]}function v(h,{params:f,message:z},_){let{keyword:b,data:R,schemaValue:S,it:y}=h,{opts:$,propertyName:I,topSchemaRef:q,schemaPath:O}=y;_.push([l.keyword,b],[l.params,typeof f=="function"?f(h):f||(0,t._)`{}`]),$.messages&&_.push([l.message,typeof z=="function"?z(h):z]),$.verbose&&_.push([l.schema,S],[l.parentSchema,(0,t._)`${q}${O}`],[o.default.data,R]),I&&_.push([l.propertyName,I])}}),kk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=$u(),r=de(),o=qt(),n={message:"boolean schema is false"};function s(c){let{gen:u,schema:l,validateName:d}=c;l===!1?a(c,!1):typeof l=="object"&&l.$async===!0?u.return(o.default.data):(u.assign((0,r._)`${d}.errors`,null),u.return(!0))}e.topBoolOrEmptySchema=s;function i(c,u){let{gen:l,schema:d}=c;d===!1?(l.var(u,!1),a(c)):l.var(u,!0)}e.boolOrEmptySchema=i;function a(c,u){let{gen:l,data:d}=c,p={gen:l,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,t.reportError)(p,n,void 0,u)}}),e$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);function r(n){return typeof n=="string"&&t.has(n)}e.isJSONType=r;function o(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=o}),t$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:s},i){let a=s.RULES.types[i];return a&&a!==!0&&r(n,a)}e.schemaHasRulesForType=t;function r(n,s){return s.rules.some(i=>o(n,i))}e.shouldUseGroup=r;function o(n,s){var i;return n[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some(a=>n[a]!==void 0))}e.shouldUseRule=o}),zu=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let t=e$(),r=t$(),o=$u(),n=de(),s=be();var i;(function(_){_[_.Correct=0]="Correct",_[_.Wrong=1]="Wrong"})(i||(e.DataType=i={}));function a(_){let b=c(_.type);if(b.includes("null")){if(_.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!b.length&&_.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');_.nullable===!0&&b.push("null")}return b}e.getSchemaTypes=a;function c(_){let b=Array.isArray(_)?_:_?[_]:[];if(b.every(t.isJSONType))return b;throw new Error("type must be JSONType or JSONType[]: "+b.join(","))}e.getJSONTypes=c;function u(_,b){let{gen:R,data:S,opts:y}=_,$=d(b,y.coerceTypes),I=b.length>0&&!($.length===0&&b.length===1&&(0,r.schemaHasRulesForType)(_,b[0]));if(I){let q=v(b,S,y.strictNumbers,i.Wrong);R.if(q,()=>{$.length?p(_,b,$):f(_)})}return I}e.coerceAndCheckDataType=u;let l=new Set(["string","number","integer","boolean","null"]);function d(_,b){return b?_.filter(R=>l.has(R)||b==="array"&&R==="array"):[]}function p(_,b,R){let{gen:S,data:y,opts:$}=_,I=S.let("dataType",(0,n._)`typeof ${y}`),q=S.let("coerced",(0,n._)`undefined`);$.coerceTypes==="array"&&S.if((0,n._)`${I} == 'object' && Array.isArray(${y}) && ${y}.length == 1`,()=>S.assign(y,(0,n._)`${y}[0]`).assign(I,(0,n._)`typeof ${y}`).if(v(b,y,$.strictNumbers),()=>S.assign(q,y))),S.if((0,n._)`${q} !== undefined`);for(let L of R)(l.has(L)||L==="array"&&$.coerceTypes==="array")&&O(L);S.else(),f(_),S.endIf(),S.if((0,n._)`${q} !== undefined`,()=>{S.assign(y,q),g(_,q)});function O(L){switch(L){case"string":S.elseIf((0,n._)`${I} == "number" || ${I} == "boolean"`).assign(q,(0,n._)`"" + ${y}`).elseIf((0,n._)`${y} === null`).assign(q,(0,n._)`""`);return;case"number":S.elseIf((0,n._)`${I} == "boolean" || ${y} === null
124
- || (${I} == "string" && ${y} && ${y} == +${y})`).assign(q,(0,n._)`+${y}`);return;case"integer":S.elseIf((0,n._)`${I} === "boolean" || ${y} === null
125
- || (${I} === "string" && ${y} && ${y} == +${y} && !(${y} % 1))`).assign(q,(0,n._)`+${y}`);return;case"boolean":S.elseIf((0,n._)`${y} === "false" || ${y} === 0 || ${y} === null`).assign(q,!1).elseIf((0,n._)`${y} === "true" || ${y} === 1`).assign(q,!0);return;case"null":S.elseIf((0,n._)`${y} === "" || ${y} === 0 || ${y} === false`),S.assign(q,null);return;case"array":S.elseIf((0,n._)`${I} === "string" || ${I} === "number"
126
- || ${I} === "boolean" || ${y} === null`).assign(q,(0,n._)`[${y}]`)}}}function g({gen:_,parentData:b,parentDataProperty:R},S){_.if((0,n._)`${b} !== undefined`,()=>_.assign((0,n._)`${b}[${R}]`,S))}function m(_,b,R,S=i.Correct){let y=S===i.Correct?n.operators.EQ:n.operators.NEQ,$;switch(_){case"null":return(0,n._)`${b} ${y} null`;case"array":$=(0,n._)`Array.isArray(${b})`;break;case"object":$=(0,n._)`${b} && typeof ${b} == "object" && !Array.isArray(${b})`;break;case"integer":$=I((0,n._)`!(${b} % 1) && !isNaN(${b})`);break;case"number":$=I();break;default:return(0,n._)`typeof ${b} ${y} ${_}`}return S===i.Correct?$:(0,n.not)($);function I(q=n.nil){return(0,n.and)((0,n._)`typeof ${b} == "number"`,q,R?(0,n._)`isFinite(${b})`:n.nil)}}e.checkDataType=m;function v(_,b,R,S){if(_.length===1)return m(_[0],b,R,S);let y,$=(0,s.toHash)(_);if($.array&&$.object){let I=(0,n._)`typeof ${b} != "object"`;y=$.null?I:(0,n._)`!${b} || ${I}`,delete $.null,delete $.array,delete $.object}else y=n.nil;$.number&&delete $.integer;for(let I in $)y=(0,n.and)(y,m(I,b,R,S));return y}e.checkDataTypes=v;let h={message:({schema:_})=>`must be ${_}`,params:({schema:_,schemaValue:b})=>typeof _=="string"?(0,n._)`{type: ${_}}`:(0,n._)`{type: ${b}}`};function f(_){let b=z(_);(0,o.reportError)(b,h)}e.reportTypeError=f;function z(_){let{gen:b,data:R,schema:S}=_,y=(0,s.schemaRefOrVal)(_,S,"type");return{gen:b,keyword:"type",data:R,schema:S.type,schemaCode:y,schemaValue:y,parentSchema:S,params:{},it:_}}}),xk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=de(),r=be();function o(s,i){let{properties:a,items:c}=s.schema;if(i==="object"&&a)for(let u in a)n(s,u,a[u].default);else i==="array"&&Array.isArray(c)&&c.forEach((u,l)=>n(s,l,u.default))}e.assignDefaults=o;function n(s,i,a){let{gen:c,compositeRule:u,data:l,opts:d}=s;if(a===void 0)return;let p=(0,t._)`${l}${(0,t.getProperty)(i)}`;if(u){(0,r.checkStrictMode)(s,`default is ignored for: ${p}`);return}let g=(0,t._)`${p} === undefined`;d.useDefaults==="empty"&&(g=(0,t._)`${g} || ${p} === null || ${p} === ""`),c.if(g,(0,t._)`${p} = ${(0,t.stringify)(a)}`)}}),Zt=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=de(),r=be(),o=qt(),n=be();function s(_,b){let{gen:R,data:S,it:y}=_;R.if(d(R,S,b,y.opts.ownProperties),()=>{_.setParams({missingProperty:(0,t._)`${b}`},!0),_.error()})}e.checkReportMissingProp=s;function i({gen:_,data:b,it:{opts:R}},S,y){return(0,t.or)(...S.map($=>(0,t.and)(d(_,b,$,R.ownProperties),(0,t._)`${y} = ${$}`)))}e.checkMissingProp=i;function a(_,b){_.setParams({missingProperty:b},!0),_.error()}e.reportMissingProp=a;function c(_){return _.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function u(_,b,R){return(0,t._)`${c(_)}.call(${b}, ${R})`}e.isOwnProperty=u;function l(_,b,R,S){let y=(0,t._)`${b}${(0,t.getProperty)(R)} !== undefined`;return S?(0,t._)`${y} && ${u(_,b,R)}`:y}e.propertyInData=l;function d(_,b,R,S){let y=(0,t._)`${b}${(0,t.getProperty)(R)} === undefined`;return S?(0,t.or)(y,(0,t.not)(u(_,b,R))):y}e.noPropertyInData=d;function p(_){return _?Object.keys(_).filter(b=>b!=="__proto__"):[]}e.allSchemaProperties=p;function g(_,b){return p(b).filter(R=>!(0,r.alwaysValidSchema)(_,b[R]))}e.schemaProperties=g;function m({schemaCode:_,data:b,it:{gen:R,topSchemaRef:S,schemaPath:y,errorPath:$},it:I},q,O,L){let K=L?(0,t._)`${_}, ${b}, ${S}${y}`:b,Y=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,$)],[o.default.parentData,I.parentData],[o.default.parentDataProperty,I.parentDataProperty],[o.default.rootData,o.default.rootData]];I.opts.dynamicRef&&Y.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let fe=(0,t._)`${K}, ${R.object(...Y)}`;return O!==t.nil?(0,t._)`${q}.call(${O}, ${fe})`:(0,t._)`${q}(${fe})`}e.callValidateCode=m;let v=(0,t._)`new RegExp`;function h({gen:_,it:{opts:b}},R){let S=b.unicodeRegExp?"u":"",{regExp:y}=b.code,$=y(R,S);return _.scopeValue("pattern",{key:$.toString(),ref:$,code:(0,t._)`${y.code==="new RegExp"?v:(0,n.useFunc)(_,y)}(${R}, ${S})`})}e.usePattern=h;function f(_){let{gen:b,data:R,keyword:S,it:y}=_,$=b.name("valid");if(y.allErrors){let q=b.let("valid",!0);return I(()=>b.assign(q,!1)),q}return b.var($,!0),I(()=>b.break()),$;function I(q){let O=b.const("len",(0,t._)`${R}.length`);b.forRange("i",0,O,L=>{_.subschema({keyword:S,dataProp:L,dataPropType:r.Type.Num},$),b.if((0,t.not)($),q)})}}e.validateArray=f;function z(_){let{gen:b,schema:R,keyword:S,it:y}=_;if(!Array.isArray(R))throw new Error("ajv implementation error");if(R.some(q=>(0,r.alwaysValidSchema)(y,q))&&!y.opts.unevaluated)return;let $=b.let("valid",!1),I=b.name("_valid");b.block(()=>R.forEach((q,O)=>{let L=_.subschema({keyword:S,schemaProp:O,compositeRule:!0},I);b.assign($,(0,t._)`${$} || ${I}`),_.mergeValidEvaluated(L,I)||b.if((0,t.not)($))})),_.result($,()=>_.reset(),()=>_.error(!0))}e.validateUnion=z}),Tk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=de(),r=qt(),o=Zt(),n=$u();function s(g,m){let{gen:v,keyword:h,schema:f,parentSchema:z,it:_}=g,b=m.macro.call(_.self,f,z,_),R=l(v,h,b);_.opts.validateSchema!==!1&&_.self.validateSchema(b,!0);let S=v.name("valid");g.subschema({schema:b,schemaPath:t.nil,errSchemaPath:`${_.errSchemaPath}/${h}`,topSchemaRef:R,compositeRule:!0},S),g.pass(S,()=>g.error(!0))}e.macroKeywordCode=s;function i(g,m){var v;let{gen:h,keyword:f,schema:z,parentSchema:_,$data:b,it:R}=g;u(R,m);let S=l(h,f,!b&&m.compile?m.compile.call(R.self,z,_,R):m.validate),y=h.let("valid");g.block$data(y,$),g.ok((v=m.valid)!==null&&v!==void 0?v:y);function $(){if(m.errors===!1)O(),m.modifying&&a(g),L(()=>g.error());else{let K=m.async?I():q();m.modifying&&a(g),L(()=>c(g,K))}}function I(){let K=h.let("ruleErrs",null);return h.try(()=>O((0,t._)`await `),Y=>h.assign(y,!1).if((0,t._)`${Y} instanceof ${R.ValidationError}`,()=>h.assign(K,(0,t._)`${Y}.errors`),()=>h.throw(Y))),K}function q(){let K=(0,t._)`${S}.errors`;return h.assign(K,null),O(t.nil),K}function O(K=m.async?(0,t._)`await `:t.nil){let Y=R.opts.passContext?r.default.this:r.default.self,fe=!("compile"in m&&!b||m.schema===!1);h.assign(y,(0,t._)`${K}${(0,o.callValidateCode)(g,S,Y,fe)}`,m.modifying)}function L(K){var Y;h.if((0,t.not)((Y=m.valid)!==null&&Y!==void 0?Y:y),K)}}e.funcKeywordCode=i;function a(g){let{gen:m,data:v,it:h}=g;m.if(h.parentData,()=>m.assign(v,(0,t._)`${h.parentData}[${h.parentDataProperty}]`))}function c(g,m){let{gen:v}=g;v.if((0,t._)`Array.isArray(${m})`,()=>{v.assign(r.default.vErrors,(0,t._)`${r.default.vErrors} === null ? ${m} : ${r.default.vErrors}.concat(${m})`).assign(r.default.errors,(0,t._)`${r.default.vErrors}.length`),(0,n.extendErrors)(g)},()=>g.error())}function u({schemaEnv:g},m){if(m.async&&!g.$async)throw new Error("async keyword in sync schema")}function l(g,m,v){if(v===void 0)throw new Error(`keyword "${m}" failed to compile`);return g.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,t.stringify)(v)})}function d(g,m,v=!1){return!m.length||m.some(h=>h==="array"?Array.isArray(g):h==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==h||v&&typeof g>"u")}e.validSchemaType=d;function p({schema:g,opts:m,self:v,errSchemaPath:h},f,z){if(Array.isArray(f.keyword)?!f.keyword.includes(z):f.keyword!==z)throw new Error("ajv implementation error");let _=f.dependencies;if(_?.some(b=>!Object.prototype.hasOwnProperty.call(g,b)))throw new Error(`parent schema must have dependencies of ${z}: ${_.join(",")}`);if(f.validateSchema&&!f.validateSchema(g[z])){let b=`keyword "${z}" value is invalid at path "${h}": `+v.errorsText(f.validateSchema.errors);if(m.validateSchema==="log")v.logger.error(b);else throw new Error(b)}}e.validateKeywordUsage=p}),Ik=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=de(),r=be();function o(i,{keyword:a,schemaProp:c,schema:u,schemaPath:l,errSchemaPath:d,topSchemaRef:p}){if(a!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){let g=i.schema[a];return c===void 0?{schema:g,schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${a}`}:{schema:g[c],schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(a)}${(0,t.getProperty)(c)}`,errSchemaPath:`${i.errSchemaPath}/${a}/${(0,r.escapeFragment)(c)}`}}if(u!==void 0){if(l===void 0||d===void 0||p===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:l,topSchemaRef:p,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(i,a,{dataProp:c,dataPropType:u,data:l,dataTypes:d,propertyName:p}){if(l!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:g}=a;if(c!==void 0){let{errorPath:v,dataPathArr:h,opts:f}=a;m(g.let("data",(0,t._)`${a.data}${(0,t.getProperty)(c)}`,!0)),i.errorPath=(0,t.str)`${v}${(0,r.getErrorPath)(c,u,f.jsPropertySyntax)}`,i.parentDataProperty=(0,t._)`${c}`,i.dataPathArr=[...h,i.parentDataProperty]}l!==void 0&&(m(l instanceof t.Name?l:g.let("data",l,!0)),p!==void 0&&(i.propertyName=p)),d&&(i.dataTypes=d);function m(v){i.data=v,i.dataLevel=a.dataLevel+1,i.dataTypes=[],a.definedProperties=new Set,i.parentData=a.data,i.dataNames=[...a.dataNames,v]}}e.extendSubschemaData=n;function s(i,{jtdDiscriminator:a,jtdMetadata:c,compositeRule:u,createErrors:l,allErrors:d}){u!==void 0&&(i.compositeRule=u),l!==void 0&&(i.createErrors=l),d!==void 0&&(i.allErrors=d),i.jtdDiscriminator=a,i.jtdMetadata=c}e.extendSubschemaMode=s}),r$=U((e,t)=>{t.exports=function r(o,n){if(o===n)return!0;if(o&&n&&typeof o=="object"&&typeof n=="object"){if(o.constructor!==n.constructor)return!1;var s,i,a;if(Array.isArray(o)){if(s=o.length,s!=n.length)return!1;for(i=s;i--!==0;)if(!r(o[i],n[i]))return!1;return!0}if(o.constructor===RegExp)return o.source===n.source&&o.flags===n.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===n.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===n.toString();if(a=Object.keys(o),s=a.length,s!==Object.keys(n).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=s;i--!==0;){var c=a[i];if(!r(o[c],n[c]))return!1}return!0}return o!==o&&n!==n}}),Ok=U((e,t)=>{var r=t.exports=function(s,i,a){typeof i=="function"&&(a=i,i={}),a=i.cb||a;var c=typeof a=="function"?a:a.pre||function(){},u=a.post||function(){};o(i,c,u,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function o(s,i,a,c,u,l,d,p,g,m){if(c&&typeof c=="object"&&!Array.isArray(c)){i(c,u,l,d,p,g,m);for(var v in c){var h=c[v];if(Array.isArray(h)){if(v in r.arrayKeywords)for(var f=0;f<h.length;f++)o(s,i,a,h[f],u+"/"+v+"/"+f,l,u,v,c,f)}else if(v in r.propsKeywords){if(h&&typeof h=="object")for(var z in h)o(s,i,a,h[z],u+"/"+v+"/"+n(z),l,u,v,c,z)}else(v in r.keywords||s.allKeys&&!(v in r.skipKeywords))&&o(s,i,a,h,u+"/"+v,l,u,v,c)}a(c,u,l,d,p,g,m)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}}),wu=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=be(),r=r$(),o=Ok(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(h,f=!0){return typeof h=="boolean"?!0:f===!0?!a(h):f?c(h)<=f:!1}e.inlineRef=s;let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(h){for(let f in h){if(i.has(f))return!0;let z=h[f];if(Array.isArray(z)&&z.some(a)||typeof z=="object"&&a(z))return!0}return!1}function c(h){let f=0;for(let z in h){if(z==="$ref")return 1/0;if(f++,!n.has(z)&&(typeof h[z]=="object"&&(0,t.eachItem)(h[z],_=>f+=c(_)),f===1/0))return 1/0}return f}function u(h,f="",z){return z!==!1&&(f=p(f)),l(h,h.parse(f))}e.getFullPath=u;function l(h,f){return h.serialize(f).split("#")[0]+"#"}e._getFullPath=l;let d=/#\/?$/;function p(h){return h?h.replace(d,""):""}e.normalizeId=p;function g(h,f,z){return z=p(z),h.resolve(f,z)}e.resolveUrl=g;let m=/^[a-z_][-a-z0-9._]*$/i;function v(h,f){if(typeof h=="boolean")return{};let{schemaId:z,uriResolver:_}=this.opts,b=p(h[z]||f),R={"":b},S=u(_,b,!1),y={},$=new Set;return o(h,{allKeys:!0},(O,L,K,Y)=>{if(Y===void 0)return;let fe=S+L,qe=R[Y];typeof O[z]=="string"&&(qe=Ie.call(this,O[z])),Ye.call(this,O.$anchor),Ye.call(this,O.$dynamicAnchor),R[L]=qe;function Ie(ye){let T=this.opts.uriResolver.resolve;if(ye=p(qe?T(qe,ye):ye),$.has(ye))throw q(ye);$.add(ye);let j=this.refs[ye];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?I(O,j.schema,ye):ye!==p(fe)&&(ye[0]==="#"?(I(O,y[ye],ye),y[ye]=O):this.refs[ye]=fe),ye}function Ye(ye){if(typeof ye=="string"){if(!m.test(ye))throw new Error(`invalid anchor "${ye}"`);Ie.call(this,`#${ye}`)}}}),y;function I(O,L,K){if(L!==void 0&&!r(O,L))throw q(K)}function q(O){return new Error(`reference "${O}" resolves to more than one schema`)}}e.getSchemaRefs=v}),Xo=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=kk(),r=zu(),o=t$(),n=zu(),s=xk(),i=Tk(),a=Ik(),c=de(),u=qt(),l=wu(),d=be(),p=$u();function g(E){if(S(E)&&($(E),R(E))){f(E);return}m(E,()=>(0,t.topBoolOrEmptySchema)(E))}e.validateFunctionCode=g;function m({gen:E,validateName:A,schema:D,schemaEnv:oe,opts:ne},pe){ne.code.es5?E.func(A,(0,c._)`${u.default.data}, ${u.default.valCxt}`,oe.$async,()=>{E.code((0,c._)`"use strict"; ${_(D,ne)}`),h(E,ne),E.code(pe)}):E.func(A,(0,c._)`${u.default.data}, ${v(ne)}`,oe.$async,()=>E.code(_(D,ne)).code(pe))}function v(E){return(0,c._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${E.dynamicRef?(0,c._)`, ${u.default.dynamicAnchors}={}`:c.nil}}={}`}function h(E,A){E.if(u.default.valCxt,()=>{E.var(u.default.instancePath,(0,c._)`${u.default.valCxt}.${u.default.instancePath}`),E.var(u.default.parentData,(0,c._)`${u.default.valCxt}.${u.default.parentData}`),E.var(u.default.parentDataProperty,(0,c._)`${u.default.valCxt}.${u.default.parentDataProperty}`),E.var(u.default.rootData,(0,c._)`${u.default.valCxt}.${u.default.rootData}`),A.dynamicRef&&E.var(u.default.dynamicAnchors,(0,c._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{E.var(u.default.instancePath,(0,c._)`""`),E.var(u.default.parentData,(0,c._)`undefined`),E.var(u.default.parentDataProperty,(0,c._)`undefined`),E.var(u.default.rootData,u.default.data),A.dynamicRef&&E.var(u.default.dynamicAnchors,(0,c._)`{}`)})}function f(E){let{schema:A,opts:D,gen:oe}=E;m(E,()=>{D.$comment&&A.$comment&&Y(E),O(E),oe.let(u.default.vErrors,null),oe.let(u.default.errors,0),D.unevaluated&&z(E),I(E),fe(E)})}function z(E){let{gen:A,validateName:D}=E;E.evaluated=A.const("evaluated",(0,c._)`${D}.evaluated`),A.if((0,c._)`${E.evaluated}.dynamicProps`,()=>A.assign((0,c._)`${E.evaluated}.props`,(0,c._)`undefined`)),A.if((0,c._)`${E.evaluated}.dynamicItems`,()=>A.assign((0,c._)`${E.evaluated}.items`,(0,c._)`undefined`))}function _(E,A){let D=typeof E=="object"&&E[A.schemaId];return D&&(A.code.source||A.code.process)?(0,c._)`/*# sourceURL=${D} */`:c.nil}function b(E,A){if(S(E)&&($(E),R(E))){y(E,A);return}(0,t.boolOrEmptySchema)(E,A)}function R({schema:E,self:A}){if(typeof E=="boolean")return!E;for(let D in E)if(A.RULES.all[D])return!0;return!1}function S(E){return typeof E.schema!="boolean"}function y(E,A){let{schema:D,gen:oe,opts:ne}=E;ne.$comment&&D.$comment&&Y(E),L(E),K(E);let pe=oe.const("_errs",u.default.errors);I(E,pe),oe.var(A,(0,c._)`${pe} === ${u.default.errors}`)}function $(E){(0,d.checkUnknownRules)(E),q(E)}function I(E,A){if(E.opts.jtd)return Ie(E,[],!1,A);let D=(0,r.getSchemaTypes)(E.schema);Ie(E,D,!(0,r.coerceAndCheckDataType)(E,D),A)}function q(E){let{schema:A,errSchemaPath:D,opts:oe,self:ne}=E;A.$ref&&oe.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(A,ne.RULES)&&ne.logger.warn(`$ref: keywords ignored in schema at path "${D}"`)}function O(E){let{schema:A,opts:D}=E;A.default!==void 0&&D.useDefaults&&D.strictSchema&&(0,d.checkStrictMode)(E,"default is ignored in the schema root")}function L(E){let A=E.schema[E.opts.schemaId];A&&(E.baseId=(0,l.resolveUrl)(E.opts.uriResolver,E.baseId,A))}function K(E){if(E.schema.$async&&!E.schemaEnv.$async)throw new Error("async schema in sync schema")}function Y({gen:E,schemaEnv:A,schema:D,errSchemaPath:oe,opts:ne}){let pe=D.$comment;if(ne.$comment===!0)E.code((0,c._)`${u.default.self}.logger.log(${pe})`);else if(typeof ne.$comment=="function"){let Ge=(0,c.str)`${oe}/$comment`,et=E.scopeValue("root",{ref:A.root});E.code((0,c._)`${u.default.self}.opts.$comment(${pe}, ${Ge}, ${et}.schema)`)}}function fe(E){let{gen:A,schemaEnv:D,validateName:oe,ValidationError:ne,opts:pe}=E;D.$async?A.if((0,c._)`${u.default.errors} === 0`,()=>A.return(u.default.data),()=>A.throw((0,c._)`new ${ne}(${u.default.vErrors})`)):(A.assign((0,c._)`${oe}.errors`,u.default.vErrors),pe.unevaluated&&qe(E),A.return((0,c._)`${u.default.errors} === 0`))}function qe({gen:E,evaluated:A,props:D,items:oe}){D instanceof c.Name&&E.assign((0,c._)`${A}.props`,D),oe instanceof c.Name&&E.assign((0,c._)`${A}.items`,oe)}function Ie(E,A,D,oe){let{gen:ne,schema:pe,data:Ge,allErrors:et,opts:at,self:Xe}=E,{RULES:Ue}=Xe;if(pe.$ref&&(at.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(pe,Ue))){ne.block(()=>me(E,"$ref",Ue.all.$ref.definition));return}at.jtd||ye(E,A),ne.block(()=>{for(let tt of Ue.rules)Pt(tt);Pt(Ue.post)});function Pt(tt){(0,o.shouldUseGroup)(pe,tt)&&(tt.type?(ne.if((0,n.checkDataType)(tt.type,Ge,at.strictNumbers)),Ye(E,tt),A.length===1&&A[0]===tt.type&&D&&(ne.else(),(0,n.reportTypeError)(E)),ne.endIf()):Ye(E,tt),et||ne.if((0,c._)`${u.default.errors} === ${oe||0}`))}}function Ye(E,A){let{gen:D,schema:oe,opts:{useDefaults:ne}}=E;ne&&(0,s.assignDefaults)(E,A.type),D.block(()=>{for(let pe of A.rules)(0,o.shouldUseRule)(oe,pe)&&me(E,pe.keyword,pe.definition,A.type)})}function ye(E,A){E.schemaEnv.meta||!E.opts.strictTypes||(T(E,A),E.opts.allowUnionTypes||j(E,A),F(E,E.dataTypes))}function T(E,A){if(A.length){if(!E.dataTypes.length){E.dataTypes=A;return}A.forEach(D=>{x(E.dataTypes,D)||H(E,`type "${D}" not allowed by context "${E.dataTypes.join(",")}"`)}),C(E,A)}}function j(E,A){A.length>1&&!(A.length===2&&A.includes("null"))&&H(E,"use allowUnionTypes to allow union type keyword")}function F(E,A){let D=E.self.RULES.all;for(let oe in D){let ne=D[oe];if(typeof ne=="object"&&(0,o.shouldUseRule)(E.schema,ne)){let{type:pe}=ne.definition;pe.length&&!pe.some(Ge=>w(A,Ge))&&H(E,`missing type "${pe.join(",")}" for keyword "${oe}"`)}}}function w(E,A){return E.includes(A)||A==="number"&&E.includes("integer")}function x(E,A){return E.includes(A)||A==="integer"&&E.includes("number")}function C(E,A){let D=[];for(let oe of E.dataTypes)x(A,oe)?D.push(oe):A.includes("integer")&&oe==="number"&&D.push("integer");E.dataTypes=D}function H(E,A){let D=E.schemaEnv.baseId+E.errSchemaPath;A+=` at "${D}" (strictTypes)`,(0,d.checkStrictMode)(E,A,E.opts.strictTypes)}var te=class{constructor(E,A,D){if((0,i.validateKeywordUsage)(E,A,D),this.gen=E.gen,this.allErrors=E.allErrors,this.keyword=D,this.data=E.data,this.schema=E.schema[D],this.$data=A.$data&&E.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(E,this.schema,D,this.$data),this.schemaType=A.schemaType,this.parentSchema=E.schema,this.params={},this.it=E,this.def=A,this.$data)this.schemaCode=E.gen.const("vSchema",pt(this.$data,E));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,A.schemaType,A.allowUndefined))throw new Error(`${D} value must be ${JSON.stringify(A.schemaType)}`);("code"in A?A.trackErrors:A.errors!==!1)&&(this.errsCount=E.gen.const("_errs",u.default.errors))}result(E,A,D){this.failResult((0,c.not)(E),A,D)}failResult(E,A,D){this.gen.if(E),D?D():this.error(),A?(this.gen.else(),A(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(E,A){this.failResult((0,c.not)(E),void 0,A)}fail(E){if(E===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(E),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(E){if(!this.$data)return this.fail(E);let{schemaCode:A}=this;this.fail((0,c._)`${A} !== undefined && (${(0,c.or)(this.invalid$data(),E)})`)}error(E,A,D){if(A){this.setParams(A),this._error(E,D),this.setParams({});return}this._error(E,D)}_error(E,A){(E?p.reportExtraError:p.reportError)(this,this.def.error,A)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(E){this.allErrors||this.gen.if(E)}setParams(E,A){A?Object.assign(this.params,E):this.params=E}block$data(E,A,D=c.nil){this.gen.block(()=>{this.check$data(E,D),A()})}check$data(E=c.nil,A=c.nil){if(!this.$data)return;let{gen:D,schemaCode:oe,schemaType:ne,def:pe}=this;D.if((0,c.or)((0,c._)`${oe} === undefined`,A)),E!==c.nil&&D.assign(E,!0),(ne.length||pe.validateSchema)&&(D.elseIf(this.invalid$data()),this.$dataError(),E!==c.nil&&D.assign(E,!1)),D.else()}invalid$data(){let{gen:E,schemaCode:A,schemaType:D,def:oe,it:ne}=this;return(0,c.or)(pe(),Ge());function pe(){if(D.length){if(!(A instanceof c.Name))throw new Error("ajv implementation error");let et=Array.isArray(D)?D:[D];return(0,c._)`${(0,n.checkDataTypes)(et,A,ne.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function Ge(){if(oe.validateSchema){let et=E.scopeValue("validate$data",{ref:oe.validateSchema});return(0,c._)`!${et}(${A})`}return c.nil}}subschema(E,A){let D=(0,a.getSubschema)(this.it,E);(0,a.extendSubschemaData)(D,this.it,E),(0,a.extendSubschemaMode)(D,E);let oe={...this.it,...D,items:void 0,props:void 0};return b(oe,A),oe}mergeEvaluated(E,A){let{it:D,gen:oe}=this;D.opts.unevaluated&&(D.props!==!0&&E.props!==void 0&&(D.props=d.mergeEvaluated.props(oe,E.props,D.props,A)),D.items!==!0&&E.items!==void 0&&(D.items=d.mergeEvaluated.items(oe,E.items,D.items,A)))}mergeValidEvaluated(E,A){let{it:D,gen:oe}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return oe.if(A,()=>this.mergeEvaluated(E,c.Name)),!0}};e.KeywordCxt=te;function me(E,A,D,oe){let ne=new te(E,D,A);"code"in D?D.code(ne,oe):ne.$data&&D.validate?(0,i.funcKeywordCode)(ne,D):"macro"in D?(0,i.macroKeywordCode)(ne,D):(D.compile||D.validate)&&(0,i.funcKeywordCode)(ne,D)}let se=/^\/(?:[^~]|~0|~1)*$/,Oe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function pt(E,{dataLevel:A,dataNames:D,dataPathArr:oe}){let ne,pe;if(E==="")return u.default.rootData;if(E[0]==="/"){if(!se.test(E))throw new Error(`Invalid JSON-pointer: ${E}`);ne=E,pe=u.default.rootData}else{let Xe=Oe.exec(E);if(!Xe)throw new Error(`Invalid JSON-pointer: ${E}`);let Ue=+Xe[1];if(ne=Xe[2],ne==="#"){if(Ue>=A)throw new Error(at("property/index",Ue));return oe[A-Ue]}if(Ue>A)throw new Error(at("data",Ue));if(pe=D[A-Ue],!ne)return pe}let Ge=pe,et=ne.split("/");for(let Xe of et)Xe&&(pe=(0,c._)`${pe}${(0,c.getProperty)((0,d.unescapeJsonPointer)(Xe))}`,Ge=(0,c._)`${Ge} && ${pe}`);return Ge;function at(Xe,Ue){return`Cannot access ${Xe} ${Ue} levels up, current level is ${A}`}}e.getData=pt}),Ls=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}};e.default=t}),Qo=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=wu();var r=class extends Error{constructor(o,n,s,i){super(i||`can't resolve reference ${s} from id ${n}`),this.missingRef=(0,t.resolveUrl)(o,n,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(o,this.missingRef))}};e.default=r}),Ru=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=de(),r=Ls(),o=qt(),n=wu(),s=be(),i=Xo();var a=class{constructor(f){var z;this.refs={},this.dynamicAnchors={};let _;typeof f.schema=="object"&&(_=f.schema),this.schema=f.schema,this.schemaId=f.schemaId,this.root=f.root||this,this.baseId=(z=f.baseId)!==null&&z!==void 0?z:(0,n.normalizeId)(_?.[f.schemaId||"$id"]),this.schemaPath=f.schemaPath,this.localRefs=f.localRefs,this.meta=f.meta,this.$async=_?.$async,this.refs={}}};e.SchemaEnv=a;function c(f){let z=d.call(this,f);if(z)return z;let _=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:b,lines:R}=this.opts.code,{ownProperties:S}=this.opts,y=new t.CodeGen(this.scope,{es5:b,lines:R,ownProperties:S}),$;f.$async&&($=y.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let I=y.scopeName("validate");f.validateName=I;let q={gen:y,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:y.scopeValue("schema",this.opts.code.source===!0?{ref:f.schema,code:(0,t.stringify)(f.schema)}:{ref:f.schema}),validateName:I,ValidationError:$,schema:f.schema,schemaEnv:f,rootId:_,baseId:f.baseId||_,schemaPath:t.nil,errSchemaPath:f.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this},O;try{this._compilations.add(f),(0,i.validateFunctionCode)(q),y.optimize(this.opts.code.optimize);let L=y.toString();O=`${y.scopeRefs(o.default.scope)}return ${L}`,this.opts.code.process&&(O=this.opts.code.process(O,f));let K=new Function(`${o.default.self}`,`${o.default.scope}`,O)(this,this.scope.get());if(this.scope.value(I,{ref:K}),K.errors=null,K.schema=f.schema,K.schemaEnv=f,f.$async&&(K.$async=!0),this.opts.code.source===!0&&(K.source={validateName:I,validateCode:L,scopeValues:y._values}),this.opts.unevaluated){let{props:Y,items:fe}=q;K.evaluated={props:Y instanceof t.Name?void 0:Y,items:fe instanceof t.Name?void 0:fe,dynamicProps:Y instanceof t.Name,dynamicItems:fe instanceof t.Name},K.source&&(K.source.evaluated=(0,t.stringify)(K.evaluated))}return f.validate=K,f}catch(L){throw delete f.validate,delete f.validateName,O&&this.logger.error("Error compiling schema, function code:",O),L}finally{this._compilations.delete(f)}}e.compileSchema=c;function u(f,z,_){var b;_=(0,n.resolveUrl)(this.opts.uriResolver,z,_);let R=f.refs[_];if(R)return R;let S=g.call(this,f,_);if(S===void 0){let y=(b=f.localRefs)===null||b===void 0?void 0:b[_],{schemaId:$}=this.opts;y&&(S=new a({schema:y,schemaId:$,root:f,baseId:z}))}if(S!==void 0)return f.refs[_]=l.call(this,S)}e.resolveRef=u;function l(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:c.call(this,f)}function d(f){for(let z of this._compilations)if(p(z,f))return z}e.getCompilingSchema=d;function p(f,z){return f.schema===z.schema&&f.root===z.root&&f.baseId===z.baseId}function g(f,z){let _;for(;typeof(_=this.refs[z])=="string";)z=_;return _||this.schemas[z]||m.call(this,f,z)}function m(f,z){let _=this.opts.uriResolver.parse(z),b=(0,n._getFullPath)(this.opts.uriResolver,_),R=(0,n.getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&b===R)return h.call(this,_,f);let S=(0,n.normalizeId)(b),y=this.refs[S]||this.schemas[S];if(typeof y=="string"){let $=m.call(this,f,y);return typeof $?.schema!="object"?void 0:h.call(this,_,$)}if(typeof y?.schema=="object"){if(y.validate||c.call(this,y),S===(0,n.normalizeId)(z)){let{schema:$}=y,{schemaId:I}=this.opts,q=$[I];return q&&(R=(0,n.resolveUrl)(this.opts.uriResolver,R,q)),new a({schema:$,schemaId:I,root:f,baseId:R})}return h.call(this,_,y)}}e.resolveSchema=m;let v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(f,{baseId:z,schema:_,root:b}){var R;if(((R=f.fragment)===null||R===void 0?void 0:R[0])!=="/")return;for(let $ of f.fragment.slice(1).split("/")){if(typeof _=="boolean")return;let I=_[(0,s.unescapeFragment)($)];if(I===void 0)return;_=I;let q=typeof _=="object"&&_[this.opts.schemaId];!v.has($)&&q&&(z=(0,n.resolveUrl)(this.opts.uriResolver,z,q))}let S;if(typeof _!="boolean"&&_.$ref&&!(0,s.schemaHasRulesButRef)(_,this.RULES)){let $=(0,n.resolveUrl)(this.opts.uriResolver,z,_.$ref);S=m.call(this,b,$)}let{schemaId:y}=this.opts;if(S=S||new a({schema:_,schemaId:y,root:b,baseId:z}),S.schema!==S.root.schema)return S}}),Ck=U((e,t)=>{t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),o$=U((e,t)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o=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 n(m){let v="",h=0,f=0;for(f=0;f<m.length;f++)if(h=m[f].charCodeAt(0),h!==48){if(!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";v+=m[f];break}for(f+=1;f<m.length;f++){if(h=m[f].charCodeAt(0),!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";v+=m[f]}return v}let s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(m){return m.length=0,!0}function a(m,v,h){if(m.length){let f=n(m);if(f!=="")v.push(f);else return h.error=!0,!1;m.length=0}return!0}function c(m){let v=0,h={error:!1,address:"",zone:""},f=[],z=[],_=!1,b=!1,R=a;for(let S=0;S<m.length;S++){let y=m[S];if(!(y==="["||y==="]"))if(y===":"){if(_===!0&&(b=!0),!R(z,f,h))break;if(++v>7){h.error=!0;break}S>0&&m[S-1]===":"&&(_=!0),f.push(":");continue}else if(y==="%"){if(!R(z,f,h))break;R=i}else{z.push(y);continue}}return z.length&&(R===i?h.zone=z.join(""):b?f.push(z.join("")):f.push(n(z))),h.address=f.join(""),h}function u(m){if(l(m,":")<2)return{host:m,isIPV6:!1};let v=c(m);if(v.error)return{host:m,isIPV6:!1};{let h=v.address,f=v.address;return v.zone&&(h+="%"+v.zone,f+="%25"+v.zone),{host:h,isIPV6:!0,escapedHost:f}}}function l(m,v){let h=0;for(let f=0;f<m.length;f++)m[f]===v&&h++;return h}function d(m){let v=m,h=[],f=-1,z=0;for(;z=v.length;){if(z===1){if(v===".")break;if(v==="/"){h.push("/");break}else{h.push(v);break}}else if(z===2){if(v[0]==="."){if(v[1]===".")break;if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"&&(v[1]==="."||v[1]==="/")){h.push("/");break}}else if(z===3&&v==="/.."){h.length!==0&&h.pop(),h.push("/");break}if(v[0]==="."){if(v[1]==="."){if(v[2]==="/"){v=v.slice(3);continue}}else if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"&&v[1]==="."){if(v[2]==="/"){v=v.slice(2);continue}else if(v[2]==="."&&v[3]==="/"){v=v.slice(3),h.length!==0&&h.pop();continue}}if((f=v.indexOf("/",1))===-1){h.push(v);break}else h.push(v.slice(0,f)),v=v.slice(f)}return h.join("")}function p(m,v){let h=v!==!0?escape:unescape;return m.scheme!==void 0&&(m.scheme=h(m.scheme)),m.userinfo!==void 0&&(m.userinfo=h(m.userinfo)),m.host!==void 0&&(m.host=h(m.host)),m.path!==void 0&&(m.path=h(m.path)),m.query!==void 0&&(m.query=h(m.query)),m.fragment!==void 0&&(m.fragment=h(m.fragment)),m}function g(m){let v=[];if(m.userinfo!==void 0&&(v.push(m.userinfo),v.push("@")),m.host!==void 0){let h=unescape(m.host);if(!o(h)){let f=u(h);f.isIPV6===!0?h=`[${f.escapedHost}]`:h=m.host}v.push(h)}return(typeof m.port=="number"||typeof m.port=="string")&&(v.push(":"),v.push(String(m.port))),v.length?v.join(""):void 0}t.exports={nonSimpleDomain:s,recomposeAuthority:g,normalizeComponentEncoding:p,removeDotSegments:d,isIPv4:o,isUUID:r,normalizeIPv6:u,stringArrayToHexStripped:n}}),Nk=U((e,t)=>{let{isUUID:r}=o$(),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(y){return n.indexOf(y)!==-1}function i(y){return y.secure===!0?!0:y.secure===!1?!1:y.scheme?y.scheme.length===3&&(y.scheme[0]==="w"||y.scheme[0]==="W")&&(y.scheme[1]==="s"||y.scheme[1]==="S")&&(y.scheme[2]==="s"||y.scheme[2]==="S"):!1}function a(y){return y.host||(y.error=y.error||"HTTP URIs must have a host."),y}function c(y){let $=String(y.scheme).toLowerCase()==="https";return(y.port===($?443:80)||y.port==="")&&(y.port=void 0),y.path||(y.path="/"),y}function u(y){return y.secure=i(y),y.resourceName=(y.path||"/")+(y.query?"?"+y.query:""),y.path=void 0,y.query=void 0,y}function l(y){if((y.port===(i(y)?443:80)||y.port==="")&&(y.port=void 0),typeof y.secure=="boolean"&&(y.scheme=y.secure?"wss":"ws",y.secure=void 0),y.resourceName){let[$,I]=y.resourceName.split("?");y.path=$&&$!=="/"?$:void 0,y.query=I,y.resourceName=void 0}return y.fragment=void 0,y}function d(y,$){if(!y.path)return y.error="URN can not be parsed",y;let I=y.path.match(o);if(I){let q=$.scheme||y.scheme||"urn";y.nid=I[1].toLowerCase(),y.nss=I[2];let O=S(`${q}:${$.nid||y.nid}`);y.path=void 0,O&&(y=O.parse(y,$))}else y.error=y.error||"URN can not be parsed.";return y}function p(y,$){if(y.nid===void 0)throw new Error("URN without nid cannot be serialized");let I=$.scheme||y.scheme||"urn",q=y.nid.toLowerCase(),O=S(`${I}:${$.nid||q}`);O&&(y=O.serialize(y,$));let L=y,K=y.nss;return L.path=`${q||$.nid}:${K}`,$.skipEscape=!0,L}function g(y,$){let I=y;return I.uuid=I.nss,I.nss=void 0,!$.tolerant&&(!I.uuid||!r(I.uuid))&&(I.error=I.error||"UUID is not valid."),I}function m(y){let $=y;return $.nss=(y.uuid||"").toLowerCase(),$}let v={scheme:"http",domainHost:!0,parse:a,serialize:c},h={scheme:"https",domainHost:v.domainHost,parse:a,serialize:c},f={scheme:"ws",domainHost:!0,parse:u,serialize:l},z={scheme:"wss",domainHost:f.domainHost,parse:f.parse,serialize:f.serialize},R={http:v,https:h,ws:f,wss:z,urn:{scheme:"urn",parse:d,serialize:p,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:g,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(R,null);function S(y){return y&&(R[y]||R[y.toLowerCase()])||void 0}t.exports={wsIsSecure:i,SCHEMES:R,isValidSchemeName:s,getSchemeHandler:S}}),jk=U((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:i,nonSimpleDomain:a}=o$(),{SCHEMES:c,getSchemeHandler:u}=Nk();function l(z,_){return typeof z=="string"?z=m(h(z,_),_):typeof z=="object"&&(z=h(m(z,_),_)),z}function d(z,_,b){let R=b?Object.assign({scheme:"null"},b):{scheme:"null"},S=p(h(z,R),h(_,R),R,!0);return R.skipEscape=!0,m(S,R)}function p(z,_,b,R){let S={};return R||(z=h(m(z,b),b),_=h(m(_,b),b)),b=b||{},!b.tolerant&&_.scheme?(S.scheme=_.scheme,S.userinfo=_.userinfo,S.host=_.host,S.port=_.port,S.path=o(_.path||""),S.query=_.query):(_.userinfo!==void 0||_.host!==void 0||_.port!==void 0?(S.userinfo=_.userinfo,S.host=_.host,S.port=_.port,S.path=o(_.path||""),S.query=_.query):(_.path?(_.path[0]==="/"?S.path=o(_.path):((z.userinfo!==void 0||z.host!==void 0||z.port!==void 0)&&!z.path?S.path="/"+_.path:z.path?S.path=z.path.slice(0,z.path.lastIndexOf("/")+1)+_.path:S.path=_.path,S.path=o(S.path)),S.query=_.query):(S.path=z.path,_.query!==void 0?S.query=_.query:S.query=z.query),S.userinfo=z.userinfo,S.host=z.host,S.port=z.port),S.scheme=z.scheme),S.fragment=_.fragment,S}function g(z,_,b){return typeof z=="string"?(z=unescape(z),z=m(s(h(z,b),!0),{...b,skipEscape:!0})):typeof z=="object"&&(z=m(s(z,!0),{...b,skipEscape:!0})),typeof _=="string"?(_=unescape(_),_=m(s(h(_,b),!0),{...b,skipEscape:!0})):typeof _=="object"&&(_=m(s(_,!0),{...b,skipEscape:!0})),z.toLowerCase()===_.toLowerCase()}function m(z,_){let b={host:z.host,scheme:z.scheme,userinfo:z.userinfo,port:z.port,path:z.path,query:z.query,nid:z.nid,nss:z.nss,uuid:z.uuid,fragment:z.fragment,reference:z.reference,resourceName:z.resourceName,secure:z.secure,error:""},R=Object.assign({},_),S=[],y=u(R.scheme||b.scheme);y&&y.serialize&&y.serialize(b,R),b.path!==void 0&&(R.skipEscape?b.path=unescape(b.path):(b.path=escape(b.path),b.scheme!==void 0&&(b.path=b.path.split("%3A").join(":")))),R.reference!=="suffix"&&b.scheme&&S.push(b.scheme,":");let $=n(b);if($!==void 0&&(R.reference!=="suffix"&&S.push("//"),S.push($),b.path&&b.path[0]!=="/"&&S.push("/")),b.path!==void 0){let I=b.path;!R.absolutePath&&(!y||!y.absolutePath)&&(I=o(I)),$===void 0&&I[0]==="/"&&I[1]==="/"&&(I="/%2F"+I.slice(2)),S.push(I)}return b.query!==void 0&&S.push("?",b.query),b.fragment!==void 0&&S.push("#",b.fragment),S.join("")}let v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function h(z,_){let b=Object.assign({},_),R={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},S=!1;b.reference==="suffix"&&(b.scheme?z=b.scheme+":"+z:z="//"+z);let y=z.match(v);if(y){if(R.scheme=y[1],R.userinfo=y[3],R.host=y[4],R.port=parseInt(y[5],10),R.path=y[6]||"",R.query=y[7],R.fragment=y[8],isNaN(R.port)&&(R.port=y[5]),R.host)if(i(R.host)===!1){let I=r(R.host);R.host=I.host.toLowerCase(),S=I.isIPV6}else S=!0;R.scheme===void 0&&R.userinfo===void 0&&R.host===void 0&&R.port===void 0&&R.query===void 0&&!R.path?R.reference="same-document":R.scheme===void 0?R.reference="relative":R.fragment===void 0?R.reference="absolute":R.reference="uri",b.reference&&b.reference!=="suffix"&&b.reference!==R.reference&&(R.error=R.error||"URI is not a "+b.reference+" reference.");let $=u(b.scheme||R.scheme);if(!b.unicodeSupport&&(!$||!$.unicodeSupport)&&R.host&&(b.domainHost||$&&$.domainHost)&&S===!1&&a(R.host))try{R.host=URL.domainToASCII(R.host.toLowerCase())}catch(I){R.error=R.error||"Host's domain name can not be converted to ASCII: "+I}(!$||$&&!$.skipNormalize)&&(z.indexOf("%")!==-1&&(R.scheme!==void 0&&(R.scheme=unescape(R.scheme)),R.host!==void 0&&(R.host=unescape(R.host))),R.path&&(R.path=escape(unescape(R.path))),R.fragment&&(R.fragment=encodeURI(decodeURIComponent(R.fragment)))),$&&$.parse&&$.parse(R,b)}else R.error=R.error||"URI can not be parsed.";return R}let f={SCHEMES:c,normalize:l,resolve:d,resolveComponent:p,equal:g,serialize:m,parse:h};t.exports=f,t.exports.default=f,t.exports.fastUri=f}),Ak=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=jk();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),um=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Xo();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=de();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});let o=Ls(),n=Qo(),s=e$(),i=Ru(),a=de(),c=wu(),u=zu(),l=be(),d=Ck(),p=Ak(),g=(T,j)=>new RegExp(T,j);g.code="new RegExp";let m=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),h={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."},f={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},z=200;function _(T){var j,F,w,x,C,H,te,me,se,Oe,pt,E,A,D,oe,ne,pe,Ge,et,at,Xe,Ue,Pt,tt,Ft;let It=T.strict,Vt=(j=T.code)===null||j===void 0?void 0:j.optimize,sr=Vt===!0||Vt===void 0?1:Vt||0,ir=(w=(F=T.code)===null||F===void 0?void 0:F.regExp)!==null&&w!==void 0?w:g,Cr=(x=T.uriResolver)!==null&&x!==void 0?x:p.default;return{strictSchema:(H=(C=T.strictSchema)!==null&&C!==void 0?C:It)!==null&&H!==void 0?H:!0,strictNumbers:(me=(te=T.strictNumbers)!==null&&te!==void 0?te:It)!==null&&me!==void 0?me:!0,strictTypes:(Oe=(se=T.strictTypes)!==null&&se!==void 0?se:It)!==null&&Oe!==void 0?Oe:"log",strictTuples:(E=(pt=T.strictTuples)!==null&&pt!==void 0?pt:It)!==null&&E!==void 0?E:"log",strictRequired:(D=(A=T.strictRequired)!==null&&A!==void 0?A:It)!==null&&D!==void 0?D:!1,code:T.code?{...T.code,optimize:sr,regExp:ir}:{optimize:sr,regExp:ir},loopRequired:(oe=T.loopRequired)!==null&&oe!==void 0?oe:z,loopEnum:(ne=T.loopEnum)!==null&&ne!==void 0?ne:z,meta:(pe=T.meta)!==null&&pe!==void 0?pe:!0,messages:(Ge=T.messages)!==null&&Ge!==void 0?Ge:!0,inlineRefs:(et=T.inlineRefs)!==null&&et!==void 0?et:!0,schemaId:(at=T.schemaId)!==null&&at!==void 0?at:"$id",addUsedSchema:(Xe=T.addUsedSchema)!==null&&Xe!==void 0?Xe:!0,validateSchema:(Ue=T.validateSchema)!==null&&Ue!==void 0?Ue:!0,validateFormats:(Pt=T.validateFormats)!==null&&Pt!==void 0?Pt:!0,unicodeRegExp:(tt=T.unicodeRegExp)!==null&&tt!==void 0?tt:!0,int32range:(Ft=T.int32range)!==null&&Ft!==void 0?Ft:!0,uriResolver:Cr}}var b=class{constructor(T={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,T=this.opts={...T,..._(T)};let{es5:j,lines:F}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:v,es5:j,lines:F}),this.logger=L(T.logger);let w=T.validateFormats;T.validateFormats=!1,this.RULES=(0,s.getRules)(),R.call(this,h,T,"NOT SUPPORTED"),R.call(this,f,T,"DEPRECATED","warn"),this._metaOpts=q.call(this),T.formats&&$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),T.keywords&&I.call(this,T.keywords),typeof T.meta=="object"&&this.addMetaSchema(T.meta),y.call(this),T.validateFormats=w}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:T,meta:j,schemaId:F}=this.opts,w=d;F==="id"&&(w={...d},w.id=w.$id,delete w.$id),j&&T&&this.addMetaSchema(w,w[F],!1)}defaultMeta(){let{meta:T,schemaId:j}=this.opts;return this.opts.defaultMeta=typeof T=="object"?T[j]||T:void 0}validate(T,j){let F;if(typeof T=="string"){if(F=this.getSchema(T),!F)throw new Error(`no schema with key or ref "${T}"`)}else F=this.compile(T);let w=F(j);return"$async"in F||(this.errors=F.errors),w}compile(T,j){let F=this._addSchema(T,j);return F.validate||this._compileSchemaEnv(F)}compileAsync(T,j){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:F}=this.opts;return w.call(this,T,j);async function w(se,Oe){await x.call(this,se.$schema);let pt=this._addSchema(se,Oe);return pt.validate||C.call(this,pt)}async function x(se){se&&!this.getSchema(se)&&await w.call(this,{$ref:se},!0)}async function C(se){try{return this._compileSchemaEnv(se)}catch(Oe){if(!(Oe instanceof n.default))throw Oe;return H.call(this,Oe),await te.call(this,Oe.missingSchema),C.call(this,se)}}function H({missingSchema:se,missingRef:Oe}){if(this.refs[se])throw new Error(`AnySchema ${se} is loaded but ${Oe} cannot be resolved`)}async function te(se){let Oe=await me.call(this,se);this.refs[se]||await x.call(this,Oe.$schema),this.refs[se]||this.addSchema(Oe,se,j)}async function me(se){let Oe=this._loading[se];if(Oe)return Oe;try{return await(this._loading[se]=F(se))}finally{delete this._loading[se]}}}addSchema(T,j,F,w=this.opts.validateSchema){if(Array.isArray(T)){for(let C of T)this.addSchema(C,void 0,F,w);return this}let x;if(typeof T=="object"){let{schemaId:C}=this.opts;if(x=T[C],x!==void 0&&typeof x!="string")throw new Error(`schema ${C} must be string`)}return j=(0,c.normalizeId)(j||x),this._checkUnique(j),this.schemas[j]=this._addSchema(T,F,j,w,!0),this}addMetaSchema(T,j,F=this.opts.validateSchema){return this.addSchema(T,j,!0,F),this}validateSchema(T,j){if(typeof T=="boolean")return!0;let F;if(F=T.$schema,F!==void 0&&typeof F!="string")throw new Error("$schema must be a string");if(F=F||this.opts.defaultMeta||this.defaultMeta(),!F)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let w=this.validate(F,T);if(!w&&j){let x="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(x);else throw new Error(x)}return w}getSchema(T){let j;for(;typeof(j=S.call(this,T))=="string";)T=j;if(j===void 0){let{schemaId:F}=this.opts,w=new i.SchemaEnv({schema:{},schemaId:F});if(j=i.resolveSchema.call(this,w,T),!j)return;this.refs[T]=j}return j.validate||this._compileSchemaEnv(j)}removeSchema(T){if(T instanceof RegExp)return this._removeAllSchemas(this.schemas,T),this._removeAllSchemas(this.refs,T),this;switch(typeof T){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let j=S.call(this,T);return typeof j=="object"&&this._cache.delete(j.schema),delete this.schemas[T],delete this.refs[T],this}case"object":{let j=T;this._cache.delete(j);let F=T[this.opts.schemaId];return F&&(F=(0,c.normalizeId)(F),delete this.schemas[F],delete this.refs[F]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(T){for(let j of T)this.addKeyword(j);return this}addKeyword(T,j){let F;if(typeof T=="string")F=T,typeof j=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),j.keyword=F);else if(typeof T=="object"&&j===void 0){if(j=T,F=j.keyword,Array.isArray(F)&&!F.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Y.call(this,F,j),!j)return(0,l.eachItem)(F,x=>fe.call(this,x)),this;Ie.call(this,j);let w={...j,type:(0,u.getJSONTypes)(j.type),schemaType:(0,u.getJSONTypes)(j.schemaType)};return(0,l.eachItem)(F,w.type.length===0?x=>fe.call(this,x,w):x=>w.type.forEach(C=>fe.call(this,x,w,C))),this}getKeyword(T){let j=this.RULES.all[T];return typeof j=="object"?j.definition:!!j}removeKeyword(T){let{RULES:j}=this;delete j.keywords[T],delete j.all[T];for(let F of j.rules){let w=F.rules.findIndex(x=>x.keyword===T);w>=0&&F.rules.splice(w,1)}return this}addFormat(T,j){return typeof j=="string"&&(j=new RegExp(j)),this.formats[T]=j,this}errorsText(T=this.errors,{separator:j=", ",dataVar:F="data"}={}){return!T||T.length===0?"No errors":T.map(w=>`${F}${w.instancePath} ${w.message}`).reduce((w,x)=>w+j+x)}$dataMetaSchema(T,j){let F=this.RULES.all;T=JSON.parse(JSON.stringify(T));for(let w of j){let x=w.split("/").slice(1),C=T;for(let H of x)C=C[H];for(let H in F){let te=F[H];if(typeof te!="object")continue;let{$data:me}=te.definition,se=C[H];me&&se&&(C[H]=ye(se))}}return T}_removeAllSchemas(T,j){for(let F in T){let w=T[F];(!j||j.test(F))&&(typeof w=="string"?delete T[F]:w&&!w.meta&&(this._cache.delete(w.schema),delete T[F]))}}_addSchema(T,j,F,w=this.opts.validateSchema,x=this.opts.addUsedSchema){let C,{schemaId:H}=this.opts;if(typeof T=="object")C=T[H];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof T!="boolean")throw new Error("schema must be object or boolean")}let te=this._cache.get(T);if(te!==void 0)return te;F=(0,c.normalizeId)(C||F);let me=c.getSchemaRefs.call(this,T,F);return te=new i.SchemaEnv({schema:T,schemaId:H,meta:j,baseId:F,localRefs:me}),this._cache.set(te.schema,te),x&&!F.startsWith("#")&&(F&&this._checkUnique(F),this.refs[F]=te),w&&this.validateSchema(T,!0),te}_checkUnique(T){if(this.schemas[T]||this.refs[T])throw new Error(`schema with key or id "${T}" already exists`)}_compileSchemaEnv(T){if(T.meta?this._compileMetaSchema(T):i.compileSchema.call(this,T),!T.validate)throw new Error("ajv implementation error");return T.validate}_compileMetaSchema(T){let j=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,T)}finally{this.opts=j}}};b.ValidationError=o.default,b.MissingRefError=n.default,e.default=b;function R(T,j,F,w="error"){for(let x in T){let C=x;C in j&&this.logger[w](`${F}: option ${x}. ${T[C]}`)}}function S(T){return T=(0,c.normalizeId)(T),this.schemas[T]||this.refs[T]}function y(){let T=this.opts.schemas;if(T)if(Array.isArray(T))this.addSchema(T);else for(let j in T)this.addSchema(T[j],j)}function $(){for(let T in this.opts.formats){let j=this.opts.formats[T];j&&this.addFormat(T,j)}}function I(T){if(Array.isArray(T)){this.addVocabulary(T);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let j in T){let F=T[j];F.keyword||(F.keyword=j),this.addKeyword(F)}}function q(){let T={...this.opts};for(let j of m)delete T[j];return T}let O={log(){},warn(){},error(){}};function L(T){if(T===!1)return O;if(T===void 0)return console;if(T.log&&T.warn&&T.error)return T;throw new Error("logger must implement log, warn and error methods")}let K=/^[a-z_$][a-z0-9_$:-]*$/i;function Y(T,j){let{RULES:F}=this;if((0,l.eachItem)(T,w=>{if(F.keywords[w])throw new Error(`Keyword ${w} is already defined`);if(!K.test(w))throw new Error(`Keyword ${w} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function fe(T,j,F){var w;let x=j?.post;if(F&&x)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:C}=this,H=x?C.post:C.rules.find(({type:me})=>me===F);if(H||(H={type:F,rules:[]},C.rules.push(H)),C.keywords[T]=!0,!j)return;let te={keyword:T,definition:{...j,type:(0,u.getJSONTypes)(j.type),schemaType:(0,u.getJSONTypes)(j.schemaType)}};j.before?qe.call(this,H,te,j.before):H.rules.push(te),C.all[T]=te,(w=j.implements)===null||w===void 0||w.forEach(me=>this.addKeyword(me))}function qe(T,j,F){let w=T.rules.findIndex(x=>x.keyword===F);w>=0?T.rules.splice(w,0,j):(T.rules.push(j),this.logger.warn(`rule ${F} is not defined`))}function Ie(T){let{metaSchema:j}=T;j!==void 0&&(T.$data&&this.opts.$data&&(j=ye(j)),T.validateSchema=this.compile(j,!0))}let Ye={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ye(T){return{anyOf:[T,Ye]}}}),Mk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t}),lm=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=Qo(),r=Zt(),o=de(),n=qt(),s=Ru(),i=be(),a={keyword:"$ref",schemaType:"string",code(l){let{gen:d,schema:p,it:g}=l,{baseId:m,schemaEnv:v,validateName:h,opts:f,self:z}=g,{root:_}=v;if((p==="#"||p==="#/")&&m===_.baseId)return R();let b=s.resolveRef.call(z,_,m,p);if(b===void 0)throw new t.default(g.opts.uriResolver,m,p);if(b instanceof s.SchemaEnv)return S(b);return y(b);function R(){if(v===_)return u(l,h,v,v.$async);let $=d.scopeValue("root",{ref:_});return u(l,(0,o._)`${$}.validate`,_,_.$async)}function S($){u(l,c(l,$),$,$.$async)}function y($){let I=d.scopeValue("schema",f.code.source===!0?{ref:$,code:(0,o.stringify)($)}:{ref:$}),q=d.name("valid"),O=l.subschema({schema:$,dataTypes:[],schemaPath:o.nil,topSchemaRef:I,errSchemaPath:p},q);l.mergeEvaluated(O),l.ok(q)}}};function c(l,d){let{gen:p}=l;return d.validate?p.scopeValue("validate",{ref:d.validate}):(0,o._)`${p.scopeValue("wrapper",{ref:d})}.validate`}e.getValidate=c;function u(l,d,p,g){let{gen:m,it:v}=l,{allErrors:h,schemaEnv:f,opts:z}=v,_=z.passContext?n.default.this:o.nil;g?b():R();function b(){if(!f.$async)throw new Error("async schema referenced by sync schema");let $=m.let("valid");m.try(()=>{m.code((0,o._)`await ${(0,r.callValidateCode)(l,d,_)}`),y(d),h||m.assign($,!0)},I=>{m.if((0,o._)`!(${I} instanceof ${v.ValidationError})`,()=>m.throw(I)),S(I),h||m.assign($,!1)}),l.ok($)}function R(){l.result((0,r.callValidateCode)(l,d,_),()=>y(d),()=>S(d))}function S($){let I=(0,o._)`${$}.errors`;m.assign(n.default.vErrors,(0,o._)`${n.default.vErrors} === null ? ${I} : ${n.default.vErrors}.concat(${I})`),m.assign(n.default.errors,(0,o._)`${n.default.vErrors}.length`)}function y($){var I;if(!v.opts.unevaluated)return;let q=(I=p?.validate)===null||I===void 0?void 0:I.evaluated;if(v.props!==!0)if(q&&!q.dynamicProps)q.props!==void 0&&(v.props=i.mergeEvaluated.props(m,q.props,v.props));else{let O=m.var("props",(0,o._)`${$}.evaluated.props`);v.props=i.mergeEvaluated.props(m,O,v.props,o.Name)}if(v.items!==!0)if(q&&!q.dynamicItems)q.items!==void 0&&(v.items=i.mergeEvaluated.items(m,q.items,v.items));else{let O=m.var("items",(0,o._)`${$}.evaluated.items`);v.items=i.mergeEvaluated.items(m,O,v.items,o.Name)}}}e.callRef=u,e.default=a}),n$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Mk(),r=lm(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o}),qk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=t.operators,o={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},n={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:s,schemaCode:i})=>(0,t.str)`must be ${o[s].okStr} ${i}`,params:({keyword:s,schemaCode:i})=>(0,t._)`{comparison: ${o[s].okStr}, limit: ${i}}`},code(s){let{keyword:i,data:a,schemaCode:c}=s;s.fail$data((0,t._)`${a} ${o[i].fail} ${c} || isNaN(${a})`)}};e.default=n}),Zk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must be multiple of ${o}`,params:({schemaCode:o})=>(0,t._)`{multipleOf: ${o}}`},code(o){let{gen:n,data:s,schemaCode:i,it:a}=o,c=a.opts.multipleOfPrecision,u=n.let("res"),l=c?(0,t._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:(0,t._)`${u} !== parseInt(${u})`;o.fail$data((0,t._)`(${i} === 0 || (${u} = ${s}/${i}, ${l}))`)}};e.default=r}),Lk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r){let o=r.length,n=0,s=0,i;for(;s<o;)n++,i=r.charCodeAt(s++),i>=55296&&i<=56319&&s<o&&(i=r.charCodeAt(s),(i&64512)===56320&&s++);return n}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),Dk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o=Lk(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:i}){let a=s==="maxLength"?"more":"fewer";return(0,t.str)`must NOT have ${a} than ${i} characters`},params:({schemaCode:s})=>(0,t._)`{limit: ${s}}`},code(s){let{keyword:i,data:a,schemaCode:c,it:u}=s,l=i==="maxLength"?t.operators.GT:t.operators.LT,d=u.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,r.useFunc)(s.gen,o.default)}(${a})`;s.fail$data((0,t._)`${d} ${l} ${c}`)}};e.default=n}),Uk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Zt(),r=be(),o=de(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,o.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,o._)`{pattern: ${s}}`},code(s){let{gen:i,data:a,$data:c,schema:u,schemaCode:l,it:d}=s,p=d.opts.unicodeRegExp?"u":"";if(c){let{regExp:g}=d.opts.code,m=g.code==="new RegExp"?(0,o._)`new RegExp`:(0,r.useFunc)(i,g),v=i.let("valid");i.try(()=>i.assign(v,(0,o._)`${m}(${l}, ${p}).test(${a})`),()=>i.assign(v,!1)),s.fail$data((0,o._)`!${v}`)}else{let g=(0,t.usePattern)(s,u);s.fail$data((0,o._)`!${g}.test(${a})`)}}};e.default=n}),Fk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxProperties"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${n} properties`},params:({schemaCode:o})=>(0,t._)`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,a=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data((0,t._)`Object.keys(${s}).length ${a} ${i}`)}};e.default=r}),Vk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Zt(),r=de(),o=be(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,r.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,r._)`{missingProperty: ${s}}`},code(s){let{gen:i,schema:a,schemaCode:c,data:u,$data:l,it:d}=s,{opts:p}=d;if(!l&&a.length===0)return;let g=a.length>=p.loopRequired;if(d.allErrors?m():v(),p.strictRequired){let z=s.parentSchema.properties,{definedProperties:_}=s.it;for(let b of a)if(z?.[b]===void 0&&!_.has(b)){let R=`required property "${b}" is not defined at "${d.schemaEnv.baseId+d.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(d,R,d.opts.strictRequired)}}function m(){if(g||l)s.block$data(r.nil,h);else for(let z of a)(0,t.checkReportMissingProp)(s,z)}function v(){let z=i.let("missing");if(g||l){let _=i.let("valid",!0);s.block$data(_,()=>f(z,_)),s.ok(_)}else i.if((0,t.checkMissingProp)(s,a,z)),(0,t.reportMissingProp)(s,z),i.else()}function h(){i.forOf("prop",c,z=>{s.setParams({missingProperty:z}),i.if((0,t.noPropertyInData)(i,u,z,p.ownProperties),()=>s.error())})}function f(z,_){s.setParams({missingProperty:z}),i.forOf(z,c,()=>{i.assign(_,(0,t.propertyInData)(i,u,z,p.ownProperties)),i.if((0,r.not)(_),()=>{s.error(),i.break()})},r.nil)}}};e.default=n}),Jk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxItems"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${n} items`},params:({schemaCode:o})=>(0,t._)`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,a=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data((0,t._)`${s}.length ${a} ${i}`)}};e.default=r}),dm=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=r$();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),Hk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=zu(),r=de(),o=be(),n=dm(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:a}})=>(0,r.str)`must NOT have duplicate items (items ## ${a} and ${i} are identical)`,params:({params:{i,j:a}})=>(0,r._)`{i: ${i}, j: ${a}}`},code(i){let{gen:a,data:c,$data:u,schema:l,parentSchema:d,schemaCode:p,it:g}=i;if(!u&&!l)return;let m=a.let("valid"),v=d.items?(0,t.getSchemaTypes)(d.items):[];i.block$data(m,h,(0,r._)`${p} === false`),i.ok(m);function h(){let b=a.let("i",(0,r._)`${c}.length`),R=a.let("j");i.setParams({i:b,j:R}),a.assign(m,!0),a.if((0,r._)`${b} > 1`,()=>(f()?z:_)(b,R))}function f(){return v.length>0&&!v.some(b=>b==="object"||b==="array")}function z(b,R){let S=a.name("item"),y=(0,t.checkDataTypes)(v,S,g.opts.strictNumbers,t.DataType.Wrong),$=a.const("indices",(0,r._)`{}`);a.for((0,r._)`;${b}--;`,()=>{a.let(S,(0,r._)`${c}[${b}]`),a.if(y,(0,r._)`continue`),v.length>1&&a.if((0,r._)`typeof ${S} == "string"`,(0,r._)`${S} += "_"`),a.if((0,r._)`typeof ${$}[${S}] == "number"`,()=>{a.assign(R,(0,r._)`${$}[${S}]`),i.error(),a.assign(m,!1).break()}).code((0,r._)`${$}[${S}] = ${b}`)})}function _(b,R){let S=(0,o.useFunc)(a,n.default),y=a.name("outer");a.label(y).for((0,r._)`;${b}--;`,()=>a.for((0,r._)`${R} = ${b}; ${R}--;`,()=>a.if((0,r._)`${S}(${c}[${b}], ${c}[${R}])`,()=>{i.error(),a.assign(m,!1).break(y)})))}}};e.default=s}),Bk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o=dm(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,t._)`{allowedValue: ${s}}`},code(s){let{gen:i,data:a,$data:c,schemaCode:u,schema:l}=s;c||l&&typeof l=="object"?s.fail$data((0,t._)`!${(0,r.useFunc)(i,o.default)}(${a}, ${u})`):s.fail((0,t._)`${l} !== ${a}`)}};e.default=n}),Kk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o=dm(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,t._)`{allowedValues: ${s}}`},code(s){let{gen:i,data:a,$data:c,schema:u,schemaCode:l,it:d}=s;if(!c&&u.length===0)throw new Error("enum must have non-empty array");let p=u.length>=d.opts.loopEnum,g,m=()=>g??(g=(0,r.useFunc)(i,o.default)),v;if(p||c)v=i.let("valid"),s.block$data(v,h);else{if(!Array.isArray(u))throw new Error("ajv implementation error");let z=i.const("vSchema",l);v=(0,t.or)(...u.map((_,b)=>f(z,b)))}s.pass(v);function h(){i.assign(v,!1),i.forOf("v",l,z=>i.if((0,t._)`${m()}(${a}, ${z})`,()=>i.assign(v,!0).break()))}function f(z,_){let b=u[_];return typeof b=="object"&&b!==null?(0,t._)`${m()}(${a}, ${z}[${_}])`:(0,t._)`${a} === ${b}`}}};e.default=n}),s$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=qk(),r=Zk(),o=Dk(),n=Uk(),s=Fk(),i=Vk(),a=Jk(),c=Hk(),u=Bk(),l=Kk(),d=[t.default,r.default,o.default,n.default,s.default,i.default,a.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,l.default];e.default=d}),i$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=de(),r=be(),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,t.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,t._)`{limit: ${s}}`},code(s){let{parentSchema:i,it:a}=s,{items:c}=i;if(!Array.isArray(c)){(0,r.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,c)}};function n(s,i){let{gen:a,schema:c,data:u,keyword:l,it:d}=s;d.items=!0;let p=a.const("len",(0,t._)`${u}.length`);if(c===!1)s.setParams({len:i.length}),s.pass((0,t._)`${p} <= ${i.length}`);else if(typeof c=="object"&&!(0,r.alwaysValidSchema)(d,c)){let m=a.var("valid",(0,t._)`${p} <= ${i.length}`);a.if((0,t.not)(m),()=>g(m)),s.ok(m)}function g(m){a.forRange("i",i.length,p,v=>{s.subschema({keyword:l,dataProp:v,dataPropType:r.Type.Num},m),d.allErrors||a.if((0,t.not)(m),()=>a.break())})}}e.validateAdditionalItems=n,e.default=o}),a$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=de(),r=be(),o=Zt(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){let{schema:a,it:c}=i;if(Array.isArray(a))return s(i,"additionalItems",a);c.items=!0,!(0,r.alwaysValidSchema)(c,a)&&i.ok((0,o.validateArray)(i))}};function s(i,a,c=i.schema){let{gen:u,parentSchema:l,data:d,keyword:p,it:g}=i;h(l),g.opts.unevaluated&&c.length&&g.items!==!0&&(g.items=r.mergeEvaluated.items(u,c.length,g.items));let m=u.name("valid"),v=u.const("len",(0,t._)`${d}.length`);c.forEach((f,z)=>{(0,r.alwaysValidSchema)(g,f)||(u.if((0,t._)`${v} > ${z}`,()=>i.subschema({keyword:p,schemaProp:z,dataProp:z},m)),i.ok(m))});function h(f){let{opts:z,errSchemaPath:_}=g,b=c.length,R=b===f.minItems&&(b===f.maxItems||f[a]===!1);if(z.strictTuples&&!R){let S=`"${p}" is ${b}-tuple, but minItems or maxItems/${a} are not specified or different at path "${_}"`;(0,r.checkStrictMode)(g,S,z.strictTuples)}}}e.validateTuple=s,e.default=n}),Gk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=a$(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o=>(0,t.validateTuple)(o,"items")};e.default=r}),Wk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o=Zt(),n=i$(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,t.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,t._)`{limit: ${i}}`},code(i){let{schema:a,parentSchema:c,it:u}=i,{prefixItems:l}=c;u.items=!0,!(0,r.alwaysValidSchema)(u,a)&&(l?(0,n.validateAdditionalItems)(i,l):i.ok((0,o.validateArray)(i)))}};e.default=s}),Yk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:s}})=>s===void 0?(0,t.str)`must contain at least ${n} valid item(s)`:(0,t.str)`must contain at least ${n} and no more than ${s} valid item(s)`,params:({params:{min:n,max:s}})=>s===void 0?(0,t._)`{minContains: ${n}}`:(0,t._)`{minContains: ${n}, maxContains: ${s}}`},code(n){let{gen:s,schema:i,parentSchema:a,data:c,it:u}=n,l,d,{minContains:p,maxContains:g}=a;u.opts.next?(l=p===void 0?1:p,d=g):l=1;let m=s.const("len",(0,t._)`${c}.length`);if(n.setParams({min:l,max:d}),d===void 0&&l===0){(0,r.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(d!==void 0&&l>d){(0,r.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(u,i)){let _=(0,t._)`${m} >= ${l}`;d!==void 0&&(_=(0,t._)`${_} && ${m} <= ${d}`),n.pass(_);return}u.items=!0;let v=s.name("valid");d===void 0&&l===1?f(v,()=>s.if(v,()=>s.break())):l===0?(s.let(v,!0),d!==void 0&&s.if((0,t._)`${c}.length > 0`,h)):(s.let(v,!1),h()),n.result(v,()=>n.reset());function h(){let _=s.name("_valid"),b=s.let("count",0);f(_,()=>s.if(_,()=>z(b)))}function f(_,b){s.forRange("i",0,m,R=>{n.subschema({keyword:"contains",dataProp:R,dataPropType:r.Type.Num,compositeRule:!0},_),b()})}function z(_){s.code((0,t._)`${_}++`),d===void 0?s.if((0,t._)`${_} >= ${l}`,()=>s.assign(v,!0).break()):(s.if((0,t._)`${_} > ${d}`,()=>s.assign(v,!1).break()),l===1?s.assign(v,!0):s.if((0,t._)`${_} >= ${l}`,()=>s.assign(v,!0)))}}};e.default=o}),pm=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=de(),r=be(),o=Zt();e.error={message:({params:{property:c,depsCount:u,deps:l}})=>{let d=u===1?"property":"properties";return(0,t.str)`must have ${d} ${l} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:l,missingProperty:d}})=>(0,t._)`{property: ${c},
120
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&e.reused==="ref"){s(i);continue}}}function Fs(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);let g=e.seen.get(d),f=g.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(f)):Object.assign(u,f),Object.assign(u,l),a._zod.parent===d)for(let m in u)m==="$ref"||m==="allOf"||m in l||delete u[m];if(f.$ref&&g.def)for(let m in u)m==="$ref"||m==="allOf"||m in g.def&&JSON.stringify(u[m])===JSON.stringify(g.def[m])&&delete u[m]}let p=a._zod.parent;if(p&&p!==d){o(p);let g=e.seen.get(p);if(g?.schema.$ref&&(u.$ref=g.schema.$ref,g.def))for(let f in u)f==="$ref"||f==="allOf"||f in g.def&&JSON.stringify(u[f])===JSON.stringify(g.def[f])&&delete u[f]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...e.seen.entries()].reverse())o(a[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Object.assign(n,r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;s!==void 0&&n.id===s&&delete n.id;let i=e.external?.defs??{};for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,i[c.defId]=c.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ls(t,"input",e.processors),output:Ls(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function ht(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return ht(o.element,r);if(o.type==="set")return ht(o.valueType,r);if(o.type==="lazy")return ht(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return ht(o.innerType,r);if(o.type==="intersection")return ht(o.left,r)||ht(o.right,r);if(o.type==="record"||o.type==="map")return ht(o.keyType,r)||ht(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ht(o.in,r)||ht(o.out,r);if(o.type==="object"){for(let n in o.shape)if(ht(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(ht(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(ht(n,r))return!0;return!!(o.rest&&ht(o.rest,r))}return!1}var kb=(e,t={})=>r=>{let o=Ds({...r,processors:t});return Te(e,o),Us(o,e),Fs(o,e)},Ls=(e,t,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=Ds({...n??{},target:s,io:t,processors:r});return Te(e,i),Us(i,e),Fs(i,e)};var UP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},bp=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),a&&(n.format=UP[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},zp=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number";let d=typeof l=="number"&&l>=(s??Number.NEGATIVE_INFINITY),p=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),g=t.target==="draft-04"||t.target==="openapi-3.0";d?g?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:typeof s=="number"&&(n.minimum=s),p?g?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof i=="number"&&(n.maximum=i),typeof c=="number"&&(n.multipleOf=c)},$p=(e,t,r,o)=>{r.type="boolean"},Tb=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Ib=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},wp=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Ob=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Cb=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Rp=(e,t,r,o)=>{r.not={}},Nb=(e,t,r,o)=>{},Pp=(e,t,r,o)=>{},jb=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Ep=(e,t,r,o)=>{let n=e._zod.def,s=Is(n.entries);s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},kp=(e,t,r,o)=>{let n=e._zod.def,s=[];for(let i of n.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s},Ab=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Mb=(e,t,r,o)=>{let n=r,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},qb=(e,t,r,o)=>{let n=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:a,mime:c}=e._zod.bag;i!==void 0&&(s.minLength=i),a!==void 0&&(s.maxLength=a),c?c.length===1?(s.contentMediaType=c[0],Object.assign(n,s)):(Object.assign(n,s),n.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(n,s)},Zb=(e,t,r,o)=>{r.type="boolean"},xp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Lb=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Tp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Db=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Ub=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Ip=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(n.minItems=i),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=Te(s.element,t,{...o,path:[...o.path,"items"]})},Op=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object",n.properties={};let i=s.shape;for(let u in i)n.properties[u]=Te(i[u],t,{...o,path:[...o.path,"properties",u]});let a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{let l=s.shape[u]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(n.required=Array.from(c)),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=Te(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Cp=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>Te(a,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},Np=(e,t,r,o)=>{let n=e._zod.def,s=Te(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=Te(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c},Fb=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((p,g)=>Te(p,t,{...o,path:[...o.path,i,g]})),u=s.rest?Te(s.rest,t,{...o,path:[...o.path,a,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=c,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:c},u&&n.items.anyOf.push(u),n.minItems=c.length,u||(n.maxItems=c.length)):(n.items=c,u&&(n.additionalItems=u));let{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(n.minItems=l),typeof d=="number"&&(n.maxItems=d)},jp=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,c=i._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let l=Te(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of c)n.patternProperties[d.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=Te(s.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=Te(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let u=i._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l)}},Ap=(e,t,r,o)=>{let n=e._zod.def,s=Te(n.innerType,t,o),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},Mp=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},qp=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Zp=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Lp=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},Dp=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;Te(i,t,o);let a=t.seen.get(e);a.ref=i},Up=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},Vb=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},mu=(e,t,r,o)=>{let n=e._zod.def;Te(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Fp=(e,t,r,o)=>{let n=e._zod.innerType;Te(n,t,o);let s=t.seen.get(e);s.ref=n},xb={string:bp,number:zp,boolean:$p,bigint:Tb,symbol:Ib,null:wp,undefined:Ob,void:Cb,never:Rp,any:Nb,unknown:Pp,date:jb,enum:Ep,literal:kp,nan:Ab,template_literal:Mb,file:qb,success:Zb,custom:xp,function:Lb,transform:Tp,map:Db,set:Ub,array:Ip,object:Op,union:Cp,intersection:Np,tuple:Fb,record:jp,nullable:Ap,nonoptional:Mp,default:qp,prefault:Zp,catch:Lp,pipe:Dp,readonly:Up,promise:Vb,optional:mu,lazy:Fp};function fu(e,t){if("_idmap"in e){let o=e,n=Ds({...t,processors:xb}),s={};for(let c of o._idmap.entries()){let[u,l]=c;Te(l,n)}let i={},a={registry:o,uri:t?.uri,defs:s};n.external=a;for(let c of o._idmap.entries()){let[u,l]=c;Us(n,l),i[u]=Fs(n,l)}if(Object.keys(s).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:s}}return{schemas:i}}let r=Ds({...t,processors:xb});return Te(e,r),Us(r,e),Fs(r,e)}var Mr={};Ro(Mr,{ZodISODate:()=>Hb,ZodISODateTime:()=>Jb,ZodISODuration:()=>Kb,ZodISOTime:()=>Bb,date:()=>Jp,datetime:()=>Vp,duration:()=>Bp,time:()=>Hp});var Jb=Z("ZodISODateTime",(e,t)=>{uS.init(e,t),De.init(e,t)});function Vp(e){return hb(Jb,e)}var Hb=Z("ZodISODate",(e,t)=>{lS.init(e,t),De.init(e,t)});function Jp(e){return gb(Hb,e)}var Bb=Z("ZodISOTime",(e,t)=>{dS.init(e,t),De.init(e,t)});function Hp(e){return _b(Bb,e)}var Kb=Z("ZodISODuration",(e,t)=>{pS.init(e,t),De.init(e,t)});function Bp(e){return vb(Kb,e)}var YP=(e,t)=>{eu.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Vv(e,r)},flatten:{value:r=>Fv(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Qo,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Qo,2)}},isEmpty:{get(){return e.issues.length===0}}})};var Pt=Z("ZodError",YP,{Parent:Error});var Gb=tu(Pt),Wb=ru(Pt),hu=js(Pt),Yb=As(Pt),Xb=Bv(Pt),Qb=Kv(Pt),ez=Gv(Pt),tz=Wv(Pt),rz=Yv(Pt),oz=Xv(Pt),nz=Qv(Pt),sz=ey(Pt);var iz=new WeakMap;function Js(e,t,r){let o=Object.getPrototypeOf(e),n=iz.get(o);if(n||(n=new Set,iz.set(o,n)),!n.has(t)){n.add(t);for(let s in r){let i=r[s];Object.defineProperty(o,s,{configurable:!0,enumerable:!1,get(){let a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var Me=Z("ZodType",(e,t)=>(Ne.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ls(e,"input"),output:Ls(e,"output")}}),e.toJSONSchema=kb(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>Gb(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>hu(e,r,o),e.parseAsync=async(r,o)=>Wb(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Yb(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Xb(e,r,o),e.decode=(r,o)=>Qb(e,r,o),e.encodeAsync=async(r,o)=>ez(e,r,o),e.decodeAsync=async(r,o)=>tz(e,r,o),e.safeEncode=(r,o)=>rz(e,r,o),e.safeDecode=(r,o)=>oz(e,r,o),e.safeEncodeAsync=async(r,o)=>nz(e,r,o),e.safeDecodeAsync=async(r,o)=>sz(e,r,o),Js(e,"ZodType",{check(...r){let o=this.def;return this.clone(Pe.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Dt(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(DE(r,o))},superRefine(r,o){return this.check(UE(r,o))},overwrite(r){return this.check(Ar(r))},optional(){return ve(this)},exactOptional(){return EE(this)},nullable(){return lz(this)},nullish(){return ve(lz(this))},nonoptional(r){return CE(this,r)},array(){return W(this)},or(r){return le([this,r])},and(r){return on(this,r)},transform(r){return dz(this,Sz(r))},default(r){return TE(this,r)},prefault(r){return OE(this,r)},catch(r){return jE(this,r)},pipe(r){return dz(this,r)},readonly(){return qE(this)},describe(r){let o=this.clone();return ao.add(o,{description:r}),o},meta(...r){if(r.length===0)return ao.get(this);let o=this.clone();return ao.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return ao.get(e)?.description},configurable:!0}),e)),pz=Z("_ZodString",(e,t)=>{au.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(o,n,s)=>bp(e,o,n,s);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Js(e,"_ZodString",{regex(...o){return this.check(lp(...o))},includes(...o){return this.check(mp(...o))},startsWith(...o){return this.check(fp(...o))},endsWith(...o){return this.check(hp(...o))},min(...o){return this.check(rn(...o))},max(...o){return this.check(du(...o))},length(...o){return this.check(pu(...o))},nonempty(...o){return this.check(rn(1,...o))},lowercase(o){return this.check(dp(o))},uppercase(o){return this.check(pp(o))},trim(){return this.check(_p())},normalize(...o){return this.check(gp(...o))},toLowerCase(){return this.check(vp())},toUpperCase(){return this.check(yp())},slugify(){return this.check(Sp())}})}),QP=Z("ZodString",(e,t)=>{au.init(e,t),pz.init(e,t),e.email=r=>e.check(ap(mz,r)),e.url=r=>e.check(up(hz,r)),e.jwt=r=>e.check(fb(fE,r)),e.emoji=r=>e.check(eb(eE,r)),e.guid=r=>e.check(cp(az,r)),e.uuid=r=>e.check(WS(gu,r)),e.uuidv4=r=>e.check(YS(gu,r)),e.uuidv6=r=>e.check(XS(gu,r)),e.uuidv7=r=>e.check(QS(gu,r)),e.nanoid=r=>e.check(tb(tE,r)),e.guid=r=>e.check(cp(az,r)),e.cuid=r=>e.check(rb(rE,r)),e.cuid2=r=>e.check(ob(oE,r)),e.ulid=r=>e.check(nb(nE,r)),e.base64=r=>e.check(db(dE,r)),e.base64url=r=>e.check(pb(pE,r)),e.xid=r=>e.check(sb(sE,r)),e.ksuid=r=>e.check(ib(iE,r)),e.ipv4=r=>e.check(ab(aE,r)),e.ipv6=r=>e.check(cb(cE,r)),e.cidrv4=r=>e.check(ub(uE,r)),e.cidrv6=r=>e.check(lb(lE,r)),e.e164=r=>e.check(mb(mE,r)),e.datetime=r=>e.check(Vp(r)),e.date=r=>e.check(Jp(r)),e.time=r=>e.check(Hp(r)),e.duration=r=>e.check(Bp(r))});function P(e){return GS(QP,e)}var De=Z("ZodStringFormat",(e,t)=>{Ae.init(e,t),pz.init(e,t)}),mz=Z("ZodEmail",(e,t)=>{eS.init(e,t),De.init(e,t)});function fz(e){return ap(mz,e)}var az=Z("ZodGUID",(e,t)=>{Xy.init(e,t),De.init(e,t)});var gu=Z("ZodUUID",(e,t)=>{Qy.init(e,t),De.init(e,t)});var hz=Z("ZodURL",(e,t)=>{tS.init(e,t),De.init(e,t)});function gz(e){return up(hz,e)}var eE=Z("ZodEmoji",(e,t)=>{rS.init(e,t),De.init(e,t)});var tE=Z("ZodNanoID",(e,t)=>{oS.init(e,t),De.init(e,t)});var rE=Z("ZodCUID",(e,t)=>{nS.init(e,t),De.init(e,t)});var oE=Z("ZodCUID2",(e,t)=>{sS.init(e,t),De.init(e,t)});var nE=Z("ZodULID",(e,t)=>{iS.init(e,t),De.init(e,t)});var sE=Z("ZodXID",(e,t)=>{aS.init(e,t),De.init(e,t)});var iE=Z("ZodKSUID",(e,t)=>{cS.init(e,t),De.init(e,t)});var aE=Z("ZodIPv4",(e,t)=>{mS.init(e,t),De.init(e,t)});var cE=Z("ZodIPv6",(e,t)=>{fS.init(e,t),De.init(e,t)});var uE=Z("ZodCIDRv4",(e,t)=>{hS.init(e,t),De.init(e,t)});var lE=Z("ZodCIDRv6",(e,t)=>{gS.init(e,t),De.init(e,t)});var dE=Z("ZodBase64",(e,t)=>{vS.init(e,t),De.init(e,t)});var pE=Z("ZodBase64URL",(e,t)=>{yS.init(e,t),De.init(e,t)});var mE=Z("ZodE164",(e,t)=>{SS.init(e,t),De.init(e,t)});var fE=Z("ZodJWT",(e,t)=>{bS.init(e,t),De.init(e,t)});var _z=Z("ZodNumber",(e,t)=>{rp.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(o,n,s)=>zp(e,o,n,s),Js(e,"ZodNumber",{gt(o,n){return this.check(uu(o,n))},gte(o,n){return this.check(Zs(o,n))},min(o,n){return this.check(Zs(o,n))},lt(o,n){return this.check(cu(o,n))},lte(o,n){return this.check(qs(o,n))},max(o,n){return this.check(qs(o,n))},int(o){return this.check(cz(o))},safe(o){return this.check(cz(o))},positive(o){return this.check(uu(0,o))},nonnegative(o){return this.check(Zs(0,o))},negative(o){return this.check(cu(0,o))},nonpositive(o){return this.check(qs(0,o))},multipleOf(o,n){return this.check(lu(o,n))},step(o,n){return this.check(lu(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function X(e){return yb(_z,e)}var hE=Z("ZodNumberFormat",(e,t)=>{zS.init(e,t),_z.init(e,t)});function cz(e){return Sb(hE,e)}var gE=Z("ZodBoolean",(e,t)=>{$S.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$p(e,r,o,n)});function _e(e){return bb(gE,e)}var _E=Z("ZodNull",(e,t)=>{wS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wp(e,r,o,n)});function _u(e){return zb(_E,e)}var vE=Z("ZodUnknown",(e,t)=>{RS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pp(e,r,o,n)});function ge(){return $b(vE)}var yE=Z("ZodNever",(e,t)=>{PS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Rp(e,r,o,n)});function SE(e){return wb(yE,e)}var bE=Z("ZodArray",(e,t)=>{ES.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ip(e,r,o,n),e.element=t.element,Js(e,"ZodArray",{min(r,o){return this.check(rn(r,o))},nonempty(r){return this.check(rn(1,r))},max(r,o){return this.check(du(r,o))},length(r,o){return this.check(pu(r,o))},unwrap(){return this.element}})});function W(e,t){return Rb(bE,e,t)}var vz=Z("ZodObject",(e,t)=>{TS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Op(e,r,o,n),Pe.defineLazy(e,"shape",()=>t.shape),Js(e,"ZodObject",{keyof(){return we(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ge()})},loose(){return this.clone({...this._zod.def,catchall:ge()})},strict(){return this.clone({...this._zod.def,catchall:SE()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return Pe.extend(this,r)},safeExtend(r){return Pe.safeExtend(this,r)},merge(r){return Pe.merge(this,r)},pick(r){return Pe.pick(this,r)},omit(r){return Pe.omit(this,r)},partial(...r){return Pe.partial(bz,this,r[0])},required(...r){return Pe.required(zz,this,r[0])}})});function j(e,t){let r={type:"object",shape:e??{},...Pe.normalizeParams(t)};return new vz(r)}function ze(e,t){return new vz({type:"object",shape:e,catchall:ge(),...Pe.normalizeParams(t)})}var yz=Z("ZodUnion",(e,t)=>{op.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cp(e,r,o,n),e.options=t.options});function le(e,t){return new yz({type:"union",options:e,...Pe.normalizeParams(t)})}var zE=Z("ZodDiscriminatedUnion",(e,t)=>{yz.init(e,t),IS.init(e,t)});function Gp(e,t,r){return new zE({type:"union",options:t,discriminator:e,...Pe.normalizeParams(r)})}var $E=Z("ZodIntersection",(e,t)=>{OS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Np(e,r,o,n)});function on(e,t){return new $E({type:"intersection",left:e,right:t})}var uz=Z("ZodRecord",(e,t)=>{CS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jp(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function ie(e,t,r){return!t||!t._zod?new uz({type:"record",keyType:P(),valueType:e,...Pe.normalizeParams(t)}):new uz({type:"record",keyType:e,valueType:t,...Pe.normalizeParams(r)})}var Kp=Z("ZodEnum",(e,t)=>{NS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Ep(e,o,n,s),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Kp({...t,checks:[],...Pe.normalizeParams(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let i of o)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Kp({...t,checks:[],...Pe.normalizeParams(n),entries:s})}});function we(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Kp({type:"enum",entries:r,...Pe.normalizeParams(t)})}var wE=Z("ZodLiteral",(e,t)=>{jS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>kp(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function J(e,t){return new wE({type:"literal",values:Array.isArray(e)?e:[e],...Pe.normalizeParams(t)})}var RE=Z("ZodTransform",(e,t)=>{AS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tp(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Yo(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Pe.issue(s,r.value,t));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(Pe.issue(i))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function Sz(e){return new RE({type:"transform",transform:e})}var bz=Z("ZodOptional",(e,t)=>{np.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ve(e){return new bz({type:"optional",innerType:e})}var PE=Z("ZodExactOptional",(e,t)=>{MS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function EE(e){return new PE({type:"optional",innerType:e})}var kE=Z("ZodNullable",(e,t)=>{qS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ap(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function lz(e){return new kE({type:"nullable",innerType:e})}var xE=Z("ZodDefault",(e,t)=>{ZS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function TE(e,t){return new xE({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Pe.shallowClone(t)}})}var IE=Z("ZodPrefault",(e,t)=>{LS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function OE(e,t){return new IE({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Pe.shallowClone(t)}})}var zz=Z("ZodNonOptional",(e,t)=>{DS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function CE(e,t){return new zz({type:"nonoptional",innerType:e,...Pe.normalizeParams(t)})}var NE=Z("ZodCatch",(e,t)=>{US.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jE(e,t){return new NE({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var $z=Z("ZodPipe",(e,t)=>{sp.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dp(e,r,o,n),e.in=t.in,e.out=t.out});function dz(e,t){return new $z({type:"pipe",in:e,out:t})}var AE=Z("ZodPreprocess",(e,t)=>{$z.init(e,t),FS.init(e,t)}),ME=Z("ZodReadonly",(e,t)=>{VS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Up(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function qE(e){return new ME({type:"readonly",innerType:e})}var ZE=Z("ZodLazy",(e,t)=>{JS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fp(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Wp(e){return new ZE({type:"lazy",getter:e})}var LE=Z("ZodCustom",(e,t)=>{HS.init(e,t),Me.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xp(e,r,o,n)});function DE(e,t={}){return Pb(LE,e,t)}function UE(e,t){return Eb(e,t)}function vu(e,t){return new AE({type:"pipe",in:Sz(e),out:t})}Rt(BS());var tm=Symbol.for("mcp.sdk.errorBrands");function sm(e,t){let r=new Set,o=t;for(;typeof o=="function";){let n=o.mcpBrand;Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof n=="string"&&r.add(n),o=Object.getPrototypeOf(o)}r.size!==0&&Object.defineProperty(e,tm,{value:r,enumerable:!1,configurable:!0})}function cn(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,tm)){let r=t[tm];if(r&&typeof r.has=="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var FE=class qz extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return cn(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return cn(this,t)}constructor(t,r,o){super(r),this.code=t,this.errorUri=o,this.name="OAuthError",sm(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}static fromResponse(t){return new qz(t.error,t.error_description??t.error,t.error_uri)}},me=function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e}({}),ue=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return cn(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return cn(this,e)}constructor(e,t,r){super(t),this.code=e,this.data=r,this.name="SdkError",sm(this,new.target)}},VE=class extends ue{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r){super(e,t,r),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};var wz={};function Zz(e){return Object.hasOwn(wz,e)?wz[e]:void 0}function Rz(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function JE(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function Lz(e){switch(e.method){case"elicitation/create":return e.params?.mode==="url"?{elicitation:{url:{}}}:{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;return t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0)?{sampling:{tools:{}}}:{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function Ys(e,t){let r={};for(let[o,n]of Object.entries(e)){if(n===void 0)continue;let s=t===void 0?void 0:t[o];if(s===void 0){r[o]=n;continue}if(Rz(n)&&Rz(s)){let i={};for(let[a,c]of Object.entries(n))c!==void 0&&s[a]===void 0&&!JE(o,a,s)&&(i[a]=c);Object.keys(i).length>0&&(r[o]=i)}}return Object.keys(r).length>0?r:void 0}var Dz="2026-07-28",Ct=[Dz];function dr(e){return e>=Dz}function Uz(e){return e.filter(t=>!dr(t))}function im(e){return e.filter(t=>dr(t))}function Fz(e){let t=e.structuredContent;return t===void 0||!(typeof t!="object"||t===null||Array.isArray(t))||(e.content?.some(r=>r.type==="text")??!1)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var Vz=["task","inputRequests","requestState"];function am(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||Vz.some(t=>t in e)?e:{...e,content:[]}}function HE(){let e=Wp(()=>le([P(),X(),_e(),_u(),ie(P(),e),W(e)])),t=ie(P(),e),r=le([P(),X().int()]),o=P(),n=j({ttl:X().optional()}),s=j({taskId:P()}),i=ze({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),a=j({_meta:i.optional()}),c=a.extend({task:n.optional()}),u=j({method:P(),params:a.loose().optional()}),l=j({_meta:i.optional()}),d=j({method:P(),params:l.loose().optional()}),p=ze({_meta:i.optional()}),g=le([P(),X().int()]),f=p.strict(),_=l.extend({requestId:g.optional(),reason:P().optional()}),m=d.extend({method:J("notifications/cancelled"),params:_}),h=j({src:P(),mimeType:P().optional(),sizes:W(P()).optional(),theme:we(["light","dark"]).optional()}),z=j({icons:W(h).optional()}),v=j({name:P(),title:P().optional()}),S=v.extend({...v.shape,...z.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),R=on(j({applyDefaults:_e().optional()}),t),b=vu(lt=>lt&&typeof lt=="object"&&!Array.isArray(lt)&&Object.keys(lt).length===0?{form:{}}:lt,on(j({form:R.optional(),url:t.optional()}),t.optional())),y=ze({list:t.optional(),cancel:t.optional(),requests:ze({sampling:ze({createMessage:t.optional()}).optional(),elicitation:ze({create:t.optional()}).optional()}).optional()}),$=ze({list:t.optional(),cancel:t.optional(),requests:ze({tools:ze({call:t.optional()}).optional()}).optional()}),T=j({experimental:ie(P(),t).optional(),sampling:j({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:j({listChanged:_e().optional()}).optional(),tasks:y.optional(),extensions:ie(P(),t).optional()}),C=a.extend({protocolVersion:P(),capabilities:T,clientInfo:S}),O=u.extend({method:J("initialize"),params:C}),L=j({experimental:ie(P(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:j({listChanged:_e().optional()}).optional(),resources:j({subscribe:_e().optional(),listChanged:_e().optional()}).optional(),tools:j({listChanged:_e().optional()}).optional(),tasks:$.optional(),extensions:ie(P(),t).optional()}),H=p.extend({protocolVersion:P(),capabilities:L,serverInfo:S,instructions:P().optional()}),G=d.extend({method:J("notifications/initialized"),params:l.optional()}),he=u.extend({method:J("ping"),params:a.optional()}),qe=j({progress:X(),total:ve(X()),message:ve(P())}),Ie=j({...l.shape,...qe.shape,progressToken:r}),Ye=d.extend({method:J("notifications/progress"),params:Ie}),ye=a.extend({cursor:o.optional()}),I=u.extend({params:ye.optional()}),A=p.extend({nextCursor:o.optional()}),F=j({uri:P(),mimeType:ve(P()),_meta:ie(P(),ge()).optional()}),w=F.extend({text:P()}),x=P().refine(lt=>{try{return atob(lt),!0}catch{return!1}},{message:"Invalid Base64 string"}),N=F.extend({blob:x}),B=we(["user","assistant"]),te=j({audience:W(B).optional(),priority:X().min(0).max(1).optional(),lastModified:Mr.datetime({offset:!0}).optional()}),fe=j({...v.shape,...z.shape,uri:P(),description:ve(P()),mimeType:ve(P()),size:ve(X()),annotations:te.optional(),_meta:ve(ze({}))}),se=j({...v.shape,...z.shape,uriTemplate:P(),description:ve(P()),mimeType:ve(P()),annotations:te.optional(),_meta:ve(ze({}))}),Oe=I.extend({method:J("resources/list")}),mt=A.extend({resources:W(fe)}),E=I.extend({method:J("resources/templates/list")}),M=A.extend({resourceTemplates:W(se)}),D=a.extend({uri:P()}),oe=D,ne=u.extend({method:J("resources/read"),params:oe}),pe=p.extend({contents:W(le([w,N]))}),Ge=d.extend({method:J("notifications/resources/list_changed"),params:l.optional()}),et=D,ct=u.extend({method:J("resources/subscribe"),params:et}),Xe=D,Ue=u.extend({method:J("resources/unsubscribe"),params:Xe}),Et=l.extend({uri:P()}),rt=d.extend({method:J("notifications/resources/updated"),params:Et}),Xt=j({name:P(),description:ve(P()),required:ve(_e())}),Nt=j({...v.shape,...z.shape,description:ve(P()),arguments:ve(W(Xt)),_meta:ve(ze({}))}),Qt=I.extend({method:J("prompts/list")}),mr=A.extend({prompts:W(Nt)}),fr=a.extend({name:P(),arguments:ie(P(),P()).optional()}),Ur=u.extend({method:J("prompts/get"),params:fr}),Fr=j({type:J("text"),text:P(),annotations:te.optional(),_meta:ie(P(),ge()).optional()}),Vr=j({type:J("image"),data:x,mimeType:P(),annotations:te.optional(),_meta:ie(P(),ge()).optional()}),Jr=j({type:J("audio"),data:x,mimeType:P(),annotations:te.optional(),_meta:ie(P(),ge()).optional()}),fn=j({type:J("tool_use"),name:P(),id:P(),input:ie(P(),ge()),_meta:ie(P(),ge()).optional()}),hr=j({type:J("resource"),resource:le([w,N]),annotations:te.optional(),_meta:ie(P(),ge()).optional()}),hn=fe.extend({type:J("resource_link")}),kt=le([Fr,Vr,Jr,hn,hr]),fo=j({role:B,content:kt}),ho=p.extend({description:P().optional(),messages:W(fo)}),Hr=d.extend({method:J("notifications/prompts/list_changed"),params:l.optional()}),gn=j({title:P().optional(),readOnlyHint:_e().optional(),destructiveHint:_e().optional(),idempotentHint:_e().optional(),openWorldHint:_e().optional()}),go=j({taskSupport:we(["required","optional","forbidden"]).optional()}),Br=j({...v.shape,...z.shape,description:P().optional(),inputSchema:j({type:J("object"),properties:ie(P(),e).optional(),required:W(P()).optional()}).catchall(ge()),outputSchema:j({type:J("object"),properties:ie(P(),e).optional(),required:W(P()).optional()}).catchall(ge()).optional(),annotations:gn.optional(),execution:go.optional(),_meta:ie(P(),ge()).optional()}),_o=I.extend({method:J("tools/list")}),vo=A.extend({tools:W(Br)}),yo=p.extend({content:W(kt),structuredContent:ie(P(),ge()).optional(),isError:_e().optional()}),ut=c.extend({name:P(),arguments:ie(P(),ge()).optional()}),_n=u.extend({method:J("tools/call"),params:ut}),si=d.extend({method:J("notifications/tools/list_changed"),params:l.optional()}),So=we(["debug","info","notice","warning","error","critical","alert","emergency"]),vn=a.extend({level:So}),yn=u.extend({method:J("logging/setLevel"),params:vn}),Sn=l.extend({level:So,logger:P().optional(),data:ge()}),bn=d.extend({method:J("notifications/message"),params:Sn}),zn=j({name:P().optional()}),$n=j({hints:W(zn).optional(),costPriority:X().min(0).max(1).optional(),speedPriority:X().min(0).max(1).optional(),intelligencePriority:X().min(0).max(1).optional()}),wn=j({mode:we(["auto","required","none"]).optional()}),ii=j({type:J("tool_result"),toolUseId:P().describe("The unique identifier for the corresponding tool call."),content:W(kt),structuredContent:j({}).loose().optional(),isError:_e().optional(),_meta:ie(P(),ge()).optional()}),Rn=Gp("type",[Fr,Vr,Jr]),gr=Gp("type",[Fr,Vr,Jr,fn,ii]),Pn=j({role:B,content:le([gr,W(gr)]),_meta:ie(P(),ge()).optional()}),En=c.extend({messages:W(Pn),modelPreferences:$n.optional(),systemPrompt:P().optional(),includeContext:we(["none","thisServer","allServers"]).optional(),temperature:X().optional(),maxTokens:X().int(),stopSequences:W(P()).optional(),metadata:t.optional(),tools:W(Br).optional(),toolChoice:wn.optional()}),kn=u.extend({method:J("sampling/createMessage"),params:En}),xn=p.extend({model:P(),stopReason:ve(we(["endTurn","stopSequence","maxTokens"]).or(P())),role:B,content:Rn}),Tn=p.extend({model:P(),stopReason:ve(we(["endTurn","stopSequence","maxTokens","toolUse"]).or(P())),role:B,content:le([gr,W(gr)])}),In=j({type:J("boolean"),title:P().optional(),description:P().optional(),default:_e().optional()}),On=j({type:J("string"),title:P().optional(),description:P().optional(),minLength:X().optional(),maxLength:X().optional(),format:we(["email","uri","date","date-time"]).optional(),default:P().optional()}),Cn=j({type:we(["number","integer"]),title:P().optional(),description:P().optional(),minimum:X().optional(),maximum:X().optional(),default:X().optional()}),Nn=j({type:J("string"),title:P().optional(),description:P().optional(),enum:W(P()),default:P().optional()}),jn=j({type:J("string"),title:P().optional(),description:P().optional(),oneOf:W(j({const:P(),title:P()})),default:P().optional()}),An=j({type:J("string"),title:P().optional(),description:P().optional(),enum:W(P()),enumNames:W(P()).optional(),default:P().optional()}),Mn=le([Nn,jn]),Kr=j({type:J("array"),title:P().optional(),description:P().optional(),minItems:X().optional(),maxItems:X().optional(),items:j({type:J("string"),enum:W(P())}),default:W(P()).optional()}),Gr=j({type:J("array"),title:P().optional(),description:P().optional(),minItems:X().optional(),maxItems:X().optional(),items:j({anyOf:W(j({const:P(),title:P()}))}),default:W(P()).optional()}),ai=le([Kr,Gr]),ci=le([An,Mn,ai]),bt=le([ci,In,On,Cn]),zt=c.extend({mode:J("form").optional(),message:P(),requestedSchema:j({type:J("object"),properties:ie(P(),bt),required:W(P()).optional()}).catchall(ge())}),qn=c.extend({mode:J("url"),message:P(),elicitationId:P(),url:P().url()}),jt=le([zt,qn]),ui=u.extend({method:J("elicitation/create"),params:jt}),li=l.extend({elicitationId:P()}),di=d.extend({method:J("notifications/elicitation/complete"),params:li}),pi=p.extend({action:we(["accept","decline","cancel"]),content:vu(lt=>lt===null?void 0:lt,ie(P(),le([P(),X(),_e(),W(P())])).optional())}),mi=j({type:J("ref/resource"),uri:P()}),fi=j({type:J("ref/prompt"),name:P()}),hi=a.extend({ref:le([fi,mi]),argument:j({name:P(),value:P()}),context:j({arguments:ie(P(),P()).optional()}).optional()}),Zn=u.extend({method:J("completion/complete"),params:hi}),gi=p.extend({completion:ze({values:W(P()).max(100),total:ve(X().int()),hasMore:ve(_e())})}),_i=j({uri:P().startsWith("file://"),name:P().optional(),_meta:ie(P(),ge()).optional()}),bo=u.extend({method:J("roots/list"),params:a.optional()}),Ln=p.extend({roots:W(_i)}),vi=d.extend({method:J("notifications/roots/list_changed"),params:l.optional()}),yi=ze({ttl:X().optional(),pollInterval:X().optional()}),Si=we(["working","input_required","completed","failed","cancelled"]),_r=j({taskId:P(),status:Si,ttl:le([X(),_u()]),createdAt:P(),lastUpdatedAt:P(),pollInterval:ve(X()),statusMessage:ve(P())}),gt=p.extend({task:_r}),bi=l.merge(_r),Wr=d.extend({method:J("notifications/tasks/status"),params:bi}),zo=u.extend({method:J("tasks/get"),params:a.extend({taskId:P()})}),$o=p.merge(_r),wo=u.extend({method:J("tasks/result"),params:a.extend({taskId:P()})}),Gu=p.loose(),_t=I.extend({method:J("tasks/list")}),We=A.extend({tasks:W(_r)}),Yr=u.extend({method:J("tasks/cancel"),params:a.extend({taskId:P()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:a,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:l,NotificationSchema:d,ResultSchema:p,RequestIdSchema:g,EmptyResultSchema:f,CancelledNotificationParamsSchema:_,CancelledNotificationSchema:m,IconSchema:h,IconsSchema:z,BaseMetadataSchema:v,ImplementationSchema:S,ClientTasksCapabilitySchema:y,ServerTasksCapabilitySchema:$,ClientCapabilitiesSchema:T,InitializeRequestParamsSchema:C,InitializeRequestSchema:O,ServerCapabilitiesSchema:L,InitializeResultSchema:H,InitializedNotificationSchema:G,PingRequestSchema:he,ProgressSchema:qe,ProgressNotificationParamsSchema:Ie,ProgressNotificationSchema:Ye,PaginatedRequestParamsSchema:ye,PaginatedRequestSchema:I,PaginatedResultSchema:A,ResourceContentsSchema:F,TextResourceContentsSchema:w,BlobResourceContentsSchema:N,RoleSchema:B,AnnotationsSchema:te,ResourceSchema:fe,ResourceTemplateSchema:se,ListResourcesRequestSchema:Oe,ListResourcesResultSchema:mt,ListResourceTemplatesRequestSchema:E,ListResourceTemplatesResultSchema:M,ResourceRequestParamsSchema:D,ReadResourceRequestParamsSchema:oe,ReadResourceRequestSchema:ne,ReadResourceResultSchema:pe,ResourceListChangedNotificationSchema:Ge,SubscribeRequestParamsSchema:et,SubscribeRequestSchema:ct,UnsubscribeRequestParamsSchema:Xe,UnsubscribeRequestSchema:Ue,ResourceUpdatedNotificationParamsSchema:Et,ResourceUpdatedNotificationSchema:rt,PromptArgumentSchema:Xt,PromptSchema:Nt,ListPromptsRequestSchema:Qt,ListPromptsResultSchema:mr,GetPromptRequestParamsSchema:fr,GetPromptRequestSchema:Ur,TextContentSchema:Fr,ImageContentSchema:Vr,AudioContentSchema:Jr,ToolUseContentSchema:fn,EmbeddedResourceSchema:hr,ResourceLinkSchema:hn,ContentBlockSchema:kt,PromptMessageSchema:fo,GetPromptResultSchema:ho,PromptListChangedNotificationSchema:Hr,ToolAnnotationsSchema:gn,ToolExecutionSchema:go,ToolSchema:Br,ListToolsRequestSchema:_o,ListToolsResultSchema:vo,CallToolResultSchema:yo,CallToolRequestParamsSchema:ut,CallToolRequestSchema:_n,ToolListChangedNotificationSchema:si,LoggingLevelSchema:So,SetLevelRequestParamsSchema:vn,SetLevelRequestSchema:yn,LoggingMessageNotificationParamsSchema:Sn,LoggingMessageNotificationSchema:bn,ModelHintSchema:zn,ModelPreferencesSchema:$n,ToolChoiceSchema:wn,ToolResultContentSchema:ii,SamplingContentSchema:Rn,SamplingMessageContentBlockSchema:gr,SamplingMessageSchema:Pn,CreateMessageRequestParamsSchema:En,CreateMessageRequestSchema:kn,CreateMessageResultSchema:xn,CreateMessageResultWithToolsSchema:Tn,BooleanSchemaSchema:In,StringSchemaSchema:On,NumberSchemaSchema:Cn,UntitledSingleSelectEnumSchemaSchema:Nn,TitledSingleSelectEnumSchemaSchema:jn,LegacyTitledEnumSchemaSchema:An,SingleSelectEnumSchemaSchema:Mn,UntitledMultiSelectEnumSchemaSchema:Kr,TitledMultiSelectEnumSchemaSchema:Gr,MultiSelectEnumSchemaSchema:ai,EnumSchemaSchema:ci,PrimitiveSchemaDefinitionSchema:bt,ElicitRequestFormParamsSchema:zt,ElicitRequestURLParamsSchema:qn,ElicitRequestParamsSchema:jt,ElicitRequestSchema:ui,ElicitationCompleteNotificationParamsSchema:li,ElicitationCompleteNotificationSchema:di,ElicitResultSchema:pi,ResourceTemplateReferenceSchema:mi,PromptReferenceSchema:fi,CompleteRequestParamsSchema:hi,CompleteRequestSchema:Zn,CompleteResultSchema:gi,RootSchema:_i,ListRootsRequestSchema:bo,ListRootsResultSchema:Ln,RootsListChangedNotificationSchema:vi,TaskCreationParamsSchema:yi,TaskStatusSchema:Si,TaskSchema:_r,CreateTaskResultSchema:gt,TaskStatusNotificationParamsSchema:bi,TaskStatusNotificationSchema:Wr,GetTaskRequestSchema:zo,GetTaskResultSchema:$o,GetTaskPayloadRequestSchema:wo,GetTaskPayloadResultSchema:Gu,ListTasksRequestSchema:_t,ListTasksResultSchema:We,CancelTaskRequestSchema:Yr,CancelTaskResultSchema:p.merge(_r),ClientRequestSchema:le([he,O,Zn,yn,Ur,Qt,Oe,E,ne,ct,Ue,_n,_o,zo,wo,_t,Yr]),ClientNotificationSchema:le([m,Ye,G,vi,Wr]),ClientResultSchema:le([f,xn,Tn,pi,Ln,$o,We,gt]),ServerRequestSchema:le([he,kn,ui,bo,zo,wo,_t,Yr]),ServerNotificationSchema:le([m,Ye,bn,rt,Ge,si,Hr,Wr,di]),ServerResultSchema:le([f,H,gi,ho,mr,mt,M,pe,yo,vo,$o,We,gt]),CallToolResultWireSchema:ge().superRefine((lt,y0)=>{if(!(typeof lt!="object"||lt===null||Array.isArray(lt)||lt.content!==void 0)){for(let Am of Vz)if(Am in lt){y0.addIssue({code:"custom",message:`content is required when the body carries '${Am}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(am).pipe(yo)}}var BE;function Jz(){return BE??=HE()}function Hz(e){return e.type!=="object"}var KE=new Set(["const","enum","default","examples"]),GE=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Pz(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function WE(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(Pz(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=Lm(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,s)=>{if(Array.isArray(n))return n.map(c=>o(c,!1));if(n===null||typeof n!="object"||!s&&Pz(n.$id))return n;let i={},a=!1;for(let[c,u]of Object.entries(n))s?i[c]=o(u,!1):(c==="$ref"||c==="$dynamicRef")&&typeof u=="string"?i[c]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u:c==="$recursiveRef"&&u==="#"&&r?a=!0:KE.has(c)?i[c]=u:GE.has(c)?i[c]=o(u,!0):i[c]=o(u,!1);return a&&("$ref"in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:"#/properties/result"}]:i.$ref="#/properties/result"),i};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var Bz={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Kz={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},YE={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},yu;function cm(){if(yu)return yu;let e=Jz();return yu={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},yu}function Gz(e){return Object.prototype.hasOwnProperty.call(Bz,e)}function Wz(e){return Object.prototype.hasOwnProperty.call(Kz,e)}function XE(e){return Object.prototype.hasOwnProperty.call(YE,e)}function QE(e){return XE(e)?cm().resultSchemas[e]:void 0}function ek(e){return Gz(e)?cm().requestSchemas[e]:void 0}function tk(e){return Wz(e)?cm().notificationSchemas[e]:void 0}var Uj=Object.keys(Bz),Fj=Object.keys(Kz);function rm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Su(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var Ez={ok:!1,reason:"not-in-era"};function kz(e){return rm(e)&&rm(e.outputSchema)&&Hz(e.outputSchema)}var um={era:"2025-11-25",hasRequestMethod:Gz,hasNotificationMethod:Wz,validateRequest:(e,t)=>Su(ek(e),t),validateResult:(e,t)=>Su(QE(e),t),validateNotification:(e,t)=>Su(tk(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Ez,validateInputResponse:()=>Ez,samplingResultVariant:(e,t)=>{let r=Jz();return Su(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=Fz(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!="object"||o===null||Array.isArray(o),s=t!==void 0&&Hz(t);return!n&&!s?r:{...r,structuredContent:{result:o}}},decodeResult(e,t){if(rm(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:r}}return{kind:"complete",result:t}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;return!Array.isArray(r)||!r.some(o=>kz(o))?t:{...t,tools:r.map(o=>kz(o)?{...o,outputSchema:WE(o.outputSchema)}:o)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function rk(){let e=Wp(()=>le([P(),X(),_e(),_u(),ie(P(),e),W(e)])),t=ie(P(),e),r=le([P(),X().int()]),o=P(),n=le([P(),X().int()]),s=we(["user","assistant"]),i=we(["debug","info","notice","warning","error","critical","alert","emergency"]),a=P().refine(We=>{try{return atob(We),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=j({ttl:X().optional()}),u=j({taskId:P()}),l=ze({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),d=j({_meta:l.optional()}),p=d.extend({task:c.optional()}),g=j({_meta:l.optional()}),f=j({method:P(),params:g.loose().optional()}),_=j({src:P(),mimeType:P().optional(),sizes:W(P()).optional(),theme:we(["light","dark"]).optional()}),m=j({icons:W(_).optional()}),h=j({name:P(),title:P().optional()}),z=h.extend({...h.shape,...m.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),v=on(j({applyDefaults:_e().optional()}),t),S=vu(We=>We&&typeof We=="object"&&!Array.isArray(We)&&Object.keys(We).length===0?{form:{}}:We,on(j({form:v.optional(),url:t.optional()}),t.optional())),R=ze({list:t.optional(),cancel:t.optional(),requests:ze({sampling:ze({createMessage:t.optional()}).optional(),elicitation:ze({create:t.optional()}).optional()}).optional()}),b=ze({list:t.optional(),cancel:t.optional(),requests:ze({tools:ze({call:t.optional()}).optional()}).optional()}),y=j({experimental:ie(P(),t).optional(),sampling:j({context:t.optional(),tools:t.optional()}).optional(),elicitation:S.optional(),roots:j({listChanged:_e().optional()}).optional(),tasks:R.optional(),extensions:ie(P(),t).optional()}),$=j({experimental:ie(P(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:j({listChanged:_e().optional()}).optional(),resources:j({subscribe:_e().optional(),listChanged:_e().optional()}).optional(),tools:j({listChanged:_e().optional()}).optional(),tasks:b.optional(),extensions:ie(P(),t).optional()}),T=j({progress:X(),total:ve(X()),message:ve(P())}),C=j({...g.shape,...T.shape,progressToken:r}),O=f.extend({method:J("notifications/progress"),params:C}),L=g.extend({level:i,logger:P().optional(),data:ge()}),H=f.extend({method:J("notifications/message"),params:L}),G=j({uri:P(),mimeType:ve(P()),_meta:ie(P(),ge()).optional()}),he=G.extend({text:P()}),qe=G.extend({blob:a}),Ie=j({audience:W(s).optional(),priority:X().min(0).max(1).optional(),lastModified:Mr.datetime({offset:!0}).optional()}),Ye=j({...h.shape,...m.shape,uri:P(),description:ve(P()),mimeType:ve(P()),size:ve(X()),annotations:Ie.optional(),_meta:ve(ze({}))}),ye=j({...h.shape,...m.shape,uriTemplate:P(),description:ve(P()),mimeType:ve(P()),annotations:Ie.optional(),_meta:ve(ze({}))}),I=f.extend({method:J("notifications/resources/list_changed"),params:g.optional()}),A=g.extend({uri:P()}),F=f.extend({method:J("notifications/resources/updated"),params:A}),w=j({name:P(),description:ve(P()),required:ve(_e())}),x=j({...h.shape,...m.shape,description:ve(P()),arguments:ve(W(w)),_meta:ve(ze({}))}),N=f.extend({method:J("notifications/prompts/list_changed"),params:g.optional()}),B=j({type:J("text"),text:P(),annotations:Ie.optional(),_meta:ie(P(),ge()).optional()}),te=j({type:J("image"),data:a,mimeType:P(),annotations:Ie.optional(),_meta:ie(P(),ge()).optional()}),fe=j({type:J("audio"),data:a,mimeType:P(),annotations:Ie.optional(),_meta:ie(P(),ge()).optional()}),se=j({type:J("tool_use"),name:P(),id:P(),input:ie(P(),ge()),_meta:ie(P(),ge()).optional()}),Oe=j({type:J("resource"),resource:le([he,qe]),annotations:Ie.optional(),_meta:ie(P(),ge()).optional()}),mt=Ye.extend({type:J("resource_link")}),E=le([B,te,fe,mt,Oe]),M=j({role:s,content:E}),D=j({title:P().optional(),readOnlyHint:_e().optional(),destructiveHint:_e().optional(),idempotentHint:_e().optional(),openWorldHint:_e().optional()}),oe=f.extend({method:J("notifications/tools/list_changed"),params:g.optional()}),ne=j({name:P().optional()}),pe=j({hints:W(ne).optional(),costPriority:X().min(0).max(1).optional(),speedPriority:X().min(0).max(1).optional(),intelligencePriority:X().min(0).max(1).optional()}),Ge=j({mode:we(["auto","required","none"]).optional()}),et=j({type:J("boolean"),title:P().optional(),description:P().optional(),default:_e().optional()}),ct=j({type:J("string"),title:P().optional(),description:P().optional(),minLength:X().optional(),maxLength:X().optional(),format:we(["email","uri","date","date-time"]).optional(),default:P().optional()}),Xe=j({type:we(["number","integer"]),title:P().optional(),description:P().optional(),minimum:X().optional(),maximum:X().optional(),default:X().optional()}),Ue=j({type:J("string"),title:P().optional(),description:P().optional(),enum:W(P()),default:P().optional()}),Et=j({type:J("string"),title:P().optional(),description:P().optional(),oneOf:W(j({const:P(),title:P()})),default:P().optional()}),rt=j({type:J("string"),title:P().optional(),description:P().optional(),enum:W(P()),enumNames:W(P()).optional(),default:P().optional()}),Xt=le([Ue,Et]),Nt=j({type:J("array"),title:P().optional(),description:P().optional(),minItems:X().optional(),maxItems:X().optional(),items:j({type:J("string"),enum:W(P())}),default:W(P()).optional()}),Qt=j({type:J("array"),title:P().optional(),description:P().optional(),minItems:X().optional(),maxItems:X().optional(),items:j({anyOf:W(j({const:P(),title:P()}))}),default:W(P()).optional()}),mr=le([Nt,Qt]),fr=le([rt,Xt,mr]),Ur=le([fr,et,ct,Xe]),Fr=p.extend({mode:J("form").optional(),message:P(),requestedSchema:j({type:J("object"),properties:ie(P(),Ur),required:W(P()).optional()}).catchall(ge())}),Vr=j({type:J("ref/resource"),uri:P()}),Jr=j({type:J("ref/prompt"),name:P()}),fn=j({uri:P().startsWith("file://"),name:P().optional(),_meta:ie(P(),ge()).optional()}),hr=y.shape,hn=j({experimental:hr.experimental,sampling:hr.sampling,elicitation:hr.elicitation,roots:hr.roots,extensions:hr.extensions}),kt=$.shape,fo=j({experimental:kt.experimental,logging:kt.logging,completions:kt.completions,prompts:kt.prompts,resources:kt.resources,tools:kt.tools,extensions:kt.extensions}),ho=ze({progressToken:r.optional(),[Tt]:P(),[ro]:z.optional(),[Kt]:hn,[Rr]:i.optional()}),Hr=j({...h.shape,...m.shape,description:P().optional(),inputSchema:ze({$schema:P().optional(),type:J("object")}),outputSchema:ze({$schema:P().optional()}).optional(),annotations:D.optional(),_meta:ie(P(),ge()).optional()}),gn=j({type:J("tool_result"),toolUseId:P(),content:W(E),structuredContent:ge().optional(),isError:_e().optional(),_meta:ie(P(),ge()).optional()}),go=le([B,te,fe,se,gn]),Br=j({role:s,content:le([go,W(go)]),_meta:ie(P(),ge()).optional()}),_o=P(),vo=ze({[Lt]:z.optional().catch(void 0)}),yo=vo.optional();function ut(We){return ze({_meta:yo,resultType:_o.default("complete"),...We})}let _n=ut({}),si=ut({nextCursor:o.optional()}),So=ut({content:W(E),structuredContent:ge().optional(),isError:_e().optional()}),vn=ut({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),tools:W(Hr),nextCursor:o.optional()}),yn=ut({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),prompts:W(x),nextCursor:o.optional()}),Sn=ut({description:P().optional(),messages:W(M)}),bn=ut({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),resources:W(Ye),nextCursor:o.optional()}),zn=ut({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),resourceTemplates:W(ye),nextCursor:o.optional()}),$n=ut({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),contents:W(le([he,qe]))}),wn=ut({completion:j({values:W(P()).max(100),total:X().int().optional(),hasMore:_e().optional()}).loose()}),ii=ut({ttlMs:X().int().min(0),cacheScope:we(["public","private"])}),Rn=ut({ttlMs:X().int().min(0).catch(0),cacheScope:we(["public","private"]).catch("private"),supportedVersions:W(P()),capabilities:fo,instructions:P().optional()}),gr=j({messages:W(Br),modelPreferences:pe.optional(),systemPrompt:P().optional(),includeContext:we(["none","thisServer","allServers"]).optional(),temperature:X().optional(),maxTokens:X().int(),stopSequences:W(P()).optional(),metadata:t.optional(),tools:W(Hr).optional(),toolChoice:Ge.optional()}),Pn=j({method:J("sampling/createMessage"),params:gr}),En=j({method:J("roots/list"),params:j({_meta:ie(P(),ge()).optional()}).optional()}),kn=j({...Br.shape,model:P(),stopReason:P().optional()}),xn=j({roots:W(fn)}),Tn=j({action:we(["accept","decline","cancel"]),content:ie(P(),le([P(),X(),_e(),W(P())])).optional()}),In=j({mode:J("url"),message:P(),url:P().url()}),On=le([Fr,In]),Cn=j({method:J("elicitation/create"),params:On}),Nn=le([Pn,En,Cn]),jn=le([kn,xn,Tn]),An=ie(P(),Nn),Mn=ie(P(),jn),Kr=ut({inputRequests:An.optional(),requestState:P().optional()}),Gr={inputResponses:Mn.optional(),requestState:P().optional()},ai=j({_meta:ho,...Gr}),ci=ze({progressToken:r.optional()});function bt(We,Yr){return j({method:J(We),params:j({_meta:ho,...Yr})})}function zt(We,Yr){return j({method:J(We),params:j({_meta:ci.optional(),...Yr}).optional()})}let qn={name:P(),arguments:ie(P(),ge()).optional(),...Gr},jt={cursor:o.optional()},ui=bt("tools/call",qn),li=bt("tools/list",jt),di=bt("prompts/list",jt),pi=bt("prompts/get",{name:P(),arguments:ie(P(),P()).optional(),...Gr}),mi=bt("resources/list",jt),fi=bt("resources/templates/list",jt),hi=bt("resources/read",{uri:P(),...Gr}),Zn={ref:le([Jr,Vr]),argument:j({name:P(),value:P()}),context:j({arguments:ie(P(),P()).optional()}).optional()},gi=bt("completion/complete",Zn),_i=bt("server/discover",{}),bo=j({toolsListChanged:_e().optional(),promptsListChanged:_e().optional(),resourcesListChanged:_e().optional(),resourceSubscriptions:W(P()).optional()}),Ln={notifications:bo},vi=bt("subscriptions/listen",Ln),yi=vo.extend({"io.modelcontextprotocol/subscriptionId":n}),Si=ze({_meta:yi,resultType:_o.default("complete")}),_r={"tools/call":zt("tools/call",qn),"tools/list":zt("tools/list",jt),"prompts/get":zt("prompts/get",{name:P(),arguments:ie(P(),P()).optional()}),"prompts/list":zt("prompts/list",jt),"resources/list":zt("resources/list",jt),"resources/templates/list":zt("resources/templates/list",jt),"resources/read":zt("resources/read",{uri:P()}),"completion/complete":zt("completion/complete",Zn),"server/discover":zt("server/discover",{}),"subscriptions/listen":zt("subscriptions/listen",Ln)};function gt(We){return ze({_meta:yo,...We})}let bi={"tools/call":gt({content:W(E),structuredContent:ge().optional(),isError:_e().optional()}),"tools/list":gt({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),tools:W(Hr),nextCursor:o.optional()}),"prompts/get":gt({description:P().optional(),messages:W(M)}),"prompts/list":gt({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),prompts:W(x),nextCursor:o.optional()}),"resources/list":gt({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),resources:W(Ye),nextCursor:o.optional()}),"resources/templates/list":gt({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),resourceTemplates:W(ye),nextCursor:o.optional()}),"resources/read":gt({ttlMs:X().int().min(0),cacheScope:we(["public","private"]),contents:W(le([he,qe]))}),"completion/complete":gt({completion:j({values:W(P()).max(100),total:X().int().optional(),hasMore:_e().optional()}).loose()}),"server/discover":gt({ttlMs:X().int().min(0).catch(0),cacheScope:we(["public","private"]).catch("private"),supportedVersions:W(P()),capabilities:fo,instructions:P().optional()}),"subscriptions/listen":gt({})},Wr=ze({"io.modelcontextprotocol/subscriptionId":n.optional()}),zo=j({method:J("notifications/subscriptions/acknowledged"),params:j({_meta:Wr.optional(),notifications:bo})}),$o=j({_meta:Wr.optional(),requestId:n,reason:P().optional()}),wo=j({method:J("notifications/cancelled"),params:$o}),Gu={"notifications/cancelled":wo,"notifications/progress":O,"notifications/message":H,"notifications/resources/updated":F,"notifications/resources/list_changed":I,"notifications/tools/list_changed":oe,"notifications/prompts/list_changed":N,"notifications/subscriptions/acknowledged":zo},_t=We=>j({jsonrpc:J("2.0"),id:le([P(),X().int()]),result:We}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:c,RelatedTaskMetadataSchema:u,RequestMetaSchema:l,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:p,NotificationsParamsSchema:g,NotificationSchema:f,IconSchema:_,IconsSchema:m,BaseMetadataSchema:h,ImplementationSchema:z,ClientTasksCapabilitySchema:R,ServerTasksCapabilitySchema:b,ClientCapabilitiesSchema:y,ServerCapabilitiesSchema:$,ProgressSchema:T,ProgressNotificationParamsSchema:C,ProgressNotificationSchema:O,LoggingMessageNotificationParamsSchema:L,LoggingMessageNotificationSchema:H,ResourceContentsSchema:G,TextResourceContentsSchema:he,BlobResourceContentsSchema:qe,AnnotationsSchema:Ie,ResourceSchema:Ye,ResourceTemplateSchema:ye,ResourceListChangedNotificationSchema:I,ResourceUpdatedNotificationParamsSchema:A,ResourceUpdatedNotificationSchema:F,PromptArgumentSchema:w,PromptSchema:x,PromptListChangedNotificationSchema:N,TextContentSchema:B,ImageContentSchema:te,AudioContentSchema:fe,ToolUseContentSchema:se,EmbeddedResourceSchema:Oe,ResourceLinkSchema:mt,ContentBlockSchema:E,PromptMessageSchema:M,ToolAnnotationsSchema:D,ToolListChangedNotificationSchema:oe,ModelHintSchema:ne,ModelPreferencesSchema:pe,ToolChoiceSchema:Ge,BooleanSchemaSchema:et,StringSchemaSchema:ct,NumberSchemaSchema:Xe,UntitledSingleSelectEnumSchemaSchema:Ue,TitledSingleSelectEnumSchemaSchema:Et,LegacyTitledEnumSchemaSchema:rt,SingleSelectEnumSchemaSchema:Xt,UntitledMultiSelectEnumSchemaSchema:Nt,TitledMultiSelectEnumSchemaSchema:Qt,MultiSelectEnumSchemaSchema:mr,EnumSchemaSchema:fr,PrimitiveSchemaDefinitionSchema:Ur,ElicitRequestFormParamsSchema:Fr,ResourceTemplateReferenceSchema:Vr,PromptReferenceSchema:Jr,RootSchema:fn,ClientCapabilities2026Schema:hn,ServerCapabilities2026Schema:fo,RequestMetaEnvelopeSchema:ho,ToolSchema:Hr,ToolResultContentSchema:gn,SamplingMessageContentBlockSchema:go,SamplingMessageSchema:Br,ResultTypeSchema:_o,ResultMetaSchema:vo,ResultSchema:_n,PaginatedResultSchema:si,CallToolResultSchema:So,ListToolsResultSchema:vn,ListPromptsResultSchema:yn,GetPromptResultSchema:Sn,ListResourcesResultSchema:bn,ListResourceTemplatesResultSchema:zn,ReadResourceResultSchema:$n,CompleteResultSchema:wn,CacheableResultSchema:ii,DiscoverResultSchema:Rn,CreateMessageRequestParamsSchema:gr,CreateMessageRequestSchema:Pn,ListRootsRequestSchema:En,CreateMessageResultSchema:kn,ListRootsResultSchema:xn,ElicitResultSchema:Tn,ElicitRequestURLParamsSchema:In,ElicitRequestParamsSchema:On,ElicitRequestSchema:Cn,InputRequestSchema:Nn,InputResponseSchema:jn,InputRequestsSchema:An,InputResponsesSchema:Mn,InputRequiredResultSchema:Kr,InputResponseRequestParamsSchema:ai,CallToolRequestSchema:ui,ListToolsRequestSchema:li,ListPromptsRequestSchema:di,GetPromptRequestSchema:pi,ListResourcesRequestSchema:mi,ListResourceTemplatesRequestSchema:fi,ReadResourceRequestSchema:hi,CompleteRequestSchema:gi,DiscoverRequestSchema:_i,SubscriptionFilterSchema:bo,SubscriptionsListenRequestSchema:vi,SubscriptionsListenResultMetaSchema:yi,SubscriptionsListenResultSchema:Si,dispatchRequestSchemas:_r,dispatchResultSchemas:bi,NotificationMetaSchema:Wr,SubscriptionsAcknowledgedNotificationSchema:zo,CancelledNotificationParamsSchema:$o,CancelledNotificationSchema:wo,notificationSchemas2026:Gu,JSONRPCResultResponseSchema:_t(_n),CallToolResultResponseSchema:_t(le([So,Kr])),ListToolsResultResponseSchema:_t(vn),ListPromptsResultResponseSchema:_t(yn),GetPromptResultResponseSchema:_t(le([Sn,Kr])),ListResourcesResultResponseSchema:_t(bn),ListResourceTemplatesResultResponseSchema:_t(zn),ReadResourceResultResponseSchema:_t(le([$n,Kr])),CompleteResultResponseSchema:_t(wn),DiscoverResultResponseSchema:_t(Rn)}}var ok;function uo(){return ok??=rk()}var nk=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function sk(e){return nk.includes(e)}var sn=Symbol("modelcontextprotocol.resultCacheHintFallback");function Ru(e,t){if(t===void 0)return e;let r=e[sn];if(r===void 0)return{...e,[sn]:t};let o={},n=r.ttlMs??t.ttlMs;n!==void 0&&(o.ttlMs=n);let s=r.cacheScope??t.cacheScope;return s!==void 0&&(o.cacheScope=s),{...e,[sn]:o}}function ik(e){return e[sn]}function lm(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function dm(e){return e==="public"||e==="private"}function pm(e,t){if(e.ttlMs!==void 0&&!lm(e.ttlMs))throw new RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!dm(e.cacheScope))throw new RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var V=function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e}({}),Q=class Yz extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return cn(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return cn(this,t)}constructor(t,r,o){super(r),this.code=t,this.data=o,this.name="ProtocolError",sm(this,new.target)}static fromError(t,r,o){if(t===V.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Xz(n.elicitations,r)}if(t===V.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new po({supported:n.supported,requested:n.requested},r)}if(t===V.InvalidParams||t===V.ResourceNotFound){let n=o;if(typeof n?.uri=="string"&&(t===V.ResourceNotFound||Object.keys(n).length===1))return new Pu(n.uri,r)}if(t===V.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new Xs({requiredCapabilities:n.requiredCapabilities},r)}return new Yz(t,r,o)}},Pu=class extends Q{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(V.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Xz=class extends Q{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(V.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},po=class extends Q{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(V.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Xs=class extends Q{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(V.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},ak=0,ck="private",uk=["tools/call","prompts/get","resources/read"];function lk(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete"||uk.includes(e))return t;throw new Q(V.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function dk(e,t){let r=ik(t);if(t.resultType!=="complete"||!sk(e))return r===void 0?t:gk(t);let o=t,n=lm(o.ttlMs)?o.ttlMs:fk(r),s=dm(o.cacheScope)?o.cacheScope:hk(r),i={...o,ttlMs:n,cacheScope:s};return delete i[sn],i}function pk(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function mk(e,t){if(t===void 0)return e;let r=e._meta;return r===void 0?{...e,_meta:{[Lt]:t}}:!pk(r)||r[Lt]!==void 0?e:{...e,_meta:{...r,[Lt]:t}}}function fk(e){return e!==void 0&&lm(e.ttlMs)?e.ttlMs:ak}function hk(e){return e!==void 0&&dm(e.cacheScope)?e.cacheScope:ck}function gk(e){let t={...e};return delete t[sn],t}var _k=["elicitation/create","sampling/createMessage","roots/list"],bu;function Qz(){if(bu)return bu;let e=uo();return bu={request:{"elicitation/create":j({method:J("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":j({method:J("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":j({method:J("roots/list"),params:ze({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},bu}function e$(e){return _k.includes(e)}function Yp(e){return e$(e)?Qz().request[e]:void 0}function vk(e){return e$(e)?Qz().response[e]:void 0}var mm={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},t$={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function r$(e){return Object.prototype.hasOwnProperty.call(mm,e)}function o$(e){return Object.prototype.hasOwnProperty.call(t$,e)}function yk(e){return Object.prototype.hasOwnProperty.call(mm,e)}function Sk(e){return r$(e)?uo().dispatchRequestSchemas[e]:void 0}function bk(e){return yk(e)?uo().dispatchResultSchemas[e]:void 0}function zk(e){return o$(e)?uo().notificationSchemas2026[e]:void 0}var Vj=Object.keys(mm),Jj=Object.keys(t$);function Ks(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Hs(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var $k={ok:!1,reason:"not-in-era"},wk=[Tt,Kt];function Rk(e,t){let r=t,o=!1,n=()=>(o||(r={...r},o=!0),r),s=t.tools;e==="tools/list"&&Array.isArray(s)&&s.some(a=>Ks(a)&&"execution"in a)&&(n().tools=s.map(a=>{if(!Ks(a)||!("execution"in a))return a;let c={...a};return delete c.execution,c}));let i=t.capabilities;if(Ks(i)&&"tasks"in i){let a={...i};delete a.tasks,n().capabilities=a}return r}var fm={era:"2026-07-28",hasRequestMethod:r$,hasNotificationMethod:o$,hasInputRequestMethod:e=>Yp(e)!==void 0,validateRequest:(e,t)=>Hs(Sk(e),t),validateResult:(e,t)=>Hs(bk(e),t),validateNotification:(e,t)=>Hs(zk(e),t),validateInputRequest:(e,t)=>Hs(Yp(e),t),validateInputResponse:(e,t)=>Hs(vk(e),t),samplingResultVariant:()=>$k,outboundEnvelope(e){return{[Tt]:e.protocolVersion,[ro]:e.clientInfo,[Kt]:e.clientCapabilities,...e.logLevel!==void 0&&{[Rr]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of wk)o in e||t.push({key:o,problem:"missing"});let r=uo().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let o of r.error.issues){let n=o.path.map(String),s=n.length>0?n.join("."):"_meta";n.length===1&&t.some(i=>i.key===s&&i.problem==="missing")||t.push({key:s,problem:o.message})}return t},projectCallToolResult:e=>Fz(e),inputRequestSchema:Yp,decodeResult(e,t){if(!Ks(t))return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: missing required resultType \u2014 servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof r!="string")return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let i=t.inputRequests,a=Ks(i)?i:{},c=t.requestState;return Object.keys(a).length===0&&typeof c!="string"?{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:a,...typeof c=="string"&&{requestState:c}}}if(r!=="complete")return{kind:"invalid",error:new ue(me.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=Pk(),n=Object.hasOwn(o,e)?o[e]:void 0;if(n!==void 0){let i=n.safeParse(t);if(!i.success)return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: ${i.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,r){return mk(dk(e,lk(e,Rk(e,t))),r)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=uo().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(r=>r.message).join("; ")}`}},zu;function Pk(){if(zu)return zu;let e=uo();return zu={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},zu}var Qs="2026-07-28";function qr(e){return e!==void 0&&dr(e)?fm:um}function xz(e){return e.revision!==void 0?qr(e.revision).era:e.era==="modern"?fm.era:um.era}function Xp(e){return n$.some(t=>t.hasRequestMethod(e))}function Qp(e){return n$.some(t=>t.hasNotificationMethod(e))}var n$=[um,fm];function Tz(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ut(e){if(!Tz(e))return;let t=e._meta;return Tz(t)?t:void 0}function mo(e){let t=Ut(e);return t!==void 0&&Tt in t}function ln(e){let t=Ut(e)?.[Tt];return typeof t=="string"?t:void 0}function lo(e){return qr(Qs).validateEnvelopeMeta(e)}var Ek=qm({AnnotationsSchema:()=>ar,AudioContentSchema:()=>Ho,BaseMetadataSchema:()=>ir,BaseRequestParamsSchema:()=>nt,BlobResourceContentsSchema:()=>vs,BooleanSchemaSchema:()=>$s,CallToolRequestParamsSchema:()=>uc,CallToolRequestSchema:()=>lc,CallToolResultSchema:()=>zs,CancelTaskRequestSchema:()=>$d,CancelTaskResultSchema:()=>wd,CancelledNotificationParamsSchema:()=>ma,CancelledNotificationSchema:()=>ds,ClientCapabilitiesSchema:()=>_a,ClientNotificationSchema:()=>Pd,ClientRequestSchema:()=>Rd,ClientResultSchema:()=>Ed,ClientTasksCapabilitySchema:()=>ha,CompatibilityCallToolResultSchema:()=>pd,CompleteRequestParamsSchema:()=>Mc,CompleteRequestSchema:()=>qc,CompleteResultSchema:()=>Zc,ContentBlockSchema:()=>Bo,CreateMessageRequestParamsSchema:()=>zc,CreateMessageRequestSchema:()=>$c,CreateMessageResultSchema:()=>wc,CreateMessageResultWithToolsSchema:()=>Rc,CreateTaskResultSchema:()=>hd,CursorSchema:()=>ss,DiscoverRequestSchema:()=>ba,DiscoverResultSchema:()=>za,ElicitRequestFormParamsSchema:()=>Wo,ElicitRequestParamsSchema:()=>Tc,ElicitRequestSchema:()=>Ic,ElicitRequestURLParamsSchema:()=>xc,ElicitResultSchema:()=>Nc,ElicitationCompleteNotificationParamsSchema:()=>Oc,ElicitationCompleteNotificationSchema:()=>Cc,EmbeddedResourceSchema:()=>ec,EmptyResultSchema:()=>ls,EnumSchemaSchema:()=>kc,GetPromptRequestParamsSchema:()=>Ya,GetPromptRequestSchema:()=>Xa,GetPromptResultSchema:()=>oc,GetTaskPayloadRequestSchema:()=>yd,GetTaskPayloadResultSchema:()=>Sd,GetTaskRequestSchema:()=>_d,GetTaskResultSchema:()=>vd,IconSchema:()=>fa,IconsSchema:()=>Er,ImageContentSchema:()=>Jo,ImplementationSchema:()=>Uo,InitializeRequestParamsSchema:()=>va,InitializeRequestSchema:()=>ps,InitializeResultSchema:()=>ya,InitializedNotificationSchema:()=>Sa,JSONArraySchema:()=>ud,JSONObjectSchema:()=>He,JSONRPCErrorResponseSchema:()=>Do,JSONRPCMessageSchema:()=>so,JSONRPCNotificationSchema:()=>us,JSONRPCRequestSchema:()=>cs,JSONRPCResponseSchema:()=>ld,JSONRPCResultResponseSchema:()=>Lo,JSONValueSchema:()=>$r,LegacyTitledEnumSchemaSchema:()=>Ps,ListChangedOptionsBaseSchema:()=>md,ListPromptsRequestSchema:()=>Ga,ListPromptsResultSchema:()=>Wa,ListResourceTemplatesRequestSchema:()=>xa,ListResourceTemplatesResultSchema:()=>Ta,ListResourcesRequestSchema:()=>Ea,ListResourcesResultSchema:()=>ka,ListRootsRequestSchema:()=>Dc,ListRootsResultSchema:()=>Uc,ListTasksRequestSchema:()=>bd,ListTasksResultSchema:()=>zd,ListToolsRequestSchema:()=>ac,ListToolsResultSchema:()=>cc,LoggingLevelSchema:()=>Ir,LoggingMessageNotificationParamsSchema:()=>fc,LoggingMessageNotificationSchema:()=>hc,ModelHintSchema:()=>gc,ModelPreferencesSchema:()=>_c,MultiSelectEnumSchemaSchema:()=>Ec,NotificationSchema:()=>pt,NotificationsParamsSchema:()=>dt,NumberSchemaSchema:()=>Go,PaginatedRequestParamsSchema:()=>Ra,PaginatedRequestSchema:()=>kr,PaginatedResultSchema:()=>xr,PingRequestSchema:()=>fs,PrimitiveSchemaDefinitionSchema:()=>xs,ProgressNotificationParamsSchema:()=>wa,ProgressNotificationSchema:()=>hs,ProgressSchema:()=>$a,ProgressTokenSchema:()=>ns,PromptArgumentSchema:()=>Ba,PromptListChangedNotificationSchema:()=>nc,PromptMessageSchema:()=>rc,PromptReferenceSchema:()=>Ac,PromptSchema:()=>Ka,ReadResourceRequestParamsSchema:()=>Ia,ReadResourceRequestSchema:()=>Oa,ReadResourceResultSchema:()=>Ca,RelatedTaskMetadataSchema:()=>pa,RequestIdSchema:()=>Pr,RequestMetaSchema:()=>is,RequestSchema:()=>Be,ResourceContentsSchema:()=>gs,ResourceLinkSchema:()=>tc,ResourceListChangedNotificationSchema:()=>Na,ResourceRequestParamsSchema:()=>Fo,ResourceSchema:()=>ys,ResourceTemplateReferenceSchema:()=>jc,ResourceTemplateSchema:()=>Pa,ResourceUpdatedNotificationParamsSchema:()=>Ja,ResourceUpdatedNotificationSchema:()=>Ha,ResultMetaObjectSchema:()=>as,ResultSchema:()=>Ke,RoleSchema:()=>Tr,RootSchema:()=>Lc,RootsListChangedNotificationSchema:()=>Fc,SamplingContentSchema:()=>Sc,SamplingMessageContentBlockSchema:()=>eo,SamplingMessageSchema:()=>bc,ServerCapabilitiesSchema:()=>ms,ServerNotificationSchema:()=>xd,ServerRequestSchema:()=>kd,ServerResultSchema:()=>Td,ServerTasksCapabilitySchema:()=>ga,SetLevelRequestParamsSchema:()=>pc,SetLevelRequestSchema:()=>mc,SingleSelectEnumSchemaSchema:()=>Pc,StringSchemaSchema:()=>Ko,SubscribeRequestParamsSchema:()=>ja,SubscribeRequestSchema:()=>Aa,SubscriptionFilterSchema:()=>Ss,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Da,SubscriptionsAcknowledgedNotificationSchema:()=>Ua,SubscriptionsListenRequestParamsSchema:()=>Za,SubscriptionsListenRequestSchema:()=>La,SubscriptionsListenResultMetaSchema:()=>Fa,SubscriptionsListenResultSchema:()=>Va,TaskAugmentedRequestParamsSchema:()=>no,TaskCreationParamsSchema:()=>fd,TaskMetadataSchema:()=>da,TaskSchema:()=>Or,TaskStatusNotificationParamsSchema:()=>Jc,TaskStatusNotificationSchema:()=>gd,TaskStatusSchema:()=>Vc,TextContentSchema:()=>Vo,TextResourceContentsSchema:()=>_s,TitledMultiSelectEnumSchemaSchema:()=>ks,TitledSingleSelectEnumSchemaSchema:()=>Rs,ToolAnnotationsSchema:()=>sc,ToolChoiceSchema:()=>vc,ToolExecutionSchema:()=>ic,ToolListChangedNotificationSchema:()=>dc,ToolResultContentSchema:()=>yc,ToolSchema:()=>bs,ToolUseContentSchema:()=>Qa,UnsubscribeRequestParamsSchema:()=>Ma,UnsubscribeRequestSchema:()=>qa,UntitledMultiSelectEnumSchemaSchema:()=>Es,UntitledSingleSelectEnumSchemaSchema:()=>ws});var tt=e=>cs.safeParse(e).success,Yt=e=>us.safeParse(e).success,Ft=e=>Lo.safeParse(e).success,Vt=e=>Do.safeParse(e).success;var pr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";var hm=e=>ps.safeParse(e).success;function gm(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function _m(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var kk="Mcp-Param-",Iz="x-mcp-header",xk=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Tk=new Set(["string","integer","boolean","number"]);function Eu(e){let t=[],r=new Map,o=(s,i,a)=>{if(s===null||typeof s!="object")return;let c=s;if(Iz in c){if(!a||i.length===0)return`${nn(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let l=c[Iz];if(typeof l!="string"||l.length===0)return`${nn(i)}: x-mcp-header MUST be a non-empty string`;if(!xk.test(l))return`${nn(i)}: x-mcp-header '${l}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let d=typeof c.type=="string"?c.type:void 0;if(d===void 0||!Tk.has(d))return`${nn(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${d??"<none>"}`;let p=l.toLowerCase(),g=r.get(p);if(g!==void 0)return`x-mcp-header '${l}' is not case-insensitively unique (also declared as '${g}')`;r.set(p,l),t.push({path:i,headerName:l,type:d})}let u=c.properties;if(u!==null&&typeof u=="object")for(let[l,d]of Object.entries(u)){let p=o(d,[...i,l],a);if(p!==void 0)return p}for(let l of Ik){let d=c[l];if(d===void 0)continue;let p=Array.isArray(d)?d:d!==null&&typeof d=="object"&&Ok.has(l)?Object.values(d):[d];for(let g of p){let f=o(g,[...i,`<${l}>`],!1);if(f!==void 0)return f}}},n=o(e,[],!0);return n===void 0?{valid:!0,declarations:t}:{valid:!1,reason:n}}var Ik=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],Ok=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function nn(e){return e.length===0?"<root>":e.join(".")}var Ck="=?base64?",Nk="?=",jk=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Ak=/^-?\d+(\.\d+)?$/;function Mk(e){if(typeof e=="string")return e;if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number")return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function qk(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.codePointAt(o);return new TextDecoder("utf-8",{fatal:!0}).decode(r)}function s$(e){if(!(e.startsWith(Ck)&&e.endsWith(Nk)))return e;let t=e.slice(9,e.length-2);if(jk.test(t))try{return qk(t)}catch{return}}function Zk(e,t){let r=e;for(let o of t){if(r===null||typeof r!="object")return;r=r[o]}return r}function i$(e,t,r){for(let o of e){let n=`${kk}${o.headerName}`,s=r.get(n),i=Zk(t,o.path);if(i==null)continue;let a=Mk(i);if(a===void 0)continue;if(s===null)return em("param-header-missing",n,`the body carries ${nn(o.path)}=${JSON.stringify(i)} but the ${n} header is absent`);let c=s$(s);if(c===void 0)return em("param-header-invalid-encoding",n,`the ${n} header carries an invalid Base64 sentinel value`);if(!((o.type==="integer"||o.type==="number")&&Ak.test(c)&&typeof i=="number"?Number(c)===i:c===a))return em("param-header-mismatch",n,`the ${n} header decodes to ${JSON.stringify(c)} but the body carries ${nn(o.path)}=${JSON.stringify(i)}`)}}function em(e,t,r){return{kind:"reject",rung:"param-header-validation",cell:e,httpStatus:400,code:an,message:`Bad Request: the request headers and body disagree: ${r}`,data:{mismatch:{header:t,body:r}},settled:!0}}var an=-32020,Hj=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32e3],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[V.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[an,V.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[V.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope \u2014 and a missing envelope on a request whose protocol-version header names a modern revision \u2014 is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[V.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision\u2019s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[V.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[an],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[V.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced \u2014 pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[an],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],vm={[V.ParseError]:400,[V.InvalidRequest]:400,[V.MethodNotFound]:404,[V.UnsupportedProtocolVersion]:400,[V.MissingRequiredClientCapability]:400,[an]:400};function a$(e,t){return t==="in-band"?e===V.MissingRequiredClientCapability?400:200:vm[e]??400}function Ot(e,t,r,o,n){return{kind:"reject",rung:e,cell:t,httpStatus:r,code:o.code,message:o.message,...o.data!==void 0&&{data:o.data},settled:n}}function Wt(e,t,r,o="era-classification"){return Ot(o,e,400,new Q(an,`Bad Request: the request headers and body disagree: ${r}`,{mismatch:{header:t,body:r}}),!0)}var Oz={"tools/call":"name","prompts/get":"name","resources/read":"uri"};function $u(e){let t=0;for(;t<e.length;){let o=e.codePointAt(t);if(o!==9&&o!==32)break;t+=1}let r=e.length;for(;r>t;){let o=e.codePointAt(r-1);if(o!==9&&o!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}function c$(e,t){if(t.messageKind!=="request")return;let r=t.message.method;if(e.mcpMethodHeader===void 0)return Wt("method-header-missing","(missing)",`the body names method ${r} but the required Mcp-Method header is absent`,"standard-header-validation");let o=Object.hasOwn(Oz,r)?Oz[r]:void 0;if(o===void 0)return;let n=t.message.params?.[o],s=typeof n=="string"?n:void 0;if(e.mcpNameHeader===void 0)return s===void 0?void 0:Wt("name-header-missing","(missing)",`the body carries params.${o}="${s}" but the required Mcp-Name header is absent`,"standard-header-validation");let i=$u(e.mcpNameHeader),a=s$(i);if(a===void 0)return Wt("name-header-invalid-encoding",i,"the Mcp-Name header carries an invalid Base64 sentinel value","standard-header-validation");if(s!==void 0&&a!==s)return Wt("name-header-mismatch",i,`the body carries params.${o}="${s}" but the Mcp-Name header names "${a}"`,"standard-header-validation")}function wu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function u$(e){return e===void 0?{era:"modern"}:{era:dr(e)?"modern":"legacy",revision:e}}function ku(e){if(!mo(e))return!1;let t=ln(e);if(t===void 0||!dr(t))return!1;let r=Ut(e);return r!==void 0&&lo(r).length===0}function Lk(e){if(e.length===0)return Ot("jsonrpc-shape","empty-batch",400,new Q(V.InvalidRequest,"Bad Request: empty JSON-RPC batch"),!0);for(let t of e){if(mo(wu(t)?t.params:void 0))return Ot("jsonrpc-shape","batch-with-modern-element",400,new Q(V.InvalidRequest,"Bad Request: JSON-RPC batches may not contain requests for protocol revision 2026-07-28 or later"),!0);if(!(tt(t)||Yt(t)||Ft(t)||Vt(t)))return Ot("jsonrpc-shape","batch-with-invalid-element",400,new Q(V.InvalidRequest,"Bad Request: JSON-RPC batch contains an invalid message"),!0)}return{kind:"legacy",reason:"batch"}}function Dk(e,t){let r=t.params,o=t.method,n=e.protocolVersionHeader,s=n!==void 0&&dr(n);if(o==="initialize"&&!ku(r)){if(s)return Wt("initialize-with-modern-header",n,"an initialize request (legacy handshake) was sent with a modern MCP-Protocol-Version header");let i=wu(r)&&typeof r.protocolVersion=="string"?r.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...i!==void 0&&{requestedVersion:i}}}if(mo(r)){let i=Ut(r),a=(i===void 0?[]:lo(i))[0];if(a!==void 0)return Ot("envelope","envelope-invalid",400,new Q(V.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${a.key}: ${a.problem}`,{envelope:a}),!0);let c=ln(r);return n!==void 0&&c!==void 0&&n!==c?Wt("header-body-version-mismatch",n,`the body envelope names protocol version ${c} but the MCP-Protocol-Version header names ${n}`):e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o?Wt("method-header-mismatch",e.mcpMethodHeader,`the body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`):{kind:"modern",messageKind:"request",message:t,classification:u$(c)}}if(s){let i=Ut(r),a=lo(i??{}).filter(u=>u.problem==="missing").map(u=>u.key),c=i===void 0?["_meta"]:a.length>0?a:[Tt];return Ot("envelope","modern-header-without-claim",400,new Q(V.InvalidParams,`Invalid params: the MCP-Protocol-Version header names protocol revision ${n}, but the request is missing the required per-request envelope key(s): ${c.join(", ")}`,{envelope:{missing:c}}),!0)}return{kind:"legacy",reason:"no-claim",...n!==void 0&&{requestedVersion:n}}}function Uk(e,t){let r=t.params,o=t.method,n=e.protocolVersionHeader,s=n!==void 0&&dr(n);if(mo(r)){let i=ln(r);if(i===void 0){let c=Ut(r),u=(c===void 0?[]:lo(c)).find(l=>l.key===Tt)??{key:Tt,problem:"expected a protocol version string"};return Ot("envelope","notification-envelope-invalid",400,new Q(V.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${u.key}: ${u.problem}`,{envelope:u}),!0)}if(n!==void 0&&n!==i)return Wt("notification-header-body-version-mismatch",n,`the notification envelope names protocol version ${i} but the MCP-Protocol-Version header names ${n}`);let a=u$(i);return a.era==="modern"&&e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o?Wt("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`):{kind:"modern",messageKind:"notification",message:t,classification:a}}return s?e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o?Wt("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`):{kind:"modern",messageKind:"notification",message:t,classification:{era:"modern",revision:n}}:{kind:"legacy",reason:"notification",...n!==void 0&&{requestedVersion:n}}}function l$(e){if(e={...e,...e.protocolVersionHeader!==void 0&&{protocolVersionHeader:$u(e.protocolVersionHeader)},...e.mcpMethodHeader!==void 0&&{mcpMethodHeader:$u(e.mcpMethodHeader)},...e.mcpNameHeader!==void 0&&{mcpNameHeader:$u(e.mcpNameHeader)}},e.httpMethod.toUpperCase()!=="POST")return{kind:"legacy",reason:"http-method"};let t=e.body;return Array.isArray(t)?Lk(t):Ft(t)||Vt(t)?{kind:"legacy",reason:"response"}:wu(t)&&tt(t)?Dk(e,t):wu(t)&&Yt(t)?Uk(e,t):Ot("jsonrpc-shape","invalid-json-rpc-body",400,new Q(V.InvalidRequest,"Bad Request: the request body is not a valid JSON-RPC message"),!0)}function xu(e,t){switch(e.reason){case"http-method":return Ot("http-method","modern-only-method-not-allowed",405,new Q(-32e3,"Method not allowed."),!0);case"batch":return Ot("jsonrpc-shape","modern-only-batch-not-supported",400,new Q(V.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return Ot("jsonrpc-shape","modern-only-response-post",400,new Q(V.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let r=e.requestedVersion;return Ot("era-classification","modern-only-missing-envelope",400,r===void 0?new Q(V.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...t]}):new po({supported:[...t],requested:r}),!0)}}}function Tu(e,t){return hu(e,t)}function Bs(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function un(e){if(e==null)return!1;let t=typeof e;return t!=="object"&&t!=="function"||!("~standard"in e)?!1:typeof e["~standard"]?.validate=="function"}var Cz=!1,om="draft-2020-12";function Zr(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:om});else if(r.vendor==="zod"){if(!("_zod"in e))throw new Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");Cz||(Cz=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),o=fu(e,{target:om,io:t})}else throw new Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output")return o.type!==void 0?o:d$(o)?{type:"object",...o}:o;if(o.type!==void 0&&o.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}function d$(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let r=e[t];if(Array.isArray(r)&&r.length>0)return r.every(o=>o!==null&&typeof o=="object"&&(o.type==="object"||d$(o)))}return!1}function Fk(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function co(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(o=>Fk(o)).join(", ")}:{success:!0,data:r.value}}function Vk(e){let t=fu(e,{target:om,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var Jk=/\\\.\\d\{(\d+)\}/;function Hk(e){let t=Jk.exec(e),r=[void 0,-1,0];return t&&r.push(Number(t[1])),[!1,!0].flatMap(o=>[!1,!0].flatMap(n=>r.map(s=>Mr.datetime({local:o,offset:n,precision:s}))))}function Bk(e,t){let r;switch(e){case"email":r=[fz()];break;case"uri":r=[gz()];break;case"date":r=[Mr.date()];break;case"date-time":r=Hk(t);break}return new Set(r.map(o=>Vk(o)).filter(o=>o!==void 0))}function Kk(e,t,r){return r!=="zod"?!0:Bk(e,t).has(t)}function p$(e){let t=Zr(e,"input"),r=t.properties||{},o=t.required||[];return Object.entries(r).map(([n,s])=>({name:n,description:s?.description,required:o.includes(n)}))}function Ws(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Gk(e){try{return Zr(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new Q(V.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var Wk=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function ym(e){return Wk.has(e)||e.startsWith("x-")}var Yk=new Set(["$schema",...Object.keys(Wo.shape.requestedSchema.shape)]),Nz={string:Bs([Ko,ws,Rs,Ps]),number:Bs([Go]),integer:Bs([Go]),boolean:Bs([$s]),array:Bs([Es,ks])},Xk=new Set(Ko.shape.format.unwrap().options);function Qk(e,t,r,o){if(!Ws(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(Nz,e.type)?Nz[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,a]of Object.entries(e))n.has(i)||ym(i)?s[i]=a:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?Xk.has(e.format)?(typeof a!="string"||!Kk(e.format,a,r))&&o.push(`${t}.${i}`):s[i]=a:o.push(`${t}.${i}`);return s}function ex(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))n==="properties"&&Ws(s)?r[n]=Object.fromEntries(Object.entries(s).map(([i,a])=>[i,Qk(a,`properties.${i}`,t,o)])):Yk.has(n)?r[n]=s:ym(n)||o.push(n);if(o.length>0)throw new Q(V.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function tx(e,t){if(!Ws(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!Tu(xs,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function nm(e,t,r=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((o,n)=>nm(o,t[n],`${r}[${n}]`)):!Ws(e)||!Ws(t)?[]:Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;return Object.prototype.hasOwnProperty.call(t,o)?nm(n,t[o],s):ym(o)?[]:[s]})}function rx(e){if(!un(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=ex(Gk(e.requestedSchema),t),o=Tu(Wo.shape.requestedSchema,r);if(!o.success)throw new Q(V.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${tx(r,o.error.message)}`);let n=nm(r,o.data);if(n.length>0)throw new Q(V.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(o.data.required??[]).filter(i=>!Object.prototype.hasOwnProperty.call(o.data.properties,i));if(s.length>0)throw new Q(V.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function ox(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState=="string";if(!t&&!r)throw new TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}var nx=Object.assign(ox,{elicit(e){try{return{method:"elicitation/create",params:rx(e)}}catch(t){throw t instanceof Q?new TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var m$=250;function f$(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function h$(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof ue?t.reason:new ue(me.RequestTimeout,String(t.reason)));return}let n=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(n),o(t?.reason instanceof ue?t.reason:new ue(me.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function g$(e){let t=new AbortController,r=()=>t.abort(e?.reason);return e?.addEventListener("abort",r,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:o=>t.abort(o),dispose:()=>e?.removeEventListener("abort",r)}}var sx=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],ix={IdJagTokenExchangeResponseSchema:Nd,OAuthClientInformationFullSchema:Ad,OAuthClientInformationSchema:Gc,OAuthClientMetadataSchema:Kc,OAuthClientRegistrationErrorSchema:Md,OAuthErrorResponseSchema:jd,OAuthMetadataSchema:Hc,OAuthProtectedResourceMetadataSchema:Id,OAuthTokenRevocationRequestSchema:qd,OAuthTokensSchema:Cd,OpenIdProviderDiscoveryMetadataSchema:Od,OpenIdProviderMetadataSchema:Bc},_$={},v$={};function y$(e,t){let r=e.slice(0,-6);_$[r]=t,v$[r]=o=>t.safeParse(o).success}for(let e of sx)y$(e,Ek[e]);for(let[e,t]of Object.entries(ix))y$(e,t);var ax=Object.freeze(_$),cx=Object.freeze(v$);function ux(e){switch(e){case"initialize":case"notifications/initialized":return qr(void 0);case"server/discover":return qr(Qs);default:return}}var S$=6e4,lx=[Tt,ro,Kt,Rr],dx=["inputResponses","requestState"];function jz(e,t){let r=e.params;if(!Gs(r))return{message:e,lifted:{}};let o=r._meta,n=Gs(o)?lx.filter(c=>c in o):[],s=t==="request"?dx.filter(c=>c in r):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},a={...r};if(n.length>0&&Gs(o)){let c={},u={...o};for(let l of n)c[l]=o[l],delete u[l];i.envelope=c,Object.keys(u).length>0?a._meta=u:delete a._meta}for(let c of s)c==="inputResponses"&&(i.inputResponses=a[c]),c==="requestState"&&(i.requestState=a[c]),delete a[c];return{message:{...e,params:a},lifted:i}}function Az(e,t){let r=e.validateResult(t,void 0);if(!(!r.ok&&r.reason==="not-in-era"))return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let n=e.validateResult(t,o);return n.ok?{value:n.value}:{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function ei(e){return()=>e}var px=ei(void 0);function Sm(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:ei(t)}}}var b$;function Iu(e,t){b$(e,t)}var bm=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{b$=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??os,this.setNotificationHandler("notifications/cancelled",t=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",t=>{this._onprogress(t)}),this.setRequestHandler("ping",t=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new ue(me.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ue(me.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let r=this.transport?.onerror;this._transport.onerror=n=>{r?.(n),this._onerror(n)};let o=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{o?.(n,s),Ft(n)||Vt(n)?this._onresponse(n):tt(n)?this._onrequest(n,s):Yt(n)?this._onnotification(n,s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new ue(me.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let o of e.values())o(r);for(let o of t.values())o.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=jz(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=xz(t.classification);if(i!==o.era){this._onerror(new Error(`Era mismatch on inbound notification '${r.method}': classified as ${i} but this instance serves ${o.era}`));return}}if(Qp(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;n===void 0&&s===void 0||Promise.resolve().then(()=>n===void 0?s(r):n(r,o)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,t){let{message:r,lifted:o}=jz(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(new Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,i=(_,m,h)=>{let z={jsonrpc:"2.0",id:r.id,error:{code:_,message:m,...h!==void 0&&{data:h}}};s?.send(z).catch(v=>this._onerror(new Error(`Failed to send an error response: ${v}`)))};if(t?.classification!==void 0){let _=xz(t.classification);if(_!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${r.method}': classified as ${_} but this instance serves ${n.era}`));let m=t.classification.revision??_;i(V.UnsupportedProtocolVersion,`Unsupported protocol version: ${m}`,{supported:this._supportedProtocolVersions,requested:m});return}}if(Xp(r.method)&&!n.hasRequestMethod(r.method)){i(V.MethodNotFound,"Method not found");return}let a=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(a===void 0){i(V.MethodNotFound,"Method not found");return}let c=n.checkInboundEnvelope(o);if(c!==void 0){i(V.InvalidParams,c);return}let u=(_,m)=>this._notificationViaCodec(this._resolveOutboundCodec(_.method),_,{...m,relatedRequestId:r.id}),l=(_,m,h)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(_.method),_,m,{...h,relatedRequestId:r.id}),d=new AbortController;this._requestHandlerAbortControllers.set(r.id,d);let p=o.inputResponses===void 0?void 0:mx(o.inputResponses),g={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...p!==void 0&&{inputResponses:p.accepted},...p!==void 0&&p.droppedKeys.length>0&&{droppedInputResponseKeys:p.droppedKeys},requestState:o.requestState===void 0?px:ei(o.requestState),signal:d.signal,send:(_,m,h)=>{let z=this._resolveOutboundCodec(_.method);if(this._assertOutboundRequestInEra(z,_.method),un(m))return l(_,m,h);let v=Az(z,_.method);if(v===void 0)throw new TypeError(`'${_.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return l(_,v,m)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},f=this.buildContext(g,t);Promise.resolve().then(()=>a(r,f)).then(async _=>{if(d.signal.aborted)return;let m;try{m=n.encodeResult(r.method,_,this._outboundServerInfo())}catch(z){this._onerror(new Error(`Failed to encode result for ${r.method}: ${z}`)),i(V.InternalError,"Internal error");return}let h={result:m,jsonrpc:"2.0",id:r.id};await s?.send(h)},async _=>{if(d.signal.aborted)return;let m=Number.isSafeInteger(_.code)?_.code:V.InternalError,h={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(m),message:_.message??"Internal error",..._.data!==void 0&&{data:_.data}}};await s?.send(h)}).catch(_=>this._onerror(new Error(`Failed to send response: ${_}`))).finally(()=>{this._requestHandlerAbortControllers.get(r.id)===d&&this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,o=Number(t),n=this._progressHandlers.get(o);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(o),i=this._timeoutInfo.get(o);if(i&&s&&i.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(a){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(a);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Ft(e)?r(e):r(Q.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let o=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(o,e.method),un(t))return this._requestWithSchemaViaCodec(o,e,t,r);let n=Az(o,e.method);if(n===void 0)throw new TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(o,e,n,t)}_negotiatedWireCodec(){return qr(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=ux(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Xp(t)&&!e.hasRequestMethod(t))throw new ue(me.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:a}=o??{},c=Date.now(),u,l;return new Promise((d,p)=>{let g=b=>{p(b)};if(!this._transport){g(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(b){g(b);return}if(o?.signal?.aborted){let b=o.signal.reason;throw b instanceof ue?b:new ue(me.RequestTimeout,String(b))}let f=e.era===Qs&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,_=this._requestMessageId++;l=_;let m={...t,jsonrpc:"2.0",id:_};o?.onprogress&&(this._progressHandlers.set(_,o.onprogress),m.params={...t.params,_meta:{...t.params?._meta,progressToken:_}});let h=this._envelopeOutbound(m),z=!1,v=b=>{z||(this._progressHandlers.delete(_),f===void 0?this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:_,reason:String(b)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(y=>this._onerror(new Error(`Failed to send cancellation: ${y}`))):f.abort(),p(b instanceof ue?b:new ue(me.RequestTimeout,String(b))))};this._responseHandlers.set(_,b=>{if(o?.signal?.aborted)return;if(z=!0,b instanceof Error)return p(b);let y;try{y=e.decodeResult(t.method,b.result)}catch(T){return p(T instanceof Error?T:new Error(String(T)))}if(y.kind==="invalid")return p(y.error);if(y.kind==="input_required"){if(o?.allowInputRequired===!0)return d(fx(y));let T={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:c,retry:(C,O)=>this._requestWithSchemaViaCodec(e,C===void 0?{method:t.method}:{method:t.method,params:C},r,O)};return d(this._resolveNonCompleteResult(y,T))}let $=y.result;co(r,$).then(T=>{T.success?d(T.data):p(new ue(me.InvalidResult,`Invalid result for ${t.method}: ${T.error}`))},p)}),u=()=>v(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let S=o?.timeout??S$,R=()=>v(new ue(me.RequestTimeout,"Request timed out",{timeout:S}));this._setupTimeout(_,S,o?.maxTotalTimeout,R,o?.resetTimeoutOnProgress??!1),this._transport.send(h,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:a,requestSignal:f?.signal}).catch(b=>{this._progressHandlers.delete(_),p(b)})}).finally(()=>{u&&o?.signal?.removeEventListener("abort",u),l!==void 0&&(this._responseHandlers.delete(l),this._cleanupTimeout(l))})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new ue(me.NotConnected,"Not connected");if(Qp(t.method)&&!e.hasNotificationMethod(t.method))throw new ue(me.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(o,r).catch(n=>this._onerror(n))});return}await this._transport.send(o,r)}setRequestHandler(e,t,r){this.assertRequestHandlerCapability(e);let o;if(typeof t=="function"){if(!Xp(e))throw new TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,s)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason==="not-in-era"&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason==="not-in-era"?new Q(V.InternalError,`No wire schema for ${e} in the resolved era`):new Error(a.message);return Promise.resolve(t(a.value,s))}}else if(r)o=async(n,s)=>{let i=await co(t.params,{...n.params});if(!i.success)throw new Q(V.InvalidParams,`Invalid params for ${e}: ${i.error}`);return r(i.data,s)};else throw new TypeError("setRequestHandler: handler is required");this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if(typeof t=="function"){if(!Qp(e))throw new TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(o,n)=>{let s=n.validateNotification(e,o);if(!s.ok)throw s.reason==="not-in-era"?new Q(V.InternalError,`No wire schema for ${e} in the resolved era`):new Error(s.message);return Promise.resolve(t(s.value))});return}if(!r)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async o=>{let n=await co(t.params,{...o.params});if(!n.success)throw new Q(V.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Gs(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function zm(e,t){let r={...e};for(let o in t){let n=o,s=t[n];if(s===void 0)continue;let i=r[n];r[n]=Gs(i)&&Gs(s)?{...i,...s}:s}return r}function Mz(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mx(e){let t={},r=[];if(!Mz(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!Mz(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function fx(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}var hx=U(e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(a){if(!a)throw new TypeError("argument string is required");var c=typeof a=="object"?s(a):a;if(typeof c!="string")throw new TypeError("argument string is required to be a string");var u=c.indexOf(";"),l=u!==-1?c.slice(0,u).trim():c.trim();if(!o.test(l))throw new TypeError("invalid media type");var d=new i(l.toLowerCase());if(u!==-1){var p,g,f;for(t.lastIndex=u;g=t.exec(c);){if(g.index!==u)throw new TypeError("invalid parameter format");u+=g[0].length,p=g[1].toLowerCase(),f=g[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf("\\")!==-1&&(f=f.replace(r,"$1"))),d.parameters[p]=f}if(u!==c.length)throw new TypeError("invalid parameter format")}return d}function s(a){var c;if(typeof a.getHeader=="function"?c=a.getHeader("content-type"):typeof a.headers=="object"&&(c=a.headers&&a.headers["content-type"]),typeof c!="string")throw new TypeError("content-type header is missing from object");return c}function i(a){this.parameters=Object.create(null),this.type=a}}),gx=wi(hx(),1);function $m(e){if(e)try{return gx.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();return t===""||e.slice(t.length).includes(",")?void 0:t}}function wm(e){return e==="application/json"?!0:$m(e)==="application/json"}var z$=10*1024*1024,Rm=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??z$}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){for(;this._buffer;){let e=this._buffer.indexOf(`
121
+ `);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return $$(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};function $$(e){return so.parse(JSON.parse(e))}function Pm(e){return JSON.stringify(e)+`
122
+ `}var _x=/^[A-Za-z0-9._-]{1,128}$/;function vx(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!_x.test(e)){let r=[...e].filter(o=>!/[A-Za-z0-9._-]/.test(o)).filter((o,n,s)=>s.indexOf(o)===n);return t.push(`Tool name contains invalid characters: ${r.map(o=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function yx(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function Em(e){let t=vx(e);return yx(e,t.warnings),t.isValid}function Sx(e){return typeof e=="object"&&e!==null&&"_zod"in e}function bx(e){return typeof e=="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName=="string"}function zx(e){if(typeof e!="object"||e===null||un(e))return!1;let t=Object.getPrototypeOf(e);return t!==Object.prototype&&t!==null?!1:Object.values(e).every(r=>Sx(r))}function Ou(e){if(e!==void 0){if(zx(e))return j(e);if(typeof e=="object"&&e!==null&&!un(e)&&Object.values(e).some(t=>bx(t)))throw new TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!un(e))throw new TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return e}}var Nu=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(h){if(super(),!e.IDENTIFIER.test(h))throw new Error("CodeGen: name must be a valid identifier");this.str=h}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(h){super(),this._items=typeof h=="string"?[h]:h}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let h=this._items[0];return h===""||h==='""'}get str(){var h;return(h=this._str)!==null&&h!==void 0?h:this._str=this._items.reduce((z,v)=>`${z}${v}`,"")}get names(){var h;return(h=this._names)!==null&&h!==void 0?h:this._names=this._items.reduce((z,v)=>(v instanceof r&&(z[v.str]=(z[v.str]||0)+1),z),{})}};e._Code=o,e.nil=new o("");function n(h,...z){let v=[h[0]],S=0;for(;S<z.length;)a(v,z[S]),v.push(h[++S]);return new o(v)}e._=n;let s=new o("+");function i(h,...z){let v=[g(h[0])],S=0;for(;S<z.length;)v.push(s),a(v,z[S]),v.push(s,g(h[++S]));return c(v),new o(v)}e.str=i;function a(h,z){z instanceof o?h.push(...z._items):z instanceof r?h.push(z):h.push(d(z))}e.addCodeArg=a;function c(h){let z=1;for(;z<h.length-1;){if(h[z]===s){let v=u(h[z-1],h[z+1]);if(v!==void 0){h.splice(z-1,3,v);continue}h[z++]="+"}z++}}function u(h,z){if(z==='""')return h;if(h==='""')return z;if(typeof h=="string")return z instanceof r||h[h.length-1]!=='"'?void 0:typeof z!="string"?`${h.slice(0,-1)}${z}"`:z[0]==='"'?h.slice(0,-1)+z.slice(1):void 0;if(typeof z=="string"&&z[0]==='"'&&!(h instanceof r))return`"${h}${z.slice(1)}`}function l(h,z){return z.emptyStr()?h:h.emptyStr()?z:i`${h}${z}`}e.strConcat=l;function d(h){return typeof h=="number"||typeof h=="boolean"||h===null?h:g(Array.isArray(h)?h.join(","):h)}function p(h){return new o(g(h))}e.stringify=p;function g(h){return JSON.stringify(h).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function f(h){return typeof h=="string"&&e.IDENTIFIER.test(h)?new o(`.${h}`):n`[${h}]`}e.getProperty=f;function _(h){if(typeof h=="string"&&e.IDENTIFIER.test(h))return new o(`${h}`);throw new Error(`CodeGen: invalid export name: ${h}, use explicit $id name mapping`)}e.getEsmExportName=_;function m(h){return new o(h.toString())}e.regexpCode=m}),w$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=Nu();var r=class extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value}},o;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var n=class{constructor({prefixes:c,parent:u}={}){this._names={},this._prefixes=c,this._parent=u}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){let u=this._names[c]||this._nameGroup(c);return`${c}${u.index++}`}_nameGroup(c){var u,l;if(!((l=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||l===void 0)&&l.has(c)||this._prefixes&&!this._prefixes.has(c))throw new Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}};e.Scope=n;var s=class extends t.Name{constructor(c,u){super(u),this.prefix=c}setValue(c,{property:u,itemIndex:l}){this.value=c,this.scopePath=(0,t._)`.${new t.Name(u)}[${l}]`}};e.ValueScopeName=s;let i=(0,t._)`\n`;var a=class extends n{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?i:t.nil}}get(){return this._scope}name(c){return new s(c,this._newName(c))}value(c,u){var l;if(u.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let d=this.toName(c),{prefix:p}=d,g=(l=u.key)!==null&&l!==void 0?l:u.ref,f=this._values[p];if(f){let h=f.get(g);if(h)return h}else f=this._values[p]=new Map;f.set(g,d);let _=this._scope[p]||(this._scope[p]=[]),m=_.length;return _[m]=u.ref,d.setValue(u,{property:p,itemIndex:m}),d}getValue(c,u){let l=this._values[c];if(l)return l.get(u)}scopeRefs(c,u=this._values){return this._reduceValues(u,l=>{if(l.scopePath===void 0)throw new Error(`CodeGen: name "${l}" has no value`);return(0,t._)`${c}${l.scopePath}`})}scopeCode(c=this._values,u,l){return this._reduceValues(c,d=>{if(d.value===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return d.value.code},u,l)}_reduceValues(c,u,l={},d){let p=t.nil;for(let g in c){let f=c[g];if(!f)continue;let _=l[g]=l[g]||new Map;f.forEach(m=>{if(_.has(m))return;_.set(m,o.Started);let h=u(m);if(h){let z=this.opts.es5?e.varKinds.var:e.varKinds.const;p=(0,t._)`${p}${z} ${m} = ${h};${this.opts._n}`}else if(h=d?.(m))p=(0,t._)`${p}${h}${this.opts._n}`;else throw new r(m);_.set(m,o.Completed)})}return p}};e.ValueScope=a}),de=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=Nu(),r=w$();var o=Nu();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var n=w$();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var s=class{optimizeNodes(){return this}optimizeNames(w,x){return this}},i=class extends s{constructor(w,x,N){super(),this.varKind=w,this.name=x,this.rhs=N}render({es5:w,_n:x}){let N=w?r.varKinds.var:this.varKind,B=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${B};`+x}optimizeNames(w,x){if(w[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,w,x)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},a=class extends s{constructor(w,x,N){super(),this.lhs=w,this.rhs=x,this.sideEffects=N}render({_n:w}){return`${this.lhs} = ${this.rhs};`+w}optimizeNames(w,x){if(!(this.lhs instanceof t.Name&&!w[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,w,x),this}get names(){return H(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends a{constructor(w,x,N,B){super(w,N,B),this.op=x}render({_n:w}){return`${this.lhs} ${this.op}= ${this.rhs};`+w}},u=class extends s{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`${this.label}:`+w}},l=class extends s{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`break${this.label?` ${this.label}`:""};`+w}},d=class extends s{constructor(w){super(),this.error=w}render({_n:w}){return`throw ${this.error};`+w}get names(){return this.error.names}},p=class extends s{constructor(w){super(),this.code=w}render({_n:w}){return`${this.code};`+w}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(w,x){return this.code=G(this.code,w,x),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},g=class extends s{constructor(w=[]){super(),this.nodes=w}render(w){return this.nodes.reduce((x,N)=>x+N.render(w),"")}optimizeNodes(){let{nodes:w}=this,x=w.length;for(;x--;){let N=w[x].optimizeNodes();Array.isArray(N)?w.splice(x,1,...N):N?w[x]=N:w.splice(x,1)}return w.length>0?this:void 0}optimizeNames(w,x){let{nodes:N}=this,B=N.length;for(;B--;){let te=N[B];te.optimizeNames(w,x)||(he(w,te.names),N.splice(B,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((w,x)=>L(w,x.names),{})}},f=class extends g{render(w){return"{"+w._n+super.render(w)+"}"+w._n}},_=class extends g{},m=class extends f{};m.kind="else";var h=class Cu extends f{constructor(x,N){super(N),this.condition=x}render(x){let N=`if(${this.condition})`+super.render(x);return this.else&&(N+="else "+this.else.render(x)),N}optimizeNodes(){super.optimizeNodes();let x=this.condition;if(x===!0)return this.nodes;let N=this.else;if(N){let B=N.optimizeNodes();N=this.else=Array.isArray(B)?new m(B):B}if(N)return x===!1?N instanceof Cu?N:N.nodes:this.nodes.length?this:new Cu(qe(x),N instanceof Cu?[N]:N.nodes);if(!(x===!1||!this.nodes.length))return this}optimizeNames(x,N){var B;if(this.else=(B=this.else)===null||B===void 0?void 0:B.optimizeNames(x,N),!!(super.optimizeNames(x,N)||this.else))return this.condition=G(this.condition,x,N),this}get names(){let x=super.names;return H(x,this.condition),this.else&&L(x,this.else.names),x}};h.kind="if";var z=class extends f{};z.kind="for";var v=class extends z{constructor(w){super(),this.iteration=w}render(w){return`for(${this.iteration})`+super.render(w)}optimizeNames(w,x){if(super.optimizeNames(w,x))return this.iteration=G(this.iteration,w,x),this}get names(){return L(super.names,this.iteration.names)}},S=class extends z{constructor(w,x,N,B){super(),this.varKind=w,this.name=x,this.from=N,this.to=B}render(w){let x=w.es5?r.varKinds.var:this.varKind,{name:N,from:B,to:te}=this;return`for(${x} ${N}=${B}; ${N}<${te}; ${N}++)`+super.render(w)}get names(){return H(H(super.names,this.from),this.to)}},R=class extends z{constructor(w,x,N,B){super(),this.loop=w,this.varKind=x,this.name=N,this.iterable=B}render(w){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(w)}optimizeNames(w,x){if(super.optimizeNames(w,x))return this.iterable=G(this.iterable,w,x),this}get names(){return L(super.names,this.iterable.names)}},b=class extends f{constructor(w,x,N){super(),this.name=w,this.args=x,this.async=N}render(w){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(w)}};b.kind="func";var y=class extends g{render(w){return"return "+super.render(w)}};y.kind="return";var $=class extends f{render(w){let x="try"+super.render(w);return this.catch&&(x+=this.catch.render(w)),this.finally&&(x+=this.finally.render(w)),x}optimizeNodes(){var w,x;return super.optimizeNodes(),(w=this.catch)===null||w===void 0||w.optimizeNodes(),(x=this.finally)===null||x===void 0||x.optimizeNodes(),this}optimizeNames(w,x){var N,B;return super.optimizeNames(w,x),(N=this.catch)===null||N===void 0||N.optimizeNames(w,x),(B=this.finally)===null||B===void 0||B.optimizeNames(w,x),this}get names(){let w=super.names;return this.catch&&L(w,this.catch.names),this.finally&&L(w,this.finally.names),w}},T=class extends f{constructor(w){super(),this.error=w}render(w){return`catch(${this.error})`+super.render(w)}};T.kind="catch";var C=class extends f{render(w){return"finally"+super.render(w)}};C.kind="finally";var O=class{constructor(w,x={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...x,_n:x.lines?`
123
+ `:""},this._extScope=w,this._scope=new r.Scope({parent:w}),this._nodes=[new _]}toString(){return this._root.render(this.opts)}name(w){return this._scope.name(w)}scopeName(w){return this._extScope.name(w)}scopeValue(w,x){let N=this._extScope.value(w,x);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(w,x){return this._extScope.getValue(w,x)}scopeRefs(w){return this._extScope.scopeRefs(w,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(w,x,N,B){let te=this._scope.toName(x);return N!==void 0&&B&&(this._constants[te.str]=N),this._leafNode(new i(w,te,N)),te}const(w,x,N){return this._def(r.varKinds.const,w,x,N)}let(w,x,N){return this._def(r.varKinds.let,w,x,N)}var(w,x,N){return this._def(r.varKinds.var,w,x,N)}assign(w,x,N){return this._leafNode(new a(w,x,N))}add(w,x){return this._leafNode(new c(w,e.operators.ADD,x))}code(w){return typeof w=="function"?w():w!==t.nil&&this._leafNode(new p(w)),this}object(...w){let x=["{"];for(let[N,B]of w)x.length>1&&x.push(","),x.push(N),(N!==B||this.opts.es5)&&(x.push(":"),(0,t.addCodeArg)(x,B));return x.push("}"),new t._Code(x)}if(w,x,N){if(this._blockNode(new h(w)),x&&N)this.code(x).else().code(N).endIf();else if(x)this.code(x).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(w){return this._elseNode(new h(w))}else(){return this._elseNode(new m)}endIf(){return this._endBlockNode(h,m)}_for(w,x){return this._blockNode(w),x&&this.code(x).endFor(),this}for(w,x){return this._for(new v(w),x)}forRange(w,x,N,B,te=this.opts.es5?r.varKinds.var:r.varKinds.let){let fe=this._scope.toName(w);return this._for(new S(te,fe,x,N),()=>B(fe))}forOf(w,x,N,B=r.varKinds.const){let te=this._scope.toName(w);if(this.opts.es5){let fe=x instanceof t.Name?x:this.var("_arr",x);return this.forRange("_i",0,(0,t._)`${fe}.length`,se=>{this.var(te,(0,t._)`${fe}[${se}]`),N(te)})}return this._for(new R("of",B,te,x),()=>N(te))}forIn(w,x,N,B=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(w,(0,t._)`Object.keys(${x})`,N);let te=this._scope.toName(w);return this._for(new R("in",B,te,x),()=>N(te))}endFor(){return this._endBlockNode(z)}label(w){return this._leafNode(new u(w))}break(w){return this._leafNode(new l(w))}return(w){let x=new y;if(this._blockNode(x),this.code(w),x.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(y)}try(w,x,N){if(!x&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');let B=new $;if(this._blockNode(B),this.code(w),x){let te=this.name("e");this._currNode=B.catch=new T(te),x(te)}return N&&(this._currNode=B.finally=new C,this.code(N)),this._endBlockNode(T,C)}throw(w){return this._leafNode(new d(w))}block(w,x){return this._blockStarts.push(this._nodes.length),w&&this.code(w).endBlock(x),this}endBlock(w){let x=this._blockStarts.pop();if(x===void 0)throw new Error("CodeGen: not in self-balancing block");let N=this._nodes.length-x;if(N<0||w!==void 0&&N!==w)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${w} expected`);return this._nodes.length=x,this}func(w,x=t.nil,N,B){return this._blockNode(new b(w,x,N)),B&&this.code(B).endFunc(),this}endFunc(){return this._endBlockNode(b)}optimize(w=1){for(;w-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(w){return this._currNode.nodes.push(w),this}_blockNode(w){this._currNode.nodes.push(w),this._nodes.push(w)}_endBlockNode(w,x){let N=this._currNode;if(N instanceof w||x&&N instanceof x)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${x?`${w.kind}/${x.kind}`:w.kind}"`)}_elseNode(w){let x=this._currNode;if(!(x instanceof h))throw new Error('CodeGen: "else" without "if"');return this._currNode=x.else=w,this}get _root(){return this._nodes[0]}get _currNode(){let w=this._nodes;return w[w.length-1]}set _currNode(w){let x=this._nodes;x[x.length-1]=w}};e.CodeGen=O;function L(w,x){for(let N in x)w[N]=(w[N]||0)+(x[N]||0);return w}function H(w,x){return x instanceof t._CodeOrName?L(w,x.names):w}function G(w,x,N){if(w instanceof t.Name)return B(w);if(!te(w))return w;return new t._Code(w._items.reduce((fe,se)=>(se instanceof t.Name&&(se=B(se)),se instanceof t._Code?fe.push(...se._items):fe.push(se),fe),[]));function B(fe){let se=N[fe.str];return se===void 0||x[fe.str]!==1?fe:(delete x[fe.str],se)}function te(fe){return fe instanceof t._Code&&fe._items.some(se=>se instanceof t.Name&&x[se.str]===1&&N[se.str]!==void 0)}}function he(w,x){for(let N in x)w[N]=(w[N]||0)-(x[N]||0)}function qe(w){return typeof w=="boolean"||typeof w=="number"||w===null?!w:(0,t._)`!${F(w)}`}e.not=qe;let Ie=A(e.operators.AND);function Ye(...w){return w.reduce(Ie)}e.and=Ye;let ye=A(e.operators.OR);function I(...w){return w.reduce(ye)}e.or=I;function A(w){return(x,N)=>x===t.nil?N:N===t.nil?x:(0,t._)`${F(x)} ${w} ${F(N)}`}function F(w){return w instanceof t.Name?w:(0,t._)`(${w})`}}),be=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let t=de(),r=Nu();function o(b){let y={};for(let $ of b)y[$]=!0;return y}e.toHash=o;function n(b,y){return typeof y=="boolean"?y:Object.keys(y).length===0?!0:(s(b,y),!i(y,b.self.RULES.all))}e.alwaysValidSchema=n;function s(b,y=b.schema){let{opts:$,self:T}=b;if(!$.strictSchema||typeof y=="boolean")return;let C=T.RULES.keywords;for(let O in y)C[O]||R(b,`unknown keyword: "${O}"`)}e.checkUnknownRules=s;function i(b,y){if(typeof b=="boolean")return!b;for(let $ in b)if(y[$])return!0;return!1}e.schemaHasRules=i;function a(b,y){if(typeof b=="boolean")return!b;for(let $ in b)if($!=="$ref"&&y.all[$])return!0;return!1}e.schemaHasRulesButRef=a;function c({topSchemaRef:b,schemaPath:y},$,T,C){if(!C){if(typeof $=="number"||typeof $=="boolean")return $;if(typeof $=="string")return(0,t._)`${$}`}return(0,t._)`${b}${y}${(0,t.getProperty)(T)}`}e.schemaRefOrVal=c;function u(b){return p(decodeURIComponent(b))}e.unescapeFragment=u;function l(b){return encodeURIComponent(d(b))}e.escapeFragment=l;function d(b){return typeof b=="number"?`${b}`:b.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=d;function p(b){return b.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=p;function g(b,y){if(Array.isArray(b))for(let $ of b)y($);else y(b)}e.eachItem=g;function f({mergeNames:b,mergeToName:y,mergeValues:$,resultToName:T}){return(C,O,L,H)=>{let G=L===void 0?O:L instanceof t.Name?(O instanceof t.Name?b(C,O,L):y(C,O,L),L):O instanceof t.Name?(y(C,L,O),O):$(O,L);return H===t.Name&&!(G instanceof t.Name)?T(C,G):G}}e.mergeEvaluated={props:f({mergeNames:(b,y,$)=>b.if((0,t._)`${$} !== true && ${y} !== undefined`,()=>{b.if((0,t._)`${y} === true`,()=>b.assign($,!0),()=>b.assign($,(0,t._)`${$} || {}`).code((0,t._)`Object.assign(${$}, ${y})`))}),mergeToName:(b,y,$)=>b.if((0,t._)`${$} !== true`,()=>{y===!0?b.assign($,!0):(b.assign($,(0,t._)`${$} || {}`),m(b,$,y))}),mergeValues:(b,y)=>b===!0?!0:{...b,...y},resultToName:_}),items:f({mergeNames:(b,y,$)=>b.if((0,t._)`${$} !== true && ${y} !== undefined`,()=>b.assign($,(0,t._)`${y} === true ? true : ${$} > ${y} ? ${$} : ${y}`)),mergeToName:(b,y,$)=>b.if((0,t._)`${$} !== true`,()=>b.assign($,y===!0?!0:(0,t._)`${$} > ${y} ? ${$} : ${y}`)),mergeValues:(b,y)=>b===!0?!0:Math.max(b,y),resultToName:(b,y)=>b.var("items",y)})};function _(b,y){if(y===!0)return b.var("props",!0);let $=b.var("props",(0,t._)`{}`);return y!==void 0&&m(b,$,y),$}e.evaluatedPropsToName=_;function m(b,y,$){Object.keys($).forEach(T=>b.assign((0,t._)`${y}${(0,t.getProperty)(T)}`,!0))}e.setEvaluated=m;let h={};function z(b,y){return b.scopeValue("func",{ref:y,code:h[y.code]||(h[y.code]=new r._Code(y.code))})}e.useFunc=z;var v;(function(b){b[b.Num=0]="Num",b[b.Str=1]="Str"})(v||(e.Type=v={}));function S(b,y,$){if(b instanceof t.Name){let T=y===v.Num;return $?T?(0,t._)`"[" + ${b} + "]"`:(0,t._)`"['" + ${b} + "']"`:T?(0,t._)`"/" + ${b}`:(0,t._)`"/" + ${b}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return $?(0,t.getProperty)(b).toString():"/"+d(b)}e.getErrorPath=S;function R(b,y,$=b.opts.strictSchema){if($){if(y=`strict mode: ${y}`,$===!0)throw new Error(y);b.self.logger.warn(y)}}e.checkStrictMode=R}),Jt=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};e.default=r}),Au=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=de(),r=be(),o=Jt();e.keywordError={message:({keyword:m})=>(0,t.str)`must pass "${m}" keyword validation`},e.keyword$DataError={message:({keyword:m,schemaType:h})=>h?(0,t.str)`"${m}" keyword must be ${h} ($data)`:(0,t.str)`"${m}" keyword is invalid ($data)`};function n(m,h=e.keywordError,z,v){let{it:S}=m,{gen:R,compositeRule:b,allErrors:y}=S,$=d(m,h,z);v??(b||y)?c(R,$):u(S,(0,t._)`[${$}]`)}e.reportError=n;function s(m,h=e.keywordError,z){let{it:v}=m,{gen:S,compositeRule:R,allErrors:b}=v;c(S,d(m,h,z)),R||b||u(v,o.default.vErrors)}e.reportExtraError=s;function i(m,h){m.assign(o.default.errors,h),m.if((0,t._)`${o.default.vErrors} !== null`,()=>m.if(h,()=>m.assign((0,t._)`${o.default.vErrors}.length`,h),()=>m.assign(o.default.vErrors,null)))}e.resetErrorsCount=i;function a({gen:m,keyword:h,schemaValue:z,data:v,errsCount:S,it:R}){if(S===void 0)throw new Error("ajv implementation error");let b=m.name("err");m.forRange("i",S,o.default.errors,y=>{m.const(b,(0,t._)`${o.default.vErrors}[${y}]`),m.if((0,t._)`${b}.instancePath === undefined`,()=>m.assign((0,t._)`${b}.instancePath`,(0,t.strConcat)(o.default.instancePath,R.errorPath))),m.assign((0,t._)`${b}.schemaPath`,(0,t.str)`${R.errSchemaPath}/${h}`),R.opts.verbose&&(m.assign((0,t._)`${b}.schema`,z),m.assign((0,t._)`${b}.data`,v))})}e.extendErrors=a;function c(m,h){let z=m.const("err",h);m.if((0,t._)`${o.default.vErrors} === null`,()=>m.assign(o.default.vErrors,(0,t._)`[${z}]`),(0,t._)`${o.default.vErrors}.push(${z})`),m.code((0,t._)`${o.default.errors}++`)}function u(m,h){let{gen:z,validateName:v,schemaEnv:S}=m;S.$async?z.throw((0,t._)`new ${m.ValidationError}(${h})`):(z.assign((0,t._)`${v}.errors`,h),z.return(!1))}let l={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function d(m,h,z){let{createErrors:v}=m.it;return v===!1?(0,t._)`{}`:p(m,h,z)}function p(m,h,z={}){let{gen:v,it:S}=m,R=[g(S,z),f(m,z)];return _(m,h,R),v.object(...R)}function g({errorPath:m},{instancePath:h}){let z=h?(0,t.str)`${m}${(0,r.getErrorPath)(h,r.Type.Str)}`:m;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,z)]}function f({keyword:m,it:{errSchemaPath:h}},{schemaPath:z,parentSchema:v}){let S=v?h:(0,t.str)`${h}/${m}`;return z&&(S=(0,t.str)`${S}${(0,r.getErrorPath)(z,r.Type.Str)}`),[l.schemaPath,S]}function _(m,{params:h,message:z},v){let{keyword:S,data:R,schemaValue:b,it:y}=m,{opts:$,propertyName:T,topSchemaRef:C,schemaPath:O}=y;v.push([l.keyword,S],[l.params,typeof h=="function"?h(m):h||(0,t._)`{}`]),$.messages&&v.push([l.message,typeof z=="function"?z(m):z]),$.verbose&&v.push([l.schema,b],[l.parentSchema,(0,t._)`${C}${O}`],[o.default.data,R]),T&&v.push([l.propertyName,T])}}),$x=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=Au(),r=de(),o=Jt(),n={message:"boolean schema is false"};function s(c){let{gen:u,schema:l,validateName:d}=c;l===!1?a(c,!1):typeof l=="object"&&l.$async===!0?u.return(o.default.data):(u.assign((0,r._)`${d}.errors`,null),u.return(!0))}e.topBoolOrEmptySchema=s;function i(c,u){let{gen:l,schema:d}=c;d===!1?(l.var(u,!1),a(c)):l.var(u,!0)}e.boolOrEmptySchema=i;function a(c,u){let{gen:l,data:d}=c,p={gen:l,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,t.reportError)(p,n,void 0,u)}}),R$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);function r(n){return typeof n=="string"&&t.has(n)}e.isJSONType=r;function o(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=o}),P$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:s},i){let a=s.RULES.types[i];return a&&a!==!0&&r(n,a)}e.schemaHasRulesForType=t;function r(n,s){return s.rules.some(i=>o(n,i))}e.shouldUseGroup=r;function o(n,s){var i;return n[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some(a=>n[a]!==void 0))}e.shouldUseRule=o}),ju=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let t=R$(),r=P$(),o=Au(),n=de(),s=be();var i;(function(v){v[v.Correct=0]="Correct",v[v.Wrong=1]="Wrong"})(i||(e.DataType=i={}));function a(v){let S=c(v.type);if(S.includes("null")){if(v.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!S.length&&v.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');v.nullable===!0&&S.push("null")}return S}e.getSchemaTypes=a;function c(v){let S=Array.isArray(v)?v:v?[v]:[];if(S.every(t.isJSONType))return S;throw new Error("type must be JSONType or JSONType[]: "+S.join(","))}e.getJSONTypes=c;function u(v,S){let{gen:R,data:b,opts:y}=v,$=d(S,y.coerceTypes),T=S.length>0&&!($.length===0&&S.length===1&&(0,r.schemaHasRulesForType)(v,S[0]));if(T){let C=_(S,b,y.strictNumbers,i.Wrong);R.if(C,()=>{$.length?p(v,S,$):h(v)})}return T}e.coerceAndCheckDataType=u;let l=new Set(["string","number","integer","boolean","null"]);function d(v,S){return S?v.filter(R=>l.has(R)||S==="array"&&R==="array"):[]}function p(v,S,R){let{gen:b,data:y,opts:$}=v,T=b.let("dataType",(0,n._)`typeof ${y}`),C=b.let("coerced",(0,n._)`undefined`);$.coerceTypes==="array"&&b.if((0,n._)`${T} == 'object' && Array.isArray(${y}) && ${y}.length == 1`,()=>b.assign(y,(0,n._)`${y}[0]`).assign(T,(0,n._)`typeof ${y}`).if(_(S,y,$.strictNumbers),()=>b.assign(C,y))),b.if((0,n._)`${C} !== undefined`);for(let L of R)(l.has(L)||L==="array"&&$.coerceTypes==="array")&&O(L);b.else(),h(v),b.endIf(),b.if((0,n._)`${C} !== undefined`,()=>{b.assign(y,C),g(v,C)});function O(L){switch(L){case"string":b.elseIf((0,n._)`${T} == "number" || ${T} == "boolean"`).assign(C,(0,n._)`"" + ${y}`).elseIf((0,n._)`${y} === null`).assign(C,(0,n._)`""`);return;case"number":b.elseIf((0,n._)`${T} == "boolean" || ${y} === null
124
+ || (${T} == "string" && ${y} && ${y} == +${y})`).assign(C,(0,n._)`+${y}`);return;case"integer":b.elseIf((0,n._)`${T} === "boolean" || ${y} === null
125
+ || (${T} === "string" && ${y} && ${y} == +${y} && !(${y} % 1))`).assign(C,(0,n._)`+${y}`);return;case"boolean":b.elseIf((0,n._)`${y} === "false" || ${y} === 0 || ${y} === null`).assign(C,!1).elseIf((0,n._)`${y} === "true" || ${y} === 1`).assign(C,!0);return;case"null":b.elseIf((0,n._)`${y} === "" || ${y} === 0 || ${y} === false`),b.assign(C,null);return;case"array":b.elseIf((0,n._)`${T} === "string" || ${T} === "number"
126
+ || ${T} === "boolean" || ${y} === null`).assign(C,(0,n._)`[${y}]`)}}}function g({gen:v,parentData:S,parentDataProperty:R},b){v.if((0,n._)`${S} !== undefined`,()=>v.assign((0,n._)`${S}[${R}]`,b))}function f(v,S,R,b=i.Correct){let y=b===i.Correct?n.operators.EQ:n.operators.NEQ,$;switch(v){case"null":return(0,n._)`${S} ${y} null`;case"array":$=(0,n._)`Array.isArray(${S})`;break;case"object":$=(0,n._)`${S} && typeof ${S} == "object" && !Array.isArray(${S})`;break;case"integer":$=T((0,n._)`!(${S} % 1) && !isNaN(${S})`);break;case"number":$=T();break;default:return(0,n._)`typeof ${S} ${y} ${v}`}return b===i.Correct?$:(0,n.not)($);function T(C=n.nil){return(0,n.and)((0,n._)`typeof ${S} == "number"`,C,R?(0,n._)`isFinite(${S})`:n.nil)}}e.checkDataType=f;function _(v,S,R,b){if(v.length===1)return f(v[0],S,R,b);let y,$=(0,s.toHash)(v);if($.array&&$.object){let T=(0,n._)`typeof ${S} != "object"`;y=$.null?T:(0,n._)`!${S} || ${T}`,delete $.null,delete $.array,delete $.object}else y=n.nil;$.number&&delete $.integer;for(let T in $)y=(0,n.and)(y,f(T,S,R,b));return y}e.checkDataTypes=_;let m={message:({schema:v})=>`must be ${v}`,params:({schema:v,schemaValue:S})=>typeof v=="string"?(0,n._)`{type: ${v}}`:(0,n._)`{type: ${S}}`};function h(v){let S=z(v);(0,o.reportError)(S,m)}e.reportTypeError=h;function z(v){let{gen:S,data:R,schema:b}=v,y=(0,s.schemaRefOrVal)(v,b,"type");return{gen:S,keyword:"type",data:R,schema:b.type,schemaCode:y,schemaValue:y,parentSchema:b,params:{},it:v}}}),wx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=de(),r=be();function o(s,i){let{properties:a,items:c}=s.schema;if(i==="object"&&a)for(let u in a)n(s,u,a[u].default);else i==="array"&&Array.isArray(c)&&c.forEach((u,l)=>n(s,l,u.default))}e.assignDefaults=o;function n(s,i,a){let{gen:c,compositeRule:u,data:l,opts:d}=s;if(a===void 0)return;let p=(0,t._)`${l}${(0,t.getProperty)(i)}`;if(u){(0,r.checkStrictMode)(s,`default is ignored for: ${p}`);return}let g=(0,t._)`${p} === undefined`;d.useDefaults==="empty"&&(g=(0,t._)`${g} || ${p} === null || ${p} === ""`),c.if(g,(0,t._)`${p} = ${(0,t.stringify)(a)}`)}}),Ht=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=de(),r=be(),o=Jt(),n=be();function s(v,S){let{gen:R,data:b,it:y}=v;R.if(d(R,b,S,y.opts.ownProperties),()=>{v.setParams({missingProperty:(0,t._)`${S}`},!0),v.error()})}e.checkReportMissingProp=s;function i({gen:v,data:S,it:{opts:R}},b,y){return(0,t.or)(...b.map($=>(0,t.and)(d(v,S,$,R.ownProperties),(0,t._)`${y} = ${$}`)))}e.checkMissingProp=i;function a(v,S){v.setParams({missingProperty:S},!0),v.error()}e.reportMissingProp=a;function c(v){return v.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function u(v,S,R){return(0,t._)`${c(v)}.call(${S}, ${R})`}e.isOwnProperty=u;function l(v,S,R,b){let y=(0,t._)`${S}${(0,t.getProperty)(R)} !== undefined`;return b?(0,t._)`${y} && ${u(v,S,R)}`:y}e.propertyInData=l;function d(v,S,R,b){let y=(0,t._)`${S}${(0,t.getProperty)(R)} === undefined`;return b?(0,t.or)(y,(0,t.not)(u(v,S,R))):y}e.noPropertyInData=d;function p(v){return v?Object.keys(v).filter(S=>S!=="__proto__"):[]}e.allSchemaProperties=p;function g(v,S){return p(S).filter(R=>!(0,r.alwaysValidSchema)(v,S[R]))}e.schemaProperties=g;function f({schemaCode:v,data:S,it:{gen:R,topSchemaRef:b,schemaPath:y,errorPath:$},it:T},C,O,L){let H=L?(0,t._)`${v}, ${S}, ${b}${y}`:S,G=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,$)],[o.default.parentData,T.parentData],[o.default.parentDataProperty,T.parentDataProperty],[o.default.rootData,o.default.rootData]];T.opts.dynamicRef&&G.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let he=(0,t._)`${H}, ${R.object(...G)}`;return O!==t.nil?(0,t._)`${C}.call(${O}, ${he})`:(0,t._)`${C}(${he})`}e.callValidateCode=f;let _=(0,t._)`new RegExp`;function m({gen:v,it:{opts:S}},R){let b=S.unicodeRegExp?"u":"",{regExp:y}=S.code,$=y(R,b);return v.scopeValue("pattern",{key:$.toString(),ref:$,code:(0,t._)`${y.code==="new RegExp"?_:(0,n.useFunc)(v,y)}(${R}, ${b})`})}e.usePattern=m;function h(v){let{gen:S,data:R,keyword:b,it:y}=v,$=S.name("valid");if(y.allErrors){let C=S.let("valid",!0);return T(()=>S.assign(C,!1)),C}return S.var($,!0),T(()=>S.break()),$;function T(C){let O=S.const("len",(0,t._)`${R}.length`);S.forRange("i",0,O,L=>{v.subschema({keyword:b,dataProp:L,dataPropType:r.Type.Num},$),S.if((0,t.not)($),C)})}}e.validateArray=h;function z(v){let{gen:S,schema:R,keyword:b,it:y}=v;if(!Array.isArray(R))throw new Error("ajv implementation error");if(R.some(C=>(0,r.alwaysValidSchema)(y,C))&&!y.opts.unevaluated)return;let $=S.let("valid",!1),T=S.name("_valid");S.block(()=>R.forEach((C,O)=>{let L=v.subschema({keyword:b,schemaProp:O,compositeRule:!0},T);S.assign($,(0,t._)`${$} || ${T}`),v.mergeValidEvaluated(L,T)||S.if((0,t.not)($))})),v.result($,()=>v.reset(),()=>v.error(!0))}e.validateUnion=z}),Rx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=de(),r=Jt(),o=Ht(),n=Au();function s(g,f){let{gen:_,keyword:m,schema:h,parentSchema:z,it:v}=g,S=f.macro.call(v.self,h,z,v),R=l(_,m,S);v.opts.validateSchema!==!1&&v.self.validateSchema(S,!0);let b=_.name("valid");g.subschema({schema:S,schemaPath:t.nil,errSchemaPath:`${v.errSchemaPath}/${m}`,topSchemaRef:R,compositeRule:!0},b),g.pass(b,()=>g.error(!0))}e.macroKeywordCode=s;function i(g,f){var _;let{gen:m,keyword:h,schema:z,parentSchema:v,$data:S,it:R}=g;u(R,f);let b=l(m,h,!S&&f.compile?f.compile.call(R.self,z,v,R):f.validate),y=m.let("valid");g.block$data(y,$),g.ok((_=f.valid)!==null&&_!==void 0?_:y);function $(){if(f.errors===!1)O(),f.modifying&&a(g),L(()=>g.error());else{let H=f.async?T():C();f.modifying&&a(g),L(()=>c(g,H))}}function T(){let H=m.let("ruleErrs",null);return m.try(()=>O((0,t._)`await `),G=>m.assign(y,!1).if((0,t._)`${G} instanceof ${R.ValidationError}`,()=>m.assign(H,(0,t._)`${G}.errors`),()=>m.throw(G))),H}function C(){let H=(0,t._)`${b}.errors`;return m.assign(H,null),O(t.nil),H}function O(H=f.async?(0,t._)`await `:t.nil){let G=R.opts.passContext?r.default.this:r.default.self,he=!("compile"in f&&!S||f.schema===!1);m.assign(y,(0,t._)`${H}${(0,o.callValidateCode)(g,b,G,he)}`,f.modifying)}function L(H){var G;m.if((0,t.not)((G=f.valid)!==null&&G!==void 0?G:y),H)}}e.funcKeywordCode=i;function a(g){let{gen:f,data:_,it:m}=g;f.if(m.parentData,()=>f.assign(_,(0,t._)`${m.parentData}[${m.parentDataProperty}]`))}function c(g,f){let{gen:_}=g;_.if((0,t._)`Array.isArray(${f})`,()=>{_.assign(r.default.vErrors,(0,t._)`${r.default.vErrors} === null ? ${f} : ${r.default.vErrors}.concat(${f})`).assign(r.default.errors,(0,t._)`${r.default.vErrors}.length`),(0,n.extendErrors)(g)},()=>g.error())}function u({schemaEnv:g},f){if(f.async&&!g.$async)throw new Error("async keyword in sync schema")}function l(g,f,_){if(_===void 0)throw new Error(`keyword "${f}" failed to compile`);return g.scopeValue("keyword",typeof _=="function"?{ref:_}:{ref:_,code:(0,t.stringify)(_)})}function d(g,f,_=!1){return!f.length||f.some(m=>m==="array"?Array.isArray(g):m==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==m||_&&typeof g>"u")}e.validSchemaType=d;function p({schema:g,opts:f,self:_,errSchemaPath:m},h,z){if(Array.isArray(h.keyword)?!h.keyword.includes(z):h.keyword!==z)throw new Error("ajv implementation error");let v=h.dependencies;if(v?.some(S=>!Object.prototype.hasOwnProperty.call(g,S)))throw new Error(`parent schema must have dependencies of ${z}: ${v.join(",")}`);if(h.validateSchema&&!h.validateSchema(g[z])){let S=`keyword "${z}" value is invalid at path "${m}": `+_.errorsText(h.validateSchema.errors);if(f.validateSchema==="log")_.logger.error(S);else throw new Error(S)}}e.validateKeywordUsage=p}),Px=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=de(),r=be();function o(i,{keyword:a,schemaProp:c,schema:u,schemaPath:l,errSchemaPath:d,topSchemaRef:p}){if(a!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){let g=i.schema[a];return c===void 0?{schema:g,schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${a}`}:{schema:g[c],schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(a)}${(0,t.getProperty)(c)}`,errSchemaPath:`${i.errSchemaPath}/${a}/${(0,r.escapeFragment)(c)}`}}if(u!==void 0){if(l===void 0||d===void 0||p===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:l,topSchemaRef:p,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(i,a,{dataProp:c,dataPropType:u,data:l,dataTypes:d,propertyName:p}){if(l!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:g}=a;if(c!==void 0){let{errorPath:_,dataPathArr:m,opts:h}=a;f(g.let("data",(0,t._)`${a.data}${(0,t.getProperty)(c)}`,!0)),i.errorPath=(0,t.str)`${_}${(0,r.getErrorPath)(c,u,h.jsPropertySyntax)}`,i.parentDataProperty=(0,t._)`${c}`,i.dataPathArr=[...m,i.parentDataProperty]}l!==void 0&&(f(l instanceof t.Name?l:g.let("data",l,!0)),p!==void 0&&(i.propertyName=p)),d&&(i.dataTypes=d);function f(_){i.data=_,i.dataLevel=a.dataLevel+1,i.dataTypes=[],a.definedProperties=new Set,i.parentData=a.data,i.dataNames=[...a.dataNames,_]}}e.extendSubschemaData=n;function s(i,{jtdDiscriminator:a,jtdMetadata:c,compositeRule:u,createErrors:l,allErrors:d}){u!==void 0&&(i.compositeRule=u),l!==void 0&&(i.createErrors=l),d!==void 0&&(i.allErrors=d),i.jtdDiscriminator=a,i.jtdMetadata=c}e.extendSubschemaMode=s}),E$=U((e,t)=>{t.exports=function r(o,n){if(o===n)return!0;if(o&&n&&typeof o=="object"&&typeof n=="object"){if(o.constructor!==n.constructor)return!1;var s,i,a;if(Array.isArray(o)){if(s=o.length,s!=n.length)return!1;for(i=s;i--!==0;)if(!r(o[i],n[i]))return!1;return!0}if(o.constructor===RegExp)return o.source===n.source&&o.flags===n.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===n.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===n.toString();if(a=Object.keys(o),s=a.length,s!==Object.keys(n).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=s;i--!==0;){var c=a[i];if(!r(o[c],n[c]))return!1}return!0}return o!==o&&n!==n}}),Ex=U((e,t)=>{var r=t.exports=function(s,i,a){typeof i=="function"&&(a=i,i={}),a=i.cb||a;var c=typeof a=="function"?a:a.pre||function(){},u=a.post||function(){};o(i,c,u,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function o(s,i,a,c,u,l,d,p,g,f){if(c&&typeof c=="object"&&!Array.isArray(c)){i(c,u,l,d,p,g,f);for(var _ in c){var m=c[_];if(Array.isArray(m)){if(_ in r.arrayKeywords)for(var h=0;h<m.length;h++)o(s,i,a,m[h],u+"/"+_+"/"+h,l,u,_,c,h)}else if(_ in r.propsKeywords){if(m&&typeof m=="object")for(var z in m)o(s,i,a,m[z],u+"/"+_+"/"+n(z),l,u,_,c,z)}else(_ in r.keywords||s.allKeys&&!(_ in r.skipKeywords))&&o(s,i,a,m,u+"/"+_,l,u,_,c)}a(c,u,l,d,p,g,f)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}}),Mu=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=be(),r=E$(),o=Ex(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(m,h=!0){return typeof m=="boolean"?!0:h===!0?!a(m):h?c(m)<=h:!1}e.inlineRef=s;let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(m){for(let h in m){if(i.has(h))return!0;let z=m[h];if(Array.isArray(z)&&z.some(a)||typeof z=="object"&&a(z))return!0}return!1}function c(m){let h=0;for(let z in m){if(z==="$ref")return 1/0;if(h++,!n.has(z)&&(typeof m[z]=="object"&&(0,t.eachItem)(m[z],v=>h+=c(v)),h===1/0))return 1/0}return h}function u(m,h="",z){return z!==!1&&(h=p(h)),l(m,m.parse(h))}e.getFullPath=u;function l(m,h){return m.serialize(h).split("#")[0]+"#"}e._getFullPath=l;let d=/#\/?$/;function p(m){return m?m.replace(d,""):""}e.normalizeId=p;function g(m,h,z){return z=p(z),m.resolve(h,z)}e.resolveUrl=g;let f=/^[a-z_][-a-z0-9._]*$/i;function _(m,h){if(typeof m=="boolean")return{};let{schemaId:z,uriResolver:v}=this.opts,S=p(m[z]||h),R={"":S},b=u(v,S,!1),y={},$=new Set;return o(m,{allKeys:!0},(O,L,H,G)=>{if(G===void 0)return;let he=b+L,qe=R[G];typeof O[z]=="string"&&(qe=Ie.call(this,O[z])),Ye.call(this,O.$anchor),Ye.call(this,O.$dynamicAnchor),R[L]=qe;function Ie(ye){let I=this.opts.uriResolver.resolve;if(ye=p(qe?I(qe,ye):ye),$.has(ye))throw C(ye);$.add(ye);let A=this.refs[ye];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?T(O,A.schema,ye):ye!==p(he)&&(ye[0]==="#"?(T(O,y[ye],ye),y[ye]=O):this.refs[ye]=he),ye}function Ye(ye){if(typeof ye=="string"){if(!f.test(ye))throw new Error(`invalid anchor "${ye}"`);Ie.call(this,`#${ye}`)}}}),y;function T(O,L,H){if(L!==void 0&&!r(O,L))throw C(H)}function C(O){return new Error(`reference "${O}" resolves to more than one schema`)}}e.getSchemaRefs=_}),dn=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=$x(),r=ju(),o=P$(),n=ju(),s=wx(),i=Rx(),a=Px(),c=de(),u=Jt(),l=Mu(),d=be(),p=Au();function g(E){if(b(E)&&($(E),R(E))){h(E);return}f(E,()=>(0,t.topBoolOrEmptySchema)(E))}e.validateFunctionCode=g;function f({gen:E,validateName:M,schema:D,schemaEnv:oe,opts:ne},pe){ne.code.es5?E.func(M,(0,c._)`${u.default.data}, ${u.default.valCxt}`,oe.$async,()=>{E.code((0,c._)`"use strict"; ${v(D,ne)}`),m(E,ne),E.code(pe)}):E.func(M,(0,c._)`${u.default.data}, ${_(ne)}`,oe.$async,()=>E.code(v(D,ne)).code(pe))}function _(E){return(0,c._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${E.dynamicRef?(0,c._)`, ${u.default.dynamicAnchors}={}`:c.nil}}={}`}function m(E,M){E.if(u.default.valCxt,()=>{E.var(u.default.instancePath,(0,c._)`${u.default.valCxt}.${u.default.instancePath}`),E.var(u.default.parentData,(0,c._)`${u.default.valCxt}.${u.default.parentData}`),E.var(u.default.parentDataProperty,(0,c._)`${u.default.valCxt}.${u.default.parentDataProperty}`),E.var(u.default.rootData,(0,c._)`${u.default.valCxt}.${u.default.rootData}`),M.dynamicRef&&E.var(u.default.dynamicAnchors,(0,c._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{E.var(u.default.instancePath,(0,c._)`""`),E.var(u.default.parentData,(0,c._)`undefined`),E.var(u.default.parentDataProperty,(0,c._)`undefined`),E.var(u.default.rootData,u.default.data),M.dynamicRef&&E.var(u.default.dynamicAnchors,(0,c._)`{}`)})}function h(E){let{schema:M,opts:D,gen:oe}=E;f(E,()=>{D.$comment&&M.$comment&&G(E),O(E),oe.let(u.default.vErrors,null),oe.let(u.default.errors,0),D.unevaluated&&z(E),T(E),he(E)})}function z(E){let{gen:M,validateName:D}=E;E.evaluated=M.const("evaluated",(0,c._)`${D}.evaluated`),M.if((0,c._)`${E.evaluated}.dynamicProps`,()=>M.assign((0,c._)`${E.evaluated}.props`,(0,c._)`undefined`)),M.if((0,c._)`${E.evaluated}.dynamicItems`,()=>M.assign((0,c._)`${E.evaluated}.items`,(0,c._)`undefined`))}function v(E,M){let D=typeof E=="object"&&E[M.schemaId];return D&&(M.code.source||M.code.process)?(0,c._)`/*# sourceURL=${D} */`:c.nil}function S(E,M){if(b(E)&&($(E),R(E))){y(E,M);return}(0,t.boolOrEmptySchema)(E,M)}function R({schema:E,self:M}){if(typeof E=="boolean")return!E;for(let D in E)if(M.RULES.all[D])return!0;return!1}function b(E){return typeof E.schema!="boolean"}function y(E,M){let{schema:D,gen:oe,opts:ne}=E;ne.$comment&&D.$comment&&G(E),L(E),H(E);let pe=oe.const("_errs",u.default.errors);T(E,pe),oe.var(M,(0,c._)`${pe} === ${u.default.errors}`)}function $(E){(0,d.checkUnknownRules)(E),C(E)}function T(E,M){if(E.opts.jtd)return Ie(E,[],!1,M);let D=(0,r.getSchemaTypes)(E.schema);Ie(E,D,!(0,r.coerceAndCheckDataType)(E,D),M)}function C(E){let{schema:M,errSchemaPath:D,opts:oe,self:ne}=E;M.$ref&&oe.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(M,ne.RULES)&&ne.logger.warn(`$ref: keywords ignored in schema at path "${D}"`)}function O(E){let{schema:M,opts:D}=E;M.default!==void 0&&D.useDefaults&&D.strictSchema&&(0,d.checkStrictMode)(E,"default is ignored in the schema root")}function L(E){let M=E.schema[E.opts.schemaId];M&&(E.baseId=(0,l.resolveUrl)(E.opts.uriResolver,E.baseId,M))}function H(E){if(E.schema.$async&&!E.schemaEnv.$async)throw new Error("async schema in sync schema")}function G({gen:E,schemaEnv:M,schema:D,errSchemaPath:oe,opts:ne}){let pe=D.$comment;if(ne.$comment===!0)E.code((0,c._)`${u.default.self}.logger.log(${pe})`);else if(typeof ne.$comment=="function"){let Ge=(0,c.str)`${oe}/$comment`,et=E.scopeValue("root",{ref:M.root});E.code((0,c._)`${u.default.self}.opts.$comment(${pe}, ${Ge}, ${et}.schema)`)}}function he(E){let{gen:M,schemaEnv:D,validateName:oe,ValidationError:ne,opts:pe}=E;D.$async?M.if((0,c._)`${u.default.errors} === 0`,()=>M.return(u.default.data),()=>M.throw((0,c._)`new ${ne}(${u.default.vErrors})`)):(M.assign((0,c._)`${oe}.errors`,u.default.vErrors),pe.unevaluated&&qe(E),M.return((0,c._)`${u.default.errors} === 0`))}function qe({gen:E,evaluated:M,props:D,items:oe}){D instanceof c.Name&&E.assign((0,c._)`${M}.props`,D),oe instanceof c.Name&&E.assign((0,c._)`${M}.items`,oe)}function Ie(E,M,D,oe){let{gen:ne,schema:pe,data:Ge,allErrors:et,opts:ct,self:Xe}=E,{RULES:Ue}=Xe;if(pe.$ref&&(ct.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(pe,Ue))){ne.block(()=>fe(E,"$ref",Ue.all.$ref.definition));return}ct.jtd||ye(E,M),ne.block(()=>{for(let rt of Ue.rules)Et(rt);Et(Ue.post)});function Et(rt){(0,o.shouldUseGroup)(pe,rt)&&(rt.type?(ne.if((0,n.checkDataType)(rt.type,Ge,ct.strictNumbers)),Ye(E,rt),M.length===1&&M[0]===rt.type&&D&&(ne.else(),(0,n.reportTypeError)(E)),ne.endIf()):Ye(E,rt),et||ne.if((0,c._)`${u.default.errors} === ${oe||0}`))}}function Ye(E,M){let{gen:D,schema:oe,opts:{useDefaults:ne}}=E;ne&&(0,s.assignDefaults)(E,M.type),D.block(()=>{for(let pe of M.rules)(0,o.shouldUseRule)(oe,pe)&&fe(E,pe.keyword,pe.definition,M.type)})}function ye(E,M){E.schemaEnv.meta||!E.opts.strictTypes||(I(E,M),E.opts.allowUnionTypes||A(E,M),F(E,E.dataTypes))}function I(E,M){if(M.length){if(!E.dataTypes.length){E.dataTypes=M;return}M.forEach(D=>{x(E.dataTypes,D)||B(E,`type "${D}" not allowed by context "${E.dataTypes.join(",")}"`)}),N(E,M)}}function A(E,M){M.length>1&&!(M.length===2&&M.includes("null"))&&B(E,"use allowUnionTypes to allow union type keyword")}function F(E,M){let D=E.self.RULES.all;for(let oe in D){let ne=D[oe];if(typeof ne=="object"&&(0,o.shouldUseRule)(E.schema,ne)){let{type:pe}=ne.definition;pe.length&&!pe.some(Ge=>w(M,Ge))&&B(E,`missing type "${pe.join(",")}" for keyword "${oe}"`)}}}function w(E,M){return E.includes(M)||M==="number"&&E.includes("integer")}function x(E,M){return E.includes(M)||M==="integer"&&E.includes("number")}function N(E,M){let D=[];for(let oe of E.dataTypes)x(M,oe)?D.push(oe):M.includes("integer")&&oe==="number"&&D.push("integer");E.dataTypes=D}function B(E,M){let D=E.schemaEnv.baseId+E.errSchemaPath;M+=` at "${D}" (strictTypes)`,(0,d.checkStrictMode)(E,M,E.opts.strictTypes)}var te=class{constructor(E,M,D){if((0,i.validateKeywordUsage)(E,M,D),this.gen=E.gen,this.allErrors=E.allErrors,this.keyword=D,this.data=E.data,this.schema=E.schema[D],this.$data=M.$data&&E.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(E,this.schema,D,this.$data),this.schemaType=M.schemaType,this.parentSchema=E.schema,this.params={},this.it=E,this.def=M,this.$data)this.schemaCode=E.gen.const("vSchema",mt(this.$data,E));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,M.schemaType,M.allowUndefined))throw new Error(`${D} value must be ${JSON.stringify(M.schemaType)}`);("code"in M?M.trackErrors:M.errors!==!1)&&(this.errsCount=E.gen.const("_errs",u.default.errors))}result(E,M,D){this.failResult((0,c.not)(E),M,D)}failResult(E,M,D){this.gen.if(E),D?D():this.error(),M?(this.gen.else(),M(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(E,M){this.failResult((0,c.not)(E),void 0,M)}fail(E){if(E===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(E),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(E){if(!this.$data)return this.fail(E);let{schemaCode:M}=this;this.fail((0,c._)`${M} !== undefined && (${(0,c.or)(this.invalid$data(),E)})`)}error(E,M,D){if(M){this.setParams(M),this._error(E,D),this.setParams({});return}this._error(E,D)}_error(E,M){(E?p.reportExtraError:p.reportError)(this,this.def.error,M)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(E){this.allErrors||this.gen.if(E)}setParams(E,M){M?Object.assign(this.params,E):this.params=E}block$data(E,M,D=c.nil){this.gen.block(()=>{this.check$data(E,D),M()})}check$data(E=c.nil,M=c.nil){if(!this.$data)return;let{gen:D,schemaCode:oe,schemaType:ne,def:pe}=this;D.if((0,c.or)((0,c._)`${oe} === undefined`,M)),E!==c.nil&&D.assign(E,!0),(ne.length||pe.validateSchema)&&(D.elseIf(this.invalid$data()),this.$dataError(),E!==c.nil&&D.assign(E,!1)),D.else()}invalid$data(){let{gen:E,schemaCode:M,schemaType:D,def:oe,it:ne}=this;return(0,c.or)(pe(),Ge());function pe(){if(D.length){if(!(M instanceof c.Name))throw new Error("ajv implementation error");let et=Array.isArray(D)?D:[D];return(0,c._)`${(0,n.checkDataTypes)(et,M,ne.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function Ge(){if(oe.validateSchema){let et=E.scopeValue("validate$data",{ref:oe.validateSchema});return(0,c._)`!${et}(${M})`}return c.nil}}subschema(E,M){let D=(0,a.getSubschema)(this.it,E);(0,a.extendSubschemaData)(D,this.it,E),(0,a.extendSubschemaMode)(D,E);let oe={...this.it,...D,items:void 0,props:void 0};return S(oe,M),oe}mergeEvaluated(E,M){let{it:D,gen:oe}=this;D.opts.unevaluated&&(D.props!==!0&&E.props!==void 0&&(D.props=d.mergeEvaluated.props(oe,E.props,D.props,M)),D.items!==!0&&E.items!==void 0&&(D.items=d.mergeEvaluated.items(oe,E.items,D.items,M)))}mergeValidEvaluated(E,M){let{it:D,gen:oe}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return oe.if(M,()=>this.mergeEvaluated(E,c.Name)),!0}};e.KeywordCxt=te;function fe(E,M,D,oe){let ne=new te(E,D,M);"code"in D?D.code(ne,oe):ne.$data&&D.validate?(0,i.funcKeywordCode)(ne,D):"macro"in D?(0,i.macroKeywordCode)(ne,D):(D.compile||D.validate)&&(0,i.funcKeywordCode)(ne,D)}let se=/^\/(?:[^~]|~0|~1)*$/,Oe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function mt(E,{dataLevel:M,dataNames:D,dataPathArr:oe}){let ne,pe;if(E==="")return u.default.rootData;if(E[0]==="/"){if(!se.test(E))throw new Error(`Invalid JSON-pointer: ${E}`);ne=E,pe=u.default.rootData}else{let Xe=Oe.exec(E);if(!Xe)throw new Error(`Invalid JSON-pointer: ${E}`);let Ue=+Xe[1];if(ne=Xe[2],ne==="#"){if(Ue>=M)throw new Error(ct("property/index",Ue));return oe[M-Ue]}if(Ue>M)throw new Error(ct("data",Ue));if(pe=D[M-Ue],!ne)return pe}let Ge=pe,et=ne.split("/");for(let Xe of et)Xe&&(pe=(0,c._)`${pe}${(0,c.getProperty)((0,d.unescapeJsonPointer)(Xe))}`,Ge=(0,c._)`${Ge} && ${pe}`);return Ge;function ct(Xe,Ue){return`Cannot access ${Xe} ${Ue} levels up, current level is ${M}`}}e.getData=mt}),ti=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}};e.default=t}),pn=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Mu();var r=class extends Error{constructor(o,n,s,i){super(i||`can't resolve reference ${s} from id ${n}`),this.missingRef=(0,t.resolveUrl)(o,n,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(o,this.missingRef))}};e.default=r}),qu=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=de(),r=ti(),o=Jt(),n=Mu(),s=be(),i=dn();var a=class{constructor(h){var z;this.refs={},this.dynamicAnchors={};let v;typeof h.schema=="object"&&(v=h.schema),this.schema=h.schema,this.schemaId=h.schemaId,this.root=h.root||this,this.baseId=(z=h.baseId)!==null&&z!==void 0?z:(0,n.normalizeId)(v?.[h.schemaId||"$id"]),this.schemaPath=h.schemaPath,this.localRefs=h.localRefs,this.meta=h.meta,this.$async=v?.$async,this.refs={}}};e.SchemaEnv=a;function c(h){let z=d.call(this,h);if(z)return z;let v=(0,n.getFullPath)(this.opts.uriResolver,h.root.baseId),{es5:S,lines:R}=this.opts.code,{ownProperties:b}=this.opts,y=new t.CodeGen(this.scope,{es5:S,lines:R,ownProperties:b}),$;h.$async&&($=y.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let T=y.scopeName("validate");h.validateName=T;let C={gen:y,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:y.scopeValue("schema",this.opts.code.source===!0?{ref:h.schema,code:(0,t.stringify)(h.schema)}:{ref:h.schema}),validateName:T,ValidationError:$,schema:h.schema,schemaEnv:h,rootId:v,baseId:h.baseId||v,schemaPath:t.nil,errSchemaPath:h.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this},O;try{this._compilations.add(h),(0,i.validateFunctionCode)(C),y.optimize(this.opts.code.optimize);let L=y.toString();O=`${y.scopeRefs(o.default.scope)}return ${L}`,this.opts.code.process&&(O=this.opts.code.process(O,h));let H=new Function(`${o.default.self}`,`${o.default.scope}`,O)(this,this.scope.get());if(this.scope.value(T,{ref:H}),H.errors=null,H.schema=h.schema,H.schemaEnv=h,h.$async&&(H.$async=!0),this.opts.code.source===!0&&(H.source={validateName:T,validateCode:L,scopeValues:y._values}),this.opts.unevaluated){let{props:G,items:he}=C;H.evaluated={props:G instanceof t.Name?void 0:G,items:he instanceof t.Name?void 0:he,dynamicProps:G instanceof t.Name,dynamicItems:he instanceof t.Name},H.source&&(H.source.evaluated=(0,t.stringify)(H.evaluated))}return h.validate=H,h}catch(L){throw delete h.validate,delete h.validateName,O&&this.logger.error("Error compiling schema, function code:",O),L}finally{this._compilations.delete(h)}}e.compileSchema=c;function u(h,z,v){var S;v=(0,n.resolveUrl)(this.opts.uriResolver,z,v);let R=h.refs[v];if(R)return R;let b=g.call(this,h,v);if(b===void 0){let y=(S=h.localRefs)===null||S===void 0?void 0:S[v],{schemaId:$}=this.opts;y&&(b=new a({schema:y,schemaId:$,root:h,baseId:z}))}if(b!==void 0)return h.refs[v]=l.call(this,b)}e.resolveRef=u;function l(h){return(0,n.inlineRef)(h.schema,this.opts.inlineRefs)?h.schema:h.validate?h:c.call(this,h)}function d(h){for(let z of this._compilations)if(p(z,h))return z}e.getCompilingSchema=d;function p(h,z){return h.schema===z.schema&&h.root===z.root&&h.baseId===z.baseId}function g(h,z){let v;for(;typeof(v=this.refs[z])=="string";)z=v;return v||this.schemas[z]||f.call(this,h,z)}function f(h,z){let v=this.opts.uriResolver.parse(z),S=(0,n._getFullPath)(this.opts.uriResolver,v),R=(0,n.getFullPath)(this.opts.uriResolver,h.baseId,void 0);if(Object.keys(h.schema).length>0&&S===R)return m.call(this,v,h);let b=(0,n.normalizeId)(S),y=this.refs[b]||this.schemas[b];if(typeof y=="string"){let $=f.call(this,h,y);return typeof $?.schema!="object"?void 0:m.call(this,v,$)}if(typeof y?.schema=="object"){if(y.validate||c.call(this,y),b===(0,n.normalizeId)(z)){let{schema:$}=y,{schemaId:T}=this.opts,C=$[T];return C&&(R=(0,n.resolveUrl)(this.opts.uriResolver,R,C)),new a({schema:$,schemaId:T,root:h,baseId:R})}return m.call(this,v,y)}}e.resolveSchema=f;let _=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function m(h,{baseId:z,schema:v,root:S}){var R;if(((R=h.fragment)===null||R===void 0?void 0:R[0])!=="/")return;for(let $ of h.fragment.slice(1).split("/")){if(typeof v=="boolean")return;let T=v[(0,s.unescapeFragment)($)];if(T===void 0)return;v=T;let C=typeof v=="object"&&v[this.opts.schemaId];!_.has($)&&C&&(z=(0,n.resolveUrl)(this.opts.uriResolver,z,C))}let b;if(typeof v!="boolean"&&v.$ref&&!(0,s.schemaHasRulesButRef)(v,this.RULES)){let $=(0,n.resolveUrl)(this.opts.uriResolver,z,v.$ref);b=f.call(this,S,$)}let{schemaId:y}=this.opts;if(b=b||new a({schema:v,schemaId:y,root:S,baseId:z}),b.schema!==b.root.schema)return b}}),kx=U((e,t)=>{t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),k$=U((e,t)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o=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 n(f){let _="",m=0,h=0;for(h=0;h<f.length;h++)if(m=f[h].charCodeAt(0),m!==48){if(!(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102))return"";_+=f[h];break}for(h+=1;h<f.length;h++){if(m=f[h].charCodeAt(0),!(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102))return"";_+=f[h]}return _}let s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(f){return f.length=0,!0}function a(f,_,m){if(f.length){let h=n(f);if(h!=="")_.push(h);else return m.error=!0,!1;f.length=0}return!0}function c(f){let _=0,m={error:!1,address:"",zone:""},h=[],z=[],v=!1,S=!1,R=a;for(let b=0;b<f.length;b++){let y=f[b];if(!(y==="["||y==="]"))if(y===":"){if(v===!0&&(S=!0),!R(z,h,m))break;if(++_>7){m.error=!0;break}b>0&&f[b-1]===":"&&(v=!0),h.push(":");continue}else if(y==="%"){if(!R(z,h,m))break;R=i}else{z.push(y);continue}}return z.length&&(R===i?m.zone=z.join(""):S?h.push(z.join("")):h.push(n(z))),m.address=h.join(""),m}function u(f){if(l(f,":")<2)return{host:f,isIPV6:!1};let _=c(f);if(_.error)return{host:f,isIPV6:!1};{let m=_.address,h=_.address;return _.zone&&(m+="%"+_.zone,h+="%25"+_.zone),{host:m,isIPV6:!0,escapedHost:h}}}function l(f,_){let m=0;for(let h=0;h<f.length;h++)f[h]===_&&m++;return m}function d(f){let _=f,m=[],h=-1,z=0;for(;z=_.length;){if(z===1){if(_===".")break;if(_==="/"){m.push("/");break}else{m.push(_);break}}else if(z===2){if(_[0]==="."){if(_[1]===".")break;if(_[1]==="/"){_=_.slice(2);continue}}else if(_[0]==="/"&&(_[1]==="."||_[1]==="/")){m.push("/");break}}else if(z===3&&_==="/.."){m.length!==0&&m.pop(),m.push("/");break}if(_[0]==="."){if(_[1]==="."){if(_[2]==="/"){_=_.slice(3);continue}}else if(_[1]==="/"){_=_.slice(2);continue}}else if(_[0]==="/"&&_[1]==="."){if(_[2]==="/"){_=_.slice(2);continue}else if(_[2]==="."&&_[3]==="/"){_=_.slice(3),m.length!==0&&m.pop();continue}}if((h=_.indexOf("/",1))===-1){m.push(_);break}else m.push(_.slice(0,h)),_=_.slice(h)}return m.join("")}function p(f,_){let m=_!==!0?escape:unescape;return f.scheme!==void 0&&(f.scheme=m(f.scheme)),f.userinfo!==void 0&&(f.userinfo=m(f.userinfo)),f.host!==void 0&&(f.host=m(f.host)),f.path!==void 0&&(f.path=m(f.path)),f.query!==void 0&&(f.query=m(f.query)),f.fragment!==void 0&&(f.fragment=m(f.fragment)),f}function g(f){let _=[];if(f.userinfo!==void 0&&(_.push(f.userinfo),_.push("@")),f.host!==void 0){let m=unescape(f.host);if(!o(m)){let h=u(m);h.isIPV6===!0?m=`[${h.escapedHost}]`:m=f.host}_.push(m)}return(typeof f.port=="number"||typeof f.port=="string")&&(_.push(":"),_.push(String(f.port))),_.length?_.join(""):void 0}t.exports={nonSimpleDomain:s,recomposeAuthority:g,normalizeComponentEncoding:p,removeDotSegments:d,isIPv4:o,isUUID:r,normalizeIPv6:u,stringArrayToHexStripped:n}}),xx=U((e,t)=>{let{isUUID:r}=k$(),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(y){return n.indexOf(y)!==-1}function i(y){return y.secure===!0?!0:y.secure===!1?!1:y.scheme?y.scheme.length===3&&(y.scheme[0]==="w"||y.scheme[0]==="W")&&(y.scheme[1]==="s"||y.scheme[1]==="S")&&(y.scheme[2]==="s"||y.scheme[2]==="S"):!1}function a(y){return y.host||(y.error=y.error||"HTTP URIs must have a host."),y}function c(y){let $=String(y.scheme).toLowerCase()==="https";return(y.port===($?443:80)||y.port==="")&&(y.port=void 0),y.path||(y.path="/"),y}function u(y){return y.secure=i(y),y.resourceName=(y.path||"/")+(y.query?"?"+y.query:""),y.path=void 0,y.query=void 0,y}function l(y){if((y.port===(i(y)?443:80)||y.port==="")&&(y.port=void 0),typeof y.secure=="boolean"&&(y.scheme=y.secure?"wss":"ws",y.secure=void 0),y.resourceName){let[$,T]=y.resourceName.split("?");y.path=$&&$!=="/"?$:void 0,y.query=T,y.resourceName=void 0}return y.fragment=void 0,y}function d(y,$){if(!y.path)return y.error="URN can not be parsed",y;let T=y.path.match(o);if(T){let C=$.scheme||y.scheme||"urn";y.nid=T[1].toLowerCase(),y.nss=T[2];let O=b(`${C}:${$.nid||y.nid}`);y.path=void 0,O&&(y=O.parse(y,$))}else y.error=y.error||"URN can not be parsed.";return y}function p(y,$){if(y.nid===void 0)throw new Error("URN without nid cannot be serialized");let T=$.scheme||y.scheme||"urn",C=y.nid.toLowerCase(),O=b(`${T}:${$.nid||C}`);O&&(y=O.serialize(y,$));let L=y,H=y.nss;return L.path=`${C||$.nid}:${H}`,$.skipEscape=!0,L}function g(y,$){let T=y;return T.uuid=T.nss,T.nss=void 0,!$.tolerant&&(!T.uuid||!r(T.uuid))&&(T.error=T.error||"UUID is not valid."),T}function f(y){let $=y;return $.nss=(y.uuid||"").toLowerCase(),$}let _={scheme:"http",domainHost:!0,parse:a,serialize:c},m={scheme:"https",domainHost:_.domainHost,parse:a,serialize:c},h={scheme:"ws",domainHost:!0,parse:u,serialize:l},z={scheme:"wss",domainHost:h.domainHost,parse:h.parse,serialize:h.serialize},R={http:_,https:m,ws:h,wss:z,urn:{scheme:"urn",parse:d,serialize:p,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:g,serialize:f,skipNormalize:!0}};Object.setPrototypeOf(R,null);function b(y){return y&&(R[y]||R[y.toLowerCase()])||void 0}t.exports={wsIsSecure:i,SCHEMES:R,isValidSchemeName:s,getSchemeHandler:b}}),Tx=U((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:i,nonSimpleDomain:a}=k$(),{SCHEMES:c,getSchemeHandler:u}=xx();function l(z,v){return typeof z=="string"?z=f(m(z,v),v):typeof z=="object"&&(z=m(f(z,v),v)),z}function d(z,v,S){let R=S?Object.assign({scheme:"null"},S):{scheme:"null"},b=p(m(z,R),m(v,R),R,!0);return R.skipEscape=!0,f(b,R)}function p(z,v,S,R){let b={};return R||(z=m(f(z,S),S),v=m(f(v,S),S)),S=S||{},!S.tolerant&&v.scheme?(b.scheme=v.scheme,b.userinfo=v.userinfo,b.host=v.host,b.port=v.port,b.path=o(v.path||""),b.query=v.query):(v.userinfo!==void 0||v.host!==void 0||v.port!==void 0?(b.userinfo=v.userinfo,b.host=v.host,b.port=v.port,b.path=o(v.path||""),b.query=v.query):(v.path?(v.path[0]==="/"?b.path=o(v.path):((z.userinfo!==void 0||z.host!==void 0||z.port!==void 0)&&!z.path?b.path="/"+v.path:z.path?b.path=z.path.slice(0,z.path.lastIndexOf("/")+1)+v.path:b.path=v.path,b.path=o(b.path)),b.query=v.query):(b.path=z.path,v.query!==void 0?b.query=v.query:b.query=z.query),b.userinfo=z.userinfo,b.host=z.host,b.port=z.port),b.scheme=z.scheme),b.fragment=v.fragment,b}function g(z,v,S){return typeof z=="string"?(z=unescape(z),z=f(s(m(z,S),!0),{...S,skipEscape:!0})):typeof z=="object"&&(z=f(s(z,!0),{...S,skipEscape:!0})),typeof v=="string"?(v=unescape(v),v=f(s(m(v,S),!0),{...S,skipEscape:!0})):typeof v=="object"&&(v=f(s(v,!0),{...S,skipEscape:!0})),z.toLowerCase()===v.toLowerCase()}function f(z,v){let S={host:z.host,scheme:z.scheme,userinfo:z.userinfo,port:z.port,path:z.path,query:z.query,nid:z.nid,nss:z.nss,uuid:z.uuid,fragment:z.fragment,reference:z.reference,resourceName:z.resourceName,secure:z.secure,error:""},R=Object.assign({},v),b=[],y=u(R.scheme||S.scheme);y&&y.serialize&&y.serialize(S,R),S.path!==void 0&&(R.skipEscape?S.path=unescape(S.path):(S.path=escape(S.path),S.scheme!==void 0&&(S.path=S.path.split("%3A").join(":")))),R.reference!=="suffix"&&S.scheme&&b.push(S.scheme,":");let $=n(S);if($!==void 0&&(R.reference!=="suffix"&&b.push("//"),b.push($),S.path&&S.path[0]!=="/"&&b.push("/")),S.path!==void 0){let T=S.path;!R.absolutePath&&(!y||!y.absolutePath)&&(T=o(T)),$===void 0&&T[0]==="/"&&T[1]==="/"&&(T="/%2F"+T.slice(2)),b.push(T)}return S.query!==void 0&&b.push("?",S.query),S.fragment!==void 0&&b.push("#",S.fragment),b.join("")}let _=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function m(z,v){let S=Object.assign({},v),R={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},b=!1;S.reference==="suffix"&&(S.scheme?z=S.scheme+":"+z:z="//"+z);let y=z.match(_);if(y){if(R.scheme=y[1],R.userinfo=y[3],R.host=y[4],R.port=parseInt(y[5],10),R.path=y[6]||"",R.query=y[7],R.fragment=y[8],isNaN(R.port)&&(R.port=y[5]),R.host)if(i(R.host)===!1){let T=r(R.host);R.host=T.host.toLowerCase(),b=T.isIPV6}else b=!0;R.scheme===void 0&&R.userinfo===void 0&&R.host===void 0&&R.port===void 0&&R.query===void 0&&!R.path?R.reference="same-document":R.scheme===void 0?R.reference="relative":R.fragment===void 0?R.reference="absolute":R.reference="uri",S.reference&&S.reference!=="suffix"&&S.reference!==R.reference&&(R.error=R.error||"URI is not a "+S.reference+" reference.");let $=u(S.scheme||R.scheme);if(!S.unicodeSupport&&(!$||!$.unicodeSupport)&&R.host&&(S.domainHost||$&&$.domainHost)&&b===!1&&a(R.host))try{R.host=URL.domainToASCII(R.host.toLowerCase())}catch(T){R.error=R.error||"Host's domain name can not be converted to ASCII: "+T}(!$||$&&!$.skipNormalize)&&(z.indexOf("%")!==-1&&(R.scheme!==void 0&&(R.scheme=unescape(R.scheme)),R.host!==void 0&&(R.host=unescape(R.host))),R.path&&(R.path=escape(unescape(R.path))),R.fragment&&(R.fragment=encodeURI(decodeURIComponent(R.fragment)))),$&&$.parse&&$.parse(R,S)}else R.error=R.error||"URI can not be parsed.";return R}let h={SCHEMES:c,normalize:l,resolve:d,resolveComponent:p,equal:g,serialize:f,parse:m};t.exports=h,t.exports.default=h,t.exports.fastUri=h}),Ix=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Tx();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),xm=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=dn();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=de();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});let o=ti(),n=pn(),s=R$(),i=qu(),a=de(),c=Mu(),u=ju(),l=be(),d=kx(),p=Ix(),g=(I,A)=>new RegExp(I,A);g.code="new RegExp";let f=["removeAdditional","useDefaults","coerceTypes"],_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),m={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."},h={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},z=200;function v(I){var A,F,w,x,N,B,te,fe,se,Oe,mt,E,M,D,oe,ne,pe,Ge,et,ct,Xe,Ue,Et,rt,Xt;let Nt=I.strict,Qt=(A=I.code)===null||A===void 0?void 0:A.optimize,mr=Qt===!0||Qt===void 0?1:Qt||0,fr=(w=(F=I.code)===null||F===void 0?void 0:F.regExp)!==null&&w!==void 0?w:g,Ur=(x=I.uriResolver)!==null&&x!==void 0?x:p.default;return{strictSchema:(B=(N=I.strictSchema)!==null&&N!==void 0?N:Nt)!==null&&B!==void 0?B:!0,strictNumbers:(fe=(te=I.strictNumbers)!==null&&te!==void 0?te:Nt)!==null&&fe!==void 0?fe:!0,strictTypes:(Oe=(se=I.strictTypes)!==null&&se!==void 0?se:Nt)!==null&&Oe!==void 0?Oe:"log",strictTuples:(E=(mt=I.strictTuples)!==null&&mt!==void 0?mt:Nt)!==null&&E!==void 0?E:"log",strictRequired:(D=(M=I.strictRequired)!==null&&M!==void 0?M:Nt)!==null&&D!==void 0?D:!1,code:I.code?{...I.code,optimize:mr,regExp:fr}:{optimize:mr,regExp:fr},loopRequired:(oe=I.loopRequired)!==null&&oe!==void 0?oe:z,loopEnum:(ne=I.loopEnum)!==null&&ne!==void 0?ne:z,meta:(pe=I.meta)!==null&&pe!==void 0?pe:!0,messages:(Ge=I.messages)!==null&&Ge!==void 0?Ge:!0,inlineRefs:(et=I.inlineRefs)!==null&&et!==void 0?et:!0,schemaId:(ct=I.schemaId)!==null&&ct!==void 0?ct:"$id",addUsedSchema:(Xe=I.addUsedSchema)!==null&&Xe!==void 0?Xe:!0,validateSchema:(Ue=I.validateSchema)!==null&&Ue!==void 0?Ue:!0,validateFormats:(Et=I.validateFormats)!==null&&Et!==void 0?Et:!0,unicodeRegExp:(rt=I.unicodeRegExp)!==null&&rt!==void 0?rt:!0,int32range:(Xt=I.int32range)!==null&&Xt!==void 0?Xt:!0,uriResolver:Ur}}var S=class{constructor(I={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,I=this.opts={...I,...v(I)};let{es5:A,lines:F}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:_,es5:A,lines:F}),this.logger=L(I.logger);let w=I.validateFormats;I.validateFormats=!1,this.RULES=(0,s.getRules)(),R.call(this,m,I,"NOT SUPPORTED"),R.call(this,h,I,"DEPRECATED","warn"),this._metaOpts=C.call(this),I.formats&&$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),I.keywords&&T.call(this,I.keywords),typeof I.meta=="object"&&this.addMetaSchema(I.meta),y.call(this),I.validateFormats=w}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:I,meta:A,schemaId:F}=this.opts,w=d;F==="id"&&(w={...d},w.id=w.$id,delete w.$id),A&&I&&this.addMetaSchema(w,w[F],!1)}defaultMeta(){let{meta:I,schemaId:A}=this.opts;return this.opts.defaultMeta=typeof I=="object"?I[A]||I:void 0}validate(I,A){let F;if(typeof I=="string"){if(F=this.getSchema(I),!F)throw new Error(`no schema with key or ref "${I}"`)}else F=this.compile(I);let w=F(A);return"$async"in F||(this.errors=F.errors),w}compile(I,A){let F=this._addSchema(I,A);return F.validate||this._compileSchemaEnv(F)}compileAsync(I,A){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:F}=this.opts;return w.call(this,I,A);async function w(se,Oe){await x.call(this,se.$schema);let mt=this._addSchema(se,Oe);return mt.validate||N.call(this,mt)}async function x(se){se&&!this.getSchema(se)&&await w.call(this,{$ref:se},!0)}async function N(se){try{return this._compileSchemaEnv(se)}catch(Oe){if(!(Oe instanceof n.default))throw Oe;return B.call(this,Oe),await te.call(this,Oe.missingSchema),N.call(this,se)}}function B({missingSchema:se,missingRef:Oe}){if(this.refs[se])throw new Error(`AnySchema ${se} is loaded but ${Oe} cannot be resolved`)}async function te(se){let Oe=await fe.call(this,se);this.refs[se]||await x.call(this,Oe.$schema),this.refs[se]||this.addSchema(Oe,se,A)}async function fe(se){let Oe=this._loading[se];if(Oe)return Oe;try{return await(this._loading[se]=F(se))}finally{delete this._loading[se]}}}addSchema(I,A,F,w=this.opts.validateSchema){if(Array.isArray(I)){for(let N of I)this.addSchema(N,void 0,F,w);return this}let x;if(typeof I=="object"){let{schemaId:N}=this.opts;if(x=I[N],x!==void 0&&typeof x!="string")throw new Error(`schema ${N} must be string`)}return A=(0,c.normalizeId)(A||x),this._checkUnique(A),this.schemas[A]=this._addSchema(I,F,A,w,!0),this}addMetaSchema(I,A,F=this.opts.validateSchema){return this.addSchema(I,A,!0,F),this}validateSchema(I,A){if(typeof I=="boolean")return!0;let F;if(F=I.$schema,F!==void 0&&typeof F!="string")throw new Error("$schema must be a string");if(F=F||this.opts.defaultMeta||this.defaultMeta(),!F)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let w=this.validate(F,I);if(!w&&A){let x="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(x);else throw new Error(x)}return w}getSchema(I){let A;for(;typeof(A=b.call(this,I))=="string";)I=A;if(A===void 0){let{schemaId:F}=this.opts,w=new i.SchemaEnv({schema:{},schemaId:F});if(A=i.resolveSchema.call(this,w,I),!A)return;this.refs[I]=A}return A.validate||this._compileSchemaEnv(A)}removeSchema(I){if(I instanceof RegExp)return this._removeAllSchemas(this.schemas,I),this._removeAllSchemas(this.refs,I),this;switch(typeof I){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let A=b.call(this,I);return typeof A=="object"&&this._cache.delete(A.schema),delete this.schemas[I],delete this.refs[I],this}case"object":{let A=I;this._cache.delete(A);let F=I[this.opts.schemaId];return F&&(F=(0,c.normalizeId)(F),delete this.schemas[F],delete this.refs[F]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(I){for(let A of I)this.addKeyword(A);return this}addKeyword(I,A){let F;if(typeof I=="string")F=I,typeof A=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),A.keyword=F);else if(typeof I=="object"&&A===void 0){if(A=I,F=A.keyword,Array.isArray(F)&&!F.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(G.call(this,F,A),!A)return(0,l.eachItem)(F,x=>he.call(this,x)),this;Ie.call(this,A);let w={...A,type:(0,u.getJSONTypes)(A.type),schemaType:(0,u.getJSONTypes)(A.schemaType)};return(0,l.eachItem)(F,w.type.length===0?x=>he.call(this,x,w):x=>w.type.forEach(N=>he.call(this,x,w,N))),this}getKeyword(I){let A=this.RULES.all[I];return typeof A=="object"?A.definition:!!A}removeKeyword(I){let{RULES:A}=this;delete A.keywords[I],delete A.all[I];for(let F of A.rules){let w=F.rules.findIndex(x=>x.keyword===I);w>=0&&F.rules.splice(w,1)}return this}addFormat(I,A){return typeof A=="string"&&(A=new RegExp(A)),this.formats[I]=A,this}errorsText(I=this.errors,{separator:A=", ",dataVar:F="data"}={}){return!I||I.length===0?"No errors":I.map(w=>`${F}${w.instancePath} ${w.message}`).reduce((w,x)=>w+A+x)}$dataMetaSchema(I,A){let F=this.RULES.all;I=JSON.parse(JSON.stringify(I));for(let w of A){let x=w.split("/").slice(1),N=I;for(let B of x)N=N[B];for(let B in F){let te=F[B];if(typeof te!="object")continue;let{$data:fe}=te.definition,se=N[B];fe&&se&&(N[B]=ye(se))}}return I}_removeAllSchemas(I,A){for(let F in I){let w=I[F];(!A||A.test(F))&&(typeof w=="string"?delete I[F]:w&&!w.meta&&(this._cache.delete(w.schema),delete I[F]))}}_addSchema(I,A,F,w=this.opts.validateSchema,x=this.opts.addUsedSchema){let N,{schemaId:B}=this.opts;if(typeof I=="object")N=I[B];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof I!="boolean")throw new Error("schema must be object or boolean")}let te=this._cache.get(I);if(te!==void 0)return te;F=(0,c.normalizeId)(N||F);let fe=c.getSchemaRefs.call(this,I,F);return te=new i.SchemaEnv({schema:I,schemaId:B,meta:A,baseId:F,localRefs:fe}),this._cache.set(te.schema,te),x&&!F.startsWith("#")&&(F&&this._checkUnique(F),this.refs[F]=te),w&&this.validateSchema(I,!0),te}_checkUnique(I){if(this.schemas[I]||this.refs[I])throw new Error(`schema with key or id "${I}" already exists`)}_compileSchemaEnv(I){if(I.meta?this._compileMetaSchema(I):i.compileSchema.call(this,I),!I.validate)throw new Error("ajv implementation error");return I.validate}_compileMetaSchema(I){let A=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,I)}finally{this.opts=A}}};S.ValidationError=o.default,S.MissingRefError=n.default,e.default=S;function R(I,A,F,w="error"){for(let x in I){let N=x;N in A&&this.logger[w](`${F}: option ${x}. ${I[N]}`)}}function b(I){return I=(0,c.normalizeId)(I),this.schemas[I]||this.refs[I]}function y(){let I=this.opts.schemas;if(I)if(Array.isArray(I))this.addSchema(I);else for(let A in I)this.addSchema(I[A],A)}function $(){for(let I in this.opts.formats){let A=this.opts.formats[I];A&&this.addFormat(I,A)}}function T(I){if(Array.isArray(I)){this.addVocabulary(I);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let A in I){let F=I[A];F.keyword||(F.keyword=A),this.addKeyword(F)}}function C(){let I={...this.opts};for(let A of f)delete I[A];return I}let O={log(){},warn(){},error(){}};function L(I){if(I===!1)return O;if(I===void 0)return console;if(I.log&&I.warn&&I.error)return I;throw new Error("logger must implement log, warn and error methods")}let H=/^[a-z_$][a-z0-9_$:-]*$/i;function G(I,A){let{RULES:F}=this;if((0,l.eachItem)(I,w=>{if(F.keywords[w])throw new Error(`Keyword ${w} is already defined`);if(!H.test(w))throw new Error(`Keyword ${w} has invalid name`)}),!!A&&A.$data&&!("code"in A||"validate"in A))throw new Error('$data keyword must have "code" or "validate" function')}function he(I,A,F){var w;let x=A?.post;if(F&&x)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:N}=this,B=x?N.post:N.rules.find(({type:fe})=>fe===F);if(B||(B={type:F,rules:[]},N.rules.push(B)),N.keywords[I]=!0,!A)return;let te={keyword:I,definition:{...A,type:(0,u.getJSONTypes)(A.type),schemaType:(0,u.getJSONTypes)(A.schemaType)}};A.before?qe.call(this,B,te,A.before):B.rules.push(te),N.all[I]=te,(w=A.implements)===null||w===void 0||w.forEach(fe=>this.addKeyword(fe))}function qe(I,A,F){let w=I.rules.findIndex(x=>x.keyword===F);w>=0?I.rules.splice(w,0,A):(I.rules.push(A),this.logger.warn(`rule ${F} is not defined`))}function Ie(I){let{metaSchema:A}=I;A!==void 0&&(I.$data&&this.opts.$data&&(A=ye(A)),I.validateSchema=this.compile(A,!0))}let Ye={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ye(I){return{anyOf:[I,Ye]}}}),Ox=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t}),Tm=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=pn(),r=Ht(),o=de(),n=Jt(),s=qu(),i=be(),a={keyword:"$ref",schemaType:"string",code(l){let{gen:d,schema:p,it:g}=l,{baseId:f,schemaEnv:_,validateName:m,opts:h,self:z}=g,{root:v}=_;if((p==="#"||p==="#/")&&f===v.baseId)return R();let S=s.resolveRef.call(z,v,f,p);if(S===void 0)throw new t.default(g.opts.uriResolver,f,p);if(S instanceof s.SchemaEnv)return b(S);return y(S);function R(){if(_===v)return u(l,m,_,_.$async);let $=d.scopeValue("root",{ref:v});return u(l,(0,o._)`${$}.validate`,v,v.$async)}function b($){u(l,c(l,$),$,$.$async)}function y($){let T=d.scopeValue("schema",h.code.source===!0?{ref:$,code:(0,o.stringify)($)}:{ref:$}),C=d.name("valid"),O=l.subschema({schema:$,dataTypes:[],schemaPath:o.nil,topSchemaRef:T,errSchemaPath:p},C);l.mergeEvaluated(O),l.ok(C)}}};function c(l,d){let{gen:p}=l;return d.validate?p.scopeValue("validate",{ref:d.validate}):(0,o._)`${p.scopeValue("wrapper",{ref:d})}.validate`}e.getValidate=c;function u(l,d,p,g){let{gen:f,it:_}=l,{allErrors:m,schemaEnv:h,opts:z}=_,v=z.passContext?n.default.this:o.nil;g?S():R();function S(){if(!h.$async)throw new Error("async schema referenced by sync schema");let $=f.let("valid");f.try(()=>{f.code((0,o._)`await ${(0,r.callValidateCode)(l,d,v)}`),y(d),m||f.assign($,!0)},T=>{f.if((0,o._)`!(${T} instanceof ${_.ValidationError})`,()=>f.throw(T)),b(T),m||f.assign($,!1)}),l.ok($)}function R(){l.result((0,r.callValidateCode)(l,d,v),()=>y(d),()=>b(d))}function b($){let T=(0,o._)`${$}.errors`;f.assign(n.default.vErrors,(0,o._)`${n.default.vErrors} === null ? ${T} : ${n.default.vErrors}.concat(${T})`),f.assign(n.default.errors,(0,o._)`${n.default.vErrors}.length`)}function y($){var T;if(!_.opts.unevaluated)return;let C=(T=p?.validate)===null||T===void 0?void 0:T.evaluated;if(_.props!==!0)if(C&&!C.dynamicProps)C.props!==void 0&&(_.props=i.mergeEvaluated.props(f,C.props,_.props));else{let O=f.var("props",(0,o._)`${$}.evaluated.props`);_.props=i.mergeEvaluated.props(f,O,_.props,o.Name)}if(_.items!==!0)if(C&&!C.dynamicItems)C.items!==void 0&&(_.items=i.mergeEvaluated.items(f,C.items,_.items));else{let O=f.var("items",(0,o._)`${$}.evaluated.items`);_.items=i.mergeEvaluated.items(f,O,_.items,o.Name)}}}e.callRef=u,e.default=a}),x$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ox(),r=Tm(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o}),Cx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=t.operators,o={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},n={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:s,schemaCode:i})=>(0,t.str)`must be ${o[s].okStr} ${i}`,params:({keyword:s,schemaCode:i})=>(0,t._)`{comparison: ${o[s].okStr}, limit: ${i}}`},code(s){let{keyword:i,data:a,schemaCode:c}=s;s.fail$data((0,t._)`${a} ${o[i].fail} ${c} || isNaN(${a})`)}};e.default=n}),Nx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must be multiple of ${o}`,params:({schemaCode:o})=>(0,t._)`{multipleOf: ${o}}`},code(o){let{gen:n,data:s,schemaCode:i,it:a}=o,c=a.opts.multipleOfPrecision,u=n.let("res"),l=c?(0,t._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:(0,t._)`${u} !== parseInt(${u})`;o.fail$data((0,t._)`(${i} === 0 || (${u} = ${s}/${i}, ${l}))`)}};e.default=r}),jx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r){let o=r.length,n=0,s=0,i;for(;s<o;)n++,i=r.charCodeAt(s++),i>=55296&&i<=56319&&s<o&&(i=r.charCodeAt(s),(i&64512)===56320&&s++);return n}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),Ax=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o=jx(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:i}){let a=s==="maxLength"?"more":"fewer";return(0,t.str)`must NOT have ${a} than ${i} characters`},params:({schemaCode:s})=>(0,t._)`{limit: ${s}}`},code(s){let{keyword:i,data:a,schemaCode:c,it:u}=s,l=i==="maxLength"?t.operators.GT:t.operators.LT,d=u.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,r.useFunc)(s.gen,o.default)}(${a})`;s.fail$data((0,t._)`${d} ${l} ${c}`)}};e.default=n}),Mx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ht(),r=be(),o=de(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,o.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,o._)`{pattern: ${s}}`},code(s){let{gen:i,data:a,$data:c,schema:u,schemaCode:l,it:d}=s,p=d.opts.unicodeRegExp?"u":"";if(c){let{regExp:g}=d.opts.code,f=g.code==="new RegExp"?(0,o._)`new RegExp`:(0,r.useFunc)(i,g),_=i.let("valid");i.try(()=>i.assign(_,(0,o._)`${f}(${l}, ${p}).test(${a})`),()=>i.assign(_,!1)),s.fail$data((0,o._)`!${_}`)}else{let g=(0,t.usePattern)(s,u);s.fail$data((0,o._)`!${g}.test(${a})`)}}};e.default=n}),qx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxProperties"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${n} properties`},params:({schemaCode:o})=>(0,t._)`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,a=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data((0,t._)`Object.keys(${s}).length ${a} ${i}`)}};e.default=r}),Zx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ht(),r=de(),o=be(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,r.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,r._)`{missingProperty: ${s}}`},code(s){let{gen:i,schema:a,schemaCode:c,data:u,$data:l,it:d}=s,{opts:p}=d;if(!l&&a.length===0)return;let g=a.length>=p.loopRequired;if(d.allErrors?f():_(),p.strictRequired){let z=s.parentSchema.properties,{definedProperties:v}=s.it;for(let S of a)if(z?.[S]===void 0&&!v.has(S)){let R=`required property "${S}" is not defined at "${d.schemaEnv.baseId+d.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(d,R,d.opts.strictRequired)}}function f(){if(g||l)s.block$data(r.nil,m);else for(let z of a)(0,t.checkReportMissingProp)(s,z)}function _(){let z=i.let("missing");if(g||l){let v=i.let("valid",!0);s.block$data(v,()=>h(z,v)),s.ok(v)}else i.if((0,t.checkMissingProp)(s,a,z)),(0,t.reportMissingProp)(s,z),i.else()}function m(){i.forOf("prop",c,z=>{s.setParams({missingProperty:z}),i.if((0,t.noPropertyInData)(i,u,z,p.ownProperties),()=>s.error())})}function h(z,v){s.setParams({missingProperty:z}),i.forOf(z,c,()=>{i.assign(v,(0,t.propertyInData)(i,u,z,p.ownProperties)),i.if((0,r.not)(v),()=>{s.error(),i.break()})},r.nil)}}};e.default=n}),Lx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxItems"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${n} items`},params:({schemaCode:o})=>(0,t._)`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,a=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data((0,t._)`${s}.length ${a} ${i}`)}};e.default=r}),Im=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=E$();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),Dx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ju(),r=de(),o=be(),n=Im(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:a}})=>(0,r.str)`must NOT have duplicate items (items ## ${a} and ${i} are identical)`,params:({params:{i,j:a}})=>(0,r._)`{i: ${i}, j: ${a}}`},code(i){let{gen:a,data:c,$data:u,schema:l,parentSchema:d,schemaCode:p,it:g}=i;if(!u&&!l)return;let f=a.let("valid"),_=d.items?(0,t.getSchemaTypes)(d.items):[];i.block$data(f,m,(0,r._)`${p} === false`),i.ok(f);function m(){let S=a.let("i",(0,r._)`${c}.length`),R=a.let("j");i.setParams({i:S,j:R}),a.assign(f,!0),a.if((0,r._)`${S} > 1`,()=>(h()?z:v)(S,R))}function h(){return _.length>0&&!_.some(S=>S==="object"||S==="array")}function z(S,R){let b=a.name("item"),y=(0,t.checkDataTypes)(_,b,g.opts.strictNumbers,t.DataType.Wrong),$=a.const("indices",(0,r._)`{}`);a.for((0,r._)`;${S}--;`,()=>{a.let(b,(0,r._)`${c}[${S}]`),a.if(y,(0,r._)`continue`),_.length>1&&a.if((0,r._)`typeof ${b} == "string"`,(0,r._)`${b} += "_"`),a.if((0,r._)`typeof ${$}[${b}] == "number"`,()=>{a.assign(R,(0,r._)`${$}[${b}]`),i.error(),a.assign(f,!1).break()}).code((0,r._)`${$}[${b}] = ${S}`)})}function v(S,R){let b=(0,o.useFunc)(a,n.default),y=a.name("outer");a.label(y).for((0,r._)`;${S}--;`,()=>a.for((0,r._)`${R} = ${S}; ${R}--;`,()=>a.if((0,r._)`${b}(${c}[${S}], ${c}[${R}])`,()=>{i.error(),a.assign(f,!1).break(y)})))}}};e.default=s}),Ux=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o=Im(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,t._)`{allowedValue: ${s}}`},code(s){let{gen:i,data:a,$data:c,schemaCode:u,schema:l}=s;c||l&&typeof l=="object"?s.fail$data((0,t._)`!${(0,r.useFunc)(i,o.default)}(${a}, ${u})`):s.fail((0,t._)`${l} !== ${a}`)}};e.default=n}),Fx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o=Im(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,t._)`{allowedValues: ${s}}`},code(s){let{gen:i,data:a,$data:c,schema:u,schemaCode:l,it:d}=s;if(!c&&u.length===0)throw new Error("enum must have non-empty array");let p=u.length>=d.opts.loopEnum,g,f=()=>g??(g=(0,r.useFunc)(i,o.default)),_;if(p||c)_=i.let("valid"),s.block$data(_,m);else{if(!Array.isArray(u))throw new Error("ajv implementation error");let z=i.const("vSchema",l);_=(0,t.or)(...u.map((v,S)=>h(z,S)))}s.pass(_);function m(){i.assign(_,!1),i.forOf("v",l,z=>i.if((0,t._)`${f()}(${a}, ${z})`,()=>i.assign(_,!0).break()))}function h(z,v){let S=u[v];return typeof S=="object"&&S!==null?(0,t._)`${f()}(${a}, ${z}[${v}])`:(0,t._)`${a} === ${S}`}}};e.default=n}),T$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Cx(),r=Nx(),o=Ax(),n=Mx(),s=qx(),i=Zx(),a=Lx(),c=Dx(),u=Ux(),l=Fx(),d=[t.default,r.default,o.default,n.default,s.default,i.default,a.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,l.default];e.default=d}),I$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=de(),r=be(),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,t.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,t._)`{limit: ${s}}`},code(s){let{parentSchema:i,it:a}=s,{items:c}=i;if(!Array.isArray(c)){(0,r.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,c)}};function n(s,i){let{gen:a,schema:c,data:u,keyword:l,it:d}=s;d.items=!0;let p=a.const("len",(0,t._)`${u}.length`);if(c===!1)s.setParams({len:i.length}),s.pass((0,t._)`${p} <= ${i.length}`);else if(typeof c=="object"&&!(0,r.alwaysValidSchema)(d,c)){let f=a.var("valid",(0,t._)`${p} <= ${i.length}`);a.if((0,t.not)(f),()=>g(f)),s.ok(f)}function g(f){a.forRange("i",i.length,p,_=>{s.subschema({keyword:l,dataProp:_,dataPropType:r.Type.Num},f),d.allErrors||a.if((0,t.not)(f),()=>a.break())})}}e.validateAdditionalItems=n,e.default=o}),O$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=de(),r=be(),o=Ht(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){let{schema:a,it:c}=i;if(Array.isArray(a))return s(i,"additionalItems",a);c.items=!0,!(0,r.alwaysValidSchema)(c,a)&&i.ok((0,o.validateArray)(i))}};function s(i,a,c=i.schema){let{gen:u,parentSchema:l,data:d,keyword:p,it:g}=i;m(l),g.opts.unevaluated&&c.length&&g.items!==!0&&(g.items=r.mergeEvaluated.items(u,c.length,g.items));let f=u.name("valid"),_=u.const("len",(0,t._)`${d}.length`);c.forEach((h,z)=>{(0,r.alwaysValidSchema)(g,h)||(u.if((0,t._)`${_} > ${z}`,()=>i.subschema({keyword:p,schemaProp:z,dataProp:z},f)),i.ok(f))});function m(h){let{opts:z,errSchemaPath:v}=g,S=c.length,R=S===h.minItems&&(S===h.maxItems||h[a]===!1);if(z.strictTuples&&!R){let b=`"${p}" is ${S}-tuple, but minItems or maxItems/${a} are not specified or different at path "${v}"`;(0,r.checkStrictMode)(g,b,z.strictTuples)}}}e.validateTuple=s,e.default=n}),Vx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=O$(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o=>(0,t.validateTuple)(o,"items")};e.default=r}),Jx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o=Ht(),n=I$(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,t.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,t._)`{limit: ${i}}`},code(i){let{schema:a,parentSchema:c,it:u}=i,{prefixItems:l}=c;u.items=!0,!(0,r.alwaysValidSchema)(u,a)&&(l?(0,n.validateAdditionalItems)(i,l):i.ok((0,o.validateArray)(i)))}};e.default=s}),Hx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:s}})=>s===void 0?(0,t.str)`must contain at least ${n} valid item(s)`:(0,t.str)`must contain at least ${n} and no more than ${s} valid item(s)`,params:({params:{min:n,max:s}})=>s===void 0?(0,t._)`{minContains: ${n}}`:(0,t._)`{minContains: ${n}, maxContains: ${s}}`},code(n){let{gen:s,schema:i,parentSchema:a,data:c,it:u}=n,l,d,{minContains:p,maxContains:g}=a;u.opts.next?(l=p===void 0?1:p,d=g):l=1;let f=s.const("len",(0,t._)`${c}.length`);if(n.setParams({min:l,max:d}),d===void 0&&l===0){(0,r.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(d!==void 0&&l>d){(0,r.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(u,i)){let v=(0,t._)`${f} >= ${l}`;d!==void 0&&(v=(0,t._)`${v} && ${f} <= ${d}`),n.pass(v);return}u.items=!0;let _=s.name("valid");d===void 0&&l===1?h(_,()=>s.if(_,()=>s.break())):l===0?(s.let(_,!0),d!==void 0&&s.if((0,t._)`${c}.length > 0`,m)):(s.let(_,!1),m()),n.result(_,()=>n.reset());function m(){let v=s.name("_valid"),S=s.let("count",0);h(v,()=>s.if(v,()=>z(S)))}function h(v,S){s.forRange("i",0,f,R=>{n.subschema({keyword:"contains",dataProp:R,dataPropType:r.Type.Num,compositeRule:!0},v),S()})}function z(v){s.code((0,t._)`${v}++`),d===void 0?s.if((0,t._)`${v} >= ${l}`,()=>s.assign(_,!0).break()):(s.if((0,t._)`${v} > ${d}`,()=>s.assign(_,!1).break()),l===1?s.assign(_,!0):s.if((0,t._)`${v} >= ${l}`,()=>s.assign(_,!0)))}}};e.default=o}),Om=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=de(),r=be(),o=Ht();e.error={message:({params:{property:c,depsCount:u,deps:l}})=>{let d=u===1?"property":"properties";return(0,t.str)`must have ${d} ${l} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:l,missingProperty:d}})=>(0,t._)`{property: ${c},
127
127
  missingProperty: ${d},
128
128
  depsCount: ${u},
129
- deps: ${l}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){let[u,l]=s(c);i(c,u),a(c,l)}};function s({schema:c}){let u={},l={};for(let d in c){if(d==="__proto__")continue;let p=Array.isArray(c[d])?u:l;p[d]=c[d]}return[u,l]}function i(c,u=c.schema){let{gen:l,data:d,it:p}=c;if(Object.keys(u).length===0)return;let g=l.let("missing");for(let m in u){let v=u[m];if(v.length===0)continue;let h=(0,o.propertyInData)(l,d,m,p.opts.ownProperties);c.setParams({property:m,depsCount:v.length,deps:v.join(", ")}),p.allErrors?l.if(h,()=>{for(let f of v)(0,o.checkReportMissingProp)(c,f)}):(l.if((0,t._)`${h} && (${(0,o.checkMissingProp)(c,v,g)})`),(0,o.reportMissingProp)(c,g),l.else())}}e.validatePropertyDeps=i;function a(c,u=c.schema){let{gen:l,data:d,keyword:p,it:g}=c,m=l.name("valid");for(let v in u)(0,r.alwaysValidSchema)(g,u[v])||(l.if((0,o.propertyInData)(l,d,v,g.opts.ownProperties),()=>{let h=c.subschema({keyword:p,schemaProp:v},m);c.mergeValidEvaluated(h,m)},()=>l.var(m,!0)),c.ok(m))}e.validateSchemaDeps=a,e.default=n}),Xk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0,t._)`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:i,data:a,it:c}=n;if((0,r.alwaysValidSchema)(c,i))return;let u=s.name("valid");s.forIn("key",a,l=>{n.setParams({propertyName:l}),n.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},u),s.if((0,t.not)(u),()=>{n.error(!0),c.allErrors||s.break()})}),n.ok(u)}};e.default=o}),c$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Zt(),r=de(),o=qt(),n=be(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>(0,r._)`{additionalProperty: ${i.additionalProperty}}`},code(i){let{gen:a,schema:c,parentSchema:u,data:l,errsCount:d,it:p}=i;if(!d)throw new Error("ajv implementation error");let{allErrors:g,opts:m}=p;if(p.props=!0,m.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(p,c))return;let v=(0,t.allSchemaProperties)(u.properties),h=(0,t.allSchemaProperties)(u.patternProperties);f(),i.ok((0,r._)`${d} === ${o.default.errors}`);function f(){a.forIn("key",l,S=>{!v.length&&!h.length?b(S):a.if(z(S),()=>b(S))})}function z(S){let y;if(v.length>8){let $=(0,n.schemaRefOrVal)(p,u.properties,"properties");y=(0,t.isOwnProperty)(a,$,S)}else v.length?y=(0,r.or)(...v.map($=>(0,r._)`${S} === ${$}`)):y=r.nil;return h.length&&(y=(0,r.or)(y,...h.map($=>(0,r._)`${(0,t.usePattern)(i,$)}.test(${S})`))),(0,r.not)(y)}function _(S){a.code((0,r._)`delete ${l}[${S}]`)}function b(S){if(m.removeAdditional==="all"||m.removeAdditional&&c===!1){_(S);return}if(c===!1){i.setParams({additionalProperty:S}),i.error(),g||a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(p,c)){let y=a.name("valid");m.removeAdditional==="failing"?(R(S,y,!1),a.if((0,r.not)(y),()=>{i.reset(),_(S)})):(R(S,y),g||a.if((0,r.not)(y),()=>a.break()))}}function R(S,y,$){let I={keyword:"additionalProperties",dataProp:S,dataPropType:n.Type.Str};$===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(I,y)}}};e.default=s}),Qk=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Xo(),r=Zt(),o=be(),n=c$(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:a,schema:c,parentSchema:u,data:l,it:d}=i;d.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(d,n.default,"additionalProperties"));let p=(0,r.allSchemaProperties)(c);for(let f of p)d.definedProperties.add(f);d.opts.unevaluated&&p.length&&d.props!==!0&&(d.props=o.mergeEvaluated.props(a,(0,o.toHash)(p),d.props));let g=p.filter(f=>!(0,o.alwaysValidSchema)(d,c[f]));if(g.length===0)return;let m=a.name("valid");for(let f of g)v(f)?h(f):(a.if((0,r.propertyInData)(a,l,f,d.opts.ownProperties)),h(f),d.allErrors||a.else().var(m,!0),a.endIf()),i.it.definedProperties.add(f),i.ok(m);function v(f){return d.opts.useDefaults&&!d.compositeRule&&c[f].default!==void 0}function h(f){i.subschema({keyword:"properties",schemaProp:f,dataProp:f},m)}}};e.default=s}),ex=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Zt(),r=de(),o=be(),n=be(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:a,schema:c,data:u,parentSchema:l,it:d}=i,{opts:p}=d,g=(0,t.allSchemaProperties)(c),m=g.filter(R=>(0,o.alwaysValidSchema)(d,c[R]));if(g.length===0||m.length===g.length&&(!d.opts.unevaluated||d.props===!0))return;let v=p.strictSchema&&!p.allowMatchingProperties&&l.properties,h=a.name("valid");d.props!==!0&&!(d.props instanceof r.Name)&&(d.props=(0,n.evaluatedPropsToName)(a,d.props));let{props:f}=d;z();function z(){for(let R of g)v&&_(R),d.allErrors?b(R):(a.var(h,!0),b(R),a.if(h))}function _(R){for(let S in v)new RegExp(R).test(S)&&(0,o.checkStrictMode)(d,`property ${S} matches pattern ${R} (use allowMatchingProperties)`)}function b(R){a.forIn("key",u,S=>{a.if((0,r._)`${(0,t.usePattern)(i,R)}.test(${S})`,()=>{let y=m.includes(R);y||i.subschema({keyword:"patternProperties",schemaProp:R,dataProp:S,dataPropType:n.Type.Str},h),d.opts.unevaluated&&f!==!0?a.assign((0,r._)`${f}[${S}]`,!0):!y&&!d.allErrors&&a.if((0,r.not)(h),()=>a.break())})})}}};e.default=s}),tx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=be(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:i}=o;if((0,t.alwaysValidSchema)(i,s)){o.fail();return}let a=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),o.failResult(a,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r}),rx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Zt().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t}),ox=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0,t._)`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:i,parentSchema:a,it:c}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;let u=i,l=s.let("valid",!1),d=s.let("passing",null),p=s.name("_valid");n.setParams({passing:d}),s.block(g),n.result(l,()=>n.reset(),()=>n.error(!0));function g(){u.forEach((m,v)=>{let h;(0,r.alwaysValidSchema)(c,m)?s.var(p,!0):h=n.subschema({keyword:"oneOf",schemaProp:v,compositeRule:!0},p),v>0&&s.if((0,t._)`${p} && ${l}`).assign(l,!1).assign(d,(0,t._)`[${d}, ${v}]`).else(),s.if(p,()=>{s.assign(l,!0),s.assign(d,v),h&&n.mergeEvaluated(h,t.Name)})})}}};e.default=o}),nx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=be(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:s,it:i}=o;if(!Array.isArray(s))throw new Error("ajv implementation error");let a=n.name("valid");s.forEach((c,u)=>{if((0,t.alwaysValidSchema)(i,c))return;let l=o.subschema({keyword:"allOf",schemaProp:u},a);o.ok(a),o.mergeEvaluated(l)})}};e.default=r}),sx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,t.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,t._)`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:i,parentSchema:a,it:c}=s;a.then===void 0&&a.else===void 0&&(0,r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let u=n(c,"then"),l=n(c,"else");if(!u&&!l)return;let d=i.let("valid",!0),p=i.name("_valid");if(g(),s.reset(),u&&l){let v=i.let("ifClause");s.setParams({ifClause:v}),i.if(p,m("then",v),m("else",v))}else u?i.if(p,m("then")):i.if((0,t.not)(p),m("else"));s.pass(d,()=>s.error(!0));function g(){let v=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},p);s.mergeEvaluated(v)}function m(v,h){return()=>{let f=s.subschema({keyword:v},p);i.assign(d,p),s.mergeValidEvaluated(f,d),h?i.assign(h,(0,t._)`${v}`):s.setParams({ifClause:v})}}}};function n(s,i){let a=s.schema[i];return a!==void 0&&!(0,r.alwaysValidSchema)(s,a)}e.default=o}),ix=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=be(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){n.if===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r}),u$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=i$(),r=Gk(),o=a$(),n=Wk(),s=Yk(),i=pm(),a=Xk(),c=c$(),u=Qk(),l=ex(),d=tx(),p=rx(),g=ox(),m=nx(),v=sx(),h=ix();function f(z=!1){let _=[d.default,p.default,g.default,m.default,v.default,h.default,a.default,c.default,i.default,u.default,l.default];return z?_.push(r.default,n.default):_.push(t.default,o.default),_.push(s.default),_}e.default=f}),ax=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must match format "${o}"`,params:({schemaCode:o})=>(0,t._)`{format: ${o}}`},code(o,n){let{gen:s,data:i,$data:a,schema:c,schemaCode:u,it:l}=o,{opts:d,errSchemaPath:p,schemaEnv:g,self:m}=l;if(!d.validateFormats)return;a?v():h();function v(){let f=s.scopeValue("formats",{ref:m.formats,code:d.code.formats}),z=s.const("fDef",(0,t._)`${f}[${u}]`),_=s.let("fType"),b=s.let("format");s.if((0,t._)`typeof ${z} == "object" && !(${z} instanceof RegExp)`,()=>s.assign(_,(0,t._)`${z}.type || "string"`).assign(b,(0,t._)`${z}.validate`),()=>s.assign(_,(0,t._)`"string"`).assign(b,z)),o.fail$data((0,t.or)(R(),S()));function R(){return d.strictSchema===!1?t.nil:(0,t._)`${u} && !${b}`}function S(){let y=g.$async?(0,t._)`(${z}.async ? await ${b}(${i}) : ${b}(${i}))`:(0,t._)`${b}(${i})`,$=(0,t._)`(typeof ${b} == "function" ? ${y} : ${b}.test(${i}))`;return(0,t._)`${b} && ${b} !== true && ${_} === ${n} && !${$}`}}function h(){let f=m.formats[c];if(!f){R();return}if(f===!0)return;let[z,_,b]=S(f);z===n&&o.pass(y());function R(){if(d.strictSchema===!1){m.logger.warn($());return}throw new Error($());function $(){return`unknown format "${c}" ignored in schema at path "${p}"`}}function S($){let I=$ instanceof RegExp?(0,t.regexpCode)($):d.code.formats?(0,t._)`${d.code.formats}${(0,t.getProperty)(c)}`:void 0,q=s.scopeValue("formats",{key:c,ref:$,code:I});return typeof $=="object"&&!($ instanceof RegExp)?[$.type||"string",$.validate,(0,t._)`${q}.validate`]:["string",$,q]}function y(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!g.$async)throw new Error("async format in sync schema");return(0,t._)`await ${b}(${i})`}return typeof _=="function"?(0,t._)`${b}(${i})`:(0,t._)`${b}.test(${i})`}}}};e.default=r}),l$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[ax().default];e.default=t}),d$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),p$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n$(),r=s$(),o=u$(),n=l$(),s=d$(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i}),cx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))}),mm=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=cx(),o=Ru(),n=Qo(),s=be(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:u}})=>(0,t._)`{error: ${a}, tag: ${u}, tagValue: ${c}}`},code(a){let{gen:c,data:u,schema:l,parentSchema:d,it:p}=a,{oneOf:g}=d;if(!p.opts.discriminator)throw new Error("discriminator: requires discriminator option");let m=l.propertyName;if(typeof m!="string")throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!g)throw new Error("discriminator: requires oneOf keyword");let v=c.let("valid",!1),h=c.const("tag",(0,t._)`${u}${(0,t.getProperty)(m)}`);c.if((0,t._)`typeof ${h} == "string"`,()=>f(),()=>a.error(!1,{discrError:r.DiscrError.Tag,tag:h,tagName:m})),a.ok(v);function f(){let b=_();c.if(!1);for(let R in b)c.elseIf((0,t._)`${h} === ${R}`),c.assign(v,z(b[R]));c.else(),a.error(!1,{discrError:r.DiscrError.Mapping,tag:h,tagName:m}),c.endIf()}function z(b){let R=c.name("valid"),S=a.subschema({keyword:"oneOf",schemaProp:b},R);return a.mergeEvaluated(S,t.Name),R}function _(){var b;let R={},S=$(d),y=!0;for(let O=0;O<g.length;O++){let L=g[O];if(L?.$ref&&!(0,s.schemaHasRulesButRef)(L,p.self.RULES)){let Y=L.$ref;if(L=o.resolveRef.call(p.self,p.schemaEnv.root,p.baseId,Y),L instanceof o.SchemaEnv&&(L=L.schema),L===void 0)throw new n.default(p.opts.uriResolver,p.baseId,Y)}let K=(b=L?.properties)===null||b===void 0?void 0:b[m];if(typeof K!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${m}"`);y=y&&(S||$(L)),I(K,O)}if(!y)throw new Error(`discriminator: "${m}" must be required`);return R;function $({required:O}){return Array.isArray(O)&&O.includes(m)}function I(O,L){if(O.const)q(O.const,L);else if(O.enum)for(let K of O.enum)q(K,L);else throw new Error(`discriminator: "properties/${m}" must have "const" or "enum"`)}function q(O,L){if(typeof O!="string"||O in R)throw new Error(`discriminator: "${m}" values must be unique strings`);R[O]=L}}}};e.default=i}),ux=U((e,t)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),m$=U((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=um(),o=p$(),n=mm(),s=ux(),i=["/properties"],a="http://json-schema.org/draft-07/schema";var c=class extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let g=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(g,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var u=Xo();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var l=de();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var d=Ls();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=Qo();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),f$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=de(),r=qt(),o=Ru(),n=lm(),s={keyword:"$dynamicAnchor",schemaType:"string",code:c=>i(c,c.schema)};function i(c,u){let{gen:l,it:d}=c;d.schemaEnv.root.dynamicAnchors[u]=!0;let p=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,g=d.errSchemaPath==="#"?d.validateName:a(c);l.if((0,t._)`!${p}`,()=>l.assign(p,g))}e.dynamicAnchor=i;function a(c){let{schemaEnv:u,schema:l,self:d}=c.it,{root:p,baseId:g,localRefs:m,meta:v}=u.root,{schemaId:h}=d.opts,f=new o.SchemaEnv({schema:l,schemaId:h,root:p,baseId:g,localRefs:m,meta:v});return o.compileSchema.call(d,f),(0,n.getValidate)(c,f)}e.default=s}),h$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=de(),r=qt(),o=lm(),n={keyword:"$dynamicRef",schemaType:"string",code:i=>s(i,i.schema)};function s(i,a){let{gen:c,keyword:u,it:l}=i;if(a[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);let d=a.slice(1);if(l.allErrors)p();else{let m=c.let("valid",!1);p(m),i.ok(m)}function p(m){if(l.schemaEnv.root.dynamicAnchors[d]){let v=c.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(d)}`);c.if(v,g(v,m),g(l.validateName,m))}else g(l.validateName,m)()}function g(m,v){return v?()=>c.block(()=>{(0,o.callRef)(i,m),c.let(v,!0)}):()=>(0,o.callRef)(i,m)}}e.dynamicRef=s,e.default=n}),lx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=f$(),r=be(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o}),dx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=h$(),r={keyword:"$recursiveRef",schemaType:"string",code:o=>(0,t.dynamicRef)(o,o.schema)};e.default=r}),g$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=f$(),r=h$(),o=lx(),n=dx(),s=[t.default,r.default,o.default,n.default];e.default=s}),px=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pm(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:o=>(0,t.validatePropertyDeps)(o)};e.default=r}),mx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pm(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o=>(0,t.validateSchemaDeps)(o)};e.default=r}),fx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=be(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){n.contains===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r}),_$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=px(),r=mx(),o=fx(),n=[t.default,r.default,o.default];e.default=n}),hx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o=qt(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>(0,t._)`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:i,schema:a,data:c,errsCount:u,it:l}=s;if(!u)throw new Error("ajv implementation error");let{allErrors:d,props:p}=l;p instanceof t.Name?i.if((0,t._)`${p} !== true`,()=>i.forIn("key",c,h=>i.if(m(p,h),()=>g(h)))):p!==!0&&i.forIn("key",c,h=>p===void 0?g(h):i.if(v(p,h),()=>g(h))),l.props=!0,s.ok((0,t._)`${u} === ${o.default.errors}`);function g(h){if(a===!1){s.setParams({unevaluatedProperty:h}),s.error(),d||i.break();return}if(!(0,r.alwaysValidSchema)(l,a)){let f=i.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:h,dataPropType:r.Type.Str},f),d||i.if((0,t.not)(f),()=>i.break())}}function m(h,f){return(0,t._)`!${h} || !${h}[${f}]`}function v(h,f){let z=[];for(let _ in h)h[_]===!0&&z.push((0,t._)`${f} !== ${_}`);return(0,t.and)(...z)}}};e.default=n}),gx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>(0,t.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,t._)`{limit: ${n}}`},code(n){let{gen:s,schema:i,data:a,it:c}=n,u=c.items||0;if(u===!0)return;let l=s.const("len",(0,t._)`${a}.length`);if(i===!1)n.setParams({len:u}),n.fail((0,t._)`${l} > ${u}`);else if(typeof i=="object"&&!(0,r.alwaysValidSchema)(c,i)){let p=s.var("valid",(0,t._)`${l} <= ${u}`);s.if((0,t.not)(p),()=>d(p,u)),n.ok(p)}c.items=!0;function d(p,g){s.forRange("i",g,l,m=>{n.subschema({keyword:"unevaluatedItems",dataProp:m,dataPropType:r.Type.Num},p),c.allErrors||s.if((0,t.not)(p),()=>s.break())})}}};e.default=o}),v$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hx(),r=gx(),o=[t.default,r.default];e.default=o}),_x=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),vx=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),yx=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),Sx=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),bx=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),zx=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),$x=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),wx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_x(),r=vx(),o=yx(),n=Sx(),s=bx(),i=zx(),a=$x(),c=["/properties"];function u(l){return[t,r,o,n,d(this,s),i,d(this,a)].forEach(p=>this.addMetaSchema(p,void 0,!1)),this;function d(p,g){return l?p.$dataMetaSchema(g,c):g}}e.default=u}),Rx=U((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=um(),o=p$(),n=g$(),s=_$(),i=v$(),a=mm(),c=wx(),u="https://json-schema.org/draft/2019-09/schema";var l=class extends r.default{constructor(v={}){super({...v,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach(v=>this.addVocabulary(v)),this.addVocabulary(s.default),this.addVocabulary(i.default),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:v,meta:h}=this.opts;h&&(c.default.call(this,v),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};e.Ajv2019=l,t.exports=e=l,t.exports.Ajv2019=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var d=Xo();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var p=de();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var g=Ls();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return g.default}});var m=Qo();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})}),Px=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=n$(),r=s$(),o=u$(),n=g$(),s=_$(),i=v$(),a=l$(),c=d$(),u=[n.default,t.default,r.default,(0,o.default)(!0),a.default,c.metadataVocabulary,c.contentVocabulary,s.default,i.default];e.default=u}),Ex=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),kx=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),xx=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),Tx=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),Ix=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),Ox=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),Cx=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),Nx=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),jx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ex(),r=kx(),o=xx(),n=Tx(),s=Ix(),i=Ox(),a=Cx(),c=Nx(),u=["/properties"];function l(d){return[t,r,o,n,s,p(this,i),a,p(this,c)].forEach(g=>this.addMetaSchema(g,void 0,!1)),this;function p(g,m){return d?g.$dataMetaSchema(m,u):m}}e.default=l}),Ax=U((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=um(),o=Px(),n=mm(),s=jx(),i="https://json-schema.org/draft/2020-12/schema";var a=class extends r.default{constructor(p={}){super({...p,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(p=>this.addVocabulary(p)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:p,meta:g}=this.opts;g&&(s.default.call(this,p),this.refs["http://json-schema.org/schema"]=i)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv2020=a,t.exports=e=a,t.exports.Ajv2020=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var c=Xo();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=de();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var l=Ls();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return l.default}});var d=Qo();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),Mx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(O,L){return{validate:O,compare:L}}e.fullFormats={date:t(s,i),time:t(c(!0),u),"date-time":t(p(!0),g),"iso-time":t(c(),l),"iso-date-time":t(p(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:f,"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:q,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:_,int32:{type:"number",validate:S},int64:{type:"number",validate:y},float:{type:"number",validate:$},double:{type:"number",validate:$},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\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,g),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,l),"iso-date-time":t(/^\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,m),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},e.formatNames=Object.keys(e.fullFormats);function r(O){return O%4===0&&(O%100!==0||O%400===0)}let o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(O){let L=o.exec(O);if(!L)return!1;let K=+L[1],Y=+L[2],fe=+L[3];return Y>=1&&Y<=12&&fe>=1&&fe<=(Y===2&&r(K)?29:n[Y])}function i(O,L){if(O&&L)return O>L?1:O<L?-1:0}let a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(O){return function(K){let Y=a.exec(K);if(!Y)return!1;let fe=+Y[1],qe=+Y[2],Ie=+Y[3],Ye=Y[4],ye=Y[5]==="-"?-1:1,T=+(Y[6]||0),j=+(Y[7]||0);if(T>23||j>59||O&&!Ye)return!1;if(fe<=23&&qe<=59&&Ie<60)return!0;let F=qe-j*ye,w=fe-T*ye-(F<0?1:0);return(w===23||w===-1)&&(F===59||F===-1)&&Ie<61}}function u(O,L){if(!(O&&L))return;let K=new Date("2020-01-01T"+O).valueOf(),Y=new Date("2020-01-01T"+L).valueOf();if(K&&Y)return K-Y}function l(O,L){if(!(O&&L))return;let K=a.exec(O),Y=a.exec(L);if(K&&Y)return O=K[1]+K[2]+K[3],L=Y[1]+Y[2]+Y[3],O>L?1:O<L?-1:0}let d=/t|\s/i;function p(O){let L=c(O);return function(Y){let fe=Y.split(d);return fe.length===2&&s(fe[0])&&L(fe[1])}}function g(O,L){if(!(O&&L))return;let K=new Date(O).valueOf(),Y=new Date(L).valueOf();if(K&&Y)return K-Y}function m(O,L){if(!(O&&L))return;let[K,Y]=O.split(d),[fe,qe]=L.split(d),Ie=i(K,fe);if(Ie!==void 0)return Ie||u(Y,qe)}let v=/\/|:/,h=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function f(O){return v.test(O)&&h.test(O)}let z=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function _(O){return z.lastIndex=0,z.test(O)}let b=-(2**31),R=2**31-1;function S(O){return Number.isInteger(O)&&O<=R&&O>=b}function y(O){return Number.isInteger(O)}function $(){return!0}let I=/[^\\]\\Z/;function q(O){if(I.test(O))return!1;try{return new RegExp(O),!0}catch{return!1}}}),qx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=m$(),r=de(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:a,schemaCode:c})=>(0,r.str)`should be ${n[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>(0,r._)`{comparison: ${n[a].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(a){let{gen:c,data:u,schemaCode:l,keyword:d,it:p}=a,{opts:g,self:m}=p;if(!g.validateFormats)return;let v=new t.KeywordCxt(p,m.RULES.all.format.definition,"format");v.$data?h():f();function h(){let _=c.scopeValue("formats",{ref:m.formats,code:g.code.formats}),b=c.const("fmt",(0,r._)`${_}[${v.schemaCode}]`);a.fail$data((0,r.or)((0,r._)`typeof ${b} != "object"`,(0,r._)`${b} instanceof RegExp`,(0,r._)`typeof ${b}.compare != "function"`,z(b)))}function f(){let _=v.schema,b=m.formats[_];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw new Error(`"${d}": format "${_}" does not define "compare" function`);let R=c.scopeValue("formats",{key:_,ref:b,code:g.code.formats?(0,r._)`${g.code.formats}${(0,r.getProperty)(_)}`:void 0});a.fail$data(z(R))}function z(_){return(0,r._)`${_}.compare(${u}, ${l}) ${n[d].fail} 0`}},dependencies:["format"]};let i=a=>(a.addKeyword(e.formatLimitDefinition),a);e.default=i}),Zx=U((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=Mx(),o=qx(),n=de(),s=new n.Name("fullFormats"),i=new n.Name("fastFormats"),a=(u,l={keywords:!0})=>{if(Array.isArray(l))return c(u,l,r.fullFormats,s),u;let[d,p]=l.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];return c(u,l.formats||r.formatNames,d,p),l.keywords&&(0,o.default)(u),u};a.get=(u,l="full")=>{let d=(l==="fast"?r.fastFormats:r.fullFormats)[u];if(!d)throw new Error(`Unknown format "${u}"`);return d};function c(u,l,d,p){var g,m;(g=(m=u.opts.code).formats)!==null&&g!==void 0||(m.formats=(0,n._)`require("ajv-formats/dist/formats").${p}`);for(let v of l)u.addFormat(v,d[v])}t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}),y$=m$(),Lx=Rx(),Dx=Ax(),Ux=ai(Zx(),1),Fx=Ux.default;function cm(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Fx(t),t}var Pu=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=cm(Dx.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=wm(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return t==="2020-12"?this.ajv:t==="2019-09"?this._ajv2019??=cm(Lx.Ajv2019):this._ajvDraft7??=cm(y$.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&typeof e.$id=="string"?t.getSchema(e.$id)??t.compile(e):t.compile(e);return o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}},sj=y$.Ajv;var Eu=D$(require("node:process"),1);var k$=Symbol.for("mcp.completable");function hm(e){return!!e&&typeof e=="object"&&k$ in e}function Jx(e){return e[k$]?.complete}var Gj=2**31-1;function Hx(e,t){switch(t.kind){case"tools_list_changed":return e.toolsListChanged===!0;case"prompts_list_changed":return e.promptsListChanged===!0;case"resources_list_changed":return e.resourcesListChanged===!0;case"resource_updated":return e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.includes(t.uri)}}function Bx(e,t){let r={},o=n=>t===void 0||n===!0;return e.toolsListChanged===!0&&o(t?.tools?.listChanged)&&(r.toolsListChanged=!0),e.promptsListChanged===!0&&o(t?.prompts?.listChanged)&&(r.promptsListChanged=!0),e.resourcesListChanged===!0&&o(t?.resources?.listChanged)&&(r.resourcesListChanged=!0),e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.length>0&&o(t?.resources?.subscribe)&&(r.resourceSubscriptions=[...e.resourceSubscriptions]),r}var ku=1024;function S$(e,t){return{method:e.method,params:{...e.params,_meta:{...e.params?._meta,[Br]:t}}}}function Kx(e){let t=xr(qs).validateRequest("subscriptions/listen",e);return t.ok?t.value.params?.notifications:void 0}var Gx=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]),x$=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor(e=ku,t,r){this._maxSubscriptions=e,this._serverCapabilities=t,this._serverInfo=r}setServerCapabilities(e,t){this._serverCapabilities=e,t!==void 0&&(this._serverInfo=t)}has(e){return this._subs.has(e)}serve(e){if(this._serverCapabilities===void 0)throw new Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:e.id,error:{code:-32603,message:"Subscription limit reached"}};let t=Kx(e);if(t===void 0)return{jsonrpc:"2.0",id:e.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let r=Bx(t,this._serverCapabilities);return this._subs.set(e.id,r),S$({method:"notifications/subscriptions/acknowledged",params:{notifications:r}},e.id)}cancel(e){return this._subs.delete(e)}routeOutbound(e){if(!Gx.has(e.method))return"passthrough";let t=e.params?.uri,r=typeof t=="string"?t:void 0,o=Wx(e.method,r),n=[];for(let[s,i]of this._subs)Hx(i,o)&&n.push(S$({method:e.method,params:e.params??{}},s));return n}teardownAll(){let e=[];for(let t of this._subs.keys())e.push({jsonrpc:"2.0",id:t,result:{resultType:"complete",_meta:{[Br]:t,...this._serverInfo!==void 0&&{[Dt]:this._serverInfo}}}});return this._subs.clear(),e}};function Wx(e,t){switch(e){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:t??""}}}var Yx=8,Xx=6e5;function Qx(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??Yx,roundTimeoutMs:e?.roundTimeoutMs??Xx,legacyShim:e?.legacyShim??!0}}function T$(e,t,r){if(r===null||typeof r!="object"||typeof r.method!="string")throw new ee(J.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let o=r,n=bz(o);if(n===void 0)throw new ee(J.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${o.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:o,required:n}}function eT(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let r=[...t].map(o=>o.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function fm(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new ee(J.InternalError,t)}var tT=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:i}=this._host,a=o.mcpReq.signal,c=n,u=0;for(;;){if(u+=1,u>s)return fm(e,Fz(e,s));let l=c.inputRequests,d=l!=null&&Object.keys(l).length>0,p=typeof c.requestState=="string"?c.requestState:void 0;if(!d&&p===void 0)throw new ee(J.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let g;if(d){let h=this._host.resolvedClientCapabilities(o),f=[];for(let[_,b]of Object.entries(l)){let{embedded:R,required:S}=T$(e,_,b);if(R.method!=="roots/list"&&R.params===void 0)throw new ee(J.InternalError,`Handler for ${e} returned an input request '${_}' of kind '${R.method}' without params`);if(lu(S,h)!==void 0)return fm(e,`Cannot request input '${_}' (${R.method}): the client on this 2025-era connection did not declare the required capability${h===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);f.push([_,R])}let z=Jz(a);try{let _={relatedRequestId:o.mcpReq.id,timeout:i,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:z.signal},b=await Promise.all(f.map(async([R,S])=>{try{return[R,await this._dispatchLeg(S,_)]}catch(y){throw z.abort(y),y}}));g=Object.fromEntries(b)}catch(_){if(a.aborted)throw _;return fm(e,`Fulfilling input required by '${e}' failed: ${_ instanceof Error?_.message:String(_)}`)}finally{z.dispose()}}else await Vz(Uz,a);let m={...o,mcpReq:{...o.mcpReq,inputResponses:g,droppedInputResponseKeys:void 0,requestState:Zs(p)}};if(p!==void 0){let h=await this._host.verifyRequestState(p,m,e);h!==void 0&&(m=tm(m,h))}let v=await t(r,m);if(!nr(v))return v;c=v}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;return r.mode==="url"&&r.elicitationId===void 0&&(r={...r,elicitationId:eT()}),await this._host.sendElicitation(r,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},rT=new Set(["tools/call","prompts/get","resources/read"]),oT,I$,O$;function gm(e,t){I$(e,t)}function _m(e){return O$(e)}var xu=class extends om{_clientCapabilities;_clientVersion;static{oT=(e,t)=>{t.clientCapabilities!==void 0&&(e._clientCapabilities=t.clientCapabilities),t.clientInfo!==void 0&&(e._clientVersion=t.clientInfo)},I$=(e,t)=>{let r=t.filter(o=>!e._supportedProtocolVersions.includes(o));r.length>0&&(e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r]),e.setRequestHandler("server/discover",()=>e._ondiscover())},O$=e=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new tT({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:e=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,r)=>this._verifyRequestState(e,t,r),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){if(super(t),this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Pu,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=Qx(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))o!==void 0&&Hp(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),Lp(this._supportedProtocolVersions).length>0&&this.setRequestHandler("server/discover",()=>this._ondiscover()),this._capabilities.logging&&this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let r=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:o}=e.params,n=vu(zr,o);return n.success&&this._loggingLevels.set(r,n.data),{}})}buildContext(e,t){let r=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,n,s)=>{if(!this._capabilities.logging)return Promise.resolve();let i;if(this._servedModernEra()){if(i=e.mcpReq.envelope?.[gr],i===void 0)return Promise.resolve()}else i=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);return i!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i)?Promise.resolve():e.mcpReq.notify({method:"notifications/message",params:{level:o,data:n,logger:s}})},elicitInput:(o,n)=>this.elicitInput(o,n),requestSampling:(o,n)=>this.createMessage(o,n)},http:r?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(zr.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return r?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r):!1};registerCapabilities(e){if(this.transport)throw new le(_e.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;this._capabilities=nm(this._capabilities,e),!t&&this._capabilities.logging&&this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=rT.has(e);return r===void 0&&!o?async(n,s)=>{let i=await t(n,s);if(nr(i))throw new ee(J.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}:async(n,s)=>{let i=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(nr(i)){if(!o)throw new ee(J.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}return r===void 0?i:du(i,r)}}return async(r,o)=>{let n=xr(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new ee(s.reason==="not-in-era"?J.InternalError:J.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let i=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(nr(i))return i;let a=Dp(i),c=n.validateResult("tools/call",a);if(!c.ok)throw new ee(c.reason==="not-in-era"?J.InternalError:J.InvalidParams,c.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${c.message}`);return c.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&Wo(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,r,o){let n=this._servedModernEra(),s=o.mcpReq.requestState();if(s!==void 0&&typeof s!="string")throw new ee(J.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let i=o;if(typeof s=="string"){let d=await this._verifyRequestState(s,o,e);d!==void 0&&(i=tm(o,d))}let a;try{a=await t(r,i)}catch(d){throw d instanceof ee&&d.code===J.UrlElicitationRequired&&n?new ee(J.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { \u2026: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`):d}if(!nr(a))return a;if(!n){if(!this._inputRequiredServing.legacyShim)throw new ee(J.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??Hr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,i,a)}let c=a.inputRequests,u=c!=null&&Object.keys(c).length>0,l=typeof a.requestState=="string";if(!u&&!l)throw new ee(J.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let d=this._inputRequestCapabilityView(o);for(let[p,g]of Object.entries(c)){let{embedded:m,required:v}=T$(e,p,g),h=lu(v,d);if(h!==void 0)throw new mu({requiredCapabilities:h},`Cannot request input '${p}' (${m.method}): the request's client capabilities do not declare the required capability`)}}return a}async _verifyRequestState(e,t,r){if(this._requestStateVerify!==void 0)try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(new Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new ee(J.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[Qt]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new le(_e.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead \u2014 the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new le(_e.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new le(_e.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new le(_e.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new le(_e.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new le(_e.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new le(_e.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new le(_e.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new le(_e.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new le(_e.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new le(_e.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new le(_e.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new le(_e.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new le(_e.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let r=$z(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??Hr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:Lp(this._supportedProtocolVersions),capabilities:nT(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new le(_e.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),i=Array.isArray(s.content)?s.content:[s.content],a=i.some(d=>d.type==="tool_result"),c=e.messages.length>1?e.messages.at(-2):void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],l=u.some(d=>d.type==="tool_use");if(a){if(i.some(d=>d.type!=="tool_result"))throw new ee(J.InvalidParams,"The last message must contain only tool_result content if any is present");if(!l)throw new ee(J.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(l){let d=new Set(u.filter(g=>g.type==="tool_use").map(g=>g.id)),p=new Set(i.filter(g=>g.type==="tool_result").map(g=>g.toolUseId));if(d.size!==p.size||![...d].every(g=>p.has(g)))throw new ee(J.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=!!(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),n=this._wireCodec().samplingResultVariant(r,o);if(!n.ok)throw new le(_e.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new le(_e.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new le(_e.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,r){let o=e.mode??"form",n=r?.validateAcceptedContent??!0;switch(o){case"url":{let s=e;return this.request({method:"elicitation/create",params:s},t)}case"form":{let s=e.mode==="form"?e:{...e,mode:"form"},i=await this.request({method:"elicitation/create",params:s},t);if(n&&i.action==="accept"&&i.content&&s.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(s.requestedSchema)(i.content);if(!a.valid)throw new ee(J.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(a){throw a instanceof ee?a:new ee(J.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new le(_e.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function nT(e){return{...e}}var vm=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(!(t===void 0||!t.enabled)){if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return z$;try{let r=Or(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}}constructor(e,t){this.server=new xu(e,t),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}_toolHandlersInitialized=!1;setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?Or(t.inputSchema,"input"):z$,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};return t.outputSchema&&(r.outputSchema=Or(t.outputSchema,"output")),r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new ee(J.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new ee(J.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(r,e.params.arguments,e.params.name),n=await this.executeToolHandler(r,o,t);return await this.validateToolOutput(r,n,e.params.name),nr(n)?n:this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof ee&&o.code===J.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(!e.inputSchema)return;let o=await Xr(e.inputSchema,t??{});if(!o.success)throw new ee(J.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema||nr(t)||t.isError)return;if(t.structuredContent===void 0)throw new ee(J.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let o=await Xr(e.outputSchema,t.structuredContent);if(!o.success)throw new ee(J.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${o.error}`)}async executeToolHandler(e,t,r){return e.executor(t,r)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async e=>{switch(e.params.ref.type){case"ref/prompt":return Gp(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Wp(e),this.handleResourceCompletion(e,e.params.ref);default:throw new ee(J.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new ee(J.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new ee(J.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Ds;let o=E$(P$(r.argsSchema)?.[e.params.argument.name]);if(!hm(o))return Ds;let n=Jx(o);return n?R$(await n(e.params.argument.value,e.params.context)):Ds}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find(n=>n.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return Ds;throw new ee(J.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);return o?R$(await o(e.params.argument.value,e.params.context)):Ds}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,s])=>s.enabled).map(([n,s])=>({uri:n,name:s.name,...s.metadata})),o=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let s=await n.resourceTemplate.listCallback(t);for(let i of s.resources)o.push({...n.metadata,...i})}return{resources:[...r,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let r;try{r=new URL(e.params.uri)}catch{throw new ee(J.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[r.toString()];if(o){if(!o.enabled)throw new ee(J.InvalidParams,`Resource ${r} disabled`);return du(await o.readCallback(r,t),o.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let s=n.resourceTemplate.uriTemplate.match(r.toString());if(s)return du(await n.readCallback(r,s,t),n.cacheHint)}throw new pu(e.params.uri)}),this._resourceHandlersInitialized=!0)}_promptHandlersInitialized=!1;setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?Dz(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new ee(J.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new ee(J.InvalidParams,`Prompt ${e.params.name} disabled`);return r.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0)}registerResource(e,t,r,o){let n=r.cacheHint,s=r;if(n!==void 0){Hp(n,`resource ${e}`);let i={...r};delete i.cacheHint,s=i}if(typeof t=="string"){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);let i=this._createRegisteredResource(e,r.title,t,s,o);return n!==void 0&&(i.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let i=this._createRegisteredResourceTemplate(e,r.title,t,s,o);return n!==void 0&&(i.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}}_createRegisteredResource(e,t,r,o,n){let s={name:e,title:t,metadata:o,readCallback:n,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:i=>{i.uri!==void 0&&i.uri!==r&&(delete this._registeredResources[r],i.uri&&(this._registeredResources[i.uri]=s)),i.name!==void 0&&(s.name=i.name),i.title!==void 0&&(s.title=i.title),i.metadata!==void 0&&(s.metadata=i.metadata),i.callback!==void 0&&(s.readCallback=i.callback),i.enabled!==void 0&&(s.enabled=i.enabled),this.sendResourceListChanged()}};return this._registeredResources[r]=s,s}_createRegisteredResourceTemplate(e,t,r,o,n){let s={resourceTemplate:r,title:t,metadata:o,readCallback:n,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{a.name!==void 0&&a.name!==e&&(delete this._registeredResourceTemplates[e],a.name&&(this._registeredResourceTemplates[a.name]=s)),a.title!==void 0&&(s.title=a.title),a.template!==void 0&&(s.resourceTemplate=a.template),a.metadata!==void 0&&(s.metadata=a.metadata),a.callback!==void 0&&(s.readCallback=a.callback),a.enabled!==void 0&&(s.enabled=a.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let i=r.uriTemplate.variableNames;return Array.isArray(i)&&i.some(a=>!!r.completeCallback(a))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,t,r,o,n,s,i){let a=o,c=n,u={title:t,description:r,argsSchema:o,icons:s,_meta:i,handler:w$(e,o,n),enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:l=>{l.name!==void 0&&l.name!==e&&(delete this._registeredPrompts[e],l.name&&(this._registeredPrompts[l.name]=u)),l.title!==void 0&&(u.title=l.title),l.description!==void 0&&(u.description=l.description),l.icons!==void 0&&(u.icons=l.icons),l._meta!==void 0&&(u._meta=l._meta);let d=!1;l.argsSchema!==void 0&&(u.argsSchema=l.argsSchema,a=l.argsSchema,d=!0),l.callback!==void 0&&(c=l.callback,d=!0),d&&(u.handler=w$(e,a,c)),l.enabled!==void 0&&(u.enabled=l.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[e]=u,o){let l=P$(o);l&&Object.values(l).some(d=>hm(E$(d)))&&this.setCompletionRequestHandler()}return u}_createRegisteredTool(e,t,r,o,n,s,i,a,c,u){if(am(e),o!==void 0)try{let p=Or(o,"input");this._toolInputSchemaJson[e]=p;let g=Yp(p);g.valid||console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${g.reason}`)}catch{}let l=u,d={title:t,description:r,inputSchema:o,outputSchema:n,outputSchemaJson:$$(n),annotations:s,icons:i,execution:a,_meta:c,handler:u,executor:b$(o,u),enabled:!0,disable:()=>d.update({enabled:!1}),enable:()=>d.update({enabled:!0}),remove:()=>d.update({name:null}),update:p=>{p.name!==void 0&&p.name!==e&&(typeof p.name=="string"&&am(p.name),delete this._registeredTools[e],delete this._toolInputSchemaJson[e],p.name&&(delete this._toolInputSchemaJson[p.name],this._registeredTools[p.name]=d,e=p.name)),p.title!==void 0&&(d.title=p.title),p.description!==void 0&&(d.description=p.description);let g=!1;p.paramsSchema!==void 0&&(d.inputSchema=p.paramsSchema,delete this._toolInputSchemaJson[e],g=!0),p.callback!==void 0&&(d.handler=p.callback,l=p.callback,g=!0),g&&(d.executor=b$(d.inputSchema,l)),p.outputSchema!==void 0&&(d.outputSchema=p.outputSchema,d.outputSchemaJson=$$(p.outputSchema)),p.annotations!==void 0&&(d.annotations=p.annotations),p.icons!==void 0&&(d.icons=p.icons),p._meta!==void 0&&(d._meta=p._meta),p.enabled!==void 0&&(d.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=d,this.setToolRequestHandlers(),this.sendToolListChanged(),d}registerTool(e,t,r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:o,description:n,inputSchema:s,outputSchema:i,annotations:a,icons:c,_meta:u}=t;return this._createRegisteredTool(e,o,n,yu(s),yu(i),a,c,void 0,u,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:o,description:n,argsSchema:s,icons:i,_meta:a}=t,c=this._createRegisteredPrompt(e,o,n,yu(s),r,i,a);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};function b$(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var z$={type:"object",properties:{}};function $$(e){if(e!==void 0)try{return Or(e,"output")}catch{return}}function w$(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await Xr(t,n);if(!i.success)throw new ee(J.InvalidParams,`Invalid arguments for prompt ${e}: ${i.error}`);return o(i.data,s)}}else{let o=r;return async(n,s)=>o(s)}}function R$(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var Ds={completion:{values:[],hasMore:!1}};function P$(e){let t=e;if(t.shape&&typeof t.shape=="object")return t.shape}function sT(e){return e?.type==="optional"}function E$(e){return sT(e)?e.def?.innerType??e:e}var iT=class{_readBuffer;_started=!1;_closed=!1;constructor(e=Eu.default.stdin,t=Eu.default.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new sm({maxBufferSize:r?.maxBufferSize})}onclose;onerror;onmessage;_ondata=e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(t){this.onerror?.(t),this.close().catch(()=>{})}};_onerror=e=>{this.onerror?.(e)};_onstdouterror=e=>{this.onerror?.(e),this.close().catch(()=>{})};async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._closed||(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdout.off("error",this._onstdouterror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.())}send(e){return this._closed?Promise.reject(new Error("StdioServerTransport is closed")):new Promise((t,r)=>{let o=im(e),n=!1,s=a=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),r(a))},i=()=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),t())};if(this._stdout.once("error",s),this._stdout.write(o)){if(n)return;n=!0,this._stdout.off("error",s),t()}else n||this._stdout.once("drain",i)})}},C$=3e3,aT=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor(e,t,r){this._wire=e,this._onInstanceClose=t,this._outboundIntercept=r}async start(){}async send(e,t){if(As(e)||_u(e)){let{id:r}=e;r!==void 0&&this._settle(r)}if(!this._closed&&this._outboundIntercept?.(e)!=="handled")return this._wire.send(e,t)}setProtocolVersion=e=>{this._wire.setProtocolVersion?.(e)};deliver(e,t){if(!this._closed){if(Tt(e))this._pendingRequests.add(e.id);else if(Ir(e)&&e.method==="notifications/cancelled"){let r=e.params?.requestId;r!==void 0&&this._settle(r)}this.onmessage?.(e,t)}}async whenRequestsAnswered(e){return this._closed||this._pendingRequests.size===0?!0:await new Promise(t=>{let r=()=>{clearTimeout(o),t(!0)},o=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter(n=>n!==r),t(!1)},e);this._drainWaiters.push(r)})}async close(){if(!this._closed){this._closed=!0,this._pendingRequests.clear(),this._releaseDrainWaiters();try{this._onInstanceClose()}finally{this.onclose?.()}}}_settle(e){this._pendingRequests.delete(e),this._pendingRequests.size===0&&this._releaseDrainWaiters()}_releaseDrainWaiters(){let e=this._drainWaiters;this._drainWaiters=[];for(let t of e)t()}};function cT(e){let t=e.params;if(e.method==="initialize"&&!Xp(t)){let s=t!==null&&typeof t=="object"&&typeof t.protocolVersion=="string"?t.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...s!==void 0&&{requestedVersion:s}}}if(!fu(t))return{kind:"legacy",reason:"no-claim"};let r=eo(t),o=(r===void 0?[]:gu(r))[0];if(o!==void 0)return{kind:"invalid-envelope",issue:o};let n=hu(t);return n===void 0||!Tr.includes(n)?{kind:"unsupported-revision",requested:n??"unknown"}:{kind:"modern",revision:n,classification:{era:"modern",revision:n}}}function N$(e,t={}){let r=t.legacy??"serve",o=t.transport??new iT,n={phase:"opening"},s,i=!1,a=()=>i||n.phase==="closed",c=$=>{try{t.onerror?.($)}catch{}},u=($,I,q,O)=>o.send({jsonrpc:"2.0",id:$,error:{code:I,message:q,...O!==void 0&&{data:O}}}).catch(L=>c(Lt(L))),l=new x$(t.maxSubscriptions??ku),d=$=>{if(!Ir($))return;let I=l.routeOutbound($);if(I!=="passthrough"){for(let q of I)o.send({jsonrpc:"2.0",...q}).catch(O=>c(Lt(O)));return"handled"}},p=async $=>{if(Tt($)&&$.method==="subscriptions/listen"){let I=eo($.params),q=fu($.params)?(I===void 0?[]:gu(I))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},O=hu($.params),L;if(q!==void 0)L={jsonrpc:"2.0",id:$.id,error:{code:-32602,message:`Invalid _meta envelope: ${q.key}: ${q.problem}`}};else if(O===void 0||!Tr.includes(O)){let K=new Yo({supported:[...Tr],requested:O??"unknown"});L={jsonrpc:"2.0",id:$.id,error:{code:K.code,message:K.message,data:K.data}}}else L=l.serve($);return await o.send("error"in L?L:{jsonrpc:"2.0",method:L.method,params:L.params}).catch(K=>c(Lt(K))),!0}if(Ir($)&&$.method==="notifications/cancelled"){let I=$.params?.requestId;if(I!==void 0&&l.cancel(I))return!0}return!1},g=($,I,q)=>{let O=Qp({kind:"legacy",reason:I,...q!==void 0&&{requestedVersion:q}},Tr);return O===void 0?Promise.resolve():(c(new Error(`Rejected 2025-era request on a modern-only stdio connection (${O.cell}): ${O.message}`)),u($.id,O.code,O.message,O.data))},m=$=>{i||$===s||S()},v=async($,I)=>{let q=await e({era:$}),O=q instanceof vm?q.server:q;$==="modern"&&(rm(O,I),gm(O,Tr),l.setServerCapabilities(O.getCapabilities(),_m(O)));let L=new aT(o,()=>m(L),$==="modern"?d:void 0);return await q.connect(L),{product:q,channel:L}},h=$=>$.product.close().catch(I=>c(Lt(I))),f=async $=>{s=$.channel;try{await $.channel.whenRequestsAnswered(C$)||c(new Error(`Discarded the probe instance with requests still unanswered after ${C$}ms; continuing with the fallback`)),await $.product.close()}catch(I){c(Lt(I))}finally{s=void 0}},z=async $=>{if(n.phase==="closed")return;if(n.phase==="pinned"){if(n.era==="modern"&&Tt($)&&$.method==="initialize"&&!Xp($.params)){await g($,"initialize",$.params!==null&&typeof $.params=="object"&&typeof $.params.protocolVersion=="string"?$.params.protocolVersion:void 0);return}if(n.era==="modern"&&await p($))return;n.instance.channel.deliver($);return}if(!Tt($)&&!Ir($)){c(new Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let I=cT($);switch(I.kind){case"invalid-envelope":{let q=`Invalid _meta envelope for protocol revision 2026-07-28: ${I.issue.key}: ${I.issue.problem}`;Tt($)?await u($.id,J.InvalidParams,q,{envelope:I.issue}):c(new Error(`Discarded a notification with a malformed envelope: ${q}`));return}case"unsupported-revision":if(Tt($)){let q=new Yo({supported:[...Tr],requested:I.requested});c(q),await u($.id,q.code,q.message,q.data)}else c(new Error(`Discarded a notification claiming unsupported protocol revision ${I.requested}`));return;case"modern":if(Tt($)&&$.method==="server/discover"){if(n.phase==="probe"){n.instance.channel.deliver($,{classification:I.classification});return}let q=await v("modern",I.revision);if(a()){await h(q);return}n={phase:"probe",instance:q},q.channel.deliver($,{classification:I.classification});return}if(n.phase==="probe"){if(Ir($)){n.instance.channel.deliver($,{classification:I.classification});return}n={phase:"pinned",era:"modern",instance:n.instance}}else{let q=await v("modern",I.revision);if(a()){await h(q);return}n={phase:"pinned",era:"modern",instance:q}}if(await p($))return;n.instance.channel.deliver($,{classification:I.classification});return;case"legacy":{if(r==="reject"){Tt($)&&await g($,I.reason,I.requestedVersion);return}if(n.phase==="probe"){if(await f(n.instance),a())return;n={phase:"opening"}}let q=await v("legacy");if(a()){await h(q);return}n={phase:"pinned",era:"legacy",instance:q},n.instance.channel.deliver($);return}}},_=[],b=!1,R=async()=>{if(!b){b=!0;try{for(;_.length>0;){let $=_.shift();try{await z($)}catch(I){Tt($)&&await u($.id,J.InternalError,"Internal server error"),c(Lt(I))}}}finally{b=!1}}},S=async()=>{if(i||n.phase==="closed")return;i=!0;let $=n;n={phase:"closed"};for(let I of l.teardownAll())await o.send(I).catch(q=>c(Lt(q)));($.phase==="probe"||$.phase==="pinned")&&await $.instance.product.close().catch(I=>c(Lt(I))),await o.close().catch(I=>c(Lt(I)))};o.onmessage=$=>{_.push($),R()},o.onerror=$=>{c($),(n.phase==="probe"||n.phase==="pinned")&&n.instance.channel.onerror?.($)},o.onclose=()=>{if(i||n.phase==="closed")return;i=!0;let $=n;n={phase:"closed"},($.phase==="probe"||$.phase==="pinned")&&$.instance.product.close().catch(I=>c(Lt(I)))};let y=o.start().catch($=>{throw c(Lt($)),$});return y.catch(()=>{}),{close:async()=>{await y.catch(()=>{}),await S()}}}function Lt(e){return e instanceof Error?e:new Error(String(e))}0&&(module.exports={ProtocolError,ProtocolErrorCode,Server,serveStdio});
129
+ deps: ${l}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){let[u,l]=s(c);i(c,u),a(c,l)}};function s({schema:c}){let u={},l={};for(let d in c){if(d==="__proto__")continue;let p=Array.isArray(c[d])?u:l;p[d]=c[d]}return[u,l]}function i(c,u=c.schema){let{gen:l,data:d,it:p}=c;if(Object.keys(u).length===0)return;let g=l.let("missing");for(let f in u){let _=u[f];if(_.length===0)continue;let m=(0,o.propertyInData)(l,d,f,p.opts.ownProperties);c.setParams({property:f,depsCount:_.length,deps:_.join(", ")}),p.allErrors?l.if(m,()=>{for(let h of _)(0,o.checkReportMissingProp)(c,h)}):(l.if((0,t._)`${m} && (${(0,o.checkMissingProp)(c,_,g)})`),(0,o.reportMissingProp)(c,g),l.else())}}e.validatePropertyDeps=i;function a(c,u=c.schema){let{gen:l,data:d,keyword:p,it:g}=c,f=l.name("valid");for(let _ in u)(0,r.alwaysValidSchema)(g,u[_])||(l.if((0,o.propertyInData)(l,d,_,g.opts.ownProperties),()=>{let m=c.subschema({keyword:p,schemaProp:_},f);c.mergeValidEvaluated(m,f)},()=>l.var(f,!0)),c.ok(f))}e.validateSchemaDeps=a,e.default=n}),Bx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0,t._)`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:i,data:a,it:c}=n;if((0,r.alwaysValidSchema)(c,i))return;let u=s.name("valid");s.forIn("key",a,l=>{n.setParams({propertyName:l}),n.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},u),s.if((0,t.not)(u),()=>{n.error(!0),c.allErrors||s.break()})}),n.ok(u)}};e.default=o}),C$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ht(),r=de(),o=Jt(),n=be(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>(0,r._)`{additionalProperty: ${i.additionalProperty}}`},code(i){let{gen:a,schema:c,parentSchema:u,data:l,errsCount:d,it:p}=i;if(!d)throw new Error("ajv implementation error");let{allErrors:g,opts:f}=p;if(p.props=!0,f.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(p,c))return;let _=(0,t.allSchemaProperties)(u.properties),m=(0,t.allSchemaProperties)(u.patternProperties);h(),i.ok((0,r._)`${d} === ${o.default.errors}`);function h(){a.forIn("key",l,b=>{!_.length&&!m.length?S(b):a.if(z(b),()=>S(b))})}function z(b){let y;if(_.length>8){let $=(0,n.schemaRefOrVal)(p,u.properties,"properties");y=(0,t.isOwnProperty)(a,$,b)}else _.length?y=(0,r.or)(..._.map($=>(0,r._)`${b} === ${$}`)):y=r.nil;return m.length&&(y=(0,r.or)(y,...m.map($=>(0,r._)`${(0,t.usePattern)(i,$)}.test(${b})`))),(0,r.not)(y)}function v(b){a.code((0,r._)`delete ${l}[${b}]`)}function S(b){if(f.removeAdditional==="all"||f.removeAdditional&&c===!1){v(b);return}if(c===!1){i.setParams({additionalProperty:b}),i.error(),g||a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(p,c)){let y=a.name("valid");f.removeAdditional==="failing"?(R(b,y,!1),a.if((0,r.not)(y),()=>{i.reset(),v(b)})):(R(b,y),g||a.if((0,r.not)(y),()=>a.break()))}}function R(b,y,$){let T={keyword:"additionalProperties",dataProp:b,dataPropType:n.Type.Str};$===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(T,y)}}};e.default=s}),Kx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dn(),r=Ht(),o=be(),n=C$(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:a,schema:c,parentSchema:u,data:l,it:d}=i;d.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(d,n.default,"additionalProperties"));let p=(0,r.allSchemaProperties)(c);for(let h of p)d.definedProperties.add(h);d.opts.unevaluated&&p.length&&d.props!==!0&&(d.props=o.mergeEvaluated.props(a,(0,o.toHash)(p),d.props));let g=p.filter(h=>!(0,o.alwaysValidSchema)(d,c[h]));if(g.length===0)return;let f=a.name("valid");for(let h of g)_(h)?m(h):(a.if((0,r.propertyInData)(a,l,h,d.opts.ownProperties)),m(h),d.allErrors||a.else().var(f,!0),a.endIf()),i.it.definedProperties.add(h),i.ok(f);function _(h){return d.opts.useDefaults&&!d.compositeRule&&c[h].default!==void 0}function m(h){i.subschema({keyword:"properties",schemaProp:h,dataProp:h},f)}}};e.default=s}),Gx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ht(),r=de(),o=be(),n=be(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:a,schema:c,data:u,parentSchema:l,it:d}=i,{opts:p}=d,g=(0,t.allSchemaProperties)(c),f=g.filter(R=>(0,o.alwaysValidSchema)(d,c[R]));if(g.length===0||f.length===g.length&&(!d.opts.unevaluated||d.props===!0))return;let _=p.strictSchema&&!p.allowMatchingProperties&&l.properties,m=a.name("valid");d.props!==!0&&!(d.props instanceof r.Name)&&(d.props=(0,n.evaluatedPropsToName)(a,d.props));let{props:h}=d;z();function z(){for(let R of g)_&&v(R),d.allErrors?S(R):(a.var(m,!0),S(R),a.if(m))}function v(R){for(let b in _)new RegExp(R).test(b)&&(0,o.checkStrictMode)(d,`property ${b} matches pattern ${R} (use allowMatchingProperties)`)}function S(R){a.forIn("key",u,b=>{a.if((0,r._)`${(0,t.usePattern)(i,R)}.test(${b})`,()=>{let y=f.includes(R);y||i.subschema({keyword:"patternProperties",schemaProp:R,dataProp:b,dataPropType:n.Type.Str},m),d.opts.unevaluated&&h!==!0?a.assign((0,r._)`${h}[${b}]`,!0):!y&&!d.allErrors&&a.if((0,r.not)(m),()=>a.break())})})}}};e.default=s}),Wx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=be(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:i}=o;if((0,t.alwaysValidSchema)(i,s)){o.fail();return}let a=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),o.failResult(a,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r}),Yx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Ht().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t}),Xx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0,t._)`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:i,parentSchema:a,it:c}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;let u=i,l=s.let("valid",!1),d=s.let("passing",null),p=s.name("_valid");n.setParams({passing:d}),s.block(g),n.result(l,()=>n.reset(),()=>n.error(!0));function g(){u.forEach((f,_)=>{let m;(0,r.alwaysValidSchema)(c,f)?s.var(p,!0):m=n.subschema({keyword:"oneOf",schemaProp:_,compositeRule:!0},p),_>0&&s.if((0,t._)`${p} && ${l}`).assign(l,!1).assign(d,(0,t._)`[${d}, ${_}]`).else(),s.if(p,()=>{s.assign(l,!0),s.assign(d,_),m&&n.mergeEvaluated(m,t.Name)})})}}};e.default=o}),Qx=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=be(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:s,it:i}=o;if(!Array.isArray(s))throw new Error("ajv implementation error");let a=n.name("valid");s.forEach((c,u)=>{if((0,t.alwaysValidSchema)(i,c))return;let l=o.subschema({keyword:"allOf",schemaProp:u},a);o.ok(a),o.mergeEvaluated(l)})}};e.default=r}),eT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,t.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,t._)`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:i,parentSchema:a,it:c}=s;a.then===void 0&&a.else===void 0&&(0,r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let u=n(c,"then"),l=n(c,"else");if(!u&&!l)return;let d=i.let("valid",!0),p=i.name("_valid");if(g(),s.reset(),u&&l){let _=i.let("ifClause");s.setParams({ifClause:_}),i.if(p,f("then",_),f("else",_))}else u?i.if(p,f("then")):i.if((0,t.not)(p),f("else"));s.pass(d,()=>s.error(!0));function g(){let _=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},p);s.mergeEvaluated(_)}function f(_,m){return()=>{let h=s.subschema({keyword:_},p);i.assign(d,p),s.mergeValidEvaluated(h,d),m?i.assign(m,(0,t._)`${_}`):s.setParams({ifClause:_})}}}};function n(s,i){let a=s.schema[i];return a!==void 0&&!(0,r.alwaysValidSchema)(s,a)}e.default=o}),tT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=be(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){n.if===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r}),N$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=I$(),r=Vx(),o=O$(),n=Jx(),s=Hx(),i=Om(),a=Bx(),c=C$(),u=Kx(),l=Gx(),d=Wx(),p=Yx(),g=Xx(),f=Qx(),_=eT(),m=tT();function h(z=!1){let v=[d.default,p.default,g.default,f.default,_.default,m.default,a.default,c.default,i.default,u.default,l.default];return z?v.push(r.default,n.default):v.push(t.default,o.default),v.push(s.default),v}e.default=h}),rT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must match format "${o}"`,params:({schemaCode:o})=>(0,t._)`{format: ${o}}`},code(o,n){let{gen:s,data:i,$data:a,schema:c,schemaCode:u,it:l}=o,{opts:d,errSchemaPath:p,schemaEnv:g,self:f}=l;if(!d.validateFormats)return;a?_():m();function _(){let h=s.scopeValue("formats",{ref:f.formats,code:d.code.formats}),z=s.const("fDef",(0,t._)`${h}[${u}]`),v=s.let("fType"),S=s.let("format");s.if((0,t._)`typeof ${z} == "object" && !(${z} instanceof RegExp)`,()=>s.assign(v,(0,t._)`${z}.type || "string"`).assign(S,(0,t._)`${z}.validate`),()=>s.assign(v,(0,t._)`"string"`).assign(S,z)),o.fail$data((0,t.or)(R(),b()));function R(){return d.strictSchema===!1?t.nil:(0,t._)`${u} && !${S}`}function b(){let y=g.$async?(0,t._)`(${z}.async ? await ${S}(${i}) : ${S}(${i}))`:(0,t._)`${S}(${i})`,$=(0,t._)`(typeof ${S} == "function" ? ${y} : ${S}.test(${i}))`;return(0,t._)`${S} && ${S} !== true && ${v} === ${n} && !${$}`}}function m(){let h=f.formats[c];if(!h){R();return}if(h===!0)return;let[z,v,S]=b(h);z===n&&o.pass(y());function R(){if(d.strictSchema===!1){f.logger.warn($());return}throw new Error($());function $(){return`unknown format "${c}" ignored in schema at path "${p}"`}}function b($){let T=$ instanceof RegExp?(0,t.regexpCode)($):d.code.formats?(0,t._)`${d.code.formats}${(0,t.getProperty)(c)}`:void 0,C=s.scopeValue("formats",{key:c,ref:$,code:T});return typeof $=="object"&&!($ instanceof RegExp)?[$.type||"string",$.validate,(0,t._)`${C}.validate`]:["string",$,C]}function y(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!g.$async)throw new Error("async format in sync schema");return(0,t._)`await ${S}(${i})`}return typeof v=="function"?(0,t._)`${S}(${i})`:(0,t._)`${S}.test(${i})`}}}};e.default=r}),j$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[rT().default];e.default=t}),A$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),M$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=x$(),r=T$(),o=N$(),n=j$(),s=A$(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i}),oT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))}),Cm=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=oT(),o=qu(),n=pn(),s=be(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:u}})=>(0,t._)`{error: ${a}, tag: ${u}, tagValue: ${c}}`},code(a){let{gen:c,data:u,schema:l,parentSchema:d,it:p}=a,{oneOf:g}=d;if(!p.opts.discriminator)throw new Error("discriminator: requires discriminator option");let f=l.propertyName;if(typeof f!="string")throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!g)throw new Error("discriminator: requires oneOf keyword");let _=c.let("valid",!1),m=c.const("tag",(0,t._)`${u}${(0,t.getProperty)(f)}`);c.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>a.error(!1,{discrError:r.DiscrError.Tag,tag:m,tagName:f})),a.ok(_);function h(){let S=v();c.if(!1);for(let R in S)c.elseIf((0,t._)`${m} === ${R}`),c.assign(_,z(S[R]));c.else(),a.error(!1,{discrError:r.DiscrError.Mapping,tag:m,tagName:f}),c.endIf()}function z(S){let R=c.name("valid"),b=a.subschema({keyword:"oneOf",schemaProp:S},R);return a.mergeEvaluated(b,t.Name),R}function v(){var S;let R={},b=$(d),y=!0;for(let O=0;O<g.length;O++){let L=g[O];if(L?.$ref&&!(0,s.schemaHasRulesButRef)(L,p.self.RULES)){let G=L.$ref;if(L=o.resolveRef.call(p.self,p.schemaEnv.root,p.baseId,G),L instanceof o.SchemaEnv&&(L=L.schema),L===void 0)throw new n.default(p.opts.uriResolver,p.baseId,G)}let H=(S=L?.properties)===null||S===void 0?void 0:S[f];if(typeof H!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);y=y&&(b||$(L)),T(H,O)}if(!y)throw new Error(`discriminator: "${f}" must be required`);return R;function $({required:O}){return Array.isArray(O)&&O.includes(f)}function T(O,L){if(O.const)C(O.const,L);else if(O.enum)for(let H of O.enum)C(H,L);else throw new Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function C(O,L){if(typeof O!="string"||O in R)throw new Error(`discriminator: "${f}" values must be unique strings`);R[O]=L}}}};e.default=i}),nT=U((e,t)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),q$=U((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=xm(),o=M$(),n=Cm(),s=nT(),i=["/properties"],a="http://json-schema.org/draft-07/schema";var c=class extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let g=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(g,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var u=dn();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var l=de();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var d=ti();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var p=pn();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})}),Z$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=de(),r=Jt(),o=qu(),n=Tm(),s={keyword:"$dynamicAnchor",schemaType:"string",code:c=>i(c,c.schema)};function i(c,u){let{gen:l,it:d}=c;d.schemaEnv.root.dynamicAnchors[u]=!0;let p=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,g=d.errSchemaPath==="#"?d.validateName:a(c);l.if((0,t._)`!${p}`,()=>l.assign(p,g))}e.dynamicAnchor=i;function a(c){let{schemaEnv:u,schema:l,self:d}=c.it,{root:p,baseId:g,localRefs:f,meta:_}=u.root,{schemaId:m}=d.opts,h=new o.SchemaEnv({schema:l,schemaId:m,root:p,baseId:g,localRefs:f,meta:_});return o.compileSchema.call(d,h),(0,n.getValidate)(c,h)}e.default=s}),L$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=de(),r=Jt(),o=Tm(),n={keyword:"$dynamicRef",schemaType:"string",code:i=>s(i,i.schema)};function s(i,a){let{gen:c,keyword:u,it:l}=i;if(a[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);let d=a.slice(1);if(l.allErrors)p();else{let f=c.let("valid",!1);p(f),i.ok(f)}function p(f){if(l.schemaEnv.root.dynamicAnchors[d]){let _=c.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(d)}`);c.if(_,g(_,f),g(l.validateName,f))}else g(l.validateName,f)()}function g(f,_){return _?()=>c.block(()=>{(0,o.callRef)(i,f),c.let(_,!0)}):()=>(0,o.callRef)(i,f)}}e.dynamicRef=s,e.default=n}),sT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Z$(),r=be(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o}),iT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=L$(),r={keyword:"$recursiveRef",schemaType:"string",code:o=>(0,t.dynamicRef)(o,o.schema)};e.default=r}),D$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Z$(),r=L$(),o=sT(),n=iT(),s=[t.default,r.default,o.default,n.default];e.default=s}),aT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Om(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:o=>(0,t.validatePropertyDeps)(o)};e.default=r}),cT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Om(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o=>(0,t.validateSchemaDeps)(o)};e.default=r}),uT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=be(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){n.contains===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r}),U$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=aT(),r=cT(),o=uT(),n=[t.default,r.default,o.default];e.default=n}),lT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o=Jt(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>(0,t._)`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:i,schema:a,data:c,errsCount:u,it:l}=s;if(!u)throw new Error("ajv implementation error");let{allErrors:d,props:p}=l;p instanceof t.Name?i.if((0,t._)`${p} !== true`,()=>i.forIn("key",c,m=>i.if(f(p,m),()=>g(m)))):p!==!0&&i.forIn("key",c,m=>p===void 0?g(m):i.if(_(p,m),()=>g(m))),l.props=!0,s.ok((0,t._)`${u} === ${o.default.errors}`);function g(m){if(a===!1){s.setParams({unevaluatedProperty:m}),s.error(),d||i.break();return}if(!(0,r.alwaysValidSchema)(l,a)){let h=i.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:m,dataPropType:r.Type.Str},h),d||i.if((0,t.not)(h),()=>i.break())}}function f(m,h){return(0,t._)`!${m} || !${m}[${h}]`}function _(m,h){let z=[];for(let v in m)m[v]===!0&&z.push((0,t._)`${h} !== ${v}`);return(0,t.and)(...z)}}};e.default=n}),dT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=be(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>(0,t.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,t._)`{limit: ${n}}`},code(n){let{gen:s,schema:i,data:a,it:c}=n,u=c.items||0;if(u===!0)return;let l=s.const("len",(0,t._)`${a}.length`);if(i===!1)n.setParams({len:u}),n.fail((0,t._)`${l} > ${u}`);else if(typeof i=="object"&&!(0,r.alwaysValidSchema)(c,i)){let p=s.var("valid",(0,t._)`${l} <= ${u}`);s.if((0,t.not)(p),()=>d(p,u)),n.ok(p)}c.items=!0;function d(p,g){s.forRange("i",g,l,f=>{n.subschema({keyword:"unevaluatedItems",dataProp:f,dataPropType:r.Type.Num},p),c.allErrors||s.if((0,t.not)(p),()=>s.break())})}}};e.default=o}),F$=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lT(),r=dT(),o=[t.default,r.default];e.default=o}),pT=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),mT=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),fT=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),hT=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),gT=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),_T=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),vT=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),yT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pT(),r=mT(),o=fT(),n=hT(),s=gT(),i=_T(),a=vT(),c=["/properties"];function u(l){return[t,r,o,n,d(this,s),i,d(this,a)].forEach(p=>this.addMetaSchema(p,void 0,!1)),this;function d(p,g){return l?p.$dataMetaSchema(g,c):g}}e.default=u}),ST=U((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=xm(),o=M$(),n=D$(),s=U$(),i=F$(),a=Cm(),c=yT(),u="https://json-schema.org/draft/2019-09/schema";var l=class extends r.default{constructor(_={}){super({..._,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach(_=>this.addVocabulary(_)),this.addVocabulary(s.default),this.addVocabulary(i.default),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:_,meta:m}=this.opts;m&&(c.default.call(this,_),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};e.Ajv2019=l,t.exports=e=l,t.exports.Ajv2019=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var d=dn();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var p=de();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var g=ti();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return g.default}});var f=pn();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}),bT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=x$(),r=T$(),o=N$(),n=D$(),s=U$(),i=F$(),a=j$(),c=A$(),u=[n.default,t.default,r.default,(0,o.default)(!0),a.default,c.metadataVocabulary,c.contentVocabulary,s.default,i.default];e.default=u}),zT=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),$T=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),wT=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),RT=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),PT=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),ET=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),kT=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),xT=U((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),TT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=zT(),r=$T(),o=wT(),n=RT(),s=PT(),i=ET(),a=kT(),c=xT(),u=["/properties"];function l(d){return[t,r,o,n,s,p(this,i),a,p(this,c)].forEach(g=>this.addMetaSchema(g,void 0,!1)),this;function p(g,f){return d?g.$dataMetaSchema(f,u):f}}e.default=l}),IT=U((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=xm(),o=bT(),n=Cm(),s=TT(),i="https://json-schema.org/draft/2020-12/schema";var a=class extends r.default{constructor(p={}){super({...p,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(p=>this.addVocabulary(p)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:p,meta:g}=this.opts;g&&(s.default.call(this,p),this.refs["http://json-schema.org/schema"]=i)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv2020=a,t.exports=e=a,t.exports.Ajv2020=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var c=dn();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=de();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var l=ti();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return l.default}});var d=pn();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),OT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(O,L){return{validate:O,compare:L}}e.fullFormats={date:t(s,i),time:t(c(!0),u),"date-time":t(p(!0),g),"iso-time":t(c(),l),"iso-date-time":t(p(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:h,"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:C,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:v,int32:{type:"number",validate:b},int64:{type:"number",validate:y},float:{type:"number",validate:$},double:{type:"number",validate:$},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\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,g),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,l),"iso-date-time":t(/^\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,f),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},e.formatNames=Object.keys(e.fullFormats);function r(O){return O%4===0&&(O%100!==0||O%400===0)}let o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(O){let L=o.exec(O);if(!L)return!1;let H=+L[1],G=+L[2],he=+L[3];return G>=1&&G<=12&&he>=1&&he<=(G===2&&r(H)?29:n[G])}function i(O,L){if(O&&L)return O>L?1:O<L?-1:0}let a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(O){return function(H){let G=a.exec(H);if(!G)return!1;let he=+G[1],qe=+G[2],Ie=+G[3],Ye=G[4],ye=G[5]==="-"?-1:1,I=+(G[6]||0),A=+(G[7]||0);if(I>23||A>59||O&&!Ye)return!1;if(he<=23&&qe<=59&&Ie<60)return!0;let F=qe-A*ye,w=he-I*ye-(F<0?1:0);return(w===23||w===-1)&&(F===59||F===-1)&&Ie<61}}function u(O,L){if(!(O&&L))return;let H=new Date("2020-01-01T"+O).valueOf(),G=new Date("2020-01-01T"+L).valueOf();if(H&&G)return H-G}function l(O,L){if(!(O&&L))return;let H=a.exec(O),G=a.exec(L);if(H&&G)return O=H[1]+H[2]+H[3],L=G[1]+G[2]+G[3],O>L?1:O<L?-1:0}let d=/t|\s/i;function p(O){let L=c(O);return function(G){let he=G.split(d);return he.length===2&&s(he[0])&&L(he[1])}}function g(O,L){if(!(O&&L))return;let H=new Date(O).valueOf(),G=new Date(L).valueOf();if(H&&G)return H-G}function f(O,L){if(!(O&&L))return;let[H,G]=O.split(d),[he,qe]=L.split(d),Ie=i(H,he);if(Ie!==void 0)return Ie||u(G,qe)}let _=/\/|:/,m=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function h(O){return _.test(O)&&m.test(O)}let z=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function v(O){return z.lastIndex=0,z.test(O)}let S=-(2**31),R=2**31-1;function b(O){return Number.isInteger(O)&&O<=R&&O>=S}function y(O){return Number.isInteger(O)}function $(){return!0}let T=/[^\\]\\Z/;function C(O){if(T.test(O))return!1;try{return new RegExp(O),!0}catch{return!1}}}),CT=U(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=q$(),r=de(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:a,schemaCode:c})=>(0,r.str)`should be ${n[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>(0,r._)`{comparison: ${n[a].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(a){let{gen:c,data:u,schemaCode:l,keyword:d,it:p}=a,{opts:g,self:f}=p;if(!g.validateFormats)return;let _=new t.KeywordCxt(p,f.RULES.all.format.definition,"format");_.$data?m():h();function m(){let v=c.scopeValue("formats",{ref:f.formats,code:g.code.formats}),S=c.const("fmt",(0,r._)`${v}[${_.schemaCode}]`);a.fail$data((0,r.or)((0,r._)`typeof ${S} != "object"`,(0,r._)`${S} instanceof RegExp`,(0,r._)`typeof ${S}.compare != "function"`,z(S)))}function h(){let v=_.schema,S=f.formats[v];if(!S||S===!0)return;if(typeof S!="object"||S instanceof RegExp||typeof S.compare!="function")throw new Error(`"${d}": format "${v}" does not define "compare" function`);let R=c.scopeValue("formats",{key:v,ref:S,code:g.code.formats?(0,r._)`${g.code.formats}${(0,r.getProperty)(v)}`:void 0});a.fail$data(z(R))}function z(v){return(0,r._)`${v}.compare(${u}, ${l}) ${n[d].fail} 0`}},dependencies:["format"]};let i=a=>(a.addKeyword(e.formatLimitDefinition),a);e.default=i}),NT=U((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=OT(),o=CT(),n=de(),s=new n.Name("fullFormats"),i=new n.Name("fastFormats"),a=(u,l={keywords:!0})=>{if(Array.isArray(l))return c(u,l,r.fullFormats,s),u;let[d,p]=l.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];return c(u,l.formats||r.formatNames,d,p),l.keywords&&(0,o.default)(u),u};a.get=(u,l="full")=>{let d=(l==="fast"?r.fastFormats:r.fullFormats)[u];if(!d)throw new Error(`Unknown format "${u}"`);return d};function c(u,l,d,p){var g,f;(g=(f=u.opts.code).formats)!==null&&g!==void 0||(f.formats=(0,n._)`require("ajv-formats/dist/formats").${p}`);for(let _ of l)u.addFormat(_,d[_])}t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}),V$=q$(),jT=ST(),AT=IT(),MT=wi(NT(),1),qT=MT.default;function km(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return qT(t),t}var Zu=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=km(AT.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Dm(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return t==="2020-12"?this.ajv:t==="2019-09"?this._ajv2019??=km(jT.Ajv2019):this._ajvDraft7??=km(V$.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&typeof e.$id=="string"?t.getSchema(e.$id)??t.compile(e):t.compile(e);return o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}},nA=V$.Ajv;var Lu=R0(require("node:process"),1);var Q$=Symbol.for("mcp.completable");function jm(e){return!!e&&typeof e=="object"&&Q$ in e}function LT(e){return e[Q$]?.complete}var oi=15e3,DT=2**31-1;function Uu(e,t){if(!Number.isFinite(e)||e<1)return;let r=setInterval(t,Math.min(e,DT));return r.unref?.(),r}var e0=class{_listeners=new Set;constructor(e){this.onerror=e}publish(e){for(let t of this._listeners)try{t(e)}catch(r){this.onerror?.(r instanceof Error?r:new Error(String(r)))}}subscribe(e){this._listeners.add(e);let t=!0;return()=>{t&&(t=!1,this._listeners.delete(e))}}get listenerCount(){return this._listeners.size}};function t0(e){return{toolsChanged:()=>e.publish({kind:"tools_list_changed"}),promptsChanged:()=>e.publish({kind:"prompts_list_changed"}),resourcesChanged:()=>e.publish({kind:"resources_list_changed"}),resourceUpdated:t=>e.publish({kind:"resource_updated",uri:t})}}function r0(e,t){switch(t.kind){case"tools_list_changed":return e.toolsListChanged===!0;case"prompts_list_changed":return e.promptsListChanged===!0;case"resources_list_changed":return e.resourcesListChanged===!0;case"resource_updated":return e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.includes(t.uri)}}function o0(e,t){let r={},o=n=>t===void 0||n===!0;return e.toolsListChanged===!0&&o(t?.tools?.listChanged)&&(r.toolsListChanged=!0),e.promptsListChanged===!0&&o(t?.prompts?.listChanged)&&(r.promptsListChanged=!0),e.resourcesListChanged===!0&&o(t?.resources?.listChanged)&&(r.resourcesListChanged=!0),e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.length>0&&o(t?.resources?.subscribe)&&(r.resourceSubscriptions=[...e.resourceSubscriptions]),r}function UT(e){switch(e.kind){case"tools_list_changed":return{method:"notifications/tools/list_changed"};case"prompts_list_changed":return{method:"notifications/prompts/list_changed"};case"resources_list_changed":return{method:"notifications/resources/list_changed"};case"resource_updated":return{method:"notifications/resources/updated",params:{uri:e.uri}}}}var mn=1024;function J$(e,t,r){return Response.json({jsonrpc:"2.0",error:{code:t,message:r},id:e},{status:200})}function Du(e,t){return{method:e.method,params:{...e.params,_meta:{...e.params?._meta,[wr]:t}}}}function n0(e){let t=qr(Qs).validateRequest("subscriptions/listen",e);return t.ok?t.value.params?.notifications:void 0}function s0(e){let{bus:t,onerror:r}=e,o=e.maxSubscriptions??mn,n=e.keepAliveMs??oi,s=new Set;function i(a,c,u,l){if(s.size>=o)return r?.(new Error(`subscriptions/listen refused: subscription limit reached (${o})`)),J$(a.id,-32603,"Subscription limit reached");let d=n0(a);if(d===void 0)return J$(a.id,-32602,"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter");let p=o0(d,u),g=a.id,f=new TextEncoder,_,m=!1,h,z,v,S=$=>{if(!m)try{_.enqueue(f.encode($))}catch(T){r?.(T instanceof Error?T:new Error(String(T)))}},R=($,T)=>{S(`event: message
130
+ data: ${JSON.stringify({jsonrpc:"2.0",method:$,params:T})}
131
+
132
+ `)},b=$=>{if(!m){$&&S(`event: message
133
+ data: ${JSON.stringify({jsonrpc:"2.0",id:g,result:{resultType:"complete",_meta:{[wr]:g,[Lt]:l}}})}
134
+
135
+ `),m=!0;try{h?.()}catch(T){r?.(T instanceof Error?T:new Error(String(T)))}z!==void 0&&clearInterval(z),v?.(),s.delete(b);try{_.close()}catch{}}},y=new ReadableStream({start($){_=$;let T=Du({method:"notifications/subscriptions/acknowledged",params:{notifications:p}},g);R(T.method,T.params),h=t.subscribe(C=>{if(m||!r0(p,C))return;let O=Du(UT(C),g);R(O.method,O.params)}),z=Uu(n,()=>S(`: keepalive
136
+
137
+ `)),s.add(b)},cancel(){b(!1)}});if(c!==void 0)if(c.aborted)b(!1);else{let $=()=>b(!1);c.addEventListener("abort",$,{once:!0}),v=()=>c.removeEventListener("abort",$)}return new Response(y,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}return{serve:i,closeAll(){for(let a of s)a(!0)},get openCount(){return s.size}}}var FT=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]),i0=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor(e=mn,t,r){this._maxSubscriptions=e,this._serverCapabilities=t,this._serverInfo=r}setServerCapabilities(e,t){this._serverCapabilities=e,t!==void 0&&(this._serverInfo=t)}has(e){return this._subs.has(e)}serve(e){if(this._serverCapabilities===void 0)throw new Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:e.id,error:{code:-32603,message:"Subscription limit reached"}};let t=n0(e);if(t===void 0)return{jsonrpc:"2.0",id:e.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let r=o0(t,this._serverCapabilities);return this._subs.set(e.id,r),Du({method:"notifications/subscriptions/acknowledged",params:{notifications:r}},e.id)}cancel(e){return this._subs.delete(e)}routeOutbound(e){if(!FT.has(e.method))return"passthrough";let t=e.params?.uri,r=typeof t=="string"?t:void 0,o=VT(e.method,r),n=[];for(let[s,i]of this._subs)r0(i,o)&&n.push(Du({method:e.method,params:e.params??{}},s));return n}teardownAll(){let e=[];for(let t of this._subs.keys())e.push({jsonrpc:"2.0",id:t,result:{resultType:"complete",_meta:{[wr]:t,...this._serverInfo!==void 0&&{[Lt]:this._serverInfo}}}});return this._subs.clear(),e}};function VT(e,t){switch(e){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:t??""}}}var JT=8,HT=6e5;function BT(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??JT,roundTimeoutMs:e?.roundTimeoutMs??HT,legacyShim:e?.legacyShim??!0}}function a0(e,t,r){if(r===null||typeof r!="object"||typeof r.method!="string")throw new Q(V.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let o=r,n=Lz(o);if(n===void 0)throw new Q(V.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${o.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:o,required:n}}function KT(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let r=[...t].map(o=>o.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function Nm(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new Q(V.InternalError,t)}var GT=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:i}=this._host,a=o.mcpReq.signal,c=n,u=0;for(;;){if(u+=1,u>s)return Nm(e,f$(e,s));let l=c.inputRequests,d=l!=null&&Object.keys(l).length>0,p=typeof c.requestState=="string"?c.requestState:void 0;if(!d&&p===void 0)throw new Q(V.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let g;if(d){let m=this._host.resolvedClientCapabilities(o),h=[];for(let[v,S]of Object.entries(l)){let{embedded:R,required:b}=a0(e,v,S);if(R.method!=="roots/list"&&R.params===void 0)throw new Q(V.InternalError,`Handler for ${e} returned an input request '${v}' of kind '${R.method}' without params`);if(Ys(b,m)!==void 0)return Nm(e,`Cannot request input '${v}' (${R.method}): the client on this 2025-era connection did not declare the required capability${m===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);h.push([v,R])}let z=g$(a);try{let v={relatedRequestId:o.mcpReq.id,timeout:i,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:z.signal},S=await Promise.all(h.map(async([R,b])=>{try{return[R,await this._dispatchLeg(b,v)]}catch(y){throw z.abort(y),y}}));g=Object.fromEntries(S)}catch(v){if(a.aborted)throw v;return Nm(e,`Fulfilling input required by '${e}' failed: ${v instanceof Error?v.message:String(v)}`)}finally{z.dispose()}}else await h$(m$,a);let f={...o,mcpReq:{...o.mcpReq,inputResponses:g,droppedInputResponseKeys:void 0,requestState:ei(p)}};if(p!==void 0){let m=await this._host.verifyRequestState(p,f,e);m!==void 0&&(f=Sm(f,m))}let _=await t(r,f);if(!pr(_))return _;c=_}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;return r.mode==="url"&&r.elicitationId===void 0&&(r={...r,elicitationId:KT()}),await this._host.sendElicitation(r,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},WT=new Set(["tools/call","prompts/get","resources/read"]),c0,u0,l0;function d0(e,t){c0(e,t)}function Fu(e,t){u0(e,t)}function Vu(e){return l0(e)}var Ju=class extends bm{_clientCapabilities;_clientVersion;static{c0=(e,t)=>{t.clientCapabilities!==void 0&&(e._clientCapabilities=t.clientCapabilities),t.clientInfo!==void 0&&(e._clientVersion=t.clientInfo)},u0=(e,t)=>{let r=t.filter(o=>!e._supportedProtocolVersions.includes(o));r.length>0&&(e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r]),e.setRequestHandler("server/discover",()=>e._ondiscover())},l0=e=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new GT({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:e=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,r)=>this._verifyRequestState(e,t,r),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){if(super(t),this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Zu,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=BT(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))o!==void 0&&pm(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),im(this._supportedProtocolVersions).length>0&&this.setRequestHandler("server/discover",()=>this._ondiscover()),this._capabilities.logging&&this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let r=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:o}=e.params,n=Tu(Ir,o);return n.success&&this._loggingLevels.set(r,n.data),{}})}buildContext(e,t){let r=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,n,s)=>{if(!this._capabilities.logging)return Promise.resolve();let i;if(this._servedModernEra()){if(i=e.mcpReq.envelope?.[Rr],i===void 0)return Promise.resolve()}else i=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);return i!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i)?Promise.resolve():e.mcpReq.notify({method:"notifications/message",params:{level:o,data:n,logger:s}})},elicitInput:(o,n)=>this.elicitInput(o,n),requestSampling:(o,n)=>this.createMessage(o,n)},http:r?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(Ir.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return r?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r):!1};registerCapabilities(e){if(this.transport)throw new ue(me.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;this._capabilities=zm(this._capabilities,e),!t&&this._capabilities.logging&&this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=WT.has(e);return r===void 0&&!o?async(n,s)=>{let i=await t(n,s);if(pr(i))throw new Q(V.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}:async(n,s)=>{let i=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(pr(i)){if(!o)throw new Q(V.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}return r===void 0?i:Ru(i,r)}}return async(r,o)=>{let n=qr(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new Q(s.reason==="not-in-era"?V.InternalError:V.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let i=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(pr(i))return i;let a=am(i),c=n.validateResult("tools/call",a);if(!c.ok)throw new Q(c.reason==="not-in-era"?V.InternalError:V.InvalidParams,c.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${c.message}`);return c.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&dr(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,r,o){let n=this._servedModernEra(),s=o.mcpReq.requestState();if(s!==void 0&&typeof s!="string")throw new Q(V.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let i=o;if(typeof s=="string"){let d=await this._verifyRequestState(s,o,e);d!==void 0&&(i=Sm(o,d))}let a;try{a=await t(r,i)}catch(d){throw d instanceof Q&&d.code===V.UrlElicitationRequired&&n?new Q(V.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { \u2026: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`):d}if(!pr(a))return a;if(!n){if(!this._inputRequiredServing.legacyShim)throw new Q(V.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??to}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,i,a)}let c=a.inputRequests,u=c!=null&&Object.keys(c).length>0,l=typeof a.requestState=="string";if(!u&&!l)throw new Q(V.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let d=this._inputRequestCapabilityView(o);for(let[p,g]of Object.entries(c)){let{embedded:f,required:_}=a0(e,p,g),m=Ys(_,d);if(m!==void 0)throw new Xs({requiredCapabilities:m},`Cannot request input '${p}' (${f.method}): the request's client capabilities do not declare the required capability`)}}return a}async _verifyRequestState(e,t,r){if(this._requestStateVerify!==void 0)try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(new Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new Q(V.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[Kt]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new ue(me.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead \u2014 the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new ue(me.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new ue(me.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new ue(me.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new ue(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new ue(me.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new ue(me.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new ue(me.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new ue(me.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new ue(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new ue(me.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new ue(me.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new ue(me.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let r=Uz(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??to;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:im(this._supportedProtocolVersions),capabilities:YT(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new ue(me.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),i=Array.isArray(s.content)?s.content:[s.content],a=i.some(d=>d.type==="tool_result"),c=e.messages.length>1?e.messages.at(-2):void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],l=u.some(d=>d.type==="tool_use");if(a){if(i.some(d=>d.type!=="tool_result"))throw new Q(V.InvalidParams,"The last message must contain only tool_result content if any is present");if(!l)throw new Q(V.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(l){let d=new Set(u.filter(g=>g.type==="tool_use").map(g=>g.id)),p=new Set(i.filter(g=>g.type==="tool_result").map(g=>g.toolUseId));if(d.size!==p.size||![...d].every(g=>p.has(g)))throw new Q(V.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=!!(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),n=this._wireCodec().samplingResultVariant(r,o);if(!n.ok)throw new ue(me.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new ue(me.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,r){let o=e.mode??"form",n=r?.validateAcceptedContent??!0;switch(o){case"url":{let s=e;return this.request({method:"elicitation/create",params:s},t)}case"form":{let s=e.mode==="form"?e:{...e,mode:"form"},i=await this.request({method:"elicitation/create",params:s},t);if(n&&i.action==="accept"&&i.content&&s.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(s.requestedSchema)(i.content);if(!a.valid)throw new Q(V.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(a){throw a instanceof Q?a:new Q(V.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function YT(e){return{...e}}var ni=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(!(t===void 0||!t.enabled)){if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return B$;try{let r=Zr(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}}constructor(e,t){this.server=new Ju(e,t),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}_toolHandlersInitialized=!1;setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?Zr(t.inputSchema,"input"):B$,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};return t.outputSchema&&(r.outputSchema=Zr(t.outputSchema,"output")),r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new Q(V.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new Q(V.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(r,e.params.arguments,e.params.name),n=await this.executeToolHandler(r,o,t);return await this.validateToolOutput(r,n,e.params.name),pr(n)?n:this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof Q&&o.code===V.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(!e.inputSchema)return;let o=await co(e.inputSchema,t??{});if(!o.success)throw new Q(V.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema||pr(t)||t.isError)return;if(t.structuredContent===void 0)throw new Q(V.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let o=await co(e.outputSchema,t.structuredContent);if(!o.success)throw new Q(V.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${o.error}`)}async executeToolHandler(e,t,r){return e.executor(t,r)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async e=>{switch(e.params.ref.type){case"ref/prompt":return gm(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return _m(e),this.handleResourceCompletion(e,e.params.ref);default:throw new Q(V.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new Q(V.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new Q(V.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return ri;let o=X$(Y$(r.argsSchema)?.[e.params.argument.name]);if(!jm(o))return ri;let n=LT(o);return n?W$(await n(e.params.argument.value,e.params.context)):ri}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find(n=>n.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return ri;throw new Q(V.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);return o?W$(await o(e.params.argument.value,e.params.context)):ri}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,s])=>s.enabled).map(([n,s])=>({uri:n,name:s.name,...s.metadata})),o=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let s=await n.resourceTemplate.listCallback(t);for(let i of s.resources)o.push({...n.metadata,...i})}return{resources:[...r,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let r;try{r=new URL(e.params.uri)}catch{throw new Q(V.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[r.toString()];if(o){if(!o.enabled)throw new Q(V.InvalidParams,`Resource ${r} disabled`);return Ru(await o.readCallback(r,t),o.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let s=n.resourceTemplate.uriTemplate.match(r.toString());if(s)return Ru(await n.readCallback(r,s,t),n.cacheHint)}throw new Pu(e.params.uri)}),this._resourceHandlersInitialized=!0)}_promptHandlersInitialized=!1;setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?p$(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new Q(V.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new Q(V.InvalidParams,`Prompt ${e.params.name} disabled`);return r.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0)}registerResource(e,t,r,o){let n=r.cacheHint,s=r;if(n!==void 0){pm(n,`resource ${e}`);let i={...r};delete i.cacheHint,s=i}if(typeof t=="string"){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);let i=this._createRegisteredResource(e,r.title,t,s,o);return n!==void 0&&(i.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let i=this._createRegisteredResourceTemplate(e,r.title,t,s,o);return n!==void 0&&(i.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}}_createRegisteredResource(e,t,r,o,n){let s={name:e,title:t,metadata:o,readCallback:n,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:i=>{i.uri!==void 0&&i.uri!==r&&(delete this._registeredResources[r],i.uri&&(this._registeredResources[i.uri]=s)),i.name!==void 0&&(s.name=i.name),i.title!==void 0&&(s.title=i.title),i.metadata!==void 0&&(s.metadata=i.metadata),i.callback!==void 0&&(s.readCallback=i.callback),i.enabled!==void 0&&(s.enabled=i.enabled),this.sendResourceListChanged()}};return this._registeredResources[r]=s,s}_createRegisteredResourceTemplate(e,t,r,o,n){let s={resourceTemplate:r,title:t,metadata:o,readCallback:n,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{a.name!==void 0&&a.name!==e&&(delete this._registeredResourceTemplates[e],a.name&&(this._registeredResourceTemplates[a.name]=s)),a.title!==void 0&&(s.title=a.title),a.template!==void 0&&(s.resourceTemplate=a.template),a.metadata!==void 0&&(s.metadata=a.metadata),a.callback!==void 0&&(s.readCallback=a.callback),a.enabled!==void 0&&(s.enabled=a.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let i=r.uriTemplate.variableNames;return Array.isArray(i)&&i.some(a=>!!r.completeCallback(a))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,t,r,o,n,s,i){let a=o,c=n,u={title:t,description:r,argsSchema:o,icons:s,_meta:i,handler:G$(e,o,n),enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:l=>{l.name!==void 0&&l.name!==e&&(delete this._registeredPrompts[e],l.name&&(this._registeredPrompts[l.name]=u)),l.title!==void 0&&(u.title=l.title),l.description!==void 0&&(u.description=l.description),l.icons!==void 0&&(u.icons=l.icons),l._meta!==void 0&&(u._meta=l._meta);let d=!1;l.argsSchema!==void 0&&(u.argsSchema=l.argsSchema,a=l.argsSchema,d=!0),l.callback!==void 0&&(c=l.callback,d=!0),d&&(u.handler=G$(e,a,c)),l.enabled!==void 0&&(u.enabled=l.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[e]=u,o){let l=Y$(o);l&&Object.values(l).some(d=>jm(X$(d)))&&this.setCompletionRequestHandler()}return u}_createRegisteredTool(e,t,r,o,n,s,i,a,c,u){if(Em(e),o!==void 0)try{let p=Zr(o,"input");this._toolInputSchemaJson[e]=p;let g=Eu(p);g.valid||console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${g.reason}`)}catch{}let l=u,d={title:t,description:r,inputSchema:o,outputSchema:n,outputSchemaJson:K$(n),annotations:s,icons:i,execution:a,_meta:c,handler:u,executor:H$(o,u),enabled:!0,disable:()=>d.update({enabled:!1}),enable:()=>d.update({enabled:!0}),remove:()=>d.update({name:null}),update:p=>{p.name!==void 0&&p.name!==e&&(typeof p.name=="string"&&Em(p.name),delete this._registeredTools[e],delete this._toolInputSchemaJson[e],p.name&&(delete this._toolInputSchemaJson[p.name],this._registeredTools[p.name]=d,e=p.name)),p.title!==void 0&&(d.title=p.title),p.description!==void 0&&(d.description=p.description);let g=!1;p.paramsSchema!==void 0&&(d.inputSchema=p.paramsSchema,delete this._toolInputSchemaJson[e],g=!0),p.callback!==void 0&&(d.handler=p.callback,l=p.callback,g=!0),g&&(d.executor=H$(d.inputSchema,l)),p.outputSchema!==void 0&&(d.outputSchema=p.outputSchema,d.outputSchemaJson=K$(p.outputSchema)),p.annotations!==void 0&&(d.annotations=p.annotations),p.icons!==void 0&&(d.icons=p.icons),p._meta!==void 0&&(d._meta=p._meta),p.enabled!==void 0&&(d.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=d,this.setToolRequestHandlers(),this.sendToolListChanged(),d}registerTool(e,t,r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:o,description:n,inputSchema:s,outputSchema:i,annotations:a,icons:c,_meta:u}=t;return this._createRegisteredTool(e,o,n,Ou(s),Ou(i),a,c,void 0,u,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:o,description:n,argsSchema:s,icons:i,_meta:a}=t,c=this._createRegisteredPrompt(e,o,n,Ou(s),r,i,a);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};function H$(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var B$={type:"object",properties:{}};function K$(e){if(e!==void 0)try{return Zr(e,"output")}catch{return}}function G$(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await co(t,n);if(!i.success)throw new Q(V.InvalidParams,`Invalid arguments for prompt ${e}: ${i.error}`);return o(i.data,s)}}else{let o=r;return async(n,s)=>o(s)}}function W$(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var ri={completion:{values:[],hasMore:!1}};function Y$(e){let t=e;if(t.shape&&typeof t.shape=="object")return t.shape}function XT(e){return e?.type==="optional"}function X$(e){return XT(e)?e.def?.innerType??e:e}var QT=class{onclose;onerror;onmessage;_classification;_responseMode;_started=!1;_used=!1;_closed=!1;_terminalDelivered=!1;_dispatchWindowOpen=!1;_requestId;_deferredResponse;_sse;_abortCleanup;_keepAliveMs;constructor(e){this._classification=e.classification,this._responseMode=e.responseMode??"auto",this._keepAliveMs=e.keepAliveMs??oi}async start(){if(this._started)throw new Error("PerRequestHTTPServerTransport is already started");this._started=!0}async handleMessage(e,t){if(this._used)throw new Error("PerRequestHTTPServerTransport serves exactly one exchange; construct a new transport per request");if(!this._started||this.onmessage===void 0)throw new Error("PerRequestHTTPServerTransport is not connected: connect a server to this transport before handling a message");if(this._closed)throw new Error("PerRequestHTTPServerTransport is closed");this._used=!0;let r=t?.request?.signal;if(r?.aborted)throw await this.close(),new ue(me.ConnectionClosed,"The request was aborted before it could be handled");let o={classification:this._classification,...t?.request!==void 0&&{request:t.request},...t?.authInfo!==void 0&&{authInfo:t.authInfo}};if(tt(e)){this._requestId=e.id;let n,s,i=new Promise((a,c)=>{n=a,s=c});if(this._deferredResponse={promise:i,resolve:n,reject:s,settled:!1},r!==void 0){let a=()=>void this.close();r.addEventListener("abort",a,{once:!0}),this._abortCleanup=()=>r.removeEventListener("abort",a)}this._dispatchWindowOpen=!0;try{this.onmessage(e,o)}finally{this._dispatchWindowOpen=!1}return this._responseMode==="sse"&&!this._closed&&!this._deferredResponse.settled&&this.upgradeToSse(),i}return this.onmessage(e,o),new Response(null,{status:202})}async send(e,t){if(this._closed)return;let r=Ft(e)||Vt(e),o=r?e.id:t?.relatedRequestId;if(this._requestId===void 0||o===void 0||o!==this._requestId){r&&this.onerror?.(new Error(`Received a response for an unknown request id: ${String(e.id)}`));return}if(r){if(this._terminalDelivered)return;this._terminalDelivered=!0;let n=Vt(e)?e.error.code:void 0,s=n!==void 0&&(this._dispatchWindowOpen||n===V.MissingRequiredClientCapability)?vm[n]:void 0;if(s!==void 0&&this._sse===void 0){this.settleResponse(Response.json(e,{status:s,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}if(this._sse!==void 0||this._responseMode==="sse"){this._sse===void 0&&this.upgradeToSse(),this.writeMessageFrame(e),this.finalizeStream();return}this.settleResponse(Response.json(e,{status:200,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}this._responseMode!=="json"&&(this._sse===void 0&&this.upgradeToSse(),this.writeMessageFrame(e))}writeCommentFrame(e){if(this._closed||this._sse===void 0||this._sse.closed)return;let t=e.split(`
138
+ `).map(r=>`: ${r}`).join(`
139
+ `);this.writeFrame(`${t}
140
+
141
+ `)}async close(){if(!this._closed){if(this._closed=!0,this._abortCleanup?.(),this._abortCleanup=void 0,this._sse?.keepAliveTimer!==void 0&&clearInterval(this._sse.keepAliveTimer),this._sse!==void 0&&!this._sse.closed){this._sse.closed=!0;try{this._sse.controller.close()}catch{}}this._deferredResponse!==void 0&&!this._deferredResponse.settled&&(this._deferredResponse.settled=!0,this._deferredResponse.reject(new ue(me.ConnectionClosed,"Connection closed before a response was produced"))),this.onclose?.()}}settleResponse(e){this._deferredResponse===void 0||this._deferredResponse.settled||(this._deferredResponse.settled=!0,this._deferredResponse.resolve(e))}upgradeToSse(){let e,t=new ReadableStream({start:r=>{e=r},cancel:()=>{this.close()}});this._sse={controller:e,encoder:new TextEncoder,closed:!1},this._sse.keepAliveTimer=Uu(this._keepAliveMs,()=>this.writeCommentFrame("keepalive")),this.settleResponse(new Response(t,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}}))}finalizeStream(){if(this._sse?.keepAliveTimer!==void 0&&clearInterval(this._sse.keepAliveTimer),this._sse!==void 0&&!this._sse.closed){this._sse.closed=!0;try{this._sse.controller.close()}catch{}}queueMicrotask(()=>void this.close())}writeMessageFrame(e){this.writeFrame(`event: message
142
+ data: ${JSON.stringify(e)}
143
+
144
+ `)}writeFrame(e){if(!(this._sse===void 0||this._sse.closed))try{this._sse.controller.enqueue(this._sse.encoder.encode(e))}catch(t){this.onerror?.(new Error(`Failed to write to the response stream: ${t}`))}}};async function eI(e,t,r){let o=new QT({classification:r.classification,...r.responseMode!==void 0&&{responseMode:r.responseMode},...r.keepAliveMs!==void 0&&{keepAliveMs:r.keepAliveMs}});return await e.connect(o),o.handleMessage(t,{...r.request!==void 0&&{request:r.request},...r.authInfo!==void 0&&{authInfo:r.authInfo}})}var tI=class{sessionIdGenerator;_started=!1;_closed=!1;_streamMapping=new Map;_requestToStreamMapping=new Map;_requestResponseMap=new Map;_initialized=!1;_enableJsonResponse=!1;_standaloneSseStreamId="_GET_stream";_eventStore;_onsessioninitialized;_onsessionclosed;_allowedHosts;_allowedOrigins;_enableDnsRebindingProtection;_retryInterval;_supportedProtocolVersions;_keepAliveMs;sessionId;onclose;onerror;onmessage;constructor(e={}){this.sessionIdGenerator=e.sessionIdGenerator,this._enableJsonResponse=e.enableJsonResponse??!1,this._eventStore=e.eventStore,this._onsessioninitialized=e.onsessioninitialized,this._onsessionclosed=e.onsessionclosed,this._allowedHosts=e.allowedHosts,this._allowedOrigins=e.allowedOrigins,this._enableDnsRebindingProtection=e.enableDnsRebindingProtection??!1,this._retryInterval=e.retryInterval,this._supportedProtocolVersions=e.supportedProtocolVersions??os,this._keepAliveMs=e.keepAliveMs??oi}startKeepAlive(e,t){if(this._closed)return;let r=Uu(this._keepAliveMs,()=>{try{e.enqueue(t.encode(`: keepalive
145
+
146
+ `))}catch{r!==void 0&&clearInterval(r)}});return r}async start(){if(this._started)throw new Error("Transport already started");this._started=!0}setSupportedProtocolVersions(e){this._supportedProtocolVersions=e}createJsonErrorResponse(e,t,r,o){let n={code:t,message:r};return o?.data!==void 0&&(n.data=o.data),Response.json({jsonrpc:"2.0",error:n,id:null},{status:e,headers:{"Content-Type":"application/json",...o?.headers}})}validateRequestHeaders(e){if(this._enableDnsRebindingProtection){if(this._allowedHosts&&this._allowedHosts.length>0){let t=e.headers.get("host");if(!t||!this._allowedHosts.includes(t)){let r=`Invalid Host header: ${t}`;return this.onerror?.(new Error(r)),this.createJsonErrorResponse(403,-32e3,r)}}if(this._allowedOrigins&&this._allowedOrigins.length>0){let t=e.headers.get("origin");if(t&&!this._allowedOrigins.includes(t)){let r=`Invalid Origin header: ${t}`;return this.onerror?.(new Error(r)),this.createJsonErrorResponse(403,-32e3,r)}}}}async handleRequest(e,t){if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");let r=this.validateRequestHeaders(e);if(r)return r;switch(e.method){case"POST":return this.handlePostRequest(e,t);case"GET":return this.handleGetRequest(e);case"DELETE":return this.handleDeleteRequest(e);default:return this.handleUnsupportedRequest()}}supportsEmptySSEData(e){return this._supportedProtocolVersions.includes(e)&&e>="2025-11-25"}async writePrimingEvent(e,t,r,o){if(!this._eventStore||!this.supportsEmptySSEData(o))return;let n=await this._eventStore.storeEvent(r,{}),s=`id: ${n}
147
+ data:
148
+
149
+ `;this._retryInterval!==void 0&&(s=`id: ${n}
150
+ retry: ${this._retryInterval}
151
+ data:
152
+
153
+ `),e.enqueue(t.encode(s))}async handleGetRequest(e){if(!e.headers.get("accept")?.includes("text/event-stream"))return this.onerror?.(new Error("Not Acceptable: Client must accept text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept text/event-stream");let t=this.validateSession(e);if(t)return t;let r=this.validateProtocolVersion(e);if(r)return r;if(this._eventStore){let c=e.headers.get("last-event-id");if(c)return this.replayEvents(c)}if(this._streamMapping.get(this._standaloneSseStreamId)!==void 0)return this.onerror?.(new Error("Conflict: Only one SSE stream is allowed per session")),this.createJsonErrorResponse(409,-32e3,"Conflict: Only one SSE stream is allowed per session");let o=new TextEncoder,n,s,i=new ReadableStream({start:c=>{n=c},cancel:()=>{s!==void 0&&clearInterval(s),this._streamMapping.get(this._standaloneSseStreamId)?.controller===n&&this._streamMapping.delete(this._standaloneSseStreamId)}}),a={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};return this.sessionId!==void 0&&(a["mcp-session-id"]=this.sessionId),this._streamMapping.set(this._standaloneSseStreamId,{controller:n,encoder:o,cleanup:()=>{s!==void 0&&clearInterval(s),this._streamMapping.delete(this._standaloneSseStreamId);try{n.close()}catch{}}}),s=this.startKeepAlive(n,o),new Response(i,{headers:a})}async replayEvents(e){if(!this._eventStore)return this.onerror?.(new Error("Event store not configured")),this.createJsonErrorResponse(400,-32e3,"Event store not configured");try{let t;if(this._eventStore.getStreamIdForEventId){if(t=await this._eventStore.getStreamIdForEventId(e),!t)return this.onerror?.(new Error("Invalid event ID format")),this.createJsonErrorResponse(400,-32e3,"Invalid event ID format");if(this._streamMapping.get(t)!==void 0)return this.onerror?.(new Error("Conflict: Stream already has an active connection")),this.createJsonErrorResponse(409,-32e3,"Conflict: Stream already has an active connection")}let r={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};this.sessionId!==void 0&&(r["mcp-session-id"]=this.sessionId);let o=new TextEncoder,n,s,i=!1,a,c=new ReadableStream({start:l=>{n=l},cancel:()=>{i=!0,s!==void 0&&clearInterval(s),a!==void 0&&this._streamMapping.get(a)?.controller===n&&this._streamMapping.delete(a)}}),u=new Set;if(a=await this._eventStore.replayEventsAfter(e,{send:async(l,d)=>{if(u.add(l),!this.writeSSEEvent(n,o,d,l))try{n.close()}catch{}}}),this._closed||i){try{n.close()}catch{}return this.createJsonErrorResponse(404,-32001,"Session not found")}if(this._streamMapping.get(a)?.cleanup(),this._streamMapping.set(a,{controller:n,encoder:o,replayedEventIds:u,cleanup:()=>{s!==void 0&&clearInterval(s),this._streamMapping.delete(a);try{n.close()}catch{}}}),a!==this._standaloneSseStreamId&&![...this._requestToStreamMapping.values()].includes(a)){this._streamMapping.delete(a);try{n.close()}catch{}}return this._streamMapping.get(a)?.controller===n&&(s=this.startKeepAlive(n,o)),new Response(c,{headers:r})}catch(t){return this.onerror?.(t),this.createJsonErrorResponse(500,-32e3,"Error replaying events")}}writeSSEEvent(e,t,r,o){try{let n=`event: message
154
+ `;return o&&(n+=`id: ${o}
155
+ `),n+=`data: ${JSON.stringify(r)}
156
+
157
+ `,e.enqueue(t.encode(n)),!0}catch(n){return this.onerror?.(n),!1}}handleUnsupportedRequest(){return this.onerror?.(new Error("Method not allowed.")),Response.json({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null},{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest(e,t){try{let r=e.headers.get("accept");if(!r?.includes("application/json")||!r.includes("text/event-stream"))return this.onerror?.(new Error("Not Acceptable: Client must accept both application/json and text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept both application/json and text/event-stream");if(!wm(e.headers.get("content-type")))return this.onerror?.(new Error("Unsupported Media Type: Content-Type must be application/json")),this.createJsonErrorResponse(415,-32e3,"Unsupported Media Type: Content-Type must be application/json");let o=e,n;if(t?.parsedBody===void 0)try{n=await e.json()}catch(_){return this.onerror?.(_),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}else n=t.parsedBody;let s;try{s=Array.isArray(n)?n.map(_=>so.parse(_)):[so.parse(n)]}catch(_){return this.onerror?.(_),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");let i=s.some(_=>hm(_));if(i){if(this._initialized&&this.sessionId!==void 0)return this.onerror?.(new Error("Invalid Request: Server already initialized")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(s.length>1)return this.onerror?.(new Error("Invalid Request: Only one initialization request is allowed")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized&&await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!i){let _=this.validateSession(e);if(_)return _;let m=this.validateProtocolVersion(e);if(m)return m}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");if(!s.some(_=>tt(_))){for(let _ of s)this.onmessage?.(_,{authInfo:t?.authInfo,request:o});return new Response(null,{status:202})}let a=crypto.randomUUID(),c=s.find(_=>hm(_)),u=c?c.params.protocolVersion:e.headers.get("mcp-protocol-version")??ua;if(this._enableJsonResponse)return new Promise(_=>{this._streamMapping.set(a,{resolveJson:_,cleanup:()=>{this._streamMapping.delete(a)}});for(let m of s)tt(m)&&this._requestToStreamMapping.set(m.id,a);for(let m of s)this.onmessage?.(m,{authInfo:t?.authInfo,request:o})});let l=new TextEncoder,d,p,g=new ReadableStream({start:_=>{d=_},cancel:()=>{p!==void 0&&clearInterval(p),this._streamMapping.get(a)?.controller===d&&this._streamMapping.delete(a)}}),f={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};this.sessionId!==void 0&&(f["mcp-session-id"]=this.sessionId);for(let _ of s)tt(_)&&(this._streamMapping.set(a,{controller:d,encoder:l,cleanup:()=>{p!==void 0&&clearInterval(p),this._streamMapping.delete(a);try{d.close()}catch{}}}),this._requestToStreamMapping.set(_.id,a));await this.writePrimingEvent(d,l,a,u);for(let _ of s){let m,h;tt(_)&&this._eventStore&&this.supportsEmptySSEData(u)&&(m=()=>{this.closeSSEStream(_.id)},h=()=>{this.closeStandaloneSSEStream()}),this.onmessage?.(_,{authInfo:t?.authInfo,request:o,closeSSEStream:m,closeStandaloneSSEStream:h})}return this._streamMapping.get(a)?.controller===d&&(p=this.startKeepAlive(d,l)),new Response(g,{status:200,headers:f})}catch(r){return this.onerror?.(r),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(r)})}}async handleDeleteRequest(e){let t=this.validateSession(e);if(t)return t;let r=this.validateProtocolVersion(e);if(r)return r;try{return await Promise.resolve(this._onsessionclosed?.(this.sessionId)),new Response(null,{status:200})}finally{await this.close()}}validateSession(e){if(this.sessionIdGenerator===void 0)return;if(!this._initialized)return this.onerror?.(new Error("Bad Request: Server not initialized")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Server not initialized");let t=e.headers.get("mcp-session-id");if(!t)return this.onerror?.(new Error("Bad Request: Mcp-Session-Id header is required")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Mcp-Session-Id header is required");if(t!==this.sessionId)return this.onerror?.(new Error("Session not found")),this.createJsonErrorResponse(404,-32001,"Session not found")}validateProtocolVersion(e){let t=e.headers.get("mcp-protocol-version");if(t!==null&&!this._supportedProtocolVersions.includes(t)){let r=`Bad Request: Unsupported protocol version: ${t} (supported versions: ${this._supportedProtocolVersions.join(", ")})`;return this.onerror?.(new Error(r)),this.createJsonErrorResponse(400,-32e3,r)}}async close(){if(!this._closed){this._closed=!0;for(let{cleanup:e}of this._streamMapping.values())e();this._streamMapping.clear(),this._requestResponseMap.clear(),this.onclose?.()}}closeSSEStream(e){let t=this._requestToStreamMapping.get(e);if(!t)return;let r=this._streamMapping.get(t);r&&r.cleanup()}closeStandaloneSSEStream(){let e=this._streamMapping.get(this._standaloneSseStreamId);e&&e.cleanup()}async send(e,t){let r=t?.relatedRequestId;if((Ft(e)||Vt(e))&&(r=e.id),r===void 0){if(Ft(e)||Vt(e))throw new Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let s;this._eventStore&&(s=await this._eventStore.storeEvent(this._standaloneSseStreamId,e));let i=this._streamMapping.get(this._standaloneSseStreamId);if(i===void 0)return;i.controller&&i.encoder&&(s===void 0||!i.replayedEventIds?.has(s))&&this.writeSSEEvent(i.controller,i.encoder,e,s);return}let o=this._requestToStreamMapping.get(r);if(!o)throw new Error(`No connection established for request ID: ${String(r)}`);let n=this._streamMapping.get(o);if(!this._enableJsonResponse){let s;this._eventStore&&(s=await this._eventStore.storeEvent(o,e),n=this._streamMapping.get(o)),n?.controller&&n?.encoder&&(s===void 0||!n.replayedEventIds?.has(s))&&this.writeSSEEvent(n.controller,n.encoder,e,s)}if(Ft(e)||Vt(e)){this._requestResponseMap.set(r,e);let s=[...this._requestToStreamMapping.entries()].filter(([i,a])=>a===o).map(([i])=>i);if(s.every(i=>this._requestResponseMap.has(i))){if(!n){if(this._enableJsonResponse)throw new Error(`No connection established for request ID: ${String(r)}`);if(!this._eventStore){this.onerror?.(new Error(`Response for request ID ${String(r)} is undeliverable: per-request stream is disconnected and no eventStore is configured`));for(let i of s)this._requestResponseMap.delete(i),this._requestToStreamMapping.delete(i);return}for(let i of s)this._requestResponseMap.delete(i),this._requestToStreamMapping.delete(i);return}if(this._enableJsonResponse&&n.resolveJson){let i={"Content-Type":"application/json"};this.sessionId!==void 0&&(i["mcp-session-id"]=this.sessionId);let a=s.map(c=>this._requestResponseMap.get(c));a.length===1?n.resolveJson(Response.json(a[0],{status:200,headers:i})):n.resolveJson(Response.json(a,{status:200,headers:i})),n.cleanup()}else n.cleanup();for(let i of s)this._requestResponseMap.delete(i),this._requestToStreamMapping.delete(i)}}}};function Lr(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;let{method:t,id:r}=e;return typeof t!="string"?null:typeof r=="string"||typeof r=="number"?r:null}function Dr(e,t,r,o,n=null){return Response.json({jsonrpc:"2.0",error:{code:t,message:r,...o!==void 0&&{data:o}},id:n},{status:e})}function Hu(e,t=null){return Dr(e.httpStatus,e.code,e.message,e.data,t)}function Bu(e){return e instanceof Error?e:new Error(String(e))}function Ku(e=null){return Dr(500,-32603,"Internal server error",void 0,e)}function rI(e,t,r){return async(o,n)=>{if(o.method.toUpperCase()!=="POST")return Dr(405,-32e3,"Method not allowed.");try{let s=await e({era:"legacy",...n?.authInfo!==void 0&&{authInfo:n.authInfo},requestInfo:o}),i=new tI({sessionIdGenerator:void 0,...r!==void 0&&{keepAliveMs:r}});await s.connect(i);let a=()=>{i.close().catch(()=>{}),s.close().catch(()=>{})};o.signal?.addEventListener("abort",a,{once:!0});let c=await i.handleRequest(o,{...n?.authInfo!==void 0&&{authInfo:n.authInfo},...n?.parsedBody!==void 0&&{parsedBody:n.parsedBody}});if(c.body===null||$m(c.headers.get("content-type"))!=="text/event-stream")return a(),c;let u=c.body.getReader(),l=!1,d=()=>{l||(l=!0,a())},p=new ReadableStream({pull:async g=>{try{let{done:f,value:_}=await u.read();if(f){d(),g.close();return}_!==void 0&&g.enqueue(_)}catch(f){d(),g.error(f)}},cancel:g=>(d(),u.cancel(g).catch(()=>{}))});return new Response(p,{status:c.status,statusText:c.statusText,headers:c.headers})}catch(s){try{t?.(Bu(s))}catch{}return Ku(Lr(n?.parsedBody))}}}async function oI(e,t,r=!0){let o=e.method.toUpperCase(),n,s=t,i=e,a=!1;if(o==="POST"){if(s===void 0){r&&(i=e.clone());let c;try{c=await e.text()}catch{return{step:"unreadable-body"}}try{n=c.length===0?void 0:JSON.parse(c)}catch{a=!0}!a&&n!==void 0&&(s=n)}else n=s;if(a||n===void 0)return{step:"no-json-body",forwardRequest:i}}return{step:"classified",outcome:l$({httpMethod:o,protocolVersionHeader:e.headers.get("mcp-protocol-version")??void 0,mcpMethodHeader:e.headers.get("mcp-method")??void 0,mcpNameHeader:e.headers.get("mcp-name")??void 0,...n!==void 0&&{body:n}}),body:n,parsedBody:s,forwardRequest:i}}function p0(e,t={}){let{legacy:r,onerror:o,responseMode:n}=t;if(typeof r=="function")throw new TypeError("The 'legacy' option only accepts 'stateless' or 'reject', not a handler function. To serve 2025-era traffic with your own handler, route in user land with the exported isLegacyRequest(request) predicate in front of a strict (legacy: 'reject') handler.");let s=new Set,i=!1,a=m=>{try{o?.(m)}catch{}},c=t.bus??new e0(a),u=t0(c),l=s0({bus:c,maxSubscriptions:t.maxSubscriptions??mn,keepAliveMs:t.keepAliveMs??oi,onerror:a});n==="json"&&console.warn("responseMode: 'json' drops mid-call notifications. subscriptions/listen streams are always served over SSE regardless; other notifications emitted before a result are dropped.");let d=r==="reject"?void 0:rI(e,a,t.keepAliveMs);async function p(m,h,z){let v=m.classification.revision;if(v===void 0||!Ct.includes(v)){let C=new po({supported:[...Ct],requested:v??"unknown"});return a(C),Dr(400,C.code,C.message,C.data,Lr(m.message))}let S=c$({httpMethod:h.method,mcpMethodHeader:h.headers.get("mcp-method")??void 0,mcpNameHeader:h.headers.get("mcp-name")??void 0},m);if(S!==void 0)return a(new Error(`Rejected inbound request (${S.cell}): ${S.message}`)),Hu(S,Lr(m.message));let R=m.messageKind==="request"?Ut(m.message.params):void 0,b=R?.[Kt];if(m.messageKind==="request"){let C=Zz(m.message.method);if(C!==void 0){let O=Ys(C,b);if(O!==void 0){let L=new Xs({requiredCapabilities:O});return a(L),Dr(a$(L.code,"ladder"),L.code,L.message,L.data,m.message.id)}}}let y=await e({era:"modern",...z!==void 0&&{authInfo:z},requestInfo:h}),$=y instanceof ni?y.server:y;if(m.messageKind==="request"&&m.message.method==="subscriptions/listen"){let C=$.getCapabilities(),O=Vu($);return y.close().catch(a),l.serve(m.message,h.signal,C,O)}if(m.messageKind==="request"&&m.message.method==="tools/call"&&y instanceof ni){let C=m.message.params,O=typeof C?.name=="string"?C.name:void 0,L=O===void 0?void 0:y.toolInputSchemaJson(O);if(L!==void 0){let H=Eu(L);if(H.valid&&H.declarations.length>0){let G=i$(H.declarations,C?.arguments,h.headers);if(G!==void 0)return y.close().catch(a),a(new Error(`Rejected inbound request (${G.cell}): ${G.message}`)),Hu(G,m.message.id)}}}Iu($,v),Fu($,Ct),R!==void 0&&d0($,{clientInfo:R[ro],clientCapabilities:b});let T=$.onclose;s.add($),$.onclose=()=>{s.delete($),T?.()};try{let C=await eI(y,m.message,{classification:m.classification,request:h,...z!==void 0&&{authInfo:z},...n!==void 0&&{responseMode:n},...t.keepAliveMs!==void 0&&{keepAliveMs:t.keepAliveMs}});return m.messageKind==="notification"&&queueMicrotask(()=>void $.close().catch(()=>{})),C}catch(C){return C instanceof ue&&C.code===me.ConnectionClosed?new Response(null,{status:499}):(await $.close().catch(()=>{}),s.delete($),a(Bu(C)),Ku(Lr(m.message)))}}async function g(m,h,z,v){if(d!==void 0)return d(h,{...z!==void 0&&{authInfo:z},...v!==void 0&&{parsedBody:v}});let S=xu(m,Ct);return S===void 0?new Response(null,{status:202}):(a(new Error(`Rejected 2025-era request on a modern-only endpoint (${S.cell}): ${S.message}`)),Hu(S,Lr(v)))}async function f(m,h){let z=h?.authInfo;if(m.method.toUpperCase()==="POST"&&!wm(m.headers.get("content-type")))return a(new Error("Unsupported Media Type: Content-Type must be application/json")),Dr(415,-32e3,"Unsupported Media Type: Content-Type must be application/json");let v=await oI(m,h?.parsedBody);if(v.step==="unreadable-body")return Dr(400,-32700,"Parse error: the request body could not be read");if(v.step==="no-json-body")return d!==void 0?d(v.forwardRequest,{...z!==void 0&&{authInfo:z}}):Dr(400,-32700,"Parse error: the request body is not valid JSON");let{outcome:S,body:R,parsedBody:b,forwardRequest:y}=v;try{switch(S.kind){case"reject":return a(new Error(`Rejected inbound request (${S.cell}): ${S.message}`)),Hu(S,Lr(R));case"modern":return await p(S,m,z);case"legacy":return await g(S,y,z,b)}}catch($){return a(Bu($)),Ku(Lr(R))}}return{fetch:async(m,h)=>{if(i)throw new Error("This MCP handler has been closed");try{return await f(m,h)}catch(z){return a(Bu(z)),Ku(Lr(h?.parsedBody))}},notify:u,bus:c,close:async()=>{i=!0,l.closeAll();let m=[...s].map(h=>h.close().catch(()=>{}));s.clear(),await Promise.all(m)}}}function nI(e,t){if(!e)return{ok:!1,errorCode:"missing_host",message:"Missing Host header"};let r;try{r=new URL(`http://${e}`).hostname}catch{return{ok:!1,errorCode:"invalid_host_header",message:`Invalid Host header: ${e}`,hostHeader:e}}return t.includes(r)?{ok:!0,hostname:r}:{ok:!1,errorCode:"invalid_host",message:`Invalid Host: ${r}`,hostHeader:e,hostname:r}}function m0(){return["localhost","127.0.0.1","[::1]"]}function f0(e,t){let r=nI(e.headers.get("host"),t);if(!r.ok)return Response.json({jsonrpc:"2.0",error:{code:-32e3,message:r.message},id:null},{status:403,headers:{"Content-Type":"application/json"}})}function sI(e,t){if(e==null||e==="")return{ok:!0};let r;try{r=new URL(e).hostname}catch{return{ok:!1,errorCode:"invalid_origin_header",message:`Invalid Origin header: ${e}`,originHeader:e}}return r===""?{ok:!1,errorCode:"invalid_origin_header",message:`Invalid Origin header: ${e}`,originHeader:e}:t.includes(r)?{ok:!0,origin:e,hostname:r}:{ok:!1,errorCode:"invalid_origin",message:`Invalid Origin: ${r}`,originHeader:e,hostname:r}}function h0(){return["localhost","127.0.0.1","[::1]"]}function g0(e,t){let r=sI(e.headers.get("origin"),t);if(!r.ok)return Response.json({jsonrpc:"2.0",error:{code:-32e3,message:r.message},id:null},{status:403,headers:{"Content-Type":"application/json"}})}var iI=class{_readBuffer;_started=!1;_closed=!1;constructor(e=Lu.default.stdin,t=Lu.default.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new Rm({maxBufferSize:r?.maxBufferSize})}onclose;onerror;onmessage;_ondata=e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(t){this.onerror?.(t),this.close().catch(()=>{})}};_onerror=e=>{this.onerror?.(e)};_onstdouterror=e=>{this.onerror?.(e),this.close().catch(()=>{})};async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._closed||(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdout.off("error",this._onstdouterror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.())}send(e){return this._closed?Promise.reject(new Error("StdioServerTransport is closed")):new Promise((t,r)=>{let o=Pm(e),n=!1,s=a=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),r(a))},i=()=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),t())};if(this._stdout.once("error",s),this._stdout.write(o)){if(n)return;n=!0,this._stdout.off("error",s),t()}else n||this._stdout.once("drain",i)})}},_0=3e3,aI=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor(e,t,r){this._wire=e,this._onInstanceClose=t,this._outboundIntercept=r}async start(){}async send(e,t){if(Ft(e)||Vt(e)){let{id:r}=e;r!==void 0&&this._settle(r)}if(!this._closed&&this._outboundIntercept?.(e)!=="handled")return this._wire.send(e,t)}setProtocolVersion=e=>{this._wire.setProtocolVersion?.(e)};deliver(e,t){if(!this._closed){if(tt(e))this._pendingRequests.add(e.id);else if(Yt(e)&&e.method==="notifications/cancelled"){let r=e.params?.requestId;r!==void 0&&this._settle(r)}this.onmessage?.(e,t)}}async whenRequestsAnswered(e){return this._closed||this._pendingRequests.size===0?!0:await new Promise(t=>{let r=()=>{clearTimeout(o),t(!0)},o=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter(n=>n!==r),t(!1)},e);this._drainWaiters.push(r)})}async close(){if(!this._closed){this._closed=!0,this._pendingRequests.clear(),this._releaseDrainWaiters();try{this._onInstanceClose()}finally{this.onclose?.()}}}_settle(e){this._pendingRequests.delete(e),this._pendingRequests.size===0&&this._releaseDrainWaiters()}_releaseDrainWaiters(){let e=this._drainWaiters;this._drainWaiters=[];for(let t of e)t()}};function cI(e){let t=e.params;if(e.method==="initialize"&&!ku(t)){let s=t!==null&&typeof t=="object"&&typeof t.protocolVersion=="string"?t.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...s!==void 0&&{requestedVersion:s}}}if(!mo(t))return{kind:"legacy",reason:"no-claim"};let r=Ut(t),o=(r===void 0?[]:lo(r))[0];if(o!==void 0)return{kind:"invalid-envelope",issue:o};let n=ln(t);return n===void 0||!Ct.includes(n)?{kind:"unsupported-revision",requested:n??"unknown"}:{kind:"modern",revision:n,classification:{era:"modern",revision:n}}}function v0(e,t={}){let r=t.legacy??"serve",o=t.transport??new iI,n={phase:"opening"},s,i=!1,a=()=>i||n.phase==="closed",c=$=>{try{t.onerror?.($)}catch{}},u=($,T,C,O)=>o.send({jsonrpc:"2.0",id:$,error:{code:T,message:C,...O!==void 0&&{data:O}}}).catch(L=>c(Bt(L))),l=new i0(t.maxSubscriptions??mn),d=$=>{if(!Yt($))return;let T=l.routeOutbound($);if(T!=="passthrough"){for(let C of T)o.send({jsonrpc:"2.0",...C}).catch(O=>c(Bt(O)));return"handled"}},p=async $=>{if(tt($)&&$.method==="subscriptions/listen"){let T=Ut($.params),C=mo($.params)?(T===void 0?[]:lo(T))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},O=ln($.params),L;if(C!==void 0)L={jsonrpc:"2.0",id:$.id,error:{code:-32602,message:`Invalid _meta envelope: ${C.key}: ${C.problem}`}};else if(O===void 0||!Ct.includes(O)){let H=new po({supported:[...Ct],requested:O??"unknown"});L={jsonrpc:"2.0",id:$.id,error:{code:H.code,message:H.message,data:H.data}}}else L=l.serve($);return await o.send("error"in L?L:{jsonrpc:"2.0",method:L.method,params:L.params}).catch(H=>c(Bt(H))),!0}if(Yt($)&&$.method==="notifications/cancelled"){let T=$.params?.requestId;if(T!==void 0&&l.cancel(T))return!0}return!1},g=($,T,C)=>{let O=xu({kind:"legacy",reason:T,...C!==void 0&&{requestedVersion:C}},Ct);return O===void 0?Promise.resolve():(c(new Error(`Rejected 2025-era request on a modern-only stdio connection (${O.cell}): ${O.message}`)),u($.id,O.code,O.message,O.data))},f=$=>{i||$===s||b()},_=async($,T)=>{let C=await e({era:$}),O=C instanceof ni?C.server:C;$==="modern"&&(Iu(O,T),Fu(O,Ct),l.setServerCapabilities(O.getCapabilities(),Vu(O)));let L=new aI(o,()=>f(L),$==="modern"?d:void 0);return await C.connect(L),{product:C,channel:L}},m=$=>$.product.close().catch(T=>c(Bt(T))),h=async $=>{s=$.channel;try{await $.channel.whenRequestsAnswered(_0)||c(new Error(`Discarded the probe instance with requests still unanswered after ${_0}ms; continuing with the fallback`)),await $.product.close()}catch(T){c(Bt(T))}finally{s=void 0}},z=async $=>{if(n.phase==="closed")return;if(n.phase==="pinned"){if(n.era==="modern"&&tt($)&&$.method==="initialize"&&!ku($.params)){await g($,"initialize",$.params!==null&&typeof $.params=="object"&&typeof $.params.protocolVersion=="string"?$.params.protocolVersion:void 0);return}if(n.era==="modern"&&await p($))return;n.instance.channel.deliver($);return}if(!tt($)&&!Yt($)){c(new Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let T=cI($);switch(T.kind){case"invalid-envelope":{let C=`Invalid _meta envelope for protocol revision 2026-07-28: ${T.issue.key}: ${T.issue.problem}`;tt($)?await u($.id,V.InvalidParams,C,{envelope:T.issue}):c(new Error(`Discarded a notification with a malformed envelope: ${C}`));return}case"unsupported-revision":if(tt($)){let C=new po({supported:[...Ct],requested:T.requested});c(C),await u($.id,C.code,C.message,C.data)}else c(new Error(`Discarded a notification claiming unsupported protocol revision ${T.requested}`));return;case"modern":if(tt($)&&$.method==="server/discover"){if(n.phase==="probe"){n.instance.channel.deliver($,{classification:T.classification});return}let C=await _("modern",T.revision);if(a()){await m(C);return}n={phase:"probe",instance:C},C.channel.deliver($,{classification:T.classification});return}if(n.phase==="probe"){if(Yt($)){n.instance.channel.deliver($,{classification:T.classification});return}n={phase:"pinned",era:"modern",instance:n.instance}}else{let C=await _("modern",T.revision);if(a()){await m(C);return}n={phase:"pinned",era:"modern",instance:C}}if(await p($))return;n.instance.channel.deliver($,{classification:T.classification});return;case"legacy":{if(r==="reject"){tt($)&&await g($,T.reason,T.requestedVersion);return}if(n.phase==="probe"){if(await h(n.instance),a())return;n={phase:"opening"}}let C=await _("legacy");if(a()){await m(C);return}n={phase:"pinned",era:"legacy",instance:C},n.instance.channel.deliver($);return}}},v=[],S=!1,R=async()=>{if(!S){S=!0;try{for(;v.length>0;){let $=v.shift();try{await z($)}catch(T){tt($)&&await u($.id,V.InternalError,"Internal server error"),c(Bt(T))}}}finally{S=!1}}},b=async()=>{if(i||n.phase==="closed")return;i=!0;let $=n;n={phase:"closed"};for(let T of l.teardownAll())await o.send(T).catch(C=>c(Bt(C)));($.phase==="probe"||$.phase==="pinned")&&await $.instance.product.close().catch(T=>c(Bt(T))),await o.close().catch(T=>c(Bt(T)))};o.onmessage=$=>{v.push($),R()},o.onerror=$=>{c($),(n.phase==="probe"||n.phase==="pinned")&&n.instance.channel.onerror?.($)},o.onclose=()=>{if(i||n.phase==="closed")return;i=!0;let $=n;n={phase:"closed"},($.phase==="probe"||$.phase==="pinned")&&$.instance.product.close().catch(T=>c(Bt(T)))};let y=o.start().catch($=>{throw c(Bt($)),$});return y.catch(()=>{}),{close:async()=>{await y.catch(()=>{}),await b()}}}function Bt(e){return e instanceof Error?e:new Error(String(e))}0&&(module.exports={ProtocolError,ProtocolErrorCode,Server,createMcpHandler,hostHeaderValidationResponse,localhostAllowedHostnames,localhostAllowedOrigins,originValidationResponse,serveStdio});
130
158
  /*! For license information please see mcpSdk.js.LEGAL.txt */