@mcpcloud/runtime 0.14.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compat-stdio.js +11 -11
- package/dist/compat-worker.js +37 -37
- package/dist/container-host.js +7 -7
- package/dist/index.js +49 -49
- package/dist/node.js +7 -7
- package/dist/platform-error-messages.d.ts +15 -0
- package/dist/runtimeVersion.d.ts +19 -0
- package/dist/stdio.js +20 -20
- package/package.json +1 -1
package/dist/compat-stdio.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! @mcpcloud/runtime v0.
|
|
2
|
-
var Yh=Object.defineProperty;var Xh=(e)=>e;function Qh(e,t){this[e]=Xh.bind(null,t)}var ei=(e,t)=>{for(var r in t)Yh(e,r,{get:t[r],enumerable:!0,configurable:!0,set:Qh.bind(t,r)})};var{create:ef,defineProperty:In,getOwnPropertyDescriptor:tf,getOwnPropertyNames:rf,getPrototypeOf:of}=Object,nf=Object.prototype.hasOwnProperty,D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Cu=(e,t)=>{let r={};for(var o in e)In(r,o,{get:e[o],enumerable:!0});if(t)In(r,Symbol.toStringTag,{value:"Module"});return r},sf=(e,t,r,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var n=rf(t),s=0,a=n.length,i;s<a;s++)if(i=n[s],!nf.call(e,i)&&i!==r)In(e,i,{get:((c)=>t[c]).bind(null,i),enumerable:!(o=tf(t,i))||o.enumerable})}return e},On=(e,t,r)=>(r=e!=null?ef(of(e)):{},sf(t||!e||!e.__esModule?In(r,"default",{value:e,enumerable:!0}):r,e));var af=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Iu=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),cf=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),uf=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Ou(e){return typeof e==="string"&&Iu.has(e.replace(/#$/,""))}function Nu(e,t){if(!("$schema"in e)||typeof e.$schema!=="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(af.has(r))return"2020-12";if(Iu.has(r))return"2019-09";if(cf.has(r)||uf.has(r))return"draft-7";throw 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 ju,ti=Object.freeze({status:"aborted"});function M(e,t,r){function o(i,c){if(!i._zod)Object.defineProperty(i,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1});if(i._zod.traits.has(e))return;i._zod.traits.add(e),t(i,c);let l=a.prototype,m=Object.keys(l);for(let g=0;g<m.length;g++){let z=m[g];if(!(z in i))i[z]=l[z].bind(i)}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function a(i){var c;let l=r?.Parent?new s:this;o(l,i),(c=l._zod).deferred??(c.deferred=[]);for(let m of l._zod.deferred)m();return l}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:(i)=>{if(r?.Parent&&i instanceof r.Parent)return!0;return i?._zod?.traits?.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}var lf=Symbol("zod_brand");class dt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class go extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(ju=globalThis).__zod_globalConfig??(ju.__zod_globalConfig={});var pr=globalThis.__zod_globalConfig;function Ge(e){if(e)Object.assign(pr,e);return pr}var Se={};ei(Se,{BIGINT_FORMAT_RANGES:()=>Mu,Class:()=>Uu,NUMBER_FORMAT_RANGES:()=>ci,aborted:()=>Pt,allowsEval:()=>si,assert:()=>ff,assertEqual:()=>df,assertIs:()=>pf,assertNever:()=>hf,assertNotEqual:()=>mf,assignProp:()=>Rt,base64ToUint8Array:()=>Zu,base64urlToUint8Array:()=>Of,cached:()=>fr,captureStackTrace:()=>qn,cleanEnum:()=>If,cleanRegex:()=>vo,clone:()=>tt,cloneDef:()=>_f,createTransparentProxy:()=>$f,defineLazy:()=>_e,esc:()=>jn,escapeRegex:()=>pt,explicitlyAborted:()=>ui,extend:()=>Pf,finalizeIssue:()=>rt,floatSafeRemainder:()=>oi,getElementAtPath:()=>Sf,getEnumValues:()=>So,getLengthableOrigin:()=>bo,getParsedType:()=>zf,getSizableOrigin:()=>Lu,hexToUint8Array:()=>jf,isObject:()=>Gt,isPlainObject:()=>wt,issue:()=>gr,joinValues:()=>Nn,jsonStringifyReplacer:()=>hr,merge:()=>Tf,mergeDefs:()=>mt,normalizeParams:()=>re,nullish:()=>yo,numKeys:()=>bf,objectClone:()=>gf,omit:()=>wf,optionalKeys:()=>ii,parsedType:()=>li,partial:()=>kf,pick:()=>Rf,prefixIssues:()=>ht,primitiveTypes:()=>Au,promiseAllObject:()=>yf,propertyKeyTypes:()=>ai,randomString:()=>vf,required:()=>Cf,safeExtend:()=>Ef,shallowClone:()=>xu,slugify:()=>ni,stringifyPrimitive:()=>xn,uint8ArrayToBase64:()=>Du,uint8ArrayToBase64url:()=>Nf,uint8ArrayToHex:()=>qf,unwrapMessage:()=>_o});function df(e){return e}function mf(e){return e}function pf(e){}function hf(e){throw Error("Unexpected value in exhaustive check")}function ff(e){}function So(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 Nn(e,t="|"){return e.map((r)=>xn(r)).join(t)}function hr(e,t){if(typeof t==="bigint")return t.toString();return t}function fr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function yo(e){return e===null||e===void 0}function vo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function oi(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}var qu=Symbol("evaluating");function _e(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===qu)return;if(o===void 0)o=qu,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function gf(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Rt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function mt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function _f(e){return mt(e._zod.def)}function Sf(e,t){if(!t)return e;return t.reduce((r,o)=>r?.[o],e)}function yf(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 vf(e=10){let r="";for(let o=0;o<e;o++)r+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return r}function jn(e){return JSON.stringify(e)}function ni(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var qn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Gt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var si=fr(()=>{if(pr.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function wt(e){if(Gt(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(Gt(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function xu(e){if(wt(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}function bf(e){let t=0;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r))t++;return t}var zf=(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":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},ai=new Set(["string","number","symbol"]),Au=new Set(["string","number","bigint","boolean","symbol","undefined"]);function pt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tt(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return 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 Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function $f(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 xn(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function ii(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var ci={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Mu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Rf(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s=mt(e._zod.def,{get shape(){let a={};for(let i in t){if(!(i in r.shape))throw Error(`Unrecognized key: "${i}"`);if(!t[i])continue;a[i]=r.shape[i]}return Rt(this,"shape",a),a},checks:[]});return tt(e,s)}function wf(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=mt(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let i in t){if(!(i in r.shape))throw Error(`Unrecognized key: "${i}"`);if(!t[i])continue;delete a[i]}return Rt(this,"shape",a),a},checks:[]});return tt(e,s)}function Pf(e,t){if(!wt(t))throw 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 a in t)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=mt(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return Rt(this,"shape",s),s}});return tt(e,n)}function Ef(e,t){if(!wt(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=mt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Rt(this,"shape",o),o}});return tt(e,r)}function Tf(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=mt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Rt(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return tt(e,r)}function kf(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let a=mt(t._zod.def,{get shape(){let i=t._zod.def.shape,c={...i};if(r)for(let l in r){if(!(l in i))throw Error(`Unrecognized key: "${l}"`);if(!r[l])continue;c[l]=e?new e({type:"optional",innerType:i[l]}):i[l]}else for(let l in i)c[l]=e?new e({type:"optional",innerType:i[l]}):i[l];return Rt(this,"shape",c),c},checks:[]});return tt(t,a)}function Cf(e,t,r){let o=mt(t._zod.def,{get shape(){let n=t._zod.def.shape,s={...n};if(r)for(let a in r){if(!(a in s))throw Error(`Unrecognized key: "${a}"`);if(!r[a])continue;s[a]=new e({type:"nonoptional",innerType:n[a]})}else for(let a in n)s[a]=new e({type:"nonoptional",innerType:n[a]});return Rt(this,"shape",s),s}});return tt(t,o)}function Pt(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 ui(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 ht(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function _o(e){return typeof e==="string"?e:e?.message}function rt(e,t,r){let o=e.message?e.message:_o(e.inst?._zod.def?.error?.(e))??_o(t?.error?.(e))??_o(r.customError?.(e))??_o(r.localeError?.(e))??"Invalid input",{inst:n,continue:s,input:a,...i}=e;if(i.path??(i.path=[]),i.message=o,t?.reportInput)i.input=a;return i}function Lu(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function bo(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function li(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 gr(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function If(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map((t)=>t[1])}function Zu(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 Du(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Of(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Zu(t+r)}function Nf(e){return Du(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function jf(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw 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 qf(e){return Array.from(e).map((t)=>t.toString(16).padStart(2,"0")).join("")}class Uu{constructor(...e){}}var Vu=(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,hr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},An=M("$ZodError",Vu),di=M("$ZodError",Vu,{Parent:Error});function mi(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function pi(e,t=(r)=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map((i)=>o({issues:i},[...s,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...s,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...s,...a.path]);else{let i=[...s,...a.path];if(i.length===0)r._errors.push(t(a));else{let c=r,l=0;while(l<i.length){let m=i[l];if(l!==i.length-1)c[m]=c[m]||{_errors:[]};else c[m]=c[m]||{_errors:[]},c[m]._errors.push(t(a));c=c[m],l++}}}};return o(e),r}var Mn=(e)=>(t,r,o,n)=>{let s=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new dt;if(a.issues.length){let i=new(n?.Err??e)(a.issues.map((c)=>rt(c,s,Ge())));throw qn(i,n?.callee),i}return a.value};var Ln=(e)=>async(t,r,o,n)=>{let s=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)a=await a;if(a.issues.length){let i=new(n?.Err??e)(a.issues.map((c)=>rt(c,s,Ge())));throw qn(i,n?.callee),i}return a.value};var zo=(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 dt;return s.issues.length?{success:!1,error:new(e??An)(s.issues.map((a)=>rt(a,n,Ge())))}:{success:!0,data:s.value}},Fu=zo(di),$o=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)s=await s;return s.issues.length?{success:!1,error:new e(s.issues.map((a)=>rt(a,n,Ge())))}:{success:!0,data:s.value}},Hu=$o(di),Ju=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Mn(e)(t,r,n)};var Bu=(e)=>(t,r,o)=>Mn(e)(t,r,o);var Ku=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ln(e)(t,r,n)};var Gu=(e)=>async(t,r,o)=>Ln(e)(t,r,o);var Wu=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return zo(e)(t,r,n)};var Yu=(e)=>(t,r,o)=>zo(e)(t,r,o);var Xu=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return $o(e)(t,r,n)};var Qu=(e)=>async(t,r,o)=>$o(e)(t,r,o);var el=/^[cC][0-9a-z]{6,}$/,tl=/^[0-9a-z]+$/,rl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ol=/^[0-9a-vA-V]{20}$/,nl=/^[A-Za-z0-9]{27}$/,sl=/^[a-zA-Z0-9_-]{21}$/,al=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var il=/^([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})$/,hi=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var cl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Af="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ul(){return new RegExp(Af,"u")}var ll=/^(?:(?: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])$/,dl=/^(([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 ml=/^((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])$/,pl=/^(([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])$/,hl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fi=/^[A-Za-z0-9_-]*$/;var fl=/^https?$/,gl=/^\+[1-9]\d{6,14}$/,_l="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Sl=new RegExp(`^${_l}$`);function yl(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function vl(e){return new RegExp(`^${yl(e)}$`)}function bl(e){let t=yl({precision:e.precision}),r=["Z"];if(e.local)r.push("");if(e.offset)r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${_l}T(?:${o})$`)}var zl=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},$l=/^-?\d+n?$/,Rl=/^-?\d+$/,Zn=/^-?\d+(?:\.\d+)?$/,wl=/^(?:true|false)$/i,Pl=/^null$/i;var El=/^[^A-Z]*$/,Tl=/^[^a-z]*$/;var Le=M("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),kl={number:"number",bigint:"bigint",object:"date"},gi=M("$ZodCheckLessThan",(e,t)=>{Le.init(e,t);let r=kl[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<s)if(t.inclusive)n.maximum=t.value;else n.exclusiveMaximum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;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})}}),_i=M("$ZodCheckGreaterThan",(e,t)=>{Le.init(e,t);let r=kl[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>s)if(t.inclusive)n.minimum=t.value;else n.exclusiveMinimum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;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})}}),Cl=M("$ZodCheckMultipleOf",(e,t)=>{Le.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 Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?r.value%t.value===BigInt(0):oi(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Il=M("$ZodCheckNumberFormat",(e,t)=>{Le.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=ci[t.format];e._zod.onattach.push((a)=>{let i=a._zod.bag;if(i.format=t.format,i.minimum=n,i.maximum=s,r)i.pattern=Rl}),e._zod.check=(a)=>{let i=a.value;if(r){if(!Number.isInteger(i)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:i,inst:e});return}if(!Number.isSafeInteger(i)){if(i>0)a.issues.push({input:i,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});else a.issues.push({input:i,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}}if(i<n)a.issues.push({origin:"number",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(i>s)a.issues.push({origin:"number",input:i,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Ol=M("$ZodCheckMaxLength",(e,t)=>{var r;Le.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!yo(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<n)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let n=o.value;if(n.length<=t.maximum)return;let a=bo(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Nl=M("$ZodCheckMinLength",(e,t)=>{var r;Le.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!yo(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>n)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let n=o.value;if(n.length>=t.minimum)return;let a=bo(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),jl=M("$ZodCheckLengthEquals",(e,t)=>{var r;Le.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!yo(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 a=bo(n),i=s>t.length;o.issues.push({origin:a,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),wo=M("$ZodCheckStringFormat",(e,t)=>{var r,o;if(Le.init(e,t),e._zod.onattach.push((n)=>{let s=n._zod.bag;if(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)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;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})});else(o=e._zod).check??(o.check=()=>{})}),ql=M("$ZodCheckRegex",(e,t)=>{wo.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),xl=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=El),wo.init(e,t)}),Al=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Tl),wo.init(e,t)}),Ml=M("$ZodCheckIncludes",(e,t)=>{Le.init(e,t);let r=pt(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)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ll=M("$ZodCheckStartsWith",(e,t)=>{Le.init(e,t);let r=new RegExp(`^${pt(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)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Zl=M("$ZodCheckEndsWith",(e,t)=>{Le.init(e,t);let r=new RegExp(`.*${pt(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)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Dl=M("$ZodCheckOverwrite",(e,t)=>{Le.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class Si{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
1
|
+
/*! @mcpcloud/runtime v0.15.1 — (c) MCPCloud.sh. All rights reserved. SEE LICENSE: https://www.npmjs.com/package/@mcpcloud/runtime */
|
|
2
|
+
var{create:Ih,defineProperty:$n,getOwnPropertyDescriptor:Oh,getOwnPropertyNames:Nh,getPrototypeOf:jh}=Object,qh=Object.prototype.hasOwnProperty,D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),fu=(e,t)=>{let r={};for(var o in e)$n(r,o,{get:e[o],enumerable:!0});if(t)$n(r,Symbol.toStringTag,{value:"Module"});return r},xh=(e,t,r,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var n=Nh(t),s=0,a=n.length,i;s<a;s++)if(i=n[s],!qh.call(e,i)&&i!==r)$n(e,i,{get:((c)=>t[c]).bind(null,i),enumerable:!(o=Oh(t,i))||o.enumerable})}return e},Rn=(e,t,r)=>(r=e!=null?Ih(jh(e)):{},xh(t||!e||!e.__esModule?$n(r,"default",{value:e,enumerable:!0}):r,e));var Ah=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),gu=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),Mh=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),Lh=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function _u(e){return typeof e==="string"&&gu.has(e.replace(/#$/,""))}function Su(e,t){if(!("$schema"in e)||typeof e.$schema!=="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(Ah.has(r))return"2020-12";if(gu.has(r))return"2019-09";if(Mh.has(r)||Lh.has(r))return"draft-7";throw 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 yu,Ga=Object.freeze({status:"aborted"});function M(e,t,r){function o(i,c){if(!i._zod)Object.defineProperty(i,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1});if(i._zod.traits.has(e))return;i._zod.traits.add(e),t(i,c);let l=a.prototype,m=Object.keys(l);for(let g=0;g<m.length;g++){let z=m[g];if(!(z in i))i[z]=l[z].bind(i)}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function a(i){var c;let l=r?.Parent?new s:this;o(l,i),(c=l._zod).deferred??(c.deferred=[]);for(let m of l._zod.deferred)m();return l}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:(i)=>{if(r?.Parent&&i instanceof r.Parent)return!0;return i?._zod?.traits?.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}var Zh=Symbol("zod_brand");class ut extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class uo extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(yu=globalThis).__zod_globalConfig??(yu.__zod_globalConfig={});var lr=globalThis.__zod_globalConfig;function Ke(e){if(e)Object.assign(lr,e);return lr}function Pn(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 Ya(e,t="|"){return e.map((r)=>ti(r)).join(t)}function lo(e,t){if(typeof t==="bigint")return t.toString();return t}function mo(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function En(e){return e===null||e===void 0}function Tn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function bu(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}var vu=Symbol("evaluating");function _e(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===vu)return;if(o===void 0)o=vu,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Vt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function St(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function Xa(e){return JSON.stringify(e)}function zu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Qa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function dr(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var $u=mo(()=>{if(lr.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Ft(e){if(dr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(dr(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function ei(e){if(Ft(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var Ru=new Set(["string","number","symbol"]);function yt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rt(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function X(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 Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function ti(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function wu(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Pu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Dh(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s=St(e._zod.def,{get shape(){let a={};for(let i in t){if(!(i in r.shape))throw Error(`Unrecognized key: "${i}"`);if(!t[i])continue;a[i]=r.shape[i]}return Vt(this,"shape",a),a},checks:[]});return rt(e,s)}function Uh(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=St(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let i in t){if(!(i in r.shape))throw Error(`Unrecognized key: "${i}"`);if(!t[i])continue;delete a[i]}return Vt(this,"shape",a),a},checks:[]});return rt(e,s)}function Vh(e,t){if(!Ft(t))throw 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 a in t)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=St(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return Vt(this,"shape",s),s}});return rt(e,n)}function Fh(e,t){if(!Ft(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=St(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Vt(this,"shape",o),o}});return rt(e,r)}function Hh(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=St(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Vt(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return rt(e,r)}function Jh(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let a=St(t._zod.def,{get shape(){let i=t._zod.def.shape,c={...i};if(r)for(let l in r){if(!(l in i))throw Error(`Unrecognized key: "${l}"`);if(!r[l])continue;c[l]=e?new e({type:"optional",innerType:i[l]}):i[l]}else for(let l in i)c[l]=e?new e({type:"optional",innerType:i[l]}):i[l];return Vt(this,"shape",c),c},checks:[]});return rt(t,a)}function Bh(e,t,r){let o=St(t._zod.def,{get shape(){let n=t._zod.def.shape,s={...n};if(r)for(let a in r){if(!(a in s))throw Error(`Unrecognized key: "${a}"`);if(!r[a])continue;s[a]=new e({type:"nonoptional",innerType:n[a]})}else for(let a in n)s[a]=new e({type:"nonoptional",innerType:n[a]});return Vt(this,"shape",s),s}});return rt(t,o)}function Ht(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 Eu(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 vt(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function wn(e){return typeof e==="string"?e:e?.message}function ot(e,t,r){let o=e.message?e.message:wn(e.inst?._zod.def?.error?.(e))??wn(t?.error?.(e))??wn(r.customError?.(e))??wn(r.localeError?.(e))??"Invalid input",{inst:n,continue:s,input:a,...i}=e;if(i.path??(i.path=[]),i.message=o,t?.reportInput)i.input=a;return i}function kn(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Tu(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 Jt(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}var ku=(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,lo,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Cn=M("$ZodError",ku),ri=M("$ZodError",ku,{Parent:Error});function oi(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function ni(e,t=(r)=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map((i)=>o({issues:i},[...s,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...s,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...s,...a.path]);else{let i=[...s,...a.path];if(i.length===0)r._errors.push(t(a));else{let c=r,l=0;while(l<i.length){let m=i[l];if(l!==i.length-1)c[m]=c[m]||{_errors:[]};else c[m]=c[m]||{_errors:[]},c[m]._errors.push(t(a));c=c[m],l++}}}};return o(e),r}var In=(e)=>(t,r,o,n)=>{let s=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new ut;if(a.issues.length){let i=new(n?.Err??e)(a.issues.map((c)=>ot(c,s,Ke())));throw Qa(i,n?.callee),i}return a.value};var On=(e)=>async(t,r,o,n)=>{let s=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)a=await a;if(a.issues.length){let i=new(n?.Err??e)(a.issues.map((c)=>ot(c,s,Ke())));throw Qa(i,n?.callee),i}return a.value};var po=(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??Cn)(s.issues.map((a)=>ot(a,n,Ke())))}:{success:!0,data:s.value}},Cu=po(ri),ho=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)s=await s;return s.issues.length?{success:!1,error:new e(s.issues.map((a)=>ot(a,n,Ke())))}:{success:!0,data:s.value}},Iu=ho(ri),Ou=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return In(e)(t,r,n)};var Nu=(e)=>(t,r,o)=>In(e)(t,r,o);var ju=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return On(e)(t,r,n)};var qu=(e)=>async(t,r,o)=>On(e)(t,r,o);var xu=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return po(e)(t,r,n)};var Au=(e)=>(t,r,o)=>po(e)(t,r,o);var Mu=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return ho(e)(t,r,n)};var Lu=(e)=>async(t,r,o)=>ho(e)(t,r,o);var Zu=/^[cC][0-9a-z]{6,}$/,Du=/^[0-9a-z]+$/,Uu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vu=/^[0-9a-vA-V]{20}$/,Fu=/^[A-Za-z0-9]{27}$/,Hu=/^[a-zA-Z0-9_-]{21}$/,Ju=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Bu=/^([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})$/,si=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var Ku=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Gh="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Gu(){return new RegExp(Gh,"u")}var Wu=/^(?:(?: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])$/,Yu=/^(([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 Xu=/^((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])$/,Qu=/^(([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])$/,el=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ai=/^[A-Za-z0-9_-]*$/;var tl=/^https?$/,rl=/^\+[1-9]\d{6,14}$/,ol="(?:(?:\\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])))",nl=new RegExp(`^${ol}$`);function sl(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function al(e){return new RegExp(`^${sl(e)}$`)}function il(e){let t=sl({precision:e.precision}),r=["Z"];if(e.local)r.push("");if(e.offset)r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${ol}T(?:${o})$`)}var cl=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var ul=/^-?\d+$/,ii=/^-?\d+(?:\.\d+)?$/,ll=/^(?:true|false)$/i,dl=/^null$/i;var ml=/^[^A-Z]*$/,pl=/^[^a-z]*$/;var Me=M("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),hl={number:"number",bigint:"bigint",object:"date"},ci=M("$ZodCheckLessThan",(e,t)=>{Me.init(e,t);let r=hl[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<s)if(t.inclusive)n.maximum=t.value;else n.exclusiveMaximum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;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})}}),ui=M("$ZodCheckGreaterThan",(e,t)=>{Me.init(e,t);let r=hl[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>s)if(t.inclusive)n.minimum=t.value;else n.exclusiveMinimum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;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})}}),fl=M("$ZodCheckMultipleOf",(e,t)=>{Me.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 Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?r.value%t.value===BigInt(0):bu(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),gl=M("$ZodCheckNumberFormat",(e,t)=>{Me.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Pu[t.format];e._zod.onattach.push((a)=>{let i=a._zod.bag;if(i.format=t.format,i.minimum=n,i.maximum=s,r)i.pattern=ul}),e._zod.check=(a)=>{let i=a.value;if(r){if(!Number.isInteger(i)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:i,inst:e});return}if(!Number.isSafeInteger(i)){if(i>0)a.issues.push({input:i,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});else a.issues.push({input:i,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}}if(i<n)a.issues.push({origin:"number",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(i>s)a.issues.push({origin:"number",input:i,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var _l=M("$ZodCheckMaxLength",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!En(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<n)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let n=o.value;if(n.length<=t.maximum)return;let a=kn(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Sl=M("$ZodCheckMinLength",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!En(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>n)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let n=o.value;if(n.length>=t.minimum)return;let a=kn(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),yl=M("$ZodCheckLengthEquals",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!En(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 a=kn(n),i=s>t.length;o.issues.push({origin:a,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),go=M("$ZodCheckStringFormat",(e,t)=>{var r,o;if(Me.init(e,t),e._zod.onattach.push((n)=>{let s=n._zod.bag;if(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)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;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})});else(o=e._zod).check??(o.check=()=>{})}),vl=M("$ZodCheckRegex",(e,t)=>{go.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),bl=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ml),go.init(e,t)}),zl=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=pl),go.init(e,t)}),$l=M("$ZodCheckIncludes",(e,t)=>{Me.init(e,t);let r=yt(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)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Rl=M("$ZodCheckStartsWith",(e,t)=>{Me.init(e,t);let r=new RegExp(`^${yt(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)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),wl=M("$ZodCheckEndsWith",(e,t)=>{Me.init(e,t);let r=new RegExp(`.*${yt(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)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Pl=M("$ZodCheckOverwrite",(e,t)=>{Me.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class li{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
3
3
|
`).filter((s)=>s),o=Math.min(...r.map((s)=>s.length-s.trimStart().length)),n=r.map((s)=>s.slice(o)).map((s)=>" ".repeat(this.indent*2)+s);for(let s of n)this.content.push(s)}compile(){let e=Function,t=this?.args,o=[...(this?.content??[""]).map((n)=>` ${n}`)];return new e(...t,o.join(`
|
|
4
|
-
`))}}var Vl={major:4,minor:4,patch:3};var ye=M("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Vl;let o=[...e._zod.def.checks??[]];if(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=(a,i,c)=>{let l=Pt(a),m;for(let g of i){if(g._zod.def.when){if(ui(a))continue;if(!g._zod.def.when(a))continue}else if(l)continue;let z=a.issues.length,w=g._zod.check(a);if(w instanceof Promise&&c?.async===!1)throw new dt;if(m||w instanceof Promise)m=(m??Promise.resolve()).then(async()=>{if(await w,a.issues.length===z)return;if(!l)l=Pt(a,z)});else{if(a.issues.length===z)continue;if(!l)l=Pt(a,z)}}if(m)return m.then(()=>a);return a},s=(a,i,c)=>{if(Pt(a))return a.aborted=!0,a;let l=n(i,o,c);if(l instanceof Promise){if(c.async===!1)throw new dt;return l.then((m)=>e._zod.parse(m,c))}return e._zod.parse(l,c)};e._zod.run=(a,i)=>{if(i.skipChecks)return e._zod.parse(a,i);if(i.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...i,skipChecks:!0});if(l instanceof Promise)return l.then((m)=>s(m,a,i));return s(l,a,i)}let c=e._zod.parse(a,i);if(c instanceof Promise){if(i.async===!1)throw new dt;return c.then((l)=>n(l,o,i))}return n(c,o,i)}}_e(e,"~standard",()=>({validate:(n)=>{try{let s=Fu(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch(s){return Hu(e,n).then((a)=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Vn=M("$ZodString",(e,t)=>{ye.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??zl(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Re=M("$ZodStringFormat",(e,t)=>{wo.init(e,t),Vn.init(e,t)}),Xl=M("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=il),Re.init(e,t)}),Ql=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 Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=hi(o))}else t.pattern??(t.pattern=hi());Re.init(e,t)}),ed=M("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cl),Re.init(e,t)}),td=M("$ZodURL",(e,t)=>{Re.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===fl.source){if(!/^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);if(t.hostname){if(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})}if(t.protocol){if(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})}if(t.normalize)r.value=n.href;else r.value=o;return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),rd=M("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ul()),Re.init(e,t)}),od=M("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=sl),Re.init(e,t)}),nd=M("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=el),Re.init(e,t)}),sd=M("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=tl),Re.init(e,t)}),ad=M("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rl),Re.init(e,t)}),id=M("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ol),Re.init(e,t)}),cd=M("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=nl),Re.init(e,t)}),ud=M("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=bl(t)),Re.init(e,t)}),ld=M("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Sl),Re.init(e,t)}),dd=M("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=vl(t)),Re.init(e,t)}),md=M("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=al),Re.init(e,t)}),pd=M("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ll),Re.init(e,t),e._zod.bag.format="ipv4"}),hd=M("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=dl),Re.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 fd=M("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ml),Re.init(e,t)}),gd=M("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=pl),Re.init(e,t),e._zod.check=(r)=>{let o=r.value.split("/");try{if(o.length!==2)throw Error();let[n,s]=o;if(!s)throw Error();let a=Number(s);if(`${a}`!==s)throw Error();if(a<0||a>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function _d(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Sd=M("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=hl),Re.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(r)=>{if(_d(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Mf(e){if(!fi.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return _d(r)}var yd=M("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=fi),Re.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(r)=>{if(Mf(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),vd=M("$ZodE164",(e,t)=>{t.pattern??(t.pattern=gl),Re.init(e,t)});function Lf(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));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var bd=M("$ZodJWT",(e,t)=>{Re.init(e,t),e._zod.check=(r)=>{if(Lf(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var vi=M("$ZodNumber",(e,t)=>{ye.init(e,t),e._zod.pattern=e._zod.bag.pattern??Zn,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(a){}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)?"Infinity":void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),zd=M("$ZodNumberFormat",(e,t)=>{Il.init(e,t),vi.init(e,t)}),$d=M("$ZodBoolean",(e,t)=>{ye.init(e,t),e._zod.pattern=wl,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(s){}let n=r.value;if(typeof n==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Rd=M("$ZodBigInt",(e,t)=>{ye.init(e,t),e._zod.pattern=$l,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(n){}if(typeof r.value==="bigint")return r;return r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var wd=M("$ZodNull",(e,t)=>{ye.init(e,t),e._zod.pattern=Pl,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Pd=M("$ZodAny",(e,t)=>{ye.init(e,t),e._zod.parse=(r)=>r}),Ed=M("$ZodUnknown",(e,t)=>{ye.init(e,t),e._zod.parse=(r)=>r}),Td=M("$ZodNever",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});var kd=M("$ZodDate",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(i){}let n=r.value,s=n instanceof Date;if(s&&!Number.isNaN(n.getTime()))return r;return r.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Fl(e,t,r){if(e.issues.length)t.issues.push(...ht(r,e.issues));t.value[r]=e.value}var Cd=M("$ZodArray",(e,t)=>{ye.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 a=0;a<n.length;a++){let i=n[a],c=t.element._zod.run({value:i,issues:[]},o);if(c instanceof Promise)s.push(c.then((l)=>Fl(l,r,a)));else Fl(c,r,a)}if(s.length)return Promise.all(s).then(()=>r);return r}});function Un(e,t,r,o,n,s){let a=r in o;if(e.issues.length){if(n&&s&&!a)return;t.issues.push(...ht(r,e.issues))}if(!a&&!n){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(a)t.value[r]=void 0}else t.value[r]=e.value}function Id(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${o}": expected a Zod schema`);let r=ii(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Od(e,t,r,o,n,s){let a=[],i=n.keySet,c=n.catchall._zod,l=c.def.type,m=c.optin==="optional",g=c.optout==="optional";for(let z in t){if(z==="__proto__")continue;if(i.has(z))continue;if(l==="never"){a.push(z);continue}let w=c.run({value:t[z],issues:[]},o);if(w instanceof Promise)e.push(w.then((_)=>Un(_,r,z,t,m,g)));else Un(w,r,z,t,m,g)}if(a.length)r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s});if(!e.length)return r;return Promise.all(e).then(()=>r)}var Zf=M("$ZodObject",(e,t)=>{if(ye.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let i=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...i};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=fr(()=>Id(t));_e(e._zod,"propValues",()=>{let i=t.shape,c={};for(let l in i){let m=i[l]._zod;if(m.values){c[l]??(c[l]=new Set);for(let g of m.values)c[l].add(g)}}return c});let n=Gt,s=t.catchall,a;e._zod.parse=(i,c)=>{a??(a=o.value);let l=i.value;if(!n(l))return i.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),i;i.value={};let m=[],g=a.shape;for(let z of a.keys){let w=g[z],_=w._zod.optin==="optional",b=w._zod.optout==="optional",f=w._zod.run({value:l[z],issues:[]},c);if(f instanceof Promise)m.push(f.then((d)=>Un(d,i,z,l,_,b)));else Un(f,i,z,l,_,b)}if(!s)return m.length?Promise.all(m).then(()=>i):i;return Od(m,l,i,c,o.value,e)}}),Nd=M("$ZodObjectJIT",(e,t)=>{Zf.init(e,t);let r=e._zod.parse,o=fr(()=>Id(t)),n=(z)=>{let w=new Si(["shape","payload","ctx"]),_=o.value,b=(p)=>{let S=jn(p);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};w.write("const input = payload.value;");let f=Object.create(null),d=0;for(let p of _.keys)f[p]=`key_${d++}`;w.write("const newResult = {};");for(let p of _.keys){let S=f[p],P=jn(p),y=z[p],h=y?._zod?.optin==="optional",E=y?._zod?.optout==="optional";if(w.write(`const ${S} = ${b(p)};`),h&&E)w.write(`
|
|
4
|
+
`))}}var Tl={major:4,minor:4,patch:3};var Se=M("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Tl;let o=[...e._zod.def.checks??[]];if(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=(a,i,c)=>{let l=Ht(a),m;for(let g of i){if(g._zod.def.when){if(Eu(a))continue;if(!g._zod.def.when(a))continue}else if(l)continue;let z=a.issues.length,w=g._zod.check(a);if(w instanceof Promise&&c?.async===!1)throw new ut;if(m||w instanceof Promise)m=(m??Promise.resolve()).then(async()=>{if(await w,a.issues.length===z)return;if(!l)l=Ht(a,z)});else{if(a.issues.length===z)continue;if(!l)l=Ht(a,z)}}if(m)return m.then(()=>a);return a},s=(a,i,c)=>{if(Ht(a))return a.aborted=!0,a;let l=n(i,o,c);if(l instanceof Promise){if(c.async===!1)throw new ut;return l.then((m)=>e._zod.parse(m,c))}return e._zod.parse(l,c)};e._zod.run=(a,i)=>{if(i.skipChecks)return e._zod.parse(a,i);if(i.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...i,skipChecks:!0});if(l instanceof Promise)return l.then((m)=>s(m,a,i));return s(l,a,i)}let c=e._zod.parse(a,i);if(c instanceof Promise){if(i.async===!1)throw new ut;return c.then((l)=>n(l,o,i))}return n(c,o,i)}}_e(e,"~standard",()=>({validate:(n)=>{try{let s=Cu(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch(s){return Iu(e,n).then((a)=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),qn=M("$ZodString",(e,t)=>{Se.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??cl(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),$e=M("$ZodStringFormat",(e,t)=>{go.init(e,t),qn.init(e,t)}),Al=M("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Bu),$e.init(e,t)}),Ml=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 Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=si(o))}else t.pattern??(t.pattern=si());$e.init(e,t)}),Ll=M("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ku),$e.init(e,t)}),Zl=M("$ZodURL",(e,t)=>{$e.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===tl.source){if(!/^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);if(t.hostname){if(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})}if(t.protocol){if(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})}if(t.normalize)r.value=n.href;else r.value=o;return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Dl=M("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Gu()),$e.init(e,t)}),Ul=M("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Hu),$e.init(e,t)}),Vl=M("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Zu),$e.init(e,t)}),Fl=M("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Du),$e.init(e,t)}),Hl=M("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Uu),$e.init(e,t)}),Jl=M("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Vu),$e.init(e,t)}),Bl=M("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Fu),$e.init(e,t)}),Kl=M("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=il(t)),$e.init(e,t)}),Gl=M("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=nl),$e.init(e,t)}),Wl=M("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=al(t)),$e.init(e,t)}),Yl=M("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ju),$e.init(e,t)}),Xl=M("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Wu),$e.init(e,t),e._zod.bag.format="ipv4"}),Ql=M("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Yu),$e.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 ed=M("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Xu),$e.init(e,t)}),td=M("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Qu),$e.init(e,t),e._zod.check=(r)=>{let o=r.value.split("/");try{if(o.length!==2)throw Error();let[n,s]=o;if(!s)throw Error();let a=Number(s);if(`${a}`!==s)throw Error();if(a<0||a>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function rd(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var od=M("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=el),$e.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(r)=>{if(rd(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Wh(e){if(!ai.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return rd(r)}var nd=M("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ai),$e.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(r)=>{if(Wh(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),sd=M("$ZodE164",(e,t)=>{t.pattern??(t.pattern=rl),$e.init(e,t)});function Yh(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));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var ad=M("$ZodJWT",(e,t)=>{$e.init(e,t),e._zod.check=(r)=>{if(Yh(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var mi=M("$ZodNumber",(e,t)=>{Se.init(e,t),e._zod.pattern=e._zod.bag.pattern??ii,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(a){}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)?"Infinity":void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),id=M("$ZodNumberFormat",(e,t)=>{gl.init(e,t),mi.init(e,t)}),cd=M("$ZodBoolean",(e,t)=>{Se.init(e,t),e._zod.pattern=ll,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(s){}let n=r.value;if(typeof n==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}});var ud=M("$ZodNull",(e,t)=>{Se.init(e,t),e._zod.pattern=dl,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),ld=M("$ZodAny",(e,t)=>{Se.init(e,t),e._zod.parse=(r)=>r}),dd=M("$ZodUnknown",(e,t)=>{Se.init(e,t),e._zod.parse=(r)=>r}),md=M("$ZodNever",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function kl(e,t,r){if(e.issues.length)t.issues.push(...vt(r,e.issues));t.value[r]=e.value}var pd=M("$ZodArray",(e,t)=>{Se.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 a=0;a<n.length;a++){let i=n[a],c=t.element._zod.run({value:i,issues:[]},o);if(c instanceof Promise)s.push(c.then((l)=>kl(l,r,a)));else kl(c,r,a)}if(s.length)return Promise.all(s).then(()=>r);return r}});function jn(e,t,r,o,n,s){let a=r in o;if(e.issues.length){if(n&&s&&!a)return;t.issues.push(...vt(r,e.issues))}if(!a&&!n){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(a)t.value[r]=void 0}else t.value[r]=e.value}function hd(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${o}": expected a Zod schema`);let r=wu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function fd(e,t,r,o,n,s){let a=[],i=n.keySet,c=n.catchall._zod,l=c.def.type,m=c.optin==="optional",g=c.optout==="optional";for(let z in t){if(z==="__proto__")continue;if(i.has(z))continue;if(l==="never"){a.push(z);continue}let w=c.run({value:t[z],issues:[]},o);if(w instanceof Promise)e.push(w.then((_)=>jn(_,r,z,t,m,g)));else jn(w,r,z,t,m,g)}if(a.length)r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s});if(!e.length)return r;return Promise.all(e).then(()=>r)}var Xh=M("$ZodObject",(e,t)=>{if(Se.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let i=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...i};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=mo(()=>hd(t));_e(e._zod,"propValues",()=>{let i=t.shape,c={};for(let l in i){let m=i[l]._zod;if(m.values){c[l]??(c[l]=new Set);for(let g of m.values)c[l].add(g)}}return c});let n=dr,s=t.catchall,a;e._zod.parse=(i,c)=>{a??(a=o.value);let l=i.value;if(!n(l))return i.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),i;i.value={};let m=[],g=a.shape;for(let z of a.keys){let w=g[z],_=w._zod.optin==="optional",b=w._zod.optout==="optional",f=w._zod.run({value:l[z],issues:[]},c);if(f instanceof Promise)m.push(f.then((d)=>jn(d,i,z,l,_,b)));else jn(f,i,z,l,_,b)}if(!s)return m.length?Promise.all(m).then(()=>i):i;return fd(m,l,i,c,o.value,e)}}),gd=M("$ZodObjectJIT",(e,t)=>{Xh.init(e,t);let r=e._zod.parse,o=mo(()=>hd(t)),n=(z)=>{let w=new li(["shape","payload","ctx"]),_=o.value,b=(p)=>{let S=Xa(p);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};w.write("const input = payload.value;");let f=Object.create(null),d=0;for(let p of _.keys)f[p]=`key_${d++}`;w.write("const newResult = {};");for(let p of _.keys){let S=f[p],P=Xa(p),y=z[p],h=y?._zod?.optin==="optional",E=y?._zod?.optout==="optional";if(w.write(`const ${S} = ${b(p)};`),h&&E)w.write(`
|
|
5
5
|
if (${S}.issues.length) {
|
|
6
6
|
if (${P} in input) {
|
|
7
7
|
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
@@ -60,19 +60,19 @@ var Yh=Object.defineProperty;var Xh=(e)=>e;function Qh(e,t){this[e]=Xh.bind(null
|
|
|
60
60
|
newResult[${P}] = ${S}.value;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
`)}w.write("payload.value = newResult;"),w.write("return payload;");let v=w.compile();return(p,S)=>v(z,p,S)},s,a=Gt,i=!pr.jitless,l=i&&si.value,m=t.catchall,g;e._zod.parse=(z,w)=>{g??(g=o.value);let _=z.value;if(!a(_))return z.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),z;if(i&&l&&w?.async===!1&&w.jitless!==!0){if(!s)s=n(t.shape);if(z=s(z,w),!m)return z;return Od([],_,z,w,g,e)}return r(z,w)}});function Hl(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)=>!Pt(s));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((s)=>s.issues.map((a)=>rt(a,o,Ge())))}),t}var bi=M("$ZodUnion",(e,t)=>{ye.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)));return}),_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)=>vo(n.source)).join("|")})$`)}return});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,a=[];for(let i of t.options){let c=i._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}if(!s)return Hl(a,o,e,n);return Promise.all(a).then((i)=>Hl(i,o,e,n))}});var jd=M("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,bi.init(e,t);let r=e._zod.parse;_e(e._zod,"propValues",()=>{let n={};for(let s of t.options){let a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[i,c]of Object.entries(a)){if(!n[i])n[i]=new Set;for(let l of c)n[i].add(l)}}return n});let o=fr(()=>{let n=t.options,s=new Map;for(let a of n){let i=a._zod.propValues?.[t.discriminator];if(!i||i.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of i){if(s.has(c))throw Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,a)}}return s});e._zod.parse=(n,s)=>{let a=n.value;if(!Gt(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let i=o.value.get(a?.[t.discriminator]);if(i)return i._zod.run(n,s);if(t.unionFallback||s.direction==="backward")return r(n,s);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n}}),qd=M("$ZodIntersection",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,s=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);if(s instanceof Promise||a instanceof Promise)return Promise.all([s,a]).then(([c,l])=>Jl(r,c,l));return Jl(r,s,a)}});function yi(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(wt(e)&&wt(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 a=yi(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};n[s]=a.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],a=yi(n,s);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Jl(e,t,r){let o=new Map,n;for(let i of t.issues)if(i.code==="unrecognized_keys"){n??(n=i);for(let c of i.keys){if(!o.has(c))o.set(c,{});o.get(c).l=!0}}else e.issues.push(i);for(let i of r.issues)if(i.code==="unrecognized_keys")for(let c of i.keys){if(!o.has(c))o.set(c,{});o.get(c).r=!0}else e.issues.push(i);let s=[...o].filter(([,i])=>i.l&&i.r).map(([i])=>i);if(s.length&&n)e.issues.push({...n,keys:s});if(Pt(e))return e;let a=yi(t.value,r.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var xd=M("$ZodRecord",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!wt(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let s=[],a=t.keyType._zod.values;if(a){r.value={};let i=new Set;for(let l of a)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){i.add(typeof l==="number"?l.toString():l);let m=t.keyType._zod.run({value:l,issues:[]},o);if(m instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(m.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map((w)=>rt(w,o,Ge())),input:l,path:[l],inst:e});continue}let g=m.value,z=t.valueType._zod.run({value:n[l],issues:[]},o);if(z instanceof Promise)s.push(z.then((w)=>{if(w.issues.length)r.issues.push(...ht(l,w.issues));r.value[g]=w.value}));else{if(z.issues.length)r.issues.push(...ht(l,z.issues));r.value[g]=z.value}}let c;for(let l in n)if(!i.has(l))c=c??[],c.push(l);if(c&&c.length>0)r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(let i of Reflect.ownKeys(n)){if(i==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(n,i))continue;let c=t.keyType._zod.run({value:i,issues:[]},o);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof i==="string"&&Zn.test(i)&&c.issues.length){let g=t.keyType._zod.run({value:Number(i),issues:[]},o);if(g instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(g.issues.length===0)c=g}if(c.issues.length){if(t.mode==="loose")r.value[i]=n[i];else r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map((g)=>rt(g,o,Ge())),input:i,path:[i],inst:e});continue}let m=t.valueType._zod.run({value:n[i],issues:[]},o);if(m instanceof Promise)s.push(m.then((g)=>{if(g.issues.length)r.issues.push(...ht(i,g.issues));r.value[c.value]=g.value}));else{if(m.issues.length)r.issues.push(...ht(i,m.issues));r.value[c.value]=m.value}}}if(s.length)return Promise.all(s).then(()=>r);return r}});var Ad=M("$ZodEnum",(e,t)=>{ye.init(e,t);let r=So(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter((n)=>ai.has(typeof n)).map((n)=>typeof n==="string"?pt(n):n.toString()).join("|")})$`),e._zod.parse=(n,s)=>{let a=n.value;if(o.has(a))return n;return n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),Md=M("$ZodLiteral",(e,t)=>{if(ye.init(e,t),t.values.length===0)throw 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"?pt(o):o?pt(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let s=o.value;if(r.has(s))return o;return o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var Ld=M("$ZodTransform",(e,t)=>{ye.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new go(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((a)=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new dt;return r.value=n,r.fallback=!0,r}});function Bl(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var zi=M("$ZodOptional",(e,t)=>{ye.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(`^(${vo(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);if(s instanceof Promise)return s.then((a)=>Bl(a,n));return Bl(s,n)}if(r.value===void 0)return r;return t.innerType._zod.run(r,o)}}),Zd=M("$ZodExactOptional",(e,t)=>{zi.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)}),Dd=M("$ZodNullable",(e,t)=>{ye.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(`^(${vo(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)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),Ud=M("$ZodDefault",(e,t)=>{ye.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);if(n instanceof Promise)return n.then((s)=>Kl(s,t));return Kl(n,t)}});function Kl(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Vd=M("$ZodPrefault",(e,t)=>{ye.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)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),Fd=M("$ZodNonOptional",(e,t)=>{ye.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);if(n instanceof Promise)return n.then((s)=>Gl(s,e));return Gl(n,e)}});function Gl(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var Hd=M("$ZodCatch",(e,t)=>{ye.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);if(n instanceof Promise)return n.then((s)=>{if(r.value=s.value,s.issues.length)r.value=t.catchValue({...r,error:{issues:s.issues.map((a)=>rt(a,o,Ge()))},input:r.value}),r.issues=[],r.fallback=!0;return r});if(r.value=n.value,n.issues.length)r.value=t.catchValue({...r,error:{issues:n.issues.map((s)=>rt(s,o,Ge()))},input:r.value}),r.issues=[],r.fallback=!0;return r}});var $i=M("$ZodPipe",(e,t)=>{ye.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);if(s instanceof Promise)return s.then((a)=>Dn(a,t.in,o));return Dn(s,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Dn(s,t.out,o));return Dn(n,t.out,o)}});function Dn(e,t,r){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var Jd=M("$ZodPreprocess",(e,t)=>{$i.init(e,t)}),Bd=M("$ZodReadonly",(e,t)=>{ye.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);if(n instanceof Promise)return n.then(Wl);return Wl(n)}});function Wl(e){return e.value=Object.freeze(e.value),e}var Kd=M("$ZodLazy",(e,t)=>{ye.init(e,t),_e(e._zod,"innerType",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return 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)}),Gd=M("$ZodCustom",(e,t)=>{Le.init(e,t),ye.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)=>Yl(s,r,o,e));Yl(n,r,o,e);return}});function Yl(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(gr(n))}}var Df=()=>{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,a=li(n.input),i=o[a]??a;return`Invalid input: expected ${s}, received ${i}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${xn(n.values[0])}`;return`Invalid option: expected one of ${Nn(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",a=t(n.origin);if(a)return`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",a=t(n.origin);if(a)return`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${a.unit}`;return`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`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":""}: ${Nn(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0)return`Invalid discriminator value. Expected ${n.options.map((a)=>`'${a}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Ri(){return{localeError:Df()}}var Wd,Uf=Symbol("ZodOutput"),Vf=Symbol("ZodInput");class Yd{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Xd(){return new Yd}(Wd=globalThis).__zod_globalRegistry??(Wd.__zod_globalRegistry=Xd());var Et=globalThis.__zod_globalRegistry;function Qd(e,t){return new e({type:"string",...re(t)})}function em(e,t){return new e({type:"string",coerce:!0,...re(t)})}function wi(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...re(t)})}function Pi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...re(t)})}function tm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...re(t)})}function rm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...re(t)})}function om(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...re(t)})}function nm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...re(t)})}function Ei(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...re(t)})}function sm(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...re(t)})}function am(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...re(t)})}function im(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...re(t)})}function cm(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...re(t)})}function um(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...re(t)})}function lm(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...re(t)})}function dm(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...re(t)})}function mm(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...re(t)})}function pm(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...re(t)})}function hm(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...re(t)})}function fm(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...re(t)})}function gm(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...re(t)})}function _m(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...re(t)})}function Sm(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...re(t)})}function ym(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...re(t)})}function vm(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...re(t)})}function bm(e,t){return new e({type:"string",format:"date",check:"string_format",...re(t)})}function zm(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...re(t)})}function $m(e,t){return new e({type:"string",format:"duration",check:"string_format",...re(t)})}function Rm(e,t){return new e({type:"number",checks:[],...re(t)})}function wm(e,t){return new e({type:"number",coerce:!0,checks:[],...re(t)})}function Pm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...re(t)})}function Em(e,t){return new e({type:"boolean",...re(t)})}function Tm(e,t){return new e({type:"boolean",coerce:!0,...re(t)})}function km(e,t){return new e({type:"bigint",coerce:!0,...re(t)})}function Cm(e,t){return new e({type:"null",...re(t)})}function Im(e){return new e({type:"any"})}function Om(e){return new e({type:"unknown"})}function Nm(e,t){return new e({type:"never",...re(t)})}function jm(e,t){return new e({type:"date",coerce:!0,...re(t)})}function _r(e,t){return new gi({check:"less_than",...re(t),value:e,inclusive:!1})}function ft(e,t){return new gi({check:"less_than",...re(t),value:e,inclusive:!0})}function Sr(e,t){return new _i({check:"greater_than",...re(t),value:e,inclusive:!1})}function st(e,t){return new _i({check:"greater_than",...re(t),value:e,inclusive:!0})}function Po(e,t){return new Cl({check:"multiple_of",...re(t),value:e})}function Fn(e,t){return new Ol({check:"max_length",...re(t),maximum:e})}function yr(e,t){return new Nl({check:"min_length",...re(t),minimum:e})}function Hn(e,t){return new jl({check:"length_equals",...re(t),length:e})}function Ti(e,t){return new ql({check:"string_format",format:"regex",...re(t),pattern:e})}function ki(e){return new xl({check:"string_format",format:"lowercase",...re(e)})}function Ci(e){return new Al({check:"string_format",format:"uppercase",...re(e)})}function Ii(e,t){return new Ml({check:"string_format",format:"includes",...re(t),includes:e})}function Oi(e,t){return new Ll({check:"string_format",format:"starts_with",...re(t),prefix:e})}function Ni(e,t){return new Zl({check:"string_format",format:"ends_with",...re(t),suffix:e})}function Tt(e){return new Dl({check:"overwrite",tx:e})}function ji(e){return Tt((t)=>t.normalize(e))}function qi(){return Tt((e)=>e.trim())}function xi(){return Tt((e)=>e.toLowerCase())}function Ai(){return Tt((e)=>e.toUpperCase())}function Mi(){return Tt((e)=>ni(e))}function qm(e,t,r){return new e({type:"array",element:t,...re(r)})}function xm(e,t,r){return new e({type:"custom",check:"custom",fn:t,...re(r)})}function Am(e,t){let r=Ff((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(gr(n,o.value,r._zod.def));else{let s=n;if(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(gr(s))}},e(o.value,o)),t);return r}function Ff(e,t){let r=new Le({check:"custom",...re(t)});return r._zod.check=e,r}function To(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??Et,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 be(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,r.schemaPath.includes(e))s.cycle=r.path;return s.schema}let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let i=e._zod.toJSONSchema?.();if(i)a.schema=i;else{let m={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,m);else{let z=a.schema,w=t.processors[n.type];if(!w)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);w(e,t,z,m)}let g=e._zod.parent;if(g){if(!a.ref)a.ref=g;be(g,t,m),t.seen.get(g).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Object.assign(a.schema,c);if(t.io==="input"&&Je(e))delete a.schema.examples,delete a.schema.default;if(t.io==="input"&&"_prefault"in a.schema)(o=a.schema).default??(o.default=a.schema._prefault);return delete a.schema._prefault,t.seen.get(e).schema}function ko(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let i=e.metadataRegistry.get(a[0])?.id;if(i){let c=o.get(i);if(c&&c!==a[0])throw Error(`Duplicate schema id "${i}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(i,a[0])}}let n=(a)=>{let i=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let g=e.external.registry.get(a[0])?.id,z=e.external.uri??((_)=>_);if(g)return{ref:z(g)};let w=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=w,{defId:w,ref:`${z("__shared")}#/${i}/${w}`}}if(a[1]===r)return{ref:"#"};let l=`${"#"}/${i}/`,m=a[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:l+m}},s=(a)=>{if(a[1].schema.$ref)return;let i=a[1],{ref:c,defId:l}=n(a);if(i.def={...i.schema},l)i.defId=l;let m=i.schema;for(let g in m)delete m[g];m.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let i=a[1];if(i.cycle)throw Error(`Cycle detected: #/${i.cycle?.join("/")}/<root>
|
|
63
|
+
`)}w.write("payload.value = newResult;"),w.write("return payload;");let v=w.compile();return(p,S)=>v(z,p,S)},s,a=dr,i=!lr.jitless,l=i&&$u.value,m=t.catchall,g;e._zod.parse=(z,w)=>{g??(g=o.value);let _=z.value;if(!a(_))return z.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),z;if(i&&l&&w?.async===!1&&w.jitless!==!0){if(!s)s=n(t.shape);if(z=s(z,w),!m)return z;return fd([],_,z,w,g,e)}return r(z,w)}});function Cl(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)=>!Ht(s));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((s)=>s.issues.map((a)=>ot(a,o,Ke())))}),t}var pi=M("$ZodUnion",(e,t)=>{Se.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)));return}),_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)=>Tn(n.source)).join("|")})$`)}return});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,a=[];for(let i of t.options){let c=i._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}if(!s)return Cl(a,o,e,n);return Promise.all(a).then((i)=>Cl(i,o,e,n))}});var _d=M("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,pi.init(e,t);let r=e._zod.parse;_e(e._zod,"propValues",()=>{let n={};for(let s of t.options){let a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[i,c]of Object.entries(a)){if(!n[i])n[i]=new Set;for(let l of c)n[i].add(l)}}return n});let o=mo(()=>{let n=t.options,s=new Map;for(let a of n){let i=a._zod.propValues?.[t.discriminator];if(!i||i.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of i){if(s.has(c))throw Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,a)}}return s});e._zod.parse=(n,s)=>{let a=n.value;if(!dr(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let i=o.value.get(a?.[t.discriminator]);if(i)return i._zod.run(n,s);if(t.unionFallback||s.direction==="backward")return r(n,s);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n}}),Sd=M("$ZodIntersection",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,s=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);if(s instanceof Promise||a instanceof Promise)return Promise.all([s,a]).then(([c,l])=>Il(r,c,l));return Il(r,s,a)}});function di(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(Ft(e)&&Ft(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 a=di(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};n[s]=a.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],a=di(n,s);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Il(e,t,r){let o=new Map,n;for(let i of t.issues)if(i.code==="unrecognized_keys"){n??(n=i);for(let c of i.keys){if(!o.has(c))o.set(c,{});o.get(c).l=!0}}else e.issues.push(i);for(let i of r.issues)if(i.code==="unrecognized_keys")for(let c of i.keys){if(!o.has(c))o.set(c,{});o.get(c).r=!0}else e.issues.push(i);let s=[...o].filter(([,i])=>i.l&&i.r).map(([i])=>i);if(s.length&&n)e.issues.push({...n,keys:s});if(Ht(e))return e;let a=di(t.value,r.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var yd=M("$ZodRecord",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Ft(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let s=[],a=t.keyType._zod.values;if(a){r.value={};let i=new Set;for(let l of a)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){i.add(typeof l==="number"?l.toString():l);let m=t.keyType._zod.run({value:l,issues:[]},o);if(m instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(m.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map((w)=>ot(w,o,Ke())),input:l,path:[l],inst:e});continue}let g=m.value,z=t.valueType._zod.run({value:n[l],issues:[]},o);if(z instanceof Promise)s.push(z.then((w)=>{if(w.issues.length)r.issues.push(...vt(l,w.issues));r.value[g]=w.value}));else{if(z.issues.length)r.issues.push(...vt(l,z.issues));r.value[g]=z.value}}let c;for(let l in n)if(!i.has(l))c=c??[],c.push(l);if(c&&c.length>0)r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(let i of Reflect.ownKeys(n)){if(i==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(n,i))continue;let c=t.keyType._zod.run({value:i,issues:[]},o);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof i==="string"&&ii.test(i)&&c.issues.length){let g=t.keyType._zod.run({value:Number(i),issues:[]},o);if(g instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(g.issues.length===0)c=g}if(c.issues.length){if(t.mode==="loose")r.value[i]=n[i];else r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map((g)=>ot(g,o,Ke())),input:i,path:[i],inst:e});continue}let m=t.valueType._zod.run({value:n[i],issues:[]},o);if(m instanceof Promise)s.push(m.then((g)=>{if(g.issues.length)r.issues.push(...vt(i,g.issues));r.value[c.value]=g.value}));else{if(m.issues.length)r.issues.push(...vt(i,m.issues));r.value[c.value]=m.value}}}if(s.length)return Promise.all(s).then(()=>r);return r}});var vd=M("$ZodEnum",(e,t)=>{Se.init(e,t);let r=Pn(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter((n)=>Ru.has(typeof n)).map((n)=>typeof n==="string"?yt(n):n.toString()).join("|")})$`),e._zod.parse=(n,s)=>{let a=n.value;if(o.has(a))return n;return n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),bd=M("$ZodLiteral",(e,t)=>{if(Se.init(e,t),t.values.length===0)throw 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"?yt(o):o?yt(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let s=o.value;if(r.has(s))return o;return o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var zd=M("$ZodTransform",(e,t)=>{Se.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new uo(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((a)=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new ut;return r.value=n,r.fallback=!0,r}});function Ol(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var hi=M("$ZodOptional",(e,t)=>{Se.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(`^(${Tn(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);if(s instanceof Promise)return s.then((a)=>Ol(a,n));return Ol(s,n)}if(r.value===void 0)return r;return t.innerType._zod.run(r,o)}}),$d=M("$ZodExactOptional",(e,t)=>{hi.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)}),Rd=M("$ZodNullable",(e,t)=>{Se.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(`^(${Tn(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)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),wd=M("$ZodDefault",(e,t)=>{Se.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);if(n instanceof Promise)return n.then((s)=>Nl(s,t));return Nl(n,t)}});function Nl(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Pd=M("$ZodPrefault",(e,t)=>{Se.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)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),Ed=M("$ZodNonOptional",(e,t)=>{Se.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);if(n instanceof Promise)return n.then((s)=>jl(s,e));return jl(n,e)}});function jl(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var Td=M("$ZodCatch",(e,t)=>{Se.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);if(n instanceof Promise)return n.then((s)=>{if(r.value=s.value,s.issues.length)r.value=t.catchValue({...r,error:{issues:s.issues.map((a)=>ot(a,o,Ke()))},input:r.value}),r.issues=[],r.fallback=!0;return r});if(r.value=n.value,n.issues.length)r.value=t.catchValue({...r,error:{issues:n.issues.map((s)=>ot(s,o,Ke()))},input:r.value}),r.issues=[],r.fallback=!0;return r}});var fi=M("$ZodPipe",(e,t)=>{Se.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);if(s instanceof Promise)return s.then((a)=>Nn(a,t.in,o));return Nn(s,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Nn(s,t.out,o));return Nn(n,t.out,o)}});function Nn(e,t,r){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var kd=M("$ZodPreprocess",(e,t)=>{fi.init(e,t)}),Cd=M("$ZodReadonly",(e,t)=>{Se.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);if(n instanceof Promise)return n.then(ql);return ql(n)}});function ql(e){return e.value=Object.freeze(e.value),e}var Id=M("$ZodLazy",(e,t)=>{Se.init(e,t),_e(e._zod,"innerType",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return 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)}),Od=M("$ZodCustom",(e,t)=>{Me.init(e,t),Se.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)=>xl(s,r,o,e));xl(n,r,o,e);return}});function xl(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(Jt(n))}}var Qh=()=>{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,a=Tu(n.input),i=o[a]??a;return`Invalid input: expected ${s}, received ${i}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${ti(n.values[0])}`;return`Invalid option: expected one of ${Ya(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",a=t(n.origin);if(a)return`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",a=t(n.origin);if(a)return`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${a.unit}`;return`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`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":""}: ${Ya(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0)return`Invalid discriminator value. Expected ${n.options.map((a)=>`'${a}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function gi(){return{localeError:Qh()}}var Nd,ef=Symbol("ZodOutput"),tf=Symbol("ZodInput");class jd{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function qd(){return new jd}(Nd=globalThis).__zod_globalRegistry??(Nd.__zod_globalRegistry=qd());var bt=globalThis.__zod_globalRegistry;function xd(e,t){return new e({type:"string",...X(t)})}function _i(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...X(t)})}function Si(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...X(t)})}function Ad(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...X(t)})}function Md(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...X(t)})}function Ld(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...X(t)})}function Zd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...X(t)})}function yi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...X(t)})}function Dd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...X(t)})}function Ud(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...X(t)})}function Vd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...X(t)})}function Fd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...X(t)})}function Hd(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...X(t)})}function Jd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...X(t)})}function Bd(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...X(t)})}function Kd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...X(t)})}function Gd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...X(t)})}function Wd(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...X(t)})}function Yd(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...X(t)})}function Xd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...X(t)})}function Qd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...X(t)})}function em(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...X(t)})}function tm(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...X(t)})}function rm(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...X(t)})}function om(e,t){return new e({type:"string",format:"date",check:"string_format",...X(t)})}function nm(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...X(t)})}function sm(e,t){return new e({type:"string",format:"duration",check:"string_format",...X(t)})}function am(e,t){return new e({type:"number",checks:[],...X(t)})}function im(e,t){return new e({type:"number",coerce:!0,checks:[],...X(t)})}function cm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...X(t)})}function um(e,t){return new e({type:"boolean",...X(t)})}function lm(e,t){return new e({type:"null",...X(t)})}function dm(e){return new e({type:"any"})}function mm(e){return new e({type:"unknown"})}function pm(e,t){return new e({type:"never",...X(t)})}function xn(e,t){return new ci({check:"less_than",...X(t),value:e,inclusive:!1})}function _o(e,t){return new ci({check:"less_than",...X(t),value:e,inclusive:!0})}function An(e,t){return new ui({check:"greater_than",...X(t),value:e,inclusive:!1})}function So(e,t){return new ui({check:"greater_than",...X(t),value:e,inclusive:!0})}function Mn(e,t){return new fl({check:"multiple_of",...X(t),value:e})}function Ln(e,t){return new _l({check:"max_length",...X(t),maximum:e})}function mr(e,t){return new Sl({check:"min_length",...X(t),minimum:e})}function Zn(e,t){return new yl({check:"length_equals",...X(t),length:e})}function vi(e,t){return new vl({check:"string_format",format:"regex",...X(t),pattern:e})}function bi(e){return new bl({check:"string_format",format:"lowercase",...X(e)})}function zi(e){return new zl({check:"string_format",format:"uppercase",...X(e)})}function $i(e,t){return new $l({check:"string_format",format:"includes",...X(t),includes:e})}function Ri(e,t){return new Rl({check:"string_format",format:"starts_with",...X(t),prefix:e})}function wi(e,t){return new wl({check:"string_format",format:"ends_with",...X(t),suffix:e})}function zt(e){return new Pl({check:"overwrite",tx:e})}function Pi(e){return zt((t)=>t.normalize(e))}function Ei(){return zt((e)=>e.trim())}function Ti(){return zt((e)=>e.toLowerCase())}function ki(){return zt((e)=>e.toUpperCase())}function Ci(){return zt((e)=>zu(e))}function hm(e,t,r){return new e({type:"array",element:t,...X(r)})}function fm(e,t,r){return new e({type:"custom",check:"custom",fn:t,...X(r)})}function gm(e,t){let r=rf((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(Jt(n,o.value,r._zod.def));else{let s=n;if(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(Jt(s))}},e(o.value,o)),t);return r}function rf(e,t){let r=new Me({check:"custom",...X(t)});return r._zod.check=e,r}function vo(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??bt,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 ye(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,r.schemaPath.includes(e))s.cycle=r.path;return s.schema}let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let i=e._zod.toJSONSchema?.();if(i)a.schema=i;else{let m={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,m);else{let z=a.schema,w=t.processors[n.type];if(!w)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);w(e,t,z,m)}let g=e._zod.parent;if(g){if(!a.ref)a.ref=g;ye(g,t,m),t.seen.get(g).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Object.assign(a.schema,c);if(t.io==="input"&&He(e))delete a.schema.examples,delete a.schema.default;if(t.io==="input"&&"_prefault"in a.schema)(o=a.schema).default??(o.default=a.schema._prefault);return delete a.schema._prefault,t.seen.get(e).schema}function bo(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let i=e.metadataRegistry.get(a[0])?.id;if(i){let c=o.get(i);if(c&&c!==a[0])throw Error(`Duplicate schema id "${i}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(i,a[0])}}let n=(a)=>{let i=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let g=e.external.registry.get(a[0])?.id,z=e.external.uri??((_)=>_);if(g)return{ref:z(g)};let w=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=w,{defId:w,ref:`${z("__shared")}#/${i}/${w}`}}if(a[1]===r)return{ref:"#"};let l=`${"#"}/${i}/`,m=a[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:l+m}},s=(a)=>{if(a[1].schema.$ref)return;let i=a[1],{ref:c,defId:l}=n(a);if(i.def={...i.schema},l)i.defId=l;let m=i.schema;for(let g in m)delete m[g];m.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let i=a[1];if(i.cycle)throw Error(`Cycle detected: #/${i.cycle?.join("/")}/<root>
|
|
64
64
|
|
|
65
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let i=a[1];if(t===a[0]){s(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(i.cycle){s(a);continue}if(i.count>1){if(e.reused==="ref"){s(a);continue}}}}function Co(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(i)=>{let c=e.seen.get(i);if(c.ref===null)return;let l=c.def??c.schema,m={...l},g=c.ref;if(c.ref=null,g){o(g);let w=e.seen.get(g),_=w.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))l.allOf=l.allOf??[],l.allOf.push(_);else Object.assign(l,_);if(Object.assign(l,m),i._zod.parent===g)for(let f in l){if(f==="$ref"||f==="allOf")continue;if(!(f in m))delete l[f]}if(_.$ref&&w.def)for(let f in l){if(f==="$ref"||f==="allOf")continue;if(f in w.def&&JSON.stringify(l[f])===JSON.stringify(w.def[f]))delete l[f]}}let z=i._zod.parent;if(z&&z!==g){o(z);let w=e.seen.get(z);if(w?.schema.$ref){if(l.$ref=w.schema.$ref,w.def)for(let _ in l){if(_==="$ref"||_==="allOf")continue;if(_ in w.def&&JSON.stringify(l[_])===JSON.stringify(w.def[_]))delete l[_]}}}e.override({zodSchema:i,jsonSchema:l,path:c.path??[]})};for(let i of[...e.seen.entries()].reverse())o(i[0]);let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let i=e.external.registry.get(t)?.id;if(!i)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(i)}Object.assign(n,r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;if(s!==void 0&&n.id===s)delete n.id;let a=e.external?.defs??{};for(let i of e.seen.entries()){let c=i[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;a[c.defId]=c.def}}if(e.external);else if(Object.keys(a).length>0)if(e.target==="draft-2020-12")n.$defs=a;else n.definitions=a;try{let i=JSON.parse(JSON.stringify(n));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:Eo(t,"input",e.processors),output:Eo(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch(i){throw Error("Error converting schema to JSON.")}}function Je(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 Je(o.element,r);if(o.type==="set")return Je(o.valueType,r);if(o.type==="lazy")return Je(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 Je(o.innerType,r);if(o.type==="intersection")return Je(o.left,r)||Je(o.right,r);if(o.type==="record"||o.type==="map")return Je(o.keyType,r)||Je(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return Je(o.in,r)||Je(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(Je(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Je(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Je(n,r))return!0;if(o.rest&&Je(o.rest,r))return!0;return!1}return!1}var Mm=(e,t={})=>(r)=>{let o=To({...r,processors:t});return be(e,o),ko(o,e),Co(o,e)},Eo=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:s}=o??{},a=To({...n??{},target:s,io:t,processors:r});return be(e,a),ko(a,e),Co(a,e)};var Hf={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Li=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:a,format:i,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof s==="number")n.minLength=s;if(typeof a==="number")n.maxLength=a;if(i){if(n.format=Hf[i]??i,n.format==="")delete n.format;if(i==="time")delete n.format}if(l)n.contentEncoding=l;if(c&&c.size>0){let m=[...c];if(m.length===1)n.pattern=m[0].source;else if(m.length>1)n.allOf=[...m.map((g)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))]}},Zi=(e,t,r,o)=>{let n=r,{minimum:s,maximum:a,format:i,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:m}=e._zod.bag;if(typeof i==="string"&&i.includes("int"))n.type="integer";else n.type="number";let g=typeof m==="number"&&m>=(s??Number.NEGATIVE_INFINITY),z=typeof l==="number"&&l<=(a??Number.POSITIVE_INFINITY),w=t.target==="draft-04"||t.target==="openapi-3.0";if(g)if(w)n.minimum=m,n.exclusiveMinimum=!0;else n.exclusiveMinimum=m;else if(typeof s==="number")n.minimum=s;if(z)if(w)n.maximum=l,n.exclusiveMaximum=!0;else n.exclusiveMaximum=l;else if(typeof a==="number")n.maximum=a;if(typeof c==="number")n.multipleOf=c},Di=(e,t,r,o)=>{r.type="boolean"},Ui=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},Zm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},Vi=(e,t,r,o)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"},Dm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},Um=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Fi=(e,t,r,o)=>{r.not={}},Hi=(e,t,r,o)=>{},Ji=(e,t,r,o)=>{},Bi=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},Ki=(e,t,r,o)=>{let n=e._zod.def,s=So(n.entries);if(s.every((a)=>typeof a==="number"))r.type="number";if(s.every((a)=>typeof a==="string"))r.type="string";r.enum=s},Gi=(e,t,r,o)=>{let n=e._zod.def,s=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else s.push(Number(a));else s.push(a);if(s.length===0);else if(s.length===1){let a=s[0];if(r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[a];else r.const=a}else{if(s.every((a)=>typeof a==="number"))r.type="number";if(s.every((a)=>typeof a==="string"))r.type="string";if(s.every((a)=>typeof a==="boolean"))r.type="boolean";if(s.every((a)=>a===null))r.type="null";r.enum=s}},Vm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},Fm=(e,t,r,o)=>{let n=r,s=e._zod.pattern;if(!s)throw Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},Hm=(e,t,r,o)=>{let n=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:i,mime:c}=e._zod.bag;if(a!==void 0)s.minLength=a;if(i!==void 0)s.maxLength=i;if(c)if(c.length===1)s.contentMediaType=c[0],Object.assign(n,s);else Object.assign(n,s),n.anyOf=c.map((l)=>({contentMediaType:l}));else Object.assign(n,s)},Jm=(e,t,r,o)=>{r.type="boolean"},Wi=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},Bm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},Yi=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},Km=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},Gm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},Xi=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:a,maximum:i}=e._zod.bag;if(typeof a==="number")n.minItems=a;if(typeof i==="number")n.maxItems=i;n.type="array",n.items=be(s.element,t,{...o,path:[...o.path,"items"]})},Qi=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object",n.properties={};let a=s.shape;for(let l in a)n.properties[l]=be(a[l],t,{...o,path:[...o.path,"properties",l]});let i=new Set(Object.keys(a)),c=new Set([...i].filter((l)=>{let m=s.shape[l]._zod;if(t.io==="input")return m.optin===void 0;else return m.optout===void 0}));if(c.size>0)n.required=Array.from(c);if(s.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")n.additionalProperties=!1}else if(s.catchall)n.additionalProperties=be(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},ec=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,a=n.options.map((i,c)=>be(i,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));if(s)r.oneOf=a;else r.anyOf=a},tc=(e,t,r,o)=>{let n=e._zod.def,s=be(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=be(n.right,t,{...o,path:[...o.path,"allOf",1]}),i=(l)=>("allOf"in l)&&Object.keys(l).length===1,c=[...i(s)?s.allOf:[s],...i(a)?a.allOf:[a]];r.allOf=c},Wm=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",i=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((z,w)=>be(z,t,{...o,path:[...o.path,a,w]})),l=s.rest?be(s.rest,t,{...o,path:[...o.path,i,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(n.prefixItems=c,l)n.items=l}else if(t.target==="openapi-3.0"){if(n.items={anyOf:c},l)n.items.anyOf.push(l);if(n.minItems=c.length,!l)n.maxItems=c.length}else if(n.items=c,l)n.additionalItems=l;let{minimum:m,maximum:g}=e._zod.bag;if(typeof m==="number")n.minItems=m;if(typeof g==="number")n.maxItems=g},rc=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let a=s.keyType,c=a._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let m=be(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let g of c)n.patternProperties[g.source]=m}else{if(t.target==="draft-07"||t.target==="draft-2020-12")n.propertyNames=be(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});n.additionalProperties=be(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let l=a._zod.values;if(l){let m=[...l].filter((g)=>typeof g==="string"||typeof g==="number");if(m.length>0)n.required=m}},oc=(e,t,r,o)=>{let n=e._zod.def,s=be(n.innerType,t,o),a=t.seen.get(e);if(t.target==="openapi-3.0")a.ref=n.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},nc=(e,t,r,o)=>{let n=e._zod.def;be(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},sc=(e,t,r,o)=>{let n=e._zod.def;be(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},ac=(e,t,r,o)=>{let n=e._zod.def;be(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io==="input")r._prefault=JSON.parse(JSON.stringify(n.defaultValue))},ic=(e,t,r,o)=>{let n=e._zod.def;be(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},cc=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?s?n.out:n.in:n.out;be(a,t,o);let i=t.seen.get(e);i.ref=a},uc=(e,t,r,o)=>{let n=e._zod.def;be(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},Ym=(e,t,r,o)=>{let n=e._zod.def;be(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Jn=(e,t,r,o)=>{let n=e._zod.def;be(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},lc=(e,t,r,o)=>{let n=e._zod.innerType;be(n,t,o);let s=t.seen.get(e);s.ref=n},Lm={string:Li,number:Zi,boolean:Di,bigint:Ui,symbol:Zm,null:Vi,undefined:Dm,void:Um,never:Fi,any:Hi,unknown:Ji,date:Bi,enum:Ki,literal:Gi,nan:Vm,template_literal:Fm,file:Hm,success:Jm,custom:Wi,function:Bm,transform:Yi,map:Km,set:Gm,array:Xi,object:Qi,union:ec,intersection:tc,tuple:Wm,record:rc,nullable:oc,nonoptional:nc,default:sc,prefault:ac,catch:ic,pipe:cc,readonly:uc,promise:Ym,optional:Jn,lazy:lc};function Bn(e,t){if("_idmap"in e){let o=e,n=To({...t,processors:Lm}),s={};for(let c of o._idmap.entries()){let[l,m]=c;be(m,n)}let a={},i={registry:o,uri:t?.uri,defs:s};n.external=i;for(let c of o._idmap.entries()){let[l,m]=c;ko(n,m),a[l]=Co(n,m)}if(Object.keys(s).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:s}}return{schemas:a}}let r=To({...t,processors:Lm});return be(e,r),ko(r,e),Co(r,e)}var ct={};ei(ct,{ZodISODate:()=>Qm,ZodISODateTime:()=>Xm,ZodISODuration:()=>tp,ZodISOTime:()=>ep,date:()=>mc,datetime:()=>dc,duration:()=>hc,time:()=>pc});var Xm=M("ZodISODateTime",(e,t)=>{ud.init(e,t),Pe.init(e,t)});function dc(e){return vm(Xm,e)}var Qm=M("ZodISODate",(e,t)=>{ld.init(e,t),Pe.init(e,t)});function mc(e){return bm(Qm,e)}var ep=M("ZodISOTime",(e,t)=>{dd.init(e,t),Pe.init(e,t)});function pc(e){return zm(ep,e)}var tp=M("ZodISODuration",(e,t)=>{md.init(e,t),Pe.init(e,t)});function hc(e){return $m(tp,e)}var Qf=(e,t)=>{An.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>pi(e,r)},flatten:{value:(r)=>mi(e,r)},addIssue:{value:(r)=>{e.issues.push(r),e.message=JSON.stringify(e.issues,hr,2)}},addIssues:{value:(r)=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,hr,2)}},isEmpty:{get(){return e.issues.length===0}}})};var Xe=M("ZodError",Qf,{Parent:Error});var op=Mn(Xe),np=Ln(Xe),Kn=zo(Xe),sp=$o(Xe),ap=Ju(Xe),ip=Bu(Xe),cp=Ku(Xe),up=Gu(Xe),lp=Wu(Xe),dp=Yu(Xe),mp=Xu(Xe),pp=Qu(Xe);var hp=new WeakMap;function Io(e,t,r){let o=Object.getPrototypeOf(e),n=hp.get(o);if(!n)n=new Set,hp.set(o,n);if(n.has(t))return;n.add(t);for(let s in r){let a=r[s];Object.defineProperty(o,s,{configurable:!0,enumerable:!1,get(){let i=a.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:i}),i},set(i){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:i})}})}}var ve=M("ZodType",(e,t)=>(ye.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Eo(e,"input"),output:Eo(e,"output")}}),e.toJSONSchema=Mm(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>op(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Kn(e,r,o),e.parseAsync=async(r,o)=>np(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>sp(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>ap(e,r,o),e.decode=(r,o)=>ip(e,r,o),e.encodeAsync=async(r,o)=>cp(e,r,o),e.decodeAsync=async(r,o)=>up(e,r,o),e.safeEncode=(r,o)=>lp(e,r,o),e.safeDecode=(r,o)=>dp(e,r,o),e.safeEncodeAsync=async(r,o)=>mp(e,r,o),e.safeDecodeAsync=async(r,o)=>pp(e,r,o),Io(e,"ZodType",{check(...r){let o=this.def;return this.clone(Se.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 tt(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(Ug(r,o))},superRefine(r,o){return this.check(Vg(r,o))},overwrite(r){return this.check(Tt(r))},optional(){return X(this)},exactOptional(){return Tg(this)},nullable(){return Sp(this)},nullish(){return X(Sp(this))},nonoptional(r){return jg(this,r)},array(){return O(this)},or(r){return W([this,r])},and(r){return gt(this,r)},transform(r){return yp(this,kp(r))},default(r){return Ig(this,r)},prefault(r){return Ng(this,r)},catch(r){return xg(this,r)},pipe(r){return yp(this,r)},readonly(){return Lg(this)},describe(r){let o=this.clone();return Et.add(o,{description:r}),o},meta(...r){if(r.length===0)return Et.get(this);let o=this.clone();return Et.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 Et.get(e)?.description},configurable:!0}),e)),vp=M("_ZodString",(e,t)=>{Vn.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Li(e,o,n,s);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Io(e,"_ZodString",{regex(...o){return this.check(Ti(...o))},includes(...o){return this.check(Ii(...o))},startsWith(...o){return this.check(Oi(...o))},endsWith(...o){return this.check(Ni(...o))},min(...o){return this.check(yr(...o))},max(...o){return this.check(Fn(...o))},length(...o){return this.check(Hn(...o))},nonempty(...o){return this.check(yr(1,...o))},lowercase(o){return this.check(ki(o))},uppercase(o){return this.check(Ci(o))},trim(){return this.check(qi())},normalize(...o){return this.check(ji(...o))},toLowerCase(){return this.check(xi())},toUpperCase(){return this.check(Ai())},slugify(){return this.check(Mi())}})}),gc=M("ZodString",(e,t)=>{Vn.init(e,t),vp.init(e,t),e.email=(r)=>e.check(wi(bp,r)),e.url=(r)=>e.check(Ei($p,r)),e.jwt=(r)=>e.check(ym(fg,r)),e.emoji=(r)=>e.check(sm(tg,r)),e.guid=(r)=>e.check(Pi(fp,r)),e.uuid=(r)=>e.check(tm(Gn,r)),e.uuidv4=(r)=>e.check(rm(Gn,r)),e.uuidv6=(r)=>e.check(om(Gn,r)),e.uuidv7=(r)=>e.check(nm(Gn,r)),e.nanoid=(r)=>e.check(am(rg,r)),e.guid=(r)=>e.check(Pi(fp,r)),e.cuid=(r)=>e.check(im(og,r)),e.cuid2=(r)=>e.check(cm(ng,r)),e.ulid=(r)=>e.check(um(sg,r)),e.base64=(r)=>e.check(gm(mg,r)),e.base64url=(r)=>e.check(_m(pg,r)),e.xid=(r)=>e.check(lm(ag,r)),e.ksuid=(r)=>e.check(dm(ig,r)),e.ipv4=(r)=>e.check(mm(cg,r)),e.ipv6=(r)=>e.check(pm(ug,r)),e.cidrv4=(r)=>e.check(hm(lg,r)),e.cidrv6=(r)=>e.check(fm(dg,r)),e.e164=(r)=>e.check(Sm(hg,r)),e.datetime=(r)=>e.check(dc(r)),e.date=(r)=>e.check(mc(r)),e.time=(r)=>e.check(pc(r)),e.duration=(r)=>e.check(hc(r))});function u(e){return Qd(gc,e)}var Pe=M("ZodStringFormat",(e,t)=>{Re.init(e,t),vp.init(e,t)}),bp=M("ZodEmail",(e,t)=>{ed.init(e,t),Pe.init(e,t)});function zp(e){return wi(bp,e)}var fp=M("ZodGUID",(e,t)=>{Xl.init(e,t),Pe.init(e,t)});var Gn=M("ZodUUID",(e,t)=>{Ql.init(e,t),Pe.init(e,t)});var $p=M("ZodURL",(e,t)=>{td.init(e,t),Pe.init(e,t)});function Wn(e){return Ei($p,e)}var tg=M("ZodEmoji",(e,t)=>{rd.init(e,t),Pe.init(e,t)});var rg=M("ZodNanoID",(e,t)=>{od.init(e,t),Pe.init(e,t)});var og=M("ZodCUID",(e,t)=>{nd.init(e,t),Pe.init(e,t)});var ng=M("ZodCUID2",(e,t)=>{sd.init(e,t),Pe.init(e,t)});var sg=M("ZodULID",(e,t)=>{ad.init(e,t),Pe.init(e,t)});var ag=M("ZodXID",(e,t)=>{id.init(e,t),Pe.init(e,t)});var ig=M("ZodKSUID",(e,t)=>{cd.init(e,t),Pe.init(e,t)});var cg=M("ZodIPv4",(e,t)=>{pd.init(e,t),Pe.init(e,t)});var ug=M("ZodIPv6",(e,t)=>{hd.init(e,t),Pe.init(e,t)});var lg=M("ZodCIDRv4",(e,t)=>{fd.init(e,t),Pe.init(e,t)});var dg=M("ZodCIDRv6",(e,t)=>{gd.init(e,t),Pe.init(e,t)});var mg=M("ZodBase64",(e,t)=>{Sd.init(e,t),Pe.init(e,t)});var pg=M("ZodBase64URL",(e,t)=>{yd.init(e,t),Pe.init(e,t)});var hg=M("ZodE164",(e,t)=>{vd.init(e,t),Pe.init(e,t)});var fg=M("ZodJWT",(e,t)=>{bd.init(e,t),Pe.init(e,t)});var Yn=M("ZodNumber",(e,t)=>{vi.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Zi(e,o,n,s),Io(e,"ZodNumber",{gt(o,n){return this.check(Sr(o,n))},gte(o,n){return this.check(st(o,n))},min(o,n){return this.check(st(o,n))},lt(o,n){return this.check(_r(o,n))},lte(o,n){return this.check(ft(o,n))},max(o,n){return this.check(ft(o,n))},int(o){return this.check(gp(o))},safe(o){return this.check(gp(o))},positive(o){return this.check(Sr(0,o))},nonnegative(o){return this.check(st(0,o))},negative(o){return this.check(_r(0,o))},nonpositive(o){return this.check(ft(0,o))},multipleOf(o,n){return this.check(Po(o,n))},step(o,n){return this.check(Po(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??0.5),e.isFinite=!0,e.format=r.format??null});function F(e){return Rm(Yn,e)}var gg=M("ZodNumberFormat",(e,t)=>{zd.init(e,t),Yn.init(e,t)});function gp(e){return Pm(gg,e)}var _c=M("ZodBoolean",(e,t)=>{$d.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Di(e,r,o,n)});function G(e){return Em(_c,e)}var Rp=M("ZodBigInt",(e,t)=>{Rd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Ui(e,o,n,s),e.gte=(o,n)=>e.check(st(o,n)),e.min=(o,n)=>e.check(st(o,n)),e.gt=(o,n)=>e.check(Sr(o,n)),e.gte=(o,n)=>e.check(st(o,n)),e.min=(o,n)=>e.check(st(o,n)),e.lt=(o,n)=>e.check(_r(o,n)),e.lte=(o,n)=>e.check(ft(o,n)),e.max=(o,n)=>e.check(ft(o,n)),e.positive=(o)=>e.check(Sr(BigInt(0),o)),e.negative=(o)=>e.check(_r(BigInt(0),o)),e.nonpositive=(o)=>e.check(ft(BigInt(0),o)),e.nonnegative=(o)=>e.check(st(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Po(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});var _g=M("ZodNull",(e,t)=>{wd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vi(e,r,o,n)});function Wt(e){return Cm(_g,e)}var Sg=M("ZodAny",(e,t)=>{Pd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hi(e,r,o,n)});function wp(){return Im(Sg)}var yg=M("ZodUnknown",(e,t)=>{Ed.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ji(e,r,o,n)});function ee(){return Om(yg)}var vg=M("ZodNever",(e,t)=>{Td.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fi(e,r,o,n)});function bg(e){return Nm(vg,e)}var Pp=M("ZodDate",(e,t)=>{kd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Bi(e,o,n,s),e.min=(o,n)=>e.check(st(o,n)),e.max=(o,n)=>e.check(ft(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});var zg=M("ZodArray",(e,t)=>{Cd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xi(e,r,o,n),e.element=t.element,Io(e,"ZodArray",{min(r,o){return this.check(yr(r,o))},nonempty(r){return this.check(yr(1,r))},max(r,o){return this.check(Fn(r,o))},length(r,o){return this.check(Hn(r,o))},unwrap(){return this.element}})});function O(e,t){return qm(zg,e,t)}var Ep=M("ZodObject",(e,t)=>{Nd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qi(e,r,o,n),Se.defineLazy(e,"shape",()=>t.shape),Io(e,"ZodObject",{keyof(){return ie(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ee()})},loose(){return this.clone({...this._zod.def,catchall:ee()})},strict(){return this.clone({...this._zod.def,catchall:bg()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return Se.extend(this,r)},safeExtend(r){return Se.safeExtend(this,r)},merge(r){return Se.merge(this,r)},pick(r){return Se.pick(this,r)},omit(r){return Se.omit(this,r)},partial(...r){return Se.partial(Cp,this,r[0])},required(...r){return Se.required(Ip,this,r[0])}})});function T(e,t){let r={type:"object",shape:e??{},...Se.normalizeParams(t)};return new Ep(r)}function oe(e,t){return new Ep({type:"object",shape:e,catchall:ee(),...Se.normalizeParams(t)})}var Tp=M("ZodUnion",(e,t)=>{bi.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ec(e,r,o,n),e.options=t.options});function W(e,t){return new Tp({type:"union",options:e,...Se.normalizeParams(t)})}var $g=M("ZodDiscriminatedUnion",(e,t)=>{Tp.init(e,t),jd.init(e,t)});function br(e,t,r){return new $g({type:"union",options:t,discriminator:e,...Se.normalizeParams(r)})}var Rg=M("ZodIntersection",(e,t)=>{qd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tc(e,r,o,n)});function gt(e,t){return new Rg({type:"intersection",left:e,right:t})}var _p=M("ZodRecord",(e,t)=>{xd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rc(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function B(e,t,r){if(!t||!t._zod)return new _p({type:"record",keyType:u(),valueType:e,...Se.normalizeParams(t)});return new _p({type:"record",keyType:e,valueType:t,...Se.normalizeParams(r)})}var fc=M("ZodEnum",(e,t)=>{Ad.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Ki(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 a of o)if(r.has(a))s[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new fc({...t,checks:[],...Se.normalizeParams(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let a of o)if(r.has(a))delete s[a];else throw Error(`Key ${a} not found in enum`);return new fc({...t,checks:[],...Se.normalizeParams(n),entries:s})}});function ie(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new fc({type:"enum",entries:r,...Se.normalizeParams(t)})}var wg=M("ZodLiteral",(e,t)=>{Md.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gi(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function N(e,t){return new wg({type:"literal",values:Array.isArray(e)?e:[e],...Se.normalizeParams(t)})}var Pg=M("ZodTransform",(e,t)=>{Ld.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yi(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new go(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(Se.issue(s,r.value,t));else{let a=s;if(a.fatal)a.continue=!1;a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(Se.issue(a))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((s)=>(r.value=s,r.fallback=!0,r));return r.value=n,r.fallback=!0,r}});function kp(e){return new Pg({type:"transform",transform:e})}var Cp=M("ZodOptional",(e,t)=>{zi.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jn(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function X(e){return new Cp({type:"optional",innerType:e})}var Eg=M("ZodExactOptional",(e,t)=>{Zd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jn(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Tg(e){return new Eg({type:"optional",innerType:e})}var kg=M("ZodNullable",(e,t)=>{Dd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>oc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Sp(e){return new kg({type:"nullable",innerType:e})}var Cg=M("ZodDefault",(e,t)=>{Ud.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ig(e,t){return new Cg({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Se.shallowClone(t)}})}var Og=M("ZodPrefault",(e,t)=>{Vd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ac(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ng(e,t){return new Og({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Se.shallowClone(t)}})}var Ip=M("ZodNonOptional",(e,t)=>{Fd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function jg(e,t){return new Ip({type:"nonoptional",innerType:e,...Se.normalizeParams(t)})}var qg=M("ZodCatch",(e,t)=>{Hd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ic(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xg(e,t){return new qg({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var Op=M("ZodPipe",(e,t)=>{$i.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cc(e,r,o,n),e.in=t.in,e.out=t.out});function yp(e,t){return new Op({type:"pipe",in:e,out:t})}var Ag=M("ZodPreprocess",(e,t)=>{Op.init(e,t),Jd.init(e,t)}),Mg=M("ZodReadonly",(e,t)=>{Bd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Lg(e){return new Mg({type:"readonly",innerType:e})}var Zg=M("ZodLazy",(e,t)=>{Kd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lc(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Oo(e){return new Zg({type:"lazy",getter:e})}var Dg=M("ZodCustom",(e,t)=>{Gd.init(e,t),ve.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wi(e,r,o,n)});function Ug(e,t={}){return xm(Dg,e,t)}function Vg(e,t){return Am(e,t)}function Yt(e,t){return new Ag({type:"pipe",in:kp(e),out:t})}var jp={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 Np;(function(e){})(Np||(Np={}));var Xn={};ei(Xn,{bigint:()=>Bg,boolean:()=>Jg,date:()=>Kg,number:()=>Hg,string:()=>Fg});function Fg(e){return em(gc,e)}function Hg(e){return wm(Yn,e)}function Jg(e){return Tm(_c,e)}function Bg(e){return km(Rp,e)}function Kg(e){return jm(Pp,e)}Ge(Ri());var zr="2025-11-25";var yc=[zr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],vc="io.modelcontextprotocol/related-task",$r="io.modelcontextprotocol/protocolVersion",No="io.modelcontextprotocol/clientInfo",Ct="io.modelcontextprotocol/serverInfo",It="io.modelcontextprotocol/clientCapabilities",Qn="io.modelcontextprotocol/subscriptionId",Qt="io.modelcontextprotocol/logLevel";var Rr="2.0";var kt=Oo(()=>W([u(),F(),G(),Wt(),B(u(),kt),O(kt)])),Te=B(u(),kt),bc=O(kt),jo=W([u(),F().int()]),qo=u(),es=T({ttl:F().optional()}),ts=T({taskId:u()}),xo=oe({progressToken:jo.optional(),[vc]:ts.optional()}),Me=T({_meta:xo.optional()}),er=Me.extend({task:es.optional()}),ke=T({method:u(),params:Me.loose().optional()}),Ve=T({_meta:xo.optional()}),Fe=T({method:u(),params:Ve.loose().optional()}),Ao=oe({get[Ct](){return Er.optional().catch(void 0)}}),Ce=oe({_meta:Ao.optional()}),Ot=W([u(),F().int()]),Mo=T({jsonrpc:N(Rr),id:Ot,...ke.shape}).strict(),Lo=T({jsonrpc:N(Rr),...Fe.shape}).strict(),wr=T({jsonrpc:N(Rr),id:Ot,result:Ce}).strict(),Pr=T({jsonrpc:N(Rr),id:Ot.optional(),error:T({code:F().int(),message:u(),data:ee().optional()})}).strict(),rs=W([Mo,Lo,wr,Pr]),zc=W([wr,Pr]),Zo=Ce.strict(),os=Ve.extend({requestId:Ot.optional(),reason:u().optional()}),Do=Fe.extend({method:N("notifications/cancelled"),params:os}),ns=T({src:u(),mimeType:u().optional(),sizes:O(u()).optional(),theme:ie(["light","dark"]).optional()}),Nt=T({icons:O(ns).optional()}),_t=T({name:u(),title:u().optional()}),Er=_t.extend({..._t.shape,...Nt.shape,version:u(),websiteUrl:u().optional(),description:u().optional()}),Wg=gt(T({applyDefaults:G().optional()}),Te),Yg=Yt((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)&&Object.keys(e).length===0)return{form:{}};return e},gt(T({form:Wg.optional(),url:Te.optional()}),Te.optional())),ss=oe({list:Te.optional(),cancel:Te.optional(),requests:oe({sampling:oe({createMessage:Te.optional()}).optional(),elicitation:oe({create:Te.optional()}).optional()}).optional()}),as=oe({list:Te.optional(),cancel:Te.optional(),requests:oe({tools:oe({call:Te.optional()}).optional()}).optional()}),is=T({experimental:B(u(),Te).optional(),sampling:T({context:Te.optional(),tools:Te.optional()}).optional(),elicitation:Yg.optional(),roots:T({listChanged:G().optional()}).optional(),tasks:ss.optional(),extensions:B(u(),Te).optional()}),cs=Me.extend({protocolVersion:u(),capabilities:is,clientInfo:Er}),us=ke.extend({method:N("initialize"),params:cs}),Uo=T({experimental:B(u(),Te).optional(),logging:Te.optional(),completions:Te.optional(),prompts:T({listChanged:G().optional()}).optional(),resources:T({subscribe:G().optional(),listChanged:G().optional()}).optional(),tools:T({listChanged:G().optional()}).optional(),tasks:as.optional(),extensions:B(u(),Te).optional()}),ls=Ce.extend({protocolVersion:u(),capabilities:Uo,serverInfo:Er,instructions:u().optional()}),ds=Fe.extend({method:N("notifications/initialized"),params:Ve.optional()}),ms=ke.extend({method:N("server/discover"),params:Me.optional()}),ps=Ce.extend({supportedVersions:O(u()),capabilities:Uo,instructions:u().optional()}),Vo=ke.extend({method:N("ping"),params:Me.optional()}),hs=T({progress:F(),total:X(F()),message:X(u())}),fs=T({...Ve.shape,...hs.shape,progressToken:jo}),Fo=Fe.extend({method:N("notifications/progress"),params:fs}),gs=Me.extend({cursor:qo.optional()}),jt=ke.extend({params:gs.optional()}),qt=Ce.extend({nextCursor:qo.optional()}),Ho=T({uri:u(),mimeType:X(u()),_meta:B(u(),ee()).optional()}),Jo=Ho.extend({text:u()}),$c=u().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Bo=Ho.extend({blob:$c}),xt=ie(["user","assistant"]),St=T({audience:O(xt).optional(),priority:F().min(0).max(1).optional(),lastModified:ct.datetime({offset:!0}).optional()}),Ko=T({..._t.shape,...Nt.shape,uri:u(),description:X(u()),mimeType:X(u()),size:X(F()),annotations:St.optional(),_meta:X(oe({}))}),_s=T({..._t.shape,...Nt.shape,uriTemplate:u(),description:X(u()),mimeType:X(u()),annotations:St.optional(),_meta:X(oe({}))}),Ss=jt.extend({method:N("resources/list")}),ys=qt.extend({resources:O(Ko)}),vs=jt.extend({method:N("resources/templates/list")}),bs=qt.extend({resourceTemplates:O(_s)}),Tr=Me.extend({uri:u()}),zs=Tr,$s=ke.extend({method:N("resources/read"),params:zs}),Rs=Ce.extend({contents:O(W([Jo,Bo]))}),ws=Fe.extend({method:N("notifications/resources/list_changed"),params:Ve.optional()}),Ps=Tr,Es=ke.extend({method:N("resources/subscribe"),params:Ps}),Ts=Tr,ks=ke.extend({method:N("resources/unsubscribe"),params:Ts}),Go=T({toolsListChanged:G().optional(),promptsListChanged:G().optional(),resourcesListChanged:G().optional(),resourceSubscriptions:O(u()).optional()}),Cs=Me.extend({notifications:Go}),Is=ke.extend({method:N("subscriptions/listen"),params:Cs}),Os=Ve.extend({notifications:Go}),Ns=Fe.extend({method:N("notifications/subscriptions/acknowledged"),params:Os}),js=Ao.extend({[Qn]:Ot}),qs=Ce.extend({_meta:js}),xs=Ve.extend({uri:u()}),As=Fe.extend({method:N("notifications/resources/updated"),params:xs}),Ms=T({name:u(),description:X(u()),required:X(G())}),Ls=T({..._t.shape,...Nt.shape,description:X(u()),arguments:X(O(Ms)),_meta:X(oe({}))}),Zs=jt.extend({method:N("prompts/list")}),Ds=qt.extend({prompts:O(Ls)}),Us=Me.extend({name:u(),arguments:B(u(),u()).optional()}),Vs=ke.extend({method:N("prompts/get"),params:Us}),kr=T({type:N("text"),text:u(),annotations:St.optional(),_meta:B(u(),ee()).optional()}),Cr=T({type:N("image"),data:$c,mimeType:u(),annotations:St.optional(),_meta:B(u(),ee()).optional()}),Ir=T({type:N("audio"),data:$c,mimeType:u(),annotations:St.optional(),_meta:B(u(),ee()).optional()}),Fs=T({type:N("tool_use"),name:u(),id:u(),input:B(u(),ee()),_meta:B(u(),ee()).optional()}),Hs=T({type:N("resource"),resource:W([Jo,Bo]),annotations:St.optional(),_meta:B(u(),ee()).optional()}),Js=Ko.extend({type:N("resource_link")}),Or=W([kr,Cr,Ir,Js,Hs]),Bs=T({role:xt,content:Or}),Ks=Ce.extend({description:u().optional(),messages:O(Bs)}),Gs=Fe.extend({method:N("notifications/prompts/list_changed"),params:Ve.optional()}),Ws=T({title:u().optional(),readOnlyHint:G().optional(),destructiveHint:G().optional(),idempotentHint:G().optional(),openWorldHint:G().optional()}),Ys=T({taskSupport:ie(["required","optional","forbidden"]).optional()}),Wo=T({..._t.shape,...Nt.shape,description:u().optional(),inputSchema:T({type:N("object"),properties:B(u(),kt).optional(),required:O(u()).optional()}).catchall(ee()),outputSchema:oe({$schema:u().optional()}).optional(),annotations:Ws.optional(),execution:Ys.optional(),_meta:B(u(),ee()).optional()}),Xs=jt.extend({method:N("tools/list")}),Qs=qt.extend({tools:O(Wo)}),Yo=Ce.extend({content:O(Or).default([]),structuredContent:ee().optional(),isError:G().optional()}),Rc=Yo.or(Ce.extend({toolResult:ee()})),ea=er.extend({name:u(),arguments:B(u(),ee()).optional()}),ta=ke.extend({method:N("tools/call"),params:ea}),ra=Fe.extend({method:N("notifications/tools/list_changed"),params:Ve.optional()}),wc=T({autoRefresh:G().default(!0),debounceMs:F().int().nonnegative().default(300)}),At=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),oa=Me.extend({level:At}),na=ke.extend({method:N("logging/setLevel"),params:oa}),sa=Ve.extend({level:At,logger:u().optional(),data:ee()}),aa=Fe.extend({method:N("notifications/message"),params:sa}),ia=T({name:u().optional()}),ca=T({hints:O(ia).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),ua=T({mode:ie(["auto","required","none"]).optional()}),la=T({type:N("tool_result"),toolUseId:u().describe("The unique identifier for the corresponding tool call."),content:O(Or),structuredContent:ee().optional(),isError:G().optional(),_meta:B(u(),ee()).optional()}),da=br("type",[kr,Cr,Ir]),Xt=br("type",[kr,Cr,Ir,Fs,la]),ma=T({role:xt,content:W([Xt,O(Xt)]),_meta:B(u(),ee()).optional()}),pa=er.extend({messages:O(ma),modelPreferences:ca.optional(),systemPrompt:u().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:O(u()).optional(),metadata:Te.optional(),tools:O(Wo).optional(),toolChoice:ua.optional()}),ha=ke.extend({method:N("sampling/createMessage"),params:pa}),fa=Ce.extend({model:u(),stopReason:X(ie(["endTurn","stopSequence","maxTokens"]).or(u())),role:xt,content:da}),ga=Ce.extend({model:u(),stopReason:X(ie(["endTurn","stopSequence","maxTokens","toolUse"]).or(u())),role:xt,content:W([Xt,O(Xt)])}),Xo=T({type:N("boolean"),title:u().optional(),description:u().optional(),default:G().optional()}),Nr=T({type:N("string"),title:u().optional(),description:u().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:u().optional()}),jr=T({type:ie(["number","integer"]),title:u().optional(),description:u().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),Qo=T({type:N("string"),title:u().optional(),description:u().optional(),enum:O(u()),default:u().optional()}),en=T({type:N("string"),title:u().optional(),description:u().optional(),oneOf:O(T({const:u(),title:u()})),default:u().optional()}),tn=T({type:N("string"),title:u().optional(),description:u().optional(),enum:O(u()),enumNames:O(u()).optional(),default:u().optional()}),_a=W([Qo,en]),rn=T({type:N("array"),title:u().optional(),description:u().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({type:N("string"),enum:O(u())}),default:O(u()).optional()}),on=T({type:N("array"),title:u().optional(),description:u().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({anyOf:O(T({const:u(),title:u()}))}),default:O(u()).optional()}),Sa=W([rn,on]),ya=W([tn,_a,Sa]),nn=W([ya,Xo,Nr,jr]),qr=er.extend({mode:N("form").optional(),message:u(),requestedSchema:T({type:N("object"),properties:B(u(),nn),required:O(u()).optional()}).catchall(ee())}),va=er.extend({mode:N("url"),message:u(),elicitationId:u(),url:u().url()}),ba=W([qr,va]),za=ke.extend({method:N("elicitation/create"),params:ba}),$a=Ve.extend({elicitationId:u()}),Ra=Fe.extend({method:N("notifications/elicitation/complete"),params:$a}),wa=Ce.extend({action:ie(["accept","decline","cancel"]),content:Yt((e)=>e===null?void 0:e,B(u(),W([u(),F(),G(),O(u())])).optional())}),Pa=T({type:N("ref/resource"),uri:u()}),Ea=T({type:N("ref/prompt"),name:u()}),Ta=Me.extend({ref:W([Ea,Pa]),argument:T({name:u(),value:u()}),context:T({arguments:B(u(),u()).optional()}).optional()}),ka=ke.extend({method:N("completion/complete"),params:Ta}),Ca=Ce.extend({completion:oe({values:O(u()).max(100),total:X(F().int()),hasMore:X(G())})}),Ia=T({uri:u().startsWith("file://"),name:u().optional(),_meta:B(u(),ee()).optional()}),Oa=ke.extend({method:N("roots/list"),params:Me.optional()}),Na=Ce.extend({roots:O(Ia)}),ja=Fe.extend({method:N("notifications/roots/list_changed"),params:Ve.optional()}),Pc=oe({ttl:F().optional(),pollInterval:F().optional()}),qa=ie(["working","input_required","completed","failed","cancelled"]),Mt=T({taskId:u(),status:qa,ttl:W([F(),Wt()]),createdAt:u(),lastUpdatedAt:u(),pollInterval:X(F()),statusMessage:X(u())}),Ec=Ce.extend({task:Mt}),xa=Ve.merge(Mt),Tc=Fe.extend({method:N("notifications/tasks/status"),params:xa}),kc=ke.extend({method:N("tasks/get"),params:Me.extend({taskId:u()})}),Cc=Ce.merge(Mt),Ic=ke.extend({method:N("tasks/result"),params:Me.extend({taskId:u()})}),Oc=Ce.loose(),Nc=jt.extend({method:N("tasks/list")}),jc=qt.extend({tasks:O(Mt)}),qc=ke.extend({method:N("tasks/cancel"),params:Me.extend({taskId:u()})}),xc=Ce.merge(Mt),Ac=W([Vo,us,ms,ka,na,Vs,Zs,Ss,vs,$s,Es,ks,Is,ta,Xs]),Mc=W([Do,Fo,ds,ja]),Lc=W([Zo,fa,ga,wa,Na]),Zc=W([Vo,ha,za,Oa]),Dc=W([Do,Fo,aa,As,ws,ra,Gs,Ns,Ra]),Uc=W([Zo,ls,ps,Ca,Ks,Ds,ys,bs,Rs,Yo,Qs,qs]),Ae=Wn().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:jp.custom,message:"URL must be parseable",fatal:!0}),ti}).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"}),Vc=oe({resource:u().url(),authorization_servers:O(Ae).optional(),jwks_uri:u().url().optional(),scopes_supported:O(u()).optional(),bearer_methods_supported:O(u()).optional(),resource_signing_alg_values_supported:O(u()).optional(),resource_name:u().optional(),resource_documentation:u().optional(),resource_policy_uri:u().url().optional(),resource_tos_uri:u().url().optional(),tls_client_certificate_bound_access_tokens:G().optional(),authorization_details_types_supported:O(u()).optional(),dpop_signing_alg_values_supported:O(u()).optional(),dpop_bound_access_tokens_required:G().optional()}),Aa=oe({issuer:u(),authorization_endpoint:Ae,token_endpoint:Ae,registration_endpoint:Ae.optional(),scopes_supported:O(u()).optional(),response_types_supported:O(u()),response_modes_supported:O(u()).optional(),grant_types_supported:O(u()).optional(),token_endpoint_auth_methods_supported:O(u()).optional(),token_endpoint_auth_signing_alg_values_supported:O(u()).optional(),service_documentation:Ae.optional(),revocation_endpoint:Ae.optional(),revocation_endpoint_auth_methods_supported:O(u()).optional(),revocation_endpoint_auth_signing_alg_values_supported:O(u()).optional(),introspection_endpoint:u().optional(),introspection_endpoint_auth_methods_supported:O(u()).optional(),introspection_endpoint_auth_signing_alg_values_supported:O(u()).optional(),code_challenge_methods_supported:O(u()).optional(),client_id_metadata_document_supported:G().optional(),authorization_response_iss_parameter_supported:G().optional().catch(void 0)}),Ma=oe({issuer:u(),authorization_endpoint:Ae,token_endpoint:Ae,userinfo_endpoint:Ae.optional(),jwks_uri:Ae,registration_endpoint:Ae.optional(),scopes_supported:O(u()).optional(),response_types_supported:O(u()),response_modes_supported:O(u()).optional(),grant_types_supported:O(u()).optional(),acr_values_supported:O(u()).optional(),subject_types_supported:O(u()),id_token_signing_alg_values_supported:O(u()),id_token_encryption_alg_values_supported:O(u()).optional(),id_token_encryption_enc_values_supported:O(u()).optional(),userinfo_signing_alg_values_supported:O(u()).optional(),userinfo_encryption_alg_values_supported:O(u()).optional(),userinfo_encryption_enc_values_supported:O(u()).optional(),request_object_signing_alg_values_supported:O(u()).optional(),request_object_encryption_alg_values_supported:O(u()).optional(),request_object_encryption_enc_values_supported:O(u()).optional(),token_endpoint_auth_methods_supported:O(u()).optional(),token_endpoint_auth_signing_alg_values_supported:O(u()).optional(),display_values_supported:O(u()).optional(),claim_types_supported:O(u()).optional(),claims_supported:O(u()).optional(),service_documentation:u().optional(),claims_locales_supported:O(u()).optional(),ui_locales_supported:O(u()).optional(),claims_parameter_supported:G().optional(),request_parameter_supported:G().optional(),request_uri_parameter_supported:G().optional(),require_request_uri_registration:G().optional(),op_policy_uri:Ae.optional(),op_tos_uri:Ae.optional(),client_id_metadata_document_supported:G().optional(),authorization_response_iss_parameter_supported:G().optional().catch(void 0)}),Fc=T({...Ma.shape,...Aa.pick({code_challenge_methods_supported:!0}).shape}),Hc=T({access_token:u(),id_token:u().optional(),token_type:u(),expires_in:Xn.number().optional(),scope:u().optional(),refresh_token:u().optional()}).strip(),Jc=T({issued_token_type:N("urn:ietf:params:oauth:token-type:id-jag"),access_token:u(),token_type:u().optional(),expires_in:F().optional(),scope:u().optional()}).strip(),Bc=T({error:u(),error_description:u().optional(),error_uri:u().optional()}),Sc=Ae.optional().or(N("").transform(()=>{return})),La=T({redirect_uris:O(Ae),token_endpoint_auth_method:u().optional(),grant_types:O(u()).optional(),response_types:O(u()).optional(),application_type:u().optional(),client_name:u().optional(),client_uri:Ae.optional(),logo_uri:Sc,scope:u().optional(),contacts:O(u()).optional(),tos_uri:Sc,policy_uri:u().optional(),jwks_uri:Ae.optional(),jwks:wp().optional(),software_id:u().optional(),software_version:u().optional(),software_statement:u().optional()}).strip(),Za=T({client_id:u(),client_secret:u().optional(),client_id_issued_at:F().optional(),client_secret_expires_at:F().optional()}).strip(),Kc=La.merge(Za),Gc=T({error:u(),error_description:u().optional()}).strip(),Wc=T({token:u(),token_type_hint:u().optional()}).strip();var eu=Symbol.for("mcp.sdk.errorBrands");function au(e,t){let r=new Set,o=t;while(typeof o==="function"){let n=o.mcpBrand;if(Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof n==="string")r.add(n);o=Object.getPrototypeOf(o)}if(r.size===0)return;Object.defineProperty(e,eu,{value:r,enumerable:!1,configurable:!0})}function Ar(e,t){try{if(typeof t==="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(t,eu)){let r=t[eu];if(r&&typeof r.has==="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Bb=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Ar(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Ar(this,t)}constructor(t,r,o){super(r);this.code=t,this.errorUri=o,this.name="OAuthError",au(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};if(this.errorUri)t.error_uri=this.errorUri;return t}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},pe=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 Ar(this,e)}static isInstance(e){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Ar(this,e)}constructor(e,t,r){super(t);this.code=e,this.data=r,this.name="SdkError",au(this,new.target)}},Kb=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 qp(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function i_(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function Jp(e){switch(e.method){case"elicitation/create":if(e.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;if(t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function iu(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(qp(n)&&qp(s)){let a={};for(let[i,c]of Object.entries(n))if(c!==void 0&&s[i]===void 0&&!i_(o,i,s))a[i]=c;if(Object.keys(a).length>0)r[o]=a}}return Object.keys(r).length>0?r:void 0}var c_="2026-07-28";function dn(e){return e>=c_}function Bp(e){return e.filter((t)=>!dn(t))}function cu(e){return e.filter((t)=>dn(t))}function Kp(e){let t=e.structuredContent;if(t===void 0)return e;if(!(typeof t!=="object"||t===null||Array.isArray(t)))return e;if(e.content?.some((r)=>r.type==="text")??!1)return e;return{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var Gp=["task","inputRequests","requestState"];function uu(e){if(e===null||typeof e!=="object"||Array.isArray(e)||e.content!==void 0||Gp.some((t)=>(t in e)))return e;return{...e,content:[]}}function u_(){let e=Oo(()=>W([u(),F(),G(),Wt(),B(u(),e),O(e)])),t=B(u(),e),r=W([u(),F().int()]),o=u(),n=T({ttl:F().optional()}),s=T({taskId:u()}),a=oe({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),i=T({_meta:a.optional()}),c=i.extend({task:n.optional()}),l=T({method:u(),params:i.loose().optional()}),m=T({_meta:a.optional()}),g=T({method:u(),params:m.loose().optional()}),z=oe({_meta:a.optional()}),w=W([u(),F().int()]),_=z.strict(),b=m.extend({requestId:w.optional(),reason:u().optional()}),f=g.extend({method:N("notifications/cancelled"),params:b}),d=T({src:u(),mimeType:u().optional(),sizes:O(u()).optional(),theme:ie(["light","dark"]).optional()}),v=T({icons:O(d).optional()}),p=T({name:u(),title:u().optional()}),S=p.extend({...p.shape,...v.shape,version:u(),websiteUrl:u().optional(),description:u().optional()}),P=gt(T({applyDefaults:G().optional()}),t),y=Yt((Ue)=>{if(Ue&&typeof Ue==="object"&&!Array.isArray(Ue)&&Object.keys(Ue).length===0)return{form:{}};return Ue},gt(T({form:P.optional(),url:t.optional()}),t.optional())),h=oe({list:t.optional(),cancel:t.optional(),requests:oe({sampling:oe({createMessage:t.optional()}).optional(),elicitation:oe({create:t.optional()}).optional()}).optional()}),E=oe({list:t.optional(),cancel:t.optional(),requests:oe({tools:oe({call:t.optional()}).optional()}).optional()}),A=T({experimental:B(u(),t).optional(),sampling:T({context:t.optional(),tools:t.optional()}).optional(),elicitation:y.optional(),roots:T({listChanged:G().optional()}).optional(),tasks:h.optional(),extensions:B(u(),t).optional()}),H=i.extend({protocolVersion:u(),capabilities:A,clientInfo:S}),L=l.extend({method:N("initialize"),params:H}),U=T({experimental:B(u(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:T({listChanged:G().optional()}).optional(),resources:T({subscribe:G().optional(),listChanged:G().optional()}).optional(),tools:T({listChanged:G().optional()}).optional(),tasks:E.optional(),extensions:B(u(),t).optional()}),Y=z.extend({protocolVersion:u(),capabilities:U,serverInfo:S,instructions:u().optional()}),K=g.extend({method:N("notifications/initialized"),params:m.optional()}),me=l.extend({method:N("ping"),params:i.optional()}),we=T({progress:F(),total:X(F()),message:X(u())}),ze=T({...m.shape,...we.shape,progressToken:r}),Ne=g.extend({method:N("notifications/progress"),params:ze}),fe=i.extend({cursor:o.optional()}),I=l.extend({params:fe.optional()}),q=z.extend({nextCursor:o.optional()}),V=T({uri:u(),mimeType:X(u()),_meta:B(u(),ee()).optional()}),R=V.extend({text:u()}),C=u().refine((Ue)=>{try{return atob(Ue),!0}catch{return!1}},{message:"Invalid Base64 string"}),j=V.extend({blob:C}),J=ie(["user","assistant"]),te=T({audience:O(J).optional(),priority:F().min(0).max(1).optional(),lastModified:ct.datetime({offset:!0}).optional()}),de=T({...p.shape,...v.shape,uri:u(),description:X(u()),mimeType:X(u()),size:X(F()),annotations:te.optional(),_meta:X(oe({}))}),ae=T({...p.shape,...v.shape,uriTemplate:u(),description:X(u()),mimeType:X(u()),annotations:te.optional(),_meta:X(oe({}))}),$e=I.extend({method:N("resources/list")}),He=q.extend({resources:O(de)}),k=I.extend({method:N("resources/templates/list")}),x=q.extend({resourceTemplates:O(ae)}),Z=i.extend({uri:u()}),ne=Z,se=l.extend({method:N("resources/read"),params:ne}),ue=z.extend({contents:O(W([R,j]))}),Ie=g.extend({method:N("notifications/resources/list_changed"),params:m.optional()}),qe=Z,Ze=l.extend({method:N("resources/subscribe"),params:qe}),je=Z,Ee=l.extend({method:N("resources/unsubscribe"),params:je}),Qe=m.extend({uri:u()}),xe=g.extend({method:N("notifications/resources/updated"),params:Qe}),ut=T({name:u(),description:X(u()),required:X(G())}),ot=T({...p.shape,...v.shape,description:X(u()),arguments:X(O(ut)),_meta:X(oe({}))}),lt=I.extend({method:N("prompts/list")}),yt=q.extend({prompts:O(ot)}),vt=i.extend({name:u(),arguments:B(u(),u()).optional()}),Lt=l.extend({method:N("prompts/get"),params:vt}),Zt=T({type:N("text"),text:u(),annotations:te.optional(),_meta:B(u(),ee()).optional()}),Dt=T({type:N("image"),data:C,mimeType:u(),annotations:te.optional(),_meta:B(u(),ee()).optional()}),Ut=T({type:N("audio"),data:C,mimeType:u(),annotations:te.optional(),_meta:B(u(),ee()).optional()}),Ur=T({type:N("tool_use"),name:u(),id:u(),input:B(u(),ee()),_meta:B(u(),ee()).optional()}),bt=T({type:N("resource"),resource:W([R,j]),annotations:te.optional(),_meta:B(u(),ee()).optional()}),Vr=de.extend({type:N("resource_link")}),et=W([Zt,Dt,Ut,Vr,bt]),rr=T({role:J,content:et}),or=z.extend({description:u().optional(),messages:O(rr)}),Vt=g.extend({method:N("notifications/prompts/list_changed"),params:m.optional()}),Fr=T({title:u().optional(),readOnlyHint:G().optional(),destructiveHint:G().optional(),idempotentHint:G().optional(),openWorldHint:G().optional()}),nr=T({taskSupport:ie(["required","optional","forbidden"]).optional()}),Ft=T({...p.shape,...v.shape,description:u().optional(),inputSchema:T({type:N("object"),properties:B(u(),e).optional(),required:O(u()).optional()}).catchall(ee()),outputSchema:T({type:N("object"),properties:B(u(),e).optional(),required:O(u()).optional()}).catchall(ee()).optional(),annotations:Fr.optional(),execution:nr.optional(),_meta:B(u(),ee()).optional()}),sr=I.extend({method:N("tools/list")}),ar=q.extend({tools:O(Ft)}),ir=z.extend({content:O(et),structuredContent:B(u(),ee()).optional(),isError:G().optional()}),De=c.extend({name:u(),arguments:B(u(),ee()).optional()}),Hr=l.extend({method:N("tools/call"),params:De}),hn=g.extend({method:N("notifications/tools/list_changed"),params:m.optional()}),cr=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),Jr=i.extend({level:cr}),Br=l.extend({method:N("logging/setLevel"),params:Jr}),Kr=m.extend({level:cr,logger:u().optional(),data:ee()}),Gr=g.extend({method:N("notifications/message"),params:Kr}),Wr=T({name:u().optional()}),Yr=T({hints:O(Wr).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),Xr=T({mode:ie(["auto","required","none"]).optional()}),fn=T({type:N("tool_result"),toolUseId:u().describe("The unique identifier for the corresponding tool call."),content:O(et),structuredContent:T({}).loose().optional(),isError:G().optional(),_meta:B(u(),ee()).optional()}),Qr=br("type",[Zt,Dt,Ut]),zt=br("type",[Zt,Dt,Ut,Ur,fn]),eo=T({role:J,content:W([zt,O(zt)]),_meta:B(u(),ee()).optional()}),to=c.extend({messages:O(eo),modelPreferences:Yr.optional(),systemPrompt:u().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:O(u()).optional(),metadata:t.optional(),tools:O(Ft).optional(),toolChoice:Xr.optional()}),ro=l.extend({method:N("sampling/createMessage"),params:to}),oo=z.extend({model:u(),stopReason:X(ie(["endTurn","stopSequence","maxTokens"]).or(u())),role:J,content:Qr}),no=z.extend({model:u(),stopReason:X(ie(["endTurn","stopSequence","maxTokens","toolUse"]).or(u())),role:J,content:W([zt,O(zt)])}),so=T({type:N("boolean"),title:u().optional(),description:u().optional(),default:G().optional()}),ao=T({type:N("string"),title:u().optional(),description:u().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:u().optional()}),io=T({type:ie(["number","integer"]),title:u().optional(),description:u().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),co=T({type:N("string"),title:u().optional(),description:u().optional(),enum:O(u()),default:u().optional()}),uo=T({type:N("string"),title:u().optional(),description:u().optional(),oneOf:O(T({const:u(),title:u()})),default:u().optional()}),lo=T({type:N("string"),title:u().optional(),description:u().optional(),enum:O(u()),enumNames:O(u()).optional(),default:u().optional()}),mo=W([co,uo]),Ht=T({type:N("array"),title:u().optional(),description:u().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({type:N("string"),enum:O(u())}),default:O(u()).optional()}),Jt=T({type:N("array"),title:u().optional(),description:u().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({anyOf:O(T({const:u(),title:u()}))}),default:O(u()).optional()}),gn=W([Ht,Jt]),_n=W([lo,mo,gn]),We=W([_n,so,ao,io]),Ye=c.extend({mode:N("form").optional(),message:u(),requestedSchema:T({type:N("object"),properties:B(u(),We),required:O(u()).optional()}).catchall(ee())}),po=c.extend({mode:N("url"),message:u(),elicitationId:u(),url:u().url()}),nt=W([Ye,po]),Sn=l.extend({method:N("elicitation/create"),params:nt}),yn=m.extend({elicitationId:u()}),vn=g.extend({method:N("notifications/elicitation/complete"),params:yn}),bn=z.extend({action:ie(["accept","decline","cancel"]),content:Yt((Ue)=>Ue===null?void 0:Ue,B(u(),W([u(),F(),G(),O(u())])).optional())}),zn=T({type:N("ref/resource"),uri:u()}),$n=T({type:N("ref/prompt"),name:u()}),Rn=i.extend({ref:W([$n,zn]),argument:T({name:u(),value:u()}),context:T({arguments:B(u(),u()).optional()}).optional()}),ho=l.extend({method:N("completion/complete"),params:Rn}),wn=z.extend({completion:oe({values:O(u()).max(100),total:X(F().int()),hasMore:X(G())})}),Pn=T({uri:u().startsWith("file://"),name:u().optional(),_meta:B(u(),ee()).optional()}),ur=l.extend({method:N("roots/list"),params:i.optional()}),fo=z.extend({roots:O(Pn)}),En=g.extend({method:N("notifications/roots/list_changed"),params:m.optional()}),Tn=oe({ttl:F().optional(),pollInterval:F().optional()}),kn=ie(["working","input_required","completed","failed","cancelled"]),$t=T({taskId:u(),status:kn,ttl:W([F(),Wt()]),createdAt:u(),lastUpdatedAt:u(),pollInterval:X(F()),statusMessage:X(u())}),Be=z.extend({task:$t}),Cn=m.merge($t),Bt=g.extend({method:N("notifications/tasks/status"),params:Cn}),lr=l.extend({method:N("tasks/get"),params:i.extend({taskId:u()})}),dr=z.merge($t),mr=l.extend({method:N("tasks/result"),params:i.extend({taskId:u()})}),Qa=z.loose(),Ke=I.extend({method:N("tasks/list")}),Oe=q.extend({tasks:O($t)}),Kt=l.extend({method:N("tasks/cancel"),params:i.extend({taskId:u()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:a,BaseRequestParamsSchema:i,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:m,NotificationSchema:g,ResultSchema:z,RequestIdSchema:w,EmptyResultSchema:_,CancelledNotificationParamsSchema:b,CancelledNotificationSchema:f,IconSchema:d,IconsSchema:v,BaseMetadataSchema:p,ImplementationSchema:S,ClientTasksCapabilitySchema:h,ServerTasksCapabilitySchema:E,ClientCapabilitiesSchema:A,InitializeRequestParamsSchema:H,InitializeRequestSchema:L,ServerCapabilitiesSchema:U,InitializeResultSchema:Y,InitializedNotificationSchema:K,PingRequestSchema:me,ProgressSchema:we,ProgressNotificationParamsSchema:ze,ProgressNotificationSchema:Ne,PaginatedRequestParamsSchema:fe,PaginatedRequestSchema:I,PaginatedResultSchema:q,ResourceContentsSchema:V,TextResourceContentsSchema:R,BlobResourceContentsSchema:j,RoleSchema:J,AnnotationsSchema:te,ResourceSchema:de,ResourceTemplateSchema:ae,ListResourcesRequestSchema:$e,ListResourcesResultSchema:He,ListResourceTemplatesRequestSchema:k,ListResourceTemplatesResultSchema:x,ResourceRequestParamsSchema:Z,ReadResourceRequestParamsSchema:ne,ReadResourceRequestSchema:se,ReadResourceResultSchema:ue,ResourceListChangedNotificationSchema:Ie,SubscribeRequestParamsSchema:qe,SubscribeRequestSchema:Ze,UnsubscribeRequestParamsSchema:je,UnsubscribeRequestSchema:Ee,ResourceUpdatedNotificationParamsSchema:Qe,ResourceUpdatedNotificationSchema:xe,PromptArgumentSchema:ut,PromptSchema:ot,ListPromptsRequestSchema:lt,ListPromptsResultSchema:yt,GetPromptRequestParamsSchema:vt,GetPromptRequestSchema:Lt,TextContentSchema:Zt,ImageContentSchema:Dt,AudioContentSchema:Ut,ToolUseContentSchema:Ur,EmbeddedResourceSchema:bt,ResourceLinkSchema:Vr,ContentBlockSchema:et,PromptMessageSchema:rr,GetPromptResultSchema:or,PromptListChangedNotificationSchema:Vt,ToolAnnotationsSchema:Fr,ToolExecutionSchema:nr,ToolSchema:Ft,ListToolsRequestSchema:sr,ListToolsResultSchema:ar,CallToolResultSchema:ir,CallToolRequestParamsSchema:De,CallToolRequestSchema:Hr,ToolListChangedNotificationSchema:hn,LoggingLevelSchema:cr,SetLevelRequestParamsSchema:Jr,SetLevelRequestSchema:Br,LoggingMessageNotificationParamsSchema:Kr,LoggingMessageNotificationSchema:Gr,ModelHintSchema:Wr,ModelPreferencesSchema:Yr,ToolChoiceSchema:Xr,ToolResultContentSchema:fn,SamplingContentSchema:Qr,SamplingMessageContentBlockSchema:zt,SamplingMessageSchema:eo,CreateMessageRequestParamsSchema:to,CreateMessageRequestSchema:ro,CreateMessageResultSchema:oo,CreateMessageResultWithToolsSchema:no,BooleanSchemaSchema:so,StringSchemaSchema:ao,NumberSchemaSchema:io,UntitledSingleSelectEnumSchemaSchema:co,TitledSingleSelectEnumSchemaSchema:uo,LegacyTitledEnumSchemaSchema:lo,SingleSelectEnumSchemaSchema:mo,UntitledMultiSelectEnumSchemaSchema:Ht,TitledMultiSelectEnumSchemaSchema:Jt,MultiSelectEnumSchemaSchema:gn,EnumSchemaSchema:_n,PrimitiveSchemaDefinitionSchema:We,ElicitRequestFormParamsSchema:Ye,ElicitRequestURLParamsSchema:po,ElicitRequestParamsSchema:nt,ElicitRequestSchema:Sn,ElicitationCompleteNotificationParamsSchema:yn,ElicitationCompleteNotificationSchema:vn,ElicitResultSchema:bn,ResourceTemplateReferenceSchema:zn,PromptReferenceSchema:$n,CompleteRequestParamsSchema:Rn,CompleteRequestSchema:ho,CompleteResultSchema:wn,RootSchema:Pn,ListRootsRequestSchema:ur,ListRootsResultSchema:fo,RootsListChangedNotificationSchema:En,TaskCreationParamsSchema:Tn,TaskStatusSchema:kn,TaskSchema:$t,CreateTaskResultSchema:Be,TaskStatusNotificationParamsSchema:Cn,TaskStatusNotificationSchema:Bt,GetTaskRequestSchema:lr,GetTaskResultSchema:dr,GetTaskPayloadRequestSchema:mr,GetTaskPayloadResultSchema:Qa,ListTasksRequestSchema:Ke,ListTasksResultSchema:Oe,CancelTaskRequestSchema:Kt,CancelTaskResultSchema:z.merge($t),ClientRequestSchema:W([me,L,ho,Br,Lt,lt,$e,k,se,Ze,Ee,Hr,sr,lr,mr,Ke,Kt]),ClientNotificationSchema:W([f,Ne,K,En,Bt]),ClientResultSchema:W([_,oo,no,bn,fo,dr,Oe,Be]),ServerRequestSchema:W([me,ro,Sn,ur,lr,mr,Ke,Kt]),ServerNotificationSchema:W([f,Ne,Gr,xe,Ie,hn,Vt,Bt,vn]),ServerResultSchema:W([_,Y,wn,or,yt,He,x,ue,ir,ar,dr,Oe,Be]),CallToolResultWireSchema:ee().superRefine((Ue,Wh)=>{if(typeof Ue!=="object"||Ue===null||Array.isArray(Ue)||Ue.content!==void 0)return;for(let ku of Gp)if(ku in Ue){Wh.addIssue({code:"custom",message:`content is required when the body carries '${ku}' — another result family cannot default into an empty tools/call success`});return}}).transform(uu).pipe(ir)}}var l_;function Wp(){return l_??=u_()}function Yp(e){return e.type!=="object"}var d_=new Set(["const","enum","default","examples"]),m_=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function xp(e){return e!==void 0&&!(typeof e==="string"&&e.startsWith("#"))}function p_(e){let t=typeof e.$schema==="string"?e.$schema:void 0;if(xp(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=Ou(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")return n;if(!s&&xp(n.$id))return n;let a={},i=!1;for(let[c,l]of Object.entries(n))if(s)a[c]=o(l,!1);else if((c==="$ref"||c==="$dynamicRef")&&typeof l==="string")a[c]=l==="#"?"#/properties/result":l.startsWith("#/")?`#/properties/result${l.slice(1)}`:l;else if(c==="$recursiveRef"&&l==="#"&&r)i=!0;else if(d_.has(c))a[c]=l;else if(m_.has(c))a[c]=o(l,!0);else a[c]=o(l,!1);if(i)if("$ref"in a)a.allOf=[...Array.isArray(a.allOf)?a.allOf:[],{$ref:"#/properties/result"}];else a.$ref="#/properties/result";return a};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var Xp={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},Qp={"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},h_={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},Da;function lu(){if(Da)return Da;let e=Wp();return Da={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}},Da}function eh(e){return Object.prototype.hasOwnProperty.call(Xp,e)}function th(e){return Object.prototype.hasOwnProperty.call(Qp,e)}function f_(e){return Object.prototype.hasOwnProperty.call(h_,e)}function g_(e){return f_(e)?lu().resultSchemas[e]:void 0}function __(e){return eh(e)?lu().requestSchemas[e]:void 0}function S_(e){return th(e)?lu().notificationSchemas[e]:void 0}var Gb=Object.keys(Xp),Wb=Object.keys(Qp);function tu(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Ua(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 Ap={ok:!1,reason:"not-in-era"};function Mp(e){return tu(e)&&tu(e.outputSchema)&&Yp(e.outputSchema)}function Lp(e){return e}var du={era:"2025-11-25",hasRequestMethod:eh,hasNotificationMethod:th,validateRequest:(e,t)=>Ua(__(e),t),validateResult:(e,t)=>Ua(g_(e),t),validateNotification:(e,t)=>Ua(S_(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Ap,validateInputResponse:()=>Ap,samplingResultVariant:(e,t)=>{let r=Wp();return Ua(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let r=Kp(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!=="object"||o===null||Array.isArray(o),s=t!==void 0&&Yp(t);if(!n&&!s)return r;return{...r,structuredContent:{result:o}}},decodeResult(e,t){if(tu(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:Lp(r)}}return{kind:"complete",result:Lp(t)}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;if(!Array.isArray(r)||!r.some((o)=>Mp(o)))return t;return{...t,tools:r.map((o)=>Mp(o)?{...o,outputSchema:p_(o.outputSchema)}:o)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function y_(){let e=Oo(()=>W([u(),F(),G(),Wt(),B(u(),e),O(e)])),t=B(u(),e),r=W([u(),F().int()]),o=u(),n=W([u(),F().int()]),s=ie(["user","assistant"]),a=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),i=u().refine((Oe)=>{try{return atob(Oe),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=T({ttl:F().optional()}),l=T({taskId:u()}),m=oe({progressToken:r.optional(),"io.modelcontextprotocol/related-task":l.optional()}),g=T({_meta:m.optional()}),z=g.extend({task:c.optional()}),w=T({_meta:m.optional()}),_=T({method:u(),params:w.loose().optional()}),b=T({src:u(),mimeType:u().optional(),sizes:O(u()).optional(),theme:ie(["light","dark"]).optional()}),f=T({icons:O(b).optional()}),d=T({name:u(),title:u().optional()}),v=d.extend({...d.shape,...f.shape,version:u(),websiteUrl:u().optional(),description:u().optional()}),p=gt(T({applyDefaults:G().optional()}),t),S=Yt((Oe)=>{if(Oe&&typeof Oe==="object"&&!Array.isArray(Oe)&&Object.keys(Oe).length===0)return{form:{}};return Oe},gt(T({form:p.optional(),url:t.optional()}),t.optional())),P=oe({list:t.optional(),cancel:t.optional(),requests:oe({sampling:oe({createMessage:t.optional()}).optional(),elicitation:oe({create:t.optional()}).optional()}).optional()}),y=oe({list:t.optional(),cancel:t.optional(),requests:oe({tools:oe({call:t.optional()}).optional()}).optional()}),h=T({experimental:B(u(),t).optional(),sampling:T({context:t.optional(),tools:t.optional()}).optional(),elicitation:S.optional(),roots:T({listChanged:G().optional()}).optional(),tasks:P.optional(),extensions:B(u(),t).optional()}),E=T({experimental:B(u(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:T({listChanged:G().optional()}).optional(),resources:T({subscribe:G().optional(),listChanged:G().optional()}).optional(),tools:T({listChanged:G().optional()}).optional(),tasks:y.optional(),extensions:B(u(),t).optional()}),A=T({progress:F(),total:X(F()),message:X(u())}),H=T({...w.shape,...A.shape,progressToken:r}),L=_.extend({method:N("notifications/progress"),params:H}),U=w.extend({level:a,logger:u().optional(),data:ee()}),Y=_.extend({method:N("notifications/message"),params:U}),K=T({uri:u(),mimeType:X(u()),_meta:B(u(),ee()).optional()}),me=K.extend({text:u()}),we=K.extend({blob:i}),ze=T({audience:O(s).optional(),priority:F().min(0).max(1).optional(),lastModified:ct.datetime({offset:!0}).optional()}),Ne=T({...d.shape,...f.shape,uri:u(),description:X(u()),mimeType:X(u()),size:X(F()),annotations:ze.optional(),_meta:X(oe({}))}),fe=T({...d.shape,...f.shape,uriTemplate:u(),description:X(u()),mimeType:X(u()),annotations:ze.optional(),_meta:X(oe({}))}),I=_.extend({method:N("notifications/resources/list_changed"),params:w.optional()}),q=w.extend({uri:u()}),V=_.extend({method:N("notifications/resources/updated"),params:q}),R=T({name:u(),description:X(u()),required:X(G())}),C=T({...d.shape,...f.shape,description:X(u()),arguments:X(O(R)),_meta:X(oe({}))}),j=_.extend({method:N("notifications/prompts/list_changed"),params:w.optional()}),J=T({type:N("text"),text:u(),annotations:ze.optional(),_meta:B(u(),ee()).optional()}),te=T({type:N("image"),data:i,mimeType:u(),annotations:ze.optional(),_meta:B(u(),ee()).optional()}),de=T({type:N("audio"),data:i,mimeType:u(),annotations:ze.optional(),_meta:B(u(),ee()).optional()}),ae=T({type:N("tool_use"),name:u(),id:u(),input:B(u(),ee()),_meta:B(u(),ee()).optional()}),$e=T({type:N("resource"),resource:W([me,we]),annotations:ze.optional(),_meta:B(u(),ee()).optional()}),He=Ne.extend({type:N("resource_link")}),k=W([J,te,de,He,$e]),x=T({role:s,content:k}),Z=T({title:u().optional(),readOnlyHint:G().optional(),destructiveHint:G().optional(),idempotentHint:G().optional(),openWorldHint:G().optional()}),ne=_.extend({method:N("notifications/tools/list_changed"),params:w.optional()}),se=T({name:u().optional()}),ue=T({hints:O(se).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),Ie=T({mode:ie(["auto","required","none"]).optional()}),qe=T({type:N("boolean"),title:u().optional(),description:u().optional(),default:G().optional()}),Ze=T({type:N("string"),title:u().optional(),description:u().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:u().optional()}),je=T({type:ie(["number","integer"]),title:u().optional(),description:u().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),Ee=T({type:N("string"),title:u().optional(),description:u().optional(),enum:O(u()),default:u().optional()}),Qe=T({type:N("string"),title:u().optional(),description:u().optional(),oneOf:O(T({const:u(),title:u()})),default:u().optional()}),xe=T({type:N("string"),title:u().optional(),description:u().optional(),enum:O(u()),enumNames:O(u()).optional(),default:u().optional()}),ut=W([Ee,Qe]),ot=T({type:N("array"),title:u().optional(),description:u().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({type:N("string"),enum:O(u())}),default:O(u()).optional()}),lt=T({type:N("array"),title:u().optional(),description:u().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({anyOf:O(T({const:u(),title:u()}))}),default:O(u()).optional()}),yt=W([ot,lt]),vt=W([xe,ut,yt]),Lt=W([vt,qe,Ze,je]),Zt=z.extend({mode:N("form").optional(),message:u(),requestedSchema:T({type:N("object"),properties:B(u(),Lt),required:O(u()).optional()}).catchall(ee())}),Dt=T({type:N("ref/resource"),uri:u()}),Ut=T({type:N("ref/prompt"),name:u()}),Ur=T({uri:u().startsWith("file://"),name:u().optional(),_meta:B(u(),ee()).optional()}),bt=h.shape,Vr=T({experimental:bt.experimental,sampling:bt.sampling,elicitation:bt.elicitation,roots:bt.roots,extensions:bt.extensions}),et=E.shape,rr=T({experimental:et.experimental,logging:et.logging,completions:et.completions,prompts:et.prompts,resources:et.resources,tools:et.tools,extensions:et.extensions}),or=oe({progressToken:r.optional(),[$r]:u(),[No]:v.optional(),[It]:Vr,[Qt]:a.optional()}),Vt=T({...d.shape,...f.shape,description:u().optional(),inputSchema:oe({$schema:u().optional(),type:N("object")}),outputSchema:oe({$schema:u().optional()}).optional(),annotations:Z.optional(),_meta:B(u(),ee()).optional()}),Fr=T({type:N("tool_result"),toolUseId:u(),content:O(k),structuredContent:ee().optional(),isError:G().optional(),_meta:B(u(),ee()).optional()}),nr=W([J,te,de,ae,Fr]),Ft=T({role:s,content:W([nr,O(nr)]),_meta:B(u(),ee()).optional()}),sr=u(),ar=oe({[Ct]:v.optional().catch(void 0)}),ir=ar.optional();function De(Oe){return oe({_meta:ir,resultType:sr.default("complete"),...Oe})}let Hr=De({}),hn=De({nextCursor:o.optional()}),cr=De({content:O(k),structuredContent:ee().optional(),isError:G().optional()}),Jr=De({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),tools:O(Vt),nextCursor:o.optional()}),Br=De({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),prompts:O(C),nextCursor:o.optional()}),Kr=De({description:u().optional(),messages:O(x)}),Gr=De({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resources:O(Ne),nextCursor:o.optional()}),Wr=De({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resourceTemplates:O(fe),nextCursor:o.optional()}),Yr=De({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),contents:O(W([me,we]))}),Xr=De({completion:T({values:O(u()).max(100),total:F().int().optional(),hasMore:G().optional()}).loose()}),fn=De({ttlMs:F().int().min(0),cacheScope:ie(["public","private"])}),Qr=De({ttlMs:F().int().min(0).catch(0),cacheScope:ie(["public","private"]).catch("private"),supportedVersions:O(u()),capabilities:rr,instructions:u().optional()}),zt=T({messages:O(Ft),modelPreferences:ue.optional(),systemPrompt:u().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:O(u()).optional(),metadata:t.optional(),tools:O(Vt).optional(),toolChoice:Ie.optional()}),eo=T({method:N("sampling/createMessage"),params:zt}),to=T({method:N("roots/list"),params:T({_meta:B(u(),ee()).optional()}).optional()}),ro=T({...Ft.shape,model:u(),stopReason:u().optional()}),oo=T({roots:O(Ur)}),no=T({action:ie(["accept","decline","cancel"]),content:B(u(),W([u(),F(),G(),O(u())])).optional()}),so=T({mode:N("url"),message:u(),url:u().url()}),ao=W([Zt,so]),io=T({method:N("elicitation/create"),params:ao}),co=W([eo,to,io]),uo=W([ro,oo,no]),lo=B(u(),co),mo=B(u(),uo),Ht=De({inputRequests:lo.optional(),requestState:u().optional()}),Jt={inputResponses:mo.optional(),requestState:u().optional()},gn=T({_meta:or,...Jt}),_n=oe({progressToken:r.optional()});function We(Oe,Kt){return T({method:N(Oe),params:T({_meta:or,...Kt})})}function Ye(Oe,Kt){return T({method:N(Oe),params:T({_meta:_n.optional(),...Kt}).optional()})}let po={name:u(),arguments:B(u(),ee()).optional(),...Jt},nt={cursor:o.optional()},Sn=We("tools/call",po),yn=We("tools/list",nt),vn=We("prompts/list",nt),bn=We("prompts/get",{name:u(),arguments:B(u(),u()).optional(),...Jt}),zn=We("resources/list",nt),$n=We("resources/templates/list",nt),Rn=We("resources/read",{uri:u(),...Jt}),ho={ref:W([Ut,Dt]),argument:T({name:u(),value:u()}),context:T({arguments:B(u(),u()).optional()}).optional()},wn=We("completion/complete",ho),Pn=We("server/discover",{}),ur=T({toolsListChanged:G().optional(),promptsListChanged:G().optional(),resourcesListChanged:G().optional(),resourceSubscriptions:O(u()).optional()}),fo={notifications:ur},En=We("subscriptions/listen",fo),Tn=ar.extend({"io.modelcontextprotocol/subscriptionId":n}),kn=oe({_meta:Tn,resultType:sr.default("complete")}),$t={"tools/call":Ye("tools/call",po),"tools/list":Ye("tools/list",nt),"prompts/get":Ye("prompts/get",{name:u(),arguments:B(u(),u()).optional()}),"prompts/list":Ye("prompts/list",nt),"resources/list":Ye("resources/list",nt),"resources/templates/list":Ye("resources/templates/list",nt),"resources/read":Ye("resources/read",{uri:u()}),"completion/complete":Ye("completion/complete",ho),"server/discover":Ye("server/discover",{}),"subscriptions/listen":Ye("subscriptions/listen",fo)};function Be(Oe){return oe({_meta:ir,...Oe})}let Cn={"tools/call":Be({content:O(k),structuredContent:ee().optional(),isError:G().optional()}),"tools/list":Be({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),tools:O(Vt),nextCursor:o.optional()}),"prompts/get":Be({description:u().optional(),messages:O(x)}),"prompts/list":Be({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),prompts:O(C),nextCursor:o.optional()}),"resources/list":Be({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resources:O(Ne),nextCursor:o.optional()}),"resources/templates/list":Be({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resourceTemplates:O(fe),nextCursor:o.optional()}),"resources/read":Be({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),contents:O(W([me,we]))}),"completion/complete":Be({completion:T({values:O(u()).max(100),total:F().int().optional(),hasMore:G().optional()}).loose()}),"server/discover":Be({ttlMs:F().int().min(0).catch(0),cacheScope:ie(["public","private"]).catch("private"),supportedVersions:O(u()),capabilities:rr,instructions:u().optional()}),"subscriptions/listen":Be({})},Bt=oe({"io.modelcontextprotocol/subscriptionId":n.optional()}),lr=T({method:N("notifications/subscriptions/acknowledged"),params:T({_meta:Bt.optional(),notifications:ur})}),dr=T({_meta:Bt.optional(),requestId:n,reason:u().optional()}),mr=T({method:N("notifications/cancelled"),params:dr}),Qa={"notifications/cancelled":mr,"notifications/progress":L,"notifications/message":Y,"notifications/resources/updated":V,"notifications/resources/list_changed":I,"notifications/tools/list_changed":ne,"notifications/prompts/list_changed":j,"notifications/subscriptions/acknowledged":lr},Ke=(Oe)=>T({jsonrpc:N("2.0"),id:W([u(),F().int()]),result:Oe}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:a,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:m,BaseRequestParamsSchema:g,TaskAugmentedRequestParamsSchema:z,NotificationsParamsSchema:w,NotificationSchema:_,IconSchema:b,IconsSchema:f,BaseMetadataSchema:d,ImplementationSchema:v,ClientTasksCapabilitySchema:P,ServerTasksCapabilitySchema:y,ClientCapabilitiesSchema:h,ServerCapabilitiesSchema:E,ProgressSchema:A,ProgressNotificationParamsSchema:H,ProgressNotificationSchema:L,LoggingMessageNotificationParamsSchema:U,LoggingMessageNotificationSchema:Y,ResourceContentsSchema:K,TextResourceContentsSchema:me,BlobResourceContentsSchema:we,AnnotationsSchema:ze,ResourceSchema:Ne,ResourceTemplateSchema:fe,ResourceListChangedNotificationSchema:I,ResourceUpdatedNotificationParamsSchema:q,ResourceUpdatedNotificationSchema:V,PromptArgumentSchema:R,PromptSchema:C,PromptListChangedNotificationSchema:j,TextContentSchema:J,ImageContentSchema:te,AudioContentSchema:de,ToolUseContentSchema:ae,EmbeddedResourceSchema:$e,ResourceLinkSchema:He,ContentBlockSchema:k,PromptMessageSchema:x,ToolAnnotationsSchema:Z,ToolListChangedNotificationSchema:ne,ModelHintSchema:se,ModelPreferencesSchema:ue,ToolChoiceSchema:Ie,BooleanSchemaSchema:qe,StringSchemaSchema:Ze,NumberSchemaSchema:je,UntitledSingleSelectEnumSchemaSchema:Ee,TitledSingleSelectEnumSchemaSchema:Qe,LegacyTitledEnumSchemaSchema:xe,SingleSelectEnumSchemaSchema:ut,UntitledMultiSelectEnumSchemaSchema:ot,TitledMultiSelectEnumSchemaSchema:lt,MultiSelectEnumSchemaSchema:yt,EnumSchemaSchema:vt,PrimitiveSchemaDefinitionSchema:Lt,ElicitRequestFormParamsSchema:Zt,ResourceTemplateReferenceSchema:Dt,PromptReferenceSchema:Ut,RootSchema:Ur,ClientCapabilities2026Schema:Vr,ServerCapabilities2026Schema:rr,RequestMetaEnvelopeSchema:or,ToolSchema:Vt,ToolResultContentSchema:Fr,SamplingMessageContentBlockSchema:nr,SamplingMessageSchema:Ft,ResultTypeSchema:sr,ResultMetaSchema:ar,ResultSchema:Hr,PaginatedResultSchema:hn,CallToolResultSchema:cr,ListToolsResultSchema:Jr,ListPromptsResultSchema:Br,GetPromptResultSchema:Kr,ListResourcesResultSchema:Gr,ListResourceTemplatesResultSchema:Wr,ReadResourceResultSchema:Yr,CompleteResultSchema:Xr,CacheableResultSchema:fn,DiscoverResultSchema:Qr,CreateMessageRequestParamsSchema:zt,CreateMessageRequestSchema:eo,ListRootsRequestSchema:to,CreateMessageResultSchema:ro,ListRootsResultSchema:oo,ElicitResultSchema:no,ElicitRequestURLParamsSchema:so,ElicitRequestParamsSchema:ao,ElicitRequestSchema:io,InputRequestSchema:co,InputResponseSchema:uo,InputRequestsSchema:lo,InputResponsesSchema:mo,InputRequiredResultSchema:Ht,InputResponseRequestParamsSchema:gn,CallToolRequestSchema:Sn,ListToolsRequestSchema:yn,ListPromptsRequestSchema:vn,GetPromptRequestSchema:bn,ListResourcesRequestSchema:zn,ListResourceTemplatesRequestSchema:$n,ReadResourceRequestSchema:Rn,CompleteRequestSchema:wn,DiscoverRequestSchema:Pn,SubscriptionFilterSchema:ur,SubscriptionsListenRequestSchema:En,SubscriptionsListenResultMetaSchema:Tn,SubscriptionsListenResultSchema:kn,dispatchRequestSchemas:$t,dispatchResultSchemas:Cn,NotificationMetaSchema:Bt,SubscriptionsAcknowledgedNotificationSchema:lr,CancelledNotificationParamsSchema:dr,CancelledNotificationSchema:mr,notificationSchemas2026:Qa,JSONRPCResultResponseSchema:Ke(Hr),CallToolResultResponseSchema:Ke(W([cr,Ht])),ListToolsResultResponseSchema:Ke(Jr),ListPromptsResultResponseSchema:Ke(Br),GetPromptResultResponseSchema:Ke(W([Kr,Ht])),ListResourcesResultResponseSchema:Ke(Gr),ListResourceTemplatesResultResponseSchema:Ke(Wr),ReadResourceResultResponseSchema:Ke(W([Yr,Ht])),CompleteResultResponseSchema:Ke(Xr),DiscoverResultResponseSchema:Ke(Qr)}}var v_;function tr(){return v_??=y_()}var b_=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function z_(e){return b_.includes(e)}var xr=Symbol("modelcontextprotocol.resultCacheHintFallback");function rh(e,t){if(t===void 0)return e;let r=e[xr];if(r===void 0)return{...e,[xr]:t};let o={},n=r.ttlMs??t.ttlMs;if(n!==void 0)o.ttlMs=n;let s=r.cacheScope??t.cacheScope;if(s!==void 0)o.cacheScope=s;return{...e,[xr]:o}}function $_(e){return e[xr]}function mu(e){return typeof e==="number"&&Number.isSafeInteger(e)&&e>=0}function pu(e){return e==="public"||e==="private"}function oh(e,t){if(e.ttlMs!==void 0&&!mu(e.ttlMs))throw RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!pu(e.cacheScope))throw RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var Q=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}({}),he=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Ar(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Ar(this,t)}constructor(t,r,o){super(r);this.code=t,this.data=o,this.name="ProtocolError",au(this,new.target)}static fromError(t,r,o){if(t===Q.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new R_(n.elicitations,r)}if(t===Q.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested==="string")return new sh({supported:n.supported,requested:n.requested},r)}if(t===Q.InvalidParams||t===Q.ResourceNotFound){let n=o;if(typeof n?.uri==="string"&&(t===Q.ResourceNotFound||Object.keys(n).length===1))return new nh(n.uri,r)}if(t===Q.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities==="object"&&!Array.isArray(n.requiredCapabilities))return new hu({requiredCapabilities:n.requiredCapabilities},r)}return new e(t,r,o)}},nh=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(Q.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},R_=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(Q.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},sh=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(Q.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},hu=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(Q.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},w_=0,P_="private",E_=["tools/call","prompts/get","resources/read"];function T_(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete")return t;if(E_.includes(e))return t;throw new he(Q.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function k_(e,t){let r=$_(t);if(t.resultType!=="complete"||!z_(e))return r===void 0?t:j_(t);let o=t,n=mu(o.ttlMs)?o.ttlMs:O_(r),s=pu(o.cacheScope)?o.cacheScope:N_(r),a={...o,ttlMs:n,cacheScope:s};return delete a[xr],a}function C_(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function I_(e,t){if(t===void 0)return e;let r=e._meta;if(r===void 0)return{...e,_meta:{[Ct]:t}};if(!C_(r))return e;if(r[Ct]!==void 0)return e;return{...e,_meta:{...r,[Ct]:t}}}function O_(e){return e!==void 0&&mu(e.ttlMs)?e.ttlMs:w_}function N_(e){return e!==void 0&&pu(e.cacheScope)?e.cacheScope:P_}function j_(e){let t={...e};return delete t[xr],t}var q_=["elicitation/create","sampling/createMessage","roots/list"],Va;function ah(){if(Va)return Va;let e=tr();return Va={request:{"elicitation/create":T({method:N("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":T({method:N("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":T({method:N("roots/list"),params:oe({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Va}function ih(e){return q_.includes(e)}function Yc(e){return ih(e)?ah().request[e]:void 0}function x_(e){return ih(e)?ah().response[e]:void 0}var fu={"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},ch={"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 uh(e){return Object.prototype.hasOwnProperty.call(fu,e)}function lh(e){return Object.prototype.hasOwnProperty.call(ch,e)}function A_(e){return Object.prototype.hasOwnProperty.call(fu,e)}function M_(e){return uh(e)?tr().dispatchRequestSchemas[e]:void 0}function L_(e){return A_(e)?tr().dispatchResultSchemas[e]:void 0}function Z_(e){return lh(e)?tr().notificationSchemas2026[e]:void 0}var Yb=Object.keys(fu),Xb=Object.keys(ch);function cn(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function sn(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 D_={ok:!1,reason:"not-in-era"},U_=[$r,It];function V_(e,t){let r=t,o=!1,n=()=>{if(!o)r={...r},o=!0;return r},s=t.tools;if(e==="tools/list"&&Array.isArray(s)&&s.some((i)=>cn(i)&&("execution"in i)))n().tools=s.map((i)=>{if(!cn(i)||!("execution"in i))return i;let c={...i};return delete c.execution,c});let a=t.capabilities;if(cn(a)&&"tasks"in a){let i={...a};delete i.tasks,n().capabilities=i}return r}var gu={era:"2026-07-28",hasRequestMethod:uh,hasNotificationMethod:lh,hasInputRequestMethod:(e)=>Yc(e)!==void 0,validateRequest:(e,t)=>sn(M_(e),t),validateResult:(e,t)=>sn(L_(e),t),validateNotification:(e,t)=>sn(Z_(e),t),validateInputRequest:(e,t)=>sn(Yc(e),t),validateInputResponse:(e,t)=>sn(x_(e),t),samplingResultVariant:()=>D_,outboundEnvelope(e){return{[$r]:e.protocolVersion,[No]:e.clientInfo,[It]:e.clientCapabilities,...e.logLevel!==void 0&&{[Qt]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of U_)if(!(o in e))t.push({key:o,problem:"missing"});let r=tr().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";if(n.length===1&&t.some((a)=>a.key===s&&a.problem==="missing"))continue;t.push({key:s,problem:o.message})}return t},projectCallToolResult:(e)=>Kp(e),inputRequestSchema:Yc,decodeResult(e,t){if(!cn(t))return{kind:"invalid",error:new le(pe.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new le(pe.InvalidResult,`Invalid result for ${e}: missing required resultType — 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(pe.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let a=t.inputRequests,i=cn(a)?a:{},c=t.requestState;if(Object.keys(i).length===0&&typeof c!=="string")return{kind:"invalid",error:new le(pe.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"})};return{kind:"input_required",inputRequests:i,...typeof c==="string"&&{requestState:c}}}if(r!=="complete")return{kind:"invalid",error:new le(pe.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=F_(),n=Object.hasOwn(o,e)?o[e]:void 0;if(n!==void 0){let a=n.safeParse(t);if(!a.success)return{kind:"invalid",error:new le(pe.InvalidResult,`Invalid result for ${e}: ${a.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,r){return I_(k_(e,T_(e,V_(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=tr().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("; ")}`}},Fa;function F_(){if(Fa)return Fa;let e=tr();return Fa={"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},Fa}var _u="2026-07-28";function Mr(e){return e!==void 0&&dn(e)?gu:du}function Zp(e){if(e.revision!==void 0)return Mr(e.revision).era;return e.era==="modern"?gu.era:du.era}function Xc(e){return dh.some((t)=>t.hasRequestMethod(e))}function Qc(e){return dh.some((t)=>t.hasNotificationMethod(e))}var dh=[du,gu];var H_=Cu({AnnotationsSchema:()=>St,AudioContentSchema:()=>Ir,BaseMetadataSchema:()=>_t,BaseRequestParamsSchema:()=>Me,BlobResourceContentsSchema:()=>Bo,BooleanSchemaSchema:()=>Xo,CallToolRequestParamsSchema:()=>ea,CallToolRequestSchema:()=>ta,CallToolResultSchema:()=>Yo,CancelTaskRequestSchema:()=>qc,CancelTaskResultSchema:()=>xc,CancelledNotificationParamsSchema:()=>os,CancelledNotificationSchema:()=>Do,ClientCapabilitiesSchema:()=>is,ClientNotificationSchema:()=>Mc,ClientRequestSchema:()=>Ac,ClientResultSchema:()=>Lc,ClientTasksCapabilitySchema:()=>ss,CompatibilityCallToolResultSchema:()=>Rc,CompleteRequestParamsSchema:()=>Ta,CompleteRequestSchema:()=>ka,CompleteResultSchema:()=>Ca,ContentBlockSchema:()=>Or,CreateMessageRequestParamsSchema:()=>pa,CreateMessageRequestSchema:()=>ha,CreateMessageResultSchema:()=>fa,CreateMessageResultWithToolsSchema:()=>ga,CreateTaskResultSchema:()=>Ec,CursorSchema:()=>qo,DiscoverRequestSchema:()=>ms,DiscoverResultSchema:()=>ps,ElicitRequestFormParamsSchema:()=>qr,ElicitRequestParamsSchema:()=>ba,ElicitRequestSchema:()=>za,ElicitRequestURLParamsSchema:()=>va,ElicitResultSchema:()=>wa,ElicitationCompleteNotificationParamsSchema:()=>$a,ElicitationCompleteNotificationSchema:()=>Ra,EmbeddedResourceSchema:()=>Hs,EmptyResultSchema:()=>Zo,EnumSchemaSchema:()=>ya,GetPromptRequestParamsSchema:()=>Us,GetPromptRequestSchema:()=>Vs,GetPromptResultSchema:()=>Ks,GetTaskPayloadRequestSchema:()=>Ic,GetTaskPayloadResultSchema:()=>Oc,GetTaskRequestSchema:()=>kc,GetTaskResultSchema:()=>Cc,IconSchema:()=>ns,IconsSchema:()=>Nt,ImageContentSchema:()=>Cr,ImplementationSchema:()=>Er,InitializeRequestParamsSchema:()=>cs,InitializeRequestSchema:()=>us,InitializeResultSchema:()=>ls,InitializedNotificationSchema:()=>ds,JSONArraySchema:()=>bc,JSONObjectSchema:()=>Te,JSONRPCErrorResponseSchema:()=>Pr,JSONRPCMessageSchema:()=>rs,JSONRPCNotificationSchema:()=>Lo,JSONRPCRequestSchema:()=>Mo,JSONRPCResponseSchema:()=>zc,JSONRPCResultResponseSchema:()=>wr,JSONValueSchema:()=>kt,LegacyTitledEnumSchemaSchema:()=>tn,ListChangedOptionsBaseSchema:()=>wc,ListPromptsRequestSchema:()=>Zs,ListPromptsResultSchema:()=>Ds,ListResourceTemplatesRequestSchema:()=>vs,ListResourceTemplatesResultSchema:()=>bs,ListResourcesRequestSchema:()=>Ss,ListResourcesResultSchema:()=>ys,ListRootsRequestSchema:()=>Oa,ListRootsResultSchema:()=>Na,ListTasksRequestSchema:()=>Nc,ListTasksResultSchema:()=>jc,ListToolsRequestSchema:()=>Xs,ListToolsResultSchema:()=>Qs,LoggingLevelSchema:()=>At,LoggingMessageNotificationParamsSchema:()=>sa,LoggingMessageNotificationSchema:()=>aa,ModelHintSchema:()=>ia,ModelPreferencesSchema:()=>ca,MultiSelectEnumSchemaSchema:()=>Sa,NotificationSchema:()=>Fe,NotificationsParamsSchema:()=>Ve,NumberSchemaSchema:()=>jr,PaginatedRequestParamsSchema:()=>gs,PaginatedRequestSchema:()=>jt,PaginatedResultSchema:()=>qt,PingRequestSchema:()=>Vo,PrimitiveSchemaDefinitionSchema:()=>nn,ProgressNotificationParamsSchema:()=>fs,ProgressNotificationSchema:()=>Fo,ProgressSchema:()=>hs,ProgressTokenSchema:()=>jo,PromptArgumentSchema:()=>Ms,PromptListChangedNotificationSchema:()=>Gs,PromptMessageSchema:()=>Bs,PromptReferenceSchema:()=>Ea,PromptSchema:()=>Ls,ReadResourceRequestParamsSchema:()=>zs,ReadResourceRequestSchema:()=>$s,ReadResourceResultSchema:()=>Rs,RelatedTaskMetadataSchema:()=>ts,RequestIdSchema:()=>Ot,RequestMetaSchema:()=>xo,RequestSchema:()=>ke,ResourceContentsSchema:()=>Ho,ResourceLinkSchema:()=>Js,ResourceListChangedNotificationSchema:()=>ws,ResourceRequestParamsSchema:()=>Tr,ResourceSchema:()=>Ko,ResourceTemplateReferenceSchema:()=>Pa,ResourceTemplateSchema:()=>_s,ResourceUpdatedNotificationParamsSchema:()=>xs,ResourceUpdatedNotificationSchema:()=>As,ResultMetaObjectSchema:()=>Ao,ResultSchema:()=>Ce,RoleSchema:()=>xt,RootSchema:()=>Ia,RootsListChangedNotificationSchema:()=>ja,SamplingContentSchema:()=>da,SamplingMessageContentBlockSchema:()=>Xt,SamplingMessageSchema:()=>ma,ServerCapabilitiesSchema:()=>Uo,ServerNotificationSchema:()=>Dc,ServerRequestSchema:()=>Zc,ServerResultSchema:()=>Uc,ServerTasksCapabilitySchema:()=>as,SetLevelRequestParamsSchema:()=>oa,SetLevelRequestSchema:()=>na,SingleSelectEnumSchemaSchema:()=>_a,StringSchemaSchema:()=>Nr,SubscribeRequestParamsSchema:()=>Ps,SubscribeRequestSchema:()=>Es,SubscriptionFilterSchema:()=>Go,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Os,SubscriptionsAcknowledgedNotificationSchema:()=>Ns,SubscriptionsListenRequestParamsSchema:()=>Cs,SubscriptionsListenRequestSchema:()=>Is,SubscriptionsListenResultMetaSchema:()=>js,SubscriptionsListenResultSchema:()=>qs,TaskAugmentedRequestParamsSchema:()=>er,TaskCreationParamsSchema:()=>Pc,TaskMetadataSchema:()=>es,TaskSchema:()=>Mt,TaskStatusNotificationParamsSchema:()=>xa,TaskStatusNotificationSchema:()=>Tc,TaskStatusSchema:()=>qa,TextContentSchema:()=>kr,TextResourceContentsSchema:()=>Jo,TitledMultiSelectEnumSchemaSchema:()=>on,TitledSingleSelectEnumSchemaSchema:()=>en,ToolAnnotationsSchema:()=>Ws,ToolChoiceSchema:()=>ua,ToolExecutionSchema:()=>Ys,ToolListChangedNotificationSchema:()=>ra,ToolResultContentSchema:()=>la,ToolSchema:()=>Wo,ToolUseContentSchema:()=>Fs,UnsubscribeRequestParamsSchema:()=>Ts,UnsubscribeRequestSchema:()=>ks,UntitledMultiSelectEnumSchemaSchema:()=>rn,UntitledSingleSelectEnumSchemaSchema:()=>Qo});var mh=(e)=>Mo.safeParse(e).success,ph=(e)=>Lo.safeParse(e).success,ru=(e)=>wr.safeParse(e).success,hh=(e)=>Pr.safeParse(e).success;var Lr=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";var Ha=-32020,Qb=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32000],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:[Q.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:[Ha,Q.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:[Q.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope — and a missing envelope on a request whose protocol-version header names a modern revision — 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:[Q.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision’s 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:[Q.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:[Ha],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s 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–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[Q.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced — 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:[Ha],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool’s `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."}],ez={[Q.ParseError]:400,[Q.InvalidRequest]:400,[Q.MethodNotFound]:404,[Q.UnsupportedProtocolVersion]:400,[Q.MissingRequiredClientCapability]:400,[Ha]:400};function Ba(e,t){return Kn(e,t)}function an(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function ou(e){if(e==null)return!1;let t=typeof e;if(t!=="object"&&t!=="function")return!1;if(!("~standard"in e))return!1;return typeof e["~standard"]?.validate==="function"}var Dp=!1,nu="draft-2020-12";function fh(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:nu});else if(r.vendor==="zod"){if(!("_zod"in e))throw 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().");if(!Dp)Dp=!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=Bn(e,{target:nu,io:t})}else throw 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"){if(o.type!==void 0)return o;return gh(o)?{type:"object",...o}:o}if(o.type!==void 0&&o.type!=="object")throw 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 gh(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"||gh(o)))}return!1}function J_(e){if(!e.path?.length)return e.message;return`${e.path.map((t)=>String(typeof t==="object"?t.key:t)).join(".")}: ${e.message}`}async function Ja(e,t){let r=await e["~standard"].validate(t);if(r.issues&&r.issues.length>0)return{success:!1,error:r.issues.map((o)=>J_(o)).join(", ")};return{success:!0,data:r.value}}function B_(e){let t=Bn(e,{target:nu,io:"input"});return typeof t.pattern==="string"?t.pattern:void 0}var K_=/\\\.\\d\{(\d+)\}/;function G_(e){let t=K_.exec(e),r=[void 0,-1,0];if(t)r.push(Number(t[1]));return[!1,!0].flatMap((o)=>[!1,!0].flatMap((n)=>r.map((s)=>ct.datetime({local:o,offset:n,precision:s}))))}function W_(e,t){let r;switch(e){case"email":r=[zp()];break;case"uri":r=[Wn()];break;case"date":r=[ct.date()];break;case"date-time":r=G_(t);break}return new Set(r.map((o)=>B_(o)).filter((o)=>o!==void 0))}function Y_(e,t,r){if(r!=="zod")return!0;return W_(e,t).has(t)}function ln(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function X_(e){try{return fh(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new he(Q.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var Q_=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Su(e){return Q_.has(e)||e.startsWith("x-")}var eS=new Set(["$schema",...Object.keys(qr.shape.requestedSchema.shape)]),Up={string:an([Nr,Qo,en,tn]),number:an([jr]),integer:an([jr]),boolean:an([Xo]),array:an([rn,on])},tS=new Set(Nr.shape.format.unwrap().options);function rS(e,t,r,o){if(!ln(e))return e;let n=typeof e.type==="string"&&Object.hasOwn(Up,e.type)?Up[e.type]:void 0;if(n===void 0)return e;let s={};for(let[a,i]of Object.entries(e))if(n.has(a)||Su(a))s[a]=i;else if(a==="pattern"&&e.type==="string"&&typeof e.format==="string"){if(!tS.has(e.format))s[a]=i;else if(typeof i!=="string"||!Y_(e.format,i,r))o.push(`${t}.${a}`)}else o.push(`${t}.${a}`);return s}function oS(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))if(n==="properties"&&ln(s))r[n]=Object.fromEntries(Object.entries(s).map(([a,i])=>[a,rS(i,`properties.${a}`,t,o)]));else if(eS.has(n))r[n]=s;else if(!Su(n))o.push(n);if(o.length>0)throw new he(Q.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function nS(e,t){if(!ln(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!Ba(nn,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function su(e,t,r=""){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((o,n)=>su(o,t[n],`${r}[${n}]`));if(!ln(e)||!ln(t))return[];return Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;if(!Object.prototype.hasOwnProperty.call(t,o))return Su(o)?[]:[s];return su(n,t[o],s)})}function sS(e){if(!ou(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=oS(X_(e.requestedSchema),t),o=Ba(qr.shape.requestedSchema,r);if(!o.success)throw new he(Q.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${nS(r,o.error.message)}`);let n=su(r,o.data);if(n.length>0)throw new he(Q.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(o.data.required??[]).filter((a)=>!Object.prototype.hasOwnProperty.call(o.data.properties,a));if(s.length>0)throw new he(Q.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function aS(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState==="string";if(!t&&!r)throw 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 tz=Object.assign(aS,{elicit(e){try{return{method:"elicitation/create",params:sS(e)}}catch(t){throw t instanceof he?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 _h=250;function Sh(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function yh(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof le?t.reason:new le(pe.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(pe.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function vh(e){let t=new AbortController,r=()=>t.abort(e?.reason);if(e?.addEventListener("abort",r,{once:!0}),e?.aborted)t.abort(e.reason);return{signal:t.signal,abort:(o)=>t.abort(o),dispose:()=>e?.removeEventListener("abort",r)}}var iS=["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"],cS={IdJagTokenExchangeResponseSchema:Jc,OAuthClientInformationFullSchema:Kc,OAuthClientInformationSchema:Za,OAuthClientMetadataSchema:La,OAuthClientRegistrationErrorSchema:Gc,OAuthErrorResponseSchema:Bc,OAuthMetadataSchema:Aa,OAuthProtectedResourceMetadataSchema:Vc,OAuthTokenRevocationRequestSchema:Wc,OAuthTokensSchema:Hc,OpenIdProviderDiscoveryMetadataSchema:Fc,OpenIdProviderMetadataSchema:Ma},bh={},zh={};function $h(e,t){let r=e.slice(0,-6);bh[r]=t,zh[r]=(o)=>t.safeParse(o).success}for(let e of iS)$h(e,H_[e]);for(let[e,t]of Object.entries(cS))$h(e,t);var rz=Object.freeze(bh),oz=Object.freeze(zh);function uS(e){switch(e){case"initialize":case"notifications/initialized":return Mr(void 0);case"server/discover":return Mr(_u);default:return}}var lS=60000,dS=[$r,No,It,Qt],mS=["inputResponses","requestState"];function Vp(e,t){let r=e.params;if(!un(r))return{message:e,lifted:{}};let o=r._meta,n=un(o)?dS.filter((c)=>(c in o)):[],s=t==="request"?mS.filter((c)=>(c in r)):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let a={},i={...r};if(n.length>0&&un(o)){let c={},l={...o};for(let m of n)c[m]=o[m],delete l[m];if(a.envelope=c,Object.keys(l).length>0)i._meta=l;else delete i._meta}for(let c of s){if(c==="inputResponses")a.inputResponses=i[c];if(c==="requestState")a.requestState=i[c];delete i[c]}return{message:{...e,params:i},lifted:a}}function Fp(e,t){let r=e.validateResult(t,void 0);if(!r.ok&&r.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let n=e.validateResult(t,o);if(n.ok)return{value:n.value};return{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function mn(e){return()=>e}var pS=mn(void 0);function yu(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:mn(t)}}}var hS;var Rh=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{hS=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??yc,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(pe.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){if(!e.params.requestId)return;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(pe.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);if(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)=>{if(o?.(n,s),ru(n)||hh(n))this._onresponse(n);else if(mh(n))this._onrequest(n,s);else if(ph(n))this._onnotification(n,s);else this._onerror(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(pe.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}=Vp(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let a=Zp(t.classification);if(a!==o.era){this._onerror(Error(`Era mismatch on inbound notification '${r.method}': classified as ${a} but this instance serves ${o.era}`));return}}if(Qc(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;if(n===void 0&&s===void 0)return;Promise.resolve().then(()=>n===void 0?s(r):n(r,o)).catch((a)=>this._onerror(Error(`Uncaught error in notification handler: ${a}`)))}_onrequest(e,t){let{message:r,lifted:o}=Vp(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,a=(b,f,d)=>{let v={jsonrpc:"2.0",id:r.id,error:{code:b,message:f,...d!==void 0&&{data:d}}};s?.send(v).catch((p)=>this._onerror(Error(`Failed to send an error response: ${p}`)))};if(t?.classification!==void 0){let b=Zp(t.classification);if(b!==n.era){this._onerror(Error(`Era mismatch on inbound request '${r.method}': classified as ${b} but this instance serves ${n.era}`));let f=t.classification.revision??b;a(Q.UnsupportedProtocolVersion,`Unsupported protocol version: ${f}`,{supported:this._supportedProtocolVersions,requested:f});return}}if(Xc(r.method)&&!n.hasRequestMethod(r.method)){a(Q.MethodNotFound,"Method not found");return}let i=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(i===void 0){a(Q.MethodNotFound,"Method not found");return}let c=n.checkInboundEnvelope(o);if(c!==void 0){a(Q.InvalidParams,c);return}let l=(b,f)=>this._notificationViaCodec(this._resolveOutboundCodec(b.method),b,{...f,relatedRequestId:r.id}),m=(b,f,d)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(b.method),b,f,{...d,relatedRequestId:r.id}),g=new AbortController;this._requestHandlerAbortControllers.set(r.id,g);let z=o.inputResponses===void 0?void 0:fS(o.inputResponses),w={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...z!==void 0&&{inputResponses:z.accepted},...z!==void 0&&z.droppedKeys.length>0&&{droppedInputResponseKeys:z.droppedKeys},requestState:o.requestState===void 0?pS:mn(o.requestState),signal:g.signal,send:(b,f,d)=>{let v=this._resolveOutboundCodec(b.method);if(this._assertOutboundRequestInEra(v,b.method),ou(f))return m(b,f,d);let p=Fp(v,b.method);if(p===void 0)throw TypeError(`'${b.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return m(b,p,f)},notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},_=this.buildContext(w,t);Promise.resolve().then(()=>i(r,_)).then(async(b)=>{if(g.signal.aborted)return;let f;try{f=n.encodeResult(r.method,b,this._outboundServerInfo())}catch(v){this._onerror(Error(`Failed to encode result for ${r.method}: ${v}`)),a(Q.InternalError,"Internal error");return}let d={result:f,jsonrpc:"2.0",id:r.id};await s?.send(d)},async(b)=>{if(g.signal.aborted)return;let f=Number.isSafeInteger(b.code)?b.code:Q.InternalError,d={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(f),message:b.message??"Internal error",...b.data!==void 0&&{data:b.data}}};await s?.send(d)}).catch((b)=>this._onerror(Error(`Failed to send response: ${b}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(r.id)===g)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(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(i){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(i);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),ru(e))r(e);else r(he.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),ou(t))return this._requestWithSchemaViaCodec(o,e,t,r);let n=Fp(o,e.method);if(n===void 0)throw 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 Mr(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=uS(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Xc(t)&&!e.hasRequestMethod(t))throw new le(pe.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:a,headers:i}=o??{},c=Date.now(),l,m;return new Promise((g,z)=>{let w=(y)=>{z(y)};if(!this._transport){w(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(y){w(y);return}if(o?.signal?.aborted){let y=o.signal.reason;throw y instanceof le?y:new le(pe.RequestTimeout,String(y))}let _=e.era===_u&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,b=this._requestMessageId++;m=b;let f={...t,jsonrpc:"2.0",id:b};if(o?.onprogress)this._progressHandlers.set(b,o.onprogress),f.params={...t.params,_meta:{...t.params?._meta,progressToken:b}};let d=this._envelopeOutbound(f),v=!1,p=(y)=>{if(v)return;if(this._progressHandlers.delete(b),_===void 0)this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:b,reason:String(y)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:a}).catch((h)=>this._onerror(Error(`Failed to send cancellation: ${h}`)));else _.abort();z(y instanceof le?y:new le(pe.RequestTimeout,String(y)))};this._responseHandlers.set(b,(y)=>{if(o?.signal?.aborted)return;if(v=!0,y instanceof Error)return z(y);let h;try{h=e.decodeResult(t.method,y.result)}catch(A){return z(A instanceof Error?A:Error(String(A)))}if(h.kind==="invalid")return z(h.error);if(h.kind==="input_required"){if(o?.allowInputRequired===!0)return g(gS(h));let A={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:c,retry:(H,L)=>this._requestWithSchemaViaCodec(e,H===void 0?{method:t.method}:{method:t.method,params:H},r,L)};return g(this._resolveNonCompleteResult(h,A))}let E=h.result;Ja(r,E).then((A)=>{if(A.success)g(A.data);else z(new le(pe.InvalidResult,`Invalid result for ${t.method}: ${A.error}`))},z)}),l=()=>p(o?.signal?.reason),o?.signal?.addEventListener("abort",l,{once:!0});let S=o?.timeout??lS,P=()=>p(new le(pe.RequestTimeout,"Request timed out",{timeout:S}));this._setupTimeout(b,S,o?.maxTotalTimeout,P,o?.resetTimeoutOnProgress??!1),this._transport.send(d,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:a,headers:i,requestSignal:_?.signal}).catch((y)=>{this._progressHandlers.delete(b),z(y)})}).finally(()=>{if(l)o?.signal?.removeEventListener("abort",l);if(m!==void 0)this._responseHandlers.delete(m),this._cleanupTimeout(m)})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new le(pe.NotConnected,"Not connected");if(Qc(t.method)&&!e.hasNotificationMethod(t.method))throw new le(pe.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(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;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(!Xc(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,s)=>{let a=this._negotiatedWireCodec(),i=a.validateRequest(e,n);if(!i.ok&&i.reason==="not-in-era")i=a.validateInputRequest(e,n);if(!i.ok){if(i.reason==="not-in-era")throw new he(Q.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(i.message)}return Promise.resolve(t(i.value,s))}}else if(r)o=async(n,s)=>{let a=await Ja(t.params,{...n.params});if(!a.success)throw new he(Q.InvalidParams,`Invalid params for ${e}: ${a.error}`);return r(a.data,s)};else throw 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 Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if(typeof t==="function"){if(!Qc(e))throw 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){if(s.reason==="not-in-era")throw new he(Q.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(s.message)}return Promise.resolve(t(s.value))});return}if(!r)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async(o)=>{let n=await Ja(t.params,{...o.params});if(!n.success)throw new he(Q.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function un(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function wh(e,t){let r={...e};for(let o in t){let n=o,s=t[n];if(s===void 0)continue;let a=r[n];r[n]=un(a)&&un(s)?{...a,...s}:s}return r}function Hp(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function fS(e){let t={},r=[];if(!Hp(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!Hp(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function gS(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}/*!
|
|
65
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let i=a[1];if(t===a[0]){s(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(i.cycle){s(a);continue}if(i.count>1){if(e.reused==="ref"){s(a);continue}}}}function zo(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(i)=>{let c=e.seen.get(i);if(c.ref===null)return;let l=c.def??c.schema,m={...l},g=c.ref;if(c.ref=null,g){o(g);let w=e.seen.get(g),_=w.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))l.allOf=l.allOf??[],l.allOf.push(_);else Object.assign(l,_);if(Object.assign(l,m),i._zod.parent===g)for(let f in l){if(f==="$ref"||f==="allOf")continue;if(!(f in m))delete l[f]}if(_.$ref&&w.def)for(let f in l){if(f==="$ref"||f==="allOf")continue;if(f in w.def&&JSON.stringify(l[f])===JSON.stringify(w.def[f]))delete l[f]}}let z=i._zod.parent;if(z&&z!==g){o(z);let w=e.seen.get(z);if(w?.schema.$ref){if(l.$ref=w.schema.$ref,w.def)for(let _ in l){if(_==="$ref"||_==="allOf")continue;if(_ in w.def&&JSON.stringify(l[_])===JSON.stringify(w.def[_]))delete l[_]}}}e.override({zodSchema:i,jsonSchema:l,path:c.path??[]})};for(let i of[...e.seen.entries()].reverse())o(i[0]);let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let i=e.external.registry.get(t)?.id;if(!i)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(i)}Object.assign(n,r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;if(s!==void 0&&n.id===s)delete n.id;let a=e.external?.defs??{};for(let i of e.seen.entries()){let c=i[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;a[c.defId]=c.def}}if(e.external);else if(Object.keys(a).length>0)if(e.target==="draft-2020-12")n.$defs=a;else n.definitions=a;try{let i=JSON.parse(JSON.stringify(n));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:yo(t,"input",e.processors),output:yo(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch(i){throw Error("Error converting schema to JSON.")}}function He(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 He(o.element,r);if(o.type==="set")return He(o.valueType,r);if(o.type==="lazy")return He(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 He(o.innerType,r);if(o.type==="intersection")return He(o.left,r)||He(o.right,r);if(o.type==="record"||o.type==="map")return He(o.keyType,r)||He(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return He(o.in,r)||He(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(He(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(He(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(He(n,r))return!0;if(o.rest&&He(o.rest,r))return!0;return!1}return!1}var _m=(e,t={})=>(r)=>{let o=vo({...r,processors:t});return ye(e,o),bo(o,e),zo(o,e)},yo=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:s}=o??{},a=vo({...n??{},target:s,io:t,processors:r});return ye(e,a),bo(a,e),zo(a,e)};var of={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ii=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:a,format:i,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof s==="number")n.minLength=s;if(typeof a==="number")n.maxLength=a;if(i){if(n.format=of[i]??i,n.format==="")delete n.format;if(i==="time")delete n.format}if(l)n.contentEncoding=l;if(c&&c.size>0){let m=[...c];if(m.length===1)n.pattern=m[0].source;else if(m.length>1)n.allOf=[...m.map((g)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))]}},Oi=(e,t,r,o)=>{let n=r,{minimum:s,maximum:a,format:i,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:m}=e._zod.bag;if(typeof i==="string"&&i.includes("int"))n.type="integer";else n.type="number";let g=typeof m==="number"&&m>=(s??Number.NEGATIVE_INFINITY),z=typeof l==="number"&&l<=(a??Number.POSITIVE_INFINITY),w=t.target==="draft-04"||t.target==="openapi-3.0";if(g)if(w)n.minimum=m,n.exclusiveMinimum=!0;else n.exclusiveMinimum=m;else if(typeof s==="number")n.minimum=s;if(z)if(w)n.maximum=l,n.exclusiveMaximum=!0;else n.exclusiveMaximum=l;else if(typeof a==="number")n.maximum=a;if(typeof c==="number")n.multipleOf=c},Ni=(e,t,r,o)=>{r.type="boolean"},ym=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},vm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},ji=(e,t,r,o)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"},bm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},zm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},qi=(e,t,r,o)=>{r.not={}},xi=(e,t,r,o)=>{},Ai=(e,t,r,o)=>{},$m=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},Mi=(e,t,r,o)=>{let n=e._zod.def,s=Pn(n.entries);if(s.every((a)=>typeof a==="number"))r.type="number";if(s.every((a)=>typeof a==="string"))r.type="string";r.enum=s},Li=(e,t,r,o)=>{let n=e._zod.def,s=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else s.push(Number(a));else s.push(a);if(s.length===0);else if(s.length===1){let a=s[0];if(r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[a];else r.const=a}else{if(s.every((a)=>typeof a==="number"))r.type="number";if(s.every((a)=>typeof a==="string"))r.type="string";if(s.every((a)=>typeof a==="boolean"))r.type="boolean";if(s.every((a)=>a===null))r.type="null";r.enum=s}},Rm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},wm=(e,t,r,o)=>{let n=r,s=e._zod.pattern;if(!s)throw Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},Pm=(e,t,r,o)=>{let n=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:i,mime:c}=e._zod.bag;if(a!==void 0)s.minLength=a;if(i!==void 0)s.maxLength=i;if(c)if(c.length===1)s.contentMediaType=c[0],Object.assign(n,s);else Object.assign(n,s),n.anyOf=c.map((l)=>({contentMediaType:l}));else Object.assign(n,s)},Em=(e,t,r,o)=>{r.type="boolean"},Zi=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},Tm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},Di=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},km=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},Cm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},Ui=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:a,maximum:i}=e._zod.bag;if(typeof a==="number")n.minItems=a;if(typeof i==="number")n.maxItems=i;n.type="array",n.items=ye(s.element,t,{...o,path:[...o.path,"items"]})},Vi=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object",n.properties={};let a=s.shape;for(let l in a)n.properties[l]=ye(a[l],t,{...o,path:[...o.path,"properties",l]});let i=new Set(Object.keys(a)),c=new Set([...i].filter((l)=>{let m=s.shape[l]._zod;if(t.io==="input")return m.optin===void 0;else return m.optout===void 0}));if(c.size>0)n.required=Array.from(c);if(s.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")n.additionalProperties=!1}else if(s.catchall)n.additionalProperties=ye(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},Fi=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,a=n.options.map((i,c)=>ye(i,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));if(s)r.oneOf=a;else r.anyOf=a},Hi=(e,t,r,o)=>{let n=e._zod.def,s=ye(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=ye(n.right,t,{...o,path:[...o.path,"allOf",1]}),i=(l)=>("allOf"in l)&&Object.keys(l).length===1,c=[...i(s)?s.allOf:[s],...i(a)?a.allOf:[a]];r.allOf=c},Im=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",i=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((z,w)=>ye(z,t,{...o,path:[...o.path,a,w]})),l=s.rest?ye(s.rest,t,{...o,path:[...o.path,i,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(n.prefixItems=c,l)n.items=l}else if(t.target==="openapi-3.0"){if(n.items={anyOf:c},l)n.items.anyOf.push(l);if(n.minItems=c.length,!l)n.maxItems=c.length}else if(n.items=c,l)n.additionalItems=l;let{minimum:m,maximum:g}=e._zod.bag;if(typeof m==="number")n.minItems=m;if(typeof g==="number")n.maxItems=g},Ji=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let a=s.keyType,c=a._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let m=ye(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let g of c)n.patternProperties[g.source]=m}else{if(t.target==="draft-07"||t.target==="draft-2020-12")n.propertyNames=ye(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});n.additionalProperties=ye(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let l=a._zod.values;if(l){let m=[...l].filter((g)=>typeof g==="string"||typeof g==="number");if(m.length>0)n.required=m}},Bi=(e,t,r,o)=>{let n=e._zod.def,s=ye(n.innerType,t,o),a=t.seen.get(e);if(t.target==="openapi-3.0")a.ref=n.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},Ki=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Gi=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Wi=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io==="input")r._prefault=JSON.parse(JSON.stringify(n.defaultValue))},Yi=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Xi=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?s?n.out:n.in:n.out;ye(a,t,o);let i=t.seen.get(e);i.ref=a},Qi=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},Om=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Dn=(e,t,r,o)=>{let n=e._zod.def;ye(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},ec=(e,t,r,o)=>{let n=e._zod.innerType;ye(n,t,o);let s=t.seen.get(e);s.ref=n},Sm={string:Ii,number:Oi,boolean:Ni,bigint:ym,symbol:vm,null:ji,undefined:bm,void:zm,never:qi,any:xi,unknown:Ai,date:$m,enum:Mi,literal:Li,nan:Rm,template_literal:wm,file:Pm,success:Em,custom:Zi,function:Tm,transform:Di,map:km,set:Cm,array:Ui,object:Vi,union:Fi,intersection:Hi,tuple:Im,record:Ji,nullable:Bi,nonoptional:Ki,default:Gi,prefault:Wi,catch:Yi,pipe:Xi,readonly:Qi,promise:Om,optional:Dn,lazy:ec};function Un(e,t){if("_idmap"in e){let o=e,n=vo({...t,processors:Sm}),s={};for(let c of o._idmap.entries()){let[l,m]=c;ye(m,n)}let a={},i={registry:o,uri:t?.uri,defs:s};n.external=i;for(let c of o._idmap.entries()){let[l,m]=c;bo(n,m),a[l]=zo(n,m)}if(Object.keys(s).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:s}}return{schemas:a}}let r=vo({...t,processors:Sm});return ye(e,r),bo(r,e),zo(r,e)}var mf=M("ZodISODateTime",(e,t)=>{Kl.init(e,t),we.init(e,t)});function hr(e){return rm(mf,e)}var pf=M("ZodISODate",(e,t)=>{Gl.init(e,t),we.init(e,t)});function tc(e){return om(pf,e)}var hf=M("ZodISOTime",(e,t)=>{Wl.init(e,t),we.init(e,t)});function Nm(e){return nm(hf,e)}var ff=M("ZodISODuration",(e,t)=>{Yl.init(e,t),we.init(e,t)});function jm(e){return sm(ff,e)}var gf=(e,t)=>{Cn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>ni(e,r)},flatten:{value:(r)=>oi(e,r)},addIssue:{value:(r)=>{e.issues.push(r),e.message=JSON.stringify(e.issues,lo,2)}},addIssues:{value:(r)=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,lo,2)}},isEmpty:{get(){return e.issues.length===0}}})};var Ye=M("ZodError",gf,{Parent:Error});var xm=In(Ye),Am=On(Ye),Fn=po(Ye),Mm=ho(Ye),Lm=Ou(Ye),Zm=Nu(Ye),Dm=ju(Ye),Um=qu(Ye),Vm=xu(Ye),Fm=Au(Ye),Hm=Mu(Ye),Jm=Lu(Ye);var Bm=new WeakMap;function $o(e,t,r){let o=Object.getPrototypeOf(e),n=Bm.get(o);if(!n)n=new Set,Bm.set(o,n);if(n.has(t))return;n.add(t);for(let s in r){let a=r[s];Object.defineProperty(o,s,{configurable:!0,enumerable:!1,get(){let i=a.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:i}),i},set(i){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:i})}})}}var ze=M("ZodType",(e,t)=>(Se.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:yo(e,"input"),output:yo(e,"output")}}),e.toJSONSchema=_m(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>xm(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Fn(e,r,o),e.parseAsync=async(r,o)=>Am(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Mm(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Lm(e,r,o),e.decode=(r,o)=>Zm(e,r,o),e.encodeAsync=async(r,o)=>Dm(e,r,o),e.decodeAsync=async(r,o)=>Um(e,r,o),e.safeEncode=(r,o)=>Vm(e,r,o),e.safeDecode=(r,o)=>Fm(e,r,o),e.safeEncodeAsync=async(r,o)=>Hm(e,r,o),e.safeDecodeAsync=async(r,o)=>Jm(e,r,o),$o(e,"ZodType",{check(...r){let o=this.def;return this.clone(St(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 rt(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(sg(r,o))},superRefine(r,o){return this.check(ag(r,o))},overwrite(r){return this.check(zt(r))},optional(){return Q(this)},exactOptional(){return Hf(this)},nullable(){return Ym(this)},nullish(){return Q(Ym(this))},nonoptional(r){return Yf(this,r)},array(){return O(this)},or(r){return W([this,r])},and(r){return lt(this,r)},transform(r){return Xm(this,cp(r))},default(r){return Kf(this,r)},prefault(r){return Wf(this,r)},catch(r){return Qf(this,r)},pipe(r){return Xm(this,r)},readonly(){return rg(this)},describe(r){let o=this.clone();return bt.add(o,{description:r}),o},meta(...r){if(r.length===0)return bt.get(this);let o=this.clone();return bt.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 bt.get(e)?.description},configurable:!0}),e)),Qm=M("_ZodString",(e,t)=>{qn.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Ii(e,o,n,s);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,$o(e,"_ZodString",{regex(...o){return this.check(vi(...o))},includes(...o){return this.check($i(...o))},startsWith(...o){return this.check(Ri(...o))},endsWith(...o){return this.check(wi(...o))},min(...o){return this.check(mr(...o))},max(...o){return this.check(Ln(...o))},length(...o){return this.check(Zn(...o))},nonempty(...o){return this.check(mr(1,...o))},lowercase(o){return this.check(bi(o))},uppercase(o){return this.check(zi(o))},trim(){return this.check(Ei())},normalize(...o){return this.check(Pi(...o))},toLowerCase(){return this.check(Ti())},toUpperCase(){return this.check(ki())},slugify(){return this.check(Ci())}})}),ep=M("ZodString",(e,t)=>{qn.init(e,t),Qm.init(e,t),e.email=(r)=>e.check(_i(tp,r)),e.url=(r)=>e.check(yi(op,r)),e.jwt=(r)=>e.check(tm(Of,r)),e.emoji=(r)=>e.check(Dd(Sf,r)),e.guid=(r)=>e.check(Si(Km,r)),e.uuid=(r)=>e.check(Ad(Hn,r)),e.uuidv4=(r)=>e.check(Md(Hn,r)),e.uuidv6=(r)=>e.check(Ld(Hn,r)),e.uuidv7=(r)=>e.check(Zd(Hn,r)),e.nanoid=(r)=>e.check(Ud(yf,r)),e.guid=(r)=>e.check(Si(Km,r)),e.cuid=(r)=>e.check(Vd(vf,r)),e.cuid2=(r)=>e.check(Fd(bf,r)),e.ulid=(r)=>e.check(Hd(zf,r)),e.base64=(r)=>e.check(Xd(kf,r)),e.base64url=(r)=>e.check(Qd(Cf,r)),e.xid=(r)=>e.check(Jd($f,r)),e.ksuid=(r)=>e.check(Bd(Rf,r)),e.ipv4=(r)=>e.check(Kd(wf,r)),e.ipv6=(r)=>e.check(Gd(Pf,r)),e.cidrv4=(r)=>e.check(Wd(Ef,r)),e.cidrv6=(r)=>e.check(Yd(Tf,r)),e.e164=(r)=>e.check(em(If,r)),e.datetime=(r)=>e.check(hr(r)),e.date=(r)=>e.check(tc(r)),e.time=(r)=>e.check(Nm(r)),e.duration=(r)=>e.check(jm(r))});function u(e){return xd(ep,e)}var we=M("ZodStringFormat",(e,t)=>{$e.init(e,t),Qm.init(e,t)}),tp=M("ZodEmail",(e,t)=>{Ll.init(e,t),we.init(e,t)});function rp(e){return _i(tp,e)}var Km=M("ZodGUID",(e,t)=>{Al.init(e,t),we.init(e,t)});var Hn=M("ZodUUID",(e,t)=>{Ml.init(e,t),we.init(e,t)});var op=M("ZodURL",(e,t)=>{Zl.init(e,t),we.init(e,t)});function Jn(e){return yi(op,e)}var Sf=M("ZodEmoji",(e,t)=>{Dl.init(e,t),we.init(e,t)});var yf=M("ZodNanoID",(e,t)=>{Ul.init(e,t),we.init(e,t)});var vf=M("ZodCUID",(e,t)=>{Vl.init(e,t),we.init(e,t)});var bf=M("ZodCUID2",(e,t)=>{Fl.init(e,t),we.init(e,t)});var zf=M("ZodULID",(e,t)=>{Hl.init(e,t),we.init(e,t)});var $f=M("ZodXID",(e,t)=>{Jl.init(e,t),we.init(e,t)});var Rf=M("ZodKSUID",(e,t)=>{Bl.init(e,t),we.init(e,t)});var wf=M("ZodIPv4",(e,t)=>{Xl.init(e,t),we.init(e,t)});var Pf=M("ZodIPv6",(e,t)=>{Ql.init(e,t),we.init(e,t)});var Ef=M("ZodCIDRv4",(e,t)=>{ed.init(e,t),we.init(e,t)});var Tf=M("ZodCIDRv6",(e,t)=>{td.init(e,t),we.init(e,t)});var kf=M("ZodBase64",(e,t)=>{od.init(e,t),we.init(e,t)});var Cf=M("ZodBase64URL",(e,t)=>{nd.init(e,t),we.init(e,t)});var If=M("ZodE164",(e,t)=>{sd.init(e,t),we.init(e,t)});var Of=M("ZodJWT",(e,t)=>{ad.init(e,t),we.init(e,t)});var Bn=M("ZodNumber",(e,t)=>{mi.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Oi(e,o,n,s),$o(e,"ZodNumber",{gt(o,n){return this.check(An(o,n))},gte(o,n){return this.check(So(o,n))},min(o,n){return this.check(So(o,n))},lt(o,n){return this.check(xn(o,n))},lte(o,n){return this.check(_o(o,n))},max(o,n){return this.check(_o(o,n))},int(o){return this.check(Gm(o))},safe(o){return this.check(Gm(o))},positive(o){return this.check(An(0,o))},nonnegative(o){return this.check(So(0,o))},negative(o){return this.check(xn(0,o))},nonpositive(o){return this.check(_o(0,o))},multipleOf(o,n){return this.check(Mn(o,n))},step(o,n){return this.check(Mn(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??0.5),e.isFinite=!0,e.format=r.format??null});function F(e){return am(Bn,e)}var Nf=M("ZodNumberFormat",(e,t)=>{id.init(e,t),Bn.init(e,t)});function Gm(e){return cm(Nf,e)}var np=M("ZodBoolean",(e,t)=>{cd.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ni(e,r,o,n)});function G(e){return um(np,e)}var jf=M("ZodNull",(e,t)=>{ud.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ji(e,r,o,n)});function Bt(e){return lm(jf,e)}var qf=M("ZodAny",(e,t)=>{ld.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xi(e,r,o,n)});function sp(){return dm(qf)}var xf=M("ZodUnknown",(e,t)=>{dd.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ai(e,r,o,n)});function te(){return mm(xf)}var Af=M("ZodNever",(e,t)=>{md.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qi(e,r,o,n)});function Mf(e){return pm(Af,e)}var Lf=M("ZodArray",(e,t)=>{pd.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ui(e,r,o,n),e.element=t.element,$o(e,"ZodArray",{min(r,o){return this.check(mr(r,o))},nonempty(r){return this.check(mr(1,r))},max(r,o){return this.check(Ln(r,o))},length(r,o){return this.check(Zn(r,o))},unwrap(){return this.element}})});function O(e,t){return hm(Lf,e,t)}var ap=M("ZodObject",(e,t)=>{gd.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vi(e,r,o,n),_e(e,"shape",()=>t.shape),$o(e,"ZodObject",{keyof(){return ie(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:te()})},loose(){return this.clone({...this._zod.def,catchall:te()})},strict(){return this.clone({...this._zod.def,catchall:Mf()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return Vh(this,r)},safeExtend(r){return Fh(this,r)},merge(r){return Hh(this,r)},pick(r){return Dh(this,r)},omit(r){return Uh(this,r)},partial(...r){return Jh(up,this,r[0])},required(...r){return Bh(lp,this,r[0])}})});function T(e,t){let r={type:"object",shape:e??{},...X(t)};return new ap(r)}function oe(e,t){return new ap({type:"object",shape:e,catchall:te(),...X(t)})}var ip=M("ZodUnion",(e,t)=>{pi.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fi(e,r,o,n),e.options=t.options});function W(e,t){return new ip({type:"union",options:e,...X(t)})}var Zf=M("ZodDiscriminatedUnion",(e,t)=>{ip.init(e,t),_d.init(e,t)});function fr(e,t,r){return new Zf({type:"union",options:t,discriminator:e,...X(r)})}var Df=M("ZodIntersection",(e,t)=>{Sd.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hi(e,r,o,n)});function lt(e,t){return new Df({type:"intersection",left:e,right:t})}var Wm=M("ZodRecord",(e,t)=>{yd.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ji(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function B(e,t,r){if(!t||!t._zod)return new Wm({type:"record",keyType:u(),valueType:e,...X(t)});return new Wm({type:"record",keyType:e,valueType:t,...X(r)})}var rc=M("ZodEnum",(e,t)=>{vd.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Mi(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 a of o)if(r.has(a))s[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new rc({...t,checks:[],...X(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let a of o)if(r.has(a))delete s[a];else throw Error(`Key ${a} not found in enum`);return new rc({...t,checks:[],...X(n),entries:s})}});function ie(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new rc({type:"enum",entries:r,...X(t)})}var Uf=M("ZodLiteral",(e,t)=>{bd.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Li(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function N(e,t){return new Uf({type:"literal",values:Array.isArray(e)?e:[e],...X(t)})}var Vf=M("ZodTransform",(e,t)=>{zd.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Di(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new uo(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(Jt(s,r.value,t));else{let a=s;if(a.fatal)a.continue=!1;a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(Jt(a))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((s)=>(r.value=s,r.fallback=!0,r));return r.value=n,r.fallback=!0,r}});function cp(e){return new Vf({type:"transform",transform:e})}var up=M("ZodOptional",(e,t)=>{hi.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dn(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Q(e){return new up({type:"optional",innerType:e})}var Ff=M("ZodExactOptional",(e,t)=>{$d.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dn(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Hf(e){return new Ff({type:"optional",innerType:e})}var Jf=M("ZodNullable",(e,t)=>{Rd.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bi(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ym(e){return new Jf({type:"nullable",innerType:e})}var Bf=M("ZodDefault",(e,t)=>{wd.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gi(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Kf(e,t){return new Bf({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():ei(t)}})}var Gf=M("ZodPrefault",(e,t)=>{Pd.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wi(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Wf(e,t){return new Gf({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():ei(t)}})}var lp=M("ZodNonOptional",(e,t)=>{Ed.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ki(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Yf(e,t){return new lp({type:"nonoptional",innerType:e,...X(t)})}var Xf=M("ZodCatch",(e,t)=>{Td.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yi(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Qf(e,t){return new Xf({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var dp=M("ZodPipe",(e,t)=>{fi.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xi(e,r,o,n),e.in=t.in,e.out=t.out});function Xm(e,t){return new dp({type:"pipe",in:e,out:t})}var eg=M("ZodPreprocess",(e,t)=>{dp.init(e,t),kd.init(e,t)}),tg=M("ZodReadonly",(e,t)=>{Cd.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qi(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function rg(e){return new tg({type:"readonly",innerType:e})}var og=M("ZodLazy",(e,t)=>{Id.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ec(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Ro(e){return new og({type:"lazy",getter:e})}var ng=M("ZodCustom",(e,t)=>{Od.init(e,t),ze.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zi(e,r,o,n)});function sg(e,t={}){return fm(ng,e,t)}function ag(e,t){return gm(e,t)}function Kt(e,t){return new eg({type:"pipe",in:cp(e),out:t})}var pp={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 mp;(function(e){})(mp||(mp={}));function ig(e){return im(Bn,e)}Ke(gi());var gr="2025-11-25";var nc=[gr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],sc="io.modelcontextprotocol/related-task",_r="io.modelcontextprotocol/protocolVersion",wo="io.modelcontextprotocol/clientInfo",Rt="io.modelcontextprotocol/serverInfo",wt="io.modelcontextprotocol/clientCapabilities",Kn="io.modelcontextprotocol/subscriptionId",Wt="io.modelcontextprotocol/logLevel";var Sr="2.0";var $t=Ro(()=>W([u(),F(),G(),Bt(),B(u(),$t),O($t)])),Ee=B(u(),$t),ac=O($t),Po=W([u(),F().int()]),Eo=u(),Gn=T({ttl:F().optional()}),Wn=T({taskId:u()}),To=oe({progressToken:Po.optional(),[sc]:Wn.optional()}),Ae=T({_meta:To.optional()}),Yt=Ae.extend({task:Gn.optional()}),Te=T({method:u(),params:Ae.loose().optional()}),Ue=T({_meta:To.optional()}),Ve=T({method:u(),params:Ue.loose().optional()}),ko=oe({get[Rt](){return br.optional().catch(void 0)}}),ke=oe({_meta:ko.optional()}),Pt=W([u(),F().int()]),Co=T({jsonrpc:N(Sr),id:Pt,...Te.shape}).strict(),Io=T({jsonrpc:N(Sr),...Ve.shape}).strict(),yr=T({jsonrpc:N(Sr),id:Pt,result:ke}).strict(),vr=T({jsonrpc:N(Sr),id:Pt.optional(),error:T({code:F().int(),message:u(),data:te().optional()})}).strict(),Yn=W([Co,Io,yr,vr]),ic=W([yr,vr]),Oo=ke.strict(),Xn=Ue.extend({requestId:Pt.optional(),reason:u().optional()}),No=Ve.extend({method:N("notifications/cancelled"),params:Xn}),Qn=T({src:u(),mimeType:u().optional(),sizes:O(u()).optional(),theme:ie(["light","dark"]).optional()}),Et=T({icons:O(Qn).optional()}),dt=T({name:u(),title:u().optional()}),br=dt.extend({...dt.shape,...Et.shape,version:u(),websiteUrl:u().optional(),description:u().optional()}),ug=lt(T({applyDefaults:G().optional()}),Ee),lg=Kt((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)&&Object.keys(e).length===0)return{form:{}};return e},lt(T({form:ug.optional(),url:Ee.optional()}),Ee.optional())),es=oe({list:Ee.optional(),cancel:Ee.optional(),requests:oe({sampling:oe({createMessage:Ee.optional()}).optional(),elicitation:oe({create:Ee.optional()}).optional()}).optional()}),ts=oe({list:Ee.optional(),cancel:Ee.optional(),requests:oe({tools:oe({call:Ee.optional()}).optional()}).optional()}),rs=T({experimental:B(u(),Ee).optional(),sampling:T({context:Ee.optional(),tools:Ee.optional()}).optional(),elicitation:lg.optional(),roots:T({listChanged:G().optional()}).optional(),tasks:es.optional(),extensions:B(u(),Ee).optional()}),os=Ae.extend({protocolVersion:u(),capabilities:rs,clientInfo:br}),ns=Te.extend({method:N("initialize"),params:os}),jo=T({experimental:B(u(),Ee).optional(),logging:Ee.optional(),completions:Ee.optional(),prompts:T({listChanged:G().optional()}).optional(),resources:T({subscribe:G().optional(),listChanged:G().optional()}).optional(),tools:T({listChanged:G().optional()}).optional(),tasks:ts.optional(),extensions:B(u(),Ee).optional()}),ss=ke.extend({protocolVersion:u(),capabilities:jo,serverInfo:br,instructions:u().optional()}),as=Ve.extend({method:N("notifications/initialized"),params:Ue.optional()}),is=Te.extend({method:N("server/discover"),params:Ae.optional()}),cs=ke.extend({supportedVersions:O(u()),capabilities:jo,instructions:u().optional()}),qo=Te.extend({method:N("ping"),params:Ae.optional()}),us=T({progress:F(),total:Q(F()),message:Q(u())}),ls=T({...Ue.shape,...us.shape,progressToken:Po}),xo=Ve.extend({method:N("notifications/progress"),params:ls}),ds=Ae.extend({cursor:Eo.optional()}),Tt=Te.extend({params:ds.optional()}),kt=ke.extend({nextCursor:Eo.optional()}),Ao=T({uri:u(),mimeType:Q(u()),_meta:B(u(),te()).optional()}),Mo=Ao.extend({text:u()}),cc=u().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Lo=Ao.extend({blob:cc}),Ct=ie(["user","assistant"]),mt=T({audience:O(Ct).optional(),priority:F().min(0).max(1).optional(),lastModified:hr({offset:!0}).optional()}),Zo=T({...dt.shape,...Et.shape,uri:u(),description:Q(u()),mimeType:Q(u()),size:Q(F()),annotations:mt.optional(),_meta:Q(oe({}))}),ms=T({...dt.shape,...Et.shape,uriTemplate:u(),description:Q(u()),mimeType:Q(u()),annotations:mt.optional(),_meta:Q(oe({}))}),ps=Tt.extend({method:N("resources/list")}),hs=kt.extend({resources:O(Zo)}),fs=Tt.extend({method:N("resources/templates/list")}),gs=kt.extend({resourceTemplates:O(ms)}),zr=Ae.extend({uri:u()}),_s=zr,Ss=Te.extend({method:N("resources/read"),params:_s}),ys=ke.extend({contents:O(W([Mo,Lo]))}),vs=Ve.extend({method:N("notifications/resources/list_changed"),params:Ue.optional()}),bs=zr,zs=Te.extend({method:N("resources/subscribe"),params:bs}),$s=zr,Rs=Te.extend({method:N("resources/unsubscribe"),params:$s}),Do=T({toolsListChanged:G().optional(),promptsListChanged:G().optional(),resourcesListChanged:G().optional(),resourceSubscriptions:O(u()).optional()}),ws=Ae.extend({notifications:Do}),Ps=Te.extend({method:N("subscriptions/listen"),params:ws}),Es=Ue.extend({notifications:Do}),Ts=Ve.extend({method:N("notifications/subscriptions/acknowledged"),params:Es}),ks=ko.extend({[Kn]:Pt}),Cs=ke.extend({_meta:ks}),Is=Ue.extend({uri:u()}),Os=Ve.extend({method:N("notifications/resources/updated"),params:Is}),Ns=T({name:u(),description:Q(u()),required:Q(G())}),js=T({...dt.shape,...Et.shape,description:Q(u()),arguments:Q(O(Ns)),_meta:Q(oe({}))}),qs=Tt.extend({method:N("prompts/list")}),xs=kt.extend({prompts:O(js)}),As=Ae.extend({name:u(),arguments:B(u(),u()).optional()}),Ms=Te.extend({method:N("prompts/get"),params:As}),$r=T({type:N("text"),text:u(),annotations:mt.optional(),_meta:B(u(),te()).optional()}),Rr=T({type:N("image"),data:cc,mimeType:u(),annotations:mt.optional(),_meta:B(u(),te()).optional()}),wr=T({type:N("audio"),data:cc,mimeType:u(),annotations:mt.optional(),_meta:B(u(),te()).optional()}),Ls=T({type:N("tool_use"),name:u(),id:u(),input:B(u(),te()),_meta:B(u(),te()).optional()}),Zs=T({type:N("resource"),resource:W([Mo,Lo]),annotations:mt.optional(),_meta:B(u(),te()).optional()}),Ds=Zo.extend({type:N("resource_link")}),Pr=W([$r,Rr,wr,Ds,Zs]),Us=T({role:Ct,content:Pr}),Vs=ke.extend({description:u().optional(),messages:O(Us)}),Fs=Ve.extend({method:N("notifications/prompts/list_changed"),params:Ue.optional()}),Hs=T({title:u().optional(),readOnlyHint:G().optional(),destructiveHint:G().optional(),idempotentHint:G().optional(),openWorldHint:G().optional()}),Js=T({taskSupport:ie(["required","optional","forbidden"]).optional()}),Uo=T({...dt.shape,...Et.shape,description:u().optional(),inputSchema:T({type:N("object"),properties:B(u(),$t).optional(),required:O(u()).optional()}).catchall(te()),outputSchema:oe({$schema:u().optional()}).optional(),annotations:Hs.optional(),execution:Js.optional(),_meta:B(u(),te()).optional()}),Bs=Tt.extend({method:N("tools/list")}),Ks=kt.extend({tools:O(Uo)}),Vo=ke.extend({content:O(Pr).default([]),structuredContent:te().optional(),isError:G().optional()}),uc=Vo.or(ke.extend({toolResult:te()})),Gs=Yt.extend({name:u(),arguments:B(u(),te()).optional()}),Ws=Te.extend({method:N("tools/call"),params:Gs}),Ys=Ve.extend({method:N("notifications/tools/list_changed"),params:Ue.optional()}),lc=T({autoRefresh:G().default(!0),debounceMs:F().int().nonnegative().default(300)}),It=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),Xs=Ae.extend({level:It}),Qs=Te.extend({method:N("logging/setLevel"),params:Xs}),ea=Ue.extend({level:It,logger:u().optional(),data:te()}),ta=Ve.extend({method:N("notifications/message"),params:ea}),ra=T({name:u().optional()}),oa=T({hints:O(ra).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),na=T({mode:ie(["auto","required","none"]).optional()}),sa=T({type:N("tool_result"),toolUseId:u().describe("The unique identifier for the corresponding tool call."),content:O(Pr),structuredContent:te().optional(),isError:G().optional(),_meta:B(u(),te()).optional()}),aa=fr("type",[$r,Rr,wr]),Gt=fr("type",[$r,Rr,wr,Ls,sa]),ia=T({role:Ct,content:W([Gt,O(Gt)]),_meta:B(u(),te()).optional()}),ca=Yt.extend({messages:O(ia),modelPreferences:oa.optional(),systemPrompt:u().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:O(u()).optional(),metadata:Ee.optional(),tools:O(Uo).optional(),toolChoice:na.optional()}),ua=Te.extend({method:N("sampling/createMessage"),params:ca}),la=ke.extend({model:u(),stopReason:Q(ie(["endTurn","stopSequence","maxTokens"]).or(u())),role:Ct,content:aa}),da=ke.extend({model:u(),stopReason:Q(ie(["endTurn","stopSequence","maxTokens","toolUse"]).or(u())),role:Ct,content:W([Gt,O(Gt)])}),Fo=T({type:N("boolean"),title:u().optional(),description:u().optional(),default:G().optional()}),Er=T({type:N("string"),title:u().optional(),description:u().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:u().optional()}),Tr=T({type:ie(["number","integer"]),title:u().optional(),description:u().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),Ho=T({type:N("string"),title:u().optional(),description:u().optional(),enum:O(u()),default:u().optional()}),Jo=T({type:N("string"),title:u().optional(),description:u().optional(),oneOf:O(T({const:u(),title:u()})),default:u().optional()}),Bo=T({type:N("string"),title:u().optional(),description:u().optional(),enum:O(u()),enumNames:O(u()).optional(),default:u().optional()}),ma=W([Ho,Jo]),Ko=T({type:N("array"),title:u().optional(),description:u().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({type:N("string"),enum:O(u())}),default:O(u()).optional()}),Go=T({type:N("array"),title:u().optional(),description:u().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({anyOf:O(T({const:u(),title:u()}))}),default:O(u()).optional()}),pa=W([Ko,Go]),ha=W([Bo,ma,pa]),Wo=W([ha,Fo,Er,Tr]),kr=Yt.extend({mode:N("form").optional(),message:u(),requestedSchema:T({type:N("object"),properties:B(u(),Wo),required:O(u()).optional()}).catchall(te())}),fa=Yt.extend({mode:N("url"),message:u(),elicitationId:u(),url:u().url()}),ga=W([kr,fa]),_a=Te.extend({method:N("elicitation/create"),params:ga}),Sa=Ue.extend({elicitationId:u()}),ya=Ve.extend({method:N("notifications/elicitation/complete"),params:Sa}),va=ke.extend({action:ie(["accept","decline","cancel"]),content:Kt((e)=>e===null?void 0:e,B(u(),W([u(),F(),G(),O(u())])).optional())}),ba=T({type:N("ref/resource"),uri:u()}),za=T({type:N("ref/prompt"),name:u()}),$a=Ae.extend({ref:W([za,ba]),argument:T({name:u(),value:u()}),context:T({arguments:B(u(),u()).optional()}).optional()}),Ra=Te.extend({method:N("completion/complete"),params:$a}),wa=ke.extend({completion:oe({values:O(u()).max(100),total:Q(F().int()),hasMore:Q(G())})}),Pa=T({uri:u().startsWith("file://"),name:u().optional(),_meta:B(u(),te()).optional()}),Ea=Te.extend({method:N("roots/list"),params:Ae.optional()}),Ta=ke.extend({roots:O(Pa)}),ka=Ve.extend({method:N("notifications/roots/list_changed"),params:Ue.optional()}),dc=oe({ttl:F().optional(),pollInterval:F().optional()}),Ca=ie(["working","input_required","completed","failed","cancelled"]),Ot=T({taskId:u(),status:Ca,ttl:W([F(),Bt()]),createdAt:u(),lastUpdatedAt:u(),pollInterval:Q(F()),statusMessage:Q(u())}),mc=ke.extend({task:Ot}),Ia=Ue.merge(Ot),pc=Ve.extend({method:N("notifications/tasks/status"),params:Ia}),hc=Te.extend({method:N("tasks/get"),params:Ae.extend({taskId:u()})}),fc=ke.merge(Ot),gc=Te.extend({method:N("tasks/result"),params:Ae.extend({taskId:u()})}),_c=ke.loose(),Sc=Tt.extend({method:N("tasks/list")}),yc=kt.extend({tasks:O(Ot)}),vc=Te.extend({method:N("tasks/cancel"),params:Ae.extend({taskId:u()})}),bc=ke.merge(Ot),zc=W([qo,ns,is,Ra,Qs,Ms,qs,ps,fs,Ss,zs,Rs,Ps,Ws,Bs]),$c=W([No,xo,as,ka]),Rc=W([Oo,la,da,va,Ta]),wc=W([qo,ua,_a,Ea]),Pc=W([No,xo,ta,Os,vs,Ys,Fs,Ts,ya]),Ec=W([Oo,ss,cs,wa,Vs,xs,hs,gs,ys,Vo,Ks,Cs]),xe=Jn().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:pp.custom,message:"URL must be parseable",fatal:!0}),Ga}).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"}),Tc=oe({resource:u().url(),authorization_servers:O(xe).optional(),jwks_uri:u().url().optional(),scopes_supported:O(u()).optional(),bearer_methods_supported:O(u()).optional(),resource_signing_alg_values_supported:O(u()).optional(),resource_name:u().optional(),resource_documentation:u().optional(),resource_policy_uri:u().url().optional(),resource_tos_uri:u().url().optional(),tls_client_certificate_bound_access_tokens:G().optional(),authorization_details_types_supported:O(u()).optional(),dpop_signing_alg_values_supported:O(u()).optional(),dpop_bound_access_tokens_required:G().optional()}),Oa=oe({issuer:u(),authorization_endpoint:xe,token_endpoint:xe,registration_endpoint:xe.optional(),scopes_supported:O(u()).optional(),response_types_supported:O(u()),response_modes_supported:O(u()).optional(),grant_types_supported:O(u()).optional(),token_endpoint_auth_methods_supported:O(u()).optional(),token_endpoint_auth_signing_alg_values_supported:O(u()).optional(),service_documentation:xe.optional(),revocation_endpoint:xe.optional(),revocation_endpoint_auth_methods_supported:O(u()).optional(),revocation_endpoint_auth_signing_alg_values_supported:O(u()).optional(),introspection_endpoint:u().optional(),introspection_endpoint_auth_methods_supported:O(u()).optional(),introspection_endpoint_auth_signing_alg_values_supported:O(u()).optional(),code_challenge_methods_supported:O(u()).optional(),client_id_metadata_document_supported:G().optional(),authorization_response_iss_parameter_supported:G().optional().catch(void 0)}),Na=oe({issuer:u(),authorization_endpoint:xe,token_endpoint:xe,userinfo_endpoint:xe.optional(),jwks_uri:xe,registration_endpoint:xe.optional(),scopes_supported:O(u()).optional(),response_types_supported:O(u()),response_modes_supported:O(u()).optional(),grant_types_supported:O(u()).optional(),acr_values_supported:O(u()).optional(),subject_types_supported:O(u()),id_token_signing_alg_values_supported:O(u()),id_token_encryption_alg_values_supported:O(u()).optional(),id_token_encryption_enc_values_supported:O(u()).optional(),userinfo_signing_alg_values_supported:O(u()).optional(),userinfo_encryption_alg_values_supported:O(u()).optional(),userinfo_encryption_enc_values_supported:O(u()).optional(),request_object_signing_alg_values_supported:O(u()).optional(),request_object_encryption_alg_values_supported:O(u()).optional(),request_object_encryption_enc_values_supported:O(u()).optional(),token_endpoint_auth_methods_supported:O(u()).optional(),token_endpoint_auth_signing_alg_values_supported:O(u()).optional(),display_values_supported:O(u()).optional(),claim_types_supported:O(u()).optional(),claims_supported:O(u()).optional(),service_documentation:u().optional(),claims_locales_supported:O(u()).optional(),ui_locales_supported:O(u()).optional(),claims_parameter_supported:G().optional(),request_parameter_supported:G().optional(),request_uri_parameter_supported:G().optional(),require_request_uri_registration:G().optional(),op_policy_uri:xe.optional(),op_tos_uri:xe.optional(),client_id_metadata_document_supported:G().optional(),authorization_response_iss_parameter_supported:G().optional().catch(void 0)}),kc=T({...Na.shape,...Oa.pick({code_challenge_methods_supported:!0}).shape}),Cc=T({access_token:u(),id_token:u().optional(),token_type:u(),expires_in:ig().optional(),scope:u().optional(),refresh_token:u().optional()}).strip(),Ic=T({issued_token_type:N("urn:ietf:params:oauth:token-type:id-jag"),access_token:u(),token_type:u().optional(),expires_in:F().optional(),scope:u().optional()}).strip(),Oc=T({error:u(),error_description:u().optional(),error_uri:u().optional()}),oc=xe.optional().or(N("").transform(()=>{return})),ja=T({redirect_uris:O(xe),token_endpoint_auth_method:u().optional(),grant_types:O(u()).optional(),response_types:O(u()).optional(),application_type:u().optional(),client_name:u().optional(),client_uri:xe.optional(),logo_uri:oc,scope:u().optional(),contacts:O(u()).optional(),tos_uri:oc,policy_uri:u().optional(),jwks_uri:xe.optional(),jwks:sp().optional(),software_id:u().optional(),software_version:u().optional(),software_statement:u().optional()}).strip(),qa=T({client_id:u(),client_secret:u().optional(),client_id_issued_at:F().optional(),client_secret_expires_at:F().optional()}).strip(),Nc=ja.merge(qa),jc=T({error:u(),error_description:u().optional()}).strip(),qc=T({token:u(),token_type_hint:u().optional()}).strip();var Lc=Symbol.for("mcp.sdk.errorBrands");function Hc(e,t){let r=new Set,o=t;while(typeof o==="function"){let n=o.mcpBrand;if(Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof n==="string")r.add(n);o=Object.getPrototypeOf(o)}if(r.size===0)return;Object.defineProperty(e,Lc,{value:r,enumerable:!1,configurable:!0})}function Ir(e,t){try{if(typeof t==="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(t,Lc)){let r=t[Lc];if(r&&typeof r.has==="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var _b=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Ir(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Ir(this,t)}constructor(t,r,o){super(r);this.code=t,this.errorUri=o,this.name="OAuthError",Hc(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};if(this.errorUri)t.error_uri=this.errorUri;return t}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},pe=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 Ir(this,e)}static isInstance(e){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Ir(this,e)}constructor(e,t,r){super(t);this.code=e,this.data=r,this.name="SdkError",Hc(this,new.target)}},Sb=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 fp(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function vg(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function Pp(e){switch(e.method){case"elicitation/create":if(e.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;if(t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function Jc(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(fp(n)&&fp(s)){let a={};for(let[i,c]of Object.entries(n))if(c!==void 0&&s[i]===void 0&&!vg(o,i,s))a[i]=c;if(Object.keys(a).length>0)r[o]=a}}return Object.keys(r).length>0?r:void 0}var bg="2026-07-28";function rn(e){return e>=bg}function Ep(e){return e.filter((t)=>!rn(t))}function Bc(e){return e.filter((t)=>rn(t))}function Tp(e){let t=e.structuredContent;if(t===void 0)return e;if(!(typeof t!=="object"||t===null||Array.isArray(t)))return e;if(e.content?.some((r)=>r.type==="text")??!1)return e;return{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var kp=["task","inputRequests","requestState"];function Kc(e){if(e===null||typeof e!=="object"||Array.isArray(e)||e.content!==void 0||kp.some((t)=>(t in e)))return e;return{...e,content:[]}}function zg(){let e=Ro(()=>W([u(),F(),G(),Bt(),B(u(),e),O(e)])),t=B(u(),e),r=W([u(),F().int()]),o=u(),n=T({ttl:F().optional()}),s=T({taskId:u()}),a=oe({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),i=T({_meta:a.optional()}),c=i.extend({task:n.optional()}),l=T({method:u(),params:i.loose().optional()}),m=T({_meta:a.optional()}),g=T({method:u(),params:m.loose().optional()}),z=oe({_meta:a.optional()}),w=W([u(),F().int()]),_=z.strict(),b=m.extend({requestId:w.optional(),reason:u().optional()}),f=g.extend({method:N("notifications/cancelled"),params:b}),d=T({src:u(),mimeType:u().optional(),sizes:O(u()).optional(),theme:ie(["light","dark"]).optional()}),v=T({icons:O(d).optional()}),p=T({name:u(),title:u().optional()}),S=p.extend({...p.shape,...v.shape,version:u(),websiteUrl:u().optional(),description:u().optional()}),P=lt(T({applyDefaults:G().optional()}),t),y=Kt((De)=>{if(De&&typeof De==="object"&&!Array.isArray(De)&&Object.keys(De).length===0)return{form:{}};return De},lt(T({form:P.optional(),url:t.optional()}),t.optional())),h=oe({list:t.optional(),cancel:t.optional(),requests:oe({sampling:oe({createMessage:t.optional()}).optional(),elicitation:oe({create:t.optional()}).optional()}).optional()}),E=oe({list:t.optional(),cancel:t.optional(),requests:oe({tools:oe({call:t.optional()}).optional()}).optional()}),A=T({experimental:B(u(),t).optional(),sampling:T({context:t.optional(),tools:t.optional()}).optional(),elicitation:y.optional(),roots:T({listChanged:G().optional()}).optional(),tasks:h.optional(),extensions:B(u(),t).optional()}),H=i.extend({protocolVersion:u(),capabilities:A,clientInfo:S}),L=l.extend({method:N("initialize"),params:H}),U=T({experimental:B(u(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:T({listChanged:G().optional()}).optional(),resources:T({subscribe:G().optional(),listChanged:G().optional()}).optional(),tools:T({listChanged:G().optional()}).optional(),tasks:E.optional(),extensions:B(u(),t).optional()}),Y=z.extend({protocolVersion:u(),capabilities:U,serverInfo:S,instructions:u().optional()}),K=g.extend({method:N("notifications/initialized"),params:m.optional()}),me=l.extend({method:N("ping"),params:i.optional()}),Re=T({progress:F(),total:Q(F()),message:Q(u())}),ve=T({...m.shape,...Re.shape,progressToken:r}),Oe=g.extend({method:N("notifications/progress"),params:ve}),fe=i.extend({cursor:o.optional()}),I=l.extend({params:fe.optional()}),q=z.extend({nextCursor:o.optional()}),V=T({uri:u(),mimeType:Q(u()),_meta:B(u(),te()).optional()}),R=V.extend({text:u()}),C=u().refine((De)=>{try{return atob(De),!0}catch{return!1}},{message:"Invalid Base64 string"}),j=V.extend({blob:C}),J=ie(["user","assistant"]),re=T({audience:O(J).optional(),priority:F().min(0).max(1).optional(),lastModified:hr({offset:!0}).optional()}),de=T({...p.shape,...v.shape,uri:u(),description:Q(u()),mimeType:Q(u()),size:Q(F()),annotations:re.optional(),_meta:Q(oe({}))}),ae=T({...p.shape,...v.shape,uriTemplate:u(),description:Q(u()),mimeType:Q(u()),annotations:re.optional(),_meta:Q(oe({}))}),be=I.extend({method:N("resources/list")}),Fe=q.extend({resources:O(de)}),k=I.extend({method:N("resources/templates/list")}),x=q.extend({resourceTemplates:O(ae)}),Z=i.extend({uri:u()}),ne=Z,se=l.extend({method:N("resources/read"),params:ne}),ue=z.extend({contents:O(W([R,j]))}),Ce=g.extend({method:N("notifications/resources/list_changed"),params:m.optional()}),je=Z,Le=l.extend({method:N("resources/subscribe"),params:je}),Ne=Z,Pe=l.extend({method:N("resources/unsubscribe"),params:Ne}),Xe=m.extend({uri:u()}),qe=g.extend({method:N("notifications/resources/updated"),params:Xe}),it=T({name:u(),description:Q(u()),required:Q(G())}),et=T({...p.shape,...v.shape,description:Q(u()),arguments:Q(O(it)),_meta:Q(oe({}))}),ct=I.extend({method:N("prompts/list")}),pt=q.extend({prompts:O(et)}),ht=i.extend({name:u(),arguments:B(u(),u()).optional()}),Nt=l.extend({method:N("prompts/get"),params:ht}),jt=T({type:N("text"),text:u(),annotations:re.optional(),_meta:B(u(),te()).optional()}),qt=T({type:N("image"),data:C,mimeType:u(),annotations:re.optional(),_meta:B(u(),te()).optional()}),xt=T({type:N("audio"),data:C,mimeType:u(),annotations:re.optional(),_meta:B(u(),te()).optional()}),xr=T({type:N("tool_use"),name:u(),id:u(),input:B(u(),te()),_meta:B(u(),te()).optional()}),ft=T({type:N("resource"),resource:W([R,j]),annotations:re.optional(),_meta:B(u(),te()).optional()}),Ar=de.extend({type:N("resource_link")}),Qe=W([jt,qt,xt,Ar,ft]),Qt=T({role:J,content:Qe}),er=z.extend({description:u().optional(),messages:O(Qt)}),At=g.extend({method:N("notifications/prompts/list_changed"),params:m.optional()}),Mr=T({title:u().optional(),readOnlyHint:G().optional(),destructiveHint:G().optional(),idempotentHint:G().optional(),openWorldHint:G().optional()}),tr=T({taskSupport:ie(["required","optional","forbidden"]).optional()}),Mt=T({...p.shape,...v.shape,description:u().optional(),inputSchema:T({type:N("object"),properties:B(u(),e).optional(),required:O(u()).optional()}).catchall(te()),outputSchema:T({type:N("object"),properties:B(u(),e).optional(),required:O(u()).optional()}).catchall(te()).optional(),annotations:Mr.optional(),execution:tr.optional(),_meta:B(u(),te()).optional()}),rr=I.extend({method:N("tools/list")}),or=q.extend({tools:O(Mt)}),nr=z.extend({content:O(Qe),structuredContent:B(u(),te()).optional(),isError:G().optional()}),Ze=c.extend({name:u(),arguments:B(u(),te()).optional()}),Lr=l.extend({method:N("tools/call"),params:Ze}),sn=g.extend({method:N("notifications/tools/list_changed"),params:m.optional()}),sr=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),Zr=i.extend({level:sr}),Dr=l.extend({method:N("logging/setLevel"),params:Zr}),Ur=m.extend({level:sr,logger:u().optional(),data:te()}),Vr=g.extend({method:N("notifications/message"),params:Ur}),Fr=T({name:u().optional()}),Hr=T({hints:O(Fr).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),Jr=T({mode:ie(["auto","required","none"]).optional()}),an=T({type:N("tool_result"),toolUseId:u().describe("The unique identifier for the corresponding tool call."),content:O(Qe),structuredContent:T({}).loose().optional(),isError:G().optional(),_meta:B(u(),te()).optional()}),Br=fr("type",[jt,qt,xt]),gt=fr("type",[jt,qt,xt,xr,an]),Kr=T({role:J,content:W([gt,O(gt)]),_meta:B(u(),te()).optional()}),Gr=c.extend({messages:O(Kr),modelPreferences:Hr.optional(),systemPrompt:u().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:O(u()).optional(),metadata:t.optional(),tools:O(Mt).optional(),toolChoice:Jr.optional()}),Wr=l.extend({method:N("sampling/createMessage"),params:Gr}),Yr=z.extend({model:u(),stopReason:Q(ie(["endTurn","stopSequence","maxTokens"]).or(u())),role:J,content:Br}),Xr=z.extend({model:u(),stopReason:Q(ie(["endTurn","stopSequence","maxTokens","toolUse"]).or(u())),role:J,content:W([gt,O(gt)])}),Qr=T({type:N("boolean"),title:u().optional(),description:u().optional(),default:G().optional()}),eo=T({type:N("string"),title:u().optional(),description:u().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:u().optional()}),to=T({type:ie(["number","integer"]),title:u().optional(),description:u().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),ro=T({type:N("string"),title:u().optional(),description:u().optional(),enum:O(u()),default:u().optional()}),oo=T({type:N("string"),title:u().optional(),description:u().optional(),oneOf:O(T({const:u(),title:u()})),default:u().optional()}),no=T({type:N("string"),title:u().optional(),description:u().optional(),enum:O(u()),enumNames:O(u()).optional(),default:u().optional()}),so=W([ro,oo]),Lt=T({type:N("array"),title:u().optional(),description:u().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({type:N("string"),enum:O(u())}),default:O(u()).optional()}),Zt=T({type:N("array"),title:u().optional(),description:u().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({anyOf:O(T({const:u(),title:u()}))}),default:O(u()).optional()}),cn=W([Lt,Zt]),un=W([no,so,cn]),Ge=W([un,Qr,eo,to]),We=c.extend({mode:N("form").optional(),message:u(),requestedSchema:T({type:N("object"),properties:B(u(),Ge),required:O(u()).optional()}).catchall(te())}),ao=c.extend({mode:N("url"),message:u(),elicitationId:u(),url:u().url()}),tt=W([We,ao]),ln=l.extend({method:N("elicitation/create"),params:tt}),dn=m.extend({elicitationId:u()}),mn=g.extend({method:N("notifications/elicitation/complete"),params:dn}),pn=z.extend({action:ie(["accept","decline","cancel"]),content:Kt((De)=>De===null?void 0:De,B(u(),W([u(),F(),G(),O(u())])).optional())}),hn=T({type:N("ref/resource"),uri:u()}),fn=T({type:N("ref/prompt"),name:u()}),gn=i.extend({ref:W([fn,hn]),argument:T({name:u(),value:u()}),context:T({arguments:B(u(),u()).optional()}).optional()}),io=l.extend({method:N("completion/complete"),params:gn}),_n=z.extend({completion:oe({values:O(u()).max(100),total:Q(F().int()),hasMore:Q(G())})}),Sn=T({uri:u().startsWith("file://"),name:u().optional(),_meta:B(u(),te()).optional()}),ar=l.extend({method:N("roots/list"),params:i.optional()}),co=z.extend({roots:O(Sn)}),yn=g.extend({method:N("notifications/roots/list_changed"),params:m.optional()}),vn=oe({ttl:F().optional(),pollInterval:F().optional()}),bn=ie(["working","input_required","completed","failed","cancelled"]),_t=T({taskId:u(),status:bn,ttl:W([F(),Bt()]),createdAt:u(),lastUpdatedAt:u(),pollInterval:Q(F()),statusMessage:Q(u())}),Je=z.extend({task:_t}),zn=m.merge(_t),Dt=g.extend({method:N("notifications/tasks/status"),params:zn}),ir=l.extend({method:N("tasks/get"),params:i.extend({taskId:u()})}),cr=z.merge(_t),ur=l.extend({method:N("tasks/result"),params:i.extend({taskId:u()})}),Ka=z.loose(),Be=I.extend({method:N("tasks/list")}),Ie=q.extend({tasks:O(_t)}),Ut=l.extend({method:N("tasks/cancel"),params:i.extend({taskId:u()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:a,BaseRequestParamsSchema:i,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:m,NotificationSchema:g,ResultSchema:z,RequestIdSchema:w,EmptyResultSchema:_,CancelledNotificationParamsSchema:b,CancelledNotificationSchema:f,IconSchema:d,IconsSchema:v,BaseMetadataSchema:p,ImplementationSchema:S,ClientTasksCapabilitySchema:h,ServerTasksCapabilitySchema:E,ClientCapabilitiesSchema:A,InitializeRequestParamsSchema:H,InitializeRequestSchema:L,ServerCapabilitiesSchema:U,InitializeResultSchema:Y,InitializedNotificationSchema:K,PingRequestSchema:me,ProgressSchema:Re,ProgressNotificationParamsSchema:ve,ProgressNotificationSchema:Oe,PaginatedRequestParamsSchema:fe,PaginatedRequestSchema:I,PaginatedResultSchema:q,ResourceContentsSchema:V,TextResourceContentsSchema:R,BlobResourceContentsSchema:j,RoleSchema:J,AnnotationsSchema:re,ResourceSchema:de,ResourceTemplateSchema:ae,ListResourcesRequestSchema:be,ListResourcesResultSchema:Fe,ListResourceTemplatesRequestSchema:k,ListResourceTemplatesResultSchema:x,ResourceRequestParamsSchema:Z,ReadResourceRequestParamsSchema:ne,ReadResourceRequestSchema:se,ReadResourceResultSchema:ue,ResourceListChangedNotificationSchema:Ce,SubscribeRequestParamsSchema:je,SubscribeRequestSchema:Le,UnsubscribeRequestParamsSchema:Ne,UnsubscribeRequestSchema:Pe,ResourceUpdatedNotificationParamsSchema:Xe,ResourceUpdatedNotificationSchema:qe,PromptArgumentSchema:it,PromptSchema:et,ListPromptsRequestSchema:ct,ListPromptsResultSchema:pt,GetPromptRequestParamsSchema:ht,GetPromptRequestSchema:Nt,TextContentSchema:jt,ImageContentSchema:qt,AudioContentSchema:xt,ToolUseContentSchema:xr,EmbeddedResourceSchema:ft,ResourceLinkSchema:Ar,ContentBlockSchema:Qe,PromptMessageSchema:Qt,GetPromptResultSchema:er,PromptListChangedNotificationSchema:At,ToolAnnotationsSchema:Mr,ToolExecutionSchema:tr,ToolSchema:Mt,ListToolsRequestSchema:rr,ListToolsResultSchema:or,CallToolResultSchema:nr,CallToolRequestParamsSchema:Ze,CallToolRequestSchema:Lr,ToolListChangedNotificationSchema:sn,LoggingLevelSchema:sr,SetLevelRequestParamsSchema:Zr,SetLevelRequestSchema:Dr,LoggingMessageNotificationParamsSchema:Ur,LoggingMessageNotificationSchema:Vr,ModelHintSchema:Fr,ModelPreferencesSchema:Hr,ToolChoiceSchema:Jr,ToolResultContentSchema:an,SamplingContentSchema:Br,SamplingMessageContentBlockSchema:gt,SamplingMessageSchema:Kr,CreateMessageRequestParamsSchema:Gr,CreateMessageRequestSchema:Wr,CreateMessageResultSchema:Yr,CreateMessageResultWithToolsSchema:Xr,BooleanSchemaSchema:Qr,StringSchemaSchema:eo,NumberSchemaSchema:to,UntitledSingleSelectEnumSchemaSchema:ro,TitledSingleSelectEnumSchemaSchema:oo,LegacyTitledEnumSchemaSchema:no,SingleSelectEnumSchemaSchema:so,UntitledMultiSelectEnumSchemaSchema:Lt,TitledMultiSelectEnumSchemaSchema:Zt,MultiSelectEnumSchemaSchema:cn,EnumSchemaSchema:un,PrimitiveSchemaDefinitionSchema:Ge,ElicitRequestFormParamsSchema:We,ElicitRequestURLParamsSchema:ao,ElicitRequestParamsSchema:tt,ElicitRequestSchema:ln,ElicitationCompleteNotificationParamsSchema:dn,ElicitationCompleteNotificationSchema:mn,ElicitResultSchema:pn,ResourceTemplateReferenceSchema:hn,PromptReferenceSchema:fn,CompleteRequestParamsSchema:gn,CompleteRequestSchema:io,CompleteResultSchema:_n,RootSchema:Sn,ListRootsRequestSchema:ar,ListRootsResultSchema:co,RootsListChangedNotificationSchema:yn,TaskCreationParamsSchema:vn,TaskStatusSchema:bn,TaskSchema:_t,CreateTaskResultSchema:Je,TaskStatusNotificationParamsSchema:zn,TaskStatusNotificationSchema:Dt,GetTaskRequestSchema:ir,GetTaskResultSchema:cr,GetTaskPayloadRequestSchema:ur,GetTaskPayloadResultSchema:Ka,ListTasksRequestSchema:Be,ListTasksResultSchema:Ie,CancelTaskRequestSchema:Ut,CancelTaskResultSchema:z.merge(_t),ClientRequestSchema:W([me,L,io,Dr,Nt,ct,be,k,se,Le,Pe,Lr,rr,ir,ur,Be,Ut]),ClientNotificationSchema:W([f,Oe,K,yn,Dt]),ClientResultSchema:W([_,Yr,Xr,pn,co,cr,Ie,Je]),ServerRequestSchema:W([me,Wr,ln,ar,ir,ur,Be,Ut]),ServerNotificationSchema:W([f,Oe,Vr,qe,Ce,sn,At,Dt,mn]),ServerResultSchema:W([_,Y,_n,er,pt,Fe,x,ue,nr,or,cr,Ie,Je]),CallToolResultWireSchema:te().superRefine((De,Ch)=>{if(typeof De!=="object"||De===null||Array.isArray(De)||De.content!==void 0)return;for(let hu of kp)if(hu in De){Ch.addIssue({code:"custom",message:`content is required when the body carries '${hu}' — another result family cannot default into an empty tools/call success`});return}}).transform(Kc).pipe(nr)}}var $g;function Cp(){return $g??=zg()}function Ip(e){return e.type!=="object"}var Rg=new Set(["const","enum","default","examples"]),wg=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function gp(e){return e!==void 0&&!(typeof e==="string"&&e.startsWith("#"))}function Pg(e){let t=typeof e.$schema==="string"?e.$schema:void 0;if(gp(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=_u(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")return n;if(!s&&gp(n.$id))return n;let a={},i=!1;for(let[c,l]of Object.entries(n))if(s)a[c]=o(l,!1);else if((c==="$ref"||c==="$dynamicRef")&&typeof l==="string")a[c]=l==="#"?"#/properties/result":l.startsWith("#/")?`#/properties/result${l.slice(1)}`:l;else if(c==="$recursiveRef"&&l==="#"&&r)i=!0;else if(Rg.has(c))a[c]=l;else if(wg.has(c))a[c]=o(l,!0);else a[c]=o(l,!1);if(i)if("$ref"in a)a.allOf=[...Array.isArray(a.allOf)?a.allOf:[],{$ref:"#/properties/result"}];else a.$ref="#/properties/result";return a};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var Op={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},Np={"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},Eg={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},xa;function Gc(){if(xa)return xa;let e=Cp();return xa={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}},xa}function jp(e){return Object.prototype.hasOwnProperty.call(Op,e)}function qp(e){return Object.prototype.hasOwnProperty.call(Np,e)}function Tg(e){return Object.prototype.hasOwnProperty.call(Eg,e)}function kg(e){return Tg(e)?Gc().resultSchemas[e]:void 0}function Cg(e){return jp(e)?Gc().requestSchemas[e]:void 0}function Ig(e){return qp(e)?Gc().notificationSchemas[e]:void 0}var yb=Object.keys(Op),vb=Object.keys(Np);function Zc(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Aa(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 _p={ok:!1,reason:"not-in-era"};function Sp(e){return Zc(e)&&Zc(e.outputSchema)&&Ip(e.outputSchema)}function yp(e){return e}var Wc={era:"2025-11-25",hasRequestMethod:jp,hasNotificationMethod:qp,validateRequest:(e,t)=>Aa(Cg(e),t),validateResult:(e,t)=>Aa(kg(e),t),validateNotification:(e,t)=>Aa(Ig(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>_p,validateInputResponse:()=>_p,samplingResultVariant:(e,t)=>{let r=Cp();return Aa(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let r=Tp(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!=="object"||o===null||Array.isArray(o),s=t!==void 0&&Ip(t);if(!n&&!s)return r;return{...r,structuredContent:{result:o}}},decodeResult(e,t){if(Zc(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:yp(r)}}return{kind:"complete",result:yp(t)}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;if(!Array.isArray(r)||!r.some((o)=>Sp(o)))return t;return{...t,tools:r.map((o)=>Sp(o)?{...o,outputSchema:Pg(o.outputSchema)}:o)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function Og(){let e=Ro(()=>W([u(),F(),G(),Bt(),B(u(),e),O(e)])),t=B(u(),e),r=W([u(),F().int()]),o=u(),n=W([u(),F().int()]),s=ie(["user","assistant"]),a=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),i=u().refine((Ie)=>{try{return atob(Ie),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=T({ttl:F().optional()}),l=T({taskId:u()}),m=oe({progressToken:r.optional(),"io.modelcontextprotocol/related-task":l.optional()}),g=T({_meta:m.optional()}),z=g.extend({task:c.optional()}),w=T({_meta:m.optional()}),_=T({method:u(),params:w.loose().optional()}),b=T({src:u(),mimeType:u().optional(),sizes:O(u()).optional(),theme:ie(["light","dark"]).optional()}),f=T({icons:O(b).optional()}),d=T({name:u(),title:u().optional()}),v=d.extend({...d.shape,...f.shape,version:u(),websiteUrl:u().optional(),description:u().optional()}),p=lt(T({applyDefaults:G().optional()}),t),S=Kt((Ie)=>{if(Ie&&typeof Ie==="object"&&!Array.isArray(Ie)&&Object.keys(Ie).length===0)return{form:{}};return Ie},lt(T({form:p.optional(),url:t.optional()}),t.optional())),P=oe({list:t.optional(),cancel:t.optional(),requests:oe({sampling:oe({createMessage:t.optional()}).optional(),elicitation:oe({create:t.optional()}).optional()}).optional()}),y=oe({list:t.optional(),cancel:t.optional(),requests:oe({tools:oe({call:t.optional()}).optional()}).optional()}),h=T({experimental:B(u(),t).optional(),sampling:T({context:t.optional(),tools:t.optional()}).optional(),elicitation:S.optional(),roots:T({listChanged:G().optional()}).optional(),tasks:P.optional(),extensions:B(u(),t).optional()}),E=T({experimental:B(u(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:T({listChanged:G().optional()}).optional(),resources:T({subscribe:G().optional(),listChanged:G().optional()}).optional(),tools:T({listChanged:G().optional()}).optional(),tasks:y.optional(),extensions:B(u(),t).optional()}),A=T({progress:F(),total:Q(F()),message:Q(u())}),H=T({...w.shape,...A.shape,progressToken:r}),L=_.extend({method:N("notifications/progress"),params:H}),U=w.extend({level:a,logger:u().optional(),data:te()}),Y=_.extend({method:N("notifications/message"),params:U}),K=T({uri:u(),mimeType:Q(u()),_meta:B(u(),te()).optional()}),me=K.extend({text:u()}),Re=K.extend({blob:i}),ve=T({audience:O(s).optional(),priority:F().min(0).max(1).optional(),lastModified:hr({offset:!0}).optional()}),Oe=T({...d.shape,...f.shape,uri:u(),description:Q(u()),mimeType:Q(u()),size:Q(F()),annotations:ve.optional(),_meta:Q(oe({}))}),fe=T({...d.shape,...f.shape,uriTemplate:u(),description:Q(u()),mimeType:Q(u()),annotations:ve.optional(),_meta:Q(oe({}))}),I=_.extend({method:N("notifications/resources/list_changed"),params:w.optional()}),q=w.extend({uri:u()}),V=_.extend({method:N("notifications/resources/updated"),params:q}),R=T({name:u(),description:Q(u()),required:Q(G())}),C=T({...d.shape,...f.shape,description:Q(u()),arguments:Q(O(R)),_meta:Q(oe({}))}),j=_.extend({method:N("notifications/prompts/list_changed"),params:w.optional()}),J=T({type:N("text"),text:u(),annotations:ve.optional(),_meta:B(u(),te()).optional()}),re=T({type:N("image"),data:i,mimeType:u(),annotations:ve.optional(),_meta:B(u(),te()).optional()}),de=T({type:N("audio"),data:i,mimeType:u(),annotations:ve.optional(),_meta:B(u(),te()).optional()}),ae=T({type:N("tool_use"),name:u(),id:u(),input:B(u(),te()),_meta:B(u(),te()).optional()}),be=T({type:N("resource"),resource:W([me,Re]),annotations:ve.optional(),_meta:B(u(),te()).optional()}),Fe=Oe.extend({type:N("resource_link")}),k=W([J,re,de,Fe,be]),x=T({role:s,content:k}),Z=T({title:u().optional(),readOnlyHint:G().optional(),destructiveHint:G().optional(),idempotentHint:G().optional(),openWorldHint:G().optional()}),ne=_.extend({method:N("notifications/tools/list_changed"),params:w.optional()}),se=T({name:u().optional()}),ue=T({hints:O(se).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),Ce=T({mode:ie(["auto","required","none"]).optional()}),je=T({type:N("boolean"),title:u().optional(),description:u().optional(),default:G().optional()}),Le=T({type:N("string"),title:u().optional(),description:u().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:u().optional()}),Ne=T({type:ie(["number","integer"]),title:u().optional(),description:u().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),Pe=T({type:N("string"),title:u().optional(),description:u().optional(),enum:O(u()),default:u().optional()}),Xe=T({type:N("string"),title:u().optional(),description:u().optional(),oneOf:O(T({const:u(),title:u()})),default:u().optional()}),qe=T({type:N("string"),title:u().optional(),description:u().optional(),enum:O(u()),enumNames:O(u()).optional(),default:u().optional()}),it=W([Pe,Xe]),et=T({type:N("array"),title:u().optional(),description:u().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({type:N("string"),enum:O(u())}),default:O(u()).optional()}),ct=T({type:N("array"),title:u().optional(),description:u().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({anyOf:O(T({const:u(),title:u()}))}),default:O(u()).optional()}),pt=W([et,ct]),ht=W([qe,it,pt]),Nt=W([ht,je,Le,Ne]),jt=z.extend({mode:N("form").optional(),message:u(),requestedSchema:T({type:N("object"),properties:B(u(),Nt),required:O(u()).optional()}).catchall(te())}),qt=T({type:N("ref/resource"),uri:u()}),xt=T({type:N("ref/prompt"),name:u()}),xr=T({uri:u().startsWith("file://"),name:u().optional(),_meta:B(u(),te()).optional()}),ft=h.shape,Ar=T({experimental:ft.experimental,sampling:ft.sampling,elicitation:ft.elicitation,roots:ft.roots,extensions:ft.extensions}),Qe=E.shape,Qt=T({experimental:Qe.experimental,logging:Qe.logging,completions:Qe.completions,prompts:Qe.prompts,resources:Qe.resources,tools:Qe.tools,extensions:Qe.extensions}),er=oe({progressToken:r.optional(),[_r]:u(),[wo]:v.optional(),[wt]:Ar,[Wt]:a.optional()}),At=T({...d.shape,...f.shape,description:u().optional(),inputSchema:oe({$schema:u().optional(),type:N("object")}),outputSchema:oe({$schema:u().optional()}).optional(),annotations:Z.optional(),_meta:B(u(),te()).optional()}),Mr=T({type:N("tool_result"),toolUseId:u(),content:O(k),structuredContent:te().optional(),isError:G().optional(),_meta:B(u(),te()).optional()}),tr=W([J,re,de,ae,Mr]),Mt=T({role:s,content:W([tr,O(tr)]),_meta:B(u(),te()).optional()}),rr=u(),or=oe({[Rt]:v.optional().catch(void 0)}),nr=or.optional();function Ze(Ie){return oe({_meta:nr,resultType:rr.default("complete"),...Ie})}let Lr=Ze({}),sn=Ze({nextCursor:o.optional()}),sr=Ze({content:O(k),structuredContent:te().optional(),isError:G().optional()}),Zr=Ze({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),tools:O(At),nextCursor:o.optional()}),Dr=Ze({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),prompts:O(C),nextCursor:o.optional()}),Ur=Ze({description:u().optional(),messages:O(x)}),Vr=Ze({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resources:O(Oe),nextCursor:o.optional()}),Fr=Ze({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resourceTemplates:O(fe),nextCursor:o.optional()}),Hr=Ze({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),contents:O(W([me,Re]))}),Jr=Ze({completion:T({values:O(u()).max(100),total:F().int().optional(),hasMore:G().optional()}).loose()}),an=Ze({ttlMs:F().int().min(0),cacheScope:ie(["public","private"])}),Br=Ze({ttlMs:F().int().min(0).catch(0),cacheScope:ie(["public","private"]).catch("private"),supportedVersions:O(u()),capabilities:Qt,instructions:u().optional()}),gt=T({messages:O(Mt),modelPreferences:ue.optional(),systemPrompt:u().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:O(u()).optional(),metadata:t.optional(),tools:O(At).optional(),toolChoice:Ce.optional()}),Kr=T({method:N("sampling/createMessage"),params:gt}),Gr=T({method:N("roots/list"),params:T({_meta:B(u(),te()).optional()}).optional()}),Wr=T({...Mt.shape,model:u(),stopReason:u().optional()}),Yr=T({roots:O(xr)}),Xr=T({action:ie(["accept","decline","cancel"]),content:B(u(),W([u(),F(),G(),O(u())])).optional()}),Qr=T({mode:N("url"),message:u(),url:u().url()}),eo=W([jt,Qr]),to=T({method:N("elicitation/create"),params:eo}),ro=W([Kr,Gr,to]),oo=W([Wr,Yr,Xr]),no=B(u(),ro),so=B(u(),oo),Lt=Ze({inputRequests:no.optional(),requestState:u().optional()}),Zt={inputResponses:so.optional(),requestState:u().optional()},cn=T({_meta:er,...Zt}),un=oe({progressToken:r.optional()});function Ge(Ie,Ut){return T({method:N(Ie),params:T({_meta:er,...Ut})})}function We(Ie,Ut){return T({method:N(Ie),params:T({_meta:un.optional(),...Ut}).optional()})}let ao={name:u(),arguments:B(u(),te()).optional(),...Zt},tt={cursor:o.optional()},ln=Ge("tools/call",ao),dn=Ge("tools/list",tt),mn=Ge("prompts/list",tt),pn=Ge("prompts/get",{name:u(),arguments:B(u(),u()).optional(),...Zt}),hn=Ge("resources/list",tt),fn=Ge("resources/templates/list",tt),gn=Ge("resources/read",{uri:u(),...Zt}),io={ref:W([xt,qt]),argument:T({name:u(),value:u()}),context:T({arguments:B(u(),u()).optional()}).optional()},_n=Ge("completion/complete",io),Sn=Ge("server/discover",{}),ar=T({toolsListChanged:G().optional(),promptsListChanged:G().optional(),resourcesListChanged:G().optional(),resourceSubscriptions:O(u()).optional()}),co={notifications:ar},yn=Ge("subscriptions/listen",co),vn=or.extend({"io.modelcontextprotocol/subscriptionId":n}),bn=oe({_meta:vn,resultType:rr.default("complete")}),_t={"tools/call":We("tools/call",ao),"tools/list":We("tools/list",tt),"prompts/get":We("prompts/get",{name:u(),arguments:B(u(),u()).optional()}),"prompts/list":We("prompts/list",tt),"resources/list":We("resources/list",tt),"resources/templates/list":We("resources/templates/list",tt),"resources/read":We("resources/read",{uri:u()}),"completion/complete":We("completion/complete",io),"server/discover":We("server/discover",{}),"subscriptions/listen":We("subscriptions/listen",co)};function Je(Ie){return oe({_meta:nr,...Ie})}let zn={"tools/call":Je({content:O(k),structuredContent:te().optional(),isError:G().optional()}),"tools/list":Je({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),tools:O(At),nextCursor:o.optional()}),"prompts/get":Je({description:u().optional(),messages:O(x)}),"prompts/list":Je({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),prompts:O(C),nextCursor:o.optional()}),"resources/list":Je({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resources:O(Oe),nextCursor:o.optional()}),"resources/templates/list":Je({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resourceTemplates:O(fe),nextCursor:o.optional()}),"resources/read":Je({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),contents:O(W([me,Re]))}),"completion/complete":Je({completion:T({values:O(u()).max(100),total:F().int().optional(),hasMore:G().optional()}).loose()}),"server/discover":Je({ttlMs:F().int().min(0).catch(0),cacheScope:ie(["public","private"]).catch("private"),supportedVersions:O(u()),capabilities:Qt,instructions:u().optional()}),"subscriptions/listen":Je({})},Dt=oe({"io.modelcontextprotocol/subscriptionId":n.optional()}),ir=T({method:N("notifications/subscriptions/acknowledged"),params:T({_meta:Dt.optional(),notifications:ar})}),cr=T({_meta:Dt.optional(),requestId:n,reason:u().optional()}),ur=T({method:N("notifications/cancelled"),params:cr}),Ka={"notifications/cancelled":ur,"notifications/progress":L,"notifications/message":Y,"notifications/resources/updated":V,"notifications/resources/list_changed":I,"notifications/tools/list_changed":ne,"notifications/prompts/list_changed":j,"notifications/subscriptions/acknowledged":ir},Be=(Ie)=>T({jsonrpc:N("2.0"),id:W([u(),F().int()]),result:Ie}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:a,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:m,BaseRequestParamsSchema:g,TaskAugmentedRequestParamsSchema:z,NotificationsParamsSchema:w,NotificationSchema:_,IconSchema:b,IconsSchema:f,BaseMetadataSchema:d,ImplementationSchema:v,ClientTasksCapabilitySchema:P,ServerTasksCapabilitySchema:y,ClientCapabilitiesSchema:h,ServerCapabilitiesSchema:E,ProgressSchema:A,ProgressNotificationParamsSchema:H,ProgressNotificationSchema:L,LoggingMessageNotificationParamsSchema:U,LoggingMessageNotificationSchema:Y,ResourceContentsSchema:K,TextResourceContentsSchema:me,BlobResourceContentsSchema:Re,AnnotationsSchema:ve,ResourceSchema:Oe,ResourceTemplateSchema:fe,ResourceListChangedNotificationSchema:I,ResourceUpdatedNotificationParamsSchema:q,ResourceUpdatedNotificationSchema:V,PromptArgumentSchema:R,PromptSchema:C,PromptListChangedNotificationSchema:j,TextContentSchema:J,ImageContentSchema:re,AudioContentSchema:de,ToolUseContentSchema:ae,EmbeddedResourceSchema:be,ResourceLinkSchema:Fe,ContentBlockSchema:k,PromptMessageSchema:x,ToolAnnotationsSchema:Z,ToolListChangedNotificationSchema:ne,ModelHintSchema:se,ModelPreferencesSchema:ue,ToolChoiceSchema:Ce,BooleanSchemaSchema:je,StringSchemaSchema:Le,NumberSchemaSchema:Ne,UntitledSingleSelectEnumSchemaSchema:Pe,TitledSingleSelectEnumSchemaSchema:Xe,LegacyTitledEnumSchemaSchema:qe,SingleSelectEnumSchemaSchema:it,UntitledMultiSelectEnumSchemaSchema:et,TitledMultiSelectEnumSchemaSchema:ct,MultiSelectEnumSchemaSchema:pt,EnumSchemaSchema:ht,PrimitiveSchemaDefinitionSchema:Nt,ElicitRequestFormParamsSchema:jt,ResourceTemplateReferenceSchema:qt,PromptReferenceSchema:xt,RootSchema:xr,ClientCapabilities2026Schema:Ar,ServerCapabilities2026Schema:Qt,RequestMetaEnvelopeSchema:er,ToolSchema:At,ToolResultContentSchema:Mr,SamplingMessageContentBlockSchema:tr,SamplingMessageSchema:Mt,ResultTypeSchema:rr,ResultMetaSchema:or,ResultSchema:Lr,PaginatedResultSchema:sn,CallToolResultSchema:sr,ListToolsResultSchema:Zr,ListPromptsResultSchema:Dr,GetPromptResultSchema:Ur,ListResourcesResultSchema:Vr,ListResourceTemplatesResultSchema:Fr,ReadResourceResultSchema:Hr,CompleteResultSchema:Jr,CacheableResultSchema:an,DiscoverResultSchema:Br,CreateMessageRequestParamsSchema:gt,CreateMessageRequestSchema:Kr,ListRootsRequestSchema:Gr,CreateMessageResultSchema:Wr,ListRootsResultSchema:Yr,ElicitResultSchema:Xr,ElicitRequestURLParamsSchema:Qr,ElicitRequestParamsSchema:eo,ElicitRequestSchema:to,InputRequestSchema:ro,InputResponseSchema:oo,InputRequestsSchema:no,InputResponsesSchema:so,InputRequiredResultSchema:Lt,InputResponseRequestParamsSchema:cn,CallToolRequestSchema:ln,ListToolsRequestSchema:dn,ListPromptsRequestSchema:mn,GetPromptRequestSchema:pn,ListResourcesRequestSchema:hn,ListResourceTemplatesRequestSchema:fn,ReadResourceRequestSchema:gn,CompleteRequestSchema:_n,DiscoverRequestSchema:Sn,SubscriptionFilterSchema:ar,SubscriptionsListenRequestSchema:yn,SubscriptionsListenResultMetaSchema:vn,SubscriptionsListenResultSchema:bn,dispatchRequestSchemas:_t,dispatchResultSchemas:zn,NotificationMetaSchema:Dt,SubscriptionsAcknowledgedNotificationSchema:ir,CancelledNotificationParamsSchema:cr,CancelledNotificationSchema:ur,notificationSchemas2026:Ka,JSONRPCResultResponseSchema:Be(Lr),CallToolResultResponseSchema:Be(W([sr,Lt])),ListToolsResultResponseSchema:Be(Zr),ListPromptsResultResponseSchema:Be(Dr),GetPromptResultResponseSchema:Be(W([Ur,Lt])),ListResourcesResultResponseSchema:Be(Vr),ListResourceTemplatesResultResponseSchema:Be(Fr),ReadResourceResultResponseSchema:Be(W([Hr,Lt])),CompleteResultResponseSchema:Be(Jr),DiscoverResultResponseSchema:Be(Br)}}var Ng;function Xt(){return Ng??=Og()}var jg=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function qg(e){return jg.includes(e)}var Cr=Symbol("modelcontextprotocol.resultCacheHintFallback");function xp(e,t){if(t===void 0)return e;let r=e[Cr];if(r===void 0)return{...e,[Cr]:t};let o={},n=r.ttlMs??t.ttlMs;if(n!==void 0)o.ttlMs=n;let s=r.cacheScope??t.cacheScope;if(s!==void 0)o.cacheScope=s;return{...e,[Cr]:o}}function xg(e){return e[Cr]}function Yc(e){return typeof e==="number"&&Number.isSafeInteger(e)&&e>=0}function Xc(e){return e==="public"||e==="private"}function Ap(e,t){if(e.ttlMs!==void 0&&!Yc(e.ttlMs))throw RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!Xc(e.cacheScope))throw RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var ee=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}({}),he=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Ir(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Ir(this,t)}constructor(t,r,o){super(r);this.code=t,this.data=o,this.name="ProtocolError",Hc(this,new.target)}static fromError(t,r,o){if(t===ee.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Ag(n.elicitations,r)}if(t===ee.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested==="string")return new Lp({supported:n.supported,requested:n.requested},r)}if(t===ee.InvalidParams||t===ee.ResourceNotFound){let n=o;if(typeof n?.uri==="string"&&(t===ee.ResourceNotFound||Object.keys(n).length===1))return new Mp(n.uri,r)}if(t===ee.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities==="object"&&!Array.isArray(n.requiredCapabilities))return new Qc({requiredCapabilities:n.requiredCapabilities},r)}return new e(t,r,o)}},Mp=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(ee.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Ag=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(ee.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Lp=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(ee.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Qc=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(ee.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Mg=0,Lg="private",Zg=["tools/call","prompts/get","resources/read"];function Dg(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete")return t;if(Zg.includes(e))return t;throw new he(ee.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Ug(e,t){let r=xg(t);if(t.resultType!=="complete"||!qg(e))return r===void 0?t:Bg(t);let o=t,n=Yc(o.ttlMs)?o.ttlMs:Hg(r),s=Xc(o.cacheScope)?o.cacheScope:Jg(r),a={...o,ttlMs:n,cacheScope:s};return delete a[Cr],a}function Vg(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Fg(e,t){if(t===void 0)return e;let r=e._meta;if(r===void 0)return{...e,_meta:{[Rt]:t}};if(!Vg(r))return e;if(r[Rt]!==void 0)return e;return{...e,_meta:{...r,[Rt]:t}}}function Hg(e){return e!==void 0&&Yc(e.ttlMs)?e.ttlMs:Mg}function Jg(e){return e!==void 0&&Xc(e.cacheScope)?e.cacheScope:Lg}function Bg(e){let t={...e};return delete t[Cr],t}var Kg=["elicitation/create","sampling/createMessage","roots/list"],Ma;function Zp(){if(Ma)return Ma;let e=Xt();return Ma={request:{"elicitation/create":T({method:N("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":T({method:N("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":T({method:N("roots/list"),params:oe({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Ma}function Dp(e){return Kg.includes(e)}function xc(e){return Dp(e)?Zp().request[e]:void 0}function Gg(e){return Dp(e)?Zp().response[e]:void 0}var eu={"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},Up={"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 Vp(e){return Object.prototype.hasOwnProperty.call(eu,e)}function Fp(e){return Object.prototype.hasOwnProperty.call(Up,e)}function Wg(e){return Object.prototype.hasOwnProperty.call(eu,e)}function Yg(e){return Vp(e)?Xt().dispatchRequestSchemas[e]:void 0}function Xg(e){return Wg(e)?Xt().dispatchResultSchemas[e]:void 0}function Qg(e){return Fp(e)?Xt().notificationSchemas2026[e]:void 0}var bb=Object.keys(eu),zb=Object.keys(Up);function Qo(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Yo(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 e_={ok:!1,reason:"not-in-era"},t_=[_r,wt];function r_(e,t){let r=t,o=!1,n=()=>{if(!o)r={...r},o=!0;return r},s=t.tools;if(e==="tools/list"&&Array.isArray(s)&&s.some((i)=>Qo(i)&&("execution"in i)))n().tools=s.map((i)=>{if(!Qo(i)||!("execution"in i))return i;let c={...i};return delete c.execution,c});let a=t.capabilities;if(Qo(a)&&"tasks"in a){let i={...a};delete i.tasks,n().capabilities=i}return r}var tu={era:"2026-07-28",hasRequestMethod:Vp,hasNotificationMethod:Fp,hasInputRequestMethod:(e)=>xc(e)!==void 0,validateRequest:(e,t)=>Yo(Yg(e),t),validateResult:(e,t)=>Yo(Xg(e),t),validateNotification:(e,t)=>Yo(Qg(e),t),validateInputRequest:(e,t)=>Yo(xc(e),t),validateInputResponse:(e,t)=>Yo(Gg(e),t),samplingResultVariant:()=>e_,outboundEnvelope(e){return{[_r]:e.protocolVersion,[wo]:e.clientInfo,[wt]:e.clientCapabilities,...e.logLevel!==void 0&&{[Wt]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of t_)if(!(o in e))t.push({key:o,problem:"missing"});let r=Xt().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";if(n.length===1&&t.some((a)=>a.key===s&&a.problem==="missing"))continue;t.push({key:s,problem:o.message})}return t},projectCallToolResult:(e)=>Tp(e),inputRequestSchema:xc,decodeResult(e,t){if(!Qo(t))return{kind:"invalid",error:new le(pe.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new le(pe.InvalidResult,`Invalid result for ${e}: missing required resultType — 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(pe.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let a=t.inputRequests,i=Qo(a)?a:{},c=t.requestState;if(Object.keys(i).length===0&&typeof c!=="string")return{kind:"invalid",error:new le(pe.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"})};return{kind:"input_required",inputRequests:i,...typeof c==="string"&&{requestState:c}}}if(r!=="complete")return{kind:"invalid",error:new le(pe.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=o_(),n=Object.hasOwn(o,e)?o[e]:void 0;if(n!==void 0){let a=n.safeParse(t);if(!a.success)return{kind:"invalid",error:new le(pe.InvalidResult,`Invalid result for ${e}: ${a.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,r){return Fg(Ug(e,Dg(e,r_(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=Xt().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("; ")}`}},La;function o_(){if(La)return La;let e=Xt();return La={"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},La}var ru="2026-07-28";function Or(e){return e!==void 0&&rn(e)?tu:Wc}function vp(e){if(e.revision!==void 0)return Or(e.revision).era;return e.era==="modern"?tu.era:Wc.era}function Ac(e){return Hp.some((t)=>t.hasRequestMethod(e))}function Mc(e){return Hp.some((t)=>t.hasNotificationMethod(e))}var Hp=[Wc,tu];var n_=fu({AnnotationsSchema:()=>mt,AudioContentSchema:()=>wr,BaseMetadataSchema:()=>dt,BaseRequestParamsSchema:()=>Ae,BlobResourceContentsSchema:()=>Lo,BooleanSchemaSchema:()=>Fo,CallToolRequestParamsSchema:()=>Gs,CallToolRequestSchema:()=>Ws,CallToolResultSchema:()=>Vo,CancelTaskRequestSchema:()=>vc,CancelTaskResultSchema:()=>bc,CancelledNotificationParamsSchema:()=>Xn,CancelledNotificationSchema:()=>No,ClientCapabilitiesSchema:()=>rs,ClientNotificationSchema:()=>$c,ClientRequestSchema:()=>zc,ClientResultSchema:()=>Rc,ClientTasksCapabilitySchema:()=>es,CompatibilityCallToolResultSchema:()=>uc,CompleteRequestParamsSchema:()=>$a,CompleteRequestSchema:()=>Ra,CompleteResultSchema:()=>wa,ContentBlockSchema:()=>Pr,CreateMessageRequestParamsSchema:()=>ca,CreateMessageRequestSchema:()=>ua,CreateMessageResultSchema:()=>la,CreateMessageResultWithToolsSchema:()=>da,CreateTaskResultSchema:()=>mc,CursorSchema:()=>Eo,DiscoverRequestSchema:()=>is,DiscoverResultSchema:()=>cs,ElicitRequestFormParamsSchema:()=>kr,ElicitRequestParamsSchema:()=>ga,ElicitRequestSchema:()=>_a,ElicitRequestURLParamsSchema:()=>fa,ElicitResultSchema:()=>va,ElicitationCompleteNotificationParamsSchema:()=>Sa,ElicitationCompleteNotificationSchema:()=>ya,EmbeddedResourceSchema:()=>Zs,EmptyResultSchema:()=>Oo,EnumSchemaSchema:()=>ha,GetPromptRequestParamsSchema:()=>As,GetPromptRequestSchema:()=>Ms,GetPromptResultSchema:()=>Vs,GetTaskPayloadRequestSchema:()=>gc,GetTaskPayloadResultSchema:()=>_c,GetTaskRequestSchema:()=>hc,GetTaskResultSchema:()=>fc,IconSchema:()=>Qn,IconsSchema:()=>Et,ImageContentSchema:()=>Rr,ImplementationSchema:()=>br,InitializeRequestParamsSchema:()=>os,InitializeRequestSchema:()=>ns,InitializeResultSchema:()=>ss,InitializedNotificationSchema:()=>as,JSONArraySchema:()=>ac,JSONObjectSchema:()=>Ee,JSONRPCErrorResponseSchema:()=>vr,JSONRPCMessageSchema:()=>Yn,JSONRPCNotificationSchema:()=>Io,JSONRPCRequestSchema:()=>Co,JSONRPCResponseSchema:()=>ic,JSONRPCResultResponseSchema:()=>yr,JSONValueSchema:()=>$t,LegacyTitledEnumSchemaSchema:()=>Bo,ListChangedOptionsBaseSchema:()=>lc,ListPromptsRequestSchema:()=>qs,ListPromptsResultSchema:()=>xs,ListResourceTemplatesRequestSchema:()=>fs,ListResourceTemplatesResultSchema:()=>gs,ListResourcesRequestSchema:()=>ps,ListResourcesResultSchema:()=>hs,ListRootsRequestSchema:()=>Ea,ListRootsResultSchema:()=>Ta,ListTasksRequestSchema:()=>Sc,ListTasksResultSchema:()=>yc,ListToolsRequestSchema:()=>Bs,ListToolsResultSchema:()=>Ks,LoggingLevelSchema:()=>It,LoggingMessageNotificationParamsSchema:()=>ea,LoggingMessageNotificationSchema:()=>ta,ModelHintSchema:()=>ra,ModelPreferencesSchema:()=>oa,MultiSelectEnumSchemaSchema:()=>pa,NotificationSchema:()=>Ve,NotificationsParamsSchema:()=>Ue,NumberSchemaSchema:()=>Tr,PaginatedRequestParamsSchema:()=>ds,PaginatedRequestSchema:()=>Tt,PaginatedResultSchema:()=>kt,PingRequestSchema:()=>qo,PrimitiveSchemaDefinitionSchema:()=>Wo,ProgressNotificationParamsSchema:()=>ls,ProgressNotificationSchema:()=>xo,ProgressSchema:()=>us,ProgressTokenSchema:()=>Po,PromptArgumentSchema:()=>Ns,PromptListChangedNotificationSchema:()=>Fs,PromptMessageSchema:()=>Us,PromptReferenceSchema:()=>za,PromptSchema:()=>js,ReadResourceRequestParamsSchema:()=>_s,ReadResourceRequestSchema:()=>Ss,ReadResourceResultSchema:()=>ys,RelatedTaskMetadataSchema:()=>Wn,RequestIdSchema:()=>Pt,RequestMetaSchema:()=>To,RequestSchema:()=>Te,ResourceContentsSchema:()=>Ao,ResourceLinkSchema:()=>Ds,ResourceListChangedNotificationSchema:()=>vs,ResourceRequestParamsSchema:()=>zr,ResourceSchema:()=>Zo,ResourceTemplateReferenceSchema:()=>ba,ResourceTemplateSchema:()=>ms,ResourceUpdatedNotificationParamsSchema:()=>Is,ResourceUpdatedNotificationSchema:()=>Os,ResultMetaObjectSchema:()=>ko,ResultSchema:()=>ke,RoleSchema:()=>Ct,RootSchema:()=>Pa,RootsListChangedNotificationSchema:()=>ka,SamplingContentSchema:()=>aa,SamplingMessageContentBlockSchema:()=>Gt,SamplingMessageSchema:()=>ia,ServerCapabilitiesSchema:()=>jo,ServerNotificationSchema:()=>Pc,ServerRequestSchema:()=>wc,ServerResultSchema:()=>Ec,ServerTasksCapabilitySchema:()=>ts,SetLevelRequestParamsSchema:()=>Xs,SetLevelRequestSchema:()=>Qs,SingleSelectEnumSchemaSchema:()=>ma,StringSchemaSchema:()=>Er,SubscribeRequestParamsSchema:()=>bs,SubscribeRequestSchema:()=>zs,SubscriptionFilterSchema:()=>Do,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Es,SubscriptionsAcknowledgedNotificationSchema:()=>Ts,SubscriptionsListenRequestParamsSchema:()=>ws,SubscriptionsListenRequestSchema:()=>Ps,SubscriptionsListenResultMetaSchema:()=>ks,SubscriptionsListenResultSchema:()=>Cs,TaskAugmentedRequestParamsSchema:()=>Yt,TaskCreationParamsSchema:()=>dc,TaskMetadataSchema:()=>Gn,TaskSchema:()=>Ot,TaskStatusNotificationParamsSchema:()=>Ia,TaskStatusNotificationSchema:()=>pc,TaskStatusSchema:()=>Ca,TextContentSchema:()=>$r,TextResourceContentsSchema:()=>Mo,TitledMultiSelectEnumSchemaSchema:()=>Go,TitledSingleSelectEnumSchemaSchema:()=>Jo,ToolAnnotationsSchema:()=>Hs,ToolChoiceSchema:()=>na,ToolExecutionSchema:()=>Js,ToolListChangedNotificationSchema:()=>Ys,ToolResultContentSchema:()=>sa,ToolSchema:()=>Uo,ToolUseContentSchema:()=>Ls,UnsubscribeRequestParamsSchema:()=>$s,UnsubscribeRequestSchema:()=>Rs,UntitledMultiSelectEnumSchemaSchema:()=>Ko,UntitledSingleSelectEnumSchemaSchema:()=>Ho});var Jp=(e)=>Co.safeParse(e).success,Bp=(e)=>Io.safeParse(e).success,Dc=(e)=>yr.safeParse(e).success,Kp=(e)=>vr.safeParse(e).success;var Nr=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";var Za=-32020,$b=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32000],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:[ee.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:[Za,ee.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:[ee.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope — and a missing envelope on a request whose protocol-version header names a modern revision — 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:[ee.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision’s 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:[ee.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:[Za],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s 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–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[ee.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced — 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:[Za],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool’s `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."}],Rb={[ee.ParseError]:400,[ee.InvalidRequest]:400,[ee.MethodNotFound]:404,[ee.UnsupportedProtocolVersion]:400,[ee.MissingRequiredClientCapability]:400,[Za]:400};function Ua(e,t){return Fn(e,t)}function Xo(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function Uc(e){if(e==null)return!1;let t=typeof e;if(t!=="object"&&t!=="function")return!1;if(!("~standard"in e))return!1;return typeof e["~standard"]?.validate==="function"}var bp=!1,Vc="draft-2020-12";function Gp(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:Vc});else if(r.vendor==="zod"){if(!("_zod"in e))throw 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().");if(!bp)bp=!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=Un(e,{target:Vc,io:t})}else throw 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"){if(o.type!==void 0)return o;return Wp(o)?{type:"object",...o}:o}if(o.type!==void 0&&o.type!=="object")throw 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 Wp(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"||Wp(o)))}return!1}function s_(e){if(!e.path?.length)return e.message;return`${e.path.map((t)=>String(typeof t==="object"?t.key:t)).join(".")}: ${e.message}`}async function Da(e,t){let r=await e["~standard"].validate(t);if(r.issues&&r.issues.length>0)return{success:!1,error:r.issues.map((o)=>s_(o)).join(", ")};return{success:!0,data:r.value}}function a_(e){let t=Un(e,{target:Vc,io:"input"});return typeof t.pattern==="string"?t.pattern:void 0}var i_=/\\\.\\d\{(\d+)\}/;function c_(e){let t=i_.exec(e),r=[void 0,-1,0];if(t)r.push(Number(t[1]));return[!1,!0].flatMap((o)=>[!1,!0].flatMap((n)=>r.map((s)=>hr({local:o,offset:n,precision:s}))))}function u_(e,t){let r;switch(e){case"email":r=[rp()];break;case"uri":r=[Jn()];break;case"date":r=[tc()];break;case"date-time":r=c_(t);break}return new Set(r.map((o)=>a_(o)).filter((o)=>o!==void 0))}function l_(e,t,r){if(r!=="zod")return!0;return u_(e,t).has(t)}function tn(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function d_(e){try{return Gp(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new he(ee.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var m_=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function ou(e){return m_.has(e)||e.startsWith("x-")}var p_=new Set(["$schema",...Object.keys(kr.shape.requestedSchema.shape)]),zp={string:Xo([Er,Ho,Jo,Bo]),number:Xo([Tr]),integer:Xo([Tr]),boolean:Xo([Fo]),array:Xo([Ko,Go])},h_=new Set(Er.shape.format.unwrap().options);function f_(e,t,r,o){if(!tn(e))return e;let n=typeof e.type==="string"&&Object.hasOwn(zp,e.type)?zp[e.type]:void 0;if(n===void 0)return e;let s={};for(let[a,i]of Object.entries(e))if(n.has(a)||ou(a))s[a]=i;else if(a==="pattern"&&e.type==="string"&&typeof e.format==="string"){if(!h_.has(e.format))s[a]=i;else if(typeof i!=="string"||!l_(e.format,i,r))o.push(`${t}.${a}`)}else o.push(`${t}.${a}`);return s}function g_(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))if(n==="properties"&&tn(s))r[n]=Object.fromEntries(Object.entries(s).map(([a,i])=>[a,f_(i,`properties.${a}`,t,o)]));else if(p_.has(n))r[n]=s;else if(!ou(n))o.push(n);if(o.length>0)throw new he(ee.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function __(e,t){if(!tn(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!Ua(Wo,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function Fc(e,t,r=""){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((o,n)=>Fc(o,t[n],`${r}[${n}]`));if(!tn(e)||!tn(t))return[];return Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;if(!Object.prototype.hasOwnProperty.call(t,o))return ou(o)?[]:[s];return Fc(n,t[o],s)})}function S_(e){if(!Uc(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=g_(d_(e.requestedSchema),t),o=Ua(kr.shape.requestedSchema,r);if(!o.success)throw new he(ee.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${__(r,o.error.message)}`);let n=Fc(r,o.data);if(n.length>0)throw new he(ee.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(o.data.required??[]).filter((a)=>!Object.prototype.hasOwnProperty.call(o.data.properties,a));if(s.length>0)throw new he(ee.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function y_(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState==="string";if(!t&&!r)throw 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 wb=Object.assign(y_,{elicit(e){try{return{method:"elicitation/create",params:S_(e)}}catch(t){throw t instanceof he?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 Yp=250;function Xp(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Qp(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof le?t.reason:new le(pe.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(pe.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function eh(e){let t=new AbortController,r=()=>t.abort(e?.reason);if(e?.addEventListener("abort",r,{once:!0}),e?.aborted)t.abort(e.reason);return{signal:t.signal,abort:(o)=>t.abort(o),dispose:()=>e?.removeEventListener("abort",r)}}var v_=["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"],b_={IdJagTokenExchangeResponseSchema:Ic,OAuthClientInformationFullSchema:Nc,OAuthClientInformationSchema:qa,OAuthClientMetadataSchema:ja,OAuthClientRegistrationErrorSchema:jc,OAuthErrorResponseSchema:Oc,OAuthMetadataSchema:Oa,OAuthProtectedResourceMetadataSchema:Tc,OAuthTokenRevocationRequestSchema:qc,OAuthTokensSchema:Cc,OpenIdProviderDiscoveryMetadataSchema:kc,OpenIdProviderMetadataSchema:Na},th={},rh={};function oh(e,t){let r=e.slice(0,-6);th[r]=t,rh[r]=(o)=>t.safeParse(o).success}for(let e of v_)oh(e,n_[e]);for(let[e,t]of Object.entries(b_))oh(e,t);var Pb=Object.freeze(th),Eb=Object.freeze(rh);function z_(e){switch(e){case"initialize":case"notifications/initialized":return Or(void 0);case"server/discover":return Or(ru);default:return}}var $_=60000,R_=[_r,wo,wt,Wt],w_=["inputResponses","requestState"];function $p(e,t){let r=e.params;if(!en(r))return{message:e,lifted:{}};let o=r._meta,n=en(o)?R_.filter((c)=>(c in o)):[],s=t==="request"?w_.filter((c)=>(c in r)):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let a={},i={...r};if(n.length>0&&en(o)){let c={},l={...o};for(let m of n)c[m]=o[m],delete l[m];if(a.envelope=c,Object.keys(l).length>0)i._meta=l;else delete i._meta}for(let c of s){if(c==="inputResponses")a.inputResponses=i[c];if(c==="requestState")a.requestState=i[c];delete i[c]}return{message:{...e,params:i},lifted:a}}function Rp(e,t){let r=e.validateResult(t,void 0);if(!r.ok&&r.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let n=e.validateResult(t,o);if(n.ok)return{value:n.value};return{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function on(e){return()=>e}var P_=on(void 0);function nu(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:on(t)}}}var E_;var nh=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{E_=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??nc,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(pe.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){if(!e.params.requestId)return;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(pe.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);if(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)=>{if(o?.(n,s),Dc(n)||Kp(n))this._onresponse(n);else if(Jp(n))this._onrequest(n,s);else if(Bp(n))this._onnotification(n,s);else this._onerror(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(pe.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}=$p(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let a=vp(t.classification);if(a!==o.era){this._onerror(Error(`Era mismatch on inbound notification '${r.method}': classified as ${a} but this instance serves ${o.era}`));return}}if(Mc(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;if(n===void 0&&s===void 0)return;Promise.resolve().then(()=>n===void 0?s(r):n(r,o)).catch((a)=>this._onerror(Error(`Uncaught error in notification handler: ${a}`)))}_onrequest(e,t){let{message:r,lifted:o}=$p(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,a=(b,f,d)=>{let v={jsonrpc:"2.0",id:r.id,error:{code:b,message:f,...d!==void 0&&{data:d}}};s?.send(v).catch((p)=>this._onerror(Error(`Failed to send an error response: ${p}`)))};if(t?.classification!==void 0){let b=vp(t.classification);if(b!==n.era){this._onerror(Error(`Era mismatch on inbound request '${r.method}': classified as ${b} but this instance serves ${n.era}`));let f=t.classification.revision??b;a(ee.UnsupportedProtocolVersion,`Unsupported protocol version: ${f}`,{supported:this._supportedProtocolVersions,requested:f});return}}if(Ac(r.method)&&!n.hasRequestMethod(r.method)){a(ee.MethodNotFound,"Method not found");return}let i=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(i===void 0){a(ee.MethodNotFound,"Method not found");return}let c=n.checkInboundEnvelope(o);if(c!==void 0){a(ee.InvalidParams,c);return}let l=(b,f)=>this._notificationViaCodec(this._resolveOutboundCodec(b.method),b,{...f,relatedRequestId:r.id}),m=(b,f,d)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(b.method),b,f,{...d,relatedRequestId:r.id}),g=new AbortController;this._requestHandlerAbortControllers.set(r.id,g);let z=o.inputResponses===void 0?void 0:T_(o.inputResponses),w={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...z!==void 0&&{inputResponses:z.accepted},...z!==void 0&&z.droppedKeys.length>0&&{droppedInputResponseKeys:z.droppedKeys},requestState:o.requestState===void 0?P_:on(o.requestState),signal:g.signal,send:(b,f,d)=>{let v=this._resolveOutboundCodec(b.method);if(this._assertOutboundRequestInEra(v,b.method),Uc(f))return m(b,f,d);let p=Rp(v,b.method);if(p===void 0)throw TypeError(`'${b.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return m(b,p,f)},notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},_=this.buildContext(w,t);Promise.resolve().then(()=>i(r,_)).then(async(b)=>{if(g.signal.aborted)return;let f;try{f=n.encodeResult(r.method,b,this._outboundServerInfo())}catch(v){this._onerror(Error(`Failed to encode result for ${r.method}: ${v}`)),a(ee.InternalError,"Internal error");return}let d={result:f,jsonrpc:"2.0",id:r.id};await s?.send(d)},async(b)=>{if(g.signal.aborted)return;let f=Number.isSafeInteger(b.code)?b.code:ee.InternalError,d={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(f),message:b.message??"Internal error",...b.data!==void 0&&{data:b.data}}};await s?.send(d)}).catch((b)=>this._onerror(Error(`Failed to send response: ${b}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(r.id)===g)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(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(i){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(i);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Dc(e))r(e);else r(he.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),Uc(t))return this._requestWithSchemaViaCodec(o,e,t,r);let n=Rp(o,e.method);if(n===void 0)throw 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 Or(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=z_(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Ac(t)&&!e.hasRequestMethod(t))throw new le(pe.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:a,headers:i}=o??{},c=Date.now(),l,m;return new Promise((g,z)=>{let w=(y)=>{z(y)};if(!this._transport){w(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(y){w(y);return}if(o?.signal?.aborted){let y=o.signal.reason;throw y instanceof le?y:new le(pe.RequestTimeout,String(y))}let _=e.era===ru&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,b=this._requestMessageId++;m=b;let f={...t,jsonrpc:"2.0",id:b};if(o?.onprogress)this._progressHandlers.set(b,o.onprogress),f.params={...t.params,_meta:{...t.params?._meta,progressToken:b}};let d=this._envelopeOutbound(f),v=!1,p=(y)=>{if(v)return;if(this._progressHandlers.delete(b),_===void 0)this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:b,reason:String(y)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:a}).catch((h)=>this._onerror(Error(`Failed to send cancellation: ${h}`)));else _.abort();z(y instanceof le?y:new le(pe.RequestTimeout,String(y)))};this._responseHandlers.set(b,(y)=>{if(o?.signal?.aborted)return;if(v=!0,y instanceof Error)return z(y);let h;try{h=e.decodeResult(t.method,y.result)}catch(A){return z(A instanceof Error?A:Error(String(A)))}if(h.kind==="invalid")return z(h.error);if(h.kind==="input_required"){if(o?.allowInputRequired===!0)return g(k_(h));let A={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:c,retry:(H,L)=>this._requestWithSchemaViaCodec(e,H===void 0?{method:t.method}:{method:t.method,params:H},r,L)};return g(this._resolveNonCompleteResult(h,A))}let E=h.result;Da(r,E).then((A)=>{if(A.success)g(A.data);else z(new le(pe.InvalidResult,`Invalid result for ${t.method}: ${A.error}`))},z)}),l=()=>p(o?.signal?.reason),o?.signal?.addEventListener("abort",l,{once:!0});let S=o?.timeout??$_,P=()=>p(new le(pe.RequestTimeout,"Request timed out",{timeout:S}));this._setupTimeout(b,S,o?.maxTotalTimeout,P,o?.resetTimeoutOnProgress??!1),this._transport.send(d,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:a,headers:i,requestSignal:_?.signal}).catch((y)=>{this._progressHandlers.delete(b),z(y)})}).finally(()=>{if(l)o?.signal?.removeEventListener("abort",l);if(m!==void 0)this._responseHandlers.delete(m),this._cleanupTimeout(m)})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new le(pe.NotConnected,"Not connected");if(Mc(t.method)&&!e.hasNotificationMethod(t.method))throw new le(pe.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(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;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(!Ac(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,s)=>{let a=this._negotiatedWireCodec(),i=a.validateRequest(e,n);if(!i.ok&&i.reason==="not-in-era")i=a.validateInputRequest(e,n);if(!i.ok){if(i.reason==="not-in-era")throw new he(ee.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(i.message)}return Promise.resolve(t(i.value,s))}}else if(r)o=async(n,s)=>{let a=await Da(t.params,{...n.params});if(!a.success)throw new he(ee.InvalidParams,`Invalid params for ${e}: ${a.error}`);return r(a.data,s)};else throw 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 Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if(typeof t==="function"){if(!Mc(e))throw 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){if(s.reason==="not-in-era")throw new he(ee.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(s.message)}return Promise.resolve(t(s.value))});return}if(!r)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async(o)=>{let n=await Da(t.params,{...o.params});if(!n.success)throw new he(ee.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function en(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function sh(e,t){let r={...e};for(let o in t){let n=o,s=t[n];if(s===void 0)continue;let a=r[n];r[n]=en(a)&&en(s)?{...a,...s}:s}return r}function wp(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function T_(e){let t={},r=[];if(!wp(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!wp(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function k_(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}/*!
|
|
66
66
|
* content-type
|
|
67
67
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
68
68
|
* MIT Licensed
|
|
69
|
-
*/var
|
|
70
|
-
`);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return
|
|
71
|
-
`}var Ka=D((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(d){super();if(!e.IDENTIFIER.test(d))throw Error("CodeGen: name must be a valid identifier");this.str=d}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(d){super();this._items=typeof d==="string"?[d]:d}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let d=this._items[0];return d===""||d==='""'}get str(){var d;return(d=this._str)!==null&&d!==void 0?d:this._str=this._items.reduce((v,p)=>`${v}${p}`,"")}get names(){var d;return(d=this._names)!==null&&d!==void 0?d:this._names=this._items.reduce((v,p)=>{if(p instanceof r)v[p.str]=(v[p.str]||0)+1;return v},{})}};e._Code=o,e.nil=new o("");function n(d,...v){let p=[d[0]],S=0;while(S<v.length)i(p,v[S]),p.push(d[++S]);return new o(p)}e._=n;let s=new o("+");function a(d,...v){let p=[w(d[0])],S=0;while(S<v.length)p.push(s),i(p,v[S]),p.push(s,w(d[++S]));return c(p),new o(p)}e.str=a;function i(d,v){if(v instanceof o)d.push(...v._items);else if(v instanceof r)d.push(v);else d.push(g(v))}e.addCodeArg=i;function c(d){let v=1;while(v<d.length-1){if(d[v]===s){let p=l(d[v-1],d[v+1]);if(p!==void 0){d.splice(v-1,3,p);continue}d[v++]="+"}v++}}function l(d,v){if(v==='""')return d;if(d==='""')return v;if(typeof d=="string"){if(v instanceof r||d[d.length-1]!=='"')return;if(typeof v!="string")return`${d.slice(0,-1)}${v}"`;if(v[0]==='"')return d.slice(0,-1)+v.slice(1);return}if(typeof v=="string"&&v[0]==='"'&&!(d instanceof r))return`"${d}${v.slice(1)}`}function m(d,v){return v.emptyStr()?d:d.emptyStr()?v:a`${d}${v}`}e.strConcat=m;function g(d){return typeof d=="number"||typeof d=="boolean"||d===null?d:w(Array.isArray(d)?d.join(","):d)}function z(d){return new o(w(d))}e.stringify=z;function w(d){return JSON.stringify(d).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=w;function _(d){return typeof d=="string"&&e.IDENTIFIER.test(d)?new o(`.${d}`):n`[${d}]`}e.getProperty=_;function b(d){if(typeof d=="string"&&e.IDENTIFIER.test(d))return new o(`${d}`);throw Error(`CodeGen: invalid export name: ${d}, use explicit $id name mapping`)}e.getEsmExportName=b;function f(d){return new o(d.toString())}e.regexpCode=f}),Th=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=Ka();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:l}={}){this._names={},this._prefixes=c,this._parent=l}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){let l=this._names[c]||this._nameGroup(c);return`${c}${l.index++}`}_nameGroup(c){var l,m;if(((m=(l=this._parent)===null||l===void 0?void 0:l._prefixes)===null||m===void 0?void 0:m.has(c))||this._prefixes&&!this._prefixes.has(c))throw 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,l){super(l);this.prefix=c}setValue(c,{property:l,itemIndex:m}){this.value=c,this.scopePath=t._`.${new t.Name(l)}[${m}]`}};e.ValueScopeName=s;let a=t._`\n`;var i=class extends n{constructor(c){super(c);this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?a:t.nil}}get(){return this._scope}name(c){return new s(c,this._newName(c))}value(c,l){var m;if(l.ref===void 0)throw Error("CodeGen: ref must be passed in value");let g=this.toName(c),{prefix:z}=g,w=(m=l.key)!==null&&m!==void 0?m:l.ref,_=this._values[z];if(_){let d=_.get(w);if(d)return d}else _=this._values[z]=new Map;_.set(w,g);let b=this._scope[z]||(this._scope[z]=[]),f=b.length;return b[f]=l.ref,g.setValue(l,{property:z,itemIndex:f}),g}getValue(c,l){let m=this._values[c];if(!m)return;return m.get(l)}scopeRefs(c,l=this._values){return this._reduceValues(l,(m)=>{if(m.scopePath===void 0)throw Error(`CodeGen: name "${m}" has no value`);return t._`${c}${m.scopePath}`})}scopeCode(c=this._values,l,m){return this._reduceValues(c,(g)=>{if(g.value===void 0)throw Error(`CodeGen: name "${g}" has no value`);return g.value.code},l,m)}_reduceValues(c,l,m={},g){let z=t.nil;for(let w in c){let _=c[w];if(!_)continue;let b=m[w]=m[w]||new Map;_.forEach((f)=>{if(b.has(f))return;b.set(f,o.Started);let d=l(f);if(d){let v=this.opts.es5?e.varKinds.var:e.varKinds.const;z=t._`${z}${v} ${f} = ${d};${this.opts._n}`}else if(d=g===null||g===void 0?void 0:g(f))z=t._`${z}${d}${this.opts._n}`;else throw new r(f);b.set(f,o.Completed)})}return z}};e.ValueScope=i}),ce=D((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=Ka(),r=Th();var o=Ka();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=Th();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(R,C){return this}},a=class extends s{constructor(R,C,j){super();this.varKind=R,this.name=C,this.rhs=j}render({es5:R,_n:C}){let j=R?r.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${j} ${this.name}${J};`+C}optimizeNames(R,C){if(!R[this.name.str])return;if(this.rhs)this.rhs=K(this.rhs,R,C);return this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},i=class extends s{constructor(R,C,j){super();this.lhs=R,this.rhs=C,this.sideEffects=j}render({_n:R}){return`${this.lhs} = ${this.rhs};`+R}optimizeNames(R,C){if(this.lhs instanceof t.Name&&!R[this.lhs.str]&&!this.sideEffects)return;return this.rhs=K(this.rhs,R,C),this}get names(){return Y(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends i{constructor(R,C,j,J){super(R,j,J);this.op=C}render({_n:R}){return`${this.lhs} ${this.op}= ${this.rhs};`+R}},l=class extends s{constructor(R){super();this.label=R,this.names={}}render({_n:R}){return`${this.label}:`+R}},m=class extends s{constructor(R){super();this.label=R,this.names={}}render({_n:R}){return`break${this.label?` ${this.label}`:""};`+R}},g=class extends s{constructor(R){super();this.error=R}render({_n:R}){return`throw ${this.error};`+R}get names(){return this.error.names}},z=class extends s{constructor(R){super();this.code=R}render({_n:R}){return`${this.code};`+R}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(R,C){return this.code=K(this.code,R,C),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},w=class extends s{constructor(R=[]){super();this.nodes=R}render(R){return this.nodes.reduce((C,j)=>C+j.render(R),"")}optimizeNodes(){let{nodes:R}=this,C=R.length;while(C--){let j=R[C].optimizeNodes();if(Array.isArray(j))R.splice(C,1,...j);else if(j)R[C]=j;else R.splice(C,1)}return R.length>0?this:void 0}optimizeNames(R,C){let{nodes:j}=this,J=j.length;while(J--){let te=j[J];if(te.optimizeNames(R,C))continue;me(R,te.names),j.splice(J,1)}return j.length>0?this:void 0}get names(){return this.nodes.reduce((R,C)=>U(R,C.names),{})}},_=class extends w{render(R){return"{"+R._n+super.render(R)+"}"+R._n}},b=class extends w{},f=class extends _{};f.kind="else";var d=class R extends _{constructor(C,j){super(j);this.condition=C}render(C){let j=`if(${this.condition})`+super.render(C);if(this.else)j+="else "+this.else.render(C);return j}optimizeNodes(){super.optimizeNodes();let C=this.condition;if(C===!0)return this.nodes;let j=this.else;if(j){let J=j.optimizeNodes();j=this.else=Array.isArray(J)?new f(J):J}if(j){if(C===!1)return j instanceof R?j:j.nodes;if(this.nodes.length)return this;return new R(we(C),j instanceof R?[j]:j.nodes)}if(C===!1||!this.nodes.length)return;return this}optimizeNames(C,j){var J;if(this.else=(J=this.else)===null||J===void 0?void 0:J.optimizeNames(C,j),!(super.optimizeNames(C,j)||this.else))return;return this.condition=K(this.condition,C,j),this}get names(){let C=super.names;if(Y(C,this.condition),this.else)U(C,this.else.names);return C}};d.kind="if";var v=class extends _{};v.kind="for";var p=class extends v{constructor(R){super();this.iteration=R}render(R){return`for(${this.iteration})`+super.render(R)}optimizeNames(R,C){if(!super.optimizeNames(R,C))return;return this.iteration=K(this.iteration,R,C),this}get names(){return U(super.names,this.iteration.names)}},S=class extends v{constructor(R,C,j,J){super();this.varKind=R,this.name=C,this.from=j,this.to=J}render(R){let C=R.es5?r.varKinds.var:this.varKind,{name:j,from:J,to:te}=this;return`for(${C} ${j}=${J}; ${j}<${te}; ${j}++)`+super.render(R)}get names(){return Y(Y(super.names,this.from),this.to)}},P=class extends v{constructor(R,C,j,J){super();this.loop=R,this.varKind=C,this.name=j,this.iterable=J}render(R){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(R)}optimizeNames(R,C){if(!super.optimizeNames(R,C))return;return this.iterable=K(this.iterable,R,C),this}get names(){return U(super.names,this.iterable.names)}},y=class extends _{constructor(R,C,j){super();this.name=R,this.args=C,this.async=j}render(R){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(R)}};y.kind="func";var h=class extends w{render(R){return"return "+super.render(R)}};h.kind="return";var E=class extends _{render(R){let C="try"+super.render(R);if(this.catch)C+=this.catch.render(R);if(this.finally)C+=this.finally.render(R);return C}optimizeNodes(){var R,C;return super.optimizeNodes(),(R=this.catch)===null||R===void 0||R.optimizeNodes(),(C=this.finally)===null||C===void 0||C.optimizeNodes(),this}optimizeNames(R,C){var j,J;return super.optimizeNames(R,C),(j=this.catch)===null||j===void 0||j.optimizeNames(R,C),(J=this.finally)===null||J===void 0||J.optimizeNames(R,C),this}get names(){let R=super.names;if(this.catch)U(R,this.catch.names);if(this.finally)U(R,this.finally.names);return R}},A=class extends _{constructor(R){super();this.error=R}render(R){return`catch(${this.error})`+super.render(R)}};A.kind="catch";var H=class extends _{render(R){return"finally"+super.render(R)}};H.kind="finally";var L=class{constructor(R,C={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...C,_n:C.lines?`
|
|
72
|
-
`:""},this._extScope=R,this._scope=new r.Scope({parent:R}),this._nodes=[new b]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,C){let j=this._extScope.value(R,C);return(this._values[j.prefix]||(this._values[j.prefix]=new Set)).add(j),j}getScopeValue(R,C){return this._extScope.getValue(R,C)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,C,j,J){let te=this._scope.toName(C);if(j!==void 0&&J)this._constants[te.str]=j;return this._leafNode(new a(R,te,j)),te}const(R,C,j){return this._def(r.varKinds.const,R,C,j)}let(R,C,j){return this._def(r.varKinds.let,R,C,j)}var(R,C,j){return this._def(r.varKinds.var,R,C,j)}assign(R,C,j){return this._leafNode(new i(R,C,j))}add(R,C){return this._leafNode(new c(R,e.operators.ADD,C))}code(R){if(typeof R=="function")R();else if(R!==t.nil)this._leafNode(new z(R));return this}object(...R){let C=["{"];for(let[j,J]of R){if(C.length>1)C.push(",");if(C.push(j),j!==J||this.opts.es5)C.push(":"),(0,t.addCodeArg)(C,J)}return C.push("}"),new t._Code(C)}if(R,C,j){if(this._blockNode(new d(R)),C&&j)this.code(C).else().code(j).endIf();else if(C)this.code(C).endIf();else if(j)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new d(R))}else(){return this._elseNode(new f)}endIf(){return this._endBlockNode(d,f)}_for(R,C){if(this._blockNode(R),C)this.code(C).endFor();return this}for(R,C){return this._for(new p(R),C)}forRange(R,C,j,J,te=this.opts.es5?r.varKinds.var:r.varKinds.let){let de=this._scope.toName(R);return this._for(new S(te,de,C,j),()=>J(de))}forOf(R,C,j,J=r.varKinds.const){let te=this._scope.toName(R);if(this.opts.es5){let de=C instanceof t.Name?C:this.var("_arr",C);return this.forRange("_i",0,t._`${de}.length`,(ae)=>{this.var(te,t._`${de}[${ae}]`),j(te)})}return this._for(new P("of",J,te,C),()=>j(te))}forIn(R,C,j,J=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(R,t._`Object.keys(${C})`,j);let te=this._scope.toName(R);return this._for(new P("in",J,te,C),()=>j(te))}endFor(){return this._endBlockNode(v)}label(R){return this._leafNode(new l(R))}break(R){return this._leafNode(new m(R))}return(R){let C=new h;if(this._blockNode(C),this.code(R),C.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(h)}try(R,C,j){if(!C&&!j)throw Error('CodeGen: "try" without "catch" and "finally"');let J=new E;if(this._blockNode(J),this.code(R),C){let te=this.name("e");this._currNode=J.catch=new A(te),C(te)}if(j)this._currNode=J.finally=new H,this.code(j);return this._endBlockNode(A,H)}throw(R){return this._leafNode(new g(R))}block(R,C){if(this._blockStarts.push(this._nodes.length),R)this.code(R).endBlock(C);return this}endBlock(R){let C=this._blockStarts.pop();if(C===void 0)throw Error("CodeGen: not in self-balancing block");let j=this._nodes.length-C;if(j<0||R!==void 0&&j!==R)throw Error(`CodeGen: wrong number of nodes: ${j} vs ${R} expected`);return this._nodes.length=C,this}func(R,C=t.nil,j,J){if(this._blockNode(new y(R,C,j)),J)this.code(J).endFunc();return this}endFunc(){return this._endBlockNode(y)}optimize(R=1){while(R-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,C){let j=this._currNode;if(j instanceof R||C&&j instanceof C)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${C?`${R.kind}/${C.kind}`:R.kind}"`)}_elseNode(R){let C=this._currNode;if(!(C instanceof d))throw Error('CodeGen: "else" without "if"');return this._currNode=C.else=R,this}get _root(){return this._nodes[0]}get _currNode(){let R=this._nodes;return R[R.length-1]}set _currNode(R){let C=this._nodes;C[C.length-1]=R}};e.CodeGen=L;function U(R,C){for(let j in C)R[j]=(R[j]||0)+(C[j]||0);return R}function Y(R,C){return C instanceof t._CodeOrName?U(R,C.names):R}function K(R,C,j){if(R instanceof t.Name)return J(R);if(!te(R))return R;return new t._Code(R._items.reduce((de,ae)=>{if(ae instanceof t.Name)ae=J(ae);if(ae instanceof t._Code)de.push(...ae._items);else de.push(ae);return de},[]));function J(de){let ae=j[de.str];if(ae===void 0||C[de.str]!==1)return de;return delete C[de.str],ae}function te(de){return de instanceof t._Code&&de._items.some((ae)=>ae instanceof t.Name&&C[ae.str]===1&&j[ae.str]!==void 0)}}function me(R,C){for(let j in C)R[j]=(R[j]||0)-(C[j]||0)}function we(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:t._`!${V(R)}`}e.not=we;let ze=q(e.operators.AND);function Ne(...R){return R.reduce(ze)}e.and=Ne;let fe=q(e.operators.OR);function I(...R){return R.reduce(fe)}e.or=I;function q(R){return(C,j)=>C===t.nil?j:j===t.nil?C:t._`${V(C)} ${R} ${V(j)}`}function V(R){return R instanceof t.Name?R:t._`(${R})`}}),ge=D((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=ce(),r=Ka();function o(y){let h={};for(let E of y)h[E]=!0;return h}e.toHash=o;function n(y,h){if(typeof h=="boolean")return h;if(Object.keys(h).length===0)return!0;return s(y,h),!a(h,y.self.RULES.all)}e.alwaysValidSchema=n;function s(y,h=y.schema){let{opts:E,self:A}=y;if(!E.strictSchema)return;if(typeof h==="boolean")return;let H=A.RULES.keywords;for(let L in h)if(!H[L])P(y,`unknown keyword: "${L}"`)}e.checkUnknownRules=s;function a(y,h){if(typeof y=="boolean")return!y;for(let E in y)if(h[E])return!0;return!1}e.schemaHasRules=a;function i(y,h){if(typeof y=="boolean")return!y;for(let E in y)if(E!=="$ref"&&h.all[E])return!0;return!1}e.schemaHasRulesButRef=i;function c({topSchemaRef:y,schemaPath:h},E,A,H){if(!H){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return t._`${E}`}return t._`${y}${h}${(0,t.getProperty)(A)}`}e.schemaRefOrVal=c;function l(y){return z(decodeURIComponent(y))}e.unescapeFragment=l;function m(y){return encodeURIComponent(g(y))}e.escapeFragment=m;function g(y){if(typeof y=="number")return`${y}`;return y.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=g;function z(y){return y.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=z;function w(y,h){if(Array.isArray(y))for(let E of y)h(E);else h(y)}e.eachItem=w;function _({mergeNames:y,mergeToName:h,mergeValues:E,resultToName:A}){return(H,L,U,Y)=>{let K=U===void 0?L:U instanceof t.Name?(L instanceof t.Name?y(H,L,U):h(H,L,U),U):L instanceof t.Name?(h(H,U,L),L):E(L,U);return Y===t.Name&&!(K instanceof t.Name)?A(H,K):K}}e.mergeEvaluated={props:_({mergeNames:(y,h,E)=>y.if(t._`${E} !== true && ${h} !== undefined`,()=>{y.if(t._`${h} === true`,()=>y.assign(E,!0),()=>y.assign(E,t._`${E} || {}`).code(t._`Object.assign(${E}, ${h})`))}),mergeToName:(y,h,E)=>y.if(t._`${E} !== true`,()=>{if(h===!0)y.assign(E,!0);else y.assign(E,t._`${E} || {}`),f(y,E,h)}),mergeValues:(y,h)=>y===!0?!0:{...y,...h},resultToName:b}),items:_({mergeNames:(y,h,E)=>y.if(t._`${E} !== true && ${h} !== undefined`,()=>y.assign(E,t._`${h} === true ? true : ${E} > ${h} ? ${E} : ${h}`)),mergeToName:(y,h,E)=>y.if(t._`${E} !== true`,()=>y.assign(E,h===!0?!0:t._`${E} > ${h} ? ${E} : ${h}`)),mergeValues:(y,h)=>y===!0?!0:Math.max(y,h),resultToName:(y,h)=>y.var("items",h)})};function b(y,h){if(h===!0)return y.var("props",!0);let E=y.var("props",t._`{}`);if(h!==void 0)f(y,E,h);return E}e.evaluatedPropsToName=b;function f(y,h,E){Object.keys(E).forEach((A)=>y.assign(t._`${h}${(0,t.getProperty)(A)}`,!0))}e.setEvaluated=f;let d={};function v(y,h){return y.scopeValue("func",{ref:h,code:d[h.code]||(d[h.code]=new r._Code(h.code))})}e.useFunc=v;var p;(function(y){y[y.Num=0]="Num",y[y.Str=1]="Str"})(p||(e.Type=p={}));function S(y,h,E){if(y instanceof t.Name){let A=h===p.Num;return E?A?t._`"[" + ${y} + "]"`:t._`"['" + ${y} + "']"`:A?t._`"/" + ${y}`:t._`"/" + ${y}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,t.getProperty)(y).toString():"/"+g(y)}e.getErrorPath=S;function P(y,h,E=y.opts.strictSchema){if(!E)return;if(h=`strict mode: ${h}`,E===!0)throw Error(h);y.self.logger.warn(h)}e.checkStrictMode=P}),at=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),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}),Wa=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=ce(),r=ge(),o=at();e.keywordError={message:({keyword:f})=>t.str`must pass "${f}" keyword validation`},e.keyword$DataError={message:({keyword:f,schemaType:d})=>d?t.str`"${f}" keyword must be ${d} ($data)`:t.str`"${f}" keyword is invalid ($data)`};function n(f,d=e.keywordError,v,p){let{it:S}=f,{gen:P,compositeRule:y,allErrors:h}=S,E=g(f,d,v);if(p!==null&&p!==void 0?p:y||h)c(P,E);else l(S,t._`[${E}]`)}e.reportError=n;function s(f,d=e.keywordError,v){let{it:p}=f,{gen:S,compositeRule:P,allErrors:y}=p;if(c(S,g(f,d,v)),!(P||y))l(p,o.default.vErrors)}e.reportExtraError=s;function a(f,d){f.assign(o.default.errors,d),f.if(t._`${o.default.vErrors} !== null`,()=>f.if(d,()=>f.assign(t._`${o.default.vErrors}.length`,d),()=>f.assign(o.default.vErrors,null)))}e.resetErrorsCount=a;function i({gen:f,keyword:d,schemaValue:v,data:p,errsCount:S,it:P}){if(S===void 0)throw Error("ajv implementation error");let y=f.name("err");f.forRange("i",S,o.default.errors,(h)=>{if(f.const(y,t._`${o.default.vErrors}[${h}]`),f.if(t._`${y}.instancePath === undefined`,()=>f.assign(t._`${y}.instancePath`,(0,t.strConcat)(o.default.instancePath,P.errorPath))),f.assign(t._`${y}.schemaPath`,t.str`${P.errSchemaPath}/${d}`),P.opts.verbose)f.assign(t._`${y}.schema`,v),f.assign(t._`${y}.data`,p)})}e.extendErrors=i;function c(f,d){let v=f.const("err",d);f.if(t._`${o.default.vErrors} === null`,()=>f.assign(o.default.vErrors,t._`[${v}]`),t._`${o.default.vErrors}.push(${v})`),f.code(t._`${o.default.errors}++`)}function l(f,d){let{gen:v,validateName:p,schemaEnv:S}=f;if(S.$async)v.throw(t._`new ${f.ValidationError}(${d})`);else v.assign(t._`${p}.errors`,d),v.return(!1)}let m={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 g(f,d,v){let{createErrors:p}=f.it;if(p===!1)return t._`{}`;return z(f,d,v)}function z(f,d,v={}){let{gen:p,it:S}=f,P=[w(S,v),_(f,v)];return b(f,d,P),p.object(...P)}function w({errorPath:f},{instancePath:d}){let v=d?t.str`${f}${(0,r.getErrorPath)(d,r.Type.Str)}`:f;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,v)]}function _({keyword:f,it:{errSchemaPath:d}},{schemaPath:v,parentSchema:p}){let S=p?d:t.str`${d}/${f}`;if(v)S=t.str`${S}${(0,r.getErrorPath)(v,r.Type.Str)}`;return[m.schemaPath,S]}function b(f,{params:d,message:v},p){let{keyword:S,data:P,schemaValue:y,it:h}=f,{opts:E,propertyName:A,topSchemaRef:H,schemaPath:L}=h;if(p.push([m.keyword,S],[m.params,typeof d=="function"?d(f):d||t._`{}`]),E.messages)p.push([m.message,typeof v=="function"?v(f):v]);if(E.verbose)p.push([m.schema,y],[m.parentSchema,t._`${H}${L}`],[o.default.data,P]);if(A)p.push([m.propertyName,A])}}),vS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=Wa(),r=ce(),o=at(),n={message:"boolean schema is false"};function s(c){let{gen:l,schema:m,validateName:g}=c;if(m===!1)i(c,!1);else if(typeof m=="object"&&m.$async===!0)l.return(o.default.data);else l.assign(r._`${g}.errors`,null),l.return(!0)}e.topBoolOrEmptySchema=s;function a(c,l){let{gen:m,schema:g}=c;if(g===!1)m.var(l,!1),i(c);else m.var(l,!0)}e.boolOrEmptySchema=a;function i(c,l){let{gen:m,data:g}=c,z={gen:m,keyword:"false schema",data:g,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,t.reportError)(z,n,void 0,l)}}),kh=D((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}),Ch=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:s},a){let i=s.RULES.types[a];return i&&i!==!0&&r(n,i)}e.schemaHasRulesForType=t;function r(n,s){return s.rules.some((a)=>o(n,a))}e.shouldUseGroup=r;function o(n,s){var a;return n[s.keyword]!==void 0||((a=s.definition.implements)===null||a===void 0?void 0:a.some((i)=>n[i]!==void 0))}e.shouldUseRule=o}),Ga=D((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=kh(),r=Ch(),o=Wa(),n=ce(),s=ge();var a;(function(p){p[p.Correct=0]="Correct",p[p.Wrong=1]="Wrong"})(a||(e.DataType=a={}));function i(p){let S=c(p.type);if(S.includes("null")){if(p.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!S.length&&p.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(p.nullable===!0)S.push("null")}return S}e.getSchemaTypes=i;function c(p){let S=Array.isArray(p)?p:p?[p]:[];if(S.every(t.isJSONType))return S;throw Error("type must be JSONType or JSONType[]: "+S.join(","))}e.getJSONTypes=c;function l(p,S){let{gen:P,data:y,opts:h}=p,E=g(S,h.coerceTypes),A=S.length>0&&!(E.length===0&&S.length===1&&(0,r.schemaHasRulesForType)(p,S[0]));if(A){let H=b(S,y,h.strictNumbers,a.Wrong);P.if(H,()=>{if(E.length)z(p,S,E);else d(p)})}return A}e.coerceAndCheckDataType=l;let m=new Set(["string","number","integer","boolean","null"]);function g(p,S){return S?p.filter((P)=>m.has(P)||S==="array"&&P==="array"):[]}function z(p,S,P){let{gen:y,data:h,opts:E}=p,A=y.let("dataType",n._`typeof ${h}`),H=y.let("coerced",n._`undefined`);if(E.coerceTypes==="array")y.if(n._`${A} == 'object' && Array.isArray(${h}) && ${h}.length == 1`,()=>y.assign(h,n._`${h}[0]`).assign(A,n._`typeof ${h}`).if(b(S,h,E.strictNumbers),()=>y.assign(H,h)));y.if(n._`${H} !== undefined`);for(let U of P)if(m.has(U)||U==="array"&&E.coerceTypes==="array")L(U);y.else(),d(p),y.endIf(),y.if(n._`${H} !== undefined`,()=>{y.assign(h,H),w(p,H)});function L(U){switch(U){case"string":y.elseIf(n._`${A} == "number" || ${A} == "boolean"`).assign(H,n._`"" + ${h}`).elseIf(n._`${h} === null`).assign(H,n._`""`);return;case"number":y.elseIf(n._`${A} == "boolean" || ${h} === null
|
|
69
|
+
*/var C_=D((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(i){if(!i)throw TypeError("argument string is required");var c=typeof i==="object"?s(i):i;if(typeof c!=="string")throw TypeError("argument string is required to be a string");var l=c.indexOf(";"),m=l!==-1?c.slice(0,l).trim():c.trim();if(!o.test(m))throw TypeError("invalid media type");var g=new a(m.toLowerCase());if(l!==-1){var z,w,_;t.lastIndex=l;while(w=t.exec(c)){if(w.index!==l)throw TypeError("invalid parameter format");if(l+=w[0].length,z=w[1].toLowerCase(),_=w[2],_.charCodeAt(0)===34){if(_=_.slice(1,-1),_.indexOf("\\")!==-1)_=_.replace(r,"$1")}g.parameters[z]=_}if(l!==c.length)throw TypeError("invalid parameter format")}return g}function s(i){var c;if(typeof i.getHeader==="function")c=i.getHeader("content-type");else if(typeof i.headers==="object")c=i.headers&&i.headers["content-type"];if(typeof c!=="string")throw TypeError("content-type header is missing from object");return c}function a(i){this.parameters=Object.create(null),this.type=i}}),Tb=Rn(C_(),1);var I_=10485760,ah=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??I_}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){while(this._buffer){let e=this._buffer.indexOf(`
|
|
70
|
+
`);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return O_(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};function O_(e){return Yn.parse(JSON.parse(e))}function ih(e){return JSON.stringify(e)+`
|
|
71
|
+
`}var Va=D((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(d){super();if(!e.IDENTIFIER.test(d))throw Error("CodeGen: name must be a valid identifier");this.str=d}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(d){super();this._items=typeof d==="string"?[d]:d}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let d=this._items[0];return d===""||d==='""'}get str(){var d;return(d=this._str)!==null&&d!==void 0?d:this._str=this._items.reduce((v,p)=>`${v}${p}`,"")}get names(){var d;return(d=this._names)!==null&&d!==void 0?d:this._names=this._items.reduce((v,p)=>{if(p instanceof r)v[p.str]=(v[p.str]||0)+1;return v},{})}};e._Code=o,e.nil=new o("");function n(d,...v){let p=[d[0]],S=0;while(S<v.length)i(p,v[S]),p.push(d[++S]);return new o(p)}e._=n;let s=new o("+");function a(d,...v){let p=[w(d[0])],S=0;while(S<v.length)p.push(s),i(p,v[S]),p.push(s,w(d[++S]));return c(p),new o(p)}e.str=a;function i(d,v){if(v instanceof o)d.push(...v._items);else if(v instanceof r)d.push(v);else d.push(g(v))}e.addCodeArg=i;function c(d){let v=1;while(v<d.length-1){if(d[v]===s){let p=l(d[v-1],d[v+1]);if(p!==void 0){d.splice(v-1,3,p);continue}d[v++]="+"}v++}}function l(d,v){if(v==='""')return d;if(d==='""')return v;if(typeof d=="string"){if(v instanceof r||d[d.length-1]!=='"')return;if(typeof v!="string")return`${d.slice(0,-1)}${v}"`;if(v[0]==='"')return d.slice(0,-1)+v.slice(1);return}if(typeof v=="string"&&v[0]==='"'&&!(d instanceof r))return`"${d}${v.slice(1)}`}function m(d,v){return v.emptyStr()?d:d.emptyStr()?v:a`${d}${v}`}e.strConcat=m;function g(d){return typeof d=="number"||typeof d=="boolean"||d===null?d:w(Array.isArray(d)?d.join(","):d)}function z(d){return new o(w(d))}e.stringify=z;function w(d){return JSON.stringify(d).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=w;function _(d){return typeof d=="string"&&e.IDENTIFIER.test(d)?new o(`.${d}`):n`[${d}]`}e.getProperty=_;function b(d){if(typeof d=="string"&&e.IDENTIFIER.test(d))return new o(`${d}`);throw Error(`CodeGen: invalid export name: ${d}, use explicit $id name mapping`)}e.getEsmExportName=b;function f(d){return new o(d.toString())}e.regexpCode=f}),ch=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=Va();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:l}={}){this._names={},this._prefixes=c,this._parent=l}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){let l=this._names[c]||this._nameGroup(c);return`${c}${l.index++}`}_nameGroup(c){var l,m;if(((m=(l=this._parent)===null||l===void 0?void 0:l._prefixes)===null||m===void 0?void 0:m.has(c))||this._prefixes&&!this._prefixes.has(c))throw 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,l){super(l);this.prefix=c}setValue(c,{property:l,itemIndex:m}){this.value=c,this.scopePath=t._`.${new t.Name(l)}[${m}]`}};e.ValueScopeName=s;let a=t._`\n`;var i=class extends n{constructor(c){super(c);this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?a:t.nil}}get(){return this._scope}name(c){return new s(c,this._newName(c))}value(c,l){var m;if(l.ref===void 0)throw Error("CodeGen: ref must be passed in value");let g=this.toName(c),{prefix:z}=g,w=(m=l.key)!==null&&m!==void 0?m:l.ref,_=this._values[z];if(_){let d=_.get(w);if(d)return d}else _=this._values[z]=new Map;_.set(w,g);let b=this._scope[z]||(this._scope[z]=[]),f=b.length;return b[f]=l.ref,g.setValue(l,{property:z,itemIndex:f}),g}getValue(c,l){let m=this._values[c];if(!m)return;return m.get(l)}scopeRefs(c,l=this._values){return this._reduceValues(l,(m)=>{if(m.scopePath===void 0)throw Error(`CodeGen: name "${m}" has no value`);return t._`${c}${m.scopePath}`})}scopeCode(c=this._values,l,m){return this._reduceValues(c,(g)=>{if(g.value===void 0)throw Error(`CodeGen: name "${g}" has no value`);return g.value.code},l,m)}_reduceValues(c,l,m={},g){let z=t.nil;for(let w in c){let _=c[w];if(!_)continue;let b=m[w]=m[w]||new Map;_.forEach((f)=>{if(b.has(f))return;b.set(f,o.Started);let d=l(f);if(d){let v=this.opts.es5?e.varKinds.var:e.varKinds.const;z=t._`${z}${v} ${f} = ${d};${this.opts._n}`}else if(d=g===null||g===void 0?void 0:g(f))z=t._`${z}${d}${this.opts._n}`;else throw new r(f);b.set(f,o.Completed)})}return z}};e.ValueScope=i}),ce=D((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=Va(),r=ch();var o=Va();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=ch();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(R,C){return this}},a=class extends s{constructor(R,C,j){super();this.varKind=R,this.name=C,this.rhs=j}render({es5:R,_n:C}){let j=R?r.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${j} ${this.name}${J};`+C}optimizeNames(R,C){if(!R[this.name.str])return;if(this.rhs)this.rhs=K(this.rhs,R,C);return this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},i=class extends s{constructor(R,C,j){super();this.lhs=R,this.rhs=C,this.sideEffects=j}render({_n:R}){return`${this.lhs} = ${this.rhs};`+R}optimizeNames(R,C){if(this.lhs instanceof t.Name&&!R[this.lhs.str]&&!this.sideEffects)return;return this.rhs=K(this.rhs,R,C),this}get names(){return Y(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends i{constructor(R,C,j,J){super(R,j,J);this.op=C}render({_n:R}){return`${this.lhs} ${this.op}= ${this.rhs};`+R}},l=class extends s{constructor(R){super();this.label=R,this.names={}}render({_n:R}){return`${this.label}:`+R}},m=class extends s{constructor(R){super();this.label=R,this.names={}}render({_n:R}){return`break${this.label?` ${this.label}`:""};`+R}},g=class extends s{constructor(R){super();this.error=R}render({_n:R}){return`throw ${this.error};`+R}get names(){return this.error.names}},z=class extends s{constructor(R){super();this.code=R}render({_n:R}){return`${this.code};`+R}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(R,C){return this.code=K(this.code,R,C),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},w=class extends s{constructor(R=[]){super();this.nodes=R}render(R){return this.nodes.reduce((C,j)=>C+j.render(R),"")}optimizeNodes(){let{nodes:R}=this,C=R.length;while(C--){let j=R[C].optimizeNodes();if(Array.isArray(j))R.splice(C,1,...j);else if(j)R[C]=j;else R.splice(C,1)}return R.length>0?this:void 0}optimizeNames(R,C){let{nodes:j}=this,J=j.length;while(J--){let re=j[J];if(re.optimizeNames(R,C))continue;me(R,re.names),j.splice(J,1)}return j.length>0?this:void 0}get names(){return this.nodes.reduce((R,C)=>U(R,C.names),{})}},_=class extends w{render(R){return"{"+R._n+super.render(R)+"}"+R._n}},b=class extends w{},f=class extends _{};f.kind="else";var d=class R extends _{constructor(C,j){super(j);this.condition=C}render(C){let j=`if(${this.condition})`+super.render(C);if(this.else)j+="else "+this.else.render(C);return j}optimizeNodes(){super.optimizeNodes();let C=this.condition;if(C===!0)return this.nodes;let j=this.else;if(j){let J=j.optimizeNodes();j=this.else=Array.isArray(J)?new f(J):J}if(j){if(C===!1)return j instanceof R?j:j.nodes;if(this.nodes.length)return this;return new R(Re(C),j instanceof R?[j]:j.nodes)}if(C===!1||!this.nodes.length)return;return this}optimizeNames(C,j){var J;if(this.else=(J=this.else)===null||J===void 0?void 0:J.optimizeNames(C,j),!(super.optimizeNames(C,j)||this.else))return;return this.condition=K(this.condition,C,j),this}get names(){let C=super.names;if(Y(C,this.condition),this.else)U(C,this.else.names);return C}};d.kind="if";var v=class extends _{};v.kind="for";var p=class extends v{constructor(R){super();this.iteration=R}render(R){return`for(${this.iteration})`+super.render(R)}optimizeNames(R,C){if(!super.optimizeNames(R,C))return;return this.iteration=K(this.iteration,R,C),this}get names(){return U(super.names,this.iteration.names)}},S=class extends v{constructor(R,C,j,J){super();this.varKind=R,this.name=C,this.from=j,this.to=J}render(R){let C=R.es5?r.varKinds.var:this.varKind,{name:j,from:J,to:re}=this;return`for(${C} ${j}=${J}; ${j}<${re}; ${j}++)`+super.render(R)}get names(){return Y(Y(super.names,this.from),this.to)}},P=class extends v{constructor(R,C,j,J){super();this.loop=R,this.varKind=C,this.name=j,this.iterable=J}render(R){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(R)}optimizeNames(R,C){if(!super.optimizeNames(R,C))return;return this.iterable=K(this.iterable,R,C),this}get names(){return U(super.names,this.iterable.names)}},y=class extends _{constructor(R,C,j){super();this.name=R,this.args=C,this.async=j}render(R){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(R)}};y.kind="func";var h=class extends w{render(R){return"return "+super.render(R)}};h.kind="return";var E=class extends _{render(R){let C="try"+super.render(R);if(this.catch)C+=this.catch.render(R);if(this.finally)C+=this.finally.render(R);return C}optimizeNodes(){var R,C;return super.optimizeNodes(),(R=this.catch)===null||R===void 0||R.optimizeNodes(),(C=this.finally)===null||C===void 0||C.optimizeNodes(),this}optimizeNames(R,C){var j,J;return super.optimizeNames(R,C),(j=this.catch)===null||j===void 0||j.optimizeNames(R,C),(J=this.finally)===null||J===void 0||J.optimizeNames(R,C),this}get names(){let R=super.names;if(this.catch)U(R,this.catch.names);if(this.finally)U(R,this.finally.names);return R}},A=class extends _{constructor(R){super();this.error=R}render(R){return`catch(${this.error})`+super.render(R)}};A.kind="catch";var H=class extends _{render(R){return"finally"+super.render(R)}};H.kind="finally";var L=class{constructor(R,C={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...C,_n:C.lines?`
|
|
72
|
+
`:""},this._extScope=R,this._scope=new r.Scope({parent:R}),this._nodes=[new b]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,C){let j=this._extScope.value(R,C);return(this._values[j.prefix]||(this._values[j.prefix]=new Set)).add(j),j}getScopeValue(R,C){return this._extScope.getValue(R,C)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,C,j,J){let re=this._scope.toName(C);if(j!==void 0&&J)this._constants[re.str]=j;return this._leafNode(new a(R,re,j)),re}const(R,C,j){return this._def(r.varKinds.const,R,C,j)}let(R,C,j){return this._def(r.varKinds.let,R,C,j)}var(R,C,j){return this._def(r.varKinds.var,R,C,j)}assign(R,C,j){return this._leafNode(new i(R,C,j))}add(R,C){return this._leafNode(new c(R,e.operators.ADD,C))}code(R){if(typeof R=="function")R();else if(R!==t.nil)this._leafNode(new z(R));return this}object(...R){let C=["{"];for(let[j,J]of R){if(C.length>1)C.push(",");if(C.push(j),j!==J||this.opts.es5)C.push(":"),(0,t.addCodeArg)(C,J)}return C.push("}"),new t._Code(C)}if(R,C,j){if(this._blockNode(new d(R)),C&&j)this.code(C).else().code(j).endIf();else if(C)this.code(C).endIf();else if(j)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new d(R))}else(){return this._elseNode(new f)}endIf(){return this._endBlockNode(d,f)}_for(R,C){if(this._blockNode(R),C)this.code(C).endFor();return this}for(R,C){return this._for(new p(R),C)}forRange(R,C,j,J,re=this.opts.es5?r.varKinds.var:r.varKinds.let){let de=this._scope.toName(R);return this._for(new S(re,de,C,j),()=>J(de))}forOf(R,C,j,J=r.varKinds.const){let re=this._scope.toName(R);if(this.opts.es5){let de=C instanceof t.Name?C:this.var("_arr",C);return this.forRange("_i",0,t._`${de}.length`,(ae)=>{this.var(re,t._`${de}[${ae}]`),j(re)})}return this._for(new P("of",J,re,C),()=>j(re))}forIn(R,C,j,J=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(R,t._`Object.keys(${C})`,j);let re=this._scope.toName(R);return this._for(new P("in",J,re,C),()=>j(re))}endFor(){return this._endBlockNode(v)}label(R){return this._leafNode(new l(R))}break(R){return this._leafNode(new m(R))}return(R){let C=new h;if(this._blockNode(C),this.code(R),C.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(h)}try(R,C,j){if(!C&&!j)throw Error('CodeGen: "try" without "catch" and "finally"');let J=new E;if(this._blockNode(J),this.code(R),C){let re=this.name("e");this._currNode=J.catch=new A(re),C(re)}if(j)this._currNode=J.finally=new H,this.code(j);return this._endBlockNode(A,H)}throw(R){return this._leafNode(new g(R))}block(R,C){if(this._blockStarts.push(this._nodes.length),R)this.code(R).endBlock(C);return this}endBlock(R){let C=this._blockStarts.pop();if(C===void 0)throw Error("CodeGen: not in self-balancing block");let j=this._nodes.length-C;if(j<0||R!==void 0&&j!==R)throw Error(`CodeGen: wrong number of nodes: ${j} vs ${R} expected`);return this._nodes.length=C,this}func(R,C=t.nil,j,J){if(this._blockNode(new y(R,C,j)),J)this.code(J).endFunc();return this}endFunc(){return this._endBlockNode(y)}optimize(R=1){while(R-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,C){let j=this._currNode;if(j instanceof R||C&&j instanceof C)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${C?`${R.kind}/${C.kind}`:R.kind}"`)}_elseNode(R){let C=this._currNode;if(!(C instanceof d))throw Error('CodeGen: "else" without "if"');return this._currNode=C.else=R,this}get _root(){return this._nodes[0]}get _currNode(){let R=this._nodes;return R[R.length-1]}set _currNode(R){let C=this._nodes;C[C.length-1]=R}};e.CodeGen=L;function U(R,C){for(let j in C)R[j]=(R[j]||0)+(C[j]||0);return R}function Y(R,C){return C instanceof t._CodeOrName?U(R,C.names):R}function K(R,C,j){if(R instanceof t.Name)return J(R);if(!re(R))return R;return new t._Code(R._items.reduce((de,ae)=>{if(ae instanceof t.Name)ae=J(ae);if(ae instanceof t._Code)de.push(...ae._items);else de.push(ae);return de},[]));function J(de){let ae=j[de.str];if(ae===void 0||C[de.str]!==1)return de;return delete C[de.str],ae}function re(de){return de instanceof t._Code&&de._items.some((ae)=>ae instanceof t.Name&&C[ae.str]===1&&j[ae.str]!==void 0)}}function me(R,C){for(let j in C)R[j]=(R[j]||0)-(C[j]||0)}function Re(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:t._`!${V(R)}`}e.not=Re;let ve=q(e.operators.AND);function Oe(...R){return R.reduce(ve)}e.and=Oe;let fe=q(e.operators.OR);function I(...R){return R.reduce(fe)}e.or=I;function q(R){return(C,j)=>C===t.nil?j:j===t.nil?C:t._`${V(C)} ${R} ${V(j)}`}function V(R){return R instanceof t.Name?R:t._`(${R})`}}),ge=D((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=ce(),r=Va();function o(y){let h={};for(let E of y)h[E]=!0;return h}e.toHash=o;function n(y,h){if(typeof h=="boolean")return h;if(Object.keys(h).length===0)return!0;return s(y,h),!a(h,y.self.RULES.all)}e.alwaysValidSchema=n;function s(y,h=y.schema){let{opts:E,self:A}=y;if(!E.strictSchema)return;if(typeof h==="boolean")return;let H=A.RULES.keywords;for(let L in h)if(!H[L])P(y,`unknown keyword: "${L}"`)}e.checkUnknownRules=s;function a(y,h){if(typeof y=="boolean")return!y;for(let E in y)if(h[E])return!0;return!1}e.schemaHasRules=a;function i(y,h){if(typeof y=="boolean")return!y;for(let E in y)if(E!=="$ref"&&h.all[E])return!0;return!1}e.schemaHasRulesButRef=i;function c({topSchemaRef:y,schemaPath:h},E,A,H){if(!H){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return t._`${E}`}return t._`${y}${h}${(0,t.getProperty)(A)}`}e.schemaRefOrVal=c;function l(y){return z(decodeURIComponent(y))}e.unescapeFragment=l;function m(y){return encodeURIComponent(g(y))}e.escapeFragment=m;function g(y){if(typeof y=="number")return`${y}`;return y.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=g;function z(y){return y.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=z;function w(y,h){if(Array.isArray(y))for(let E of y)h(E);else h(y)}e.eachItem=w;function _({mergeNames:y,mergeToName:h,mergeValues:E,resultToName:A}){return(H,L,U,Y)=>{let K=U===void 0?L:U instanceof t.Name?(L instanceof t.Name?y(H,L,U):h(H,L,U),U):L instanceof t.Name?(h(H,U,L),L):E(L,U);return Y===t.Name&&!(K instanceof t.Name)?A(H,K):K}}e.mergeEvaluated={props:_({mergeNames:(y,h,E)=>y.if(t._`${E} !== true && ${h} !== undefined`,()=>{y.if(t._`${h} === true`,()=>y.assign(E,!0),()=>y.assign(E,t._`${E} || {}`).code(t._`Object.assign(${E}, ${h})`))}),mergeToName:(y,h,E)=>y.if(t._`${E} !== true`,()=>{if(h===!0)y.assign(E,!0);else y.assign(E,t._`${E} || {}`),f(y,E,h)}),mergeValues:(y,h)=>y===!0?!0:{...y,...h},resultToName:b}),items:_({mergeNames:(y,h,E)=>y.if(t._`${E} !== true && ${h} !== undefined`,()=>y.assign(E,t._`${h} === true ? true : ${E} > ${h} ? ${E} : ${h}`)),mergeToName:(y,h,E)=>y.if(t._`${E} !== true`,()=>y.assign(E,h===!0?!0:t._`${E} > ${h} ? ${E} : ${h}`)),mergeValues:(y,h)=>y===!0?!0:Math.max(y,h),resultToName:(y,h)=>y.var("items",h)})};function b(y,h){if(h===!0)return y.var("props",!0);let E=y.var("props",t._`{}`);if(h!==void 0)f(y,E,h);return E}e.evaluatedPropsToName=b;function f(y,h,E){Object.keys(E).forEach((A)=>y.assign(t._`${h}${(0,t.getProperty)(A)}`,!0))}e.setEvaluated=f;let d={};function v(y,h){return y.scopeValue("func",{ref:h,code:d[h.code]||(d[h.code]=new r._Code(h.code))})}e.useFunc=v;var p;(function(y){y[y.Num=0]="Num",y[y.Str=1]="Str"})(p||(e.Type=p={}));function S(y,h,E){if(y instanceof t.Name){let A=h===p.Num;return E?A?t._`"[" + ${y} + "]"`:t._`"['" + ${y} + "']"`:A?t._`"/" + ${y}`:t._`"/" + ${y}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,t.getProperty)(y).toString():"/"+g(y)}e.getErrorPath=S;function P(y,h,E=y.opts.strictSchema){if(!E)return;if(h=`strict mode: ${h}`,E===!0)throw Error(h);y.self.logger.warn(h)}e.checkStrictMode=P}),nt=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),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}),Ha=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=ce(),r=ge(),o=nt();e.keywordError={message:({keyword:f})=>t.str`must pass "${f}" keyword validation`},e.keyword$DataError={message:({keyword:f,schemaType:d})=>d?t.str`"${f}" keyword must be ${d} ($data)`:t.str`"${f}" keyword is invalid ($data)`};function n(f,d=e.keywordError,v,p){let{it:S}=f,{gen:P,compositeRule:y,allErrors:h}=S,E=g(f,d,v);if(p!==null&&p!==void 0?p:y||h)c(P,E);else l(S,t._`[${E}]`)}e.reportError=n;function s(f,d=e.keywordError,v){let{it:p}=f,{gen:S,compositeRule:P,allErrors:y}=p;if(c(S,g(f,d,v)),!(P||y))l(p,o.default.vErrors)}e.reportExtraError=s;function a(f,d){f.assign(o.default.errors,d),f.if(t._`${o.default.vErrors} !== null`,()=>f.if(d,()=>f.assign(t._`${o.default.vErrors}.length`,d),()=>f.assign(o.default.vErrors,null)))}e.resetErrorsCount=a;function i({gen:f,keyword:d,schemaValue:v,data:p,errsCount:S,it:P}){if(S===void 0)throw Error("ajv implementation error");let y=f.name("err");f.forRange("i",S,o.default.errors,(h)=>{if(f.const(y,t._`${o.default.vErrors}[${h}]`),f.if(t._`${y}.instancePath === undefined`,()=>f.assign(t._`${y}.instancePath`,(0,t.strConcat)(o.default.instancePath,P.errorPath))),f.assign(t._`${y}.schemaPath`,t.str`${P.errSchemaPath}/${d}`),P.opts.verbose)f.assign(t._`${y}.schema`,v),f.assign(t._`${y}.data`,p)})}e.extendErrors=i;function c(f,d){let v=f.const("err",d);f.if(t._`${o.default.vErrors} === null`,()=>f.assign(o.default.vErrors,t._`[${v}]`),t._`${o.default.vErrors}.push(${v})`),f.code(t._`${o.default.errors}++`)}function l(f,d){let{gen:v,validateName:p,schemaEnv:S}=f;if(S.$async)v.throw(t._`new ${f.ValidationError}(${d})`);else v.assign(t._`${p}.errors`,d),v.return(!1)}let m={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 g(f,d,v){let{createErrors:p}=f.it;if(p===!1)return t._`{}`;return z(f,d,v)}function z(f,d,v={}){let{gen:p,it:S}=f,P=[w(S,v),_(f,v)];return b(f,d,P),p.object(...P)}function w({errorPath:f},{instancePath:d}){let v=d?t.str`${f}${(0,r.getErrorPath)(d,r.Type.Str)}`:f;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,v)]}function _({keyword:f,it:{errSchemaPath:d}},{schemaPath:v,parentSchema:p}){let S=p?d:t.str`${d}/${f}`;if(v)S=t.str`${S}${(0,r.getErrorPath)(v,r.Type.Str)}`;return[m.schemaPath,S]}function b(f,{params:d,message:v},p){let{keyword:S,data:P,schemaValue:y,it:h}=f,{opts:E,propertyName:A,topSchemaRef:H,schemaPath:L}=h;if(p.push([m.keyword,S],[m.params,typeof d=="function"?d(f):d||t._`{}`]),E.messages)p.push([m.message,typeof v=="function"?v(f):v]);if(E.verbose)p.push([m.schema,y],[m.parentSchema,t._`${H}${L}`],[o.default.data,P]);if(A)p.push([m.propertyName,A])}}),N_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=Ha(),r=ce(),o=nt(),n={message:"boolean schema is false"};function s(c){let{gen:l,schema:m,validateName:g}=c;if(m===!1)i(c,!1);else if(typeof m=="object"&&m.$async===!0)l.return(o.default.data);else l.assign(r._`${g}.errors`,null),l.return(!0)}e.topBoolOrEmptySchema=s;function a(c,l){let{gen:m,schema:g}=c;if(g===!1)m.var(l,!1),i(c);else m.var(l,!0)}e.boolOrEmptySchema=a;function i(c,l){let{gen:m,data:g}=c,z={gen:m,keyword:"false schema",data:g,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,t.reportError)(z,n,void 0,l)}}),uh=D((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}),lh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:s},a){let i=s.RULES.types[a];return i&&i!==!0&&r(n,i)}e.schemaHasRulesForType=t;function r(n,s){return s.rules.some((a)=>o(n,a))}e.shouldUseGroup=r;function o(n,s){var a;return n[s.keyword]!==void 0||((a=s.definition.implements)===null||a===void 0?void 0:a.some((i)=>n[i]!==void 0))}e.shouldUseRule=o}),Fa=D((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=uh(),r=lh(),o=Ha(),n=ce(),s=ge();var a;(function(p){p[p.Correct=0]="Correct",p[p.Wrong=1]="Wrong"})(a||(e.DataType=a={}));function i(p){let S=c(p.type);if(S.includes("null")){if(p.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!S.length&&p.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(p.nullable===!0)S.push("null")}return S}e.getSchemaTypes=i;function c(p){let S=Array.isArray(p)?p:p?[p]:[];if(S.every(t.isJSONType))return S;throw Error("type must be JSONType or JSONType[]: "+S.join(","))}e.getJSONTypes=c;function l(p,S){let{gen:P,data:y,opts:h}=p,E=g(S,h.coerceTypes),A=S.length>0&&!(E.length===0&&S.length===1&&(0,r.schemaHasRulesForType)(p,S[0]));if(A){let H=b(S,y,h.strictNumbers,a.Wrong);P.if(H,()=>{if(E.length)z(p,S,E);else d(p)})}return A}e.coerceAndCheckDataType=l;let m=new Set(["string","number","integer","boolean","null"]);function g(p,S){return S?p.filter((P)=>m.has(P)||S==="array"&&P==="array"):[]}function z(p,S,P){let{gen:y,data:h,opts:E}=p,A=y.let("dataType",n._`typeof ${h}`),H=y.let("coerced",n._`undefined`);if(E.coerceTypes==="array")y.if(n._`${A} == 'object' && Array.isArray(${h}) && ${h}.length == 1`,()=>y.assign(h,n._`${h}[0]`).assign(A,n._`typeof ${h}`).if(b(S,h,E.strictNumbers),()=>y.assign(H,h)));y.if(n._`${H} !== undefined`);for(let U of P)if(m.has(U)||U==="array"&&E.coerceTypes==="array")L(U);y.else(),d(p),y.endIf(),y.if(n._`${H} !== undefined`,()=>{y.assign(h,H),w(p,H)});function L(U){switch(U){case"string":y.elseIf(n._`${A} == "number" || ${A} == "boolean"`).assign(H,n._`"" + ${h}`).elseIf(n._`${h} === null`).assign(H,n._`""`);return;case"number":y.elseIf(n._`${A} == "boolean" || ${h} === null
|
|
73
73
|
|| (${A} == "string" && ${h} && ${h} == +${h})`).assign(H,n._`+${h}`);return;case"integer":y.elseIf(n._`${A} === "boolean" || ${h} === null
|
|
74
74
|
|| (${A} === "string" && ${h} && ${h} == +${h} && !(${h} % 1))`).assign(H,n._`+${h}`);return;case"boolean":y.elseIf(n._`${h} === "false" || ${h} === 0 || ${h} === null`).assign(H,!1).elseIf(n._`${h} === "true" || ${h} === 1`).assign(H,!0);return;case"null":y.elseIf(n._`${h} === "" || ${h} === 0 || ${h} === false`),y.assign(H,null);return;case"array":y.elseIf(n._`${A} === "string" || ${A} === "number"
|
|
75
|
-
|| ${A} === "boolean" || ${h} === null`).assign(H,n._`[${h}]`)}}}function w({gen:p,parentData:S,parentDataProperty:P},y){p.if(n._`${S} !== undefined`,()=>p.assign(n._`${S}[${P}]`,y))}function _(p,S,P,y=a.Correct){let h=y===a.Correct?n.operators.EQ:n.operators.NEQ,E;switch(p){case"null":return n._`${S} ${h} null`;case"array":E=n._`Array.isArray(${S})`;break;case"object":E=n._`${S} && typeof ${S} == "object" && !Array.isArray(${S})`;break;case"integer":E=A(n._`!(${S} % 1) && !isNaN(${S})`);break;case"number":E=A();break;default:return n._`typeof ${S} ${h} ${p}`}return y===a.Correct?E:(0,n.not)(E);function A(H=n.nil){return(0,n.and)(n._`typeof ${S} == "number"`,H,P?n._`isFinite(${S})`:n.nil)}}e.checkDataType=_;function b(p,S,P,y){if(p.length===1)return _(p[0],S,P,y);let h,E=(0,s.toHash)(p);if(E.array&&E.object){let A=n._`typeof ${S} != "object"`;h=E.null?A:n._`!${S} || ${A}`,delete E.null,delete E.array,delete E.object}else h=n.nil;if(E.number)delete E.integer;for(let A in E)h=(0,n.and)(h,_(A,S,P,y));return h}e.checkDataTypes=b;let f={message:({schema:p})=>`must be ${p}`,params:({schema:p,schemaValue:S})=>typeof p=="string"?n._`{type: ${p}}`:n._`{type: ${S}}`};function d(p){let S=v(p);(0,o.reportError)(S,f)}e.reportTypeError=d;function v(p){let{gen:S,data:P,schema:y}=p,h=(0,s.schemaRefOrVal)(p,y,"type");return{gen:S,keyword:"type",data:P,schema:y.type,schemaCode:h,schemaValue:h,parentSchema:y,params:{},it:p}}}),bS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=ce(),r=ge();function o(s,a){let{properties:i,items:c}=s.schema;if(a==="object"&&i)for(let l in i)n(s,l,i[l].default);else if(a==="array"&&Array.isArray(c))c.forEach((l,m)=>n(s,m,l.default))}e.assignDefaults=o;function n(s,a,i){let{gen:c,compositeRule:l,data:m,opts:g}=s;if(i===void 0)return;let z=t._`${m}${(0,t.getProperty)(a)}`;if(l){(0,r.checkStrictMode)(s,`default is ignored for: ${z}`);return}let w=t._`${z} === undefined`;if(g.useDefaults==="empty")w=t._`${w} || ${z} === null || ${z} === ""`;c.if(w,t._`${z} = ${(0,t.stringify)(i)}`)}}),it=D((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=ce(),r=ge(),o=at(),n=ge();function s(p,S){let{gen:P,data:y,it:h}=p;P.if(g(P,y,S,h.opts.ownProperties),()=>{p.setParams({missingProperty:t._`${S}`},!0),p.error()})}e.checkReportMissingProp=s;function a({gen:p,data:S,it:{opts:P}},y,h){return(0,t.or)(...y.map((E)=>(0,t.and)(g(p,S,E,P.ownProperties),t._`${h} = ${E}`)))}e.checkMissingProp=a;function i(p,S){p.setParams({missingProperty:S},!0),p.error()}e.reportMissingProp=i;function c(p){return p.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(p,S,P){return t._`${c(p)}.call(${S}, ${P})`}e.isOwnProperty=l;function m(p,S,P,y){let h=t._`${S}${(0,t.getProperty)(P)} !== undefined`;return y?t._`${h} && ${l(p,S,P)}`:h}e.propertyInData=m;function g(p,S,P,y){let h=t._`${S}${(0,t.getProperty)(P)} === undefined`;return y?(0,t.or)(h,(0,t.not)(l(p,S,P))):h}e.noPropertyInData=g;function z(p){return p?Object.keys(p).filter((S)=>S!=="__proto__"):[]}e.allSchemaProperties=z;function w(p,S){return z(S).filter((P)=>!(0,r.alwaysValidSchema)(p,S[P]))}e.schemaProperties=w;function _({schemaCode:p,data:S,it:{gen:P,topSchemaRef:y,schemaPath:h,errorPath:E},it:A},H,L,U){let Y=U?t._`${p}, ${S}, ${y}${h}`:S,K=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,E)],[o.default.parentData,A.parentData],[o.default.parentDataProperty,A.parentDataProperty],[o.default.rootData,o.default.rootData]];if(A.opts.dynamicRef)K.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let me=t._`${Y}, ${P.object(...K)}`;return L!==t.nil?t._`${H}.call(${L}, ${me})`:t._`${H}(${me})`}e.callValidateCode=_;let b=t._`new RegExp`;function f({gen:p,it:{opts:S}},P){let y=S.unicodeRegExp?"u":"",{regExp:h}=S.code,E=h(P,y);return p.scopeValue("pattern",{key:E.toString(),ref:E,code:t._`${h.code==="new RegExp"?b:(0,n.useFunc)(p,h)}(${P}, ${y})`})}e.usePattern=f;function d(p){let{gen:S,data:P,keyword:y,it:h}=p,E=S.name("valid");if(h.allErrors){let H=S.let("valid",!0);return A(()=>S.assign(H,!1)),H}return S.var(E,!0),A(()=>S.break()),E;function A(H){let L=S.const("len",t._`${P}.length`);S.forRange("i",0,L,(U)=>{p.subschema({keyword:y,dataProp:U,dataPropType:r.Type.Num},E),S.if((0,t.not)(E),H)})}}e.validateArray=d;function v(p){let{gen:S,schema:P,keyword:y,it:h}=p;if(!Array.isArray(P))throw Error("ajv implementation error");if(P.some((H)=>(0,r.alwaysValidSchema)(h,H))&&!h.opts.unevaluated)return;let E=S.let("valid",!1),A=S.name("_valid");S.block(()=>P.forEach((H,L)=>{let U=p.subschema({keyword:y,schemaProp:L,compositeRule:!0},A);if(S.assign(E,t._`${E} || ${A}`),!p.mergeValidEvaluated(U,A))S.if((0,t.not)(E))})),p.result(E,()=>p.reset(),()=>p.error(!0))}e.validateUnion=v}),zS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=ce(),r=at(),o=it(),n=Wa();function s(w,_){let{gen:b,keyword:f,schema:d,parentSchema:v,it:p}=w,S=_.macro.call(p.self,d,v,p),P=m(b,f,S);if(p.opts.validateSchema!==!1)p.self.validateSchema(S,!0);let y=b.name("valid");w.subschema({schema:S,schemaPath:t.nil,errSchemaPath:`${p.errSchemaPath}/${f}`,topSchemaRef:P,compositeRule:!0},y),w.pass(y,()=>w.error(!0))}e.macroKeywordCode=s;function a(w,_){var b;let{gen:f,keyword:d,schema:v,parentSchema:p,$data:S,it:P}=w;l(P,_);let y=m(f,d,!S&&_.compile?_.compile.call(P.self,v,p,P):_.validate),h=f.let("valid");w.block$data(h,E),w.ok((b=_.valid)!==null&&b!==void 0?b:h);function E(){if(_.errors===!1){if(L(),_.modifying)i(w);U(()=>w.error())}else{let Y=_.async?A():H();if(_.modifying)i(w);U(()=>c(w,Y))}}function A(){let Y=f.let("ruleErrs",null);return f.try(()=>L(t._`await `),(K)=>f.assign(h,!1).if(t._`${K} instanceof ${P.ValidationError}`,()=>f.assign(Y,t._`${K}.errors`),()=>f.throw(K))),Y}function H(){let Y=t._`${y}.errors`;return f.assign(Y,null),L(t.nil),Y}function L(Y=_.async?t._`await `:t.nil){let K=P.opts.passContext?r.default.this:r.default.self,me=!(("compile"in _)&&!S||_.schema===!1);f.assign(h,t._`${Y}${(0,o.callValidateCode)(w,y,K,me)}`,_.modifying)}function U(Y){var K;f.if((0,t.not)((K=_.valid)!==null&&K!==void 0?K:h),Y)}}e.funcKeywordCode=a;function i(w){let{gen:_,data:b,it:f}=w;_.if(f.parentData,()=>_.assign(b,t._`${f.parentData}[${f.parentDataProperty}]`))}function c(w,_){let{gen:b}=w;b.if(t._`Array.isArray(${_})`,()=>{b.assign(r.default.vErrors,t._`${r.default.vErrors} === null ? ${_} : ${r.default.vErrors}.concat(${_})`).assign(r.default.errors,t._`${r.default.vErrors}.length`),(0,n.extendErrors)(w)},()=>w.error())}function l({schemaEnv:w},_){if(_.async&&!w.$async)throw Error("async keyword in sync schema")}function m(w,_,b){if(b===void 0)throw Error(`keyword "${_}" failed to compile`);return w.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,t.stringify)(b)})}function g(w,_,b=!1){return!_.length||_.some((f)=>f==="array"?Array.isArray(w):f==="object"?w&&typeof w=="object"&&!Array.isArray(w):typeof w==f||b&&typeof w>"u")}e.validSchemaType=g;function z({schema:w,opts:_,self:b,errSchemaPath:f},d,v){if(Array.isArray(d.keyword)?!d.keyword.includes(v):d.keyword!==v)throw Error("ajv implementation error");let p=d.dependencies;if(p===null||p===void 0?void 0:p.some((S)=>!Object.prototype.hasOwnProperty.call(w,S)))throw Error(`parent schema must have dependencies of ${v}: ${p.join(",")}`);if(d.validateSchema){if(!d.validateSchema(w[v])){let S=`keyword "${v}" value is invalid at path "${f}": `+b.errorsText(d.validateSchema.errors);if(_.validateSchema==="log")b.logger.error(S);else throw Error(S)}}}e.validateKeywordUsage=z}),$S=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=ce(),r=ge();function o(a,{keyword:i,schemaProp:c,schema:l,schemaPath:m,errSchemaPath:g,topSchemaRef:z}){if(i!==void 0&&l!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(i!==void 0){let w=a.schema[i];return c===void 0?{schema:w,schemaPath:t._`${a.schemaPath}${(0,t.getProperty)(i)}`,errSchemaPath:`${a.errSchemaPath}/${i}`}:{schema:w[c],schemaPath:t._`${a.schemaPath}${(0,t.getProperty)(i)}${(0,t.getProperty)(c)}`,errSchemaPath:`${a.errSchemaPath}/${i}/${(0,r.escapeFragment)(c)}`}}if(l!==void 0){if(m===void 0||g===void 0||z===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:m,topSchemaRef:z,errSchemaPath:g}}throw Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(a,i,{dataProp:c,dataPropType:l,data:m,dataTypes:g,propertyName:z}){if(m!==void 0&&c!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:w}=i;if(c!==void 0){let{errorPath:b,dataPathArr:f,opts:d}=i;_(w.let("data",t._`${i.data}${(0,t.getProperty)(c)}`,!0)),a.errorPath=t.str`${b}${(0,r.getErrorPath)(c,l,d.jsPropertySyntax)}`,a.parentDataProperty=t._`${c}`,a.dataPathArr=[...f,a.parentDataProperty]}if(m!==void 0){if(_(m instanceof t.Name?m:w.let("data",m,!0)),z!==void 0)a.propertyName=z}if(g)a.dataTypes=g;function _(b){a.data=b,a.dataLevel=i.dataLevel+1,a.dataTypes=[],i.definedProperties=new Set,a.parentData=i.data,a.dataNames=[...i.dataNames,b]}}e.extendSubschemaData=n;function s(a,{jtdDiscriminator:i,jtdMetadata:c,compositeRule:l,createErrors:m,allErrors:g}){if(l!==void 0)a.compositeRule=l;if(m!==void 0)a.createErrors=m;if(g!==void 0)a.allErrors=g;a.jtdDiscriminator=i,a.jtdMetadata=c}e.extendSubschemaMode=s}),Ih=D((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,a,i;if(Array.isArray(o)){if(s=o.length,s!=n.length)return!1;for(a=s;a--!==0;)if(!r(o[a],n[a]))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(i=Object.keys(o),s=i.length,s!==Object.keys(n).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=s;a--!==0;){var c=i[a];if(!r(o[c],n[c]))return!1}return!0}return o!==o&&n!==n}}),RS=D((e,t)=>{var r=t.exports=function(s,a,i){if(typeof a=="function")i=a,a={};i=a.cb||i;var c=typeof i=="function"?i:i.pre||function(){},l=i.post||function(){};o(a,c,l,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,a,i,c,l,m,g,z,w,_){if(c&&typeof c=="object"&&!Array.isArray(c)){a(c,l,m,g,z,w,_);for(var b in c){var f=c[b];if(Array.isArray(f)){if(b in r.arrayKeywords)for(var d=0;d<f.length;d++)o(s,a,i,f[d],l+"/"+b+"/"+d,m,l,b,c,d)}else if(b in r.propsKeywords){if(f&&typeof f=="object")for(var v in f)o(s,a,i,f[v],l+"/"+b+"/"+n(v),m,l,b,c,v)}else if(b in r.keywords||s.allKeys&&!(b in r.skipKeywords))o(s,a,i,f,l+"/"+b,m,l,b,c)}i(c,l,m,g,z,w,_)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}}),Ya=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=ge(),r=Ih(),o=RS(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(f,d=!0){if(typeof f=="boolean")return!0;if(d===!0)return!i(f);if(!d)return!1;return c(f)<=d}e.inlineRef=s;let a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(f){for(let d in f){if(a.has(d))return!0;let v=f[d];if(Array.isArray(v)&&v.some(i))return!0;if(typeof v=="object"&&i(v))return!0}return!1}function c(f){let d=0;for(let v in f){if(v==="$ref")return 1/0;if(d++,n.has(v))continue;if(typeof f[v]=="object")(0,t.eachItem)(f[v],(p)=>d+=c(p));if(d===1/0)return 1/0}return d}function l(f,d="",v){if(v!==!1)d=z(d);return m(f,f.parse(d))}e.getFullPath=l;function m(f,d){return f.serialize(d).split("#")[0]+"#"}e._getFullPath=m;let g=/#\/?$/;function z(f){return f?f.replace(g,""):""}e.normalizeId=z;function w(f,d,v){return v=z(v),f.resolve(d,v)}e.resolveUrl=w;let _=/^[a-z_][-a-z0-9._]*$/i;function b(f,d){if(typeof f=="boolean")return{};let{schemaId:v,uriResolver:p}=this.opts,S=z(f[v]||d),P={"":S},y=l(p,S,!1),h={},E=new Set;return o(f,{allKeys:!0},(L,U,Y,K)=>{if(K===void 0)return;let me=y+U,we=P[K];if(typeof L[v]=="string")we=ze.call(this,L[v]);Ne.call(this,L.$anchor),Ne.call(this,L.$dynamicAnchor),P[U]=we;function ze(fe){let I=this.opts.uriResolver.resolve;if(fe=z(we?I(we,fe):fe),E.has(fe))throw H(fe);E.add(fe);let q=this.refs[fe];if(typeof q=="string")q=this.refs[q];if(typeof q=="object")A(L,q.schema,fe);else if(fe!==z(me))if(fe[0]==="#")A(L,h[fe],fe),h[fe]=L;else this.refs[fe]=me;return fe}function Ne(fe){if(typeof fe=="string"){if(!_.test(fe))throw Error(`invalid anchor "${fe}"`);ze.call(this,`#${fe}`)}}}),h;function A(L,U,Y){if(U!==void 0&&!r(L,U))throw H(Y)}function H(L){return Error(`reference "${L}" resolves to more than one schema`)}}e.getSchemaRefs=b}),Zr=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=vS(),r=Ga(),o=Ch(),n=Ga(),s=bS(),a=zS(),i=$S(),c=ce(),l=at(),m=Ya(),g=ge(),z=Wa();function w(k){if(y(k)){if(E(k),P(k)){d(k);return}}_(k,()=>(0,t.topBoolOrEmptySchema)(k))}e.validateFunctionCode=w;function _({gen:k,validateName:x,schema:Z,schemaEnv:ne,opts:se},ue){if(se.code.es5)k.func(x,c._`${l.default.data}, ${l.default.valCxt}`,ne.$async,()=>{k.code(c._`"use strict"; ${p(Z,se)}`),f(k,se),k.code(ue)});else k.func(x,c._`${l.default.data}, ${b(se)}`,ne.$async,()=>k.code(p(Z,se)).code(ue))}function b(k){return c._`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${k.dynamicRef?c._`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function f(k,x){k.if(l.default.valCxt,()=>{if(k.var(l.default.instancePath,c._`${l.default.valCxt}.${l.default.instancePath}`),k.var(l.default.parentData,c._`${l.default.valCxt}.${l.default.parentData}`),k.var(l.default.parentDataProperty,c._`${l.default.valCxt}.${l.default.parentDataProperty}`),k.var(l.default.rootData,c._`${l.default.valCxt}.${l.default.rootData}`),x.dynamicRef)k.var(l.default.dynamicAnchors,c._`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{if(k.var(l.default.instancePath,c._`""`),k.var(l.default.parentData,c._`undefined`),k.var(l.default.parentDataProperty,c._`undefined`),k.var(l.default.rootData,l.default.data),x.dynamicRef)k.var(l.default.dynamicAnchors,c._`{}`)})}function d(k){let{schema:x,opts:Z,gen:ne}=k;_(k,()=>{if(Z.$comment&&x.$comment)K(k);if(L(k),ne.let(l.default.vErrors,null),ne.let(l.default.errors,0),Z.unevaluated)v(k);A(k),me(k)})}function v(k){let{gen:x,validateName:Z}=k;k.evaluated=x.const("evaluated",c._`${Z}.evaluated`),x.if(c._`${k.evaluated}.dynamicProps`,()=>x.assign(c._`${k.evaluated}.props`,c._`undefined`)),x.if(c._`${k.evaluated}.dynamicItems`,()=>x.assign(c._`${k.evaluated}.items`,c._`undefined`))}function p(k,x){let Z=typeof k=="object"&&k[x.schemaId];return Z&&(x.code.source||x.code.process)?c._`/*# sourceURL=${Z} */`:c.nil}function S(k,x){if(y(k)){if(E(k),P(k)){h(k,x);return}}(0,t.boolOrEmptySchema)(k,x)}function P({schema:k,self:x}){if(typeof k=="boolean")return!k;for(let Z in k)if(x.RULES.all[Z])return!0;return!1}function y(k){return typeof k.schema!="boolean"}function h(k,x){let{schema:Z,gen:ne,opts:se}=k;if(se.$comment&&Z.$comment)K(k);U(k),Y(k);let ue=ne.const("_errs",l.default.errors);A(k,ue),ne.var(x,c._`${ue} === ${l.default.errors}`)}function E(k){(0,g.checkUnknownRules)(k),H(k)}function A(k,x){if(k.opts.jtd)return ze(k,[],!1,x);let Z=(0,r.getSchemaTypes)(k.schema);ze(k,Z,!(0,r.coerceAndCheckDataType)(k,Z),x)}function H(k){let{schema:x,errSchemaPath:Z,opts:ne,self:se}=k;if(x.$ref&&ne.ignoreKeywordsWithRef&&(0,g.schemaHasRulesButRef)(x,se.RULES))se.logger.warn(`$ref: keywords ignored in schema at path "${Z}"`)}function L(k){let{schema:x,opts:Z}=k;if(x.default!==void 0&&Z.useDefaults&&Z.strictSchema)(0,g.checkStrictMode)(k,"default is ignored in the schema root")}function U(k){let x=k.schema[k.opts.schemaId];if(x)k.baseId=(0,m.resolveUrl)(k.opts.uriResolver,k.baseId,x)}function Y(k){if(k.schema.$async&&!k.schemaEnv.$async)throw Error("async schema in sync schema")}function K({gen:k,schemaEnv:x,schema:Z,errSchemaPath:ne,opts:se}){let ue=Z.$comment;if(se.$comment===!0)k.code(c._`${l.default.self}.logger.log(${ue})`);else if(typeof se.$comment=="function"){let Ie=c.str`${ne}/$comment`,qe=k.scopeValue("root",{ref:x.root});k.code(c._`${l.default.self}.opts.$comment(${ue}, ${Ie}, ${qe}.schema)`)}}function me(k){let{gen:x,schemaEnv:Z,validateName:ne,ValidationError:se,opts:ue}=k;if(Z.$async)x.if(c._`${l.default.errors} === 0`,()=>x.return(l.default.data),()=>x.throw(c._`new ${se}(${l.default.vErrors})`));else{if(x.assign(c._`${ne}.errors`,l.default.vErrors),ue.unevaluated)we(k);x.return(c._`${l.default.errors} === 0`)}}function we({gen:k,evaluated:x,props:Z,items:ne}){if(Z instanceof c.Name)k.assign(c._`${x}.props`,Z);if(ne instanceof c.Name)k.assign(c._`${x}.items`,ne)}function ze(k,x,Z,ne){let{gen:se,schema:ue,data:Ie,allErrors:qe,opts:Ze,self:je}=k,{RULES:Ee}=je;if(ue.$ref&&(Ze.ignoreKeywordsWithRef||!(0,g.schemaHasRulesButRef)(ue,Ee))){se.block(()=>de(k,"$ref",Ee.all.$ref.definition));return}if(!Ze.jtd)fe(k,x);se.block(()=>{for(let xe of Ee.rules)Qe(xe);Qe(Ee.post)});function Qe(xe){if(!(0,o.shouldUseGroup)(ue,xe))return;if(xe.type){if(se.if((0,n.checkDataType)(xe.type,Ie,Ze.strictNumbers)),Ne(k,xe),x.length===1&&x[0]===xe.type&&Z)se.else(),(0,n.reportTypeError)(k);se.endIf()}else Ne(k,xe);if(!qe)se.if(c._`${l.default.errors} === ${ne||0}`)}}function Ne(k,x){let{gen:Z,schema:ne,opts:{useDefaults:se}}=k;if(se)(0,s.assignDefaults)(k,x.type);Z.block(()=>{for(let ue of x.rules)if((0,o.shouldUseRule)(ne,ue))de(k,ue.keyword,ue.definition,x.type)})}function fe(k,x){if(k.schemaEnv.meta||!k.opts.strictTypes)return;if(I(k,x),!k.opts.allowUnionTypes)q(k,x);V(k,k.dataTypes)}function I(k,x){if(!x.length)return;if(!k.dataTypes.length){k.dataTypes=x;return}x.forEach((Z)=>{if(!C(k.dataTypes,Z))J(k,`type "${Z}" not allowed by context "${k.dataTypes.join(",")}"`)}),j(k,x)}function q(k,x){if(x.length>1&&!(x.length===2&&x.includes("null")))J(k,"use allowUnionTypes to allow union type keyword")}function V(k,x){let Z=k.self.RULES.all;for(let ne in Z){let se=Z[ne];if(typeof se=="object"&&(0,o.shouldUseRule)(k.schema,se)){let{type:ue}=se.definition;if(ue.length&&!ue.some((Ie)=>R(x,Ie)))J(k,`missing type "${ue.join(",")}" for keyword "${ne}"`)}}}function R(k,x){return k.includes(x)||x==="number"&&k.includes("integer")}function C(k,x){return k.includes(x)||x==="integer"&&k.includes("number")}function j(k,x){let Z=[];for(let ne of k.dataTypes)if(C(x,ne))Z.push(ne);else if(x.includes("integer")&&ne==="number")Z.push("integer");k.dataTypes=Z}function J(k,x){let Z=k.schemaEnv.baseId+k.errSchemaPath;x+=` at "${Z}" (strictTypes)`,(0,g.checkStrictMode)(k,x,k.opts.strictTypes)}var te=class{constructor(k,x,Z){if((0,a.validateKeywordUsage)(k,x,Z),this.gen=k.gen,this.allErrors=k.allErrors,this.keyword=Z,this.data=k.data,this.schema=k.schema[Z],this.$data=x.$data&&k.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,g.schemaRefOrVal)(k,this.schema,Z,this.$data),this.schemaType=x.schemaType,this.parentSchema=k.schema,this.params={},this.it=k,this.def=x,this.$data)this.schemaCode=k.gen.const("vSchema",He(this.$data,k));else if(this.schemaCode=this.schemaValue,!(0,a.validSchemaType)(this.schema,x.schemaType,x.allowUndefined))throw Error(`${Z} value must be ${JSON.stringify(x.schemaType)}`);if("code"in x?x.trackErrors:x.errors!==!1)this.errsCount=k.gen.const("_errs",l.default.errors)}result(k,x,Z){this.failResult((0,c.not)(k),x,Z)}failResult(k,x,Z){if(this.gen.if(k),Z)Z();else this.error();if(x){if(this.gen.else(),x(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(k,x){this.failResult((0,c.not)(k),void 0,x)}fail(k){if(k===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(k),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(k){if(!this.$data)return this.fail(k);let{schemaCode:x}=this;this.fail(c._`${x} !== undefined && (${(0,c.or)(this.invalid$data(),k)})`)}error(k,x,Z){if(x){this.setParams(x),this._error(k,Z),this.setParams({});return}this._error(k,Z)}_error(k,x){(k?z.reportExtraError:z.reportError)(this,this.def.error,x)}$dataError(){(0,z.reportError)(this,this.def.$dataError||z.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,z.resetErrorsCount)(this.gen,this.errsCount)}ok(k){if(!this.allErrors)this.gen.if(k)}setParams(k,x){if(x)Object.assign(this.params,k);else this.params=k}block$data(k,x,Z=c.nil){this.gen.block(()=>{this.check$data(k,Z),x()})}check$data(k=c.nil,x=c.nil){if(!this.$data)return;let{gen:Z,schemaCode:ne,schemaType:se,def:ue}=this;if(Z.if((0,c.or)(c._`${ne} === undefined`,x)),k!==c.nil)Z.assign(k,!0);if(se.length||ue.validateSchema){if(Z.elseIf(this.invalid$data()),this.$dataError(),k!==c.nil)Z.assign(k,!1)}Z.else()}invalid$data(){let{gen:k,schemaCode:x,schemaType:Z,def:ne,it:se}=this;return(0,c.or)(ue(),Ie());function ue(){if(Z.length){if(!(x instanceof c.Name))throw Error("ajv implementation error");let qe=Array.isArray(Z)?Z:[Z];return c._`${(0,n.checkDataTypes)(qe,x,se.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function Ie(){if(ne.validateSchema){let qe=k.scopeValue("validate$data",{ref:ne.validateSchema});return c._`!${qe}(${x})`}return c.nil}}subschema(k,x){let Z=(0,i.getSubschema)(this.it,k);(0,i.extendSubschemaData)(Z,this.it,k),(0,i.extendSubschemaMode)(Z,k);let ne={...this.it,...Z,items:void 0,props:void 0};return S(ne,x),ne}mergeEvaluated(k,x){let{it:Z,gen:ne}=this;if(!Z.opts.unevaluated)return;if(Z.props!==!0&&k.props!==void 0)Z.props=g.mergeEvaluated.props(ne,k.props,Z.props,x);if(Z.items!==!0&&k.items!==void 0)Z.items=g.mergeEvaluated.items(ne,k.items,Z.items,x)}mergeValidEvaluated(k,x){let{it:Z,gen:ne}=this;if(Z.opts.unevaluated&&(Z.props!==!0||Z.items!==!0))return ne.if(x,()=>this.mergeEvaluated(k,c.Name)),!0}};e.KeywordCxt=te;function de(k,x,Z,ne){let se=new te(k,Z,x);if("code"in Z)Z.code(se,ne);else if(se.$data&&Z.validate)(0,a.funcKeywordCode)(se,Z);else if("macro"in Z)(0,a.macroKeywordCode)(se,Z);else if(Z.compile||Z.validate)(0,a.funcKeywordCode)(se,Z)}let ae=/^\/(?:[^~]|~0|~1)*$/,$e=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function He(k,{dataLevel:x,dataNames:Z,dataPathArr:ne}){let se,ue;if(k==="")return l.default.rootData;if(k[0]==="/"){if(!ae.test(k))throw Error(`Invalid JSON-pointer: ${k}`);se=k,ue=l.default.rootData}else{let je=$e.exec(k);if(!je)throw Error(`Invalid JSON-pointer: ${k}`);let Ee=+je[1];if(se=je[2],se==="#"){if(Ee>=x)throw Error(Ze("property/index",Ee));return ne[x-Ee]}if(Ee>x)throw Error(Ze("data",Ee));if(ue=Z[x-Ee],!se)return ue}let Ie=ue,qe=se.split("/");for(let je of qe)if(je)ue=c._`${ue}${(0,c.getProperty)((0,g.unescapeJsonPointer)(je))}`,Ie=c._`${Ie} && ${ue}`;return Ie;function Ze(je,Ee){return`Cannot access ${je} ${Ee} levels up, current level is ${x}`}}e.getData=He}),pn=D((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}),Dr=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ya();var r=class extends Error{constructor(o,n,s,a){super(a||`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}),Xa=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=ce(),r=pn(),o=at(),n=Ya(),s=ge(),a=Zr();var i=class{constructor(d){var v;this.refs={},this.dynamicAnchors={};let p;if(typeof d.schema=="object")p=d.schema;this.schema=d.schema,this.schemaId=d.schemaId,this.root=d.root||this,this.baseId=(v=d.baseId)!==null&&v!==void 0?v:(0,n.normalizeId)(p===null||p===void 0?void 0:p[d.schemaId||"$id"]),this.schemaPath=d.schemaPath,this.localRefs=d.localRefs,this.meta=d.meta,this.$async=p===null||p===void 0?void 0:p.$async,this.refs={}}};e.SchemaEnv=i;function c(d){let v=g.call(this,d);if(v)return v;let p=(0,n.getFullPath)(this.opts.uriResolver,d.root.baseId),{es5:S,lines:P}=this.opts.code,{ownProperties:y}=this.opts,h=new t.CodeGen(this.scope,{es5:S,lines:P,ownProperties:y}),E;if(d.$async)E=h.scopeValue("Error",{ref:r.default,code:t._`require("ajv/dist/runtime/validation_error").default`});let A=h.scopeName("validate");d.validateName=A;let H={gen:h,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:h.scopeValue("schema",this.opts.code.source===!0?{ref:d.schema,code:(0,t.stringify)(d.schema)}:{ref:d.schema}),validateName:A,ValidationError:E,schema:d.schema,schemaEnv:d,rootId:p,baseId:d.baseId||p,schemaPath:t.nil,errSchemaPath:d.schemaPath||(this.opts.jtd?"":"#"),errorPath:t._`""`,opts:this.opts,self:this},L;try{this._compilations.add(d),(0,a.validateFunctionCode)(H),h.optimize(this.opts.code.optimize);let U=h.toString();if(L=`${h.scopeRefs(o.default.scope)}return ${U}`,this.opts.code.process)L=this.opts.code.process(L,d);let Y=Function(`${o.default.self}`,`${o.default.scope}`,L)(this,this.scope.get());if(this.scope.value(A,{ref:Y}),Y.errors=null,Y.schema=d.schema,Y.schemaEnv=d,d.$async)Y.$async=!0;if(this.opts.code.source===!0)Y.source={validateName:A,validateCode:U,scopeValues:h._values};if(this.opts.unevaluated){let{props:K,items:me}=H;if(Y.evaluated={props:K instanceof t.Name?void 0:K,items:me instanceof t.Name?void 0:me,dynamicProps:K instanceof t.Name,dynamicItems:me instanceof t.Name},Y.source)Y.source.evaluated=(0,t.stringify)(Y.evaluated)}return d.validate=Y,d}catch(U){if(delete d.validate,delete d.validateName,L)this.logger.error("Error compiling schema, function code:",L);throw U}finally{this._compilations.delete(d)}}e.compileSchema=c;function l(d,v,p){var S;p=(0,n.resolveUrl)(this.opts.uriResolver,v,p);let P=d.refs[p];if(P)return P;let y=w.call(this,d,p);if(y===void 0){let h=(S=d.localRefs)===null||S===void 0?void 0:S[p],{schemaId:E}=this.opts;if(h)y=new i({schema:h,schemaId:E,root:d,baseId:v})}if(y===void 0)return;return d.refs[p]=m.call(this,y)}e.resolveRef=l;function m(d){if((0,n.inlineRef)(d.schema,this.opts.inlineRefs))return d.schema;return d.validate?d:c.call(this,d)}function g(d){for(let v of this._compilations)if(z(v,d))return v}e.getCompilingSchema=g;function z(d,v){return d.schema===v.schema&&d.root===v.root&&d.baseId===v.baseId}function w(d,v){let p;while(typeof(p=this.refs[v])=="string")v=p;return p||this.schemas[v]||_.call(this,d,v)}function _(d,v){let p=this.opts.uriResolver.parse(v),S=(0,n._getFullPath)(this.opts.uriResolver,p),P=(0,n.getFullPath)(this.opts.uriResolver,d.baseId,void 0);if(Object.keys(d.schema).length>0&&S===P)return f.call(this,p,d);let y=(0,n.normalizeId)(S),h=this.refs[y]||this.schemas[y];if(typeof h=="string"){let E=_.call(this,d,h);if(typeof(E===null||E===void 0?void 0:E.schema)!=="object")return;return f.call(this,p,E)}if(typeof(h===null||h===void 0?void 0:h.schema)!=="object")return;if(!h.validate)c.call(this,h);if(y===(0,n.normalizeId)(v)){let{schema:E}=h,{schemaId:A}=this.opts,H=E[A];if(H)P=(0,n.resolveUrl)(this.opts.uriResolver,P,H);return new i({schema:E,schemaId:A,root:d,baseId:P})}return f.call(this,p,h)}e.resolveSchema=_;let b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function f(d,{baseId:v,schema:p,root:S}){var P;if(((P=d.fragment)===null||P===void 0?void 0:P[0])!=="/")return;for(let E of d.fragment.slice(1).split("/")){if(typeof p==="boolean")return;let A=p[(0,s.unescapeFragment)(E)];if(A===void 0)return;p=A;let H=typeof p==="object"&&p[this.opts.schemaId];if(!b.has(E)&&H)v=(0,n.resolveUrl)(this.opts.uriResolver,v,H)}let y;if(typeof p!="boolean"&&p.$ref&&!(0,s.schemaHasRulesButRef)(p,this.RULES)){let E=(0,n.resolveUrl)(this.opts.uriResolver,v,p.$ref);y=_.call(this,S,E)}let{schemaId:h}=this.opts;if(y=y||new i({schema:p,schemaId:h,root:S,baseId:v}),y.schema!==y.root.schema)return y}}),wS=D((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}}),Oh=D((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(_){let b="",f=0,d=0;for(d=0;d<_.length;d++){if(f=_[d].charCodeAt(0),f===48)continue;if(!(f>=48&&f<=57||f>=65&&f<=70||f>=97&&f<=102))return"";b+=_[d];break}for(d+=1;d<_.length;d++){if(f=_[d].charCodeAt(0),!(f>=48&&f<=57||f>=65&&f<=70||f>=97&&f<=102))return"";b+=_[d]}return b}let s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function a(_){return _.length=0,!0}function i(_,b,f){if(_.length){let d=n(_);if(d!=="")b.push(d);else return f.error=!0,!1;_.length=0}return!0}function c(_){let b=0,f={error:!1,address:"",zone:""},d=[],v=[],p=!1,S=!1,P=i;for(let y=0;y<_.length;y++){let h=_[y];if(h==="["||h==="]")continue;if(h===":"){if(p===!0)S=!0;if(!P(v,d,f))break;if(++b>7){f.error=!0;break}if(y>0&&_[y-1]===":")p=!0;d.push(":");continue}else if(h==="%"){if(!P(v,d,f))break;P=a}else{v.push(h);continue}}if(v.length)if(P===a)f.zone=v.join("");else if(S)d.push(v.join(""));else d.push(n(v));return f.address=d.join(""),f}function l(_){if(m(_,":")<2)return{host:_,isIPV6:!1};let b=c(_);if(!b.error){let{address:f,address:d}=b;if(b.zone)f+="%"+b.zone,d+="%25"+b.zone;return{host:f,isIPV6:!0,escapedHost:d}}else return{host:_,isIPV6:!1}}function m(_,b){let f=0;for(let d=0;d<_.length;d++)if(_[d]===b)f++;return f}function g(_){let b=_,f=[],d=-1,v=0;while(v=b.length){if(v===1)if(b===".")break;else if(b==="/"){f.push("/");break}else{f.push(b);break}else if(v===2){if(b[0]==="."){if(b[1]===".")break;else if(b[1]==="/"){b=b.slice(2);continue}}else if(b[0]==="/"){if(b[1]==="."||b[1]==="/"){f.push("/");break}}}else if(v===3){if(b==="/.."){if(f.length!==0)f.pop();f.push("/");break}}if(b[0]==="."){if(b[1]==="."){if(b[2]==="/"){b=b.slice(3);continue}}else if(b[1]==="/"){b=b.slice(2);continue}}else if(b[0]==="/"){if(b[1]==="."){if(b[2]==="/"){b=b.slice(2);continue}else if(b[2]==="."){if(b[3]==="/"){if(b=b.slice(3),f.length!==0)f.pop();continue}}}}if((d=b.indexOf("/",1))===-1){f.push(b);break}else f.push(b.slice(0,d)),b=b.slice(d)}return f.join("")}function z(_,b){let f=b!==!0?escape:unescape;if(_.scheme!==void 0)_.scheme=f(_.scheme);if(_.userinfo!==void 0)_.userinfo=f(_.userinfo);if(_.host!==void 0)_.host=f(_.host);if(_.path!==void 0)_.path=f(_.path);if(_.query!==void 0)_.query=f(_.query);if(_.fragment!==void 0)_.fragment=f(_.fragment);return _}function w(_){let b=[];if(_.userinfo!==void 0)b.push(_.userinfo),b.push("@");if(_.host!==void 0){let f=unescape(_.host);if(!o(f)){let d=l(f);if(d.isIPV6===!0)f=`[${d.escapedHost}]`;else f=_.host}b.push(f)}if(typeof _.port==="number"||typeof _.port==="string")b.push(":"),b.push(String(_.port));return b.length?b.join(""):void 0}t.exports={nonSimpleDomain:s,recomposeAuthority:w,normalizeComponentEncoding:z,removeDotSegments:g,isIPv4:o,isUUID:r,normalizeIPv6:l,stringArrayToHexStripped:n}}),PS=D((e,t)=>{let{isUUID:r}=Oh(),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(h){return n.indexOf(h)!==-1}function a(h){if(h.secure===!0)return!0;else if(h.secure===!1)return!1;else if(h.scheme)return h.scheme.length===3&&(h.scheme[0]==="w"||h.scheme[0]==="W")&&(h.scheme[1]==="s"||h.scheme[1]==="S")&&(h.scheme[2]==="s"||h.scheme[2]==="S");else return!1}function i(h){if(!h.host)h.error=h.error||"HTTP URIs must have a host.";return h}function c(h){let E=String(h.scheme).toLowerCase()==="https";if(h.port===(E?443:80)||h.port==="")h.port=void 0;if(!h.path)h.path="/";return h}function l(h){return h.secure=a(h),h.resourceName=(h.path||"/")+(h.query?"?"+h.query:""),h.path=void 0,h.query=void 0,h}function m(h){if(h.port===(a(h)?443:80)||h.port==="")h.port=void 0;if(typeof h.secure==="boolean")h.scheme=h.secure?"wss":"ws",h.secure=void 0;if(h.resourceName){let[E,A]=h.resourceName.split("?");h.path=E&&E!=="/"?E:void 0,h.query=A,h.resourceName=void 0}return h.fragment=void 0,h}function g(h,E){if(!h.path)return h.error="URN can not be parsed",h;let A=h.path.match(o);if(A){let H=E.scheme||h.scheme||"urn";h.nid=A[1].toLowerCase(),h.nss=A[2];let L=y(`${H}:${E.nid||h.nid}`);if(h.path=void 0,L)h=L.parse(h,E)}else h.error=h.error||"URN can not be parsed.";return h}function z(h,E){if(h.nid===void 0)throw Error("URN without nid cannot be serialized");let A=E.scheme||h.scheme||"urn",H=h.nid.toLowerCase(),L=y(`${A}:${E.nid||H}`);if(L)h=L.serialize(h,E);let U=h,Y=h.nss;return U.path=`${H||E.nid}:${Y}`,E.skipEscape=!0,U}function w(h,E){let A=h;if(A.uuid=A.nss,A.nss=void 0,!E.tolerant&&(!A.uuid||!r(A.uuid)))A.error=A.error||"UUID is not valid.";return A}function _(h){let E=h;return E.nss=(h.uuid||"").toLowerCase(),E}let b={scheme:"http",domainHost:!0,parse:i,serialize:c},f={scheme:"https",domainHost:b.domainHost,parse:i,serialize:c},d={scheme:"ws",domainHost:!0,parse:l,serialize:m},v={scheme:"wss",domainHost:d.domainHost,parse:d.parse,serialize:d.serialize},P={http:b,https:f,ws:d,wss:v,urn:{scheme:"urn",parse:g,serialize:z,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:w,serialize:_,skipNormalize:!0}};Object.setPrototypeOf(P,null);function y(h){return h&&(P[h]||P[h.toLowerCase()])||void 0}t.exports={wsIsSecure:a,SCHEMES:P,isValidSchemeName:s,getSchemeHandler:y}}),ES=D((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:a,nonSimpleDomain:i}=Oh(),{SCHEMES:c,getSchemeHandler:l}=PS();function m(v,p){if(typeof v==="string")v=_(f(v,p),p);else if(typeof v==="object")v=f(_(v,p),p);return v}function g(v,p,S){let P=S?Object.assign({scheme:"null"},S):{scheme:"null"},y=z(f(v,P),f(p,P),P,!0);return P.skipEscape=!0,_(y,P)}function z(v,p,S,P){let y={};if(!P)v=f(_(v,S),S),p=f(_(p,S),S);if(S=S||{},!S.tolerant&&p.scheme)y.scheme=p.scheme,y.userinfo=p.userinfo,y.host=p.host,y.port=p.port,y.path=o(p.path||""),y.query=p.query;else{if(p.userinfo!==void 0||p.host!==void 0||p.port!==void 0)y.userinfo=p.userinfo,y.host=p.host,y.port=p.port,y.path=o(p.path||""),y.query=p.query;else{if(!p.path)if(y.path=v.path,p.query!==void 0)y.query=p.query;else y.query=v.query;else{if(p.path[0]==="/")y.path=o(p.path);else{if((v.userinfo!==void 0||v.host!==void 0||v.port!==void 0)&&!v.path)y.path="/"+p.path;else if(!v.path)y.path=p.path;else y.path=v.path.slice(0,v.path.lastIndexOf("/")+1)+p.path;y.path=o(y.path)}y.query=p.query}y.userinfo=v.userinfo,y.host=v.host,y.port=v.port}y.scheme=v.scheme}return y.fragment=p.fragment,y}function w(v,p,S){if(typeof v==="string")v=unescape(v),v=_(s(f(v,S),!0),{...S,skipEscape:!0});else if(typeof v==="object")v=_(s(v,!0),{...S,skipEscape:!0});if(typeof p==="string")p=unescape(p),p=_(s(f(p,S),!0),{...S,skipEscape:!0});else if(typeof p==="object")p=_(s(p,!0),{...S,skipEscape:!0});return v.toLowerCase()===p.toLowerCase()}function _(v,p){let S={host:v.host,scheme:v.scheme,userinfo:v.userinfo,port:v.port,path:v.path,query:v.query,nid:v.nid,nss:v.nss,uuid:v.uuid,fragment:v.fragment,reference:v.reference,resourceName:v.resourceName,secure:v.secure,error:""},P=Object.assign({},p),y=[],h=l(P.scheme||S.scheme);if(h&&h.serialize)h.serialize(S,P);if(S.path!==void 0)if(!P.skipEscape){if(S.path=escape(S.path),S.scheme!==void 0)S.path=S.path.split("%3A").join(":")}else S.path=unescape(S.path);if(P.reference!=="suffix"&&S.scheme)y.push(S.scheme,":");let E=n(S);if(E!==void 0){if(P.reference!=="suffix")y.push("//");if(y.push(E),S.path&&S.path[0]!=="/")y.push("/")}if(S.path!==void 0){let A=S.path;if(!P.absolutePath&&(!h||!h.absolutePath))A=o(A);if(E===void 0&&A[0]==="/"&&A[1]==="/")A="/%2F"+A.slice(2);y.push(A)}if(S.query!==void 0)y.push("?",S.query);if(S.fragment!==void 0)y.push("#",S.fragment);return y.join("")}let b=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function f(v,p){let S=Object.assign({},p),P={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},y=!1;if(S.reference==="suffix")if(S.scheme)v=S.scheme+":"+v;else v="//"+v;let h=v.match(b);if(h){if(P.scheme=h[1],P.userinfo=h[3],P.host=h[4],P.port=parseInt(h[5],10),P.path=h[6]||"",P.query=h[7],P.fragment=h[8],isNaN(P.port))P.port=h[5];if(P.host)if(a(P.host)===!1){let A=r(P.host);P.host=A.host.toLowerCase(),y=A.isIPV6}else y=!0;if(P.scheme===void 0&&P.userinfo===void 0&&P.host===void 0&&P.port===void 0&&P.query===void 0&&!P.path)P.reference="same-document";else if(P.scheme===void 0)P.reference="relative";else if(P.fragment===void 0)P.reference="absolute";else P.reference="uri";if(S.reference&&S.reference!=="suffix"&&S.reference!==P.reference)P.error=P.error||"URI is not a "+S.reference+" reference.";let E=l(S.scheme||P.scheme);if(!S.unicodeSupport&&(!E||!E.unicodeSupport)){if(P.host&&(S.domainHost||E&&E.domainHost)&&y===!1&&i(P.host))try{P.host=URL.domainToASCII(P.host.toLowerCase())}catch(A){P.error=P.error||"Host's domain name can not be converted to ASCII: "+A}}if(!E||E&&!E.skipNormalize){if(v.indexOf("%")!==-1){if(P.scheme!==void 0)P.scheme=unescape(P.scheme);if(P.host!==void 0)P.host=unescape(P.host)}if(P.path)P.path=escape(unescape(P.path));if(P.fragment)P.fragment=encodeURI(decodeURIComponent(P.fragment))}if(E&&E.parse)E.parse(P,S)}else P.error=P.error||"URI can not be parsed.";return P}let d={SCHEMES:c,normalize:m,resolve:g,resolveComponent:z,equal:w,serialize:_,parse:f};t.exports=d,t.exports.default=d,t.exports.fastUri=d}),TS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ES();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),bu=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Zr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ce();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=pn(),n=Dr(),s=kh(),a=Xa(),i=ce(),c=Ya(),l=Ga(),m=ge(),g=wS(),z=TS(),w=(I,q)=>new RegExp(I,q);w.code="new RegExp";let _=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f={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."},d={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function p(I){var q,V,R,C,j,J,te,de,ae,$e,He,k,x,Z,ne,se,ue,Ie,qe,Ze,je,Ee,Qe,xe,ut;let ot=I.strict,lt=(q=I.code)===null||q===void 0?void 0:q.optimize,yt=lt===!0||lt===void 0?1:lt||0,vt=(R=(V=I.code)===null||V===void 0?void 0:V.regExp)!==null&&R!==void 0?R:w,Lt=(C=I.uriResolver)!==null&&C!==void 0?C:z.default;return{strictSchema:(J=(j=I.strictSchema)!==null&&j!==void 0?j:ot)!==null&&J!==void 0?J:!0,strictNumbers:(de=(te=I.strictNumbers)!==null&&te!==void 0?te:ot)!==null&&de!==void 0?de:!0,strictTypes:($e=(ae=I.strictTypes)!==null&&ae!==void 0?ae:ot)!==null&&$e!==void 0?$e:"log",strictTuples:(k=(He=I.strictTuples)!==null&&He!==void 0?He:ot)!==null&&k!==void 0?k:"log",strictRequired:(Z=(x=I.strictRequired)!==null&&x!==void 0?x:ot)!==null&&Z!==void 0?Z:!1,code:I.code?{...I.code,optimize:yt,regExp:vt}:{optimize:yt,regExp:vt},loopRequired:(ne=I.loopRequired)!==null&&ne!==void 0?ne:v,loopEnum:(se=I.loopEnum)!==null&&se!==void 0?se:v,meta:(ue=I.meta)!==null&&ue!==void 0?ue:!0,messages:(Ie=I.messages)!==null&&Ie!==void 0?Ie:!0,inlineRefs:(qe=I.inlineRefs)!==null&&qe!==void 0?qe:!0,schemaId:(Ze=I.schemaId)!==null&&Ze!==void 0?Ze:"$id",addUsedSchema:(je=I.addUsedSchema)!==null&&je!==void 0?je:!0,validateSchema:(Ee=I.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(Qe=I.validateFormats)!==null&&Qe!==void 0?Qe:!0,unicodeRegExp:(xe=I.unicodeRegExp)!==null&&xe!==void 0?xe:!0,int32range:(ut=I.int32range)!==null&&ut!==void 0?ut:!0,uriResolver:Lt}}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,...p(I)};let{es5:q,lines:V}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:b,es5:q,lines:V}),this.logger=U(I.logger);let R=I.validateFormats;if(I.validateFormats=!1,this.RULES=(0,s.getRules)(),P.call(this,f,I,"NOT SUPPORTED"),P.call(this,d,I,"DEPRECATED","warn"),this._metaOpts=H.call(this),I.formats)E.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),I.keywords)A.call(this,I.keywords);if(typeof I.meta=="object")this.addMetaSchema(I.meta);h.call(this),I.validateFormats=R}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:I,meta:q,schemaId:V}=this.opts,R=g;if(V==="id")R={...g},R.id=R.$id,delete R.$id;if(q&&I)this.addMetaSchema(R,R[V],!1)}defaultMeta(){let{meta:I,schemaId:q}=this.opts;return this.opts.defaultMeta=typeof I=="object"?I[q]||I:void 0}validate(I,q){let V;if(typeof I=="string"){if(V=this.getSchema(I),!V)throw Error(`no schema with key or ref "${I}"`)}else V=this.compile(I);let R=V(q);if(!("$async"in V))this.errors=V.errors;return R}compile(I,q){let V=this._addSchema(I,q);return V.validate||this._compileSchemaEnv(V)}compileAsync(I,q){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:V}=this.opts;return R.call(this,I,q);async function R(ae,$e){await C.call(this,ae.$schema);let He=this._addSchema(ae,$e);return He.validate||j.call(this,He)}async function C(ae){if(ae&&!this.getSchema(ae))await R.call(this,{$ref:ae},!0)}async function j(ae){try{return this._compileSchemaEnv(ae)}catch($e){if(!($e instanceof n.default))throw $e;return J.call(this,$e),await te.call(this,$e.missingSchema),j.call(this,ae)}}function J({missingSchema:ae,missingRef:$e}){if(this.refs[ae])throw Error(`AnySchema ${ae} is loaded but ${$e} cannot be resolved`)}async function te(ae){let $e=await de.call(this,ae);if(!this.refs[ae])await C.call(this,$e.$schema);if(!this.refs[ae])this.addSchema($e,ae,q)}async function de(ae){let $e=this._loading[ae];if($e)return $e;try{return await(this._loading[ae]=V(ae))}finally{delete this._loading[ae]}}}addSchema(I,q,V,R=this.opts.validateSchema){if(Array.isArray(I)){for(let j of I)this.addSchema(j,void 0,V,R);return this}let C;if(typeof I==="object"){let{schemaId:j}=this.opts;if(C=I[j],C!==void 0&&typeof C!="string")throw Error(`schema ${j} must be string`)}return q=(0,c.normalizeId)(q||C),this._checkUnique(q),this.schemas[q]=this._addSchema(I,V,q,R,!0),this}addMetaSchema(I,q,V=this.opts.validateSchema){return this.addSchema(I,q,!0,V),this}validateSchema(I,q){if(typeof I=="boolean")return!0;let V;if(V=I.$schema,V!==void 0&&typeof V!="string")throw Error("$schema must be a string");if(V=V||this.opts.defaultMeta||this.defaultMeta(),!V)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let R=this.validate(V,I);if(!R&&q){let C="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(C);else throw Error(C)}return R}getSchema(I){let q;while(typeof(q=y.call(this,I))=="string")I=q;if(q===void 0){let{schemaId:V}=this.opts,R=new a.SchemaEnv({schema:{},schemaId:V});if(q=a.resolveSchema.call(this,R,I),!q)return;this.refs[I]=q}return q.validate||this._compileSchemaEnv(q)}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 q=y.call(this,I);if(typeof q=="object")this._cache.delete(q.schema);return delete this.schemas[I],delete this.refs[I],this}case"object":{let q=I;this._cache.delete(q);let V=I[this.opts.schemaId];if(V)V=(0,c.normalizeId)(V),delete this.schemas[V],delete this.refs[V];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(I){for(let q of I)this.addKeyword(q);return this}addKeyword(I,q){let V;if(typeof I=="string"){if(V=I,typeof q=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),q.keyword=V}else if(typeof I=="object"&&q===void 0){if(q=I,V=q.keyword,Array.isArray(V)&&!V.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(K.call(this,V,q),!q)return(0,m.eachItem)(V,(C)=>me.call(this,C)),this;ze.call(this,q);let R={...q,type:(0,l.getJSONTypes)(q.type),schemaType:(0,l.getJSONTypes)(q.schemaType)};return(0,m.eachItem)(V,R.type.length===0?(C)=>me.call(this,C,R):(C)=>R.type.forEach((j)=>me.call(this,C,R,j))),this}getKeyword(I){let q=this.RULES.all[I];return typeof q=="object"?q.definition:!!q}removeKeyword(I){let{RULES:q}=this;delete q.keywords[I],delete q.all[I];for(let V of q.rules){let R=V.rules.findIndex((C)=>C.keyword===I);if(R>=0)V.rules.splice(R,1)}return this}addFormat(I,q){if(typeof q=="string")q=new RegExp(q);return this.formats[I]=q,this}errorsText(I=this.errors,{separator:q=", ",dataVar:V="data"}={}){if(!I||I.length===0)return"No errors";return I.map((R)=>`${V}${R.instancePath} ${R.message}`).reduce((R,C)=>R+q+C)}$dataMetaSchema(I,q){let V=this.RULES.all;I=JSON.parse(JSON.stringify(I));for(let R of q){let C=R.split("/").slice(1),j=I;for(let J of C)j=j[J];for(let J in V){let te=V[J];if(typeof te!="object")continue;let{$data:de}=te.definition,ae=j[J];if(de&&ae)j[J]=fe(ae)}}return I}_removeAllSchemas(I,q){for(let V in I){let R=I[V];if(!q||q.test(V)){if(typeof R=="string")delete I[V];else if(R&&!R.meta)this._cache.delete(R.schema),delete I[V]}}}_addSchema(I,q,V,R=this.opts.validateSchema,C=this.opts.addUsedSchema){let j,{schemaId:J}=this.opts;if(typeof I=="object")j=I[J];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof I!="boolean")throw Error("schema must be object or boolean");let te=this._cache.get(I);if(te!==void 0)return te;V=(0,c.normalizeId)(j||V);let de=c.getSchemaRefs.call(this,I,V);if(te=new a.SchemaEnv({schema:I,schemaId:J,meta:q,baseId:V,localRefs:de}),this._cache.set(te.schema,te),C&&!V.startsWith("#")){if(V)this._checkUnique(V);this.refs[V]=te}if(R)this.validateSchema(I,!0);return te}_checkUnique(I){if(this.schemas[I]||this.refs[I])throw Error(`schema with key or id "${I}" already exists`)}_compileSchemaEnv(I){if(I.meta)this._compileMetaSchema(I);else a.compileSchema.call(this,I);if(!I.validate)throw Error("ajv implementation error");return I.validate}_compileMetaSchema(I){let q=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,I)}finally{this.opts=q}}};S.ValidationError=o.default,S.MissingRefError=n.default,e.default=S;function P(I,q,V,R="error"){for(let C in I){let j=C;if(j in q)this.logger[R](`${V}: option ${C}. ${I[j]}`)}}function y(I){return I=(0,c.normalizeId)(I),this.schemas[I]||this.refs[I]}function h(){let I=this.opts.schemas;if(!I)return;if(Array.isArray(I))this.addSchema(I);else for(let q in I)this.addSchema(I[q],q)}function E(){for(let I in this.opts.formats){let q=this.opts.formats[I];if(q)this.addFormat(I,q)}}function A(I){if(Array.isArray(I)){this.addVocabulary(I);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let q in I){let V=I[q];if(!V.keyword)V.keyword=q;this.addKeyword(V)}}function H(){let I={...this.opts};for(let q of _)delete I[q];return I}let L={log(){},warn(){},error(){}};function U(I){if(I===!1)return L;if(I===void 0)return console;if(I.log&&I.warn&&I.error)return I;throw Error("logger must implement log, warn and error methods")}let Y=/^[a-z_$][a-z0-9_$:-]*$/i;function K(I,q){let{RULES:V}=this;if((0,m.eachItem)(I,(R)=>{if(V.keywords[R])throw Error(`Keyword ${R} is already defined`);if(!Y.test(R))throw Error(`Keyword ${R} has invalid name`)}),!q)return;if(q.$data&&!(("code"in q)||("validate"in q)))throw Error('$data keyword must have "code" or "validate" function')}function me(I,q,V){var R;let C=q===null||q===void 0?void 0:q.post;if(V&&C)throw Error('keyword with "post" flag cannot have "type"');let{RULES:j}=this,J=C?j.post:j.rules.find(({type:de})=>de===V);if(!J)J={type:V,rules:[]},j.rules.push(J);if(j.keywords[I]=!0,!q)return;let te={keyword:I,definition:{...q,type:(0,l.getJSONTypes)(q.type),schemaType:(0,l.getJSONTypes)(q.schemaType)}};if(q.before)we.call(this,J,te,q.before);else J.rules.push(te);j.all[I]=te,(R=q.implements)===null||R===void 0||R.forEach((de)=>this.addKeyword(de))}function we(I,q,V){let R=I.rules.findIndex((C)=>C.keyword===V);if(R>=0)I.rules.splice(R,0,q);else I.rules.push(q),this.logger.warn(`rule ${V} is not defined`)}function ze(I){let{metaSchema:q}=I;if(q===void 0)return;if(I.$data&&this.opts.$data)q=fe(q);I.validateSchema=this.compile(q,!0)}let Ne={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function fe(I){return{anyOf:[I,Ne]}}}),kS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t}),zu=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=Dr(),r=it(),o=ce(),n=at(),s=Xa(),a=ge(),i={keyword:"$ref",schemaType:"string",code(m){let{gen:g,schema:z,it:w}=m,{baseId:_,schemaEnv:b,validateName:f,opts:d,self:v}=w,{root:p}=b;if((z==="#"||z==="#/")&&_===p.baseId)return P();let S=s.resolveRef.call(v,p,_,z);if(S===void 0)throw new t.default(w.opts.uriResolver,_,z);if(S instanceof s.SchemaEnv)return y(S);return h(S);function P(){if(b===p)return l(m,f,b,b.$async);let E=g.scopeValue("root",{ref:p});return l(m,o._`${E}.validate`,p,p.$async)}function y(E){l(m,c(m,E),E,E.$async)}function h(E){let A=g.scopeValue("schema",d.code.source===!0?{ref:E,code:(0,o.stringify)(E)}:{ref:E}),H=g.name("valid"),L=m.subschema({schema:E,dataTypes:[],schemaPath:o.nil,topSchemaRef:A,errSchemaPath:z},H);m.mergeEvaluated(L),m.ok(H)}}};function c(m,g){let{gen:z}=m;return g.validate?z.scopeValue("validate",{ref:g.validate}):o._`${z.scopeValue("wrapper",{ref:g})}.validate`}e.getValidate=c;function l(m,g,z,w){let{gen:_,it:b}=m,{allErrors:f,schemaEnv:d,opts:v}=b,p=v.passContext?n.default.this:o.nil;if(w)S();else P();function S(){if(!d.$async)throw Error("async schema referenced by sync schema");let E=_.let("valid");_.try(()=>{if(_.code(o._`await ${(0,r.callValidateCode)(m,g,p)}`),h(g),!f)_.assign(E,!0)},(A)=>{if(_.if(o._`!(${A} instanceof ${b.ValidationError})`,()=>_.throw(A)),y(A),!f)_.assign(E,!1)}),m.ok(E)}function P(){m.result((0,r.callValidateCode)(m,g,p),()=>h(g),()=>y(g))}function y(E){let A=o._`${E}.errors`;_.assign(n.default.vErrors,o._`${n.default.vErrors} === null ? ${A} : ${n.default.vErrors}.concat(${A})`),_.assign(n.default.errors,o._`${n.default.vErrors}.length`)}function h(E){var A;if(!b.opts.unevaluated)return;let H=(A=z===null||z===void 0?void 0:z.validate)===null||A===void 0?void 0:A.evaluated;if(b.props!==!0)if(H&&!H.dynamicProps){if(H.props!==void 0)b.props=a.mergeEvaluated.props(_,H.props,b.props)}else{let L=_.var("props",o._`${E}.evaluated.props`);b.props=a.mergeEvaluated.props(_,L,b.props,o.Name)}if(b.items!==!0)if(H&&!H.dynamicItems){if(H.items!==void 0)b.items=a.mergeEvaluated.items(_,H.items,b.items)}else{let L=_.var("items",o._`${E}.evaluated.items`);b.items=a.mergeEvaluated.items(_,L,b.items,o.Name)}}}e.callRef=l,e.default=i}),Nh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=kS(),r=zu(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o}),CS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),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:a})=>t.str`must be ${o[s].okStr} ${a}`,params:({keyword:s,schemaCode:a})=>t._`{comparison: ${o[s].okStr}, limit: ${a}}`},code(s){let{keyword:a,data:i,schemaCode:c}=s;s.fail$data(t._`${i} ${o[a].fail} ${c} || isNaN(${i})`)}};e.default=n}),IS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>t.str`must be multiple of ${o}`,params:({schemaCode:o})=>t._`{multipleOf: ${o}}`},code(o){let{gen:n,data:s,schemaCode:a,it:i}=o,c=i.opts.multipleOfPrecision,l=n.let("res"),m=c?t._`Math.abs(Math.round(${l}) - ${l}) > 1e-${c}`:t._`${l} !== parseInt(${l})`;o.fail$data(t._`(${a} === 0 || (${l} = ${s}/${a}, ${m}))`)}};e.default=r}),OS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r){let o=r.length,n=0,s=0,a;while(s<o)if(n++,a=r.charCodeAt(s++),a>=55296&&a<=56319&&s<o){if(a=r.charCodeAt(s),(a&64512)===56320)s++}return n}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),NS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o=OS(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:a}){let i=s==="maxLength"?"more":"fewer";return t.str`must NOT have ${i} than ${a} characters`},params:({schemaCode:s})=>t._`{limit: ${s}}`},code(s){let{keyword:a,data:i,schemaCode:c,it:l}=s,m=a==="maxLength"?t.operators.GT:t.operators.LT,g=l.opts.unicode===!1?t._`${i}.length`:t._`${(0,r.useFunc)(s.gen,o.default)}(${i})`;s.fail$data(t._`${g} ${m} ${c}`)}};e.default=n}),jS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=it(),r=ge(),o=ce(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>o.str`must match pattern "${s}"`,params:({schemaCode:s})=>o._`{pattern: ${s}}`},code(s){let{gen:a,data:i,$data:c,schema:l,schemaCode:m,it:g}=s,z=g.opts.unicodeRegExp?"u":"";if(c){let{regExp:w}=g.opts.code,_=w.code==="new RegExp"?o._`new RegExp`:(0,r.useFunc)(a,w),b=a.let("valid");a.try(()=>a.assign(b,o._`${_}(${m}, ${z}).test(${i})`),()=>a.assign(b,!1)),s.fail$data(o._`!${b}`)}else{let w=(0,t.usePattern)(s,l);s.fail$data(o._`!${w}.test(${i})`)}}};e.default=n}),qS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxProperties"?"more":"fewer";return t.str`must NOT have ${s} than ${n} properties`},params:({schemaCode:o})=>t._`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:a}=o,i=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data(t._`Object.keys(${s}).length ${i} ${a}`)}};e.default=r}),xS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=it(),r=ce(),o=ge(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>r.str`must have required property '${s}'`,params:({params:{missingProperty:s}})=>r._`{missingProperty: ${s}}`},code(s){let{gen:a,schema:i,schemaCode:c,data:l,$data:m,it:g}=s,{opts:z}=g;if(!m&&i.length===0)return;let w=i.length>=z.loopRequired;if(g.allErrors)_();else b();if(z.strictRequired){let v=s.parentSchema.properties,{definedProperties:p}=s.it;for(let S of i)if((v===null||v===void 0?void 0:v[S])===void 0&&!p.has(S)){let P=`required property "${S}" is not defined at "${g.schemaEnv.baseId+g.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(g,P,g.opts.strictRequired)}}function _(){if(w||m)s.block$data(r.nil,f);else for(let v of i)(0,t.checkReportMissingProp)(s,v)}function b(){let v=a.let("missing");if(w||m){let p=a.let("valid",!0);s.block$data(p,()=>d(v,p)),s.ok(p)}else a.if((0,t.checkMissingProp)(s,i,v)),(0,t.reportMissingProp)(s,v),a.else()}function f(){a.forOf("prop",c,(v)=>{s.setParams({missingProperty:v}),a.if((0,t.noPropertyInData)(a,l,v,z.ownProperties),()=>s.error())})}function d(v,p){s.setParams({missingProperty:v}),a.forOf(v,c,()=>{a.assign(p,(0,t.propertyInData)(a,l,v,z.ownProperties)),a.if((0,r.not)(p),()=>{s.error(),a.break()})},r.nil)}}};e.default=n}),AS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxItems"?"more":"fewer";return t.str`must NOT have ${s} than ${n} items`},params:({schemaCode:o})=>t._`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:a}=o,i=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data(t._`${s}.length ${i} ${a}`)}};e.default=r}),$u=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ih();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),MS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ga(),r=ce(),o=ge(),n=$u(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:a,j:i}})=>r.str`must NOT have duplicate items (items ## ${i} and ${a} are identical)`,params:({params:{i:a,j:i}})=>r._`{i: ${a}, j: ${i}}`},code(a){let{gen:i,data:c,$data:l,schema:m,parentSchema:g,schemaCode:z,it:w}=a;if(!l&&!m)return;let _=i.let("valid"),b=g.items?(0,t.getSchemaTypes)(g.items):[];a.block$data(_,f,r._`${z} === false`),a.ok(_);function f(){let S=i.let("i",r._`${c}.length`),P=i.let("j");a.setParams({i:S,j:P}),i.assign(_,!0),i.if(r._`${S} > 1`,()=>(d()?v:p)(S,P))}function d(){return b.length>0&&!b.some((S)=>S==="object"||S==="array")}function v(S,P){let y=i.name("item"),h=(0,t.checkDataTypes)(b,y,w.opts.strictNumbers,t.DataType.Wrong),E=i.const("indices",r._`{}`);i.for(r._`;${S}--;`,()=>{if(i.let(y,r._`${c}[${S}]`),i.if(h,r._`continue`),b.length>1)i.if(r._`typeof ${y} == "string"`,r._`${y} += "_"`);i.if(r._`typeof ${E}[${y}] == "number"`,()=>{i.assign(P,r._`${E}[${y}]`),a.error(),i.assign(_,!1).break()}).code(r._`${E}[${y}] = ${S}`)})}function p(S,P){let y=(0,o.useFunc)(i,n.default),h=i.name("outer");i.label(h).for(r._`;${S}--;`,()=>i.for(r._`${P} = ${S}; ${P}--;`,()=>i.if(r._`${y}(${c}[${S}], ${c}[${P}])`,()=>{a.error(),i.assign(_,!1).break(h)})))}}};e.default=s}),LS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o=$u(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>t._`{allowedValue: ${s}}`},code(s){let{gen:a,data:i,$data:c,schemaCode:l,schema:m}=s;if(c||m&&typeof m=="object")s.fail$data(t._`!${(0,r.useFunc)(a,o.default)}(${i}, ${l})`);else s.fail(t._`${m} !== ${i}`)}};e.default=n}),ZS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o=$u(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>t._`{allowedValues: ${s}}`},code(s){let{gen:a,data:i,$data:c,schema:l,schemaCode:m,it:g}=s;if(!c&&l.length===0)throw Error("enum must have non-empty array");let z=l.length>=g.opts.loopEnum,w,_=()=>w!==null&&w!==void 0?w:w=(0,r.useFunc)(a,o.default),b;if(z||c)b=a.let("valid"),s.block$data(b,f);else{if(!Array.isArray(l))throw Error("ajv implementation error");let v=a.const("vSchema",m);b=(0,t.or)(...l.map((p,S)=>d(v,S)))}s.pass(b);function f(){a.assign(b,!1),a.forOf("v",m,(v)=>a.if(t._`${_()}(${i}, ${v})`,()=>a.assign(b,!0).break()))}function d(v,p){let S=l[p];return typeof S==="object"&&S!==null?t._`${_()}(${i}, ${v}[${p}])`:t._`${i} === ${S}`}}};e.default=n}),jh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=CS(),r=IS(),o=NS(),n=jS(),s=qS(),a=xS(),i=AS(),c=MS(),l=LS(),m=ZS(),g=[t.default,r.default,o.default,n.default,s.default,a.default,i.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,m.default];e.default=g}),qh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=ce(),r=ge(),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>t.str`must NOT have more than ${s} items`,params:({params:{len:s}})=>t._`{limit: ${s}}`},code(s){let{parentSchema:a,it:i}=s,{items:c}=a;if(!Array.isArray(c)){(0,r.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,c)}};function n(s,a){let{gen:i,schema:c,data:l,keyword:m,it:g}=s;g.items=!0;let z=i.const("len",t._`${l}.length`);if(c===!1)s.setParams({len:a.length}),s.pass(t._`${z} <= ${a.length}`);else if(typeof c=="object"&&!(0,r.alwaysValidSchema)(g,c)){let _=i.var("valid",t._`${z} <= ${a.length}`);i.if((0,t.not)(_),()=>w(_)),s.ok(_)}function w(_){i.forRange("i",a.length,z,(b)=>{if(s.subschema({keyword:m,dataProp:b,dataPropType:r.Type.Num},_),!g.allErrors)i.if((0,t.not)(_),()=>i.break())})}}e.validateAdditionalItems=n,e.default=o}),xh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=ce(),r=ge(),o=it(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(a){let{schema:i,it:c}=a;if(Array.isArray(i))return s(a,"additionalItems",i);if(c.items=!0,(0,r.alwaysValidSchema)(c,i))return;a.ok((0,o.validateArray)(a))}};function s(a,i,c=a.schema){let{gen:l,parentSchema:m,data:g,keyword:z,it:w}=a;if(f(m),w.opts.unevaluated&&c.length&&w.items!==!0)w.items=r.mergeEvaluated.items(l,c.length,w.items);let _=l.name("valid"),b=l.const("len",t._`${g}.length`);c.forEach((d,v)=>{if((0,r.alwaysValidSchema)(w,d))return;l.if(t._`${b} > ${v}`,()=>a.subschema({keyword:z,schemaProp:v,dataProp:v},_)),a.ok(_)});function f(d){let{opts:v,errSchemaPath:p}=w,S=c.length,P=S===d.minItems&&(S===d.maxItems||d[i]===!1);if(v.strictTuples&&!P){let y=`"${z}" is ${S}-tuple, but minItems or maxItems/${i} are not specified or different at path "${p}"`;(0,r.checkStrictMode)(w,y,v.strictTuples)}}}e.validateTuple=s,e.default=n}),DS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xh(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(o)=>(0,t.validateTuple)(o,"items")};e.default=r}),US=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o=it(),n=qh(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:a}})=>t.str`must NOT have more than ${a} items`,params:({params:{len:a}})=>t._`{limit: ${a}}`},code(a){let{schema:i,parentSchema:c,it:l}=a,{prefixItems:m}=c;if(l.items=!0,(0,r.alwaysValidSchema)(l,i))return;if(m)(0,n.validateAdditionalItems)(a,m);else a.ok((0,o.validateArray)(a))}};e.default=s}),VS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:s}})=>s===void 0?t.str`must contain at least ${n} valid item(s)`:t.str`must contain at least ${n} and no more than ${s} valid item(s)`,params:({params:{min:n,max:s}})=>s===void 0?t._`{minContains: ${n}}`:t._`{minContains: ${n}, maxContains: ${s}}`},code(n){let{gen:s,schema:a,parentSchema:i,data:c,it:l}=n,m,g,{minContains:z,maxContains:w}=i;if(l.opts.next)m=z===void 0?1:z,g=w;else m=1;let _=s.const("len",t._`${c}.length`);if(n.setParams({min:m,max:g}),g===void 0&&m===0){(0,r.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(g!==void 0&&m>g){(0,r.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(l,a)){let p=t._`${_} >= ${m}`;if(g!==void 0)p=t._`${p} && ${_} <= ${g}`;n.pass(p);return}l.items=!0;let b=s.name("valid");if(g===void 0&&m===1)d(b,()=>s.if(b,()=>s.break()));else if(m===0){if(s.let(b,!0),g!==void 0)s.if(t._`${c}.length > 0`,f)}else s.let(b,!1),f();n.result(b,()=>n.reset());function f(){let p=s.name("_valid"),S=s.let("count",0);d(p,()=>s.if(p,()=>v(S)))}function d(p,S){s.forRange("i",0,_,(P)=>{n.subschema({keyword:"contains",dataProp:P,dataPropType:r.Type.Num,compositeRule:!0},p),S()})}function v(p){if(s.code(t._`${p}++`),g===void 0)s.if(t._`${p} >= ${m}`,()=>s.assign(b,!0).break());else if(s.if(t._`${p} > ${g}`,()=>s.assign(b,!1).break()),m===1)s.assign(b,!0);else s.if(t._`${p} >= ${m}`,()=>s.assign(b,!0))}}};e.default=o}),Ru=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=ce(),r=ge(),o=it();e.error={message:({params:{property:c,depsCount:l,deps:m}})=>{let g=l===1?"property":"properties";return t.str`must have ${g} ${m} when property ${c} is present`},params:({params:{property:c,depsCount:l,deps:m,missingProperty:g}})=>t._`{property: ${c},
|
|
75
|
+
|| ${A} === "boolean" || ${h} === null`).assign(H,n._`[${h}]`)}}}function w({gen:p,parentData:S,parentDataProperty:P},y){p.if(n._`${S} !== undefined`,()=>p.assign(n._`${S}[${P}]`,y))}function _(p,S,P,y=a.Correct){let h=y===a.Correct?n.operators.EQ:n.operators.NEQ,E;switch(p){case"null":return n._`${S} ${h} null`;case"array":E=n._`Array.isArray(${S})`;break;case"object":E=n._`${S} && typeof ${S} == "object" && !Array.isArray(${S})`;break;case"integer":E=A(n._`!(${S} % 1) && !isNaN(${S})`);break;case"number":E=A();break;default:return n._`typeof ${S} ${h} ${p}`}return y===a.Correct?E:(0,n.not)(E);function A(H=n.nil){return(0,n.and)(n._`typeof ${S} == "number"`,H,P?n._`isFinite(${S})`:n.nil)}}e.checkDataType=_;function b(p,S,P,y){if(p.length===1)return _(p[0],S,P,y);let h,E=(0,s.toHash)(p);if(E.array&&E.object){let A=n._`typeof ${S} != "object"`;h=E.null?A:n._`!${S} || ${A}`,delete E.null,delete E.array,delete E.object}else h=n.nil;if(E.number)delete E.integer;for(let A in E)h=(0,n.and)(h,_(A,S,P,y));return h}e.checkDataTypes=b;let f={message:({schema:p})=>`must be ${p}`,params:({schema:p,schemaValue:S})=>typeof p=="string"?n._`{type: ${p}}`:n._`{type: ${S}}`};function d(p){let S=v(p);(0,o.reportError)(S,f)}e.reportTypeError=d;function v(p){let{gen:S,data:P,schema:y}=p,h=(0,s.schemaRefOrVal)(p,y,"type");return{gen:S,keyword:"type",data:P,schema:y.type,schemaCode:h,schemaValue:h,parentSchema:y,params:{},it:p}}}),j_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=ce(),r=ge();function o(s,a){let{properties:i,items:c}=s.schema;if(a==="object"&&i)for(let l in i)n(s,l,i[l].default);else if(a==="array"&&Array.isArray(c))c.forEach((l,m)=>n(s,m,l.default))}e.assignDefaults=o;function n(s,a,i){let{gen:c,compositeRule:l,data:m,opts:g}=s;if(i===void 0)return;let z=t._`${m}${(0,t.getProperty)(a)}`;if(l){(0,r.checkStrictMode)(s,`default is ignored for: ${z}`);return}let w=t._`${z} === undefined`;if(g.useDefaults==="empty")w=t._`${w} || ${z} === null || ${z} === ""`;c.if(w,t._`${z} = ${(0,t.stringify)(i)}`)}}),st=D((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=ce(),r=ge(),o=nt(),n=ge();function s(p,S){let{gen:P,data:y,it:h}=p;P.if(g(P,y,S,h.opts.ownProperties),()=>{p.setParams({missingProperty:t._`${S}`},!0),p.error()})}e.checkReportMissingProp=s;function a({gen:p,data:S,it:{opts:P}},y,h){return(0,t.or)(...y.map((E)=>(0,t.and)(g(p,S,E,P.ownProperties),t._`${h} = ${E}`)))}e.checkMissingProp=a;function i(p,S){p.setParams({missingProperty:S},!0),p.error()}e.reportMissingProp=i;function c(p){return p.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(p,S,P){return t._`${c(p)}.call(${S}, ${P})`}e.isOwnProperty=l;function m(p,S,P,y){let h=t._`${S}${(0,t.getProperty)(P)} !== undefined`;return y?t._`${h} && ${l(p,S,P)}`:h}e.propertyInData=m;function g(p,S,P,y){let h=t._`${S}${(0,t.getProperty)(P)} === undefined`;return y?(0,t.or)(h,(0,t.not)(l(p,S,P))):h}e.noPropertyInData=g;function z(p){return p?Object.keys(p).filter((S)=>S!=="__proto__"):[]}e.allSchemaProperties=z;function w(p,S){return z(S).filter((P)=>!(0,r.alwaysValidSchema)(p,S[P]))}e.schemaProperties=w;function _({schemaCode:p,data:S,it:{gen:P,topSchemaRef:y,schemaPath:h,errorPath:E},it:A},H,L,U){let Y=U?t._`${p}, ${S}, ${y}${h}`:S,K=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,E)],[o.default.parentData,A.parentData],[o.default.parentDataProperty,A.parentDataProperty],[o.default.rootData,o.default.rootData]];if(A.opts.dynamicRef)K.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let me=t._`${Y}, ${P.object(...K)}`;return L!==t.nil?t._`${H}.call(${L}, ${me})`:t._`${H}(${me})`}e.callValidateCode=_;let b=t._`new RegExp`;function f({gen:p,it:{opts:S}},P){let y=S.unicodeRegExp?"u":"",{regExp:h}=S.code,E=h(P,y);return p.scopeValue("pattern",{key:E.toString(),ref:E,code:t._`${h.code==="new RegExp"?b:(0,n.useFunc)(p,h)}(${P}, ${y})`})}e.usePattern=f;function d(p){let{gen:S,data:P,keyword:y,it:h}=p,E=S.name("valid");if(h.allErrors){let H=S.let("valid",!0);return A(()=>S.assign(H,!1)),H}return S.var(E,!0),A(()=>S.break()),E;function A(H){let L=S.const("len",t._`${P}.length`);S.forRange("i",0,L,(U)=>{p.subschema({keyword:y,dataProp:U,dataPropType:r.Type.Num},E),S.if((0,t.not)(E),H)})}}e.validateArray=d;function v(p){let{gen:S,schema:P,keyword:y,it:h}=p;if(!Array.isArray(P))throw Error("ajv implementation error");if(P.some((H)=>(0,r.alwaysValidSchema)(h,H))&&!h.opts.unevaluated)return;let E=S.let("valid",!1),A=S.name("_valid");S.block(()=>P.forEach((H,L)=>{let U=p.subschema({keyword:y,schemaProp:L,compositeRule:!0},A);if(S.assign(E,t._`${E} || ${A}`),!p.mergeValidEvaluated(U,A))S.if((0,t.not)(E))})),p.result(E,()=>p.reset(),()=>p.error(!0))}e.validateUnion=v}),q_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=ce(),r=nt(),o=st(),n=Ha();function s(w,_){let{gen:b,keyword:f,schema:d,parentSchema:v,it:p}=w,S=_.macro.call(p.self,d,v,p),P=m(b,f,S);if(p.opts.validateSchema!==!1)p.self.validateSchema(S,!0);let y=b.name("valid");w.subschema({schema:S,schemaPath:t.nil,errSchemaPath:`${p.errSchemaPath}/${f}`,topSchemaRef:P,compositeRule:!0},y),w.pass(y,()=>w.error(!0))}e.macroKeywordCode=s;function a(w,_){var b;let{gen:f,keyword:d,schema:v,parentSchema:p,$data:S,it:P}=w;l(P,_);let y=m(f,d,!S&&_.compile?_.compile.call(P.self,v,p,P):_.validate),h=f.let("valid");w.block$data(h,E),w.ok((b=_.valid)!==null&&b!==void 0?b:h);function E(){if(_.errors===!1){if(L(),_.modifying)i(w);U(()=>w.error())}else{let Y=_.async?A():H();if(_.modifying)i(w);U(()=>c(w,Y))}}function A(){let Y=f.let("ruleErrs",null);return f.try(()=>L(t._`await `),(K)=>f.assign(h,!1).if(t._`${K} instanceof ${P.ValidationError}`,()=>f.assign(Y,t._`${K}.errors`),()=>f.throw(K))),Y}function H(){let Y=t._`${y}.errors`;return f.assign(Y,null),L(t.nil),Y}function L(Y=_.async?t._`await `:t.nil){let K=P.opts.passContext?r.default.this:r.default.self,me=!(("compile"in _)&&!S||_.schema===!1);f.assign(h,t._`${Y}${(0,o.callValidateCode)(w,y,K,me)}`,_.modifying)}function U(Y){var K;f.if((0,t.not)((K=_.valid)!==null&&K!==void 0?K:h),Y)}}e.funcKeywordCode=a;function i(w){let{gen:_,data:b,it:f}=w;_.if(f.parentData,()=>_.assign(b,t._`${f.parentData}[${f.parentDataProperty}]`))}function c(w,_){let{gen:b}=w;b.if(t._`Array.isArray(${_})`,()=>{b.assign(r.default.vErrors,t._`${r.default.vErrors} === null ? ${_} : ${r.default.vErrors}.concat(${_})`).assign(r.default.errors,t._`${r.default.vErrors}.length`),(0,n.extendErrors)(w)},()=>w.error())}function l({schemaEnv:w},_){if(_.async&&!w.$async)throw Error("async keyword in sync schema")}function m(w,_,b){if(b===void 0)throw Error(`keyword "${_}" failed to compile`);return w.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,t.stringify)(b)})}function g(w,_,b=!1){return!_.length||_.some((f)=>f==="array"?Array.isArray(w):f==="object"?w&&typeof w=="object"&&!Array.isArray(w):typeof w==f||b&&typeof w>"u")}e.validSchemaType=g;function z({schema:w,opts:_,self:b,errSchemaPath:f},d,v){if(Array.isArray(d.keyword)?!d.keyword.includes(v):d.keyword!==v)throw Error("ajv implementation error");let p=d.dependencies;if(p===null||p===void 0?void 0:p.some((S)=>!Object.prototype.hasOwnProperty.call(w,S)))throw Error(`parent schema must have dependencies of ${v}: ${p.join(",")}`);if(d.validateSchema){if(!d.validateSchema(w[v])){let S=`keyword "${v}" value is invalid at path "${f}": `+b.errorsText(d.validateSchema.errors);if(_.validateSchema==="log")b.logger.error(S);else throw Error(S)}}}e.validateKeywordUsage=z}),x_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=ce(),r=ge();function o(a,{keyword:i,schemaProp:c,schema:l,schemaPath:m,errSchemaPath:g,topSchemaRef:z}){if(i!==void 0&&l!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(i!==void 0){let w=a.schema[i];return c===void 0?{schema:w,schemaPath:t._`${a.schemaPath}${(0,t.getProperty)(i)}`,errSchemaPath:`${a.errSchemaPath}/${i}`}:{schema:w[c],schemaPath:t._`${a.schemaPath}${(0,t.getProperty)(i)}${(0,t.getProperty)(c)}`,errSchemaPath:`${a.errSchemaPath}/${i}/${(0,r.escapeFragment)(c)}`}}if(l!==void 0){if(m===void 0||g===void 0||z===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:m,topSchemaRef:z,errSchemaPath:g}}throw Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(a,i,{dataProp:c,dataPropType:l,data:m,dataTypes:g,propertyName:z}){if(m!==void 0&&c!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:w}=i;if(c!==void 0){let{errorPath:b,dataPathArr:f,opts:d}=i;_(w.let("data",t._`${i.data}${(0,t.getProperty)(c)}`,!0)),a.errorPath=t.str`${b}${(0,r.getErrorPath)(c,l,d.jsPropertySyntax)}`,a.parentDataProperty=t._`${c}`,a.dataPathArr=[...f,a.parentDataProperty]}if(m!==void 0){if(_(m instanceof t.Name?m:w.let("data",m,!0)),z!==void 0)a.propertyName=z}if(g)a.dataTypes=g;function _(b){a.data=b,a.dataLevel=i.dataLevel+1,a.dataTypes=[],i.definedProperties=new Set,a.parentData=i.data,a.dataNames=[...i.dataNames,b]}}e.extendSubschemaData=n;function s(a,{jtdDiscriminator:i,jtdMetadata:c,compositeRule:l,createErrors:m,allErrors:g}){if(l!==void 0)a.compositeRule=l;if(m!==void 0)a.createErrors=m;if(g!==void 0)a.allErrors=g;a.jtdDiscriminator=i,a.jtdMetadata=c}e.extendSubschemaMode=s}),dh=D((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,a,i;if(Array.isArray(o)){if(s=o.length,s!=n.length)return!1;for(a=s;a--!==0;)if(!r(o[a],n[a]))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(i=Object.keys(o),s=i.length,s!==Object.keys(n).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=s;a--!==0;){var c=i[a];if(!r(o[c],n[c]))return!1}return!0}return o!==o&&n!==n}}),A_=D((e,t)=>{var r=t.exports=function(s,a,i){if(typeof a=="function")i=a,a={};i=a.cb||i;var c=typeof i=="function"?i:i.pre||function(){},l=i.post||function(){};o(a,c,l,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,a,i,c,l,m,g,z,w,_){if(c&&typeof c=="object"&&!Array.isArray(c)){a(c,l,m,g,z,w,_);for(var b in c){var f=c[b];if(Array.isArray(f)){if(b in r.arrayKeywords)for(var d=0;d<f.length;d++)o(s,a,i,f[d],l+"/"+b+"/"+d,m,l,b,c,d)}else if(b in r.propsKeywords){if(f&&typeof f=="object")for(var v in f)o(s,a,i,f[v],l+"/"+b+"/"+n(v),m,l,b,c,v)}else if(b in r.keywords||s.allKeys&&!(b in r.skipKeywords))o(s,a,i,f,l+"/"+b,m,l,b,c)}i(c,l,m,g,z,w,_)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}}),Ja=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=ge(),r=dh(),o=A_(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(f,d=!0){if(typeof f=="boolean")return!0;if(d===!0)return!i(f);if(!d)return!1;return c(f)<=d}e.inlineRef=s;let a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(f){for(let d in f){if(a.has(d))return!0;let v=f[d];if(Array.isArray(v)&&v.some(i))return!0;if(typeof v=="object"&&i(v))return!0}return!1}function c(f){let d=0;for(let v in f){if(v==="$ref")return 1/0;if(d++,n.has(v))continue;if(typeof f[v]=="object")(0,t.eachItem)(f[v],(p)=>d+=c(p));if(d===1/0)return 1/0}return d}function l(f,d="",v){if(v!==!1)d=z(d);return m(f,f.parse(d))}e.getFullPath=l;function m(f,d){return f.serialize(d).split("#")[0]+"#"}e._getFullPath=m;let g=/#\/?$/;function z(f){return f?f.replace(g,""):""}e.normalizeId=z;function w(f,d,v){return v=z(v),f.resolve(d,v)}e.resolveUrl=w;let _=/^[a-z_][-a-z0-9._]*$/i;function b(f,d){if(typeof f=="boolean")return{};let{schemaId:v,uriResolver:p}=this.opts,S=z(f[v]||d),P={"":S},y=l(p,S,!1),h={},E=new Set;return o(f,{allKeys:!0},(L,U,Y,K)=>{if(K===void 0)return;let me=y+U,Re=P[K];if(typeof L[v]=="string")Re=ve.call(this,L[v]);Oe.call(this,L.$anchor),Oe.call(this,L.$dynamicAnchor),P[U]=Re;function ve(fe){let I=this.opts.uriResolver.resolve;if(fe=z(Re?I(Re,fe):fe),E.has(fe))throw H(fe);E.add(fe);let q=this.refs[fe];if(typeof q=="string")q=this.refs[q];if(typeof q=="object")A(L,q.schema,fe);else if(fe!==z(me))if(fe[0]==="#")A(L,h[fe],fe),h[fe]=L;else this.refs[fe]=me;return fe}function Oe(fe){if(typeof fe=="string"){if(!_.test(fe))throw Error(`invalid anchor "${fe}"`);ve.call(this,`#${fe}`)}}}),h;function A(L,U,Y){if(U!==void 0&&!r(L,U))throw H(Y)}function H(L){return Error(`reference "${L}" resolves to more than one schema`)}}e.getSchemaRefs=b}),jr=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=N_(),r=Fa(),o=lh(),n=Fa(),s=j_(),a=q_(),i=x_(),c=ce(),l=nt(),m=Ja(),g=ge(),z=Ha();function w(k){if(y(k)){if(E(k),P(k)){d(k);return}}_(k,()=>(0,t.topBoolOrEmptySchema)(k))}e.validateFunctionCode=w;function _({gen:k,validateName:x,schema:Z,schemaEnv:ne,opts:se},ue){if(se.code.es5)k.func(x,c._`${l.default.data}, ${l.default.valCxt}`,ne.$async,()=>{k.code(c._`"use strict"; ${p(Z,se)}`),f(k,se),k.code(ue)});else k.func(x,c._`${l.default.data}, ${b(se)}`,ne.$async,()=>k.code(p(Z,se)).code(ue))}function b(k){return c._`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${k.dynamicRef?c._`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function f(k,x){k.if(l.default.valCxt,()=>{if(k.var(l.default.instancePath,c._`${l.default.valCxt}.${l.default.instancePath}`),k.var(l.default.parentData,c._`${l.default.valCxt}.${l.default.parentData}`),k.var(l.default.parentDataProperty,c._`${l.default.valCxt}.${l.default.parentDataProperty}`),k.var(l.default.rootData,c._`${l.default.valCxt}.${l.default.rootData}`),x.dynamicRef)k.var(l.default.dynamicAnchors,c._`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{if(k.var(l.default.instancePath,c._`""`),k.var(l.default.parentData,c._`undefined`),k.var(l.default.parentDataProperty,c._`undefined`),k.var(l.default.rootData,l.default.data),x.dynamicRef)k.var(l.default.dynamicAnchors,c._`{}`)})}function d(k){let{schema:x,opts:Z,gen:ne}=k;_(k,()=>{if(Z.$comment&&x.$comment)K(k);if(L(k),ne.let(l.default.vErrors,null),ne.let(l.default.errors,0),Z.unevaluated)v(k);A(k),me(k)})}function v(k){let{gen:x,validateName:Z}=k;k.evaluated=x.const("evaluated",c._`${Z}.evaluated`),x.if(c._`${k.evaluated}.dynamicProps`,()=>x.assign(c._`${k.evaluated}.props`,c._`undefined`)),x.if(c._`${k.evaluated}.dynamicItems`,()=>x.assign(c._`${k.evaluated}.items`,c._`undefined`))}function p(k,x){let Z=typeof k=="object"&&k[x.schemaId];return Z&&(x.code.source||x.code.process)?c._`/*# sourceURL=${Z} */`:c.nil}function S(k,x){if(y(k)){if(E(k),P(k)){h(k,x);return}}(0,t.boolOrEmptySchema)(k,x)}function P({schema:k,self:x}){if(typeof k=="boolean")return!k;for(let Z in k)if(x.RULES.all[Z])return!0;return!1}function y(k){return typeof k.schema!="boolean"}function h(k,x){let{schema:Z,gen:ne,opts:se}=k;if(se.$comment&&Z.$comment)K(k);U(k),Y(k);let ue=ne.const("_errs",l.default.errors);A(k,ue),ne.var(x,c._`${ue} === ${l.default.errors}`)}function E(k){(0,g.checkUnknownRules)(k),H(k)}function A(k,x){if(k.opts.jtd)return ve(k,[],!1,x);let Z=(0,r.getSchemaTypes)(k.schema);ve(k,Z,!(0,r.coerceAndCheckDataType)(k,Z),x)}function H(k){let{schema:x,errSchemaPath:Z,opts:ne,self:se}=k;if(x.$ref&&ne.ignoreKeywordsWithRef&&(0,g.schemaHasRulesButRef)(x,se.RULES))se.logger.warn(`$ref: keywords ignored in schema at path "${Z}"`)}function L(k){let{schema:x,opts:Z}=k;if(x.default!==void 0&&Z.useDefaults&&Z.strictSchema)(0,g.checkStrictMode)(k,"default is ignored in the schema root")}function U(k){let x=k.schema[k.opts.schemaId];if(x)k.baseId=(0,m.resolveUrl)(k.opts.uriResolver,k.baseId,x)}function Y(k){if(k.schema.$async&&!k.schemaEnv.$async)throw Error("async schema in sync schema")}function K({gen:k,schemaEnv:x,schema:Z,errSchemaPath:ne,opts:se}){let ue=Z.$comment;if(se.$comment===!0)k.code(c._`${l.default.self}.logger.log(${ue})`);else if(typeof se.$comment=="function"){let Ce=c.str`${ne}/$comment`,je=k.scopeValue("root",{ref:x.root});k.code(c._`${l.default.self}.opts.$comment(${ue}, ${Ce}, ${je}.schema)`)}}function me(k){let{gen:x,schemaEnv:Z,validateName:ne,ValidationError:se,opts:ue}=k;if(Z.$async)x.if(c._`${l.default.errors} === 0`,()=>x.return(l.default.data),()=>x.throw(c._`new ${se}(${l.default.vErrors})`));else{if(x.assign(c._`${ne}.errors`,l.default.vErrors),ue.unevaluated)Re(k);x.return(c._`${l.default.errors} === 0`)}}function Re({gen:k,evaluated:x,props:Z,items:ne}){if(Z instanceof c.Name)k.assign(c._`${x}.props`,Z);if(ne instanceof c.Name)k.assign(c._`${x}.items`,ne)}function ve(k,x,Z,ne){let{gen:se,schema:ue,data:Ce,allErrors:je,opts:Le,self:Ne}=k,{RULES:Pe}=Ne;if(ue.$ref&&(Le.ignoreKeywordsWithRef||!(0,g.schemaHasRulesButRef)(ue,Pe))){se.block(()=>de(k,"$ref",Pe.all.$ref.definition));return}if(!Le.jtd)fe(k,x);se.block(()=>{for(let qe of Pe.rules)Xe(qe);Xe(Pe.post)});function Xe(qe){if(!(0,o.shouldUseGroup)(ue,qe))return;if(qe.type){if(se.if((0,n.checkDataType)(qe.type,Ce,Le.strictNumbers)),Oe(k,qe),x.length===1&&x[0]===qe.type&&Z)se.else(),(0,n.reportTypeError)(k);se.endIf()}else Oe(k,qe);if(!je)se.if(c._`${l.default.errors} === ${ne||0}`)}}function Oe(k,x){let{gen:Z,schema:ne,opts:{useDefaults:se}}=k;if(se)(0,s.assignDefaults)(k,x.type);Z.block(()=>{for(let ue of x.rules)if((0,o.shouldUseRule)(ne,ue))de(k,ue.keyword,ue.definition,x.type)})}function fe(k,x){if(k.schemaEnv.meta||!k.opts.strictTypes)return;if(I(k,x),!k.opts.allowUnionTypes)q(k,x);V(k,k.dataTypes)}function I(k,x){if(!x.length)return;if(!k.dataTypes.length){k.dataTypes=x;return}x.forEach((Z)=>{if(!C(k.dataTypes,Z))J(k,`type "${Z}" not allowed by context "${k.dataTypes.join(",")}"`)}),j(k,x)}function q(k,x){if(x.length>1&&!(x.length===2&&x.includes("null")))J(k,"use allowUnionTypes to allow union type keyword")}function V(k,x){let Z=k.self.RULES.all;for(let ne in Z){let se=Z[ne];if(typeof se=="object"&&(0,o.shouldUseRule)(k.schema,se)){let{type:ue}=se.definition;if(ue.length&&!ue.some((Ce)=>R(x,Ce)))J(k,`missing type "${ue.join(",")}" for keyword "${ne}"`)}}}function R(k,x){return k.includes(x)||x==="number"&&k.includes("integer")}function C(k,x){return k.includes(x)||x==="integer"&&k.includes("number")}function j(k,x){let Z=[];for(let ne of k.dataTypes)if(C(x,ne))Z.push(ne);else if(x.includes("integer")&&ne==="number")Z.push("integer");k.dataTypes=Z}function J(k,x){let Z=k.schemaEnv.baseId+k.errSchemaPath;x+=` at "${Z}" (strictTypes)`,(0,g.checkStrictMode)(k,x,k.opts.strictTypes)}var re=class{constructor(k,x,Z){if((0,a.validateKeywordUsage)(k,x,Z),this.gen=k.gen,this.allErrors=k.allErrors,this.keyword=Z,this.data=k.data,this.schema=k.schema[Z],this.$data=x.$data&&k.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,g.schemaRefOrVal)(k,this.schema,Z,this.$data),this.schemaType=x.schemaType,this.parentSchema=k.schema,this.params={},this.it=k,this.def=x,this.$data)this.schemaCode=k.gen.const("vSchema",Fe(this.$data,k));else if(this.schemaCode=this.schemaValue,!(0,a.validSchemaType)(this.schema,x.schemaType,x.allowUndefined))throw Error(`${Z} value must be ${JSON.stringify(x.schemaType)}`);if("code"in x?x.trackErrors:x.errors!==!1)this.errsCount=k.gen.const("_errs",l.default.errors)}result(k,x,Z){this.failResult((0,c.not)(k),x,Z)}failResult(k,x,Z){if(this.gen.if(k),Z)Z();else this.error();if(x){if(this.gen.else(),x(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(k,x){this.failResult((0,c.not)(k),void 0,x)}fail(k){if(k===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(k),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(k){if(!this.$data)return this.fail(k);let{schemaCode:x}=this;this.fail(c._`${x} !== undefined && (${(0,c.or)(this.invalid$data(),k)})`)}error(k,x,Z){if(x){this.setParams(x),this._error(k,Z),this.setParams({});return}this._error(k,Z)}_error(k,x){(k?z.reportExtraError:z.reportError)(this,this.def.error,x)}$dataError(){(0,z.reportError)(this,this.def.$dataError||z.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,z.resetErrorsCount)(this.gen,this.errsCount)}ok(k){if(!this.allErrors)this.gen.if(k)}setParams(k,x){if(x)Object.assign(this.params,k);else this.params=k}block$data(k,x,Z=c.nil){this.gen.block(()=>{this.check$data(k,Z),x()})}check$data(k=c.nil,x=c.nil){if(!this.$data)return;let{gen:Z,schemaCode:ne,schemaType:se,def:ue}=this;if(Z.if((0,c.or)(c._`${ne} === undefined`,x)),k!==c.nil)Z.assign(k,!0);if(se.length||ue.validateSchema){if(Z.elseIf(this.invalid$data()),this.$dataError(),k!==c.nil)Z.assign(k,!1)}Z.else()}invalid$data(){let{gen:k,schemaCode:x,schemaType:Z,def:ne,it:se}=this;return(0,c.or)(ue(),Ce());function ue(){if(Z.length){if(!(x instanceof c.Name))throw Error("ajv implementation error");let je=Array.isArray(Z)?Z:[Z];return c._`${(0,n.checkDataTypes)(je,x,se.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function Ce(){if(ne.validateSchema){let je=k.scopeValue("validate$data",{ref:ne.validateSchema});return c._`!${je}(${x})`}return c.nil}}subschema(k,x){let Z=(0,i.getSubschema)(this.it,k);(0,i.extendSubschemaData)(Z,this.it,k),(0,i.extendSubschemaMode)(Z,k);let ne={...this.it,...Z,items:void 0,props:void 0};return S(ne,x),ne}mergeEvaluated(k,x){let{it:Z,gen:ne}=this;if(!Z.opts.unevaluated)return;if(Z.props!==!0&&k.props!==void 0)Z.props=g.mergeEvaluated.props(ne,k.props,Z.props,x);if(Z.items!==!0&&k.items!==void 0)Z.items=g.mergeEvaluated.items(ne,k.items,Z.items,x)}mergeValidEvaluated(k,x){let{it:Z,gen:ne}=this;if(Z.opts.unevaluated&&(Z.props!==!0||Z.items!==!0))return ne.if(x,()=>this.mergeEvaluated(k,c.Name)),!0}};e.KeywordCxt=re;function de(k,x,Z,ne){let se=new re(k,Z,x);if("code"in Z)Z.code(se,ne);else if(se.$data&&Z.validate)(0,a.funcKeywordCode)(se,Z);else if("macro"in Z)(0,a.macroKeywordCode)(se,Z);else if(Z.compile||Z.validate)(0,a.funcKeywordCode)(se,Z)}let ae=/^\/(?:[^~]|~0|~1)*$/,be=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Fe(k,{dataLevel:x,dataNames:Z,dataPathArr:ne}){let se,ue;if(k==="")return l.default.rootData;if(k[0]==="/"){if(!ae.test(k))throw Error(`Invalid JSON-pointer: ${k}`);se=k,ue=l.default.rootData}else{let Ne=be.exec(k);if(!Ne)throw Error(`Invalid JSON-pointer: ${k}`);let Pe=+Ne[1];if(se=Ne[2],se==="#"){if(Pe>=x)throw Error(Le("property/index",Pe));return ne[x-Pe]}if(Pe>x)throw Error(Le("data",Pe));if(ue=Z[x-Pe],!se)return ue}let Ce=ue,je=se.split("/");for(let Ne of je)if(Ne)ue=c._`${ue}${(0,c.getProperty)((0,g.unescapeJsonPointer)(Ne))}`,Ce=c._`${Ce} && ${ue}`;return Ce;function Le(Ne,Pe){return`Cannot access ${Ne} ${Pe} levels up, current level is ${x}`}}e.getData=Fe}),nn=D((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}),qr=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ja();var r=class extends Error{constructor(o,n,s,a){super(a||`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}),Ba=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=ce(),r=nn(),o=nt(),n=Ja(),s=ge(),a=jr();var i=class{constructor(d){var v;this.refs={},this.dynamicAnchors={};let p;if(typeof d.schema=="object")p=d.schema;this.schema=d.schema,this.schemaId=d.schemaId,this.root=d.root||this,this.baseId=(v=d.baseId)!==null&&v!==void 0?v:(0,n.normalizeId)(p===null||p===void 0?void 0:p[d.schemaId||"$id"]),this.schemaPath=d.schemaPath,this.localRefs=d.localRefs,this.meta=d.meta,this.$async=p===null||p===void 0?void 0:p.$async,this.refs={}}};e.SchemaEnv=i;function c(d){let v=g.call(this,d);if(v)return v;let p=(0,n.getFullPath)(this.opts.uriResolver,d.root.baseId),{es5:S,lines:P}=this.opts.code,{ownProperties:y}=this.opts,h=new t.CodeGen(this.scope,{es5:S,lines:P,ownProperties:y}),E;if(d.$async)E=h.scopeValue("Error",{ref:r.default,code:t._`require("ajv/dist/runtime/validation_error").default`});let A=h.scopeName("validate");d.validateName=A;let H={gen:h,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:h.scopeValue("schema",this.opts.code.source===!0?{ref:d.schema,code:(0,t.stringify)(d.schema)}:{ref:d.schema}),validateName:A,ValidationError:E,schema:d.schema,schemaEnv:d,rootId:p,baseId:d.baseId||p,schemaPath:t.nil,errSchemaPath:d.schemaPath||(this.opts.jtd?"":"#"),errorPath:t._`""`,opts:this.opts,self:this},L;try{this._compilations.add(d),(0,a.validateFunctionCode)(H),h.optimize(this.opts.code.optimize);let U=h.toString();if(L=`${h.scopeRefs(o.default.scope)}return ${U}`,this.opts.code.process)L=this.opts.code.process(L,d);let Y=Function(`${o.default.self}`,`${o.default.scope}`,L)(this,this.scope.get());if(this.scope.value(A,{ref:Y}),Y.errors=null,Y.schema=d.schema,Y.schemaEnv=d,d.$async)Y.$async=!0;if(this.opts.code.source===!0)Y.source={validateName:A,validateCode:U,scopeValues:h._values};if(this.opts.unevaluated){let{props:K,items:me}=H;if(Y.evaluated={props:K instanceof t.Name?void 0:K,items:me instanceof t.Name?void 0:me,dynamicProps:K instanceof t.Name,dynamicItems:me instanceof t.Name},Y.source)Y.source.evaluated=(0,t.stringify)(Y.evaluated)}return d.validate=Y,d}catch(U){if(delete d.validate,delete d.validateName,L)this.logger.error("Error compiling schema, function code:",L);throw U}finally{this._compilations.delete(d)}}e.compileSchema=c;function l(d,v,p){var S;p=(0,n.resolveUrl)(this.opts.uriResolver,v,p);let P=d.refs[p];if(P)return P;let y=w.call(this,d,p);if(y===void 0){let h=(S=d.localRefs)===null||S===void 0?void 0:S[p],{schemaId:E}=this.opts;if(h)y=new i({schema:h,schemaId:E,root:d,baseId:v})}if(y===void 0)return;return d.refs[p]=m.call(this,y)}e.resolveRef=l;function m(d){if((0,n.inlineRef)(d.schema,this.opts.inlineRefs))return d.schema;return d.validate?d:c.call(this,d)}function g(d){for(let v of this._compilations)if(z(v,d))return v}e.getCompilingSchema=g;function z(d,v){return d.schema===v.schema&&d.root===v.root&&d.baseId===v.baseId}function w(d,v){let p;while(typeof(p=this.refs[v])=="string")v=p;return p||this.schemas[v]||_.call(this,d,v)}function _(d,v){let p=this.opts.uriResolver.parse(v),S=(0,n._getFullPath)(this.opts.uriResolver,p),P=(0,n.getFullPath)(this.opts.uriResolver,d.baseId,void 0);if(Object.keys(d.schema).length>0&&S===P)return f.call(this,p,d);let y=(0,n.normalizeId)(S),h=this.refs[y]||this.schemas[y];if(typeof h=="string"){let E=_.call(this,d,h);if(typeof(E===null||E===void 0?void 0:E.schema)!=="object")return;return f.call(this,p,E)}if(typeof(h===null||h===void 0?void 0:h.schema)!=="object")return;if(!h.validate)c.call(this,h);if(y===(0,n.normalizeId)(v)){let{schema:E}=h,{schemaId:A}=this.opts,H=E[A];if(H)P=(0,n.resolveUrl)(this.opts.uriResolver,P,H);return new i({schema:E,schemaId:A,root:d,baseId:P})}return f.call(this,p,h)}e.resolveSchema=_;let b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function f(d,{baseId:v,schema:p,root:S}){var P;if(((P=d.fragment)===null||P===void 0?void 0:P[0])!=="/")return;for(let E of d.fragment.slice(1).split("/")){if(typeof p==="boolean")return;let A=p[(0,s.unescapeFragment)(E)];if(A===void 0)return;p=A;let H=typeof p==="object"&&p[this.opts.schemaId];if(!b.has(E)&&H)v=(0,n.resolveUrl)(this.opts.uriResolver,v,H)}let y;if(typeof p!="boolean"&&p.$ref&&!(0,s.schemaHasRulesButRef)(p,this.RULES)){let E=(0,n.resolveUrl)(this.opts.uriResolver,v,p.$ref);y=_.call(this,S,E)}let{schemaId:h}=this.opts;if(y=y||new i({schema:p,schemaId:h,root:S,baseId:v}),y.schema!==y.root.schema)return y}}),M_=D((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}}),mh=D((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(_){let b="",f=0,d=0;for(d=0;d<_.length;d++){if(f=_[d].charCodeAt(0),f===48)continue;if(!(f>=48&&f<=57||f>=65&&f<=70||f>=97&&f<=102))return"";b+=_[d];break}for(d+=1;d<_.length;d++){if(f=_[d].charCodeAt(0),!(f>=48&&f<=57||f>=65&&f<=70||f>=97&&f<=102))return"";b+=_[d]}return b}let s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function a(_){return _.length=0,!0}function i(_,b,f){if(_.length){let d=n(_);if(d!=="")b.push(d);else return f.error=!0,!1;_.length=0}return!0}function c(_){let b=0,f={error:!1,address:"",zone:""},d=[],v=[],p=!1,S=!1,P=i;for(let y=0;y<_.length;y++){let h=_[y];if(h==="["||h==="]")continue;if(h===":"){if(p===!0)S=!0;if(!P(v,d,f))break;if(++b>7){f.error=!0;break}if(y>0&&_[y-1]===":")p=!0;d.push(":");continue}else if(h==="%"){if(!P(v,d,f))break;P=a}else{v.push(h);continue}}if(v.length)if(P===a)f.zone=v.join("");else if(S)d.push(v.join(""));else d.push(n(v));return f.address=d.join(""),f}function l(_){if(m(_,":")<2)return{host:_,isIPV6:!1};let b=c(_);if(!b.error){let{address:f,address:d}=b;if(b.zone)f+="%"+b.zone,d+="%25"+b.zone;return{host:f,isIPV6:!0,escapedHost:d}}else return{host:_,isIPV6:!1}}function m(_,b){let f=0;for(let d=0;d<_.length;d++)if(_[d]===b)f++;return f}function g(_){let b=_,f=[],d=-1,v=0;while(v=b.length){if(v===1)if(b===".")break;else if(b==="/"){f.push("/");break}else{f.push(b);break}else if(v===2){if(b[0]==="."){if(b[1]===".")break;else if(b[1]==="/"){b=b.slice(2);continue}}else if(b[0]==="/"){if(b[1]==="."||b[1]==="/"){f.push("/");break}}}else if(v===3){if(b==="/.."){if(f.length!==0)f.pop();f.push("/");break}}if(b[0]==="."){if(b[1]==="."){if(b[2]==="/"){b=b.slice(3);continue}}else if(b[1]==="/"){b=b.slice(2);continue}}else if(b[0]==="/"){if(b[1]==="."){if(b[2]==="/"){b=b.slice(2);continue}else if(b[2]==="."){if(b[3]==="/"){if(b=b.slice(3),f.length!==0)f.pop();continue}}}}if((d=b.indexOf("/",1))===-1){f.push(b);break}else f.push(b.slice(0,d)),b=b.slice(d)}return f.join("")}function z(_,b){let f=b!==!0?escape:unescape;if(_.scheme!==void 0)_.scheme=f(_.scheme);if(_.userinfo!==void 0)_.userinfo=f(_.userinfo);if(_.host!==void 0)_.host=f(_.host);if(_.path!==void 0)_.path=f(_.path);if(_.query!==void 0)_.query=f(_.query);if(_.fragment!==void 0)_.fragment=f(_.fragment);return _}function w(_){let b=[];if(_.userinfo!==void 0)b.push(_.userinfo),b.push("@");if(_.host!==void 0){let f=unescape(_.host);if(!o(f)){let d=l(f);if(d.isIPV6===!0)f=`[${d.escapedHost}]`;else f=_.host}b.push(f)}if(typeof _.port==="number"||typeof _.port==="string")b.push(":"),b.push(String(_.port));return b.length?b.join(""):void 0}t.exports={nonSimpleDomain:s,recomposeAuthority:w,normalizeComponentEncoding:z,removeDotSegments:g,isIPv4:o,isUUID:r,normalizeIPv6:l,stringArrayToHexStripped:n}}),L_=D((e,t)=>{let{isUUID:r}=mh(),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(h){return n.indexOf(h)!==-1}function a(h){if(h.secure===!0)return!0;else if(h.secure===!1)return!1;else if(h.scheme)return h.scheme.length===3&&(h.scheme[0]==="w"||h.scheme[0]==="W")&&(h.scheme[1]==="s"||h.scheme[1]==="S")&&(h.scheme[2]==="s"||h.scheme[2]==="S");else return!1}function i(h){if(!h.host)h.error=h.error||"HTTP URIs must have a host.";return h}function c(h){let E=String(h.scheme).toLowerCase()==="https";if(h.port===(E?443:80)||h.port==="")h.port=void 0;if(!h.path)h.path="/";return h}function l(h){return h.secure=a(h),h.resourceName=(h.path||"/")+(h.query?"?"+h.query:""),h.path=void 0,h.query=void 0,h}function m(h){if(h.port===(a(h)?443:80)||h.port==="")h.port=void 0;if(typeof h.secure==="boolean")h.scheme=h.secure?"wss":"ws",h.secure=void 0;if(h.resourceName){let[E,A]=h.resourceName.split("?");h.path=E&&E!=="/"?E:void 0,h.query=A,h.resourceName=void 0}return h.fragment=void 0,h}function g(h,E){if(!h.path)return h.error="URN can not be parsed",h;let A=h.path.match(o);if(A){let H=E.scheme||h.scheme||"urn";h.nid=A[1].toLowerCase(),h.nss=A[2];let L=y(`${H}:${E.nid||h.nid}`);if(h.path=void 0,L)h=L.parse(h,E)}else h.error=h.error||"URN can not be parsed.";return h}function z(h,E){if(h.nid===void 0)throw Error("URN without nid cannot be serialized");let A=E.scheme||h.scheme||"urn",H=h.nid.toLowerCase(),L=y(`${A}:${E.nid||H}`);if(L)h=L.serialize(h,E);let U=h,Y=h.nss;return U.path=`${H||E.nid}:${Y}`,E.skipEscape=!0,U}function w(h,E){let A=h;if(A.uuid=A.nss,A.nss=void 0,!E.tolerant&&(!A.uuid||!r(A.uuid)))A.error=A.error||"UUID is not valid.";return A}function _(h){let E=h;return E.nss=(h.uuid||"").toLowerCase(),E}let b={scheme:"http",domainHost:!0,parse:i,serialize:c},f={scheme:"https",domainHost:b.domainHost,parse:i,serialize:c},d={scheme:"ws",domainHost:!0,parse:l,serialize:m},v={scheme:"wss",domainHost:d.domainHost,parse:d.parse,serialize:d.serialize},P={http:b,https:f,ws:d,wss:v,urn:{scheme:"urn",parse:g,serialize:z,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:w,serialize:_,skipNormalize:!0}};Object.setPrototypeOf(P,null);function y(h){return h&&(P[h]||P[h.toLowerCase()])||void 0}t.exports={wsIsSecure:a,SCHEMES:P,isValidSchemeName:s,getSchemeHandler:y}}),Z_=D((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:a,nonSimpleDomain:i}=mh(),{SCHEMES:c,getSchemeHandler:l}=L_();function m(v,p){if(typeof v==="string")v=_(f(v,p),p);else if(typeof v==="object")v=f(_(v,p),p);return v}function g(v,p,S){let P=S?Object.assign({scheme:"null"},S):{scheme:"null"},y=z(f(v,P),f(p,P),P,!0);return P.skipEscape=!0,_(y,P)}function z(v,p,S,P){let y={};if(!P)v=f(_(v,S),S),p=f(_(p,S),S);if(S=S||{},!S.tolerant&&p.scheme)y.scheme=p.scheme,y.userinfo=p.userinfo,y.host=p.host,y.port=p.port,y.path=o(p.path||""),y.query=p.query;else{if(p.userinfo!==void 0||p.host!==void 0||p.port!==void 0)y.userinfo=p.userinfo,y.host=p.host,y.port=p.port,y.path=o(p.path||""),y.query=p.query;else{if(!p.path)if(y.path=v.path,p.query!==void 0)y.query=p.query;else y.query=v.query;else{if(p.path[0]==="/")y.path=o(p.path);else{if((v.userinfo!==void 0||v.host!==void 0||v.port!==void 0)&&!v.path)y.path="/"+p.path;else if(!v.path)y.path=p.path;else y.path=v.path.slice(0,v.path.lastIndexOf("/")+1)+p.path;y.path=o(y.path)}y.query=p.query}y.userinfo=v.userinfo,y.host=v.host,y.port=v.port}y.scheme=v.scheme}return y.fragment=p.fragment,y}function w(v,p,S){if(typeof v==="string")v=unescape(v),v=_(s(f(v,S),!0),{...S,skipEscape:!0});else if(typeof v==="object")v=_(s(v,!0),{...S,skipEscape:!0});if(typeof p==="string")p=unescape(p),p=_(s(f(p,S),!0),{...S,skipEscape:!0});else if(typeof p==="object")p=_(s(p,!0),{...S,skipEscape:!0});return v.toLowerCase()===p.toLowerCase()}function _(v,p){let S={host:v.host,scheme:v.scheme,userinfo:v.userinfo,port:v.port,path:v.path,query:v.query,nid:v.nid,nss:v.nss,uuid:v.uuid,fragment:v.fragment,reference:v.reference,resourceName:v.resourceName,secure:v.secure,error:""},P=Object.assign({},p),y=[],h=l(P.scheme||S.scheme);if(h&&h.serialize)h.serialize(S,P);if(S.path!==void 0)if(!P.skipEscape){if(S.path=escape(S.path),S.scheme!==void 0)S.path=S.path.split("%3A").join(":")}else S.path=unescape(S.path);if(P.reference!=="suffix"&&S.scheme)y.push(S.scheme,":");let E=n(S);if(E!==void 0){if(P.reference!=="suffix")y.push("//");if(y.push(E),S.path&&S.path[0]!=="/")y.push("/")}if(S.path!==void 0){let A=S.path;if(!P.absolutePath&&(!h||!h.absolutePath))A=o(A);if(E===void 0&&A[0]==="/"&&A[1]==="/")A="/%2F"+A.slice(2);y.push(A)}if(S.query!==void 0)y.push("?",S.query);if(S.fragment!==void 0)y.push("#",S.fragment);return y.join("")}let b=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function f(v,p){let S=Object.assign({},p),P={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},y=!1;if(S.reference==="suffix")if(S.scheme)v=S.scheme+":"+v;else v="//"+v;let h=v.match(b);if(h){if(P.scheme=h[1],P.userinfo=h[3],P.host=h[4],P.port=parseInt(h[5],10),P.path=h[6]||"",P.query=h[7],P.fragment=h[8],isNaN(P.port))P.port=h[5];if(P.host)if(a(P.host)===!1){let A=r(P.host);P.host=A.host.toLowerCase(),y=A.isIPV6}else y=!0;if(P.scheme===void 0&&P.userinfo===void 0&&P.host===void 0&&P.port===void 0&&P.query===void 0&&!P.path)P.reference="same-document";else if(P.scheme===void 0)P.reference="relative";else if(P.fragment===void 0)P.reference="absolute";else P.reference="uri";if(S.reference&&S.reference!=="suffix"&&S.reference!==P.reference)P.error=P.error||"URI is not a "+S.reference+" reference.";let E=l(S.scheme||P.scheme);if(!S.unicodeSupport&&(!E||!E.unicodeSupport)){if(P.host&&(S.domainHost||E&&E.domainHost)&&y===!1&&i(P.host))try{P.host=URL.domainToASCII(P.host.toLowerCase())}catch(A){P.error=P.error||"Host's domain name can not be converted to ASCII: "+A}}if(!E||E&&!E.skipNormalize){if(v.indexOf("%")!==-1){if(P.scheme!==void 0)P.scheme=unescape(P.scheme);if(P.host!==void 0)P.host=unescape(P.host)}if(P.path)P.path=escape(unescape(P.path));if(P.fragment)P.fragment=encodeURI(decodeURIComponent(P.fragment))}if(E&&E.parse)E.parse(P,S)}else P.error=P.error||"URI can not be parsed.";return P}let d={SCHEMES:c,normalize:m,resolve:g,resolveComponent:z,equal:w,serialize:_,parse:f};t.exports=d,t.exports.default=d,t.exports.fastUri=d}),D_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Z_();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),au=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=jr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ce();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=nn(),n=qr(),s=uh(),a=Ba(),i=ce(),c=Ja(),l=Fa(),m=ge(),g=M_(),z=D_(),w=(I,q)=>new RegExp(I,q);w.code="new RegExp";let _=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f={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."},d={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function p(I){var q,V,R,C,j,J,re,de,ae,be,Fe,k,x,Z,ne,se,ue,Ce,je,Le,Ne,Pe,Xe,qe,it;let et=I.strict,ct=(q=I.code)===null||q===void 0?void 0:q.optimize,pt=ct===!0||ct===void 0?1:ct||0,ht=(R=(V=I.code)===null||V===void 0?void 0:V.regExp)!==null&&R!==void 0?R:w,Nt=(C=I.uriResolver)!==null&&C!==void 0?C:z.default;return{strictSchema:(J=(j=I.strictSchema)!==null&&j!==void 0?j:et)!==null&&J!==void 0?J:!0,strictNumbers:(de=(re=I.strictNumbers)!==null&&re!==void 0?re:et)!==null&&de!==void 0?de:!0,strictTypes:(be=(ae=I.strictTypes)!==null&&ae!==void 0?ae:et)!==null&&be!==void 0?be:"log",strictTuples:(k=(Fe=I.strictTuples)!==null&&Fe!==void 0?Fe:et)!==null&&k!==void 0?k:"log",strictRequired:(Z=(x=I.strictRequired)!==null&&x!==void 0?x:et)!==null&&Z!==void 0?Z:!1,code:I.code?{...I.code,optimize:pt,regExp:ht}:{optimize:pt,regExp:ht},loopRequired:(ne=I.loopRequired)!==null&&ne!==void 0?ne:v,loopEnum:(se=I.loopEnum)!==null&&se!==void 0?se:v,meta:(ue=I.meta)!==null&&ue!==void 0?ue:!0,messages:(Ce=I.messages)!==null&&Ce!==void 0?Ce:!0,inlineRefs:(je=I.inlineRefs)!==null&&je!==void 0?je:!0,schemaId:(Le=I.schemaId)!==null&&Le!==void 0?Le:"$id",addUsedSchema:(Ne=I.addUsedSchema)!==null&&Ne!==void 0?Ne:!0,validateSchema:(Pe=I.validateSchema)!==null&&Pe!==void 0?Pe:!0,validateFormats:(Xe=I.validateFormats)!==null&&Xe!==void 0?Xe:!0,unicodeRegExp:(qe=I.unicodeRegExp)!==null&&qe!==void 0?qe:!0,int32range:(it=I.int32range)!==null&&it!==void 0?it:!0,uriResolver:Nt}}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,...p(I)};let{es5:q,lines:V}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:b,es5:q,lines:V}),this.logger=U(I.logger);let R=I.validateFormats;if(I.validateFormats=!1,this.RULES=(0,s.getRules)(),P.call(this,f,I,"NOT SUPPORTED"),P.call(this,d,I,"DEPRECATED","warn"),this._metaOpts=H.call(this),I.formats)E.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),I.keywords)A.call(this,I.keywords);if(typeof I.meta=="object")this.addMetaSchema(I.meta);h.call(this),I.validateFormats=R}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:I,meta:q,schemaId:V}=this.opts,R=g;if(V==="id")R={...g},R.id=R.$id,delete R.$id;if(q&&I)this.addMetaSchema(R,R[V],!1)}defaultMeta(){let{meta:I,schemaId:q}=this.opts;return this.opts.defaultMeta=typeof I=="object"?I[q]||I:void 0}validate(I,q){let V;if(typeof I=="string"){if(V=this.getSchema(I),!V)throw Error(`no schema with key or ref "${I}"`)}else V=this.compile(I);let R=V(q);if(!("$async"in V))this.errors=V.errors;return R}compile(I,q){let V=this._addSchema(I,q);return V.validate||this._compileSchemaEnv(V)}compileAsync(I,q){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:V}=this.opts;return R.call(this,I,q);async function R(ae,be){await C.call(this,ae.$schema);let Fe=this._addSchema(ae,be);return Fe.validate||j.call(this,Fe)}async function C(ae){if(ae&&!this.getSchema(ae))await R.call(this,{$ref:ae},!0)}async function j(ae){try{return this._compileSchemaEnv(ae)}catch(be){if(!(be instanceof n.default))throw be;return J.call(this,be),await re.call(this,be.missingSchema),j.call(this,ae)}}function J({missingSchema:ae,missingRef:be}){if(this.refs[ae])throw Error(`AnySchema ${ae} is loaded but ${be} cannot be resolved`)}async function re(ae){let be=await de.call(this,ae);if(!this.refs[ae])await C.call(this,be.$schema);if(!this.refs[ae])this.addSchema(be,ae,q)}async function de(ae){let be=this._loading[ae];if(be)return be;try{return await(this._loading[ae]=V(ae))}finally{delete this._loading[ae]}}}addSchema(I,q,V,R=this.opts.validateSchema){if(Array.isArray(I)){for(let j of I)this.addSchema(j,void 0,V,R);return this}let C;if(typeof I==="object"){let{schemaId:j}=this.opts;if(C=I[j],C!==void 0&&typeof C!="string")throw Error(`schema ${j} must be string`)}return q=(0,c.normalizeId)(q||C),this._checkUnique(q),this.schemas[q]=this._addSchema(I,V,q,R,!0),this}addMetaSchema(I,q,V=this.opts.validateSchema){return this.addSchema(I,q,!0,V),this}validateSchema(I,q){if(typeof I=="boolean")return!0;let V;if(V=I.$schema,V!==void 0&&typeof V!="string")throw Error("$schema must be a string");if(V=V||this.opts.defaultMeta||this.defaultMeta(),!V)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let R=this.validate(V,I);if(!R&&q){let C="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(C);else throw Error(C)}return R}getSchema(I){let q;while(typeof(q=y.call(this,I))=="string")I=q;if(q===void 0){let{schemaId:V}=this.opts,R=new a.SchemaEnv({schema:{},schemaId:V});if(q=a.resolveSchema.call(this,R,I),!q)return;this.refs[I]=q}return q.validate||this._compileSchemaEnv(q)}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 q=y.call(this,I);if(typeof q=="object")this._cache.delete(q.schema);return delete this.schemas[I],delete this.refs[I],this}case"object":{let q=I;this._cache.delete(q);let V=I[this.opts.schemaId];if(V)V=(0,c.normalizeId)(V),delete this.schemas[V],delete this.refs[V];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(I){for(let q of I)this.addKeyword(q);return this}addKeyword(I,q){let V;if(typeof I=="string"){if(V=I,typeof q=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),q.keyword=V}else if(typeof I=="object"&&q===void 0){if(q=I,V=q.keyword,Array.isArray(V)&&!V.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(K.call(this,V,q),!q)return(0,m.eachItem)(V,(C)=>me.call(this,C)),this;ve.call(this,q);let R={...q,type:(0,l.getJSONTypes)(q.type),schemaType:(0,l.getJSONTypes)(q.schemaType)};return(0,m.eachItem)(V,R.type.length===0?(C)=>me.call(this,C,R):(C)=>R.type.forEach((j)=>me.call(this,C,R,j))),this}getKeyword(I){let q=this.RULES.all[I];return typeof q=="object"?q.definition:!!q}removeKeyword(I){let{RULES:q}=this;delete q.keywords[I],delete q.all[I];for(let V of q.rules){let R=V.rules.findIndex((C)=>C.keyword===I);if(R>=0)V.rules.splice(R,1)}return this}addFormat(I,q){if(typeof q=="string")q=new RegExp(q);return this.formats[I]=q,this}errorsText(I=this.errors,{separator:q=", ",dataVar:V="data"}={}){if(!I||I.length===0)return"No errors";return I.map((R)=>`${V}${R.instancePath} ${R.message}`).reduce((R,C)=>R+q+C)}$dataMetaSchema(I,q){let V=this.RULES.all;I=JSON.parse(JSON.stringify(I));for(let R of q){let C=R.split("/").slice(1),j=I;for(let J of C)j=j[J];for(let J in V){let re=V[J];if(typeof re!="object")continue;let{$data:de}=re.definition,ae=j[J];if(de&&ae)j[J]=fe(ae)}}return I}_removeAllSchemas(I,q){for(let V in I){let R=I[V];if(!q||q.test(V)){if(typeof R=="string")delete I[V];else if(R&&!R.meta)this._cache.delete(R.schema),delete I[V]}}}_addSchema(I,q,V,R=this.opts.validateSchema,C=this.opts.addUsedSchema){let j,{schemaId:J}=this.opts;if(typeof I=="object")j=I[J];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof I!="boolean")throw Error("schema must be object or boolean");let re=this._cache.get(I);if(re!==void 0)return re;V=(0,c.normalizeId)(j||V);let de=c.getSchemaRefs.call(this,I,V);if(re=new a.SchemaEnv({schema:I,schemaId:J,meta:q,baseId:V,localRefs:de}),this._cache.set(re.schema,re),C&&!V.startsWith("#")){if(V)this._checkUnique(V);this.refs[V]=re}if(R)this.validateSchema(I,!0);return re}_checkUnique(I){if(this.schemas[I]||this.refs[I])throw Error(`schema with key or id "${I}" already exists`)}_compileSchemaEnv(I){if(I.meta)this._compileMetaSchema(I);else a.compileSchema.call(this,I);if(!I.validate)throw Error("ajv implementation error");return I.validate}_compileMetaSchema(I){let q=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,I)}finally{this.opts=q}}};S.ValidationError=o.default,S.MissingRefError=n.default,e.default=S;function P(I,q,V,R="error"){for(let C in I){let j=C;if(j in q)this.logger[R](`${V}: option ${C}. ${I[j]}`)}}function y(I){return I=(0,c.normalizeId)(I),this.schemas[I]||this.refs[I]}function h(){let I=this.opts.schemas;if(!I)return;if(Array.isArray(I))this.addSchema(I);else for(let q in I)this.addSchema(I[q],q)}function E(){for(let I in this.opts.formats){let q=this.opts.formats[I];if(q)this.addFormat(I,q)}}function A(I){if(Array.isArray(I)){this.addVocabulary(I);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let q in I){let V=I[q];if(!V.keyword)V.keyword=q;this.addKeyword(V)}}function H(){let I={...this.opts};for(let q of _)delete I[q];return I}let L={log(){},warn(){},error(){}};function U(I){if(I===!1)return L;if(I===void 0)return console;if(I.log&&I.warn&&I.error)return I;throw Error("logger must implement log, warn and error methods")}let Y=/^[a-z_$][a-z0-9_$:-]*$/i;function K(I,q){let{RULES:V}=this;if((0,m.eachItem)(I,(R)=>{if(V.keywords[R])throw Error(`Keyword ${R} is already defined`);if(!Y.test(R))throw Error(`Keyword ${R} has invalid name`)}),!q)return;if(q.$data&&!(("code"in q)||("validate"in q)))throw Error('$data keyword must have "code" or "validate" function')}function me(I,q,V){var R;let C=q===null||q===void 0?void 0:q.post;if(V&&C)throw Error('keyword with "post" flag cannot have "type"');let{RULES:j}=this,J=C?j.post:j.rules.find(({type:de})=>de===V);if(!J)J={type:V,rules:[]},j.rules.push(J);if(j.keywords[I]=!0,!q)return;let re={keyword:I,definition:{...q,type:(0,l.getJSONTypes)(q.type),schemaType:(0,l.getJSONTypes)(q.schemaType)}};if(q.before)Re.call(this,J,re,q.before);else J.rules.push(re);j.all[I]=re,(R=q.implements)===null||R===void 0||R.forEach((de)=>this.addKeyword(de))}function Re(I,q,V){let R=I.rules.findIndex((C)=>C.keyword===V);if(R>=0)I.rules.splice(R,0,q);else I.rules.push(q),this.logger.warn(`rule ${V} is not defined`)}function ve(I){let{metaSchema:q}=I;if(q===void 0)return;if(I.$data&&this.opts.$data)q=fe(q);I.validateSchema=this.compile(q,!0)}let Oe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function fe(I){return{anyOf:[I,Oe]}}});var U_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t}),iu=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=qr(),r=st(),o=ce(),n=nt(),s=Ba(),a=ge(),i={keyword:"$ref",schemaType:"string",code(m){let{gen:g,schema:z,it:w}=m,{baseId:_,schemaEnv:b,validateName:f,opts:d,self:v}=w,{root:p}=b;if((z==="#"||z==="#/")&&_===p.baseId)return P();let S=s.resolveRef.call(v,p,_,z);if(S===void 0)throw new t.default(w.opts.uriResolver,_,z);if(S instanceof s.SchemaEnv)return y(S);return h(S);function P(){if(b===p)return l(m,f,b,b.$async);let E=g.scopeValue("root",{ref:p});return l(m,o._`${E}.validate`,p,p.$async)}function y(E){l(m,c(m,E),E,E.$async)}function h(E){let A=g.scopeValue("schema",d.code.source===!0?{ref:E,code:(0,o.stringify)(E)}:{ref:E}),H=g.name("valid"),L=m.subschema({schema:E,dataTypes:[],schemaPath:o.nil,topSchemaRef:A,errSchemaPath:z},H);m.mergeEvaluated(L),m.ok(H)}}};function c(m,g){let{gen:z}=m;return g.validate?z.scopeValue("validate",{ref:g.validate}):o._`${z.scopeValue("wrapper",{ref:g})}.validate`}e.getValidate=c;function l(m,g,z,w){let{gen:_,it:b}=m,{allErrors:f,schemaEnv:d,opts:v}=b,p=v.passContext?n.default.this:o.nil;if(w)S();else P();function S(){if(!d.$async)throw Error("async schema referenced by sync schema");let E=_.let("valid");_.try(()=>{if(_.code(o._`await ${(0,r.callValidateCode)(m,g,p)}`),h(g),!f)_.assign(E,!0)},(A)=>{if(_.if(o._`!(${A} instanceof ${b.ValidationError})`,()=>_.throw(A)),y(A),!f)_.assign(E,!1)}),m.ok(E)}function P(){m.result((0,r.callValidateCode)(m,g,p),()=>h(g),()=>y(g))}function y(E){let A=o._`${E}.errors`;_.assign(n.default.vErrors,o._`${n.default.vErrors} === null ? ${A} : ${n.default.vErrors}.concat(${A})`),_.assign(n.default.errors,o._`${n.default.vErrors}.length`)}function h(E){var A;if(!b.opts.unevaluated)return;let H=(A=z===null||z===void 0?void 0:z.validate)===null||A===void 0?void 0:A.evaluated;if(b.props!==!0)if(H&&!H.dynamicProps){if(H.props!==void 0)b.props=a.mergeEvaluated.props(_,H.props,b.props)}else{let L=_.var("props",o._`${E}.evaluated.props`);b.props=a.mergeEvaluated.props(_,L,b.props,o.Name)}if(b.items!==!0)if(H&&!H.dynamicItems){if(H.items!==void 0)b.items=a.mergeEvaluated.items(_,H.items,b.items)}else{let L=_.var("items",o._`${E}.evaluated.items`);b.items=a.mergeEvaluated.items(_,L,b.items,o.Name)}}}e.callRef=l,e.default=i}),ph=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=U_(),r=iu(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o}),V_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),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:a})=>t.str`must be ${o[s].okStr} ${a}`,params:({keyword:s,schemaCode:a})=>t._`{comparison: ${o[s].okStr}, limit: ${a}}`},code(s){let{keyword:a,data:i,schemaCode:c}=s;s.fail$data(t._`${i} ${o[a].fail} ${c} || isNaN(${i})`)}};e.default=n}),F_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>t.str`must be multiple of ${o}`,params:({schemaCode:o})=>t._`{multipleOf: ${o}}`},code(o){let{gen:n,data:s,schemaCode:a,it:i}=o,c=i.opts.multipleOfPrecision,l=n.let("res"),m=c?t._`Math.abs(Math.round(${l}) - ${l}) > 1e-${c}`:t._`${l} !== parseInt(${l})`;o.fail$data(t._`(${a} === 0 || (${l} = ${s}/${a}, ${m}))`)}};e.default=r}),H_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r){let o=r.length,n=0,s=0,a;while(s<o)if(n++,a=r.charCodeAt(s++),a>=55296&&a<=56319&&s<o){if(a=r.charCodeAt(s),(a&64512)===56320)s++}return n}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),J_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o=H_(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:a}){let i=s==="maxLength"?"more":"fewer";return t.str`must NOT have ${i} than ${a} characters`},params:({schemaCode:s})=>t._`{limit: ${s}}`},code(s){let{keyword:a,data:i,schemaCode:c,it:l}=s,m=a==="maxLength"?t.operators.GT:t.operators.LT,g=l.opts.unicode===!1?t._`${i}.length`:t._`${(0,r.useFunc)(s.gen,o.default)}(${i})`;s.fail$data(t._`${g} ${m} ${c}`)}};e.default=n}),B_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=st(),r=ge(),o=ce(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>o.str`must match pattern "${s}"`,params:({schemaCode:s})=>o._`{pattern: ${s}}`},code(s){let{gen:a,data:i,$data:c,schema:l,schemaCode:m,it:g}=s,z=g.opts.unicodeRegExp?"u":"";if(c){let{regExp:w}=g.opts.code,_=w.code==="new RegExp"?o._`new RegExp`:(0,r.useFunc)(a,w),b=a.let("valid");a.try(()=>a.assign(b,o._`${_}(${m}, ${z}).test(${i})`),()=>a.assign(b,!1)),s.fail$data(o._`!${b}`)}else{let w=(0,t.usePattern)(s,l);s.fail$data(o._`!${w}.test(${i})`)}}};e.default=n}),K_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxProperties"?"more":"fewer";return t.str`must NOT have ${s} than ${n} properties`},params:({schemaCode:o})=>t._`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:a}=o,i=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data(t._`Object.keys(${s}).length ${i} ${a}`)}};e.default=r}),G_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=st(),r=ce(),o=ge(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>r.str`must have required property '${s}'`,params:({params:{missingProperty:s}})=>r._`{missingProperty: ${s}}`},code(s){let{gen:a,schema:i,schemaCode:c,data:l,$data:m,it:g}=s,{opts:z}=g;if(!m&&i.length===0)return;let w=i.length>=z.loopRequired;if(g.allErrors)_();else b();if(z.strictRequired){let v=s.parentSchema.properties,{definedProperties:p}=s.it;for(let S of i)if((v===null||v===void 0?void 0:v[S])===void 0&&!p.has(S)){let P=`required property "${S}" is not defined at "${g.schemaEnv.baseId+g.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(g,P,g.opts.strictRequired)}}function _(){if(w||m)s.block$data(r.nil,f);else for(let v of i)(0,t.checkReportMissingProp)(s,v)}function b(){let v=a.let("missing");if(w||m){let p=a.let("valid",!0);s.block$data(p,()=>d(v,p)),s.ok(p)}else a.if((0,t.checkMissingProp)(s,i,v)),(0,t.reportMissingProp)(s,v),a.else()}function f(){a.forOf("prop",c,(v)=>{s.setParams({missingProperty:v}),a.if((0,t.noPropertyInData)(a,l,v,z.ownProperties),()=>s.error())})}function d(v,p){s.setParams({missingProperty:v}),a.forOf(v,c,()=>{a.assign(p,(0,t.propertyInData)(a,l,v,z.ownProperties)),a.if((0,r.not)(p),()=>{s.error(),a.break()})},r.nil)}}};e.default=n}),W_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxItems"?"more":"fewer";return t.str`must NOT have ${s} than ${n} items`},params:({schemaCode:o})=>t._`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:a}=o,i=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data(t._`${s}.length ${i} ${a}`)}};e.default=r}),cu=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dh();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),Y_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Fa(),r=ce(),o=ge(),n=cu(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:a,j:i}})=>r.str`must NOT have duplicate items (items ## ${i} and ${a} are identical)`,params:({params:{i:a,j:i}})=>r._`{i: ${a}, j: ${i}}`},code(a){let{gen:i,data:c,$data:l,schema:m,parentSchema:g,schemaCode:z,it:w}=a;if(!l&&!m)return;let _=i.let("valid"),b=g.items?(0,t.getSchemaTypes)(g.items):[];a.block$data(_,f,r._`${z} === false`),a.ok(_);function f(){let S=i.let("i",r._`${c}.length`),P=i.let("j");a.setParams({i:S,j:P}),i.assign(_,!0),i.if(r._`${S} > 1`,()=>(d()?v:p)(S,P))}function d(){return b.length>0&&!b.some((S)=>S==="object"||S==="array")}function v(S,P){let y=i.name("item"),h=(0,t.checkDataTypes)(b,y,w.opts.strictNumbers,t.DataType.Wrong),E=i.const("indices",r._`{}`);i.for(r._`;${S}--;`,()=>{if(i.let(y,r._`${c}[${S}]`),i.if(h,r._`continue`),b.length>1)i.if(r._`typeof ${y} == "string"`,r._`${y} += "_"`);i.if(r._`typeof ${E}[${y}] == "number"`,()=>{i.assign(P,r._`${E}[${y}]`),a.error(),i.assign(_,!1).break()}).code(r._`${E}[${y}] = ${S}`)})}function p(S,P){let y=(0,o.useFunc)(i,n.default),h=i.name("outer");i.label(h).for(r._`;${S}--;`,()=>i.for(r._`${P} = ${S}; ${P}--;`,()=>i.if(r._`${y}(${c}[${S}], ${c}[${P}])`,()=>{a.error(),i.assign(_,!1).break(h)})))}}};e.default=s}),X_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o=cu(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>t._`{allowedValue: ${s}}`},code(s){let{gen:a,data:i,$data:c,schemaCode:l,schema:m}=s;if(c||m&&typeof m=="object")s.fail$data(t._`!${(0,r.useFunc)(a,o.default)}(${i}, ${l})`);else s.fail(t._`${m} !== ${i}`)}};e.default=n}),Q_=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o=cu(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>t._`{allowedValues: ${s}}`},code(s){let{gen:a,data:i,$data:c,schema:l,schemaCode:m,it:g}=s;if(!c&&l.length===0)throw Error("enum must have non-empty array");let z=l.length>=g.opts.loopEnum,w,_=()=>w!==null&&w!==void 0?w:w=(0,r.useFunc)(a,o.default),b;if(z||c)b=a.let("valid"),s.block$data(b,f);else{if(!Array.isArray(l))throw Error("ajv implementation error");let v=a.const("vSchema",m);b=(0,t.or)(...l.map((p,S)=>d(v,S)))}s.pass(b);function f(){a.assign(b,!1),a.forOf("v",m,(v)=>a.if(t._`${_()}(${i}, ${v})`,()=>a.assign(b,!0).break()))}function d(v,p){let S=l[p];return typeof S==="object"&&S!==null?t._`${_()}(${i}, ${v}[${p}])`:t._`${i} === ${S}`}}};e.default=n}),hh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=V_(),r=F_(),o=J_(),n=B_(),s=K_(),a=G_(),i=W_(),c=Y_(),l=X_(),m=Q_(),g=[t.default,r.default,o.default,n.default,s.default,a.default,i.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,m.default];e.default=g}),fh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=ce(),r=ge(),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>t.str`must NOT have more than ${s} items`,params:({params:{len:s}})=>t._`{limit: ${s}}`},code(s){let{parentSchema:a,it:i}=s,{items:c}=a;if(!Array.isArray(c)){(0,r.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,c)}};function n(s,a){let{gen:i,schema:c,data:l,keyword:m,it:g}=s;g.items=!0;let z=i.const("len",t._`${l}.length`);if(c===!1)s.setParams({len:a.length}),s.pass(t._`${z} <= ${a.length}`);else if(typeof c=="object"&&!(0,r.alwaysValidSchema)(g,c)){let _=i.var("valid",t._`${z} <= ${a.length}`);i.if((0,t.not)(_),()=>w(_)),s.ok(_)}function w(_){i.forRange("i",a.length,z,(b)=>{if(s.subschema({keyword:m,dataProp:b,dataPropType:r.Type.Num},_),!g.allErrors)i.if((0,t.not)(_),()=>i.break())})}}e.validateAdditionalItems=n,e.default=o}),gh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=ce(),r=ge(),o=st(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(a){let{schema:i,it:c}=a;if(Array.isArray(i))return s(a,"additionalItems",i);if(c.items=!0,(0,r.alwaysValidSchema)(c,i))return;a.ok((0,o.validateArray)(a))}};function s(a,i,c=a.schema){let{gen:l,parentSchema:m,data:g,keyword:z,it:w}=a;if(f(m),w.opts.unevaluated&&c.length&&w.items!==!0)w.items=r.mergeEvaluated.items(l,c.length,w.items);let _=l.name("valid"),b=l.const("len",t._`${g}.length`);c.forEach((d,v)=>{if((0,r.alwaysValidSchema)(w,d))return;l.if(t._`${b} > ${v}`,()=>a.subschema({keyword:z,schemaProp:v,dataProp:v},_)),a.ok(_)});function f(d){let{opts:v,errSchemaPath:p}=w,S=c.length,P=S===d.minItems&&(S===d.maxItems||d[i]===!1);if(v.strictTuples&&!P){let y=`"${z}" is ${S}-tuple, but minItems or maxItems/${i} are not specified or different at path "${p}"`;(0,r.checkStrictMode)(w,y,v.strictTuples)}}}e.validateTuple=s,e.default=n}),eS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=gh(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(o)=>(0,t.validateTuple)(o,"items")};e.default=r}),tS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o=st(),n=fh(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:a}})=>t.str`must NOT have more than ${a} items`,params:({params:{len:a}})=>t._`{limit: ${a}}`},code(a){let{schema:i,parentSchema:c,it:l}=a,{prefixItems:m}=c;if(l.items=!0,(0,r.alwaysValidSchema)(l,i))return;if(m)(0,n.validateAdditionalItems)(a,m);else a.ok((0,o.validateArray)(a))}};e.default=s}),rS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:s}})=>s===void 0?t.str`must contain at least ${n} valid item(s)`:t.str`must contain at least ${n} and no more than ${s} valid item(s)`,params:({params:{min:n,max:s}})=>s===void 0?t._`{minContains: ${n}}`:t._`{minContains: ${n}, maxContains: ${s}}`},code(n){let{gen:s,schema:a,parentSchema:i,data:c,it:l}=n,m,g,{minContains:z,maxContains:w}=i;if(l.opts.next)m=z===void 0?1:z,g=w;else m=1;let _=s.const("len",t._`${c}.length`);if(n.setParams({min:m,max:g}),g===void 0&&m===0){(0,r.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(g!==void 0&&m>g){(0,r.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(l,a)){let p=t._`${_} >= ${m}`;if(g!==void 0)p=t._`${p} && ${_} <= ${g}`;n.pass(p);return}l.items=!0;let b=s.name("valid");if(g===void 0&&m===1)d(b,()=>s.if(b,()=>s.break()));else if(m===0){if(s.let(b,!0),g!==void 0)s.if(t._`${c}.length > 0`,f)}else s.let(b,!1),f();n.result(b,()=>n.reset());function f(){let p=s.name("_valid"),S=s.let("count",0);d(p,()=>s.if(p,()=>v(S)))}function d(p,S){s.forRange("i",0,_,(P)=>{n.subschema({keyword:"contains",dataProp:P,dataPropType:r.Type.Num,compositeRule:!0},p),S()})}function v(p){if(s.code(t._`${p}++`),g===void 0)s.if(t._`${p} >= ${m}`,()=>s.assign(b,!0).break());else if(s.if(t._`${p} > ${g}`,()=>s.assign(b,!1).break()),m===1)s.assign(b,!0);else s.if(t._`${p} >= ${m}`,()=>s.assign(b,!0))}}};e.default=o}),uu=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=ce(),r=ge(),o=st();e.error={message:({params:{property:c,depsCount:l,deps:m}})=>{let g=l===1?"property":"properties";return t.str`must have ${g} ${m} when property ${c} is present`},params:({params:{property:c,depsCount:l,deps:m,missingProperty:g}})=>t._`{property: ${c},
|
|
76
76
|
missingProperty: ${g},
|
|
77
77
|
depsCount: ${l},
|
|
78
|
-
deps: ${m}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){let[l,m]=s(c);a(c,l),i(c,m)}};function s({schema:c}){let l={},m={};for(let g in c){if(g==="__proto__")continue;let z=Array.isArray(c[g])?l:m;z[g]=c[g]}return[l,m]}function a(c,l=c.schema){let{gen:m,data:g,it:z}=c;if(Object.keys(l).length===0)return;let w=m.let("missing");for(let _ in l){let b=l[_];if(b.length===0)continue;let f=(0,o.propertyInData)(m,g,_,z.opts.ownProperties);if(c.setParams({property:_,depsCount:b.length,deps:b.join(", ")}),z.allErrors)m.if(f,()=>{for(let d of b)(0,o.checkReportMissingProp)(c,d)});else m.if(t._`${f} && (${(0,o.checkMissingProp)(c,b,w)})`),(0,o.reportMissingProp)(c,w),m.else()}}e.validatePropertyDeps=a;function i(c,l=c.schema){let{gen:m,data:g,keyword:z,it:w}=c,_=m.name("valid");for(let b in l){if((0,r.alwaysValidSchema)(w,l[b]))continue;m.if((0,o.propertyInData)(m,g,b,w.opts.ownProperties),()=>{let f=c.subschema({keyword:z,schemaProp:b},_);c.mergeValidEvaluated(f,_)},()=>m.var(_,!0)),c.ok(_)}}e.validateSchemaDeps=i,e.default=n}),FS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>t._`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:a,data:i,it:c}=n;if((0,r.alwaysValidSchema)(c,a))return;let l=s.name("valid");s.forIn("key",i,(m)=>{n.setParams({propertyName:m}),n.subschema({keyword:"propertyNames",data:m,dataTypes:["string"],propertyName:m,compositeRule:!0},l),s.if((0,t.not)(l),()=>{if(n.error(!0),!c.allErrors)s.break()})}),n.ok(l)}};e.default=o}),Ah=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=it(),r=ce(),o=at(),n=ge(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:a})=>r._`{additionalProperty: ${a.additionalProperty}}`},code(a){let{gen:i,schema:c,parentSchema:l,data:m,errsCount:g,it:z}=a;if(!g)throw Error("ajv implementation error");let{allErrors:w,opts:_}=z;if(z.props=!0,_.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(z,c))return;let b=(0,t.allSchemaProperties)(l.properties),f=(0,t.allSchemaProperties)(l.patternProperties);d(),a.ok(r._`${g} === ${o.default.errors}`);function d(){i.forIn("key",m,(y)=>{if(!b.length&&!f.length)S(y);else i.if(v(y),()=>S(y))})}function v(y){let h;if(b.length>8){let E=(0,n.schemaRefOrVal)(z,l.properties,"properties");h=(0,t.isOwnProperty)(i,E,y)}else if(b.length)h=(0,r.or)(...b.map((E)=>r._`${y} === ${E}`));else h=r.nil;if(f.length)h=(0,r.or)(h,...f.map((E)=>r._`${(0,t.usePattern)(a,E)}.test(${y})`));return(0,r.not)(h)}function p(y){i.code(r._`delete ${m}[${y}]`)}function S(y){if(_.removeAdditional==="all"||_.removeAdditional&&c===!1){p(y);return}if(c===!1){if(a.setParams({additionalProperty:y}),a.error(),!w)i.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(z,c)){let h=i.name("valid");if(_.removeAdditional==="failing")P(y,h,!1),i.if((0,r.not)(h),()=>{a.reset(),p(y)});else if(P(y,h),!w)i.if((0,r.not)(h),()=>i.break())}}function P(y,h,E){let A={keyword:"additionalProperties",dataProp:y,dataPropType:n.Type.Str};if(E===!1)Object.assign(A,{compositeRule:!0,createErrors:!1,allErrors:!1});a.subschema(A,h)}}};e.default=s}),HS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Zr(),r=it(),o=ge(),n=Ah(),s={keyword:"properties",type:"object",schemaType:"object",code(a){let{gen:i,schema:c,parentSchema:l,data:m,it:g}=a;if(g.opts.removeAdditional==="all"&&l.additionalProperties===void 0)n.default.code(new t.KeywordCxt(g,n.default,"additionalProperties"));let z=(0,r.allSchemaProperties)(c);for(let d of z)g.definedProperties.add(d);if(g.opts.unevaluated&&z.length&&g.props!==!0)g.props=o.mergeEvaluated.props(i,(0,o.toHash)(z),g.props);let w=z.filter((d)=>!(0,o.alwaysValidSchema)(g,c[d]));if(w.length===0)return;let _=i.name("valid");for(let d of w){if(b(d))f(d);else{if(i.if((0,r.propertyInData)(i,m,d,g.opts.ownProperties)),f(d),!g.allErrors)i.else().var(_,!0);i.endIf()}a.it.definedProperties.add(d),a.ok(_)}function b(d){return g.opts.useDefaults&&!g.compositeRule&&c[d].default!==void 0}function f(d){a.subschema({keyword:"properties",schemaProp:d,dataProp:d},_)}}};e.default=s}),JS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=it(),r=ce(),o=ge(),n=ge(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(a){let{gen:i,schema:c,data:l,parentSchema:m,it:g}=a,{opts:z}=g,w=(0,t.allSchemaProperties)(c),_=w.filter((P)=>(0,o.alwaysValidSchema)(g,c[P]));if(w.length===0||_.length===w.length&&(!g.opts.unevaluated||g.props===!0))return;let b=z.strictSchema&&!z.allowMatchingProperties&&m.properties,f=i.name("valid");if(g.props!==!0&&!(g.props instanceof r.Name))g.props=(0,n.evaluatedPropsToName)(i,g.props);let{props:d}=g;v();function v(){for(let P of w){if(b)p(P);if(g.allErrors)S(P);else i.var(f,!0),S(P),i.if(f)}}function p(P){for(let y in b)if(new RegExp(P).test(y))(0,o.checkStrictMode)(g,`property ${y} matches pattern ${P} (use allowMatchingProperties)`)}function S(P){i.forIn("key",l,(y)=>{i.if(r._`${(0,t.usePattern)(a,P)}.test(${y})`,()=>{let h=_.includes(P);if(!h)a.subschema({keyword:"patternProperties",schemaProp:P,dataProp:y,dataPropType:n.Type.Str},f);if(g.opts.unevaluated&&d!==!0)i.assign(r._`${d}[${y}]`,!0);else if(!h&&!g.allErrors)i.if((0,r.not)(f),()=>i.break())})})}}};e.default=s}),BS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ge(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:a}=o;if((0,t.alwaysValidSchema)(a,s)){o.fail();return}let i=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),o.failResult(i,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r}),KS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:it().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t}),GS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>t._`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:a,parentSchema:i,it:c}=n;if(!Array.isArray(a))throw Error("ajv implementation error");if(c.opts.discriminator&&i.discriminator)return;let l=a,m=s.let("valid",!1),g=s.let("passing",null),z=s.name("_valid");n.setParams({passing:g}),s.block(w),n.result(m,()=>n.reset(),()=>n.error(!0));function w(){l.forEach((_,b)=>{let f;if((0,r.alwaysValidSchema)(c,_))s.var(z,!0);else f=n.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},z);if(b>0)s.if(t._`${z} && ${m}`).assign(m,!1).assign(g,t._`[${g}, ${b}]`).else();s.if(z,()=>{if(s.assign(m,!0),s.assign(g,b),f)n.mergeEvaluated(f,t.Name)})})}}};e.default=o}),WS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ge(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:s,it:a}=o;if(!Array.isArray(s))throw Error("ajv implementation error");let i=n.name("valid");s.forEach((c,l)=>{if((0,t.alwaysValidSchema)(a,c))return;let m=o.subschema({keyword:"allOf",schemaProp:l},i);o.ok(i),o.mergeEvaluated(m)})}};e.default=r}),YS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>t.str`must match "${s.ifClause}" schema`,params:({params:s})=>t._`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:a,parentSchema:i,it:c}=s;if(i.then===void 0&&i.else===void 0)(0,r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let l=n(c,"then"),m=n(c,"else");if(!l&&!m)return;let g=a.let("valid",!0),z=a.name("_valid");if(w(),s.reset(),l&&m){let b=a.let("ifClause");s.setParams({ifClause:b}),a.if(z,_("then",b),_("else",b))}else if(l)a.if(z,_("then"));else a.if((0,t.not)(z),_("else"));s.pass(g,()=>s.error(!0));function w(){let b=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},z);s.mergeEvaluated(b)}function _(b,f){return()=>{let d=s.subschema({keyword:b},z);if(a.assign(g,z),s.mergeValidEvaluated(d,g),f)a.assign(f,t._`${b}`);else s.setParams({ifClause:b})}}}};function n(s,a){let i=s.schema[a];return i!==void 0&&!(0,r.alwaysValidSchema)(s,i)}e.default=o}),XS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ge(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){if(n.if===void 0)(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r}),Mh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=qh(),r=DS(),o=xh(),n=US(),s=VS(),a=Ru(),i=FS(),c=Ah(),l=HS(),m=JS(),g=BS(),z=KS(),w=GS(),_=WS(),b=YS(),f=XS();function d(v=!1){let p=[g.default,z.default,w.default,_.default,b.default,f.default,i.default,c.default,a.default,l.default,m.default];if(v)p.push(r.default,n.default);else p.push(t.default,o.default);return p.push(s.default),p}e.default=d}),QS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>t.str`must match format "${o}"`,params:({schemaCode:o})=>t._`{format: ${o}}`},code(o,n){let{gen:s,data:a,$data:i,schema:c,schemaCode:l,it:m}=o,{opts:g,errSchemaPath:z,schemaEnv:w,self:_}=m;if(!g.validateFormats)return;if(i)b();else f();function b(){let d=s.scopeValue("formats",{ref:_.formats,code:g.code.formats}),v=s.const("fDef",t._`${d}[${l}]`),p=s.let("fType"),S=s.let("format");s.if(t._`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>s.assign(p,t._`${v}.type || "string"`).assign(S,t._`${v}.validate`),()=>s.assign(p,t._`"string"`).assign(S,v)),o.fail$data((0,t.or)(P(),y()));function P(){if(g.strictSchema===!1)return t.nil;return t._`${l} && !${S}`}function y(){let h=w.$async?t._`(${v}.async ? await ${S}(${a}) : ${S}(${a}))`:t._`${S}(${a})`,E=t._`(typeof ${S} == "function" ? ${h} : ${S}.test(${a}))`;return t._`${S} && ${S} !== true && ${p} === ${n} && !${E}`}}function f(){let d=_.formats[c];if(!d){P();return}if(d===!0)return;let[v,p,S]=y(d);if(v===n)o.pass(h());function P(){if(g.strictSchema===!1){_.logger.warn(E());return}throw Error(E());function E(){return`unknown format "${c}" ignored in schema at path "${z}"`}}function y(E){let A=E instanceof RegExp?(0,t.regexpCode)(E):g.code.formats?t._`${g.code.formats}${(0,t.getProperty)(c)}`:void 0,H=s.scopeValue("formats",{key:c,ref:E,code:A});if(typeof E=="object"&&!(E instanceof RegExp))return[E.type||"string",E.validate,t._`${H}.validate`];return["string",E,H]}function h(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!w.$async)throw Error("async format in sync schema");return t._`await ${S}(${a})`}return typeof p=="function"?t._`${S}(${a})`:t._`${S}.test(${a})`}}}};e.default=r}),Lh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[QS().default];e.default=t}),Zh=D((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"]}),Dh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Nh(),r=jh(),o=Mh(),n=Lh(),s=Zh(),a=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=a}),ey=D((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={}))}),wu=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ey(),o=Xa(),n=Dr(),s=ge(),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:i,tagName:c}})=>i===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:i,tag:c,tagName:l}})=>t._`{error: ${i}, tag: ${l}, tagValue: ${c}}`},code(i){let{gen:c,data:l,schema:m,parentSchema:g,it:z}=i,{oneOf:w}=g;if(!z.opts.discriminator)throw Error("discriminator: requires discriminator option");let _=m.propertyName;if(typeof _!="string")throw Error("discriminator: requires propertyName");if(m.mapping)throw Error("discriminator: mapping is not supported");if(!w)throw Error("discriminator: requires oneOf keyword");let b=c.let("valid",!1),f=c.const("tag",t._`${l}${(0,t.getProperty)(_)}`);c.if(t._`typeof ${f} == "string"`,()=>d(),()=>i.error(!1,{discrError:r.DiscrError.Tag,tag:f,tagName:_})),i.ok(b);function d(){let S=p();c.if(!1);for(let P in S)c.elseIf(t._`${f} === ${P}`),c.assign(b,v(S[P]));c.else(),i.error(!1,{discrError:r.DiscrError.Mapping,tag:f,tagName:_}),c.endIf()}function v(S){let P=c.name("valid"),y=i.subschema({keyword:"oneOf",schemaProp:S},P);return i.mergeEvaluated(y,t.Name),P}function p(){var S;let P={},y=E(g),h=!0;for(let L=0;L<w.length;L++){let U=w[L];if((U===null||U===void 0?void 0:U.$ref)&&!(0,s.schemaHasRulesButRef)(U,z.self.RULES)){let K=U.$ref;if(U=o.resolveRef.call(z.self,z.schemaEnv.root,z.baseId,K),U instanceof o.SchemaEnv)U=U.schema;if(U===void 0)throw new n.default(z.opts.uriResolver,z.baseId,K)}let Y=(S=U===null||U===void 0?void 0:U.properties)===null||S===void 0?void 0:S[_];if(typeof Y!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${_}"`);h=h&&(y||E(U)),A(Y,L)}if(!h)throw Error(`discriminator: "${_}" must be required`);return P;function E({required:L}){return Array.isArray(L)&&L.includes(_)}function A(L,U){if(L.const)H(L.const,U);else if(L.enum)for(let Y of L.enum)H(Y,U);else throw Error(`discriminator: "properties/${_}" must have "const" or "enum"`)}function H(L,U){if(typeof L!="string"||L in P)throw Error(`discriminator: "${_}" values must be unique strings`);P[L]=U}}}};e.default=a}),ty=D((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}}),Uh=D((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=bu(),o=Dh(),n=wu(),s=ty(),a=["/properties"],i="http://json-schema.org/draft-07/schema";var c=class extends r.default{_addVocabularies(){if(super._addVocabularies(),o.default.forEach((w)=>this.addVocabulary(w)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let w=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(w,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var l=Zr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var m=ce();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var g=pn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return g.default}});var z=Dr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return z.default}})}),Vh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=ce(),r=at(),o=Xa(),n=zu(),s={keyword:"$dynamicAnchor",schemaType:"string",code:(c)=>a(c,c.schema)};function a(c,l){let{gen:m,it:g}=c;g.schemaEnv.root.dynamicAnchors[l]=!0;let z=t._`${r.default.dynamicAnchors}${(0,t.getProperty)(l)}`,w=g.errSchemaPath==="#"?g.validateName:i(c);m.if(t._`!${z}`,()=>m.assign(z,w))}e.dynamicAnchor=a;function i(c){let{schemaEnv:l,schema:m,self:g}=c.it,{root:z,baseId:w,localRefs:_,meta:b}=l.root,{schemaId:f}=g.opts,d=new o.SchemaEnv({schema:m,schemaId:f,root:z,baseId:w,localRefs:_,meta:b});return o.compileSchema.call(g,d),(0,n.getValidate)(c,d)}e.default=s}),Fh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=ce(),r=at(),o=zu(),n={keyword:"$dynamicRef",schemaType:"string",code:(a)=>s(a,a.schema)};function s(a,i){let{gen:c,keyword:l,it:m}=a;if(i[0]!=="#")throw Error(`"${l}" only supports hash fragment reference`);let g=i.slice(1);if(m.allErrors)z();else{let _=c.let("valid",!1);z(_),a.ok(_)}function z(_){if(m.schemaEnv.root.dynamicAnchors[g]){let b=c.let("_v",t._`${r.default.dynamicAnchors}${(0,t.getProperty)(g)}`);c.if(b,w(b,_),w(m.validateName,_))}else w(m.validateName,_)()}function w(_,b){return b?()=>c.block(()=>{(0,o.callRef)(a,_),c.let(b,!0)}):()=>(0,o.callRef)(a,_)}}e.dynamicRef=s,e.default=n}),ry=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Vh(),r=ge(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){if(n.schema)(0,t.dynamicAnchor)(n,"");else(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o}),oy=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Fh(),r={keyword:"$recursiveRef",schemaType:"string",code:(o)=>(0,t.dynamicRef)(o,o.schema)};e.default=r}),Hh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Vh(),r=Fh(),o=ry(),n=oy(),s=[t.default,r.default,o.default,n.default];e.default=s}),ny=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ru(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:(o)=>(0,t.validatePropertyDeps)(o)};e.default=r}),sy=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ru(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(o)=>(0,t.validateSchemaDeps)(o)};e.default=r}),ay=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ge(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){if(n.contains===void 0)(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r}),Jh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ny(),r=sy(),o=ay(),n=[t.default,r.default,o.default];e.default=n}),iy=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o=at(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>t._`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:a,schema:i,data:c,errsCount:l,it:m}=s;if(!l)throw Error("ajv implementation error");let{allErrors:g,props:z}=m;if(z instanceof t.Name)a.if(t._`${z} !== true`,()=>a.forIn("key",c,(f)=>a.if(_(z,f),()=>w(f))));else if(z!==!0)a.forIn("key",c,(f)=>z===void 0?w(f):a.if(b(z,f),()=>w(f)));m.props=!0,s.ok(t._`${l} === ${o.default.errors}`);function w(f){if(i===!1){if(s.setParams({unevaluatedProperty:f}),s.error(),!g)a.break();return}if(!(0,r.alwaysValidSchema)(m,i)){let d=a.name("valid");if(s.subschema({keyword:"unevaluatedProperties",dataProp:f,dataPropType:r.Type.Str},d),!g)a.if((0,t.not)(d),()=>a.break())}}function _(f,d){return t._`!${f} || !${f}[${d}]`}function b(f,d){let v=[];for(let p in f)if(f[p]===!0)v.push(t._`${d} !== ${p}`);return(0,t.and)(...v)}}};e.default=n}),cy=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>t.str`must NOT have more than ${n} items`,params:({params:{len:n}})=>t._`{limit: ${n}}`},code(n){let{gen:s,schema:a,data:i,it:c}=n,l=c.items||0;if(l===!0)return;let m=s.const("len",t._`${i}.length`);if(a===!1)n.setParams({len:l}),n.fail(t._`${m} > ${l}`);else if(typeof a=="object"&&!(0,r.alwaysValidSchema)(c,a)){let z=s.var("valid",t._`${m} <= ${l}`);s.if((0,t.not)(z),()=>g(z,l)),n.ok(z)}c.items=!0;function g(z,w){s.forRange("i",w,m,(_)=>{if(n.subschema({keyword:"unevaluatedItems",dataProp:_,dataPropType:r.Type.Num},z),!c.allErrors)s.if((0,t.not)(z),()=>s.break())})}}};e.default=o}),Bh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=iy(),r=cy(),o=[t.default,r.default];e.default=o}),uy=D((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"}]}}}}}),ly=D((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:"#"}}}}}),dy=D((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:"#"}}}}),my=D((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:{}}}}}),py=D((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"}}}}),hy=D((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}}}}),fy=D((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:[]}}}}),gy=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uy(),r=ly(),o=dy(),n=my(),s=py(),a=hy(),i=fy(),c=["/properties"];function l(m){return[t,r,o,n,g(this,s),a,g(this,i)].forEach((z)=>this.addMetaSchema(z,void 0,!1)),this;function g(z,w){return m?z.$dataMetaSchema(w,c):w}}e.default=l}),_y=D((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=bu(),o=Dh(),n=Hh(),s=Jh(),a=Bh(),i=wu(),c=gy(),l="https://json-schema.org/draft/2019-09/schema";var m=class extends r.default{constructor(b={}){super({...b,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach((b)=>this.addVocabulary(b)),this.addVocabulary(s.default),this.addVocabulary(a.default),this.opts.discriminator)this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:b,meta:f}=this.opts;if(!f)return;c.default.call(this,b),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};e.Ajv2019=m,t.exports=e=m,t.exports.Ajv2019=m,Object.defineProperty(e,"__esModule",{value:!0}),e.default=m;var g=Zr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return g.KeywordCxt}});var z=ce();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return z._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return z.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return z.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return z.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return z.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return z.CodeGen}});var w=pn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return w.default}});var _=Dr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return _.default}})}),Sy=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Nh(),r=jh(),o=Mh(),n=Hh(),s=Jh(),a=Bh(),i=Lh(),c=Zh(),l=[n.default,t.default,r.default,(0,o.default)(!0),i.default,c.metadataVocabulary,c.contentVocabulary,s.default,a.default];e.default=l}),yy=D((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}}}}),vy=D((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"}}}}}),by=D((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"}}}}),zy=D((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"}}}}),$y=D((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"}}}}),Ry=D((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"}}}}),wy=D((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}}}}),Py=D((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:[]}}}}),Ey=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=yy(),r=vy(),o=by(),n=zy(),s=$y(),a=Ry(),i=wy(),c=Py(),l=["/properties"];function m(g){return[t,r,o,n,s,z(this,a),i,z(this,c)].forEach((w)=>this.addMetaSchema(w,void 0,!1)),this;function z(w,_){return g?w.$dataMetaSchema(_,l):_}}e.default=m}),Ty=D((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=bu(),o=Sy(),n=wu(),s=Ey(),a="https://json-schema.org/draft/2020-12/schema";var i=class extends r.default{constructor(z={}){super({...z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),o.default.forEach((z)=>this.addVocabulary(z)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:z,meta:w}=this.opts;if(!w)return;s.default.call(this,z),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}};e.Ajv2020=i,t.exports=e=i,t.exports.Ajv2020=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var c=Zr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var l=ce();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 m=pn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return m.default}});var g=Dr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return g.default}})}),ky=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(L,U){return{validate:L,compare:U}}e.fullFormats={date:t(s,a),time:t(c(!0),l),"date-time":t(z(!0),w),"iso-time":t(c(),m),"iso-date-time":t(z(),_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:d,"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:H,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:p,int32:{type:"number",validate:y},int64:{type:"number",validate:h},float:{type:"number",validate:E},double:{type:"number",validate:E},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"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,w),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),"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,_),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(L){return L%4===0&&(L%100!==0||L%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(L){let U=o.exec(L);if(!U)return!1;let Y=+U[1],K=+U[2],me=+U[3];return K>=1&&K<=12&&me>=1&&me<=(K===2&&r(Y)?29:n[K])}function a(L,U){if(!(L&&U))return;if(L>U)return 1;if(L<U)return-1;return 0}let i=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(L){return function(Y){let K=i.exec(Y);if(!K)return!1;let me=+K[1],we=+K[2],ze=+K[3],Ne=K[4],fe=K[5]==="-"?-1:1,I=+(K[6]||0),q=+(K[7]||0);if(I>23||q>59||L&&!Ne)return!1;if(me<=23&&we<=59&&ze<60)return!0;let V=we-q*fe,R=me-I*fe-(V<0?1:0);return(R===23||R===-1)&&(V===59||V===-1)&&ze<61}}function l(L,U){if(!(L&&U))return;let Y=new Date("2020-01-01T"+L).valueOf(),K=new Date("2020-01-01T"+U).valueOf();if(!(Y&&K))return;return Y-K}function m(L,U){if(!(L&&U))return;let Y=i.exec(L),K=i.exec(U);if(!(Y&&K))return;if(L=Y[1]+Y[2]+Y[3],U=K[1]+K[2]+K[3],L>U)return 1;if(L<U)return-1;return 0}let g=/t|\s/i;function z(L){let U=c(L);return function(K){let me=K.split(g);return me.length===2&&s(me[0])&&U(me[1])}}function w(L,U){if(!(L&&U))return;let Y=new Date(L).valueOf(),K=new Date(U).valueOf();if(!(Y&&K))return;return Y-K}function _(L,U){if(!(L&&U))return;let[Y,K]=L.split(g),[me,we]=U.split(g),ze=a(Y,me);if(ze===void 0)return;return ze||l(K,we)}let b=/\/|:/,f=/^(?:[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 d(L){return b.test(L)&&f.test(L)}let v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function p(L){return v.lastIndex=0,v.test(L)}let S=-2147483648,P=2147483647;function y(L){return Number.isInteger(L)&&L<=P&&L>=S}function h(L){return Number.isInteger(L)}function E(){return!0}let A=/[^\\]\\Z/;function H(L){if(A.test(L))return!1;try{return new RegExp(L),!0}catch(U){return!1}}}),Cy=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=Uh(),r=ce(),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:i,schemaCode:c})=>r.str`should be ${n[i].okStr} ${c}`,params:({keyword:i,schemaCode:c})=>r._`{comparison: ${n[i].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(i){let{gen:c,data:l,schemaCode:m,keyword:g,it:z}=i,{opts:w,self:_}=z;if(!w.validateFormats)return;let b=new t.KeywordCxt(z,_.RULES.all.format.definition,"format");if(b.$data)f();else d();function f(){let p=c.scopeValue("formats",{ref:_.formats,code:w.code.formats}),S=c.const("fmt",r._`${p}[${b.schemaCode}]`);i.fail$data((0,r.or)(r._`typeof ${S} != "object"`,r._`${S} instanceof RegExp`,r._`typeof ${S}.compare != "function"`,v(S)))}function d(){let p=b.schema,S=_.formats[p];if(!S||S===!0)return;if(typeof S!="object"||S instanceof RegExp||typeof S.compare!="function")throw Error(`"${g}": format "${p}" does not define "compare" function`);let P=c.scopeValue("formats",{key:p,ref:S,code:w.code.formats?r._`${w.code.formats}${(0,r.getProperty)(p)}`:void 0});i.fail$data(v(P))}function v(p){return r._`${p}.compare(${l}, ${m}) ${n[g].fail} 0`}},dependencies:["format"]};let a=(i)=>(i.addKeyword(e.formatLimitDefinition),i);e.default=a}),Iy=D((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=ky(),o=Cy(),n=ce(),s=new n.Name("fullFormats"),a=new n.Name("fastFormats"),i=(l,m={keywords:!0})=>{if(Array.isArray(m))return c(l,m,r.fullFormats,s),l;let[g,z]=m.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,s];if(c(l,m.formats||r.formatNames,g,z),m.keywords)(0,o.default)(l);return l};i.get=(l,m="full")=>{let g=(m==="fast"?r.fastFormats:r.fullFormats)[l];if(!g)throw Error(`Unknown format "${l}"`);return g};function c(l,m,g,z){var w,_;(w=(_=l.opts.code).formats)!==null&&w!==void 0||(_.formats=n._`require("ajv-formats/dist/formats").${z}`);for(let b of m)l.addFormat(b,g[b])}t.exports=e=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i}),Kh=Uh(),Oy=_y(),Ny=Ty(),jy=On(Iy(),1),qy=jy.default;function vu(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return qy(t),t}var Pu=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=vu(Ny.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Nu(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(t==="2020-12")return this.ajv;if(t==="2019-09")return this._ajv2019??=vu(Oy.Ajv2019);return this._ajvDraft7??=vu(Kh.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)}}},gz=Kh.Ajv;import Eu from"node:process";var xy=8,Ay=600000;function My(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??xy,roundTimeoutMs:e?.roundTimeoutMs??Ay,legacyShim:e?.legacyShim??!0}}function Gh(e,t,r){if(r===null||typeof r!=="object"||typeof r.method!=="string")throw new he(Q.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=Jp(o);if(n===void 0)throw new he(Q.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 Ly(){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 Tu(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new he(Q.InternalError,t)}var Zy=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:a}=this._host,i=o.mcpReq.signal,c=n,l=0;while(!0){if(l+=1,l>s)return Tu(e,Sh(e,s));let m=c.inputRequests,g=m!=null&&Object.keys(m).length>0,z=typeof c.requestState==="string"?c.requestState:void 0;if(!g&&z===void 0)throw new he(Q.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 w;if(g){let f=this._host.resolvedClientCapabilities(o),d=[];for(let[p,S]of Object.entries(m)){let{embedded:P,required:y}=Gh(e,p,S);if(P.method!=="roots/list"&&P.params===void 0)throw new he(Q.InternalError,`Handler for ${e} returned an input request '${p}' of kind '${P.method}' without params`);if(iu(y,f)!==void 0)return Tu(e,`Cannot request input '${p}' (${P.method}): the client on this 2025-era connection did not declare the required capability${f===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);d.push([p,P])}let v=vh(i);try{let p={relatedRequestId:o.mcpReq.id,timeout:a,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:v.signal},S=await Promise.all(d.map(async([P,y])=>{try{return[P,await this._dispatchLeg(y,p)]}catch(h){throw v.abort(h),h}}));w=Object.fromEntries(S)}catch(p){if(i.aborted)throw p;return Tu(e,`Fulfilling input required by '${e}' failed: ${p instanceof Error?p.message:String(p)}`)}finally{v.dispose()}}else await yh(_h,i);let _={...o,mcpReq:{...o.mcpReq,inputResponses:w,droppedInputResponseKeys:void 0,requestState:mn(z)}};if(z!==void 0){let f=await this._host.verifyRequestState(z,_,e);if(f!==void 0)_=yu(_,f)}let b=await t(r,_);if(!Lr(b))return b;c=b}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;if(r.mode==="url"&&r.elicitationId===void 0)r={...r,elicitationId:Ly()};return 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)}}},Dy=new Set(["tools/call","prompts/get","resources/read"]),Uy,Vy,Fy;var h0=class extends Rh{_clientCapabilities;_clientVersion;static{Uy=(e,t)=>{if(t.clientCapabilities!==void 0)e._clientCapabilities=t.clientCapabilities;if(t.clientInfo!==void 0)e._clientVersion=t.clientInfo},Vy=(e,t)=>{let r=t.filter((o)=>!e._supportedProtocolVersions.includes(o));if(r.length>0)e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r];e.setRequestHandler("server/discover",()=>e._ondiscover())},Fy=(e)=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Zy({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){super(t);if(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=My(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))if(o!==void 0)oh(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}if(this.setRequestHandler("initialize",(r)=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),cu(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(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=Ba(At,o);if(n.success)this._loggingLevels.set(r,n.data);return{}})}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 a;if(this._servedModernEra()){if(a=e.mcpReq.envelope?.[Qt],a===void 0)return Promise.resolve()}else a=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);if(a!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(a))return Promise.resolve();return 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(At.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(pe.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;if(this._capabilities=wh(this._capabilities,e),!t&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=Dy.has(e);if(r===void 0&&!o)return async(n,s)=>{let a=await t(n,s);if(Lr(a))throw new he(Q.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 a};return async(n,s)=>{let a=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(Lr(a)){if(!o)throw new he(Q.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 a}return r===void 0?a:rh(a,r)}}return async(r,o)=>{let n=Mr(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new he(s.reason==="not-in-era"?Q.InternalError:Q.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let a=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(Lr(a))return a;let i=uu(a),c=n.validateResult("tools/call",i);if(!c.ok)throw new he(c.reason==="not-in-era"?Q.InternalError:Q.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&&dn(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 he(Q.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let a=o;if(typeof s==="string"){let g=await this._verifyRequestState(s,o,e);if(g!==void 0)a=yu(o,g)}let i;try{i=await t(r,a)}catch(g){if(g instanceof he&&g.code===Q.UrlElicitationRequired){if(!n)throw g;throw new he(Q.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw g}if(!Lr(i))return i;if(!n){if(!this._inputRequiredServing.legacyShim)throw new he(Q.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??zr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,a,i)}let c=i.inputRequests,l=c!=null&&Object.keys(c).length>0,m=typeof i.requestState==="string";if(!l&&!m)throw new he(Q.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(l){let g=this._inputRequestCapabilityView(o);for(let[z,w]of Object.entries(c)){let{embedded:_,required:b}=Gh(e,z,w),f=iu(b,g);if(f!==void 0)throw new hu({requiredCapabilities:f},`Cannot request input '${z}' (${_.method}): the request's client capabilities do not declare the required capability`)}}return i}async _verifyRequestState(e,t,r){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new he(Q.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[It]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new le(pe.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 — 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(pe.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new le(pe.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new le(pe.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(pe.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(pe.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new le(pe.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(pe.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(pe.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(pe.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new le(pe.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new le(pe.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(pe.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new le(pe.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=Bp(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??zr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:cu(this._supportedProtocolVersions),capabilities:Hy(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(pe.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),a=Array.isArray(s.content)?s.content:[s.content],i=a.some((g)=>g.type==="tool_result"),c=e.messages.length>1?e.messages.at(-2):void 0,l=c?Array.isArray(c.content)?c.content:[c.content]:[],m=l.some((g)=>g.type==="tool_use");if(i){if(a.some((g)=>g.type!=="tool_result"))throw new he(Q.InvalidParams,"The last message must contain only tool_result content if any is present");if(!m)throw new he(Q.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(m){let g=new Set(l.filter((w)=>w.type==="tool_use").map((w)=>w.id)),z=new Set(a.filter((w)=>w.type==="tool_result").map((w)=>w.toolUseId));if(g.size!==z.size||![...g].every((w)=>z.has(w)))throw new he(Q.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=Boolean(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(pe.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(pe.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new le(pe.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"},a=await this.request({method:"elicitation/create",params:s},t);if(n&&a.action==="accept"&&a.content&&s.requestedSchema)try{let i=this._jsonSchemaValidator.getValidator(s.requestedSchema)(a.content);if(!i.valid)throw new he(Q.InvalidParams,`Elicitation response content does not match requested schema: ${i.errorMessage}`)}catch(i){if(i instanceof he)throw i;throw new he(Q.InternalError,`Error validating elicitation response: ${i instanceof Error?i.message:String(i)}`)}return a}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new le(pe.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 Hy(e){return{...e}}var Jy=class{_readBuffer;_started=!1;_closed=!1;constructor(e=Eu.stdin,t=Eu.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new Ph({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 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(){while(!0)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){if(this._closed)return;if(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){if(this._closed)return Promise.reject(Error("StdioServerTransport is closed"));return new Promise((t,r)=>{let o=Eh(e),n=!1,s=(i)=>{if(n)return;n=!0,this._stdout.off("error",s),this._stdout.off("drain",a),r(i)},a=()=>{if(n)return;n=!0,this._stdout.off("error",s),this._stdout.off("drain",a),t()};if(this._stdout.once("error",s),this._stdout.write(o)){if(n)return;n=!0,this._stdout.off("error",s),t()}else if(!n)this._stdout.once("drain",a)})}};export{Jy as StdioServerTransport};
|
|
78
|
+
deps: ${m}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){let[l,m]=s(c);a(c,l),i(c,m)}};function s({schema:c}){let l={},m={};for(let g in c){if(g==="__proto__")continue;let z=Array.isArray(c[g])?l:m;z[g]=c[g]}return[l,m]}function a(c,l=c.schema){let{gen:m,data:g,it:z}=c;if(Object.keys(l).length===0)return;let w=m.let("missing");for(let _ in l){let b=l[_];if(b.length===0)continue;let f=(0,o.propertyInData)(m,g,_,z.opts.ownProperties);if(c.setParams({property:_,depsCount:b.length,deps:b.join(", ")}),z.allErrors)m.if(f,()=>{for(let d of b)(0,o.checkReportMissingProp)(c,d)});else m.if(t._`${f} && (${(0,o.checkMissingProp)(c,b,w)})`),(0,o.reportMissingProp)(c,w),m.else()}}e.validatePropertyDeps=a;function i(c,l=c.schema){let{gen:m,data:g,keyword:z,it:w}=c,_=m.name("valid");for(let b in l){if((0,r.alwaysValidSchema)(w,l[b]))continue;m.if((0,o.propertyInData)(m,g,b,w.opts.ownProperties),()=>{let f=c.subschema({keyword:z,schemaProp:b},_);c.mergeValidEvaluated(f,_)},()=>m.var(_,!0)),c.ok(_)}}e.validateSchemaDeps=i,e.default=n}),oS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>t._`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:a,data:i,it:c}=n;if((0,r.alwaysValidSchema)(c,a))return;let l=s.name("valid");s.forIn("key",i,(m)=>{n.setParams({propertyName:m}),n.subschema({keyword:"propertyNames",data:m,dataTypes:["string"],propertyName:m,compositeRule:!0},l),s.if((0,t.not)(l),()=>{if(n.error(!0),!c.allErrors)s.break()})}),n.ok(l)}};e.default=o}),_h=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=st(),r=ce(),o=nt(),n=ge(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:a})=>r._`{additionalProperty: ${a.additionalProperty}}`},code(a){let{gen:i,schema:c,parentSchema:l,data:m,errsCount:g,it:z}=a;if(!g)throw Error("ajv implementation error");let{allErrors:w,opts:_}=z;if(z.props=!0,_.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(z,c))return;let b=(0,t.allSchemaProperties)(l.properties),f=(0,t.allSchemaProperties)(l.patternProperties);d(),a.ok(r._`${g} === ${o.default.errors}`);function d(){i.forIn("key",m,(y)=>{if(!b.length&&!f.length)S(y);else i.if(v(y),()=>S(y))})}function v(y){let h;if(b.length>8){let E=(0,n.schemaRefOrVal)(z,l.properties,"properties");h=(0,t.isOwnProperty)(i,E,y)}else if(b.length)h=(0,r.or)(...b.map((E)=>r._`${y} === ${E}`));else h=r.nil;if(f.length)h=(0,r.or)(h,...f.map((E)=>r._`${(0,t.usePattern)(a,E)}.test(${y})`));return(0,r.not)(h)}function p(y){i.code(r._`delete ${m}[${y}]`)}function S(y){if(_.removeAdditional==="all"||_.removeAdditional&&c===!1){p(y);return}if(c===!1){if(a.setParams({additionalProperty:y}),a.error(),!w)i.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(z,c)){let h=i.name("valid");if(_.removeAdditional==="failing")P(y,h,!1),i.if((0,r.not)(h),()=>{a.reset(),p(y)});else if(P(y,h),!w)i.if((0,r.not)(h),()=>i.break())}}function P(y,h,E){let A={keyword:"additionalProperties",dataProp:y,dataPropType:n.Type.Str};if(E===!1)Object.assign(A,{compositeRule:!0,createErrors:!1,allErrors:!1});a.subschema(A,h)}}};e.default=s}),nS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=jr(),r=st(),o=ge(),n=_h(),s={keyword:"properties",type:"object",schemaType:"object",code(a){let{gen:i,schema:c,parentSchema:l,data:m,it:g}=a;if(g.opts.removeAdditional==="all"&&l.additionalProperties===void 0)n.default.code(new t.KeywordCxt(g,n.default,"additionalProperties"));let z=(0,r.allSchemaProperties)(c);for(let d of z)g.definedProperties.add(d);if(g.opts.unevaluated&&z.length&&g.props!==!0)g.props=o.mergeEvaluated.props(i,(0,o.toHash)(z),g.props);let w=z.filter((d)=>!(0,o.alwaysValidSchema)(g,c[d]));if(w.length===0)return;let _=i.name("valid");for(let d of w){if(b(d))f(d);else{if(i.if((0,r.propertyInData)(i,m,d,g.opts.ownProperties)),f(d),!g.allErrors)i.else().var(_,!0);i.endIf()}a.it.definedProperties.add(d),a.ok(_)}function b(d){return g.opts.useDefaults&&!g.compositeRule&&c[d].default!==void 0}function f(d){a.subschema({keyword:"properties",schemaProp:d,dataProp:d},_)}}};e.default=s}),sS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=st(),r=ce(),o=ge(),n=ge(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(a){let{gen:i,schema:c,data:l,parentSchema:m,it:g}=a,{opts:z}=g,w=(0,t.allSchemaProperties)(c),_=w.filter((P)=>(0,o.alwaysValidSchema)(g,c[P]));if(w.length===0||_.length===w.length&&(!g.opts.unevaluated||g.props===!0))return;let b=z.strictSchema&&!z.allowMatchingProperties&&m.properties,f=i.name("valid");if(g.props!==!0&&!(g.props instanceof r.Name))g.props=(0,n.evaluatedPropsToName)(i,g.props);let{props:d}=g;v();function v(){for(let P of w){if(b)p(P);if(g.allErrors)S(P);else i.var(f,!0),S(P),i.if(f)}}function p(P){for(let y in b)if(new RegExp(P).test(y))(0,o.checkStrictMode)(g,`property ${y} matches pattern ${P} (use allowMatchingProperties)`)}function S(P){i.forIn("key",l,(y)=>{i.if(r._`${(0,t.usePattern)(a,P)}.test(${y})`,()=>{let h=_.includes(P);if(!h)a.subschema({keyword:"patternProperties",schemaProp:P,dataProp:y,dataPropType:n.Type.Str},f);if(g.opts.unevaluated&&d!==!0)i.assign(r._`${d}[${y}]`,!0);else if(!h&&!g.allErrors)i.if((0,r.not)(f),()=>i.break())})})}}};e.default=s}),aS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ge(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:a}=o;if((0,t.alwaysValidSchema)(a,s)){o.fail();return}let i=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),o.failResult(i,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r}),iS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:st().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t}),cS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>t._`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:a,parentSchema:i,it:c}=n;if(!Array.isArray(a))throw Error("ajv implementation error");if(c.opts.discriminator&&i.discriminator)return;let l=a,m=s.let("valid",!1),g=s.let("passing",null),z=s.name("_valid");n.setParams({passing:g}),s.block(w),n.result(m,()=>n.reset(),()=>n.error(!0));function w(){l.forEach((_,b)=>{let f;if((0,r.alwaysValidSchema)(c,_))s.var(z,!0);else f=n.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},z);if(b>0)s.if(t._`${z} && ${m}`).assign(m,!1).assign(g,t._`[${g}, ${b}]`).else();s.if(z,()=>{if(s.assign(m,!0),s.assign(g,b),f)n.mergeEvaluated(f,t.Name)})})}}};e.default=o}),uS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ge(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:s,it:a}=o;if(!Array.isArray(s))throw Error("ajv implementation error");let i=n.name("valid");s.forEach((c,l)=>{if((0,t.alwaysValidSchema)(a,c))return;let m=o.subschema({keyword:"allOf",schemaProp:l},i);o.ok(i),o.mergeEvaluated(m)})}};e.default=r}),lS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>t.str`must match "${s.ifClause}" schema`,params:({params:s})=>t._`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:a,parentSchema:i,it:c}=s;if(i.then===void 0&&i.else===void 0)(0,r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let l=n(c,"then"),m=n(c,"else");if(!l&&!m)return;let g=a.let("valid",!0),z=a.name("_valid");if(w(),s.reset(),l&&m){let b=a.let("ifClause");s.setParams({ifClause:b}),a.if(z,_("then",b),_("else",b))}else if(l)a.if(z,_("then"));else a.if((0,t.not)(z),_("else"));s.pass(g,()=>s.error(!0));function w(){let b=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},z);s.mergeEvaluated(b)}function _(b,f){return()=>{let d=s.subschema({keyword:b},z);if(a.assign(g,z),s.mergeValidEvaluated(d,g),f)a.assign(f,t._`${b}`);else s.setParams({ifClause:b})}}}};function n(s,a){let i=s.schema[a];return i!==void 0&&!(0,r.alwaysValidSchema)(s,i)}e.default=o}),dS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ge(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){if(n.if===void 0)(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r}),Sh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fh(),r=eS(),o=gh(),n=tS(),s=rS(),a=uu(),i=oS(),c=_h(),l=nS(),m=sS(),g=aS(),z=iS(),w=cS(),_=uS(),b=lS(),f=dS();function d(v=!1){let p=[g.default,z.default,w.default,_.default,b.default,f.default,i.default,c.default,a.default,l.default,m.default];if(v)p.push(r.default,n.default);else p.push(t.default,o.default);return p.push(s.default),p}e.default=d}),mS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>t.str`must match format "${o}"`,params:({schemaCode:o})=>t._`{format: ${o}}`},code(o,n){let{gen:s,data:a,$data:i,schema:c,schemaCode:l,it:m}=o,{opts:g,errSchemaPath:z,schemaEnv:w,self:_}=m;if(!g.validateFormats)return;if(i)b();else f();function b(){let d=s.scopeValue("formats",{ref:_.formats,code:g.code.formats}),v=s.const("fDef",t._`${d}[${l}]`),p=s.let("fType"),S=s.let("format");s.if(t._`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>s.assign(p,t._`${v}.type || "string"`).assign(S,t._`${v}.validate`),()=>s.assign(p,t._`"string"`).assign(S,v)),o.fail$data((0,t.or)(P(),y()));function P(){if(g.strictSchema===!1)return t.nil;return t._`${l} && !${S}`}function y(){let h=w.$async?t._`(${v}.async ? await ${S}(${a}) : ${S}(${a}))`:t._`${S}(${a})`,E=t._`(typeof ${S} == "function" ? ${h} : ${S}.test(${a}))`;return t._`${S} && ${S} !== true && ${p} === ${n} && !${E}`}}function f(){let d=_.formats[c];if(!d){P();return}if(d===!0)return;let[v,p,S]=y(d);if(v===n)o.pass(h());function P(){if(g.strictSchema===!1){_.logger.warn(E());return}throw Error(E());function E(){return`unknown format "${c}" ignored in schema at path "${z}"`}}function y(E){let A=E instanceof RegExp?(0,t.regexpCode)(E):g.code.formats?t._`${g.code.formats}${(0,t.getProperty)(c)}`:void 0,H=s.scopeValue("formats",{key:c,ref:E,code:A});if(typeof E=="object"&&!(E instanceof RegExp))return[E.type||"string",E.validate,t._`${H}.validate`];return["string",E,H]}function h(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!w.$async)throw Error("async format in sync schema");return t._`await ${S}(${a})`}return typeof p=="function"?t._`${S}(${a})`:t._`${S}.test(${a})`}}}};e.default=r}),yh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[mS().default];e.default=t}),vh=D((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"]}),bh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ph(),r=hh(),o=Sh(),n=yh(),s=vh(),a=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=a}),pS=D((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={}))}),lu=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=pS(),o=Ba(),n=qr(),s=ge(),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:i,tagName:c}})=>i===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:i,tag:c,tagName:l}})=>t._`{error: ${i}, tag: ${l}, tagValue: ${c}}`},code(i){let{gen:c,data:l,schema:m,parentSchema:g,it:z}=i,{oneOf:w}=g;if(!z.opts.discriminator)throw Error("discriminator: requires discriminator option");let _=m.propertyName;if(typeof _!="string")throw Error("discriminator: requires propertyName");if(m.mapping)throw Error("discriminator: mapping is not supported");if(!w)throw Error("discriminator: requires oneOf keyword");let b=c.let("valid",!1),f=c.const("tag",t._`${l}${(0,t.getProperty)(_)}`);c.if(t._`typeof ${f} == "string"`,()=>d(),()=>i.error(!1,{discrError:r.DiscrError.Tag,tag:f,tagName:_})),i.ok(b);function d(){let S=p();c.if(!1);for(let P in S)c.elseIf(t._`${f} === ${P}`),c.assign(b,v(S[P]));c.else(),i.error(!1,{discrError:r.DiscrError.Mapping,tag:f,tagName:_}),c.endIf()}function v(S){let P=c.name("valid"),y=i.subschema({keyword:"oneOf",schemaProp:S},P);return i.mergeEvaluated(y,t.Name),P}function p(){var S;let P={},y=E(g),h=!0;for(let L=0;L<w.length;L++){let U=w[L];if((U===null||U===void 0?void 0:U.$ref)&&!(0,s.schemaHasRulesButRef)(U,z.self.RULES)){let K=U.$ref;if(U=o.resolveRef.call(z.self,z.schemaEnv.root,z.baseId,K),U instanceof o.SchemaEnv)U=U.schema;if(U===void 0)throw new n.default(z.opts.uriResolver,z.baseId,K)}let Y=(S=U===null||U===void 0?void 0:U.properties)===null||S===void 0?void 0:S[_];if(typeof Y!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${_}"`);h=h&&(y||E(U)),A(Y,L)}if(!h)throw Error(`discriminator: "${_}" must be required`);return P;function E({required:L}){return Array.isArray(L)&&L.includes(_)}function A(L,U){if(L.const)H(L.const,U);else if(L.enum)for(let Y of L.enum)H(Y,U);else throw Error(`discriminator: "properties/${_}" must have "const" or "enum"`)}function H(L,U){if(typeof L!="string"||L in P)throw Error(`discriminator: "${_}" values must be unique strings`);P[L]=U}}}};e.default=a}),hS=D((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}}),zh=D((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=au(),o=bh(),n=lu(),s=hS(),a=["/properties"],i="http://json-schema.org/draft-07/schema";var c=class extends r.default{_addVocabularies(){if(super._addVocabularies(),o.default.forEach((w)=>this.addVocabulary(w)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let w=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(w,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var l=jr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var m=ce();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var g=nn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return g.default}});var z=qr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return z.default}})}),$h=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=ce(),r=nt(),o=Ba(),n=iu(),s={keyword:"$dynamicAnchor",schemaType:"string",code:(c)=>a(c,c.schema)};function a(c,l){let{gen:m,it:g}=c;g.schemaEnv.root.dynamicAnchors[l]=!0;let z=t._`${r.default.dynamicAnchors}${(0,t.getProperty)(l)}`,w=g.errSchemaPath==="#"?g.validateName:i(c);m.if(t._`!${z}`,()=>m.assign(z,w))}e.dynamicAnchor=a;function i(c){let{schemaEnv:l,schema:m,self:g}=c.it,{root:z,baseId:w,localRefs:_,meta:b}=l.root,{schemaId:f}=g.opts,d=new o.SchemaEnv({schema:m,schemaId:f,root:z,baseId:w,localRefs:_,meta:b});return o.compileSchema.call(g,d),(0,n.getValidate)(c,d)}e.default=s}),Rh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=ce(),r=nt(),o=iu(),n={keyword:"$dynamicRef",schemaType:"string",code:(a)=>s(a,a.schema)};function s(a,i){let{gen:c,keyword:l,it:m}=a;if(i[0]!=="#")throw Error(`"${l}" only supports hash fragment reference`);let g=i.slice(1);if(m.allErrors)z();else{let _=c.let("valid",!1);z(_),a.ok(_)}function z(_){if(m.schemaEnv.root.dynamicAnchors[g]){let b=c.let("_v",t._`${r.default.dynamicAnchors}${(0,t.getProperty)(g)}`);c.if(b,w(b,_),w(m.validateName,_))}else w(m.validateName,_)()}function w(_,b){return b?()=>c.block(()=>{(0,o.callRef)(a,_),c.let(b,!0)}):()=>(0,o.callRef)(a,_)}}e.dynamicRef=s,e.default=n}),fS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=$h(),r=ge(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){if(n.schema)(0,t.dynamicAnchor)(n,"");else(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o}),gS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Rh(),r={keyword:"$recursiveRef",schemaType:"string",code:(o)=>(0,t.dynamicRef)(o,o.schema)};e.default=r}),wh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=$h(),r=Rh(),o=fS(),n=gS(),s=[t.default,r.default,o.default,n.default];e.default=s}),_S=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uu(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:(o)=>(0,t.validatePropertyDeps)(o)};e.default=r}),SS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uu(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(o)=>(0,t.validateSchemaDeps)(o)};e.default=r}),yS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ge(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){if(n.contains===void 0)(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r}),Ph=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_S(),r=SS(),o=yS(),n=[t.default,r.default,o.default];e.default=n}),vS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o=nt(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>t._`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:a,schema:i,data:c,errsCount:l,it:m}=s;if(!l)throw Error("ajv implementation error");let{allErrors:g,props:z}=m;if(z instanceof t.Name)a.if(t._`${z} !== true`,()=>a.forIn("key",c,(f)=>a.if(_(z,f),()=>w(f))));else if(z!==!0)a.forIn("key",c,(f)=>z===void 0?w(f):a.if(b(z,f),()=>w(f)));m.props=!0,s.ok(t._`${l} === ${o.default.errors}`);function w(f){if(i===!1){if(s.setParams({unevaluatedProperty:f}),s.error(),!g)a.break();return}if(!(0,r.alwaysValidSchema)(m,i)){let d=a.name("valid");if(s.subschema({keyword:"unevaluatedProperties",dataProp:f,dataPropType:r.Type.Str},d),!g)a.if((0,t.not)(d),()=>a.break())}}function _(f,d){return t._`!${f} || !${f}[${d}]`}function b(f,d){let v=[];for(let p in f)if(f[p]===!0)v.push(t._`${d} !== ${p}`);return(0,t.and)(...v)}}};e.default=n}),bS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=ge(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>t.str`must NOT have more than ${n} items`,params:({params:{len:n}})=>t._`{limit: ${n}}`},code(n){let{gen:s,schema:a,data:i,it:c}=n,l=c.items||0;if(l===!0)return;let m=s.const("len",t._`${i}.length`);if(a===!1)n.setParams({len:l}),n.fail(t._`${m} > ${l}`);else if(typeof a=="object"&&!(0,r.alwaysValidSchema)(c,a)){let z=s.var("valid",t._`${m} <= ${l}`);s.if((0,t.not)(z),()=>g(z,l)),n.ok(z)}c.items=!0;function g(z,w){s.forRange("i",w,m,(_)=>{if(n.subschema({keyword:"unevaluatedItems",dataProp:_,dataPropType:r.Type.Num},z),!c.allErrors)s.if((0,t.not)(z),()=>s.break())})}}};e.default=o}),Eh=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=vS(),r=bS(),o=[t.default,r.default];e.default=o}),zS=D((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"}]}}}}}),$S=D((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:"#"}}}}}),RS=D((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:"#"}}}}),wS=D((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:{}}}}}),PS=D((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"}}}}),ES=D((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}}}}),TS=D((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:[]}}}}),kS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=zS(),r=$S(),o=RS(),n=wS(),s=PS(),a=ES(),i=TS(),c=["/properties"];function l(m){return[t,r,o,n,g(this,s),a,g(this,i)].forEach((z)=>this.addMetaSchema(z,void 0,!1)),this;function g(z,w){return m?z.$dataMetaSchema(w,c):w}}e.default=l}),CS=D((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=au(),o=bh(),n=wh(),s=Ph(),a=Eh(),i=lu(),c=kS(),l="https://json-schema.org/draft/2019-09/schema";var m=class extends r.default{constructor(b={}){super({...b,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach((b)=>this.addVocabulary(b)),this.addVocabulary(s.default),this.addVocabulary(a.default),this.opts.discriminator)this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:b,meta:f}=this.opts;if(!f)return;c.default.call(this,b),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};e.Ajv2019=m,t.exports=e=m,t.exports.Ajv2019=m,Object.defineProperty(e,"__esModule",{value:!0}),e.default=m;var g=jr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return g.KeywordCxt}});var z=ce();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return z._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return z.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return z.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return z.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return z.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return z.CodeGen}});var w=nn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return w.default}});var _=qr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return _.default}})}),IS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ph(),r=hh(),o=Sh(),n=wh(),s=Ph(),a=Eh(),i=yh(),c=vh(),l=[n.default,t.default,r.default,(0,o.default)(!0),i.default,c.metadataVocabulary,c.contentVocabulary,s.default,a.default];e.default=l}),OS=D((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}}}}),NS=D((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"}}}}}),jS=D((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"}}}}),qS=D((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"}}}}),xS=D((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"}}}}),AS=D((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"}}}}),MS=D((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}}}}),LS=D((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:[]}}}}),ZS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=OS(),r=NS(),o=jS(),n=qS(),s=xS(),a=AS(),i=MS(),c=LS(),l=["/properties"];function m(g){return[t,r,o,n,s,z(this,a),i,z(this,c)].forEach((w)=>this.addMetaSchema(w,void 0,!1)),this;function z(w,_){return g?w.$dataMetaSchema(_,l):_}}e.default=m}),DS=D((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=au(),o=IS(),n=lu(),s=ZS(),a="https://json-schema.org/draft/2020-12/schema";var i=class extends r.default{constructor(z={}){super({...z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),o.default.forEach((z)=>this.addVocabulary(z)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:z,meta:w}=this.opts;if(!w)return;s.default.call(this,z),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}};e.Ajv2020=i,t.exports=e=i,t.exports.Ajv2020=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var c=jr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var l=ce();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 m=nn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return m.default}});var g=qr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return g.default}})}),US=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(L,U){return{validate:L,compare:U}}e.fullFormats={date:t(s,a),time:t(c(!0),l),"date-time":t(z(!0),w),"iso-time":t(c(),m),"iso-date-time":t(z(),_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:d,"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:H,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:p,int32:{type:"number",validate:y},int64:{type:"number",validate:h},float:{type:"number",validate:E},double:{type:"number",validate:E},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"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,w),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),"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,_),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(L){return L%4===0&&(L%100!==0||L%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(L){let U=o.exec(L);if(!U)return!1;let Y=+U[1],K=+U[2],me=+U[3];return K>=1&&K<=12&&me>=1&&me<=(K===2&&r(Y)?29:n[K])}function a(L,U){if(!(L&&U))return;if(L>U)return 1;if(L<U)return-1;return 0}let i=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(L){return function(Y){let K=i.exec(Y);if(!K)return!1;let me=+K[1],Re=+K[2],ve=+K[3],Oe=K[4],fe=K[5]==="-"?-1:1,I=+(K[6]||0),q=+(K[7]||0);if(I>23||q>59||L&&!Oe)return!1;if(me<=23&&Re<=59&&ve<60)return!0;let V=Re-q*fe,R=me-I*fe-(V<0?1:0);return(R===23||R===-1)&&(V===59||V===-1)&&ve<61}}function l(L,U){if(!(L&&U))return;let Y=new Date("2020-01-01T"+L).valueOf(),K=new Date("2020-01-01T"+U).valueOf();if(!(Y&&K))return;return Y-K}function m(L,U){if(!(L&&U))return;let Y=i.exec(L),K=i.exec(U);if(!(Y&&K))return;if(L=Y[1]+Y[2]+Y[3],U=K[1]+K[2]+K[3],L>U)return 1;if(L<U)return-1;return 0}let g=/t|\s/i;function z(L){let U=c(L);return function(K){let me=K.split(g);return me.length===2&&s(me[0])&&U(me[1])}}function w(L,U){if(!(L&&U))return;let Y=new Date(L).valueOf(),K=new Date(U).valueOf();if(!(Y&&K))return;return Y-K}function _(L,U){if(!(L&&U))return;let[Y,K]=L.split(g),[me,Re]=U.split(g),ve=a(Y,me);if(ve===void 0)return;return ve||l(K,Re)}let b=/\/|:/,f=/^(?:[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 d(L){return b.test(L)&&f.test(L)}let v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function p(L){return v.lastIndex=0,v.test(L)}let S=-2147483648,P=2147483647;function y(L){return Number.isInteger(L)&&L<=P&&L>=S}function h(L){return Number.isInteger(L)}function E(){return!0}let A=/[^\\]\\Z/;function H(L){if(A.test(L))return!1;try{return new RegExp(L),!0}catch(U){return!1}}}),VS=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=zh(),r=ce(),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:i,schemaCode:c})=>r.str`should be ${n[i].okStr} ${c}`,params:({keyword:i,schemaCode:c})=>r._`{comparison: ${n[i].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(i){let{gen:c,data:l,schemaCode:m,keyword:g,it:z}=i,{opts:w,self:_}=z;if(!w.validateFormats)return;let b=new t.KeywordCxt(z,_.RULES.all.format.definition,"format");if(b.$data)f();else d();function f(){let p=c.scopeValue("formats",{ref:_.formats,code:w.code.formats}),S=c.const("fmt",r._`${p}[${b.schemaCode}]`);i.fail$data((0,r.or)(r._`typeof ${S} != "object"`,r._`${S} instanceof RegExp`,r._`typeof ${S}.compare != "function"`,v(S)))}function d(){let p=b.schema,S=_.formats[p];if(!S||S===!0)return;if(typeof S!="object"||S instanceof RegExp||typeof S.compare!="function")throw Error(`"${g}": format "${p}" does not define "compare" function`);let P=c.scopeValue("formats",{key:p,ref:S,code:w.code.formats?r._`${w.code.formats}${(0,r.getProperty)(p)}`:void 0});i.fail$data(v(P))}function v(p){return r._`${p}.compare(${l}, ${m}) ${n[g].fail} 0`}},dependencies:["format"]};let a=(i)=>(i.addKeyword(e.formatLimitDefinition),i);e.default=a}),FS=D((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=US(),o=VS(),n=ce(),s=new n.Name("fullFormats"),a=new n.Name("fastFormats"),i=(l,m={keywords:!0})=>{if(Array.isArray(m))return c(l,m,r.fullFormats,s),l;let[g,z]=m.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,s];if(c(l,m.formats||r.formatNames,g,z),m.keywords)(0,o.default)(l);return l};i.get=(l,m="full")=>{let g=(m==="fast"?r.fastFormats:r.fullFormats)[l];if(!g)throw Error(`Unknown format "${l}"`);return g};function c(l,m,g,z){var w,_;(w=(_=l.opts.code).formats)!==null&&w!==void 0||(_.formats=n._`require("ajv-formats/dist/formats").${z}`);for(let b of m)l.addFormat(b,g[b])}t.exports=e=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i}),Th=zh(),HS=CS(),JS=DS(),BS=Rn(FS(),1),KS=BS.default;function su(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return KS(t),t}var du=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=su(JS.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Su(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(t==="2020-12")return this.ajv;if(t==="2019-09")return this._ajv2019??=su(HS.Ajv2019);return this._ajvDraft7??=su(Th.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)}}},Zb=Th.Ajv;import mu from"node:process";var GS=8,WS=600000;function YS(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??GS,roundTimeoutMs:e?.roundTimeoutMs??WS,legacyShim:e?.legacyShim??!0}}function kh(e,t,r){if(r===null||typeof r!=="object"||typeof r.method!=="string")throw new he(ee.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=Pp(o);if(n===void 0)throw new he(ee.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 XS(){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 pu(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new he(ee.InternalError,t)}var QS=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:a}=this._host,i=o.mcpReq.signal,c=n,l=0;while(!0){if(l+=1,l>s)return pu(e,Xp(e,s));let m=c.inputRequests,g=m!=null&&Object.keys(m).length>0,z=typeof c.requestState==="string"?c.requestState:void 0;if(!g&&z===void 0)throw new he(ee.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 w;if(g){let f=this._host.resolvedClientCapabilities(o),d=[];for(let[p,S]of Object.entries(m)){let{embedded:P,required:y}=kh(e,p,S);if(P.method!=="roots/list"&&P.params===void 0)throw new he(ee.InternalError,`Handler for ${e} returned an input request '${p}' of kind '${P.method}' without params`);if(Jc(y,f)!==void 0)return pu(e,`Cannot request input '${p}' (${P.method}): the client on this 2025-era connection did not declare the required capability${f===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);d.push([p,P])}let v=eh(i);try{let p={relatedRequestId:o.mcpReq.id,timeout:a,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:v.signal},S=await Promise.all(d.map(async([P,y])=>{try{return[P,await this._dispatchLeg(y,p)]}catch(h){throw v.abort(h),h}}));w=Object.fromEntries(S)}catch(p){if(i.aborted)throw p;return pu(e,`Fulfilling input required by '${e}' failed: ${p instanceof Error?p.message:String(p)}`)}finally{v.dispose()}}else await Qp(Yp,i);let _={...o,mcpReq:{...o.mcpReq,inputResponses:w,droppedInputResponseKeys:void 0,requestState:on(z)}};if(z!==void 0){let f=await this._host.verifyRequestState(z,_,e);if(f!==void 0)_=nu(_,f)}let b=await t(r,_);if(!Nr(b))return b;c=b}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;if(r.mode==="url"&&r.elicitationId===void 0)r={...r,elicitationId:XS()};return 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)}}},ey=new Set(["tools/call","prompts/get","resources/read"]),ty,ry,oy;var Mz=class extends nh{_clientCapabilities;_clientVersion;static{ty=(e,t)=>{if(t.clientCapabilities!==void 0)e._clientCapabilities=t.clientCapabilities;if(t.clientInfo!==void 0)e._clientVersion=t.clientInfo},ry=(e,t)=>{let r=t.filter((o)=>!e._supportedProtocolVersions.includes(o));if(r.length>0)e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r];e.setRequestHandler("server/discover",()=>e._ondiscover())},oy=(e)=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new QS({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){super(t);if(this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new du,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=YS(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))if(o!==void 0)Ap(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}if(this.setRequestHandler("initialize",(r)=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),Bc(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(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=Ua(It,o);if(n.success)this._loggingLevels.set(r,n.data);return{}})}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 a;if(this._servedModernEra()){if(a=e.mcpReq.envelope?.[Wt],a===void 0)return Promise.resolve()}else a=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);if(a!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(a))return Promise.resolve();return 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(It.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(pe.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;if(this._capabilities=sh(this._capabilities,e),!t&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=ey.has(e);if(r===void 0&&!o)return async(n,s)=>{let a=await t(n,s);if(Nr(a))throw new he(ee.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 a};return async(n,s)=>{let a=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(Nr(a)){if(!o)throw new he(ee.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 a}return r===void 0?a:xp(a,r)}}return async(r,o)=>{let n=Or(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new he(s.reason==="not-in-era"?ee.InternalError:ee.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let a=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(Nr(a))return a;let i=Kc(a),c=n.validateResult("tools/call",i);if(!c.ok)throw new he(c.reason==="not-in-era"?ee.InternalError:ee.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&&rn(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 he(ee.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let a=o;if(typeof s==="string"){let g=await this._verifyRequestState(s,o,e);if(g!==void 0)a=nu(o,g)}let i;try{i=await t(r,a)}catch(g){if(g instanceof he&&g.code===ee.UrlElicitationRequired){if(!n)throw g;throw new he(ee.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw g}if(!Nr(i))return i;if(!n){if(!this._inputRequiredServing.legacyShim)throw new he(ee.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??gr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,a,i)}let c=i.inputRequests,l=c!=null&&Object.keys(c).length>0,m=typeof i.requestState==="string";if(!l&&!m)throw new he(ee.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(l){let g=this._inputRequestCapabilityView(o);for(let[z,w]of Object.entries(c)){let{embedded:_,required:b}=kh(e,z,w),f=Jc(b,g);if(f!==void 0)throw new Qc({requiredCapabilities:f},`Cannot request input '${z}' (${_.method}): the request's client capabilities do not declare the required capability`)}}return i}async _verifyRequestState(e,t,r){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new he(ee.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[wt]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new le(pe.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 — 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(pe.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new le(pe.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new le(pe.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(pe.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(pe.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new le(pe.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(pe.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(pe.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(pe.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new le(pe.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new le(pe.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(pe.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new le(pe.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=Ep(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??gr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:Bc(this._supportedProtocolVersions),capabilities:ny(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(pe.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),a=Array.isArray(s.content)?s.content:[s.content],i=a.some((g)=>g.type==="tool_result"),c=e.messages.length>1?e.messages.at(-2):void 0,l=c?Array.isArray(c.content)?c.content:[c.content]:[],m=l.some((g)=>g.type==="tool_use");if(i){if(a.some((g)=>g.type!=="tool_result"))throw new he(ee.InvalidParams,"The last message must contain only tool_result content if any is present");if(!m)throw new he(ee.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(m){let g=new Set(l.filter((w)=>w.type==="tool_use").map((w)=>w.id)),z=new Set(a.filter((w)=>w.type==="tool_result").map((w)=>w.toolUseId));if(g.size!==z.size||![...g].every((w)=>z.has(w)))throw new he(ee.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=Boolean(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(pe.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(pe.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new le(pe.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"},a=await this.request({method:"elicitation/create",params:s},t);if(n&&a.action==="accept"&&a.content&&s.requestedSchema)try{let i=this._jsonSchemaValidator.getValidator(s.requestedSchema)(a.content);if(!i.valid)throw new he(ee.InvalidParams,`Elicitation response content does not match requested schema: ${i.errorMessage}`)}catch(i){if(i instanceof he)throw i;throw new he(ee.InternalError,`Error validating elicitation response: ${i instanceof Error?i.message:String(i)}`)}return a}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new le(pe.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 ny(e){return{...e}}var sy=class{_readBuffer;_started=!1;_closed=!1;constructor(e=mu.stdin,t=mu.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new ah({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 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(){while(!0)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){if(this._closed)return;if(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){if(this._closed)return Promise.reject(Error("StdioServerTransport is closed"));return new Promise((t,r)=>{let o=ih(e),n=!1,s=(i)=>{if(n)return;n=!0,this._stdout.off("error",s),this._stdout.off("drain",a),r(i)},a=()=>{if(n)return;n=!0,this._stdout.off("error",s),this._stdout.off("drain",a),t()};if(this._stdout.once("error",s),this._stdout.write(o)){if(n)return;n=!0,this._stdout.off("error",s),t()}else if(!n)this._stdout.once("drain",a)})}};export{sy as StdioServerTransport};
|