forge-terminal 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +305 -24
- package/dist/chunks/adm-zip-SQKLKBDP.js +3 -0
- package/dist/chunks/available-2VX7K7W6.js +3 -0
- package/dist/chunks/boot-ODZZHFUI.js +3 -0
- package/dist/chunks/cfb-V6M2PYOD.js +13 -0
- package/dist/chunks/chunk-2WYHI73Y.js +3 -0
- package/dist/chunks/chunk-4YHKTP7I.js +3 -0
- package/dist/chunks/chunk-5PYTOHLZ.js +3 -0
- package/dist/chunks/chunk-7YQR2MVH.js +3 -0
- package/dist/chunks/chunk-DRBA23IQ.js +3 -0
- package/dist/chunks/chunk-EOYBXOCV.js +4 -0
- package/dist/chunks/chunk-FQV57RMH.js +3 -0
- package/dist/chunks/chunk-IMKI5F4I.js +4 -0
- package/dist/chunks/chunk-J7FLFHQJ.js +3 -0
- package/dist/chunks/chunk-L2WK7CJG.js +3 -0
- package/dist/chunks/chunk-LFE3WRU4.js +3 -0
- package/dist/chunks/chunk-MHFY7HF6.js +10 -0
- package/dist/chunks/chunk-PBIS2ONZ.js +3 -0
- package/dist/chunks/chunk-QVACE4IE.js +3 -0
- package/dist/chunks/chunk-TMUK2DD3.js +3 -0
- package/dist/chunks/chunk-UNVHKJW4.js +41 -0
- package/dist/chunks/chunk-V4GHQGQM.js +4 -0
- package/dist/chunks/chunk-VB665HTV.js +3 -0
- package/dist/chunks/chunk-YHK5VE5R.js +3 -0
- package/dist/chunks/colour-QV2C3R7R.js +3 -0
- package/dist/chunks/config-command-UXJY623L.js +3 -0
- package/dist/chunks/dist-J2V6ITHG.js +29 -0
- package/dist/chunks/es-T2U7NBLD.js +3 -0
- package/dist/chunks/execute-4WJCUM7J.js +3 -0
- package/dist/chunks/extensions-command-6WZV2AES.js +3 -0
- package/dist/chunks/launch-2OI4ZLBQ.js +66 -0
- package/dist/chunks/lib-TPEJ5CJJ.js +46 -0
- package/dist/chunks/lock-R6GZXCCW.js +3 -0
- package/dist/chunks/manager-H52ENJOH.js +4 -0
- package/dist/chunks/paths-XY2345OS.js +3 -0
- package/dist/chunks/pdf-compress-IMRFBLZF.js +3 -0
- package/dist/chunks/react-devtools-core-UM4FS6CU.js +3 -0
- package/dist/chunks/run-N3F4EM7E.js +4 -0
- package/dist/chunks/server-5RWSVTOM.js +73 -0
- package/dist/chunks/theme-GW7CQPUO.js +3 -0
- package/dist/chunks/word-OGQ2KZAJ.js +24 -0
- package/dist/index.js +67 -95
- package/dist/third-party-licenses.txt +2856 -0
- package/package.json +28 -21
- package/skills/forge/SKILL.md +128 -0
- package/dist/cli/args.js +0 -278
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/config-command.js +0 -55
- package/dist/cli/config-command.js.map +0 -1
- package/dist/cli/execute.js +0 -377
- package/dist/cli/execute.js.map +0 -1
- package/dist/cli/report.js +0 -123
- package/dist/cli/report.js.map +0 -1
- package/dist/cli/spinner.js +0 -60
- package/dist/cli/spinner.js.map +0 -1
- package/dist/cli/stdin.js +0 -47
- package/dist/cli/stdin.js.map +0 -1
- package/dist/config/preferences.js +0 -143
- package/dist/config/preferences.js.map +0 -1
- package/dist/core/actions/compress.js +0 -157
- package/dist/core/actions/compress.js.map +0 -1
- package/dist/core/actions/convert.js +0 -270
- package/dist/core/actions/convert.js.map +0 -1
- package/dist/core/actions/extract.js +0 -94
- package/dist/core/actions/extract.js.map +0 -1
- package/dist/core/actions/index.js +0 -23
- package/dist/core/actions/index.js.map +0 -1
- package/dist/core/actions/merge.js +0 -16
- package/dist/core/actions/merge.js.map +0 -1
- package/dist/core/actions/rotate.js +0 -36
- package/dist/core/actions/rotate.js.map +0 -1
- package/dist/core/actions/split.js +0 -65
- package/dist/core/actions/split.js.map +0 -1
- package/dist/core/atomic.js +0 -61
- package/dist/core/atomic.js.map +0 -1
- package/dist/core/capabilities.js +0 -59
- package/dist/core/capabilities.js.map +0 -1
- package/dist/core/compress.js +0 -76
- package/dist/core/compress.js.map +0 -1
- package/dist/core/describe.js +0 -49
- package/dist/core/describe.js.map +0 -1
- package/dist/core/errors.js +0 -469
- package/dist/core/errors.js.map +0 -1
- package/dist/core/execute-jobs.js +0 -122
- package/dist/core/execute-jobs.js.map +0 -1
- package/dist/core/formats.js +0 -108
- package/dist/core/formats.js.map +0 -1
- package/dist/core/order.js +0 -44
- package/dist/core/order.js.map +0 -1
- package/dist/core/output-path.js +0 -176
- package/dist/core/output-path.js.map +0 -1
- package/dist/core/pages.js +0 -107
- package/dist/core/pages.js.map +0 -1
- package/dist/core/pdf-compress.js +0 -206
- package/dist/core/pdf-compress.js.map +0 -1
- package/dist/core/plan.js +0 -42
- package/dist/core/plan.js.map +0 -1
- package/dist/core/resolve.js +0 -115
- package/dist/core/resolve.js.map +0 -1
- package/dist/core/run.js +0 -66
- package/dist/core/run.js.map +0 -1
- package/dist/core/suggest.js +0 -50
- package/dist/core/suggest.js.map +0 -1
- package/dist/core/types.js +0 -2
- package/dist/core/types.js.map +0 -1
- package/dist/core/units.js +0 -94
- package/dist/core/units.js.map +0 -1
- package/dist/core/write-safety.js +0 -128
- package/dist/core/write-safety.js.map +0 -1
- package/dist/engines/heic.js +0 -166
- package/dist/engines/heic.js.map +0 -1
- package/dist/engines/image.js +0 -342
- package/dist/engines/image.js.map +0 -1
- package/dist/engines/pdf.js +0 -444
- package/dist/engines/pdf.js.map +0 -1
- package/dist/engines/pdfium.js +0 -161
- package/dist/engines/pdfium.js.map +0 -1
- package/dist/engines/registry.js +0 -65
- package/dist/engines/registry.js.map +0 -1
- package/dist/engines/types.js +0 -2
- package/dist/engines/types.js.map +0 -1
- package/dist/engines/word.js +0 -385
- package/dist/engines/word.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/shell/App.js +0 -1972
- package/dist/shell/App.js.map +0 -1
- package/dist/shell/ClickTargets.js +0 -183
- package/dist/shell/ClickTargets.js.map +0 -1
- package/dist/shell/ThemeContext.js +0 -21
- package/dist/shell/ThemeContext.js.map +0 -1
- package/dist/shell/blocks.js +0 -160
- package/dist/shell/blocks.js.map +0 -1
- package/dist/shell/clipboard.js +0 -64
- package/dist/shell/clipboard.js.map +0 -1
- package/dist/shell/commands.js +0 -51
- package/dist/shell/commands.js.map +0 -1
- package/dist/shell/components/Banner.js +0 -73
- package/dist/shell/components/Banner.js.map +0 -1
- package/dist/shell/components/CommandPalette.js +0 -37
- package/dist/shell/components/CommandPalette.js.map +0 -1
- package/dist/shell/components/FileCard.js +0 -59
- package/dist/shell/components/FileCard.js.map +0 -1
- package/dist/shell/components/HintBar.js +0 -18
- package/dist/shell/components/HintBar.js.map +0 -1
- package/dist/shell/components/Hints.js +0 -21
- package/dist/shell/components/Hints.js.map +0 -1
- package/dist/shell/components/MergeList.js +0 -268
- package/dist/shell/components/MergeList.js.map +0 -1
- package/dist/shell/components/ModeHeader.js +0 -21
- package/dist/shell/components/ModeHeader.js.map +0 -1
- package/dist/shell/components/PageGrid.js +0 -324
- package/dist/shell/components/PageGrid.js.map +0 -1
- package/dist/shell/components/PathInput.js +0 -147
- package/dist/shell/components/PathInput.js.map +0 -1
- package/dist/shell/components/Progress.js +0 -43
- package/dist/shell/components/Progress.js.map +0 -1
- package/dist/shell/components/Prompt.js +0 -667
- package/dist/shell/components/Prompt.js.map +0 -1
- package/dist/shell/components/ResultLinks.js +0 -26
- package/dist/shell/components/ResultLinks.js.map +0 -1
- package/dist/shell/components/Select.js +0 -152
- package/dist/shell/components/Select.js.map +0 -1
- package/dist/shell/components/Slider.js +0 -48
- package/dist/shell/components/Slider.js.map +0 -1
- package/dist/shell/components/StagedFiles.js +0 -92
- package/dist/shell/components/StagedFiles.js.map +0 -1
- package/dist/shell/components/ThemePicker.js +0 -18
- package/dist/shell/components/ThemePicker.js.map +0 -1
- package/dist/shell/components/UnitRow.js +0 -30
- package/dist/shell/components/UnitRow.js.map +0 -1
- package/dist/shell/flows/pdf.js +0 -424
- package/dist/shell/flows/pdf.js.map +0 -1
- package/dist/shell/frame-geometry.js +0 -56
- package/dist/shell/frame-geometry.js.map +0 -1
- package/dist/shell/hyperlink.js +0 -27
- package/dist/shell/hyperlink.js.map +0 -1
- package/dist/shell/intro.js +0 -101
- package/dist/shell/intro.js.map +0 -1
- package/dist/shell/launch.js +0 -75
- package/dist/shell/launch.js.map +0 -1
- package/dist/shell/mark.js +0 -134
- package/dist/shell/mark.js.map +0 -1
- package/dist/shell/mouse.js +0 -209
- package/dist/shell/mouse.js.map +0 -1
- package/dist/shell/redraw.js +0 -36
- package/dist/shell/redraw.js.map +0 -1
- package/dist/shell/reveal.js +0 -24
- package/dist/shell/reveal.js.map +0 -1
- package/dist/shell/stage.js +0 -34
- package/dist/shell/stage.js.map +0 -1
- package/dist/shell/terminal-write.js +0 -16
- package/dist/shell/terminal-write.js.map +0 -1
- package/dist/shell/theme.js +0 -178
- package/dist/shell/theme.js.map +0 -1
- package/dist/shell/useFrameOrigin.js +0 -175
- package/dist/shell/useFrameOrigin.js.map +0 -1
- package/dist/shell/useKeys.js +0 -28
- package/dist/shell/useKeys.js.map +0 -1
- package/dist/shell/useMouse.js +0 -150
- package/dist/shell/useMouse.js.map +0 -1
- package/dist/shell/useMouseRouting.js +0 -69
- package/dist/shell/useMouseRouting.js.map +0 -1
- package/dist/shell/width.js +0 -62
- package/dist/shell/width.js.map +0 -1
- package/dist/utils/display-path.js +0 -31
- package/dist/utils/display-path.js.map +0 -1
- package/dist/utils/unescape-path.js +0 -68
- package/dist/utils/unescape-path.js.map +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { createRequire as __forgeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __forgeCreateRequire(import.meta.url);
|
|
3
|
+
import{a as vd,c as zd}from"./chunk-IMKI5F4I.js";import{f as bd}from"./chunk-PBIS2ONZ.js";import{e as hd,g as gd,o as _d,p as Sd,s as yd}from"./chunk-4YHKTP7I.js";import"./chunk-L2WK7CJG.js";import{c as dd,d as pd,e as md,f as fd}from"./chunk-VB665HTV.js";import{a as ac}from"./chunk-QVACE4IE.js";import"./chunk-FQV57RMH.js";import{a as ir}from"./chunk-V4GHQGQM.js";import{a as cc}from"./chunk-EOYBXOCV.js";import{F as Nt,d as ld}from"./chunk-DRBA23IQ.js";import{d as ud}from"./chunk-J7FLFHQJ.js";import{d as ic}from"./chunk-TMUK2DD3.js";var tS=Object.create,os=Object.defineProperty,rS=Object.getOwnPropertyDescriptor,oS=Object.getOwnPropertyNames,nS=Object.getPrototypeOf,sS=Object.prototype.hasOwnProperty,U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Rd=(e,t)=>{let r={};for(var o in e)os(r,o,{get:e[o],enumerable:!0});return t&&os(r,Symbol.toStringTag,{value:"Module"}),r},iS=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=oS(t),s=0,i=n.length,c;s<i;s++)c=n[s],!sS.call(e,c)&&c!==r&&os(e,c,{get:(a=>t[a]).bind(null,c),enumerable:!(o=rS(t,c))||o.enumerable});return e},ns=(e,t,r)=>(r=e!=null?tS(nS(e)):{},iS(t||!e||!e.__esModule?os(r,"default",{value:e,enumerable:!0}):r,e));var aS=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),$d=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),cS=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),uS=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function wd(e){return typeof e=="string"&&$d.has(e.replace(/#$/,""))}function Pd(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(aS.has(r))return"2020-12";if($d.has(r))return"2019-09";if(cS.has(r)||uS.has(r))return"draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var ae={};ic(ae,{BIGINT_FORMAT_RANGES:()=>cs,CONSTANT_CATCH:()=>qd,Class:()=>dc,NUMBER_FORMAT_RANGES:()=>qo,aborted:()=>ct,allowsEval:()=>_c,assert:()=>fS,assertEqual:()=>lS,assertIs:()=>pS,assertNever:()=>mS,assertNotEqual:()=>dS,assignProp:()=>Ye,attachSchema:()=>ls,base64ToUint8Array:()=>xd,base64urlToUint8Array:()=>NS,cached:()=>Or,captureStackTrace:()=>is,cleanEnum:()=>OS,cleanRegex:()=>Ao,clone:()=>st,cloneDef:()=>_S,codePointLength:()=>Mo,constantCatch:()=>Md,createTransparentProxy:()=>RS,defineLazy:()=>fc,defineLazyInternal:()=>ge,derived:()=>qS,esc:()=>hc,escapeRegex:()=>_t,explicitlyAborted:()=>vc,extend:()=>PS,finalizeIssue:()=>ut,floatSafeRemainder:()=>mc,getElementAtPath:()=>SS,getEnumValues:()=>kr,getLengthableOrigin:()=>Lo,getParsedType:()=>zS,getSizableOrigin:()=>jd,hexToUint8Array:()=>xS,hide:()=>ds,installLazyProp:()=>ZS,isObject:()=>cr,isPlainObject:()=>At,issue:()=>jr,joinValues:()=>ss,jsonStringifyReplacer:()=>Ir,members:()=>zc,merge:()=>TS,mergeDefs:()=>gt,normalizeParams:()=>te,nullish:()=>pc,numKeys:()=>bS,objectClone:()=>hS,omit:()=>wS,optionalKeys:()=>yc,own:()=>xt,parsedType:()=>bc,partial:()=>CS,pick:()=>$S,prefixIssues:()=>St,primitiveTypes:()=>Od,promiseAllObject:()=>yS,propertyKeyTypes:()=>Sc,randomString:()=>vS,rawShape:()=>Nr,required:()=>kS,safeExtend:()=>ES,shallowClone:()=>Id,slugify:()=>gc,stringifyPrimitive:()=>as,toZod:()=>Td,uint8ArrayToBase64:()=>Ad,uint8ArrayToBase64url:()=>jS,uint8ArrayToHex:()=>AS,unwrapMessage:()=>Cr});function lS(e){return e}function dS(e){return e}function Td(){return e=>e}function pS(e){}function mS(e){throw new Error("Unexpected value in exhaustive check")}function fS(e){}function kr(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 ss(e,t="|"){return e.map(r=>as(r)).join(t)}function Ir(e,t){return typeof t=="bigint"?t.toString():t}var lc=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Or(e){return new lc(e)}function pc(e){return e==null}function Ao(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function mc(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Ed=Symbol("evaluating");function fc(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Ed)return o===void 0&&(o=Ed,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function hS(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ye(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Nr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function ht(e){return Nr(e._zod.def)??e._zod.def.shape}function Cd(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return Ye(this,t,o),o},enumerable:!0,configurable:!0})}function kd(e,t,r){t in e?Ye(e,t,r):e[t]=r}function ar(e,t,r,o){let n=ht(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);i.enumerable&&(i.get?Cd(e,s,()=>{let c=t._zod.def.shape[s];return o?o(c,s):c}):kd(e,s,o?o(i.value,s):i.value))}}function gS(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?Cd(e,r,()=>t[r]):kd(e,r,o.value))}}function gt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function _S(e){return gt(e._zod.def)}function SS(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function yS(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 vS(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function hc(e){return JSON.stringify(e)}function gc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var is="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var _c=Or(()=>{if(Xe.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function At(e){if(cr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(cr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Id(e){return At(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function bS(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var zS=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Sc=new Set(["string","number","symbol"]),Od=new Set(["string","number","bigint","boolean","symbol","undefined"]);function _t(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function st(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function te(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function RS(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 as(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function yc(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var qo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},cs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function $S(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return ar(s,e,us(e,t)),st(e,gt(r,{shape:s,checks:[]}))}function us(e,t){let r=ht(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);t[n]&&o.push(n)}return o}function wS(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(us(e,t)),i={};return ar(i,e,Reflect.ownKeys(ht(e)).filter(c=>!s.has(c))),st(e,gt(r,{shape:i,checks:[]}))}function PS(e,t){if(!At(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=ht(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return st(e,gt(e._zod.def,{shape:Nd(e,t)}))}function Nd(e,t){let r={};return ar(r,e,Reflect.ownKeys(ht(e))),gS(r,t),r}function ES(e,t){if(!At(t))throw new Error("Invalid input to safeExtend: expected a plain object");return st(e,gt(e._zod.def,{shape:Nd(e,t)}))}function TS(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};ar(r,e,Reflect.ownKeys(ht(e))),ar(r,t,Reflect.ownKeys(ht(t)));let o=gt(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return st(e,o)}function CS(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let c=r?new Set(us(t,r)):void 0,a={};return ar(a,t,Reflect.ownKeys(ht(t)),e&&((u,d)=>c&&!c.has(d)?u:new e({type:"optional",innerType:u}))),st(t,gt(t._zod.def,{shape:a,checks:[]}))}function kS(e,t,r){let o=r?new Set(us(t,r)):void 0,n={};return ar(n,t,Reflect.ownKeys(ht(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),st(t,gt(t._zod.def,{shape:n}))}function ct(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function vc(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 St(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Cr(e){return typeof e=="string"?e:e?.message}function ls(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function ut(e,t,r){var o;let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Cr(e.inst?._zod.def?.error?.(e))??Cr(s?.(e))??Cr(t?.error?.(e))??Cr(r.customError?.(e))??Cr(r.localeError?.(e))??"Invalid input",c={};for(let a of Object.keys(e))a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__"||(c[a]=e[a]);return c.path??(c.path=[]),c.message=i,t?.reportInput&&(c.input=e.input),c}function jd(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var IS=/[\uD800-\uDBFF]/;function Mo(e){let t=e.length;if(!IS.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(r--,o++);return r}function Lo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function bc(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 jr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function OS(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function xd(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 Ad(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function NS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return xd(t+r)}function jS(e){return Ad(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xS(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function AS(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var dc=class{constructor(...t){}};function zc(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):MS(e,r,o.value)}}function xt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function ds(e,t,r){return xt(e,t,r,!1)}function qS(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return xt(this,r,o(this))},set(n){xt(this,r,n)}})}return t}function MS(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:xt(this,t,r.bind(this))},set(o){xt(this,t,o)}})}function LS(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var uc,jt=!1,DS={configurable:!0,get(){jt=!0}};function ge(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&uc!==e._zod){uc=void 0;return}uc=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,DS);let n=jt;jt=!1;try{let s=r(this);return jt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),jt=jt||n,s}catch(s){throw delete this[t],jt=jt||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function ZS(e,t,r,o){let n=LS(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var qd="~constantCatch";function Md(e){let t=()=>e;return t[qd]=!0,t}var Ld,$c=Object.freeze({status:"aborted"}),Rc={value:void 0,enumerable:!1},Dd="captureStackTrace"in Error?Error:null;function US(e){let t=Dd;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return Dd=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function q(e,t,r,o){let n={};function s(g){this.def=g,this.constr=m,this.traits=new Set}s.prototype=n;let i=r,c=i&&new WeakSet;function a(g,v){if(g._zod){if(g._zod.traits.has(e))return}else{Rc.value=new s(v);try{Object.defineProperty(g,"_zod",Rc)}finally{Rc.value=void 0}}if(g._zod.traits.add(e),t(g,v),c){let _=Object.getPrototypeOf(g),h=g._zod.constr.prototype,f=_;for(;f&&f!==h;)f=Object.getPrototypeOf(f);let z=f??_;c.has(z)||(c.add(z),zc(z,i))}let p=m.prototype;for(let _ in p)Object.prototype.hasOwnProperty.call(p,_)&&(_ in g||(g[_]=p[_].bind(g)))}let u=o?.Parent??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function m(g){let v=o?.Parent?US(d):this;a(v,g);let p=v._zod.deferred;if(p){for(let h of p)h();v._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(v),v}return Object.defineProperty(m,"init",{value:a}),Object.defineProperty(m,Symbol.hasInstance,{value:g=>o?.Parent&&g instanceof o.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}var lt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},xr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Ld=globalThis).__zod_globalConfig??(Ld.__zod_globalConfig={});var Xe=globalThis.__zod_globalConfig;function Qe(e){return e&&Object.assign(Xe,e),Xe}function VS(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Ir,2)),e.message}function FS(e){this._zod.message=e}var HS={get:VS,set:FS,enumerable:!0,configurable:!0},Pc={value:void 0,enumerable:!1},Zd=new WeakSet([Object.prototype,Error.prototype]),Ud=(e,t)=>{e.name="$ZodError",Pc.value=t,Object.defineProperty(e,"issues",Pc),Pc.value=void 0,Object.defineProperty(e,"message",HS);let r=Object.getPrototypeOf(e);Zd.has(r)||(Zd.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},Vd=q("$ZodError",Ud),cR=q("$ZodError",Ud,void 0,{Parent:Error});function JS(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Ec(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?JS(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Tc(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(c=>o({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)r._errors.push(t(i));else{let a=r,u=0;for(;u<c.length;){let d=c[u],m=u===c.length-1;if(d==="_errors"){m&&a._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(a,d)||Object.defineProperty(a,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=a[d];m&&g._errors.push(t(i)),a=g,u++}}}};return o(e),r}function ps(e,t){return{callee:t?.callee??e,Err:t?.Err}}var ms=e=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise)throw new lt;if(c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>ut(u,i,Qe())));throw is(a,s?.callee??t),a}return c.value};return t};var fs=e=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},c=r._zod.run({value:o,issues:[]},i);if(c instanceof Promise&&(c=await c),c.issues.length){let a=new(s?.Err??e)(c.issues.map(u=>ut(u,i,Qe())));throw is(a,s?.callee??t),a}return c.value};return t};var hs=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 lt;return s.issues.length?Fd(e,s.issues,n):{success:!0,data:s.value}};function Fd(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>ut(n,r,Qe()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}var gs=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?Fd(e,s.issues,n):{success:!0,data:s.value}};var BS=Symbol.for("zod.compile.invalid"),KS=Symbol.for("zod.compile.fallback"),Cc=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==BS)return!0;if(o.definite===!0&&r===void 0)return!1}return GS(e,t,r)});function GS(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n?(o[KS]=!0,s=n({value:t,issues:[]},o)):s=e._zod.run({value:t,issues:[]},o),s instanceof Promise)throw new lt;return s.issues.length===0}var kc=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);return n instanceof Promise&&(n=await n),n.issues.length===0},Hd=e=>{let t=ms(e),r=(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,c,ps(r,i))};return r};var Jd=e=>{let t=ms(e),r=(o,n,s,i)=>t(o,n,s,ps(r,i));return r};var Bd=e=>{let t=fs(e),r=async(o,n,s,i)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,c,ps(r,i))};return r};var Kd=e=>{let t=fs(e),r=async(o,n,s,i)=>await t(o,n,s,ps(r,i));return r};var Gd=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return hs(e)(t,r,n)};var Wd=e=>(t,r,o)=>hs(e)(t,r,o);var Yd=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return gs(e)(t,r,n)};var Xd=e=>async(t,r,o)=>gs(e)(t,r,o);var Qd=/^[cC][0-9a-z]{6,}$/,ep=/^[0-9a-z]+$/,tp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,rp=/^[0-9a-vA-V]{20}$/,op=/^[A-Za-z0-9]{27}$/,np=/^[a-zA-Z0-9_-]{21}$/;function sp(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var ip=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var ap=/^([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})$/,Oc=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var cp=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var WS="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function up(){return new RegExp(WS,"u")}var lp=/^(?:(?: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])$/,dp=/^(([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 pp=/^((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])$/,mp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hp=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var gp=/^https?$/,_p=/^\+[1-9]\d{6,14}$/;var Sp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function YS(e){return new RegExp(`^${e}$`)}var yp=YS(Sp);function Ic(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function vp(e){return new RegExp(`^${Ic(e)}$`)}function bp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Ic({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Ic({precision:e.precision})}`:r;return new RegExp(`^${Sp}T(?:${o})$`)}var zp=/^[\s\S]{0,}$/;var Rp=/^-?\d+n?$/,Nc=/^-?\d+$/,Do=/^-?\d+(?:\.\d+)?$/,$p=/^(?:true|false)$/i,wp=/^null$/i;var Pp=/^[^A-Z]*$/,Ep=/^[^a-z]*$/;var De=q("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var jc=e=>{let t=e.value;return!pc(t)&&t.length!==void 0},_s={number:"number",bigint:"bigint",object:"date"},xc=q("$ZodCheckLessThan",(e,t)=>{De.init(e,t);let r=_s[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:_s[typeof o.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ac=q("$ZodCheckGreaterThan",(e,t)=>{De.init(e,t);let r=_s[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:_s[typeof o.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tp=q("$ZodCheckMultipleOf",(e,t)=>{De.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):mc(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Cp=q("$ZodCheckNumberFormat",(e,t)=>{De.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=qo[t.format];e._zod.check=i=>{let c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:c,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}}c<n&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var kp=q("$ZodCheckMaxLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>t.maximum?Mo(n):s)<=t.maximum)return;let c=Lo(n);o.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ip=q("$ZodCheckMinLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length;if((typeof n=="string"&&s>=t.minimum&&s<t.minimum*2?Mo(n):s)>=t.minimum)return;let c=Lo(n);o.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Op=q("$ZodCheckLengthEquals",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=jc),e._zod.check=o=>{let n=o.value,s=n.length,i=typeof n=="string"&&s>=t.length&&s<=t.length*2?Mo(n):s;if(i===t.length)return;let c=Lo(n),a=i>t.length;o.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Zo=q("$ZodCheckStringFormat",(e,t)=>{var r,o;De.init(e,t),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Np=q("$ZodCheckRegex",(e,t)=>{Zo.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),jp=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Pp),Zo.init(e,t)}),xp=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ep),Zo.init(e,t)}),Ap=q("$ZodCheckIncludes",(e,t)=>{De.init(e,t);let r=_t(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),qp=q("$ZodCheckStartsWith",(e,t)=>{De.init(e,t);let r=new RegExp(`^${_t(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Mp=q("$ZodCheckEndsWith",(e,t)=>{De.init(e,t);let r=new RegExp(`.*${_t(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Lp=q("$ZodCheckOverwrite",(e,t)=>{De.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Ss=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
4
|
+
`).filter(i=>i),n=Math.min(...o.map(i=>i.length-i.trimStart().length)),s=o.map(i=>i.slice(n)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
5
|
+
${r.join(`
|
|
6
|
+
`)}
|
|
7
|
+
};`)(...Object.values(this.closed))}};var Zp={major:4,minor:6,patch:5};var Se=q("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Zp;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let s of n)for(let i of s._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(c,a,u)=>{if(c.memo)return c;let d=ct(c),m;for(let g of a){if(g._zod.def.when){if(vc(c)||!g._zod.def.when(c))continue}else if(d)continue;let v=c.issues.length,p=g._zod.check(c);if(p instanceof Promise&&u?.async===!1)throw new lt;if(m||p instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await p,c.issues.length!==v&&(ls(c.issues,v,e),d||(d=ct(c,v)))});else{if(c.issues.length===v)continue;ls(c.issues,v,e),d||(d=ct(c,v))}}return m?m.then(()=>c):c},i=(c,a,u)=>{if(ct(c))return c.aborted=!0,c;let d=s(a,n,u);if(d instanceof Promise){if(u.async===!1)throw new lt;return d.then(m=>e._zod.parse(m,u))}return e._zod.parse(d,u)};e._zod.run=(c,a)=>{if(a.skipChecks)return e._zod.parse(c,a);if(a.direction==="backward"){let d=e._zod.parse({value:c.value,issues:[]},{...a,skipChecks:!0});return d instanceof Promise?d.then(m=>i(m,c,a)):i(d,c,a)}let u=e._zod.parse(c,a);if(u instanceof Promise){if(a.async===!1)throw new lt;return u.then(d=>s(d,n,a))}return s(u,n,a)}}},{get"~standard"(){return ds(this,"~standard",Mc(this))},set"~standard"(e){xt(this,"~standard",e)}}),Xp=(e,t)=>e.issues.length?{issues:e.issues.map(r=>ut(r,t,Qe()))}:{value:e.value};async function XS(e,t){let r={async:!0};return Xp(await e._zod.run({value:t,issues:[]},r),r)}function Mc(e){return{validate:t=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Xp(o,r)}catch{}return XS(e,t)},vendor:"zod",version:1}}var zs=q("$ZodString",(e,t)=>{Se.init(e,t),e._zod.pattern=t.pattern??zp,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Re=q("$ZodStringFormat",(e,t)=>{Zo.init(e,t),zs.init(e,t)}),Qp=q("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ap),Re.init(e,t)}),em=q("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Oc(o))}else t.pattern??(t.pattern=Oc());Re.init(e,t)}),tm=q("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cp),Re.init(e,t)}),rm=1,vs=2;function om(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function QS(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?om(e)||vs:ey(e,t)}function ey(e,t){if(!t.normalize&&t.protocol?.source===gp.source&&!/^https?:\/\//i.test(e))return rm;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??vs}return new URL(e)}catch{return vs}}var ty=/[\t\n\r]/g;function Up(e){return e.replace(ty,"")}function ry(e,t){return t.lastIndex=0,t.test(e.hostname)}function oy(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var nm=q("$ZodURL",(e,t)=>{Re.init(e,t),e._zod.check=r=>{try{let o=r.value.trim(),n=QS(o,t);if(n===rm){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===vs){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=Up(o);return}t.hostname&&!ry(n,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!oy(n,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?n.href:Up(o);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),sm=q("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=up()),Re.init(e,t)}),im=q("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?np:sp(t.length)),Re.init(e,t)}),am=q("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Qd),Re.init(e,t)}),cm=q("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ep),Re.init(e,t)}),um=q("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tp),Re.init(e,t)}),lm=q("$ZodXID",(e,t)=>{t.pattern??(t.pattern=rp),Re.init(e,t)}),dm=q("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=op),Re.init(e,t)}),pm=q("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=bp(t)),Re.init(e,t)}),mm=q("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=yp),Re.init(e,t)}),fm=q("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=vp(t)),Re.init(e,t)}),hm=q("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ip),Re.init(e,t)}),gm=q("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=lp),Re.init(e,t)}),ny=/^[0-9a-fA-F:.]+$/;function _m(e){return ny.test(e)?om(`http://[${e}]`):!1}var Sm=q("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=dp),Re.init(e,t),e._zod.check=r=>{_m(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var ym=q("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=pp),Re.init(e,t)});function sy(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);return`${n}`!==o||n<0||n>128?!1:_m(r)}var vm=q("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=mp),Re.init(e,t),e._zod.check=r=>{sy(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function bm(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Lc=/^[0-9a-zA-Z+/]*={0,2}$/,zm=q("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Lc),Re.init(e,t),e._zod.check=r=>{bm(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Rs=/^[A-Za-z0-9_-]*$/;function iy(e){if(!Rs.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return bm(r)}var Rm=q("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Rs),Re.init(e,t),e._zod.check=r=>{iy(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),$m=q("$ZodE164",(e,t)=>{t.pattern??(t.pattern=_p),Re.init(e,t)});function ay(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var wm=q("$ZodJWT",(e,t)=>{Re.init(e,t),e._zod.check=r=>{ay(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Dc=q("$ZodNumber",(e,t)=>{Se.init(e,t),e._zod.pattern=Do,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:String(n):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),Pm=q("$ZodNumberFormat",(e,t)=>{Cp.init(e,t),Dc.init(e,t)}),Em=q("$ZodBoolean",(e,t)=>{Se.init(e,t),e._zod.pattern=$p,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Tm=q("$ZodBigInt",(e,t)=>{Se.init(e,t),e._zod.pattern=Rp,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Cm=q("$ZodNull",(e,t)=>{Se.init(e,t),e._zod.pattern=wp,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),km=q("$ZodAny",(e,t)=>{Se.init(e,t),e._zod.parse=r=>r}),Im=q("$ZodUnknown",(e,t)=>{Se.init(e,t),e._zod.parse=r=>r}),Om=q("$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)});var Nm=q("$ZodDate",(e,t)=>{Se.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Vp(e,t,r){e.issues.length&&t.issues.push(...St(r,e.issues)),t.value[r]=e.value}var jm=q("$ZodArray",(e,t)=>{Se.init(e,t);let r=Xe.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=r?r.alloc(e,o,Array(s.length),n):Array(s.length);let i=[],c=n?.abortEarly;for(let a=0;a<s.length;a++){let u=s[a],d=t.element._zod.run({value:u,issues:[]},n);if(d instanceof Promise)i.push(d.then(m=>Vp(m,o,a)));else if(Vp(d,o,a),c&&d.issues.length!==0&&ct(d))break}return i.length?Promise.all(i).then(()=>o):o}});function bs(e,t,r,o,n,s){let i=r in o,c=s==="optional";if(!(!i&&c&&n==="optional")){if(e.issues.length){if(n!==void 0&&c&&!i)return;t.issues.push(...St(r,e.issues))}if(!i&&n===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(i||n==="defaulted"&&!c)&&(t.value[r]=void 0):t.value[r]=e.value}}var cy=[];function xm(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:cy,n=o.length?[...t,...o]:t;for(let i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=yc(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Am(e,t,r,o,n,s,i){let c=[],a=n.keySet,u=n.catchall._zod,d=u.def.type,m=u.optin,g=u.optout,v=0;for(let p in t){if(i&&r.issues.length!==v){if(ct(r,v))break;v=r.issues.length}if(a.has(p))continue;if(p==="__proto__"){d==="never"&&c.push(p);continue}if(d==="never"){c.push(p);continue}let _=u.run({value:t[p],issues:[]},o);_ instanceof Promise?e.push(_.then(h=>bs(h,r,p,t,m,g))):bs(_,r,p,t,m,g)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var uy=q("$ZodObject",(e,t)=>{Se.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let d={...o};return Object.defineProperty(t,"shape",{value:d}),u.raw=d,d};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=Or(()=>xm(t));ge(e,"propValues",u=>{let d=u.def.shape,m={};for(let g in d){let v=d[g]._zod;if(v.values){Object.prototype.hasOwnProperty.call(m,g)||Ye(m,g,new Set);for(let p of v.values)m[g].add(p);v.optin!==void 0&&m[g].add(void 0)}}return m});let s=cr,i=t.catchall,c,a=Xe.memoizer;a?.attach(e),e._zod.parse=(u,d)=>{c??(c=n.value);let m=u.value;if(!s(m))return u.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),u;u.value=a?a.alloc(e,u,{},d):{};let g=[],v=c.shape,p=d?.abortEarly,_=u.issues.length;for(let h of c.allKeys){if(p&&u.issues.length!==_){if(ct(u,_))break;_=u.issues.length}if(h==="__proto__")continue;let f=v[h],z=f._zod.optin,y=f._zod.optout,R=f._zod.run({value:m[h],issues:[]},d);R instanceof Promise?g.push(R.then(w=>bs(w,u,h,m,z,y))):bs(R,u,h,m,z,y)}return i?Am(g,m,u,d,n.value,e,p===!0):g.length?Promise.all(g).then(()=>u):u}}),qm=q("$ZodObjectJIT",(e,t)=>{uy.init(e,t);let r=e._zod.parse,o=Or(()=>xm(t)),n=Xe.memoizer,s=v=>{let p=o.value,_=p.symbolKeys,h=new Ss(["payload","ctx"],{shape:v,inst:e,memo:n,syms:_}),f=w=>`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`,z=(w,b)=>`
|
|
8
|
+
let ${w}_ab = false;
|
|
9
|
+
for (let i = 0; i < ${w}.issues.length; i++) {
|
|
10
|
+
const iss = ${w}.issues[i];
|
|
11
|
+
iss.path = iss.path ? [${b}, ...iss.path] : [${b}];
|
|
12
|
+
payload.issues.push(iss);
|
|
13
|
+
if (iss.continue !== true) ${w}_ab = true;
|
|
14
|
+
}
|
|
15
|
+
if (${w}_ab && ctx && ctx.abortEarly) {
|
|
16
|
+
payload.value = newResult;
|
|
17
|
+
return payload;
|
|
18
|
+
}`;h.write("const input = payload.value;");let y=Object.create(null),R=0;for(let w of p.allKeys)y[w]=`key_${R++}`;h.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let w of p.allKeys){if(w==="__proto__")continue;let b=y[w],S=typeof w=="symbol"?`syms[${_.indexOf(w)}]`:hc(w),E=`${S} in input`,j=v[w],F=j?._zod?.optin,M=F!==void 0,Z=j?._zod?.optout==="optional";if(h.write(`const ${b} = ${f(S)};`),M&&Z){let Y=F==="optional"?`${b}_present`:`${b}.value !== undefined || ${b}_present`;h.write(`
|
|
19
|
+
const ${b}_present = ${E};
|
|
20
|
+
if (!${b}.issues.length || ${b}_present) {
|
|
21
|
+
if (${b}.issues.length) {${z(b,S)}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (${Y}) {
|
|
25
|
+
newResult[${S}] = ${b}.value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
`)}else M?(h.write(`
|
|
30
|
+
if (${b}.issues.length) {${z(b,S)}
|
|
31
|
+
}
|
|
32
|
+
`),F==="defaulted"?h.write(`newResult[${S}] = ${b}.value;`):h.write(`
|
|
33
|
+
if (${b}.value !== undefined || ${E}) {
|
|
34
|
+
newResult[${S}] = ${b}.value;
|
|
35
|
+
}
|
|
36
|
+
`)):h.write(`
|
|
37
|
+
const ${b}_present = ${E};
|
|
38
|
+
if (${b}.issues.length) {${z(b,S)}
|
|
39
|
+
}
|
|
40
|
+
if (!${b}_present && !${b}.issues.length) {
|
|
41
|
+
payload.issues.push({
|
|
42
|
+
code: "invalid_type",
|
|
43
|
+
expected: "nonoptional",
|
|
44
|
+
input: undefined,
|
|
45
|
+
path: [${S}]
|
|
46
|
+
});
|
|
47
|
+
if (ctx && ctx.abortEarly) {
|
|
48
|
+
payload.value = newResult;
|
|
49
|
+
return payload;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (${b}_present) {
|
|
54
|
+
newResult[${S}] = ${b}.value;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
`)}return h.write("payload.value = newResult;"),h.write("return payload;"),h.compile()},i,c=cr,a=!Xe.jitless,d=a&&_c.value,m=t.catchall,g;e._zod.parse=(v,p)=>{g??(g=o.value);let _=v.value;return c(_)?a&&d&&p?.async===!1&&p.jitless!==!0?(i||(i=s(t.shape)),v=i(v,p),m?Am([],_,v,p,g,e,p?.abortEarly===!0):v):r(v,p):(v.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),v)}});function Fp(e,t,r,o){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter(s=>!ct(s));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>ut(i,o,Qe())))}),t)}var Zc=q("$ZodUnion",(e,t)=>{Se.init(e,t),ge(e,"optin",o=>o.def.options.some(n=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some(n=>n._zod.optin!==void 0)?"optional":void 0),ge(e,"optout",o=>o.def.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ge(e,"values",o=>{if(o.def.options.every(n=>n._zod.values))return new Set(o.def.options.flatMap(n=>Array.from(n._zod.values)))}),ge(e,"pattern",o=>{if(o.def.options.every(n=>n._zod.pattern)){let n=o.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${n.map(s=>Ao(s.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,i=[];for(let c of t.options){let a=c._zod.run({value:o.value,issues:[]},n);if(a instanceof Promise)i.push(a),s=!0;else{if(a.issues.length===0)return a;i.push(a)}}return s?Promise.all(i).then(c=>Fp(c,o,e,n)):Fp(i,o,e,n)}});function ly(e){let t=new Map;for(let r of e.options){let o=r._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let n of o)if(t.has(n)){if(n!==void 0)throw new Error(`Duplicate discriminator value "${String(n)}"`);t.set(n,null)}else t.set(n,r)}return t}var Mm=q("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Zc.init(e,t);let r=e._zod.parse;ge(e,"propValues",n=>{let s={},i=0;for(let c of n.def.options){let a=c._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${n.def.options.indexOf(c)}"`);a[n.def.discriminator]?.has(void 0)&&i++;for(let[u,d]of Object.entries(a)){Object.prototype.hasOwnProperty.call(s,u)||Ye(s,u,new Set);for(let m of d)s[u].add(m)}}return!n.def.unionFallback&&i>1&&s[n.def.discriminator]?.delete(void 0),s}),t.options.forEach((n,s)=>{let i=Nr(n._zod.def);if(i&&!Object.prototype.hasOwnProperty.call(i,t.discriminator))throw new Error(`Invalid discriminated union option at index "${s}"`)});let o=Or(()=>ly(t));e._zod.parse=(n,s)=>{let i=n.value;if(!cr(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let c=i?.[t.discriminator],a=o.value.get(c);return a&&(c!==void 0||s.direction!=="backward")?a._zod.run(n,s):t.unionFallback||s.direction==="backward"?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()).filter(u=>o.value.get(u)!==null),input:i,path:[t.discriminator],inst:e}),n)}}),Lm=q("$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),i=t.right._zod.run({value:n,issues:[]},o);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([a,u])=>Hp(r,a,u)):Hp(r,s,i)}});function qc(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(At(e)&&At(t)){let r=Object.keys(t),o=Object.keys(e).filter(s=>r.indexOf(s)!==-1),n={...e,...t};Object.prototype.hasOwnProperty.call(n,"__proto__")&&delete n.__proto__;for(let s of o){if(s==="__proto__")continue;let i=qc(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],s=t[o],i=qc(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Hp(e,t,r){let o=new Map,n,s=new Map,i=(u,d)=>{let m;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),m=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let g=String(u.path[0]);s.has(g)||s.set(g,u),m=[g]}else return!1;for(let g of m)o.has(g)||o.set(g,{}),o.get(g)[d]=!0;return!0};for(let u of t.issues)i(u,"l")||e.issues.push(u);for(let u of r.issues)i(u,"r")||e.issues.push(u);let c=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(c.length){let u=n?c.filter(d=>n.keys.includes(d)):[];u.length&&e.issues.push({...n,keys:u});for(let d of c)!u.includes(d)&&s.has(d)&&e.issues.push(s.get(d))}let a=qc(t.value,r.value);if(!a.valid){if(ct(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}var Dm=q("$ZodRecord",(e,t)=>{Se.init(e,t);let r=Xe.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!At(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;let i=[],c=t.keyType._zod.values;if(c&&!t.partial){o.value=r?r.alloc(e,o,{},n):{};let a=new Set;for(let d of c)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){if(a.add(typeof d=="number"?d.toString():d),d==="__proto__")continue;let m=t.keyType._zod.run({value:d,issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(m.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(p=>ut(p,n,Qe())),input:d,path:[d],inst:e});continue}let g=m.value;if(g==="__proto__")continue;let v=t.valueType._zod.run({value:s[d],issues:[]},n);v instanceof Promise?i.push(v.then(p=>{p.issues.length&&o.issues.push(...St(d,p.issues)),o.value[g]=p.value})):(v.issues.length&&o.issues.push(...St(d,v.issues)),o.value[g]=v.value)}let u;for(let d in s)if(!a.has(d))if(t.mode==="loose"){if(d==="__proto__")continue;o.value[d]=s[d]}else u=u??[],u.push(d);u&&u.length>0&&o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u,continue:!0})}else{o.value=r?r.alloc(e,o,{},n):{};let a;for(let u of Reflect.ownKeys(s)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,u))continue;let d=t.keyType._zod.run({value:u,issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Do.test(u)&&d.issues.length){let p=t.keyType._zod.run({value:Number(u),issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(d=p)}if(d.issues.length){t.mode==="loose"?o.value[u]=s[u]:c?(a=a??[],a.push(u)):o.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(p=>ut(p,n,Qe())),input:u,path:[u],inst:e});continue}let g=d.value;if(g==="__proto__")continue;let v=t.valueType._zod.run({value:s[u],issues:[]},n);v instanceof Promise?i.push(v.then(p=>{p.issues.length&&o.issues.push(...St(u,p.issues)),o.value[g]=p.value})):(v.issues.length&&o.issues.push(...St(u,v.issues)),o.value[g]=v.value)}a&&a.length>0&&o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:a,continue:!0})}return i.length?Promise.all(i).then(()=>o):o}});var Zm=q("$ZodEnum",(e,t)=>{Se.init(e,t);let r=kr(t.entries),o=new Set(r);e._zod.values=o,ge(e,"pattern",n=>{let s=kr(n.def.entries).filter(i=>Sc.has(typeof i));return new RegExp(s.length?`^(${s.map(i=>_t(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let i=n.value;return o.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),Um=q("$ZodLiteral",(e,t)=>{Se.init(e,t);let r=new Set(t.values);e._zod.values=r,ge(e,"pattern",o=>{let n=o.def.values;return new RegExp(n.length?`^(${n.map(s=>typeof s=="string"?_t(s):s?_t(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,n)=>{let s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var Vm=q("$ZodTransform",(e,t)=>{Se.init(e,t),e._zod.optin="optional",Xe.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new xr(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(r.value=i,r));if(n instanceof Promise)throw new lt;return r.value=n,r}});function Jp(e,t){return e.value=t.issues.length?void 0:t.value,e}var Uc=q("$ZodOptional",(e,t)=>{Se.init(e,t),ge(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",ge(e,"values",r=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),ge(e,"pattern",r=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${Ao(o.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let n=t.innerType._zod.run({value:r.value,issues:[]},o);return n instanceof Promise?n.then(s=>Jp(r,s)):Jp(r,n)}return t.innerType._zod.run(r,o)}}),Fm=q("$ZodExactOptional",(e,t)=>{Uc.init(e,t),ge(e,"values",r=>r.def.innerType._zod.values),ge(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Hm=q("$ZodNullable",(e,t)=>{Se.init(e,t),ge(e,"optin",r=>r.def.innerType._zod.optin),ge(e,"optout",r=>r.def.innerType._zod.optout),ge(e,"pattern",r=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${Ao(o.source)}|null)$`):void 0}),ge(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),Jm=q("$ZodDefault",(e,t)=>{Se.init(e,t),e._zod.optin="defaulted",ge(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>Bp(s,t)):Bp(n,t)}});function Bp(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Bm=q("$ZodPrefault",(e,t)=>{Se.init(e,t),e._zod.optin="defaulted",ge(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),Km=q("$ZodNonOptional",(e,t)=>{Se.init(e,t),ge(e,"values",r=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>Kp(s,e)):Kp(n,e)}});function Kp(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Gp(e,t,r,o){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(n=>ut(n,o,Qe()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Gm=q("$ZodCatch",(e,t)=>{Se.init(e,t),ge(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ge(e,"optout",r=>r.def.innerType._zod.optout),ge(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);return n instanceof Promise?n.then(s=>Gp(r,s,t,o)):Gp(r,n,t,o)}});var Vc=q("$ZodPipe",(e,t)=>{Se.init(e,t),ge(e,"values",r=>r.def.in._zod.values),ge(e,"optin",r=>r.def.in._zod.optin),ge(e,"optout",r=>r.def.out._zod.optout),ge(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);return s instanceof Promise?s.then(i=>ys(i,t.in,o)):ys(s,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(s=>ys(s,t.out,o)):ys(n,t.out,o)}});function ys(e,t,r){return e.issues.some(o=>o.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var Wm=q("$ZodPreprocess",(e,t)=>{Vc.init(e,t)}),Ym=q("$ZodReadonly",(e,t)=>{Se.init(e,t),ge(e,"propValues",r=>r.def.innerType._zod.propValues),ge(e,"values",r=>r.def.innerType._zod.values),ge(e,"optin",r=>r.def.innerType?._zod?.optin),ge(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Wp):Wp(n)}});function Wp(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Xm=q("$ZodLazy",(e,t)=>{Se.init(e,t),fc(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),ge(e,"pattern",r=>r.innerType?._zod?.pattern),ge(e,"propValues",r=>r.innerType?._zod?.propValues),ge(e,"optin",r=>r.innerType?._zod?.optin??void 0),ge(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Qm=q("$ZodCustom",(e,t)=>{De.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=>Yp(s,r,o,e));Yp(n,r,o,e)}});function Yp(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(jr(n))}}var Hc=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Jc="~memo",ef=[];function tf(e){return e!==null&&typeof e=="object"}function Fc(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var rf=new WeakMap,Uo=0,Ps=1,Vo=2;function Es(e,t,r){let o=rf.get(e);if(o!==void 0)return o?Vo:Uo;if(t.has(e))return Vo;t.add(e);let n=Uo,s=d=>{if(n!==Vo&&d?._zod){let m=Es(d,t,r);m>n&&(n=m)}},i=(d,m)=>{let g=Uo;for(let v of Reflect.ownKeys(d)){let p=Object.getOwnPropertyDescriptor(d,v);if(m&&!p.enumerable)continue;let _=p.get?Ps:p.value?._zod?Es(p.value,t,r):Uo;_>g&&(g=_)}return g},c=d=>{d>n&&(n=d)},a=e._zod.def,u=a.type;switch(u){case"object":{let d=Nr(a);c(d?i(d,!0):Ps),s(a.catchall);break}case"array":s(a.element);break;case"tuple":for(let d of a.items)s(d);s(a.rest);break;case"record":case"map":s(a.keyType),s(a.valueType);break;case"set":s(a.valueType);break;case"union":for(let d of a.options)s(d);break;case"intersection":s(a.left),s(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(a.innerType);break;case"pipe":s(a.in),s(a.out);break;case"function":s(a.input),s(a.output);break;case"lazy":{let d=a._cachedInner??(r?e._zod.innerType:void 0);c(d?Es(d,t,!1):Ps);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let d in a){let m=Object.getOwnPropertyDescriptor(a,d);if(!m||m.get)continue;let g=m.value;if(!(!g||typeof g!="object")){if(g._zod)s(g);else if(Array.isArray(g))for(let v of g)s(v)}}}return t.delete(e),dy(e,n)}function dy(e,t){return t!==Ps&&rf.set(e,t===Vo),t}function py(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var $s,ws=[],my={alloc(e,t,r){let o=$s;if(!o)return r;$s=void 0;let n={value:r,issues:null};return o.set(t.value,n),ws.push(n),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,o=(n,s)=>{if(s.direction!=="backward"&&fy(s,n.value))throw new Hc;return r(n,s)};e._zod.parse=o,e._zod.run===r&&(e._zod.run=o)})},attach(e){var t;let r,o=!1,n,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let i=e._zod.parse,c=(a,u)=>{if(r===void 0){let f=Es(e,new Set,!1);if(f===Uo)return e._zod.parse=i,e._zod.run===c&&(e._zod.run=i),i(a,u);f===Vo||o?r=!0:o=!0}let d=a.value;if(!tf(d))return i(a,u);let m=u[Jc];m||(m={buckets:new WeakMap,backEdges:void 0},u[Jc]=m);let g;n===u?g=s:(g=py(m,e),n=u,s=g);let v=g.get(d);if(v)return a.value=v.value,v.issues?v.issues.length&&a.issues.push(...Fc(v.issues)):(a.memo=!0,m.backEdges??(m.backEdges=new WeakSet),m.backEdges.add(v.value)),a;$s=g;let p=ws.length,_=i(a,u);$s=void 0;let h=ws.length>p?ws.pop():void 0;return _ instanceof Promise?_.then(f=>(h&&(h.issues=f.issues.length?Fc(f.issues):ef),f)):(h&&(h.issues=_.issues.length?Fc(_.issues):ef),_)};e._zod.parse=c,e._zod.run===i&&(e._zod.run=c)})}};function Bc(){return my}function fy(e,t){let r=e[Jc]?.backEdges;return r!==void 0&&tf(t)&&r.has(t)}var hy=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};function n(s,i){return s==="number"&&typeof i=="number"&&!Number.isFinite(i)?String(i):o[s]??s}return s=>{switch(s.code){case"invalid_type":{let i=n(s.expected),c=bc(s.input),a=n(c,s.input);return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${as(s.values[0])}`:`Invalid option: expected one of ${ss(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",c=t(s.origin);return c?`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",c=t(s.origin);return c?`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${c.unit}`:`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${ss(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(c=>`'${c}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function of(){return{localeError:hy()}}var nf;var Kc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function sf(){return new Kc}(nf=globalThis).__zod_globalRegistry??(nf.__zod_globalRegistry=sf());var qt=globalThis.__zod_globalRegistry;function Ts(e){return e.checks&&(e.checks=[...e.checks]),e}function af(e,t){return new e(Ts({type:"string",...te(t)}))}function cf(e,t){return new e(Ts({type:"string",coerce:!0,...te(t)}))}function Gc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...te(t)})}function uf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...te(t)})}function lf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...te(t)})}function df(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...te(t)})}function pf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...te(t)})}function mf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...te(t)})}function Wc(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...te(t)})}function ff(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...te(t)})}function hf(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...te(t)})}function gf(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...te(t)})}function _f(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...te(t)})}function Sf(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...te(t)})}function yf(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...te(t)})}function vf(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...te(t)})}function bf(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...te(t)})}function zf(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...te(t)})}function Rf(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...te(t)})}function $f(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...te(t)})}function wf(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...te(t)})}function Pf(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...te(t)})}function Ef(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...te(t)})}function Tf(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...te(t)})}function Cs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...te(t)})}function ks(e,t){return new e({type:"string",format:"date",check:"string_format",...te(t)})}function Is(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...te(t)})}function Os(e,t){return new e({type:"string",format:"duration",check:"string_format",...te(t)})}function Cf(e,t){return new e(Ts({type:"number",checks:[],...te(t)}))}function kf(e,t){return new e(Ts({type:"number",coerce:!0,checks:[],...te(t)}))}function If(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...te(t)})}function Of(e,t){return new e({type:"boolean",...te(t)})}function Nf(e,t){return new e({type:"boolean",coerce:!0,...te(t)})}function jf(e,t){return new e({type:"bigint",coerce:!0,...te(t)})}function xf(e,t){return new e({type:"null",...te(t)})}function Af(e){return new e({type:"any"})}function qf(e){return new e({type:"unknown"})}function Mf(e,t){return new e({type:"never",...te(t)})}function Lf(e,t){return new e({type:"date",coerce:!0,...te(t)})}function qr(e,t){return new xc({check:"less_than",...te(t),value:e,inclusive:!1})}function yt(e,t){return new xc({check:"less_than",...te(t),value:e,inclusive:!0})}function Mr(e,t){return new Ac({check:"greater_than",...te(t),value:e,inclusive:!1})}function vt(e,t){return new Ac({check:"greater_than",...te(t),value:e,inclusive:!0})}function Fo(e,t){return new Tp({check:"multiple_of",...te(t),value:e})}function Ns(e,t){return new kp({check:"max_length",...te(t),maximum:e})}function Lr(e,t){return new Ip({check:"min_length",...te(t),minimum:e})}function js(e,t){return new Op({check:"length_equals",...te(t),length:e})}function Yc(e,t){return new Np({check:"string_format",format:"regex",...te(t),pattern:e})}function Xc(e){return new jp({check:"string_format",format:"lowercase",...te(e)})}function Qc(e){return new xp({check:"string_format",format:"uppercase",...te(e)})}function eu(e,t){return new Ap({check:"string_format",format:"includes",...te(t),includes:e})}function tu(e,t){return new qp({check:"string_format",format:"starts_with",...te(t),prefix:e})}function ru(e,t){return new Mp({check:"string_format",format:"ends_with",...te(t),suffix:e})}function Mt(e){return new Lp({check:"overwrite",tx:e})}function ou(e){return Mt(t=>t.normalize(e))}function nu(){return Mt(e=>e.trim())}function su(){return Mt(e=>e.toLowerCase())}function iu(){return Mt(e=>e.toUpperCase())}function au(){return Mt(e=>gc(e))}function Df(e,t,r){return new e({type:"array",element:t,...te(r)})}function Zf(e,t,r){return new e({type:"custom",check:"custom",fn:t,...te(r)})}function Uf(e,t){let r=gy(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(jr(n,o.value,r._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=o.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(jr(s))}},e(o.value,o)),t);return r}function gy(e,t){let r=new De({check:"custom",...te(t)});return r._zod.check=e,r}function Ho(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,o)&&Ye(e,o,r[o]);return e}function Bo(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??qt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function qe(e,t,r,o,n){let s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:o.path,message:n}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(n);return Object.assign(r,s),!0}function ve(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)i.schema=c;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,d);else{let g=i.schema,v=t.processors[n.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);v(e,t,g,d)}let m=e._zod.parent;m&&(i.ref||(i.ref=m),ve(m,t,d),t.seen.get(m).isParent=!0)}let a=t.metadataRegistry.get(e);return a&&Ho(i.schema,a),t.io==="input"&&Ke(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Vf(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Ko(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let i of e.seen.entries()){let c=e.metadataRegistry.get(i[0])?.id;if(c){let a=o.get(c);if(a&&a!==i[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,i[0])}}let n=i=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let m=e.external.registry.get(i[0])?.id,g=e.external.uri??(p=>p);if(m)return{ref:g(m)};let v=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=v,{defId:v,ref:`${g("__shared")}#/${c}/${Vf(v)}`}}let a="#",u=`${a}/${c}/`;if(i[1]===r&&!i[1].schema.id)return{ref:a};let d=i[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+Vf(d)}},s=i=>{if(i[1].schema.$ref)return;let c=i[1],{ref:a,defId:u}=n(i);c.def={...c.schema},u&&(c.defId=u);let d=c.schema;for(let m in d)delete d[m];d.$ref=a};if(e.cycles==="throw")for(let i of e.seen.entries()){let c=i[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
58
|
+
|
|
59
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let c=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(c.cycle){s(i);continue}c.count>1&&e.reused==="ref"&&s(i)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Jf(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let o of t){if(!o||typeof o!="object")return;Jf(o);let n=Object.keys(o);if(n.length!==1||n[0]!=="type")return;let s=o.type;for(let i of Array.isArray(s)?s:[s]){if(typeof i!="string")return;r.includes(i)||r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Bf=new Set(["type","properties","required","additionalProperties"]),Ff=["oneOf","anyOf"];function Hf(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function cu(e){let t=[];for(let s of e){if(typeof s!="object"||s.type!=="object")return null;for(let i in s)if(!Bf.has(i))return null;t.push(s)}let r={},o=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let c=[];for(let u of t){let d=u.properties?.[i]??Hf(u);d!=null&&(c.some(m=>JSON.stringify(m)===JSON.stringify(d))||c.push(d))}let a=c.length===1?c[0]:cu(c)??{allOf:c};Ye(r,i,a)}for(let i of s.required??[])o.add(i)}let n={type:"object",properties:r};if(o.size&&(n.required=[...o]),t.every(s=>s.additionalProperties===!1))n.additionalProperties=!1;else{let s=[];for(let i of t){let c=Hf(i);c&&!s.some(a=>JSON.stringify(a)===JSON.stringify(c))&&s.push(c)}s.length===1?n.additionalProperties=s[0]:s.length>1&&(n.additionalProperties={allOf:s})}return n}function _y(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of Bf)if(n in e)return;let r=t.filter(n=>Ff.some(s=>Array.isArray(n[s]))),o=null;if(!r.length)o=cu(t);else{let n=r[0],s=Ff.find(a=>Array.isArray(n[a]));if(Object.keys(n).length!==1)return;let i=t.filter(a=>a!==n),c=n[s].map(a=>cu([...i,a]));if(c.some(a=>!a))return;o={[s]:c}}o&&(delete e.allOf,Ho(e,o))}function Go(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=c=>{let a=e.seen.get(c);if(a.ref===null)return;let u=a.def??a.schema,d={...u},m=a.ref;if(a.ref=null,m){o(m);let v=e.seen.get(m),p=v.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(p)):Ho(u,p),Ho(u,d),c._zod.parent===m)for(let h in u)h==="$ref"||h==="allOf"||h in d||delete u[h];if(p.$ref&&v.def)for(let h in u)h==="$ref"||h==="allOf"||h in v.def&&JSON.stringify(u[h])===JSON.stringify(v.def[h])&&delete u[h]}let g=c._zod.parent;if(g&&g!==m){o(g);let v=e.seen.get(g);if(v?.schema.$ref&&(u.$ref=v.schema.$ref,v.def))for(let p in u)p==="$ref"||p==="allOf"||p in v.def&&JSON.stringify(u[p])===JSON.stringify(v.def[p])&&delete u[p]}e.override({zodSchema:c,jsonSchema:u,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())o(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Jf(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let a of e.seen.values())for(let u of[a.schema,a.def]){let d=u?.allOf;if(!Array.isArray(d))continue;let m=c.get(d);m?m.push(u):c.set(d,[u])}for(let a of e.intersections)for(let u of c.get(a)??[])_y(u)}}let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Ho(n,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;s!==void 0&&n.id===s&&delete n.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let a=c[1];a.def&&a.defId&&(a.def.id===a.defId&&delete a.def.id,Ye(i,a.defId,a.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Jo(t,"input",e.processors),output:Jo(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Ke(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 Ke(o.element,r);if(o.type==="set")return Ke(o.valueType,r);if(o.type==="lazy")return Ke(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return Ke(o.innerType,r);if(o.type==="intersection")return Ke(o.left,r)||Ke(o.right,r);if(o.type==="record"||o.type==="map")return Ke(o.keyType,r)||Ke(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Ke(o.in,r)||Ke(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Ke(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Ke(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Ke(n,r))return!0;return!!(o.rest&&Ke(o.rest,r))}return!1}var Kf=(e,t={})=>r=>{let o=Bo({...r,processors:t});return ve(e,o),Ko(o,e),Go(o,e)},Jo=(e,t,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=Bo({...n??{},target:s,io:t,processors:r});return ve(e,i),Ko(i,e),Go(i,e)};var Dr=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},Zr=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},Gf=(e,t)=>{Dr(e,"minimum",t),Zr(e,"maximum",t)},eh=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},th=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},rh=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},oh=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},Wf=(e,t)=>Dr(e,"minimum",t.minimum),Yf=(e,t)=>Zr(e,"maximum",t.maximum),Xf=e=>(t,r)=>{oh(t,r.format);let[o,n]=e[r.format];Dr(t,"minimum",o),Zr(t,"maximum",n)},Sy={greater_than:(e,t)=>Dr(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Zr(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>eh(e,t.value),number_format:Xf(qo),bigint_format:Xf(cs),min_length:Wf,max_length:Yf,length_equals:(e,t)=>Gf(e,t.length),min_size:Wf,max_size:Yf,size_equals:(e,t)=>Gf(e,t.size),string_format:(e,t)=>{oh(e,t.format),t.pattern&&th(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>rh(e,t.mime)};function xe(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)Sy[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;n.minimum!==void 0&&Dr(t,"minimum",n.minimum),n.exclusiveMinimum!==void 0&&Dr(t,"exclusiveMinimum",n.exclusiveMinimum),n.maximum!==void 0&&Zr(t,"maximum",n.maximum),n.exclusiveMaximum!==void 0&&Zr(t,"exclusiveMaximum",n.exclusiveMaximum),n.multipleOf!==void 0&&eh(t,n.multipleOf),n.format!==void 0&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&rh(t,n.mime);for(let s of n.patterns??[])th(t,s);return t}var yy={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},vy=new Map([[Lc,fp],[Rs,hp]]),nh=e=>vy.get(e)??e,du=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:c,patterns:a,contentEncoding:u,laxFormat:d}=xe(e);if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),c&&(n.format=yy[c]??c,n.format===""&&delete n.format,(c==="time"||d)&&delete n.format),u&&(n.contentEncoding=u),a&&a.size>0){let m=[...a].map(nh);m.length===1?n.pattern=m[0].source: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}))])}},pu=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:u,isInt:d}=xe(e);n.type=d?"integer":"number";let m=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),g=typeof a=="number"&&a<=(i??Number.POSITIVE_INFINITY),v=t.target==="draft-04"||t.target==="openapi-3.0";if(m?v?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof s=="number"&&(n.minimum=s),g?v?(n.maximum=a,n.exclusiveMaximum=!0):n.exclusiveMaximum=a:typeof i=="number"&&(n.maximum=i),c){let p=new Set;for(let f of c)Number.isFinite(f)&&f!==0?p.add(Math.abs(f)):qe(e,t,n,o,`A multipleOf divisor of ${f} cannot be represented in JSON Schema`);let[_,...h]=p;_!==void 0&&(n.multipleOf=_),h.length&&(n.allOf=[...n.allOf??[],...h.map(f=>({multipleOf:f}))])}},mu=(e,t,r,o)=>{r.type="boolean"},fu=(e,t,r,o)=>{qe(e,t,r,o,"BigInt cannot be represented in JSON Schema")},sh=(e,t,r,o)=>{qe(e,t,r,o,"Symbols cannot be represented in JSON Schema")},hu=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},ih=(e,t,r,o)=>{qe(e,t,r,o,"Undefined cannot be represented in JSON Schema")},ah=(e,t,r,o)=>{qe(e,t,r,o,"Void cannot be represented in JSON Schema")},gu=(e,t,r,o)=>{r.not={}},_u=(e,t,r,o)=>{},Su=(e,t,r,o)=>{},yu=(e,t,r,o)=>{qe(e,t,r,o,"Date cannot be represented in JSON Schema")},vu=(e,t,r,o)=>{let n=e._zod.def,s=kr(n.entries);if(s.length===0){r.not={};return}s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},bu=(e,t,r,o)=>{let n=e._zod.def;if(n.values.length===0){r.not={};return}let s=[];for(let i of n.values)if(i===void 0){if(qe(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i=="bigint"){if(qe(e,t,r,o,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s},ch=(e,t,r,o)=>{qe(e,t,r,o,"NaN cannot be represented in JSON Schema")},uh=(e,t,r,o)=>{let n=r,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},lh=(e,t,r,o)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:s,maximum:i,mime:c}=xe(e);s!==void 0&&(n.minLength=s),i!==void 0&&(n.maxLength=i),c&&(c.length===0?n.not={}:c.length===1?n.contentMediaType=c[0]:n.anyOf=c.map(a=>({contentMediaType:a})))},dh=(e,t,r,o)=>{r.type="boolean"},zu=(e,t,r,o)=>{qe(e,t,r,o,"Custom types cannot be represented in JSON Schema")},ph=(e,t,r,o)=>{qe(e,t,r,o,"Function types cannot be represented in JSON Schema")},Ru=(e,t,r,o)=>{qe(e,t,r,o,"Transforms cannot be represented in JSON Schema")},mh=(e,t,r,o)=>{qe(e,t,r,o,"Map cannot be represented in JSON Schema")},fh=(e,t,r,o)=>{qe(e,t,r,o,"Set cannot be represented in JSON Schema")},$u=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:c}=xe(e);typeof i=="number"&&(n.minItems=i),typeof c=="number"&&(n.maxItems=c),n.type="array",n.items=ve(s.element,t,{...o,path:[...o.path,"items"]})};function Wo(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Wo(t.out):t.type==="catch"?Wo(t.innerType):e._zod.optin}var wu=(e,t,r,o)=>{let n=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&qe(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in i)Ye(n.properties,u,ve(i[u],t,{...o,path:[...o.path,"properties",u]}));let a=[];for(let u of Object.keys(i)){let d=s.shape[u];(t.io==="input"?Wo(d)===void 0:d._zod.optout===void 0)&&a.push(u)}a.length>0&&(n.required=a),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=ve(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Pu=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((c,a)=>ve(c,t,{...o,path:[...o.path,s?"oneOf":"anyOf",a]}));s?r.oneOf=i:r.anyOf=i},Eu=(e,t,r,o)=>{let n=e._zod.def,s=ve(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=ve(n.right,t,{...o,path:[...o.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,a=[...c(s)?s.allOf:[s],...c(i)?i.allOf:[i]];r.allOf=a,t.intersections.push(a)},hh=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",a=s.items.map((_,h)=>ve(_,t,{...o,path:[...o.path,i,h]})),u=s.rest?ve(s.rest,t,{...o,path:[...o.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null,d=s.items.length;for(;d>0;){let _=s.items[d-1];if(!(t.io==="input"?Wo(_)!==void 0:_._zod.optout==="optional"))break;d--}let m=s.items.length,g=!s.rest;t.target==="draft-2020-12"?(n.prefixItems=a,g?n.items=!1:u&&(n.items=u),d>0&&(n.minItems=d),g&&(n.maxItems=m)):t.target==="openapi-3.0"?(n.items={anyOf:a},u&&n.items.anyOf.push(u),d>0&&(n.minItems=d),g&&(n.maxItems=m)):(n.items=a,g?n.additionalItems=!1:u&&(n.additionalItems=u),d>0&&(n.minItems=d),g&&(n.maxItems=m));let{minimum:v,maximum:p}=xe(e);typeof v=="number"&&(n.minItems=v),typeof p=="number"&&(n.maxItems=p)};function uu(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let p=e.get(t)?.def;if(!p)return t;let _=uu(e,p,r);return _===p?t:_}for(let p of["anyOf","oneOf"]){let _=t[p];if(!Array.isArray(_))continue;let h=_.map(f=>uu(e,f,r));h.some((f,z)=>f!==_[z])&&(t={...t,[p]:h})}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some(p=>p==="number"||p==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some(p=>typeof p=="number"))return t;let{minimum:i,maximum:c,exclusiveMinimum:a,exclusiveMaximum:u,multipleOf:d,format:m,id:g,...v}=t;return v.enum?v.enum=v.enum.map(p=>typeof p=="number"?String(p):p):typeof v.const=="number"&&(v.const=String(v.const)),n&&(v.type="string",s||(v.pattern=(o.includes("number")?Do:Nc).source)),v}var lu=new WeakMap;function by(e){let t=new Map;for(let o of e.seen.values())o.def&&!t.has(o.schema)&&t.set(o.schema,o);let r=new Map;for(let o of lu.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=uu(t,s,new Set);i!==s&&r.set(s,i)}if(r.size)for(let o of e.seen.values())for(let n of[o.schema,o.def]){let s=n&&r.get(n.propertyNames);s&&(n.propertyNames=s)}}var Tu=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,c=xe(i).patterns;if(s.mode==="loose"&&c&&c.size>0){let d=ve(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let m of c)Ye(n.patternProperties,nh(m).source,d)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=ve(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});let d=lu.get(t);d||(d=[],lu.set(t,d),t.deferred.push(()=>by(t))),d.push(e)}n.additionalProperties=ve(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let a=i._zod.values,u=t.io==="input"&&Wo(s.valueType)!==void 0;if(a&&!s.partial&&!u){let d=[...a].filter(m=>typeof m=="string"||typeof m=="number");d.length>0&&(n.required=d.map(String))}},Cu=(e,t,r,o)=>{let n=e._zod.def,s=ve(n.innerType,t,o),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},ku=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Iu=Symbol();function gh(e,t,r,o,n){let s=!1,i=JSON.stringify(e,(c,a)=>typeof a!="bigint"?a:(s=!0,null));return s?(qe(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),Iu):JSON.parse(i)}var Ou=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i=gh(n.defaultValue,e,t,r,o);i!==Iu&&(r.default=i)},Nu=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io!=="input")return;let i=gh(n.defaultValue,e,t,r,o);i!==Iu&&(r._prefault=i)},ju=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{qe(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},xu=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;ve(i,t,o);let c=t.seen.get(e);c.ref=i},Au=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},_h=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},xs=(e,t,r,o)=>{let n=e._zod.def;ve(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},qu=(e,t,r,o)=>{let n=e._zod.innerType;ve(n,t,o);let s=t.seen.get(e);s.ref=n},Qf={string:du,number:pu,boolean:mu,bigint:fu,symbol:sh,null:hu,undefined:ih,void:ah,never:gu,any:_u,unknown:Su,date:yu,enum:vu,literal:bu,nan:ch,template_literal:uh,file:lh,success:dh,custom:zu,function:ph,transform:Ru,map:mh,set:fh,array:$u,object:wu,union:Pu,intersection:Eu,tuple:hh,record:Tu,nullable:Cu,nonoptional:ku,default:Ou,prefault:Nu,catch:ju,pipe:xu,readonly:Au,promise:_h,optional:xs,lazy:qu};function As(e,t){if("_idmap"in e){let o=e,n=Bo({...t,processors:Qf}),s={};for(let a of o._idmap.entries()){let[u,d]=a;ve(d,n)}let i={},c={registry:o,uri:t?.uri,defs:s};n.external=c;for(let a of o._idmap.entries()){let[u,d]=a;Ko(n,d),Ye(i,u,Go(n,d))}if(Object.keys(s).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:s}}return{schemas:i}}let r=Bo({...t,processors:Qf});return ve(e,r),Ko(r,e),Go(r,e)}var Sh=new WeakSet([Object.prototype,Error.prototype]);function qs(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let o=r(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}var ky=(e,t)=>{Vd.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);Sh.has(r)||(Sh.add(r),qs(r,"format",o=>n=>Tc(o,n)),qs(r,"flatten",o=>n=>Ec(o,n)),qs(r,"addIssue",o=>n=>{o.issues.push(n),o.message=JSON.stringify(o.issues,Ir,2)}),qs(r,"addIssues",o=>n=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,Ir,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))};var rt=q("ZodError",ky,void 0,{Parent:Error});var yh=ms(rt),vh=fs(rt),Ms=hs(rt),bh=gs(rt),zh=Hd(rt),Rh=Jd(rt),$h=Bd(rt),wh=Kd(rt),Ph=Gd(rt),Eh=Wd(rt),Th=Yd(rt),Ch=Xd(rt);function Oy(){Xe.localeError||Qe(of())}function Ds(){Xe.memoizer||Qe({memoizer:Bc()})}var ye=q("ZodType",(e,t)=>(Oy(),Se.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ae.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return st(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(yv(e,t))},superRefine(e,t){return this.check(vv(e,t))},overwrite(e){return this.check(Mt(e))},optional(){return X(this)},exactOptional(){return sv(this)},nullable(){return Oh(this)},nullish(){return X(Oh(this))},nonoptional(e){return dv(this,e)},array(){return I(this)},or(e){return W([this,e])},and(e){return bt(this,e)},transform(e){return Nh(this,Vh(e))},default(e){return cv(this,e)},prefault(e){return lv(this,e)},catch(e){return mv(this,e)},pipe(e){return Nh(this,e)},readonly(){return gv(this)},describe(e){let t=this.clone();return qt.add(t,{description:e}),t},meta(...e){if(e.length===0)return qt.get(this);let t=this.clone();return qt.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return ae.hide(this,"~standard",{...Mc(this),jsonSchema:{input:Jo(this,"input"),output:Jo(this,"output")}})},set"~standard"(e){ae.own(this,"~standard",e)},parse:function e(t,r){return yh(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await vh(this,t,r,{callee:e})},safeParse(e,t){return Ms(this,e,t)},async safeParseAsync(e,t){return bh(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ae.own(this,"spa",e)},validate(e,t){return Cc(this,e,t)},validateAsync(e,t){return kc(this,e,t)},encode:function e(t,r){return zh(this,t,r,{callee:e})},decode:function e(t,r){return Rh(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await $h(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await wh(this,t,r,{callee:e})},safeEncode(e,t){return Ph(this,e,t)},safeDecode(e,t){return Eh(this,e,t)},async safeEncodeAsync(e,t){return Th(this,e,t)},async safeDecodeAsync(e,t){return Ch(this,e,t)},toJSONSchema(e){return Kf(this,{})(e)},get description(){return qt.get(this)?.description},get _def(){return this._zod.def}}),jh=q("_ZodString",(e,t)=>{zs.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>du(e,r,o,n)},ae.derived({format:e=>xe(e).format??null,minLength:e=>xe(e).minimum??null,maxLength:e=>xe(e).maximum??null},{regex(...e){return this.check(Yc(...e))},includes(...e){return this.check(eu(...e))},startsWith(...e){return this.check(tu(...e))},endsWith(...e){return this.check(ru(...e))},min(...e){return this.check(Lr(...e))},max(...e){return this.check(Ns(...e))},length(...e){return this.check(js(...e))},nonempty(...e){return this.check(Lr(1,...e))},lowercase(e){return this.check(Xc(e))},uppercase(e){return this.check(Qc(e))},trim(){return this.check(nu())},normalize(...e){return this.check(ou(...e))},toLowerCase(){return this.check(su())},toUpperCase(){return this.check(iu())},slugify(){return this.check(au())}})),Lu=q("ZodString",(e,t)=>{zs.init(e,t),jh.init(e,t)},{email(e){return this.check(Gc(xh,e))},url(e){return this.check(Wc(qh,e))},jwt(e){return this.check(Tf(Ky,e))},emoji(e){return this.check(ff(jy,e))},guid(e){return this.check(uf(Ny,e))},uuid(e){return this.check(lf(Ls,e))},uuidv4(e){return this.check(df(Ls,e))},uuidv6(e){return this.check(pf(Ls,e))},uuidv7(e){return this.check(mf(Ls,e))},nanoid(e){return this.check(hf(xy,e))},cuid(e){return this.check(gf(Ay,e))},cuid2(e){return this.check(_f(qy,e))},ulid(e){return this.check(Sf(My,e))},base64(e){return this.check(wf(Hy,e))},base64url(e){return this.check(Pf(Jy,e))},xid(e){return this.check(yf(Ly,e))},ksuid(e){return this.check(vf(Dy,e))},ipv4(e){return this.check(bf(Zy,e))},ipv6(e){return this.check(zf(Uy,e))},cidrv4(e){return this.check(Rf(Vy,e))},cidrv6(e){return this.check($f(Fy,e))},e164(e){return this.check(Ef(By,e))},datetime(e){return this.check(Cs(Yo,e))},date(e){return this.check(ks(Xo,e))},time(e){return this.check(Is(Qo,e))},duration(e){return this.check(Os(en,e))}});function l(e){return af(Lu,e)}var Pe=q("ZodStringFormat",(e,t)=>{Re.init(e,t),jh.init(e,t)}),Yo=q("ZodISODateTime",(e,t)=>{pm.init(e,t),Pe.init(e,t)}),Xo=q("ZodISODate",(e,t)=>{mm.init(e,t),Pe.init(e,t)}),Qo=q("ZodISOTime",(e,t)=>{fm.init(e,t),Pe.init(e,t)}),en=q("ZodISODuration",(e,t)=>{hm.init(e,t),Pe.init(e,t)}),xh=q("ZodEmail",(e,t)=>{tm.init(e,t),Pe.init(e,t)});function Ah(e){return Gc(xh,e)}var Ny=q("ZodGUID",(e,t)=>{Qp.init(e,t),Pe.init(e,t)});var Ls=q("ZodUUID",(e,t)=>{em.init(e,t),Pe.init(e,t)});var qh=q("ZodURL",(e,t)=>{nm.init(e,t),Pe.init(e,t)});function Zs(e){return Wc(qh,e)}var jy=q("ZodEmoji",(e,t)=>{sm.init(e,t),Pe.init(e,t)});var xy=q("ZodNanoID",(e,t)=>{im.init(e,t),Pe.init(e,t)});var Ay=q("ZodCUID",(e,t)=>{am.init(e,t),Pe.init(e,t)});var qy=q("ZodCUID2",(e,t)=>{cm.init(e,t),Pe.init(e,t)});var My=q("ZodULID",(e,t)=>{um.init(e,t),Pe.init(e,t)});var Ly=q("ZodXID",(e,t)=>{lm.init(e,t),Pe.init(e,t)});var Dy=q("ZodKSUID",(e,t)=>{dm.init(e,t),Pe.init(e,t)});var Zy=q("ZodIPv4",(e,t)=>{gm.init(e,t),Pe.init(e,t)});var Uy=q("ZodIPv6",(e,t)=>{Sm.init(e,t),Pe.init(e,t)});var Vy=q("ZodCIDRv4",(e,t)=>{ym.init(e,t),Pe.init(e,t)});var Fy=q("ZodCIDRv6",(e,t)=>{vm.init(e,t),Pe.init(e,t)});var Hy=q("ZodBase64",(e,t)=>{zm.init(e,t),Pe.init(e,t)});var Jy=q("ZodBase64URL",(e,t)=>{Rm.init(e,t),Pe.init(e,t)});var By=q("ZodE164",(e,t)=>{$m.init(e,t),Pe.init(e,t)});var Ky=q("ZodJWT",(e,t)=>{wm.init(e,t),Pe.init(e,t)});var Us=q("ZodNumber",(e,t)=>{Dc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pu(e,r,o,n),e.isFinite=!0},ae.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=xe(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=xe(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=xe(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>xe(e).format??null},{gt(e,t){return this.check(Mr(e,t))},gte(e,t){return this.check(vt(e,t))},min(e,t){return this.check(vt(e,t))},lt(e,t){return this.check(qr(e,t))},lte(e,t){return this.check(yt(e,t))},max(e,t){return this.check(yt(e,t))},int(e){return this.check(kh(e))},safe(e){return this.check(kh(e))},positive(e){return this.check(Mr(0,e))},nonnegative(e){return this.check(vt(0,e))},negative(e){return this.check(qr(0,e))},nonpositive(e){return this.check(yt(0,e))},multipleOf(e,t){return this.check(Fo(e,t))},step(e,t){return this.check(Fo(e,t))},finite(){return this}}));function L(e){return Cf(Us,e)}var Gy=q("ZodNumberFormat",(e,t)=>{Pm.init(e,t),Us.init(e,t)});function kh(e){return If(Gy,e)}var Du=q("ZodBoolean",(e,t)=>{Em.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mu(e,r,o,n)});function H(e){return Of(Du,e)}var Mh=q("ZodBigInt",(e,t)=>{Tm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fu(e,r,o,n)},ae.derived({minValue:e=>xe(e).minimum??null,maxValue:e=>xe(e).maximum??null,format:e=>xe(e).format??null},{gte(e,t){return this.check(vt(e,t))},min(e,t){return this.check(vt(e,t))},gt(e,t){return this.check(Mr(e,t))},lt(e,t){return this.check(qr(e,t))},lte(e,t){return this.check(yt(e,t))},max(e,t){return this.check(yt(e,t))},positive(e){return this.check(Mr(BigInt(0),e))},negative(e){return this.check(qr(BigInt(0),e))},nonpositive(e){return this.check(yt(BigInt(0),e))},nonnegative(e){return this.check(vt(BigInt(0),e))},multipleOf(e,t){return this.check(Fo(e,t))}}));var Wy=q("ZodNull",(e,t)=>{Cm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hu(e,r,o,n)});function ur(e){return xf(Wy,e)}var Yy=q("ZodAny",(e,t)=>{km.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_u(e,r,o,n)});function Lh(){return Af(Yy)}var Xy=q("ZodUnknown",(e,t)=>{Im.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Su(e,r,o,n)});function Q(){return qf(Xy)}var Qy=q("ZodNever",(e,t)=>{Om.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gu(e,r,o,n)});function Dh(e){return Mf(Qy,e)}var Zh=q("ZodDate",(e,t)=>{Nm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yu(e,r,o,n),e.min=(r,o)=>e.check(vt(r,o)),e.max=(r,o)=>e.check(yt(r,o))},ae.derived({minDate:e=>{let{minimum:t}=xe(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=xe(e);return t?new Date(t):null}},{}));var ev=q("ZodArray",(e,t)=>{Ds(),jm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$u(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Lr(e,t))},nonempty(e){return this.check(Lr(1,e))},max(e,t){return this.check(Ns(e,t))},length(e,t){return this.check(js(e,t))},unwrap(){return this.element}});function I(e,t){return Df(ev,e,t)}var Zu=q("ZodObject",(e,t)=>{Ds(),qm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wu(e,r,o,n),ae.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return ce(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ae.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Q()}))},loose(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Q()}))},strict(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:Dh()}))},strip(){return this.clone(ae.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return ae.extend(this,e)},safeExtend(e){return ae.safeExtend(this,e)},merge(e){return ae.merge(this,e)},pick(e){return ae.pick(this,e)},omit(e){return ae.omit(this,e)},partial(...e){return ae.partial(Fh,this,e[0])},exactPartial(...e){return ae.partial(Hh,this,e[0],"exactPartial")},required(...e){return ae.required(Jh,this,e[0])}});function P(e,t){let r={type:"object",shape:e??{},...ae.normalizeParams(t)};return new Zu(r)}function Ge(e,t){return new Zu({type:"object",shape:e,catchall:Dh(),...ae.normalizeParams(t)})}function re(e,t){return new Zu({type:"object",shape:e,catchall:Q(),...ae.normalizeParams(t)})}var Uh=q("ZodUnion",(e,t)=>{Zc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pu(e,r,o,n),e.options=t.options});function W(e,t){return new Uh({type:"union",options:e,...ae.normalizeParams(t)})}var tv=q("ZodDiscriminatedUnion",(e,t)=>{Uh.init(e,t),Mm.init(e,t)});function Lt(e,t,r){return new tv({type:"union",options:t,discriminator:e,...ae.normalizeParams(r)})}var rv=q("ZodIntersection",(e,t)=>{Lm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Eu(e,r,o,n)});function bt(e,t){return new rv({type:"intersection",left:e,right:t})}var Ih=q("ZodRecord",(e,t)=>{Ds(),Dm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tu(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function K(e,t,r){return!t||!t._zod?new Ih({type:"record",keyType:l(),valueType:e,...ae.normalizeParams(t)}):new Ih({type:"record",keyType:e,valueType:t,...ae.normalizeParams(r)})}var Mu=q("ZodEnum",(e,t)=>{Zm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(o,n,s)=>vu(e,o,n,s),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Mu({...t,checks:[],...ae.normalizeParams(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let i of o)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Mu({...t,checks:[],...ae.normalizeParams(n),entries:s})}});function ce(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Mu({type:"enum",entries:r,...ae.normalizeParams(t)})}var ov=q("ZodLiteral",(e,t)=>{Um.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bu(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function O(e,t){return new ov({type:"literal",values:Array.isArray(e)?e:[e],...ae.normalizeParams(t)})}var nv=q("ZodTransform",(e,t)=>{Ds(),Vm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ru(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new xr(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(ae.issue(s,r.value,t));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=e),r.issues.push(ae.issue(i))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r)):(r.value=n,r)}});function Vh(e){return new nv({type:"transform",transform:e})}var Fh=q("ZodOptional",(e,t)=>{Uc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function X(e){return new Fh({type:"optional",innerType:e})}var Hh=q("ZodExactOptional",(e,t)=>{Fm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function sv(e){return new Hh({type:"optional",innerType:e})}var iv=q("ZodNullable",(e,t)=>{Hm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Oh(e){return new iv({type:"nullable",innerType:e})}var av=q("ZodDefault",(e,t)=>{Jm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ou(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function cv(e,t){return new av({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ae.shallowClone(t)}})}var uv=q("ZodPrefault",(e,t)=>{Bm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function lv(e,t){return new uv({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ae.shallowClone(t)}})}var Jh=q("ZodNonOptional",(e,t)=>{Km.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ku(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function dv(e,t){return new Jh({type:"nonoptional",innerType:e,...ae.normalizeParams(t)})}var pv=q("ZodCatch",(e,t)=>{Gm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ju(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function mv(e,t){return new pv({type:"catch",innerType:e,catchValue:typeof t=="function"?t:ae.constantCatch(t)})}var Bh=q("ZodPipe",(e,t)=>{Vc.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xu(e,r,o,n),e.in=t.in,e.out=t.out});function Nh(e,t){return new Bh({type:"pipe",in:e,out:t})}var fv=q("ZodPreprocess",(e,t)=>{Bh.init(e,t),Wm.init(e,t)}),hv=q("ZodReadonly",(e,t)=>{Ym.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Au(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function gv(e){return new hv({type:"readonly",innerType:e})}var _v=q("ZodLazy",(e,t)=>{Xm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qu(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function tn(e){return new _v({type:"lazy",getter:e})}var Sv=q("ZodCustom",(e,t)=>{Qm.init(e,t),ye.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zu(e,r,o,n)});function yv(e,t={}){return Zf(Sv,e,t)}function vv(e,t){return Uf(e,t)}function lr(e,t){return new fv({type:"pipe",in:Vh(e),out:t})}var Gh={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 Kh;Kh||(Kh={});var zt={};ic(zt,{ZodISODate:()=>Xo,ZodISODateTime:()=>Yo,ZodISODuration:()=>en,ZodISOTime:()=>Qo,date:()=>Rv,datetime:()=>zv,duration:()=>wv,time:()=>$v});function zv(e){return Cs(Yo,e)}function Rv(e){return ks(Xo,e)}function $v(e){return Is(Qo,e)}function wv(e){return Os(en,e)}var Vs={};ic(Vs,{bigint:()=>Cv,boolean:()=>Tv,date:()=>kv,number:()=>Ev,string:()=>Pv});function Pv(e){return cf(Lu,e)}function Ev(e){return kf(Us,e)}function Tv(e){return Nf(Du,e)}function Cv(e){return jf(Mh,e)}function kv(e){return Lf(Zh,e)}var pr="2025-11-25";var Fs=[pr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Hs="io.modelcontextprotocol/related-task",mr="io.modelcontextprotocol/protocolVersion",Vr="io.modelcontextprotocol/clientInfo",$t="io.modelcontextprotocol/serverInfo",wt="io.modelcontextprotocol/clientCapabilities",rn="io.modelcontextprotocol/subscriptionId",Zt="io.modelcontextprotocol/logLevel";var fr="2.0";var Dt=tn(()=>W([l(),L(),H(),ur(),K(l(),Dt),I(Dt)])),Ee=K(l(),Dt),Vu=I(Dt),on=W([l(),L().int()]),nn=l(),Js=P({ttl:L().optional()}),Bs=P({taskId:l()}),sn=re({progressToken:on.optional(),[Hs]:Bs.optional()}),Le=P({_meta:sn.optional()}),hr=Le.extend({task:Js.optional()}),Te=P({method:l(),params:Le.loose().optional()}),Fe=P({_meta:sn.optional()}),He=P({method:l(),params:Fe.loose().optional()}),an=re({get[$t](){return Jr.optional().catch(void 0)}}),Ce=re({_meta:an.optional()}),Ut=W([l(),L().int()]),cn=P({jsonrpc:O(fr),id:Ut,...Te.shape}).strict(),un=P({jsonrpc:O(fr),...He.shape}).strict(),Fr=P({jsonrpc:O(fr),id:Ut,result:Ce}).strict(),Hr=P({jsonrpc:O(fr),id:Ut.optional(),error:P({code:L().int(),message:l(),data:Q().optional()})}).strict(),ln=W([cn,un,Fr,Hr]),Fu=W([Fr,Hr]),dn=Ce.strict(),Ks=Fe.extend({requestId:Ut.optional(),reason:l().optional()}),pn=He.extend({method:O("notifications/cancelled"),params:Ks}),Gs=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:ce(["light","dark"]).optional()}),Vt=P({icons:I(Gs).optional()}),Rt=P({name:l(),title:l().optional()}),Jr=Rt.extend({...Rt.shape,...Vt.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),Ov=bt(P({applyDefaults:H().optional()}),Ee),Nv=lr(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,bt(P({form:Ov.optional(),url:Ee.optional()}),Ee.optional())),Ws=re({list:Ee.optional(),cancel:Ee.optional(),requests:re({sampling:re({createMessage:Ee.optional()}).optional(),elicitation:re({create:Ee.optional()}).optional()}).optional()}),Ys=re({list:Ee.optional(),cancel:Ee.optional(),requests:re({tools:re({call:Ee.optional()}).optional()}).optional()}),Xs=P({experimental:K(l(),Ee).optional(),sampling:P({context:Ee.optional(),tools:Ee.optional()}).optional(),elicitation:Nv.optional(),roots:P({listChanged:H().optional()}).optional(),tasks:Ws.optional(),extensions:K(l(),Ee).optional()}),Qs=Le.extend({protocolVersion:l(),capabilities:Xs,clientInfo:Jr}),ei=Te.extend({method:O("initialize"),params:Qs}),mn=P({experimental:K(l(),Ee).optional(),logging:Ee.optional(),completions:Ee.optional(),prompts:P({listChanged:H().optional()}).optional(),resources:P({subscribe:H().optional(),listChanged:H().optional()}).optional(),tools:P({listChanged:H().optional()}).optional(),tasks:Ys.optional(),extensions:K(l(),Ee).optional()}),ti=Ce.extend({protocolVersion:l(),capabilities:mn,serverInfo:Jr,instructions:l().optional()}),ri=He.extend({method:O("notifications/initialized"),params:Fe.optional()}),oi=Te.extend({method:O("server/discover"),params:Le.optional()}),ni=Ce.extend({supportedVersions:I(l()),capabilities:mn,instructions:l().optional()}),fn=Te.extend({method:O("ping"),params:Le.optional()}),si=P({progress:L(),total:X(L()),message:X(l())}),ii=P({...Fe.shape,...si.shape,progressToken:on}),hn=He.extend({method:O("notifications/progress"),params:ii}),ai=Le.extend({cursor:nn.optional()}),Ft=Te.extend({params:ai.optional()}),Ht=Ce.extend({nextCursor:nn.optional()}),gn=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),_n=gn.extend({text:l()}),Hu=l().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Sn=gn.extend({blob:Hu}),Jt=ce(["user","assistant"]),Pt=P({audience:I(Jt).optional(),priority:L().min(0).max(1).optional(),lastModified:zt.datetime({offset:!0}).optional()}),yn=P({...Rt.shape,...Vt.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:Pt.optional(),_meta:X(re({}))}),ci=P({...Rt.shape,...Vt.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:Pt.optional(),_meta:X(re({}))}),ui=Ft.extend({method:O("resources/list")}),li=Ht.extend({resources:I(yn)}),di=Ft.extend({method:O("resources/templates/list")}),pi=Ht.extend({resourceTemplates:I(ci)}),Br=Le.extend({uri:l()}),mi=Br,fi=Te.extend({method:O("resources/read"),params:mi}),hi=Ce.extend({contents:I(W([_n,Sn]))}),gi=He.extend({method:O("notifications/resources/list_changed"),params:Fe.optional()}),_i=Br,Si=Te.extend({method:O("resources/subscribe"),params:_i}),yi=Br,vi=Te.extend({method:O("resources/unsubscribe"),params:yi}),vn=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),bi=Le.extend({notifications:vn}),zi=Te.extend({method:O("subscriptions/listen"),params:bi}),Ri=Fe.extend({notifications:vn}),$i=He.extend({method:O("notifications/subscriptions/acknowledged"),params:Ri}),wi=an.extend({[rn]:Ut}),Pi=Ce.extend({_meta:wi}),Ei=Fe.extend({uri:l()}),Ti=He.extend({method:O("notifications/resources/updated"),params:Ei}),Ci=P({name:l(),description:X(l()),required:X(H())}),ki=P({...Rt.shape,...Vt.shape,description:X(l()),arguments:X(I(Ci)),_meta:X(re({}))}),Ii=Ft.extend({method:O("prompts/list")}),Oi=Ht.extend({prompts:I(ki)}),Ni=Le.extend({name:l(),arguments:K(l(),l()).optional()}),ji=Te.extend({method:O("prompts/get"),params:Ni}),Kr=P({type:O("text"),text:l(),annotations:Pt.optional(),_meta:K(l(),Q()).optional()}),Gr=P({type:O("image"),data:Hu,mimeType:l(),annotations:Pt.optional(),_meta:K(l(),Q()).optional()}),Wr=P({type:O("audio"),data:Hu,mimeType:l(),annotations:Pt.optional(),_meta:K(l(),Q()).optional()}),xi=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),Ai=P({type:O("resource"),resource:W([_n,Sn]),annotations:Pt.optional(),_meta:K(l(),Q()).optional()}),qi=yn.extend({type:O("resource_link")}),Yr=W([Kr,Gr,Wr,qi,Ai]),Mi=P({role:Jt,content:Yr}),Li=Ce.extend({description:l().optional(),messages:I(Mi)}),Di=He.extend({method:O("notifications/prompts/list_changed"),params:Fe.optional()}),Zi=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),Ui=P({taskSupport:ce(["required","optional","forbidden"]).optional()}),bn=P({...Rt.shape,...Vt.shape,description:l().optional(),inputSchema:P({type:O("object"),properties:K(l(),Dt).optional(),required:I(l()).optional()}).catchall(Q()),outputSchema:re({$schema:l().optional()}).optional(),annotations:Zi.optional(),execution:Ui.optional(),_meta:K(l(),Q()).optional()}),Vi=Ft.extend({method:O("tools/list")}),Fi=Ht.extend({tools:I(bn)}),zn=Ce.extend({content:I(Yr).default([]),structuredContent:Q().optional(),isError:H().optional()}),Ju=zn.or(Ce.extend({toolResult:Q()})),Hi=hr.extend({name:l(),arguments:K(l(),Q()).optional()}),Ji=Te.extend({method:O("tools/call"),params:Hi}),Bi=He.extend({method:O("notifications/tools/list_changed"),params:Fe.optional()}),Bu=P({autoRefresh:H().default(!0),debounceMs:L().int().nonnegative().default(300)}),Bt=ce(["debug","info","notice","warning","error","critical","alert","emergency"]),Ki=Le.extend({level:Bt}),Gi=Te.extend({method:O("logging/setLevel"),params:Ki}),Wi=Fe.extend({level:Bt,logger:l().optional(),data:Q()}),Yi=He.extend({method:O("notifications/message"),params:Wi}),Xi=P({name:l().optional()}),Qi=P({hints:I(Xi).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),ea=P({mode:ce(["auto","required","none"]).optional()}),ta=P({type:O("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:I(Yr),structuredContent:Q().optional(),isError:H().optional(),_meta:K(l(),Q()).optional()}),ra=Lt("type",[Kr,Gr,Wr]),dr=Lt("type",[Kr,Gr,Wr,xi,ta]),oa=P({role:Jt,content:W([dr,I(dr)]),_meta:K(l(),Q()).optional()}),na=hr.extend({messages:I(oa),modelPreferences:Qi.optional(),systemPrompt:l().optional(),includeContext:ce(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:Ee.optional(),tools:I(bn).optional(),toolChoice:ea.optional()}),sa=Te.extend({method:O("sampling/createMessage"),params:na}),ia=Ce.extend({model:l(),stopReason:X(ce(["endTurn","stopSequence","maxTokens"]).or(l())),role:Jt,content:ra}),aa=Ce.extend({model:l(),stopReason:X(ce(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:Jt,content:W([dr,I(dr)])}),Rn=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),Xr=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:ce(["email","uri","date","date-time"]).optional(),default:l().optional()}),Qr=P({type:ce(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),$n=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),wn=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),Pn=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),ca=W([$n,wn]),En=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({type:O("string"),enum:I(l())}),default:I(l()).optional()}),Tn=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({anyOf:I(P({const:l(),title:l()}))}),default:I(l()).optional()}),ua=W([En,Tn]),la=W([Pn,ca,ua]),Cn=W([la,Rn,Xr,Qr]),eo=hr.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),Cn),required:I(l()).optional()}).catchall(Q())}),da=hr.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),pa=W([eo,da]),ma=Te.extend({method:O("elicitation/create"),params:pa}),fa=Fe.extend({elicitationId:l()}),ha=He.extend({method:O("notifications/elicitation/complete"),params:fa}),ga=Ce.extend({action:ce(["accept","decline","cancel"]),content:lr(e=>e===null?void 0:e,K(l(),W([l(),L(),H(),I(l())])).optional())}),_a=P({type:O("ref/resource"),uri:l()}),Sa=P({type:O("ref/prompt"),name:l()}),ya=Le.extend({ref:W([Sa,_a]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),va=Te.extend({method:O("completion/complete"),params:ya}),ba=Ce.extend({completion:re({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),za=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),Ra=Te.extend({method:O("roots/list"),params:Le.optional()}),$a=Ce.extend({roots:I(za)}),wa=He.extend({method:O("notifications/roots/list_changed"),params:Fe.optional()}),Ku=re({ttl:L().optional(),pollInterval:L().optional()}),Pa=ce(["working","input_required","completed","failed","cancelled"]),Kt=P({taskId:l(),status:Pa,ttl:W([L(),ur()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),Gu=Ce.extend({task:Kt}),Ea=Fe.merge(Kt),Wu=He.extend({method:O("notifications/tasks/status"),params:Ea}),Yu=Te.extend({method:O("tasks/get"),params:Le.extend({taskId:l()})}),Xu=Ce.merge(Kt),Qu=Te.extend({method:O("tasks/result"),params:Le.extend({taskId:l()})}),el=Ce.loose(),tl=Ft.extend({method:O("tasks/list")}),rl=Ht.extend({tasks:I(Kt)}),ol=Te.extend({method:O("tasks/cancel"),params:Le.extend({taskId:l()})}),nl=Ce.merge(Kt),sl=W([fn,ei,oi,va,Gi,ji,Ii,ui,di,fi,Si,vi,zi,Ji,Vi]),il=W([pn,hn,ri,wa]),al=W([dn,ia,aa,ga,$a]),cl=W([fn,sa,ma,Ra]),ul=W([pn,hn,Yi,Ti,gi,Bi,Di,$i,ha]),ll=W([dn,ti,ni,ba,Li,Oi,li,pi,hi,zn,Fi,Pi]),Me=Zs().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Gh.custom,message:"URL must be parseable",fatal:!0}),$c}).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"}),dl=re({resource:l().url(),authorization_servers:I(Me).optional(),jwks_uri:l().url().optional(),scopes_supported:I(l()).optional(),bearer_methods_supported:I(l()).optional(),resource_signing_alg_values_supported:I(l()).optional(),resource_name:l().optional(),resource_documentation:l().optional(),resource_policy_uri:l().url().optional(),resource_tos_uri:l().url().optional(),tls_client_certificate_bound_access_tokens:H().optional(),authorization_details_types_supported:I(l()).optional(),dpop_signing_alg_values_supported:I(l()).optional(),dpop_bound_access_tokens_required:H().optional()}),Ta=re({issuer:l(),authorization_endpoint:Me,token_endpoint:Me,registration_endpoint:Me.optional(),scopes_supported:I(l()).optional(),response_types_supported:I(l()),response_modes_supported:I(l()).optional(),grant_types_supported:I(l()).optional(),token_endpoint_auth_methods_supported:I(l()).optional(),token_endpoint_auth_signing_alg_values_supported:I(l()).optional(),service_documentation:Me.optional(),revocation_endpoint:Me.optional(),revocation_endpoint_auth_methods_supported:I(l()).optional(),revocation_endpoint_auth_signing_alg_values_supported:I(l()).optional(),introspection_endpoint:l().optional(),introspection_endpoint_auth_methods_supported:I(l()).optional(),introspection_endpoint_auth_signing_alg_values_supported:I(l()).optional(),code_challenge_methods_supported:I(l()).optional(),client_id_metadata_document_supported:H().optional(),authorization_response_iss_parameter_supported:H().optional().catch(void 0),dpop_signing_alg_values_supported:I(l()).optional()}),Ca=re({issuer:l(),authorization_endpoint:Me,token_endpoint:Me,userinfo_endpoint:Me.optional(),jwks_uri:Me,registration_endpoint:Me.optional(),scopes_supported:I(l()).optional(),response_types_supported:I(l()),response_modes_supported:I(l()).optional(),grant_types_supported:I(l()).optional(),acr_values_supported:I(l()).optional(),subject_types_supported:I(l()),id_token_signing_alg_values_supported:I(l()),id_token_encryption_alg_values_supported:I(l()).optional(),id_token_encryption_enc_values_supported:I(l()).optional(),userinfo_signing_alg_values_supported:I(l()).optional(),userinfo_encryption_alg_values_supported:I(l()).optional(),userinfo_encryption_enc_values_supported:I(l()).optional(),request_object_signing_alg_values_supported:I(l()).optional(),request_object_encryption_alg_values_supported:I(l()).optional(),request_object_encryption_enc_values_supported:I(l()).optional(),token_endpoint_auth_methods_supported:I(l()).optional(),token_endpoint_auth_signing_alg_values_supported:I(l()).optional(),display_values_supported:I(l()).optional(),claim_types_supported:I(l()).optional(),claims_supported:I(l()).optional(),service_documentation:l().optional(),claims_locales_supported:I(l()).optional(),ui_locales_supported:I(l()).optional(),claims_parameter_supported:H().optional(),request_parameter_supported:H().optional(),request_uri_parameter_supported:H().optional(),require_request_uri_registration:H().optional(),op_policy_uri:Me.optional(),op_tos_uri:Me.optional(),client_id_metadata_document_supported:H().optional(),authorization_response_iss_parameter_supported:H().optional().catch(void 0)}),pl=P({...Ca.shape,...Ta.pick({code_challenge_methods_supported:!0}).shape}),ml=P({access_token:l(),id_token:l().optional(),token_type:l(),expires_in:Vs.number().optional(),scope:l().optional(),refresh_token:l().optional(),issuer:l().optional().catch(void 0)}).strip(),fl=P({issued_token_type:O("urn:ietf:params:oauth:token-type:id-jag"),access_token:l(),token_type:l().optional(),expires_in:L().optional(),scope:l().optional()}).strip(),hl=P({error:l(),error_description:l().optional(),error_uri:l().optional()}),Uu=Me.optional().or(O("").transform(()=>{})),ka=P({redirect_uris:I(Me),token_endpoint_auth_method:l().optional(),grant_types:I(l()).optional(),response_types:I(l()).optional(),application_type:l().optional(),client_name:l().optional(),client_uri:Me.optional(),logo_uri:Uu,scope:l().optional(),contacts:I(l()).optional(),tos_uri:Uu,policy_uri:l().optional(),jwks_uri:Me.optional(),jwks:Lh().optional(),software_id:l().optional(),software_version:l().optional(),software_statement:l().optional()}).strip(),Ia=P({client_id:l(),client_secret:l().optional(),client_id_issued_at:L().optional(),client_secret_expires_at:L().optional(),issuer:l().optional().catch(void 0)}).strip(),gl=ka.merge(Ia),_l=P({error:l(),error_description:l().optional()}).strip(),Sl=P({token:l(),token_type_hint:l().optional()}).strip();var zl=Symbol.for("mcp.sdk.errorBrands");function Pl(e,t){let r=new Set,o=t;for(;typeof o=="function";){let n=o.mcpBrand;Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof n=="string"&&r.add(n),o=Object.getPrototypeOf(o)}r.size!==0&&Object.defineProperty(e,zl,{value:r,enumerable:!1,configurable:!0})}function ro(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,zl)){let r=t[zl];if(r&&typeof r.has=="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var _g=class Sg extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return ro(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return ro(this,t)}constructor(t,r,o){super(r),this.code=t,this.errorUri=o,this.name="OAuthError",Pl(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}static fromResponse(t){return new Sg(t.error,t.error_description??t.error,t.error_uri)}},me=(function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e})({}),ue=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return ro(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return ro(this,e)}constructor(e,t,r,o){super(t,o),this.code=e,this.data=r,this.name="SdkError",Pl(this,new.target)}},jv=class extends ue{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r,o){super(e,t,r,o),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function sg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function xv(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function yg(e){switch(e.method){case"elicitation/create":return e.params?.mode==="url"?{elicitation:{url:{}}}:{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;return t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0)?{sampling:{tools:{}}}:{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function La(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(sg(n)&&sg(s)){let i={};for(let[c,a]of Object.entries(n))a!==void 0&&s[c]===void 0&&!xv(o,c,s)&&(i[c]=a);Object.keys(i).length>0&&(r[o]=i)}}return Object.keys(r).length>0?r:void 0}var Av="2026-07-28";function xn(e){return e>=Av}function vg(e){return e.filter(t=>!xn(t))}function El(e){return e.filter(t=>xn(t))}function bg(e){let t=e.structuredContent;return t===void 0||!(typeof t!="object"||t===null||Array.isArray(t))||(e.content?.some(r=>r.type==="text")??!1)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var zg=["task","inputRequests","requestState"];function Tl(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||zg.some(t=>t in e)?e:{...e,content:[]}}function qv(){let e=tn(()=>W([l(),L(),H(),ur(),K(l(),e),I(e)])),t=K(l(),e),r=W([l(),L().int()]),o=l(),n=P({ttl:L().optional()}),s=P({taskId:l()}),i=re({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),c=P({_meta:i.optional()}),a=c.extend({task:n.optional()}),u=P({method:l(),params:c.loose().optional()}),d=P({_meta:i.optional()}),m=P({method:l(),params:d.loose().optional()}),g=re({_meta:i.optional()}),v=W([l(),L().int()]),p=g.strict(),_=d.extend({requestId:v.optional(),reason:l().optional()}),h=m.extend({method:O("notifications/cancelled"),params:_}),f=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:ce(["light","dark"]).optional()}),z=P({icons:I(f).optional()}),y=P({name:l(),title:l().optional()}),R=y.extend({...y.shape,...z.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),w=bt(P({applyDefaults:H().optional()}),t),b=lr(Ve=>Ve&&typeof Ve=="object"&&!Array.isArray(Ve)&&Object.keys(Ve).length===0?{form:{}}:Ve,bt(P({form:w.optional(),url:t.optional()}),t.optional())),S=re({list:t.optional(),cancel:t.optional(),requests:re({sampling:re({createMessage:t.optional()}).optional(),elicitation:re({create:t.optional()}).optional()}).optional()}),E=re({list:t.optional(),cancel:t.optional(),requests:re({tools:re({call:t.optional()}).optional()}).optional()}),j=P({experimental:K(l(),t).optional(),sampling:P({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:P({listChanged:H().optional()}).optional(),tasks:S.optional(),extensions:K(l(),t).optional()}),F=c.extend({protocolVersion:l(),capabilities:j,clientInfo:R}),M=u.extend({method:O("initialize"),params:F}),Z=P({experimental:K(l(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:P({listChanged:H().optional()}).optional(),resources:P({subscribe:H().optional(),listChanged:H().optional()}).optional(),tools:P({listChanged:H().optional()}).optional(),tasks:E.optional(),extensions:K(l(),t).optional()}),Y=g.extend({protocolVersion:l(),capabilities:Z,serverInfo:R,instructions:l().optional()}),G=m.extend({method:O("notifications/initialized"),params:d.optional()}),fe=u.extend({method:O("ping"),params:c.optional()}),$e=P({progress:L(),total:X(L()),message:X(l())}),be=P({...d.shape,...$e.shape,progressToken:r}),Oe=m.extend({method:O("notifications/progress"),params:be}),he=c.extend({cursor:o.optional()}),k=u.extend({params:he.optional()}),x=g.extend({nextCursor:o.optional()}),V=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),$=V.extend({text:l()}),C=l().refine(Ve=>{try{return atob(Ve),!0}catch{return!1}},{message:"Invalid Base64 string"}),N=V.extend({blob:C}),J=ce(["user","assistant"]),ee=P({audience:I(J).optional(),priority:L().min(0).max(1).optional(),lastModified:zt.datetime({offset:!0}).optional()}),pe=P({...y.shape,...z.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:ee.optional(),_meta:X(re({}))}),ie=P({...y.shape,...z.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:ee.optional(),_meta:X(re({}))}),ze=k.extend({method:O("resources/list")}),Je=x.extend({resources:I(pe)}),T=k.extend({method:O("resources/templates/list")}),A=x.extend({resourceTemplates:I(ie)}),D=c.extend({uri:l()}),ne=D,se=u.extend({method:O("resources/read"),params:ne}),de=g.extend({contents:I(W([$,N]))}),ke=m.extend({method:O("notifications/resources/list_changed"),params:d.optional()}),je=D,Ze=u.extend({method:O("resources/subscribe"),params:je}),Ne=D,we=u.extend({method:O("resources/unsubscribe"),params:Ne}),ot=d.extend({uri:l()}),Ae=m.extend({method:O("notifications/resources/updated"),params:ot}),mt=P({name:l(),description:X(l()),required:X(H())}),it=P({...y.shape,...z.shape,description:X(l()),arguments:X(I(mt)),_meta:X(re({}))}),ft=k.extend({method:O("prompts/list")}),Tt=x.extend({prompts:I(it)}),Ct=c.extend({name:l(),arguments:K(l(),l()).optional()}),Wt=u.extend({method:O("prompts/get"),params:Ct}),Yt=P({type:O("text"),text:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),Xt=P({type:O("image"),data:C,mimeType:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),Qt=P({type:O("audio"),data:C,mimeType:l(),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),ao=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),kt=P({type:O("resource"),resource:W([$,N]),annotations:ee.optional(),_meta:K(l(),Q()).optional()}),co=pe.extend({type:O("resource_link")}),nt=W([Yt,Xt,Qt,co,kt]),Sr=P({role:J,content:nt}),yr=g.extend({description:l().optional(),messages:I(Sr)}),er=m.extend({method:O("notifications/prompts/list_changed"),params:d.optional()}),uo=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),vr=P({taskSupport:ce(["required","optional","forbidden"]).optional()}),tr=P({...y.shape,...z.shape,description:l().optional(),inputSchema:P({type:O("object"),properties:K(l(),e).optional(),required:I(l()).optional()}).catchall(Q()),outputSchema:P({type:O("object"),properties:K(l(),e).optional(),required:I(l()).optional()}).catchall(Q()).optional(),annotations:uo.optional(),execution:vr.optional(),_meta:K(l(),Q()).optional()}),br=k.extend({method:O("tools/list")}),zr=x.extend({tools:I(tr)}),Rr=g.extend({content:I(nt),structuredContent:K(l(),Q()).optional(),isError:H().optional()}),Ue=a.extend({name:l(),arguments:K(l(),Q()).optional()}),lo=u.extend({method:O("tools/call"),params:Ue}),Zn=m.extend({method:O("notifications/tools/list_changed"),params:d.optional()}),$r=ce(["debug","info","notice","warning","error","critical","alert","emergency"]),po=c.extend({level:$r}),mo=u.extend({method:O("logging/setLevel"),params:po}),fo=d.extend({level:$r,logger:l().optional(),data:Q()}),ho=m.extend({method:O("notifications/message"),params:fo}),go=P({name:l().optional()}),_o=P({hints:I(go).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),So=P({mode:ce(["auto","required","none"]).optional()}),Un=P({type:O("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:I(nt),structuredContent:P({}).loose().optional(),isError:H().optional(),_meta:K(l(),Q()).optional()}),yo=Lt("type",[Yt,Xt,Qt]),It=Lt("type",[Yt,Xt,Qt,ao,Un]),vo=P({role:J,content:W([It,I(It)]),_meta:K(l(),Q()).optional()}),bo=a.extend({messages:I(vo),modelPreferences:_o.optional(),systemPrompt:l().optional(),includeContext:ce(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(tr).optional(),toolChoice:So.optional()}),zo=u.extend({method:O("sampling/createMessage"),params:bo}),Ro=g.extend({model:l(),stopReason:X(ce(["endTurn","stopSequence","maxTokens"]).or(l())),role:J,content:yo}),$o=g.extend({model:l(),stopReason:X(ce(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:J,content:W([It,I(It)])}),wo=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),Po=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:ce(["email","uri","date","date-time"]).optional(),default:l().optional()}),Eo=P({type:ce(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),To=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),Co=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),ko=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),Io=W([To,Co]),rr=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({type:O("string"),enum:I(l())}),default:I(l()).optional()}),or=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({anyOf:I(P({const:l(),title:l()}))}),default:I(l()).optional()}),Vn=W([rr,or]),Fn=W([ko,Io,Vn]),et=W([Fn,wo,Po,Eo]),tt=a.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),et),required:I(l()).optional()}).catchall(Q())}),Oo=a.extend({mode:O("url"),message:l(),elicitationId:l(),url:l().url()}),at=W([tt,Oo]),Hn=u.extend({method:O("elicitation/create"),params:at}),Jn=d.extend({elicitationId:l()}),Bn=m.extend({method:O("notifications/elicitation/complete"),params:Jn}),Kn=g.extend({action:ce(["accept","decline","cancel"]),content:lr(Ve=>Ve===null?void 0:Ve,K(l(),W([l(),L(),H(),I(l())])).optional())}),Gn=P({type:O("ref/resource"),uri:l()}),Wn=P({type:O("ref/prompt"),name:l()}),Yn=c.extend({ref:W([Wn,Gn]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()}),No=u.extend({method:O("completion/complete"),params:Yn}),Xn=g.extend({completion:re({values:I(l()).max(100),total:X(L().int()),hasMore:X(H())})}),Qn=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),wr=u.extend({method:O("roots/list"),params:c.optional()}),jo=g.extend({roots:I(Qn)}),es=m.extend({method:O("notifications/roots/list_changed"),params:d.optional()}),ts=re({ttl:L().optional(),pollInterval:L().optional()}),xo=ce(["working","input_required","completed","failed","cancelled"]),Ot=P({taskId:l(),status:xo,ttl:W([L(),ur()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:X(L()),statusMessage:X(l())}),We=g.extend({task:Ot}),rs=d.merge(Ot),nr=m.extend({method:O("notifications/tasks/status"),params:rs}),Pr=u.extend({method:O("tasks/get"),params:c.extend({taskId:l()})}),Er=g.merge(Ot),Tr=u.extend({method:O("tasks/result"),params:c.extend({taskId:l()})}),sc=g.loose(),Be=k.extend({method:O("tasks/list")}),Ie=x.extend({tasks:I(Ot)}),sr=u.extend({method:O("tasks/cancel"),params:c.extend({taskId:l()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:c,TaskAugmentedRequestParamsSchema:a,RequestSchema:u,NotificationsParamsSchema:d,NotificationSchema:m,ResultSchema:g,RequestIdSchema:v,EmptyResultSchema:p,CancelledNotificationParamsSchema:_,CancelledNotificationSchema:h,IconSchema:f,IconsSchema:z,BaseMetadataSchema:y,ImplementationSchema:R,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:E,ClientCapabilitiesSchema:j,InitializeRequestParamsSchema:F,InitializeRequestSchema:M,ServerCapabilitiesSchema:Z,InitializeResultSchema:Y,InitializedNotificationSchema:G,PingRequestSchema:fe,ProgressSchema:$e,ProgressNotificationParamsSchema:be,ProgressNotificationSchema:Oe,PaginatedRequestParamsSchema:he,PaginatedRequestSchema:k,PaginatedResultSchema:x,ResourceContentsSchema:V,TextResourceContentsSchema:$,BlobResourceContentsSchema:N,RoleSchema:J,AnnotationsSchema:ee,ResourceSchema:pe,ResourceTemplateSchema:ie,ListResourcesRequestSchema:ze,ListResourcesResultSchema:Je,ListResourceTemplatesRequestSchema:T,ListResourceTemplatesResultSchema:A,ResourceRequestParamsSchema:D,ReadResourceRequestParamsSchema:ne,ReadResourceRequestSchema:se,ReadResourceResultSchema:de,ResourceListChangedNotificationSchema:ke,SubscribeRequestParamsSchema:je,SubscribeRequestSchema:Ze,UnsubscribeRequestParamsSchema:Ne,UnsubscribeRequestSchema:we,ResourceUpdatedNotificationParamsSchema:ot,ResourceUpdatedNotificationSchema:Ae,PromptArgumentSchema:mt,PromptSchema:it,ListPromptsRequestSchema:ft,ListPromptsResultSchema:Tt,GetPromptRequestParamsSchema:Ct,GetPromptRequestSchema:Wt,TextContentSchema:Yt,ImageContentSchema:Xt,AudioContentSchema:Qt,ToolUseContentSchema:ao,EmbeddedResourceSchema:kt,ResourceLinkSchema:co,ContentBlockSchema:nt,PromptMessageSchema:Sr,GetPromptResultSchema:yr,PromptListChangedNotificationSchema:er,ToolAnnotationsSchema:uo,ToolExecutionSchema:vr,ToolSchema:tr,ListToolsRequestSchema:br,ListToolsResultSchema:zr,CallToolResultSchema:Rr,CallToolRequestParamsSchema:Ue,CallToolRequestSchema:lo,ToolListChangedNotificationSchema:Zn,LoggingLevelSchema:$r,SetLevelRequestParamsSchema:po,SetLevelRequestSchema:mo,LoggingMessageNotificationParamsSchema:fo,LoggingMessageNotificationSchema:ho,ModelHintSchema:go,ModelPreferencesSchema:_o,ToolChoiceSchema:So,ToolResultContentSchema:Un,SamplingContentSchema:yo,SamplingMessageContentBlockSchema:It,SamplingMessageSchema:vo,CreateMessageRequestParamsSchema:bo,CreateMessageRequestSchema:zo,CreateMessageResultSchema:Ro,CreateMessageResultWithToolsSchema:$o,BooleanSchemaSchema:wo,StringSchemaSchema:Po,NumberSchemaSchema:Eo,UntitledSingleSelectEnumSchemaSchema:To,TitledSingleSelectEnumSchemaSchema:Co,LegacyTitledEnumSchemaSchema:ko,SingleSelectEnumSchemaSchema:Io,UntitledMultiSelectEnumSchemaSchema:rr,TitledMultiSelectEnumSchemaSchema:or,MultiSelectEnumSchemaSchema:Vn,EnumSchemaSchema:Fn,PrimitiveSchemaDefinitionSchema:et,ElicitRequestFormParamsSchema:tt,ElicitRequestURLParamsSchema:Oo,ElicitRequestParamsSchema:at,ElicitRequestSchema:Hn,ElicitationCompleteNotificationParamsSchema:Jn,ElicitationCompleteNotificationSchema:Bn,ElicitResultSchema:Kn,ResourceTemplateReferenceSchema:Gn,PromptReferenceSchema:Wn,CompleteRequestParamsSchema:Yn,CompleteRequestSchema:No,CompleteResultSchema:Xn,RootSchema:Qn,ListRootsRequestSchema:wr,ListRootsResultSchema:jo,RootsListChangedNotificationSchema:es,TaskCreationParamsSchema:ts,TaskStatusSchema:xo,TaskSchema:Ot,CreateTaskResultSchema:We,TaskStatusNotificationParamsSchema:rs,TaskStatusNotificationSchema:nr,GetTaskRequestSchema:Pr,GetTaskResultSchema:Er,GetTaskPayloadRequestSchema:Tr,GetTaskPayloadResultSchema:sc,ListTasksRequestSchema:Be,ListTasksResultSchema:Ie,CancelTaskRequestSchema:sr,CancelTaskResultSchema:g.merge(Ot),ClientRequestSchema:W([fe,M,No,mo,Wt,ft,ze,T,se,Ze,we,lo,br,Pr,Tr,Be,sr]),ClientNotificationSchema:W([h,Oe,G,es,nr]),ClientResultSchema:W([p,Ro,$o,Kn,jo,Er,Ie,We]),ServerRequestSchema:W([fe,zo,Hn,wr,Pr,Tr,Be,sr]),ServerNotificationSchema:W([h,Oe,ho,Ae,ke,Zn,er,nr,Bn]),ServerResultSchema:W([p,Y,Xn,yr,Tt,Je,A,de,Rr,zr,Er,Ie,We]),CallToolResultWireSchema:Q().superRefine((Ve,eS)=>{if(!(typeof Ve!="object"||Ve===null||Array.isArray(Ve)||Ve.content!==void 0)){for(let cd of zg)if(cd in Ve){eS.addIssue({code:"custom",message:`content is required when the body carries '${cd}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Tl).pipe(Rr)}}var Mv;function Rg(){return Mv??=qv()}function $g(e){return e.type!=="object"}var Lv=new Set(["const","enum","default","examples"]),Dv=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function ig(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Zv(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(ig(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=wd(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,s)=>{if(Array.isArray(n))return n.map(a=>o(a,!1));if(n===null||typeof n!="object"||!s&&ig(n.$id))return n;let i={},c=!1;for(let[a,u]of Object.entries(n))s?i[a]=o(u,!1):(a==="$ref"||a==="$dynamicRef")&&typeof u=="string"?i[a]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u:a==="$recursiveRef"&&u==="#"&&r?c=!0:Lv.has(a)?i[a]=u:Dv.has(a)?i[a]=o(u,!0):i[a]=o(u,!1);return c&&("$ref"in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:"#/properties/result"}]:i.$ref="#/properties/result"),i};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var wg={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},Pg={"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},Uv={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},Oa;function Cl(){if(Oa)return Oa;let e=Rg();return Oa={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}},Oa}function Eg(e){return Object.prototype.hasOwnProperty.call(wg,e)}function Tg(e){return Object.prototype.hasOwnProperty.call(Pg,e)}function Vv(e){return Object.prototype.hasOwnProperty.call(Uv,e)}function Fv(e){return Vv(e)?Cl().resultSchemas[e]:void 0}function Hv(e){return Eg(e)?Cl().requestSchemas[e]:void 0}function Jv(e){return Tg(e)?Cl().notificationSchemas[e]:void 0}var Pw=Object.keys(wg),Ew=Object.keys(Pg);function Rl(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Na(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 ag={ok:!1,reason:"not-in-era"};function cg(e){return Rl(e)&&Rl(e.outputSchema)&&$g(e.outputSchema)}var kl={era:"2025-11-25",hasRequestMethod:Eg,hasNotificationMethod:Tg,validateRequest:(e,t)=>Na(Hv(e),t),validateResult:(e,t)=>Na(Fv(e),t),validateNotification:(e,t)=>Na(Jv(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>ag,validateInputResponse:()=>ag,samplingResultVariant:((e,t)=>{let r=Rg();return Na(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=bg(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!="object"||o===null||Array.isArray(o),s=t!==void 0&&$g(t);return!n&&!s?r:{...r,structuredContent:{result:o}}},decodeResult(e,t){if(Rl(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:r}}return{kind:"complete",result:t}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;return!Array.isArray(r)||!r.some(o=>cg(o))?t:{...t,tools:r.map(o=>cg(o)?{...o,outputSchema:Zv(o.outputSchema)}:o)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function Bv(){let e=tn(()=>W([l(),L(),H(),ur(),K(l(),e),I(e)])),t=K(l(),e),r=W([l(),L().int()]),o=l(),n=W([l(),L().int()]),s=ce(["user","assistant"]),i=ce(["debug","info","notice","warning","error","critical","alert","emergency"]),c=l().refine(Ie=>{try{return atob(Ie),!0}catch{return!1}},{message:"Invalid Base64 string"}),a=P({ttl:L().optional()}),u=P({taskId:l()}),d=re({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),m=P({_meta:d.optional()}),g=m.extend({task:a.optional()}),v=P({_meta:d.optional()}),p=P({method:l(),params:v.loose().optional()}),_=P({src:l(),mimeType:l().optional(),sizes:I(l()).optional(),theme:ce(["light","dark"]).optional()}),h=P({icons:I(_).optional()}),f=P({name:l(),title:l().optional()}),z=f.extend({...f.shape,...h.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),y=bt(P({applyDefaults:H().optional()}),t),R=lr(Ie=>Ie&&typeof Ie=="object"&&!Array.isArray(Ie)&&Object.keys(Ie).length===0?{form:{}}:Ie,bt(P({form:y.optional(),url:t.optional()}),t.optional())),w=re({list:t.optional(),cancel:t.optional(),requests:re({sampling:re({createMessage:t.optional()}).optional(),elicitation:re({create:t.optional()}).optional()}).optional()}),b=re({list:t.optional(),cancel:t.optional(),requests:re({tools:re({call:t.optional()}).optional()}).optional()}),S=P({experimental:K(l(),t).optional(),sampling:P({context:t.optional(),tools:t.optional()}).optional(),elicitation:R.optional(),roots:P({listChanged:H().optional()}).optional(),tasks:w.optional(),extensions:K(l(),t).optional()}),E=P({experimental:K(l(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:P({listChanged:H().optional()}).optional(),resources:P({subscribe:H().optional(),listChanged:H().optional()}).optional(),tools:P({listChanged:H().optional()}).optional(),tasks:b.optional(),extensions:K(l(),t).optional()}),j=P({progress:L(),total:X(L()),message:X(l())}),F=P({...v.shape,...j.shape,progressToken:r}),M=p.extend({method:O("notifications/progress"),params:F}),Z=v.extend({level:i,logger:l().optional(),data:Q()}),Y=p.extend({method:O("notifications/message"),params:Z}),G=P({uri:l(),mimeType:X(l()),_meta:K(l(),Q()).optional()}),fe=G.extend({text:l()}),$e=G.extend({blob:c}),be=P({audience:I(s).optional(),priority:L().min(0).max(1).optional(),lastModified:zt.datetime({offset:!0}).optional()}),Oe=P({...f.shape,...h.shape,uri:l(),description:X(l()),mimeType:X(l()),size:X(L()),annotations:be.optional(),_meta:X(re({}))}),he=P({...f.shape,...h.shape,uriTemplate:l(),description:X(l()),mimeType:X(l()),annotations:be.optional(),_meta:X(re({}))}),k=p.extend({method:O("notifications/resources/list_changed"),params:v.optional()}),x=v.extend({uri:l()}),V=p.extend({method:O("notifications/resources/updated"),params:x}),$=P({name:l(),description:X(l()),required:X(H())}),C=P({...f.shape,...h.shape,description:X(l()),arguments:X(I($)),_meta:X(re({}))}),N=p.extend({method:O("notifications/prompts/list_changed"),params:v.optional()}),J=P({type:O("text"),text:l(),annotations:be.optional(),_meta:K(l(),Q()).optional()}),ee=P({type:O("image"),data:c,mimeType:l(),annotations:be.optional(),_meta:K(l(),Q()).optional()}),pe=P({type:O("audio"),data:c,mimeType:l(),annotations:be.optional(),_meta:K(l(),Q()).optional()}),ie=P({type:O("tool_use"),name:l(),id:l(),input:K(l(),Q()),_meta:K(l(),Q()).optional()}),ze=P({type:O("resource"),resource:W([fe,$e]),annotations:be.optional(),_meta:K(l(),Q()).optional()}),Je=Oe.extend({type:O("resource_link")}),T=W([J,ee,pe,Je,ze]),A=P({role:s,content:T}),D=P({title:l().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),ne=p.extend({method:O("notifications/tools/list_changed"),params:v.optional()}),se=P({name:l().optional()}),de=P({hints:I(se).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),ke=P({mode:ce(["auto","required","none"]).optional()}),je=P({type:O("boolean"),title:l().optional(),description:l().optional(),default:H().optional()}),Ze=P({type:O("string"),title:l().optional(),description:l().optional(),minLength:L().optional(),maxLength:L().optional(),format:ce(["email","uri","date","date-time"]).optional(),default:l().optional()}),Ne=P({type:ce(["number","integer"]),title:l().optional(),description:l().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),we=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),default:l().optional()}),ot=P({type:O("string"),title:l().optional(),description:l().optional(),oneOf:I(P({const:l(),title:l()})),default:l().optional()}),Ae=P({type:O("string"),title:l().optional(),description:l().optional(),enum:I(l()),enumNames:I(l()).optional(),default:l().optional()}),mt=W([we,ot]),it=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({type:O("string"),enum:I(l())}),default:I(l()).optional()}),ft=P({type:O("array"),title:l().optional(),description:l().optional(),minItems:L().optional(),maxItems:L().optional(),items:P({anyOf:I(P({const:l(),title:l()}))}),default:I(l()).optional()}),Tt=W([it,ft]),Ct=W([Ae,mt,Tt]),Wt=W([Ct,je,Ze,Ne]),Yt=g.extend({mode:O("form").optional(),message:l(),requestedSchema:P({type:O("object"),properties:K(l(),Wt),required:I(l()).optional()}).catchall(Q())}),Xt=P({type:O("ref/resource"),uri:l()}),Qt=P({type:O("ref/prompt"),name:l()}),ao=P({uri:l().startsWith("file://"),name:l().optional(),_meta:K(l(),Q()).optional()}),kt=S.shape,co=P({experimental:kt.experimental,sampling:kt.sampling,elicitation:kt.elicitation,roots:kt.roots,extensions:kt.extensions}),nt=E.shape,Sr=P({experimental:nt.experimental,logging:nt.logging,completions:nt.completions,prompts:nt.prompts,resources:nt.resources,tools:nt.tools,extensions:nt.extensions}),yr=re({progressToken:r.optional(),[mr]:l(),[Vr]:z.optional(),[wt]:co,[Zt]:i.optional()}),er=P({...f.shape,...h.shape,description:l().optional(),inputSchema:re({$schema:l().optional(),type:O("object")}),outputSchema:re({$schema:l().optional()}).optional(),annotations:D.optional(),_meta:K(l(),Q()).optional()}),uo=P({type:O("tool_result"),toolUseId:l(),content:I(T),structuredContent:Q().optional(),isError:H().optional(),_meta:K(l(),Q()).optional()}),vr=W([J,ee,pe,ie,uo]),tr=P({role:s,content:W([vr,I(vr)]),_meta:K(l(),Q()).optional()}),br=l(),zr=re({[$t]:z.optional().catch(void 0)}),Rr=zr.optional();function Ue(Ie){return re({_meta:Rr,resultType:br.default("complete"),...Ie})}let lo=Ue({}),Zn=Ue({nextCursor:o.optional()}),$r=Ue({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),po=Ue({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),tools:I(er),nextCursor:o.optional()}),mo=Ue({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),prompts:I(C),nextCursor:o.optional()}),fo=Ue({description:l().optional(),messages:I(A)}),ho=Ue({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),go=Ue({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),_o=Ue({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),contents:I(W([fe,$e]))}),So=Ue({completion:P({values:I(l()).max(100),total:L().int().optional(),hasMore:H().optional()}).loose()}),Un=Ue({ttlMs:L().int().min(0),cacheScope:ce(["public","private"])}),yo=Ue({ttlMs:L().int().min(0).catch(0),cacheScope:ce(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:Sr,instructions:l().optional()}),It=P({messages:I(tr),modelPreferences:de.optional(),systemPrompt:l().optional(),includeContext:ce(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(l()).optional(),metadata:t.optional(),tools:I(er).optional(),toolChoice:ke.optional()}),vo=P({method:O("sampling/createMessage"),params:It}),bo=P({method:O("roots/list"),params:P({_meta:K(l(),Q()).optional()}).optional()}),zo=P({...tr.shape,model:l(),stopReason:l().optional()}),Ro=P({roots:I(ao)}),$o=P({action:ce(["accept","decline","cancel"]),content:K(l(),W([l(),L(),H(),I(l())])).optional()}),wo=P({mode:O("url"),message:l(),url:l().url()}),Po=W([Yt,wo]),Eo=P({method:O("elicitation/create"),params:Po}),To=W([vo,bo,Eo]),Co=W([zo,Ro,$o]),ko=K(l(),To),Io=K(l(),Co),rr=Ue({inputRequests:ko.optional(),requestState:l().optional()}),or={inputResponses:Io.optional(),requestState:l().optional()},Vn=P({_meta:yr,...or}),Fn=re({progressToken:r.optional()});function et(Ie,sr){return P({method:O(Ie),params:P({_meta:yr,...sr})})}function tt(Ie,sr){return P({method:O(Ie),params:P({_meta:Fn.optional(),...sr}).optional()})}let Oo={name:l(),arguments:K(l(),Q()).optional(),...or},at={cursor:o.optional()},Hn=et("tools/call",Oo),Jn=et("tools/list",at),Bn=et("prompts/list",at),Kn=et("prompts/get",{name:l(),arguments:K(l(),l()).optional(),...or}),Gn=et("resources/list",at),Wn=et("resources/templates/list",at),Yn=et("resources/read",{uri:l(),...or}),No={ref:W([Qt,Xt]),argument:P({name:l(),value:l()}),context:P({arguments:K(l(),l()).optional()}).optional()},Xn=et("completion/complete",No),Qn=et("server/discover",{}),wr=P({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:I(l()).optional()}),jo={notifications:wr},es=et("subscriptions/listen",jo),ts=zr.extend({"io.modelcontextprotocol/subscriptionId":n}),xo=re({_meta:ts,resultType:br.default("complete")}),Ot={"tools/call":tt("tools/call",Oo),"tools/list":tt("tools/list",at),"prompts/get":tt("prompts/get",{name:l(),arguments:K(l(),l()).optional()}),"prompts/list":tt("prompts/list",at),"resources/list":tt("resources/list",at),"resources/templates/list":tt("resources/templates/list",at),"resources/read":tt("resources/read",{uri:l()}),"completion/complete":tt("completion/complete",No),"server/discover":tt("server/discover",{}),"subscriptions/listen":tt("subscriptions/listen",jo)};function We(Ie){return re({_meta:Rr,...Ie})}let rs={"tools/call":We({content:I(T),structuredContent:Q().optional(),isError:H().optional()}),"tools/list":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),tools:I(er),nextCursor:o.optional()}),"prompts/get":We({description:l().optional(),messages:I(A)}),"prompts/list":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),prompts:I(C),nextCursor:o.optional()}),"resources/list":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),resources:I(Oe),nextCursor:o.optional()}),"resources/templates/list":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),resourceTemplates:I(he),nextCursor:o.optional()}),"resources/read":We({ttlMs:L().int().min(0),cacheScope:ce(["public","private"]),contents:I(W([fe,$e]))}),"completion/complete":We({completion:P({values:I(l()).max(100),total:L().int().optional(),hasMore:H().optional()}).loose()}),"server/discover":We({ttlMs:L().int().min(0).catch(0),cacheScope:ce(["public","private"]).catch("private"),supportedVersions:I(l()),capabilities:Sr,instructions:l().optional()}),"subscriptions/listen":We({})},nr=re({"io.modelcontextprotocol/subscriptionId":n.optional()}),Pr=P({method:O("notifications/subscriptions/acknowledged"),params:P({_meta:nr.optional(),notifications:wr})}),Er=P({_meta:nr.optional(),requestId:n,reason:l().optional()}),Tr=P({method:O("notifications/cancelled"),params:Er}),sc={"notifications/cancelled":Tr,"notifications/progress":M,"notifications/message":Y,"notifications/resources/updated":V,"notifications/resources/list_changed":k,"notifications/tools/list_changed":ne,"notifications/prompts/list_changed":N,"notifications/subscriptions/acknowledged":Pr},Be=Ie=>P({jsonrpc:O("2.0"),id:W([l(),L().int()]),result:Ie}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:a,RelatedTaskMetadataSchema:u,RequestMetaSchema:d,BaseRequestParamsSchema:m,TaskAugmentedRequestParamsSchema:g,NotificationsParamsSchema:v,NotificationSchema:p,IconSchema:_,IconsSchema:h,BaseMetadataSchema:f,ImplementationSchema:z,ClientTasksCapabilitySchema:w,ServerTasksCapabilitySchema:b,ClientCapabilitiesSchema:S,ServerCapabilitiesSchema:E,ProgressSchema:j,ProgressNotificationParamsSchema:F,ProgressNotificationSchema:M,LoggingMessageNotificationParamsSchema:Z,LoggingMessageNotificationSchema:Y,ResourceContentsSchema:G,TextResourceContentsSchema:fe,BlobResourceContentsSchema:$e,AnnotationsSchema:be,ResourceSchema:Oe,ResourceTemplateSchema:he,ResourceListChangedNotificationSchema:k,ResourceUpdatedNotificationParamsSchema:x,ResourceUpdatedNotificationSchema:V,PromptArgumentSchema:$,PromptSchema:C,PromptListChangedNotificationSchema:N,TextContentSchema:J,ImageContentSchema:ee,AudioContentSchema:pe,ToolUseContentSchema:ie,EmbeddedResourceSchema:ze,ResourceLinkSchema:Je,ContentBlockSchema:T,PromptMessageSchema:A,ToolAnnotationsSchema:D,ToolListChangedNotificationSchema:ne,ModelHintSchema:se,ModelPreferencesSchema:de,ToolChoiceSchema:ke,BooleanSchemaSchema:je,StringSchemaSchema:Ze,NumberSchemaSchema:Ne,UntitledSingleSelectEnumSchemaSchema:we,TitledSingleSelectEnumSchemaSchema:ot,LegacyTitledEnumSchemaSchema:Ae,SingleSelectEnumSchemaSchema:mt,UntitledMultiSelectEnumSchemaSchema:it,TitledMultiSelectEnumSchemaSchema:ft,MultiSelectEnumSchemaSchema:Tt,EnumSchemaSchema:Ct,PrimitiveSchemaDefinitionSchema:Wt,ElicitRequestFormParamsSchema:Yt,ResourceTemplateReferenceSchema:Xt,PromptReferenceSchema:Qt,RootSchema:ao,ClientCapabilities2026Schema:co,ServerCapabilities2026Schema:Sr,RequestMetaEnvelopeSchema:yr,ToolSchema:er,ToolResultContentSchema:uo,SamplingMessageContentBlockSchema:vr,SamplingMessageSchema:tr,ResultTypeSchema:br,ResultMetaSchema:zr,ResultSchema:lo,PaginatedResultSchema:Zn,CallToolResultSchema:$r,ListToolsResultSchema:po,ListPromptsResultSchema:mo,GetPromptResultSchema:fo,ListResourcesResultSchema:ho,ListResourceTemplatesResultSchema:go,ReadResourceResultSchema:_o,CompleteResultSchema:So,CacheableResultSchema:Un,DiscoverResultSchema:yo,CreateMessageRequestParamsSchema:It,CreateMessageRequestSchema:vo,ListRootsRequestSchema:bo,CreateMessageResultSchema:zo,ListRootsResultSchema:Ro,ElicitResultSchema:$o,ElicitRequestURLParamsSchema:wo,ElicitRequestParamsSchema:Po,ElicitRequestSchema:Eo,InputRequestSchema:To,InputResponseSchema:Co,InputRequestsSchema:ko,InputResponsesSchema:Io,InputRequiredResultSchema:rr,InputResponseRequestParamsSchema:Vn,CallToolRequestSchema:Hn,ListToolsRequestSchema:Jn,ListPromptsRequestSchema:Bn,GetPromptRequestSchema:Kn,ListResourcesRequestSchema:Gn,ListResourceTemplatesRequestSchema:Wn,ReadResourceRequestSchema:Yn,CompleteRequestSchema:Xn,DiscoverRequestSchema:Qn,SubscriptionFilterSchema:wr,SubscriptionsListenRequestSchema:es,SubscriptionsListenResultMetaSchema:ts,SubscriptionsListenResultSchema:xo,dispatchRequestSchemas:Ot,dispatchResultSchemas:rs,NotificationMetaSchema:nr,SubscriptionsAcknowledgedNotificationSchema:Pr,CancelledNotificationParamsSchema:Er,CancelledNotificationSchema:Tr,notificationSchemas2026:sc,JSONRPCResultResponseSchema:Be(lo),CallToolResultResponseSchema:Be(W([$r,rr])),ListToolsResultResponseSchema:Be(po),ListPromptsResultResponseSchema:Be(mo),GetPromptResultResponseSchema:Be(W([fo,rr])),ListResourcesResultResponseSchema:Be(ho),ListResourceTemplatesResultResponseSchema:Be(go),ReadResourceResultResponseSchema:Be(W([_o,rr])),CompleteResultResponseSchema:Be(So),DiscoverResultResponseSchema:Be(yo),SubscriptionsListenResultResponseSchema:Be(xo)}}var Kv;function Gt(){return Kv??=Bv()}var Gv=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Wv(e){return Gv.includes(e)}var to=Symbol("modelcontextprotocol.resultCacheHintFallback");function Da(e,t){if(t===void 0)return e;let r=e[to];if(r===void 0)return{...e,[to]:t};let o={},n=r.ttlMs??t.ttlMs;n!==void 0&&(o.ttlMs=n);let s=r.cacheScope??t.cacheScope;return s!==void 0&&(o.cacheScope=s),{...e,[to]:o}}function Yv(e){return e[to]}function Il(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function Ol(e){return e==="public"||e==="private"}function Nl(e,t){if(e.ttlMs!==void 0&&!Il(e.ttlMs))throw new RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!Ol(e.cacheScope))throw new RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var B=(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})({}),oe=class Cg extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return ro(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return ro(this,t)}constructor(t,r,o){super(r),this.code=t,this.data=o,this.name="ProtocolError",Pl(this,new.target)}static fromError(t,r,o){if(t===B.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new kg(n.elicitations,r)}if(t===B.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new jl({supported:n.supported,requested:n.requested},r)}if(t===B.InvalidParams||t===B.ResourceNotFound){let n=o;if(typeof n?.uri=="string"&&(t===B.ResourceNotFound||Object.keys(n).length===1))return new Za(n.uri,r)}if(t===B.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new Ua({requiredCapabilities:n.requiredCapabilities},r)}return new Cg(t,r,o)}},Za=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(B.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},kg=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(B.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},jl=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(B.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Ua=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(B.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Xv=0,Qv="private",eb=["tools/call","prompts/get","resources/read"];function tb(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete"||eb.includes(e))return t;throw new oe(B.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function rb(e,t){let r=Yv(t);if(t.resultType!=="complete"||!Wv(e))return r===void 0?t:ab(t);let o=t,n=Il(o.ttlMs)?o.ttlMs:sb(r),s=Ol(o.cacheScope)?o.cacheScope:ib(r),i={...o,ttlMs:n,cacheScope:s};return delete i[to],i}function ob(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function nb(e,t){if(t===void 0)return e;let r=e._meta;return r===void 0?{...e,_meta:{[$t]:t}}:!ob(r)||r[$t]!==void 0?e:{...e,_meta:{...r,[$t]:t}}}function sb(e){return e!==void 0&&Il(e.ttlMs)?e.ttlMs:Xv}function ib(e){return e!==void 0&&Ol(e.cacheScope)?e.cacheScope:Qv}function ab(e){let t={...e};return delete t[to],t}var cb=["elicitation/create","sampling/createMessage","roots/list"],ja;function Ig(){if(ja)return ja;let e=Gt();return ja={request:{"elicitation/create":P({method:O("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":P({method:O("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":P({method:O("roots/list"),params:re({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},ja}function Og(e){return cb.includes(e)}function yl(e){return Og(e)?Ig().request[e]:void 0}function ub(e){return Og(e)?Ig().response[e]:void 0}var xl={"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},Ng={"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 jg(e){return Object.prototype.hasOwnProperty.call(xl,e)}function xg(e){return Object.prototype.hasOwnProperty.call(Ng,e)}function lb(e){return Object.prototype.hasOwnProperty.call(xl,e)}function db(e){return jg(e)?Gt().dispatchRequestSchemas[e]:void 0}function pb(e){return lb(e)?Gt().dispatchResultSchemas[e]:void 0}function mb(e){return xg(e)?Gt().notificationSchemas2026[e]:void 0}var Tw=Object.keys(xl),Cw=Object.keys(Ng);function On(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function kn(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 fb={ok:!1,reason:"not-in-era"},hb=[mr,wt];function gb(e,t){let r=t,o=!1,n=()=>(o||(r={...r},o=!0),r),s=t.tools;e==="tools/list"&&Array.isArray(s)&&s.some(c=>On(c)&&"execution"in c)&&(n().tools=s.map(c=>{if(!On(c)||!("execution"in c))return c;let a={...c};return delete a.execution,a}));let i=t.capabilities;if(On(i)&&"tasks"in i){let c={...i};delete c.tasks,n().capabilities=c}return r}var Al={era:"2026-07-28",hasRequestMethod:jg,hasNotificationMethod:xg,hasInputRequestMethod:e=>yl(e)!==void 0,validateRequest:(e,t)=>kn(db(e),t),validateResult:(e,t)=>kn(pb(e),t),validateNotification:(e,t)=>kn(mb(e),t),validateInputRequest:(e,t)=>kn(yl(e),t),validateInputResponse:(e,t)=>kn(ub(e),t),samplingResultVariant:()=>fb,outboundEnvelope(e){return{[mr]:e.protocolVersion,[Vr]:e.clientInfo,[wt]:e.clientCapabilities,...e.logLevel!==void 0&&{[Zt]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of hb)o in e||t.push({key:o,problem:"missing"});let r=Gt().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let o of r.error.issues){let n=o.path.map(String),s=n.length>0?n.join("."):"_meta";n.length===1&&t.some(i=>i.key===s&&i.problem==="missing")||t.push({key:s,problem:o.message})}return t},projectCallToolResult:e=>bg(e),inputRequestSchema:yl,decodeResult(e,t){if(!On(t))return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: missing required resultType \u2014 servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof r!="string")return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let i=t.inputRequests,c=On(i)?i:{},a=t.requestState,u=t._meta===void 0?void 0:Gt().ResultMetaSchema.safeParse(t._meta),d=u?.success?u.data:void 0;return Object.keys(c).length===0&&typeof a!="string"?{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:c,...typeof a=="string"&&{requestState:a},...d!==void 0&&{_meta:d}}}if(r!=="complete")return{kind:"invalid",error:new ue(me.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=_b(),n=Object.hasOwn(o,e)?o[e]:void 0;if(n!==void 0){let i=n.safeParse(t);if(!i.success)return{kind:"invalid",error:new ue(me.InvalidResult,`Invalid result for ${e}: ${i.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,r){return nb(rb(e,tb(e,gb(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=Gt().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("; ")}`}},xa;function _b(){if(xa)return xa;let e=Gt();return xa={"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},xa}var ql="2026-07-28";function oo(e){return e!==void 0&&xn(e)?Al:kl}function ug(e){return e.revision!==void 0?oo(e.revision).era:e.era==="modern"?Al.era:kl.era}function vl(e){return Ag.some(t=>t.hasRequestMethod(e))}function bl(e){return Ag.some(t=>t.hasNotificationMethod(e))}function lg(e){return e==="tasks/get"||e==="tasks/cancel"}var Ag=[kl,Al];var Sb=Rd({AnnotationsSchema:()=>Pt,AudioContentSchema:()=>Wr,BaseMetadataSchema:()=>Rt,BaseRequestParamsSchema:()=>Le,BlobResourceContentsSchema:()=>Sn,BooleanSchemaSchema:()=>Rn,CallToolRequestParamsSchema:()=>Hi,CallToolRequestSchema:()=>Ji,CallToolResultSchema:()=>zn,CancelTaskRequestSchema:()=>ol,CancelTaskResultSchema:()=>nl,CancelledNotificationParamsSchema:()=>Ks,CancelledNotificationSchema:()=>pn,ClientCapabilitiesSchema:()=>Xs,ClientNotificationSchema:()=>il,ClientRequestSchema:()=>sl,ClientResultSchema:()=>al,ClientTasksCapabilitySchema:()=>Ws,CompatibilityCallToolResultSchema:()=>Ju,CompleteRequestParamsSchema:()=>ya,CompleteRequestSchema:()=>va,CompleteResultSchema:()=>ba,ContentBlockSchema:()=>Yr,CreateMessageRequestParamsSchema:()=>na,CreateMessageRequestSchema:()=>sa,CreateMessageResultSchema:()=>ia,CreateMessageResultWithToolsSchema:()=>aa,CreateTaskResultSchema:()=>Gu,CursorSchema:()=>nn,DiscoverRequestSchema:()=>oi,DiscoverResultSchema:()=>ni,ElicitRequestFormParamsSchema:()=>eo,ElicitRequestParamsSchema:()=>pa,ElicitRequestSchema:()=>ma,ElicitRequestURLParamsSchema:()=>da,ElicitResultSchema:()=>ga,ElicitationCompleteNotificationParamsSchema:()=>fa,ElicitationCompleteNotificationSchema:()=>ha,EmbeddedResourceSchema:()=>Ai,EmptyResultSchema:()=>dn,EnumSchemaSchema:()=>la,GetPromptRequestParamsSchema:()=>Ni,GetPromptRequestSchema:()=>ji,GetPromptResultSchema:()=>Li,GetTaskPayloadRequestSchema:()=>Qu,GetTaskPayloadResultSchema:()=>el,GetTaskRequestSchema:()=>Yu,GetTaskResultSchema:()=>Xu,IconSchema:()=>Gs,IconsSchema:()=>Vt,ImageContentSchema:()=>Gr,ImplementationSchema:()=>Jr,InitializeRequestParamsSchema:()=>Qs,InitializeRequestSchema:()=>ei,InitializeResultSchema:()=>ti,InitializedNotificationSchema:()=>ri,JSONArraySchema:()=>Vu,JSONObjectSchema:()=>Ee,JSONRPCErrorResponseSchema:()=>Hr,JSONRPCMessageSchema:()=>ln,JSONRPCNotificationSchema:()=>un,JSONRPCRequestSchema:()=>cn,JSONRPCResponseSchema:()=>Fu,JSONRPCResultResponseSchema:()=>Fr,JSONValueSchema:()=>Dt,LegacyTitledEnumSchemaSchema:()=>Pn,ListChangedOptionsBaseSchema:()=>Bu,ListPromptsRequestSchema:()=>Ii,ListPromptsResultSchema:()=>Oi,ListResourceTemplatesRequestSchema:()=>di,ListResourceTemplatesResultSchema:()=>pi,ListResourcesRequestSchema:()=>ui,ListResourcesResultSchema:()=>li,ListRootsRequestSchema:()=>Ra,ListRootsResultSchema:()=>$a,ListTasksRequestSchema:()=>tl,ListTasksResultSchema:()=>rl,ListToolsRequestSchema:()=>Vi,ListToolsResultSchema:()=>Fi,LoggingLevelSchema:()=>Bt,LoggingMessageNotificationParamsSchema:()=>Wi,LoggingMessageNotificationSchema:()=>Yi,ModelHintSchema:()=>Xi,ModelPreferencesSchema:()=>Qi,MultiSelectEnumSchemaSchema:()=>ua,NotificationSchema:()=>He,NotificationsParamsSchema:()=>Fe,NumberSchemaSchema:()=>Qr,PaginatedRequestParamsSchema:()=>ai,PaginatedRequestSchema:()=>Ft,PaginatedResultSchema:()=>Ht,PingRequestSchema:()=>fn,PrimitiveSchemaDefinitionSchema:()=>Cn,ProgressNotificationParamsSchema:()=>ii,ProgressNotificationSchema:()=>hn,ProgressSchema:()=>si,ProgressTokenSchema:()=>on,PromptArgumentSchema:()=>Ci,PromptListChangedNotificationSchema:()=>Di,PromptMessageSchema:()=>Mi,PromptReferenceSchema:()=>Sa,PromptSchema:()=>ki,ReadResourceRequestParamsSchema:()=>mi,ReadResourceRequestSchema:()=>fi,ReadResourceResultSchema:()=>hi,RelatedTaskMetadataSchema:()=>Bs,RequestIdSchema:()=>Ut,RequestMetaSchema:()=>sn,RequestSchema:()=>Te,ResourceContentsSchema:()=>gn,ResourceLinkSchema:()=>qi,ResourceListChangedNotificationSchema:()=>gi,ResourceRequestParamsSchema:()=>Br,ResourceSchema:()=>yn,ResourceTemplateReferenceSchema:()=>_a,ResourceTemplateSchema:()=>ci,ResourceUpdatedNotificationParamsSchema:()=>Ei,ResourceUpdatedNotificationSchema:()=>Ti,ResultMetaObjectSchema:()=>an,ResultSchema:()=>Ce,RoleSchema:()=>Jt,RootSchema:()=>za,RootsListChangedNotificationSchema:()=>wa,SamplingContentSchema:()=>ra,SamplingMessageContentBlockSchema:()=>dr,SamplingMessageSchema:()=>oa,ServerCapabilitiesSchema:()=>mn,ServerNotificationSchema:()=>ul,ServerRequestSchema:()=>cl,ServerResultSchema:()=>ll,ServerTasksCapabilitySchema:()=>Ys,SetLevelRequestParamsSchema:()=>Ki,SetLevelRequestSchema:()=>Gi,SingleSelectEnumSchemaSchema:()=>ca,StringSchemaSchema:()=>Xr,SubscribeRequestParamsSchema:()=>_i,SubscribeRequestSchema:()=>Si,SubscriptionFilterSchema:()=>vn,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Ri,SubscriptionsAcknowledgedNotificationSchema:()=>$i,SubscriptionsListenRequestParamsSchema:()=>bi,SubscriptionsListenRequestSchema:()=>zi,SubscriptionsListenResultMetaSchema:()=>wi,SubscriptionsListenResultSchema:()=>Pi,TaskAugmentedRequestParamsSchema:()=>hr,TaskCreationParamsSchema:()=>Ku,TaskMetadataSchema:()=>Js,TaskSchema:()=>Kt,TaskStatusNotificationParamsSchema:()=>Ea,TaskStatusNotificationSchema:()=>Wu,TaskStatusSchema:()=>Pa,TextContentSchema:()=>Kr,TextResourceContentsSchema:()=>_n,TitledMultiSelectEnumSchemaSchema:()=>Tn,TitledSingleSelectEnumSchemaSchema:()=>wn,ToolAnnotationsSchema:()=>Zi,ToolChoiceSchema:()=>ea,ToolExecutionSchema:()=>Ui,ToolListChangedNotificationSchema:()=>Bi,ToolResultContentSchema:()=>ta,ToolSchema:()=>bn,ToolUseContentSchema:()=>xi,UnsubscribeRequestParamsSchema:()=>yi,UnsubscribeRequestSchema:()=>vi,UntitledMultiSelectEnumSchemaSchema:()=>En,UntitledSingleSelectEnumSchemaSchema:()=>$n});var Ml=e=>cn.safeParse(e).success,Ll=e=>un.safeParse(e).success,Ma=e=>Fr.safeParse(e).success,Dl=e=>Hr.safeParse(e).success;var Et=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";function Zl(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Ul(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var dg="x-mcp-header",yb=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,vb=new Set(["string","integer","boolean","number"]);function Vl(e){let t=[],r=new Map,o=(s,i,c)=>{if(s===null||typeof s!="object")return;let a=s;if(dg in a){if(!c||i.length===0)return`${Aa(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let d=a[dg];if(typeof d!="string"||d.length===0)return`${Aa(i)}: x-mcp-header MUST be a non-empty string`;if(!yb.test(d))return`${Aa(i)}: x-mcp-header '${d}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let m=typeof a.type=="string"?a.type:void 0;if(m===void 0||!vb.has(m))return`${Aa(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${m??"<none>"}`;let g=d.toLowerCase(),v=r.get(g);if(v!==void 0)return`x-mcp-header '${d}' is not case-insensitively unique (also declared as '${v}')`;r.set(g,d),t.push({path:i,headerName:d,type:m})}let u=a.properties;if(u!==null&&typeof u=="object")for(let[d,m]of Object.entries(u)){let g=o(m,[...i,d],c);if(g!==void 0)return g}for(let d of bb){let m=a[d];if(m===void 0)continue;let g=Array.isArray(m)?m:m!==null&&typeof m=="object"&&zb.has(d)?Object.values(m):[m];for(let v of g){let p=o(v,[...i,`<${d}>`],!1);if(p!==void 0)return p}}},n=o(e,[],!0);return n===void 0?{valid:!0,declarations:t}:{valid:!1,reason:n}}var bb=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],zb=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function Aa(e){return e.length===0?"<root>":e.join(".")}var qa=-32020,kw=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32e3],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[B.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:[qa,B.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:[B.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope \u2014 and a missing envelope on a request whose protocol-version header names a modern revision \u2014 is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[B.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision\u2019s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[B.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:[qa],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half \u2014 including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[B.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced \u2014 pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[qa],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],Rb={[B.ParseError]:400,[B.InvalidRequest]:400,[B.MethodNotFound]:404,[B.UnsupportedProtocolVersion]:400,[B.MissingRequiredClientCapability]:400,[qa]:400};function Va(e,t){return Ms(e,t)}function In(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function no(e){if(e==null)return!1;let t=typeof e;return t!=="object"&&t!=="function"||!("~standard"in e)?!1:typeof e["~standard"]?.validate=="function"}var pg=!1,$l="draft-2020-12";function _r(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:$l});else if(r.vendor==="zod"){if(!("_zod"in e))throw new Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");pg||(pg=!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=As(e,{target:$l,io:t})}else throw new Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output")return o.type!==void 0?o:qg(o)?{type:"object",...o}:o;if(o.type!==void 0&&o.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}function qg(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"||qg(o)))}return!1}function $b(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function gr(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(o=>$b(o)).join(", ")}:{success:!0,data:r.value}}function wb(e){let t=As(e,{target:$l,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}var Pb=/\\\.\\d\{(\d+)\}/;function Eb(e){let t=Pb.exec(e),r=[void 0,-1,0];return t&&r.push(Number(t[1])),[!1,!0].flatMap(o=>[!1,!0].flatMap(n=>r.map(s=>zt.datetime({local:o,offset:n,precision:s}))))}function Tb(e,t){let r;switch(e){case"email":r=[Ah()];break;case"uri":r=[Zs()];break;case"date":r=[zt.date()];break;case"date-time":r=Eb(t);break}return new Set(r.map(o=>wb(o)).filter(o=>o!==void 0))}function Cb(e,t,r){return r!=="zod"?!0:Tb(e,t).has(t)}function Mg(e){let t=_r(e,"input"),r=t.properties||{},o=t.required||[];return Object.entries(r).map(([n,s])=>({name:n,description:s?.description,required:o.includes(n)}))}function jn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function kb(e){try{return _r(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new oe(B.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var Ib=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Fl(e){return Ib.has(e)||e.startsWith("x-")}var Ob=new Set(["$schema",...Object.keys(eo.shape.requestedSchema.shape)]),mg={string:In([Xr,$n,wn,Pn]),number:In([Qr]),integer:In([Qr]),boolean:In([Rn]),array:In([En,Tn])},Nb=new Set(Xr.shape.format.unwrap().options);function jb(e,t,r,o){if(!jn(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(mg,e.type)?mg[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,c]of Object.entries(e))n.has(i)||Fl(i)?s[i]=c:i==="pattern"&&e.type==="string"&&typeof e.format=="string"?Nb.has(e.format)?(typeof c!="string"||!Cb(e.format,c,r))&&o.push(`${t}.${i}`):s[i]=c:o.push(`${t}.${i}`);return s}function xb(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))n==="properties"&&jn(s)?r[n]=Object.fromEntries(Object.entries(s).map(([i,c])=>[i,jb(c,`properties.${i}`,t,o)])):Ob.has(n)?r[n]=s:Fl(n)||o.push(n);if(o.length>0)throw new oe(B.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function Ab(e,t){if(!jn(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!Va(Cn,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function wl(e,t,r=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((o,n)=>wl(o,t[n],`${r}[${n}]`)):!jn(e)||!jn(t)?[]:Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;return Object.prototype.hasOwnProperty.call(t,o)?wl(n,t[o],s):Fl(o)?[]:[s]})}function qb(e){if(!no(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=xb(kb(e.requestedSchema),t),o=Va(eo.shape.requestedSchema,r);if(!o.success)throw new oe(B.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Ab(r,o.error.message)}`);let n=wl(r,o.data);if(n.length>0)throw new oe(B.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(o.data.required??[]).filter(i=>!Object.prototype.hasOwnProperty.call(o.data.properties,i));if(s.length>0)throw new oe(B.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function Mb(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState=="string";if(!t&&!r)throw new TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}var Lb=Object.assign(Mb,{elicit(e){try{return{method:"elicitation/create",params:qb(e)}}catch(t){throw t instanceof oe?new TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var Lg=250;function Dg(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Zg(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof ue?t.reason:new ue(me.RequestTimeout,String(t.reason)));return}let n=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(n),o(t?.reason instanceof ue?t.reason:new ue(me.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function Ug(e){let t=new AbortController,r=()=>t.abort(e?.reason);return e?.addEventListener("abort",r,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:o=>t.abort(o),dispose:()=>e?.removeEventListener("abort",r)}}var Db=["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"],Zb={IdJagTokenExchangeResponseSchema:fl,OAuthClientInformationFullSchema:gl,OAuthClientInformationSchema:Ia,OAuthClientMetadataSchema:ka,OAuthClientRegistrationErrorSchema:_l,OAuthErrorResponseSchema:hl,OAuthMetadataSchema:Ta,OAuthProtectedResourceMetadataSchema:dl,OAuthTokenRevocationRequestSchema:Sl,OAuthTokensSchema:ml,OpenIdProviderDiscoveryMetadataSchema:pl,OpenIdProviderMetadataSchema:Ca},Vg={},Fg={};function Hg(e,t){let r=e.slice(0,-6);Vg[r]=t,Fg[r]=o=>t.safeParse(o).success}for(let e of Db)Hg(e,Sb[e]);for(let[e,t]of Object.entries(Zb))Hg(e,t);var Ub=Object.freeze(Vg),Vb=Object.freeze(Fg);function Fb(e){switch(e){case"initialize":case"notifications/initialized":return oo(void 0);case"server/discover":return oo(ql);default:return}}var Jg=6e4,Hb=[mr,Vr,wt,Zt],Jb=["inputResponses","requestState"];function fg(e,t){let r=e.params;if(!Nn(r))return{message:e,lifted:{}};let o=r._meta,n=Nn(o)?Hb.filter(a=>a in o):[],s=t==="request"?Jb.filter(a=>a in r):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},c={...r};if(n.length>0&&Nn(o)){let a={},u={...o};for(let d of n)a[d]=o[d],delete u[d];i.envelope=a,Object.keys(u).length>0?c._meta=u:delete c._meta}for(let a of s)a==="inputResponses"&&(i.inputResponses=c[a]),a==="requestState"&&(i.requestState=c[a]),delete c[a];return{message:{...e,params:c},lifted:i}}function hg(e,t){let r=e.validateResult(t,void 0);if(!(!r.ok&&r.reason==="not-in-era"))return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let n=e.validateResult(t,o);return n.ok?{value:n.value}:{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function An(e){return()=>e}var Bb=An(void 0);function Hl(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:An(t)}}}var Kb;var Jl=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{Kb=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Fs,this.setNotificationHandler("notifications/cancelled",t=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",t=>{this._onprogress(t)}),this.setRequestHandler("ping",t=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new ue(me.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ue(me.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let r=this.transport?.onerror;this._transport.onerror=n=>{r?.(n),this._onerror(n)};let o=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{o?.(n,s),Ma(n)||Dl(n)?this._onresponse(n):Ml(n)?this._onrequest(n,s):Ll(n)?this._onnotification(n,s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new ue(me.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let o of e.values())o(r);for(let o of t.values())o.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=fg(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=ug(t.classification);if(i!==o.era){this._onerror(new Error(`Era mismatch on inbound notification '${r.method}': classified as ${i} but this instance serves ${o.era}`));return}}if(bl(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;n===void 0&&s===void 0||Promise.resolve().then(()=>n===void 0?s(r):n(r,o)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,t){let{message:r,lifted:o}=fg(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(new Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,i=(_,h,f)=>{let z={jsonrpc:"2.0",id:r.id,error:{code:_,message:h,...f!==void 0&&{data:f}}};s?.send(z).catch(y=>this._onerror(new Error(`Failed to send an error response: ${y}`)))};if(t?.classification!==void 0){let _=ug(t.classification);if(_!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${r.method}': classified as ${_} but this instance serves ${n.era}`));let h=t.classification.revision??_;i(B.UnsupportedProtocolVersion,`Unsupported protocol version: ${h}`,{supported:this._supportedProtocolVersions,requested:h});return}}if(vl(r.method)&&!n.hasRequestMethod(r.method)&&!(lg(r.method)&&this._customSchemaRequestMethods.has(r.method))){i(B.MethodNotFound,"Method not found");return}let c=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(c===void 0){i(B.MethodNotFound,"Method not found");return}let a=n.checkInboundEnvelope(o);if(a!==void 0){i(B.InvalidParams,a);return}let u=(_,h)=>this._notificationViaCodec(this._resolveOutboundCodec(_.method),_,{...h,relatedRequestId:r.id}),d=(_,h,f)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(_.method),_,h,{...f,relatedRequestId:r.id}),m=new AbortController;this._requestHandlerAbortControllers.set(r.id,m);let g=o.inputResponses===void 0?void 0:Gb(o.inputResponses),v={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...g!==void 0&&{inputResponses:g.accepted},...g!==void 0&&g.droppedKeys.length>0&&{droppedInputResponseKeys:g.droppedKeys},requestState:o.requestState===void 0?Bb:An(o.requestState),signal:m.signal,send:((_,h,f)=>{let z=this._resolveOutboundCodec(_.method);if(this._assertOutboundRequestInEra(z,_.method),no(h))return d(_,h,f);let y=hg(z,_.method);if(y===void 0)throw new TypeError(`'${_.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return d(_,y,h)}),notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},p=this.buildContext(v,t);Promise.resolve().then(()=>c(r,p)).then(async _=>{if(m.signal.aborted)return;let h;try{h=n.encodeResult(r.method,_,this._outboundServerInfo())}catch(z){this._onerror(new Error(`Failed to encode result for ${r.method}: ${z}`)),i(B.InternalError,"Internal error");return}let f={result:h,jsonrpc:"2.0",id:r.id};await s?.send(f)},async _=>{if(m.signal.aborted)return;let h=Number.isSafeInteger(_.code)?_.code:B.InternalError,f={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(h),message:_.message??"Internal error",..._.data!==void 0&&{data:_.data}}};await s?.send(f)}).catch(_=>this._onerror(new Error(`Failed to send response: ${_}`))).finally(()=>{this._requestHandlerAbortControllers.get(r.id)===m&&this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,o=Number(t),n=this._progressHandlers.get(o);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(o),i=this._timeoutInfo.get(o);if(i&&s&&i.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(c);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Ma(e)?r(e):r(oe.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(no(t))return lg(e.method)||this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r);this._assertOutboundRequestInEra(o,e.method);let n=hg(o,e.method);if(n===void 0)throw new TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(o,e,n,t)}_negotiatedWireCodec(){return oo(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Fb(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(vl(t)&&!e.hasRequestMethod(t))throw new ue(me.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c}=o??{},a=Date.now(),u,d;return new Promise((m,g)=>{let v=b=>{g(b)};if(!this._transport){v(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(b){v(b);return}if(o?.signal?.aborted){let b=o.signal.reason;throw b instanceof ue?b:new ue(me.RequestTimeout,String(b))}let p=e.era===ql&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,_=this._requestMessageId++;d=_;let h={...t,jsonrpc:"2.0",id:_};o?.onprogress&&(this._progressHandlers.set(_,o.onprogress),h.params={...t.params,_meta:{...t.params?._meta,progressToken:_}});let f=this._envelopeOutbound(h),z=!1,y=b=>{z||(this._progressHandlers.delete(_),p===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:_,reason:String(b)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`))):p.abort(),g(b instanceof ue?b:new ue(me.RequestTimeout,String(b))))};this._responseHandlers.set(_,b=>{if(o?.signal?.aborted)return;if(z=!0,b instanceof Error)return g(b);let S;try{S=e.decodeResult(t.method,b.result)}catch(j){return g(j instanceof Error?j:new Error(String(j)))}if(S.kind==="invalid")return g(S.error);if(S.kind==="input_required"){if(o?.allowInputRequired===!0)return m(Wb(S));let j={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:a,retry:(F,M)=>this._requestWithSchemaViaCodec(e,F===void 0?{method:t.method}:{method:t.method,params:F},r,M)};return m(this._resolveNonCompleteResult(S,j))}let E=S.result;gr(r,E).then(j=>{j.success?m(j.data):g(new ue(me.InvalidResult,`Invalid result for ${t.method}: ${j.error}`))},g)}),u=()=>y(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let R=o?.timeout??Jg,w=()=>y(new ue(me.RequestTimeout,"Request timed out",{timeout:R}));this._setupTimeout(_,R,o?.maxTotalTimeout,w,o?.resetTimeoutOnProgress??!1),this._transport.send(f,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:c,requestSignal:p?.signal}).catch(b=>{this._progressHandlers.delete(_),g(b)})}).finally(()=>{u&&o?.signal?.removeEventListener("abort",u),d!==void 0&&(this._responseHandlers.delete(d),this._cleanupTimeout(d))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new ue(me.NotConnected,"Not connected");if(bl(t.method)&&!e.hasNotificationMethod(t.method))throw new ue(me.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&r?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(o,r).catch(n=>this._onerror(n))});return}await this._transport.send(o,r)}setRequestHandler(e,t,r){this.assertRequestHandlerCapability(e);let o;if(typeof t=="function"){if(!vl(e))throw new TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,s)=>{let i=this._negotiatedWireCodec(),c=i.validateRequest(e,n);if(!c.ok&&c.reason==="not-in-era"&&(c=i.validateInputRequest(e,n)),!c.ok)throw c.reason==="not-in-era"?new oe(B.InternalError,`No wire schema for ${e} in the resolved era`):new Error(c.message);return Promise.resolve(t(c.value,s))}}else if(r)o=async(n,s)=>{let i=await gr(t.params,{...n.params});if(!i.success)throw new oe(B.InvalidParams,`Invalid params for ${e}: ${i.error}`);return r(i.data,s)};else throw new TypeError("setRequestHandler: handler is required");typeof t=="function"?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if(typeof t=="function"){if(!bl(e))throw new TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(o,n)=>{let s=n.validateNotification(e,o);if(!s.ok)throw s.reason==="not-in-era"?new oe(B.InternalError,`No wire schema for ${e} in the resolved era`):new Error(s.message);return Promise.resolve(t(s.value))});return}if(!r)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async o=>{let n=await gr(t.params,{...o.params});if(!n.success)throw new oe(B.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Nn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Bl(e,t){let r={...e};for(let o in t){let n=o,s=t[n];if(s===void 0)continue;let i=r[n];r[n]=Nn(i)&&Nn(s)?{...i,...s}:s}return r}function gg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Gb(e){let t={},r=[];if(!gg(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!gg(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function Wb(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var Yb=U((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(c){if(!c)throw new TypeError("argument string is required");var a=typeof c=="object"?s(c):c;if(typeof a!="string")throw new TypeError("argument string is required to be a string");var u=a.indexOf(";"),d=u!==-1?a.slice(0,u).trim():a.trim();if(!o.test(d))throw new TypeError("invalid media type");var m=new i(d.toLowerCase());if(u!==-1){var g,v,p;for(t.lastIndex=u;v=t.exec(a);){if(v.index!==u)throw new TypeError("invalid parameter format");u+=v[0].length,g=v[1].toLowerCase(),p=v[2],p.charCodeAt(0)===34&&(p=p.slice(1,-1),p.indexOf("\\")!==-1&&(p=p.replace(r,"$1"))),m.parameters[g]=p}if(u!==a.length)throw new TypeError("invalid parameter format")}return m}function s(c){var a;if(typeof c.getHeader=="function"?a=c.getHeader("content-type"):typeof c.headers=="object"&&(a=c.headers&&c.headers["content-type"]),typeof a!="string")throw new TypeError("content-type header is missing from object");return a}function i(c){this.parameters=Object.create(null),this.type=c}})),Iw=ns(Yb(),1);var Bg=10*1024*1024,Kl=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??Bg}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){for(;this._buffer;){let e=this._buffer.indexOf(`
|
|
60
|
+
`);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return Kg(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};function Kg(e){return ln.parse(JSON.parse(e))}function Gl(e){return JSON.stringify(e)+`
|
|
61
|
+
`}var Xb=/^[A-Za-z0-9._-]{1,128}$/;function Qb(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!Xb.test(e)){let r=[...e].filter(o=>!/[A-Za-z0-9._-]/.test(o)).filter((o,n,s)=>s.indexOf(o)===n);return t.push(`Tool name contains invalid characters: ${r.map(o=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function ez(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function Wl(e){let t=Qb(e);return ez(e,t.warnings),t.isValid}function tz(e){return typeof e=="object"&&e!==null&&"_zod"in e}function rz(e){return typeof e=="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName=="string"}function oz(e){if(typeof e!="object"||e===null||no(e))return!1;let t=Object.getPrototypeOf(e);return t!==Object.prototype&&t!==null?!1:Object.values(e).every(r=>tz(r))}function Fa(e){if(e!==void 0){if(oz(e))return P(e);if(typeof e=="object"&&e!==null&&!no(e)&&Object.values(e).some(t=>rz(t)))throw new TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!no(e))throw new TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return e}}var Ja=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(f){if(super(),!e.IDENTIFIER.test(f))throw new Error("CodeGen: name must be a valid identifier");this.str=f}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(f){super(),this._items=typeof f=="string"?[f]:f}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let f=this._items[0];return f===""||f==='""'}get str(){var f;return(f=this._str)!==null&&f!==void 0?f:this._str=this._items.reduce((z,y)=>`${z}${y}`,"")}get names(){var f;return(f=this._names)!==null&&f!==void 0?f:this._names=this._items.reduce((z,y)=>(y instanceof r&&(z[y.str]=(z[y.str]||0)+1),z),{})}};e._Code=o,e.nil=new o("");function n(f,...z){let y=[f[0]],R=0;for(;R<z.length;)c(y,z[R]),y.push(f[++R]);return new o(y)}e._=n;let s=new o("+");function i(f,...z){let y=[v(f[0])],R=0;for(;R<z.length;)y.push(s),c(y,z[R]),y.push(s,v(f[++R]));return a(y),new o(y)}e.str=i;function c(f,z){z instanceof o?f.push(...z._items):z instanceof r?f.push(z):f.push(m(z))}e.addCodeArg=c;function a(f){let z=1;for(;z<f.length-1;){if(f[z]===s){let y=u(f[z-1],f[z+1]);if(y!==void 0){f.splice(z-1,3,y);continue}f[z++]="+"}z++}}function u(f,z){if(z==='""')return f;if(f==='""')return z;if(typeof f=="string")return z instanceof r||f[f.length-1]!=='"'?void 0:typeof z!="string"?`${f.slice(0,-1)}${z}"`:z[0]==='"'?f.slice(0,-1)+z.slice(1):void 0;if(typeof z=="string"&&z[0]==='"'&&!(f instanceof r))return`"${f}${z.slice(1)}`}function d(f,z){return z.emptyStr()?f:f.emptyStr()?z:i`${f}${z}`}e.strConcat=d;function m(f){return typeof f=="number"||typeof f=="boolean"||f===null?f:v(Array.isArray(f)?f.join(","):f)}function g(f){return new o(v(f))}e.stringify=g;function v(f){return JSON.stringify(f).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function p(f){return typeof f=="string"&&e.IDENTIFIER.test(f)?new o(`.${f}`):n`[${f}]`}e.getProperty=p;function _(f){if(typeof f=="string"&&e.IDENTIFIER.test(f))return new o(`${f}`);throw new Error(`CodeGen: invalid export name: ${f}, use explicit $id name mapping`)}e.getEsmExportName=_;function h(f){return new o(f.toString())}e.regexpCode=h})),Gg=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=Ja();var r=class extends Error{constructor(a){super(`CodeGen: "code" for ${a} not defined`),this.value=a.value}},o;(function(a){a[a.Started=0]="Started",a[a.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:a,parent:u}={}){this._names={},this._prefixes=a,this._parent=u}toName(a){return a instanceof t.Name?a:this.name(a)}name(a){return new t.Name(this._newName(a))}_newName(a){let u=this._names[a]||this._nameGroup(a);return`${a}${u.index++}`}_nameGroup(a){var u,d;if(!((d=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||d===void 0)&&d.has(a)||this._prefixes&&!this._prefixes.has(a))throw new Error(`CodeGen: prefix "${a}" is not allowed in this scope`);return this._names[a]={prefix:a,index:0}}};e.Scope=n;var s=class extends t.Name{constructor(a,u){super(u),this.prefix=a}setValue(a,{property:u,itemIndex:d}){this.value=a,this.scopePath=(0,t._)`.${new t.Name(u)}[${d}]`}};e.ValueScopeName=s;let i=(0,t._)`\n`;var c=class extends n{constructor(a){super(a),this._values={},this._scope=a.scope,this.opts={...a,_n:a.lines?i:t.nil}}get(){return this._scope}name(a){return new s(a,this._newName(a))}value(a,u){var d;if(u.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let m=this.toName(a),{prefix:g}=m,v=(d=u.key)!==null&&d!==void 0?d:u.ref,p=this._values[g];if(p){let f=p.get(v);if(f)return f}else p=this._values[g]=new Map;p.set(v,m);let _=this._scope[g]||(this._scope[g]=[]),h=_.length;return _[h]=u.ref,m.setValue(u,{property:g,itemIndex:h}),m}getValue(a,u){let d=this._values[a];if(d)return d.get(u)}scopeRefs(a,u=this._values){return this._reduceValues(u,d=>{if(d.scopePath===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return(0,t._)`${a}${d.scopePath}`})}scopeCode(a=this._values,u,d){return this._reduceValues(a,m=>{if(m.value===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return m.value.code},u,d)}_reduceValues(a,u,d={},m){let g=t.nil;for(let v in a){let p=a[v];if(!p)continue;let _=d[v]=d[v]||new Map;p.forEach(h=>{if(_.has(h))return;_.set(h,o.Started);let f=u(h);if(f){let z=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${z} ${h} = ${f};${this.opts._n}`}else if(f=m?.(h))g=(0,t._)`${g}${f}${this.opts._n}`;else throw new r(h);_.set(h,o.Completed)})}return g}};e.ValueScope=c})),le=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=Ja(),r=Gg();var o=Ja();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=Gg();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($,C){return this}},i=class extends s{constructor($,C,N){super(),this.varKind=$,this.name=C,this.rhs=N}render({es5:$,_n:C}){let N=$?r.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${J};`+C}optimizeNames($,C){if($[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,$,C)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},c=class extends s{constructor($,C,N){super(),this.lhs=$,this.rhs=C,this.sideEffects=N}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,C){if(!(this.lhs instanceof t.Name&&!$[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,$,C),this}get names(){return Y(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},a=class extends c{constructor($,C,N,J){super($,N,J),this.op=C}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}},u=class extends s{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}},d=class extends s{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}},m=class extends s{constructor($){super(),this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}},g=class extends s{constructor($){super(),this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,C){return this.code=G(this.code,$,C),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},v=class extends s{constructor($=[]){super(),this.nodes=$}render($){return this.nodes.reduce((C,N)=>C+N.render($),"")}optimizeNodes(){let{nodes:$}=this,C=$.length;for(;C--;){let N=$[C].optimizeNodes();Array.isArray(N)?$.splice(C,1,...N):N?$[C]=N:$.splice(C,1)}return $.length>0?this:void 0}optimizeNames($,C){let{nodes:N}=this,J=N.length;for(;J--;){let ee=N[J];ee.optimizeNames($,C)||(fe($,ee.names),N.splice(J,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce(($,C)=>Z($,C.names),{})}},p=class extends v{render($){return"{"+$._n+super.render($)+"}"+$._n}},_=class extends v{},h=class extends p{};h.kind="else";var f=class Ha extends p{constructor(C,N){super(N),this.condition=C}render(C){let N=`if(${this.condition})`+super.render(C);return this.else&&(N+="else "+this.else.render(C)),N}optimizeNodes(){super.optimizeNodes();let C=this.condition;if(C===!0)return this.nodes;let N=this.else;if(N){let J=N.optimizeNodes();N=this.else=Array.isArray(J)?new h(J):J}if(N)return C===!1?N instanceof Ha?N:N.nodes:this.nodes.length?this:new Ha($e(C),N instanceof Ha?[N]:N.nodes);if(!(C===!1||!this.nodes.length))return this}optimizeNames(C,N){var J;if(this.else=(J=this.else)===null||J===void 0?void 0:J.optimizeNames(C,N),!!(super.optimizeNames(C,N)||this.else))return this.condition=G(this.condition,C,N),this}get names(){let C=super.names;return Y(C,this.condition),this.else&&Z(C,this.else.names),C}};f.kind="if";var z=class extends p{};z.kind="for";var y=class extends z{constructor($){super(),this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,C){if(super.optimizeNames($,C))return this.iteration=G(this.iteration,$,C),this}get names(){return Z(super.names,this.iteration.names)}},R=class extends z{constructor($,C,N,J){super(),this.varKind=$,this.name=C,this.from=N,this.to=J}render($){let C=$.es5?r.varKinds.var:this.varKind,{name:N,from:J,to:ee}=this;return`for(${C} ${N}=${J}; ${N}<${ee}; ${N}++)`+super.render($)}get names(){return Y(Y(super.names,this.from),this.to)}},w=class extends z{constructor($,C,N,J){super(),this.loop=$,this.varKind=C,this.name=N,this.iterable=J}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,C){if(super.optimizeNames($,C))return this.iterable=G(this.iterable,$,C),this}get names(){return Z(super.names,this.iterable.names)}},b=class extends p{constructor($,C,N){super(),this.name=$,this.args=C,this.async=N}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}};b.kind="func";var S=class extends v{render($){return"return "+super.render($)}};S.kind="return";var E=class extends p{render($){let C="try"+super.render($);return this.catch&&(C+=this.catch.render($)),this.finally&&(C+=this.finally.render($)),C}optimizeNodes(){var $,C;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(C=this.finally)===null||C===void 0||C.optimizeNodes(),this}optimizeNames($,C){var N,J;return super.optimizeNames($,C),(N=this.catch)===null||N===void 0||N.optimizeNames($,C),(J=this.finally)===null||J===void 0||J.optimizeNames($,C),this}get names(){let $=super.names;return this.catch&&Z($,this.catch.names),this.finally&&Z($,this.finally.names),$}},j=class extends p{constructor($){super(),this.error=$}render($){return`catch(${this.error})`+super.render($)}};j.kind="catch";var F=class extends p{render($){return"finally"+super.render($)}};F.kind="finally";var M=class{constructor($,C={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...C,_n:C.lines?`
|
|
62
|
+
`:""},this._extScope=$,this._scope=new r.Scope({parent:$}),this._nodes=[new _]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,C){let N=this._extScope.value($,C);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue($,C){return this._extScope.getValue($,C)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,C,N,J){let ee=this._scope.toName(C);return N!==void 0&&J&&(this._constants[ee.str]=N),this._leafNode(new i($,ee,N)),ee}const($,C,N){return this._def(r.varKinds.const,$,C,N)}let($,C,N){return this._def(r.varKinds.let,$,C,N)}var($,C,N){return this._def(r.varKinds.var,$,C,N)}assign($,C,N){return this._leafNode(new c($,C,N))}add($,C){return this._leafNode(new a($,e.operators.ADD,C))}code($){return typeof $=="function"?$():$!==t.nil&&this._leafNode(new g($)),this}object(...$){let C=["{"];for(let[N,J]of $)C.length>1&&C.push(","),C.push(N),(N!==J||this.opts.es5)&&(C.push(":"),(0,t.addCodeArg)(C,J));return C.push("}"),new t._Code(C)}if($,C,N){if(this._blockNode(new f($)),C&&N)this.code(C).else().code(N).endIf();else if(C)this.code(C).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new f($))}else(){return this._elseNode(new h)}endIf(){return this._endBlockNode(f,h)}_for($,C){return this._blockNode($),C&&this.code(C).endFor(),this}for($,C){return this._for(new y($),C)}forRange($,C,N,J,ee=this.opts.es5?r.varKinds.var:r.varKinds.let){let pe=this._scope.toName($);return this._for(new R(ee,pe,C,N),()=>J(pe))}forOf($,C,N,J=r.varKinds.const){let ee=this._scope.toName($);if(this.opts.es5){let pe=C instanceof t.Name?C:this.var("_arr",C);return this.forRange("_i",0,(0,t._)`${pe}.length`,ie=>{this.var(ee,(0,t._)`${pe}[${ie}]`),N(ee)})}return this._for(new w("of",J,ee,C),()=>N(ee))}forIn($,C,N,J=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf($,(0,t._)`Object.keys(${C})`,N);let ee=this._scope.toName($);return this._for(new w("in",J,ee,C),()=>N(ee))}endFor(){return this._endBlockNode(z)}label($){return this._leafNode(new u($))}break($){return this._leafNode(new d($))}return($){let C=new S;if(this._blockNode(C),this.code($),C.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try($,C,N){if(!C&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');let J=new E;if(this._blockNode(J),this.code($),C){let ee=this.name("e");this._currNode=J.catch=new j(ee),C(ee)}return N&&(this._currNode=J.finally=new F,this.code(N)),this._endBlockNode(j,F)}throw($){return this._leafNode(new m($))}block($,C){return this._blockStarts.push(this._nodes.length),$&&this.code($).endBlock(C),this}endBlock($){let C=this._blockStarts.pop();if(C===void 0)throw new Error("CodeGen: not in self-balancing block");let N=this._nodes.length-C;if(N<0||$!==void 0&&N!==$)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${$} expected`);return this._nodes.length=C,this}func($,C=t.nil,N,J){return this._blockNode(new b($,C,N)),J&&this.code(J).endFunc(),this}endFunc(){return this._endBlockNode(b)}optimize($=1){for(;$-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,C){let N=this._currNode;if(N instanceof $||C&&N instanceof C)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${C?`${$.kind}/${C.kind}`:$.kind}"`)}_elseNode($){let C=this._currNode;if(!(C instanceof f))throw new Error('CodeGen: "else" without "if"');return this._currNode=C.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let C=this._nodes;C[C.length-1]=$}};e.CodeGen=M;function Z($,C){for(let N in C)$[N]=($[N]||0)+(C[N]||0);return $}function Y($,C){return C instanceof t._CodeOrName?Z($,C.names):$}function G($,C,N){if($ instanceof t.Name)return J($);if(!ee($))return $;return new t._Code($._items.reduce((pe,ie)=>(ie instanceof t.Name&&(ie=J(ie)),ie instanceof t._Code?pe.push(...ie._items):pe.push(ie),pe),[]));function J(pe){let ie=N[pe.str];return ie===void 0||C[pe.str]!==1?pe:(delete C[pe.str],ie)}function ee(pe){return pe instanceof t._Code&&pe._items.some(ie=>ie instanceof t.Name&&C[ie.str]===1&&N[ie.str]!==void 0)}}function fe($,C){for(let N in C)$[N]=($[N]||0)-(C[N]||0)}function $e($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:(0,t._)`!${V($)}`}e.not=$e;let be=x(e.operators.AND);function Oe(...$){return $.reduce(be)}e.and=Oe;let he=x(e.operators.OR);function k(...$){return $.reduce(he)}e.or=k;function x($){return(C,N)=>C===t.nil?N:N===t.nil?C:(0,t._)`${V(C)} ${$} ${V(N)}`}function V($){return $ instanceof t.Name?$:(0,t._)`(${$})`}})),_e=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let t=le(),r=Ja();function o(b){let S={};for(let E of b)S[E]=!0;return S}e.toHash=o;function n(b,S){return typeof S=="boolean"?S:Object.keys(S).length===0?!0:(s(b,S),!i(S,b.self.RULES.all))}e.alwaysValidSchema=n;function s(b,S=b.schema){let{opts:E,self:j}=b;if(!E.strictSchema||typeof S=="boolean")return;let F=j.RULES.keywords;for(let M in S)F[M]||w(b,`unknown keyword: "${M}"`)}e.checkUnknownRules=s;function i(b,S){if(typeof b=="boolean")return!b;for(let E in b)if(S[E])return!0;return!1}e.schemaHasRules=i;function c(b,S){if(typeof b=="boolean")return!b;for(let E in b)if(E!=="$ref"&&S.all[E])return!0;return!1}e.schemaHasRulesButRef=c;function a({topSchemaRef:b,schemaPath:S},E,j,F){if(!F){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,t._)`${E}`}return(0,t._)`${b}${S}${(0,t.getProperty)(j)}`}e.schemaRefOrVal=a;function u(b){return g(decodeURIComponent(b))}e.unescapeFragment=u;function d(b){return encodeURIComponent(m(b))}e.escapeFragment=d;function m(b){return typeof b=="number"?`${b}`:b.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=m;function g(b){return b.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=g;function v(b,S){if(Array.isArray(b))for(let E of b)S(E);else S(b)}e.eachItem=v;function p({mergeNames:b,mergeToName:S,mergeValues:E,resultToName:j}){return(F,M,Z,Y)=>{let G=Z===void 0?M:Z instanceof t.Name?(M instanceof t.Name?b(F,M,Z):S(F,M,Z),Z):M instanceof t.Name?(S(F,Z,M),M):E(M,Z);return Y===t.Name&&!(G instanceof t.Name)?j(F,G):G}}e.mergeEvaluated={props:p({mergeNames:(b,S,E)=>b.if((0,t._)`${E} !== true && ${S} !== undefined`,()=>{b.if((0,t._)`${S} === true`,()=>b.assign(E,!0),()=>b.assign(E,(0,t._)`${E} || {}`).code((0,t._)`Object.assign(${E}, ${S})`))}),mergeToName:(b,S,E)=>b.if((0,t._)`${E} !== true`,()=>{S===!0?b.assign(E,!0):(b.assign(E,(0,t._)`${E} || {}`),h(b,E,S))}),mergeValues:(b,S)=>b===!0?!0:{...b,...S},resultToName:_}),items:p({mergeNames:(b,S,E)=>b.if((0,t._)`${E} !== true && ${S} !== undefined`,()=>b.assign(E,(0,t._)`${S} === true ? true : ${E} > ${S} ? ${E} : ${S}`)),mergeToName:(b,S,E)=>b.if((0,t._)`${E} !== true`,()=>b.assign(E,S===!0?!0:(0,t._)`${E} > ${S} ? ${E} : ${S}`)),mergeValues:(b,S)=>b===!0?!0:Math.max(b,S),resultToName:(b,S)=>b.var("items",S)})};function _(b,S){if(S===!0)return b.var("props",!0);let E=b.var("props",(0,t._)`{}`);return S!==void 0&&h(b,E,S),E}e.evaluatedPropsToName=_;function h(b,S,E){Object.keys(E).forEach(j=>b.assign((0,t._)`${S}${(0,t.getProperty)(j)}`,!0))}e.setEvaluated=h;let f={};function z(b,S){return b.scopeValue("func",{ref:S,code:f[S.code]||(f[S.code]=new r._Code(S.code))})}e.useFunc=z;var y;(function(b){b[b.Num=0]="Num",b[b.Str=1]="Str"})(y||(e.Type=y={}));function R(b,S,E){if(b instanceof t.Name){let j=S===y.Num;return E?j?(0,t._)`"[" + ${b} + "]"`:(0,t._)`"['" + ${b} + "']"`:j?(0,t._)`"/" + ${b}`:(0,t._)`"/" + ${b}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,t.getProperty)(b).toString():"/"+m(b)}e.getErrorPath=R;function w(b,S,E=b.opts.strictSchema){if(E){if(S=`strict mode: ${S}`,E===!0)throw new Error(S);b.self.logger.warn(S)}}e.checkStrictMode=w})),dt=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),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})),Ka=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=le(),r=_e(),o=dt();e.keywordError={message:({keyword:h})=>(0,t.str)`must pass "${h}" keyword validation`},e.keyword$DataError={message:({keyword:h,schemaType:f})=>f?(0,t.str)`"${h}" keyword must be ${f} ($data)`:(0,t.str)`"${h}" keyword is invalid ($data)`};function n(h,f=e.keywordError,z,y){let{it:R}=h,{gen:w,compositeRule:b,allErrors:S}=R,E=m(h,f,z);y??(b||S)?a(w,E):u(R,(0,t._)`[${E}]`)}e.reportError=n;function s(h,f=e.keywordError,z){let{it:y}=h,{gen:R,compositeRule:w,allErrors:b}=y;a(R,m(h,f,z)),w||b||u(y,o.default.vErrors)}e.reportExtraError=s;function i(h,f){h.assign(o.default.errors,f),h.if((0,t._)`${o.default.vErrors} !== null`,()=>h.if(f,()=>h.assign((0,t._)`${o.default.vErrors}.length`,f),()=>h.assign(o.default.vErrors,null)))}e.resetErrorsCount=i;function c({gen:h,keyword:f,schemaValue:z,data:y,errsCount:R,it:w}){if(R===void 0)throw new Error("ajv implementation error");let b=h.name("err");h.forRange("i",R,o.default.errors,S=>{h.const(b,(0,t._)`${o.default.vErrors}[${S}]`),h.if((0,t._)`${b}.instancePath === undefined`,()=>h.assign((0,t._)`${b}.instancePath`,(0,t.strConcat)(o.default.instancePath,w.errorPath))),h.assign((0,t._)`${b}.schemaPath`,(0,t.str)`${w.errSchemaPath}/${f}`),w.opts.verbose&&(h.assign((0,t._)`${b}.schema`,z),h.assign((0,t._)`${b}.data`,y))})}e.extendErrors=c;function a(h,f){let z=h.const("err",f);h.if((0,t._)`${o.default.vErrors} === null`,()=>h.assign(o.default.vErrors,(0,t._)`[${z}]`),(0,t._)`${o.default.vErrors}.push(${z})`),h.code((0,t._)`${o.default.errors}++`)}function u(h,f){let{gen:z,validateName:y,schemaEnv:R}=h;R.$async?z.throw((0,t._)`new ${h.ValidationError}(${f})`):(z.assign((0,t._)`${y}.errors`,f),z.return(!1))}let d={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 m(h,f,z){let{createErrors:y}=h.it;return y===!1?(0,t._)`{}`:g(h,f,z)}function g(h,f,z={}){let{gen:y,it:R}=h,w=[v(R,z),p(h,z)];return _(h,f,w),y.object(...w)}function v({errorPath:h},{instancePath:f}){let z=f?(0,t.str)`${h}${(0,r.getErrorPath)(f,r.Type.Str)}`:h;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,z)]}function p({keyword:h,it:{errSchemaPath:f}},{schemaPath:z,parentSchema:y}){let R=y?f:(0,t.str)`${f}/${h}`;return z&&(R=(0,t.str)`${R}${(0,r.getErrorPath)(z,r.Type.Str)}`),[d.schemaPath,R]}function _(h,{params:f,message:z},y){let{keyword:R,data:w,schemaValue:b,it:S}=h,{opts:E,propertyName:j,topSchemaRef:F,schemaPath:M}=S;y.push([d.keyword,R],[d.params,typeof f=="function"?f(h):f||(0,t._)`{}`]),E.messages&&y.push([d.message,typeof z=="function"?z(h):z]),E.verbose&&y.push([d.schema,b],[d.parentSchema,(0,t._)`${F}${M}`],[o.default.data,w]),j&&y.push([d.propertyName,j])}})),nz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=Ka(),r=le(),o=dt(),n={message:"boolean schema is false"};function s(a){let{gen:u,schema:d,validateName:m}=a;d===!1?c(a,!1):typeof d=="object"&&d.$async===!0?u.return(o.default.data):(u.assign((0,r._)`${m}.errors`,null),u.return(!0))}e.topBoolOrEmptySchema=s;function i(a,u){let{gen:d,schema:m}=a;m===!1?(d.var(u,!1),c(a)):d.var(u,!0)}e.boolOrEmptySchema=i;function c(a,u){let{gen:d,data:m}=a,g={gen:d,keyword:"false schema",data:m,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,t.reportError)(g,n,void 0,u)}})),Wg=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);function r(n){return typeof n=="string"&&t.has(n)}e.isJSONType=r;function o(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=o})),Yg=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:s},i){let c=s.RULES.types[i];return c&&c!==!0&&r(n,c)}e.schemaHasRulesForType=t;function r(n,s){return s.rules.some(i=>o(n,i))}e.shouldUseGroup=r;function o(n,s){var i;return n[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some(c=>n[c]!==void 0))}e.shouldUseRule=o})),Ba=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let t=Wg(),r=Yg(),o=Ka(),n=le(),s=_e();var i;(function(y){y[y.Correct=0]="Correct",y[y.Wrong=1]="Wrong"})(i||(e.DataType=i={}));function c(y){let R=a(y.type);if(R.includes("null")){if(y.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!R.length&&y.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');y.nullable===!0&&R.push("null")}return R}e.getSchemaTypes=c;function a(y){let R=Array.isArray(y)?y:y?[y]:[];if(R.every(t.isJSONType))return R;throw new Error("type must be JSONType or JSONType[]: "+R.join(","))}e.getJSONTypes=a;function u(y,R){let{gen:w,data:b,opts:S}=y,E=m(R,S.coerceTypes),j=R.length>0&&!(E.length===0&&R.length===1&&(0,r.schemaHasRulesForType)(y,R[0]));if(j){let F=_(R,b,S.strictNumbers,i.Wrong);w.if(F,()=>{E.length?g(y,R,E):f(y)})}return j}e.coerceAndCheckDataType=u;let d=new Set(["string","number","integer","boolean","null"]);function m(y,R){return R?y.filter(w=>d.has(w)||R==="array"&&w==="array"):[]}function g(y,R,w){let{gen:b,data:S,opts:E}=y,j=b.let("dataType",(0,n._)`typeof ${S}`),F=b.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&b.if((0,n._)`${j} == 'object' && Array.isArray(${S}) && ${S}.length == 1`,()=>b.assign(S,(0,n._)`${S}[0]`).assign(j,(0,n._)`typeof ${S}`).if(_(R,S,E.strictNumbers),()=>b.assign(F,S))),b.if((0,n._)`${F} !== undefined`);for(let Z of w)(d.has(Z)||Z==="array"&&E.coerceTypes==="array")&&M(Z);b.else(),f(y),b.endIf(),b.if((0,n._)`${F} !== undefined`,()=>{b.assign(S,F),v(y,F)});function M(Z){switch(Z){case"string":b.elseIf((0,n._)`${j} == "number" || ${j} == "boolean"`).assign(F,(0,n._)`"" + ${S}`).elseIf((0,n._)`${S} === null`).assign(F,(0,n._)`""`);return;case"number":b.elseIf((0,n._)`${j} == "boolean" || ${S} === null
|
|
63
|
+
|| (${j} == "string" && ${S} && ${S} == +${S})`).assign(F,(0,n._)`+${S}`);return;case"integer":b.elseIf((0,n._)`${j} === "boolean" || ${S} === null
|
|
64
|
+
|| (${j} === "string" && ${S} && ${S} == +${S} && !(${S} % 1))`).assign(F,(0,n._)`+${S}`);return;case"boolean":b.elseIf((0,n._)`${S} === "false" || ${S} === 0 || ${S} === null`).assign(F,!1).elseIf((0,n._)`${S} === "true" || ${S} === 1`).assign(F,!0);return;case"null":b.elseIf((0,n._)`${S} === "" || ${S} === 0 || ${S} === false`),b.assign(F,null);return;case"array":b.elseIf((0,n._)`${j} === "string" || ${j} === "number"
|
|
65
|
+
|| ${j} === "boolean" || ${S} === null`).assign(F,(0,n._)`[${S}]`)}}}function v({gen:y,parentData:R,parentDataProperty:w},b){y.if((0,n._)`${R} !== undefined`,()=>y.assign((0,n._)`${R}[${w}]`,b))}function p(y,R,w,b=i.Correct){let S=b===i.Correct?n.operators.EQ:n.operators.NEQ,E;switch(y){case"null":return(0,n._)`${R} ${S} null`;case"array":E=(0,n._)`Array.isArray(${R})`;break;case"object":E=(0,n._)`${R} && typeof ${R} == "object" && !Array.isArray(${R})`;break;case"integer":E=j((0,n._)`!(${R} % 1) && !isNaN(${R})`);break;case"number":E=j();break;default:return(0,n._)`typeof ${R} ${S} ${y}`}return b===i.Correct?E:(0,n.not)(E);function j(F=n.nil){return(0,n.and)((0,n._)`typeof ${R} == "number"`,F,w?(0,n._)`isFinite(${R})`:n.nil)}}e.checkDataType=p;function _(y,R,w,b){if(y.length===1)return p(y[0],R,w,b);let S,E=(0,s.toHash)(y);if(E.array&&E.object){let j=(0,n._)`typeof ${R} != "object"`;S=E.null?j:(0,n._)`!${R} || ${j}`,delete E.null,delete E.array,delete E.object}else S=n.nil;E.number&&delete E.integer;for(let j in E)S=(0,n.and)(S,p(j,R,w,b));return S}e.checkDataTypes=_;let h={message:({schema:y})=>`must be ${y}`,params:({schema:y,schemaValue:R})=>typeof y=="string"?(0,n._)`{type: ${y}}`:(0,n._)`{type: ${R}}`};function f(y){let R=z(y);(0,o.reportError)(R,h)}e.reportTypeError=f;function z(y){let{gen:R,data:w,schema:b}=y,S=(0,s.schemaRefOrVal)(y,b,"type");return{gen:R,keyword:"type",data:w,schema:b.type,schemaCode:S,schemaValue:S,parentSchema:b,params:{},it:y}}})),sz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=le(),r=_e();function o(s,i){let{properties:c,items:a}=s.schema;if(i==="object"&&c)for(let u in c)n(s,u,c[u].default);else i==="array"&&Array.isArray(a)&&a.forEach((u,d)=>n(s,d,u.default))}e.assignDefaults=o;function n(s,i,c){let{gen:a,compositeRule:u,data:d,opts:m}=s;if(c===void 0)return;let g=(0,t._)`${d}${(0,t.getProperty)(i)}`;if(u){(0,r.checkStrictMode)(s,`default is ignored for: ${g}`);return}let v=(0,t._)`${g} === undefined`;m.useDefaults==="empty"&&(v=(0,t._)`${v} || ${g} === null || ${g} === ""`),a.if(v,(0,t._)`${g} = ${(0,t.stringify)(c)}`)}})),pt=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=le(),r=_e(),o=dt(),n=_e();function s(y,R){let{gen:w,data:b,it:S}=y;w.if(m(w,b,R,S.opts.ownProperties),()=>{y.setParams({missingProperty:(0,t._)`${R}`},!0),y.error()})}e.checkReportMissingProp=s;function i({gen:y,data:R,it:{opts:w}},b,S){return(0,t.or)(...b.map(E=>(0,t.and)(m(y,R,E,w.ownProperties),(0,t._)`${S} = ${E}`)))}e.checkMissingProp=i;function c(y,R){y.setParams({missingProperty:R},!0),y.error()}e.reportMissingProp=c;function a(y){return y.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=a;function u(y,R,w){return(0,t._)`${a(y)}.call(${R}, ${w})`}e.isOwnProperty=u;function d(y,R,w,b){let S=(0,t._)`${R}${(0,t.getProperty)(w)} !== undefined`;return b?(0,t._)`${S} && ${u(y,R,w)}`:S}e.propertyInData=d;function m(y,R,w,b){let S=(0,t._)`${R}${(0,t.getProperty)(w)} === undefined`;return b?(0,t.or)(S,(0,t.not)(u(y,R,w))):S}e.noPropertyInData=m;function g(y){return y?Object.keys(y).filter(R=>R!=="__proto__"):[]}e.allSchemaProperties=g;function v(y,R){return g(R).filter(w=>!(0,r.alwaysValidSchema)(y,R[w]))}e.schemaProperties=v;function p({schemaCode:y,data:R,it:{gen:w,topSchemaRef:b,schemaPath:S,errorPath:E},it:j},F,M,Z){let Y=Z?(0,t._)`${y}, ${R}, ${b}${S}`:R,G=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,E)],[o.default.parentData,j.parentData],[o.default.parentDataProperty,j.parentDataProperty],[o.default.rootData,o.default.rootData]];j.opts.dynamicRef&&G.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let fe=(0,t._)`${Y}, ${w.object(...G)}`;return M!==t.nil?(0,t._)`${F}.call(${M}, ${fe})`:(0,t._)`${F}(${fe})`}e.callValidateCode=p;let _=(0,t._)`new RegExp`;function h({gen:y,it:{opts:R}},w){let b=R.unicodeRegExp?"u":"",{regExp:S}=R.code,E=S(w,b);return y.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,t._)`${S.code==="new RegExp"?_:(0,n.useFunc)(y,S)}(${w}, ${b})`})}e.usePattern=h;function f(y){let{gen:R,data:w,keyword:b,it:S}=y,E=R.name("valid");if(S.allErrors){let F=R.let("valid",!0);return j(()=>R.assign(F,!1)),F}return R.var(E,!0),j(()=>R.break()),E;function j(F){let M=R.const("len",(0,t._)`${w}.length`);R.forRange("i",0,M,Z=>{y.subschema({keyword:b,dataProp:Z,dataPropType:r.Type.Num},E),R.if((0,t.not)(E),F)})}}e.validateArray=f;function z(y){let{gen:R,schema:w,keyword:b,it:S}=y;if(!Array.isArray(w))throw new Error("ajv implementation error");if(w.some(F=>(0,r.alwaysValidSchema)(S,F))&&!S.opts.unevaluated)return;let E=R.let("valid",!1),j=R.name("_valid");R.block(()=>w.forEach((F,M)=>{let Z=y.subschema({keyword:b,schemaProp:M,compositeRule:!0},j);R.assign(E,(0,t._)`${E} || ${j}`),y.mergeValidEvaluated(Z,j)||R.if((0,t.not)(E))})),y.result(E,()=>y.reset(),()=>y.error(!0))}e.validateUnion=z})),iz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=le(),r=dt(),o=pt(),n=Ka();function s(v,p){let{gen:_,keyword:h,schema:f,parentSchema:z,it:y}=v,R=p.macro.call(y.self,f,z,y),w=d(_,h,R);y.opts.validateSchema!==!1&&y.self.validateSchema(R,!0);let b=_.name("valid");v.subschema({schema:R,schemaPath:t.nil,errSchemaPath:`${y.errSchemaPath}/${h}`,topSchemaRef:w,compositeRule:!0},b),v.pass(b,()=>v.error(!0))}e.macroKeywordCode=s;function i(v,p){var _;let{gen:h,keyword:f,schema:z,parentSchema:y,$data:R,it:w}=v;u(w,p);let b=d(h,f,!R&&p.compile?p.compile.call(w.self,z,y,w):p.validate),S=h.let("valid");v.block$data(S,E),v.ok((_=p.valid)!==null&&_!==void 0?_:S);function E(){if(p.errors===!1)M(),p.modifying&&c(v),Z(()=>v.error());else{let Y=p.async?j():F();p.modifying&&c(v),Z(()=>a(v,Y))}}function j(){let Y=h.let("ruleErrs",null);return h.try(()=>M((0,t._)`await `),G=>h.assign(S,!1).if((0,t._)`${G} instanceof ${w.ValidationError}`,()=>h.assign(Y,(0,t._)`${G}.errors`),()=>h.throw(G))),Y}function F(){let Y=(0,t._)`${b}.errors`;return h.assign(Y,null),M(t.nil),Y}function M(Y=p.async?(0,t._)`await `:t.nil){let G=w.opts.passContext?r.default.this:r.default.self,fe=!("compile"in p&&!R||p.schema===!1);h.assign(S,(0,t._)`${Y}${(0,o.callValidateCode)(v,b,G,fe)}`,p.modifying)}function Z(Y){var G;h.if((0,t.not)((G=p.valid)!==null&&G!==void 0?G:S),Y)}}e.funcKeywordCode=i;function c(v){let{gen:p,data:_,it:h}=v;p.if(h.parentData,()=>p.assign(_,(0,t._)`${h.parentData}[${h.parentDataProperty}]`))}function a(v,p){let{gen:_}=v;_.if((0,t._)`Array.isArray(${p})`,()=>{_.assign(r.default.vErrors,(0,t._)`${r.default.vErrors} === null ? ${p} : ${r.default.vErrors}.concat(${p})`).assign(r.default.errors,(0,t._)`${r.default.vErrors}.length`),(0,n.extendErrors)(v)},()=>v.error())}function u({schemaEnv:v},p){if(p.async&&!v.$async)throw new Error("async keyword in sync schema")}function d(v,p,_){if(_===void 0)throw new Error(`keyword "${p}" failed to compile`);return v.scopeValue("keyword",typeof _=="function"?{ref:_}:{ref:_,code:(0,t.stringify)(_)})}function m(v,p,_=!1){return!p.length||p.some(h=>h==="array"?Array.isArray(v):h==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==h||_&&typeof v>"u")}e.validSchemaType=m;function g({schema:v,opts:p,self:_,errSchemaPath:h},f,z){if(Array.isArray(f.keyword)?!f.keyword.includes(z):f.keyword!==z)throw new Error("ajv implementation error");let y=f.dependencies;if(y?.some(R=>!Object.prototype.hasOwnProperty.call(v,R)))throw new Error(`parent schema must have dependencies of ${z}: ${y.join(",")}`);if(f.validateSchema&&!f.validateSchema(v[z])){let R=`keyword "${z}" value is invalid at path "${h}": `+_.errorsText(f.validateSchema.errors);if(p.validateSchema==="log")_.logger.error(R);else throw new Error(R)}}e.validateKeywordUsage=g})),az=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=le(),r=_e();function o(i,{keyword:c,schemaProp:a,schema:u,schemaPath:d,errSchemaPath:m,topSchemaRef:g}){if(c!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(c!==void 0){let v=i.schema[c];return a===void 0?{schema:v,schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(c)}`,errSchemaPath:`${i.errSchemaPath}/${c}`}:{schema:v[a],schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(c)}${(0,t.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${c}/${(0,r.escapeFragment)(a)}`}}if(u!==void 0){if(d===void 0||m===void 0||g===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:d,topSchemaRef:g,errSchemaPath:m}}throw new Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(i,c,{dataProp:a,dataPropType:u,data:d,dataTypes:m,propertyName:g}){if(d!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:v}=c;if(a!==void 0){let{errorPath:_,dataPathArr:h,opts:f}=c;p(v.let("data",(0,t._)`${c.data}${(0,t.getProperty)(a)}`,!0)),i.errorPath=(0,t.str)`${_}${(0,r.getErrorPath)(a,u,f.jsPropertySyntax)}`,i.parentDataProperty=(0,t._)`${a}`,i.dataPathArr=[...h,i.parentDataProperty]}d!==void 0&&(p(d instanceof t.Name?d:v.let("data",d,!0)),g!==void 0&&(i.propertyName=g)),m&&(i.dataTypes=m);function p(_){i.data=_,i.dataLevel=c.dataLevel+1,i.dataTypes=[],c.definedProperties=new Set,i.parentData=c.data,i.dataNames=[...c.dataNames,_]}}e.extendSubschemaData=n;function s(i,{jtdDiscriminator:c,jtdMetadata:a,compositeRule:u,createErrors:d,allErrors:m}){u!==void 0&&(i.compositeRule=u),d!==void 0&&(i.createErrors=d),m!==void 0&&(i.allErrors=m),i.jtdDiscriminator=c,i.jtdMetadata=a}e.extendSubschemaMode=s})),Xg=U(((e,t)=>{t.exports=function r(o,n){if(o===n)return!0;if(o&&n&&typeof o=="object"&&typeof n=="object"){if(o.constructor!==n.constructor)return!1;var s,i,c;if(Array.isArray(o)){if(s=o.length,s!=n.length)return!1;for(i=s;i--!==0;)if(!r(o[i],n[i]))return!1;return!0}if(o.constructor===RegExp)return o.source===n.source&&o.flags===n.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===n.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===n.toString();if(c=Object.keys(o),s=c.length,s!==Object.keys(n).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,c[i]))return!1;for(i=s;i--!==0;){var a=c[i];if(!r(o[a],n[a]))return!1}return!0}return o!==o&&n!==n}})),cz=U(((e,t)=>{var r=t.exports=function(s,i,c){typeof i=="function"&&(c=i,i={}),c=i.cb||c;var a=typeof c=="function"?c:c.pre||function(){},u=c.post||function(){};o(i,a,u,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function o(s,i,c,a,u,d,m,g,v,p){if(a&&typeof a=="object"&&!Array.isArray(a)){i(a,u,d,m,g,v,p);for(var _ in a){var h=a[_];if(Array.isArray(h)){if(_ in r.arrayKeywords)for(var f=0;f<h.length;f++)o(s,i,c,h[f],u+"/"+_+"/"+f,d,u,_,a,f)}else if(_ in r.propsKeywords){if(h&&typeof h=="object")for(var z in h)o(s,i,c,h[z],u+"/"+_+"/"+n(z),d,u,_,a,z)}else(_ in r.keywords||s.allKeys&&!(_ in r.skipKeywords))&&o(s,i,c,h,u+"/"+_,d,u,_,a)}c(a,u,d,m,g,v,p)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}})),Ga=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=_e(),r=Xg(),o=cz(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(h,f=!0){return typeof h=="boolean"?!0:f===!0?!c(h):f?a(h)<=f:!1}e.inlineRef=s;let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(h){for(let f in h){if(i.has(f))return!0;let z=h[f];if(Array.isArray(z)&&z.some(c)||typeof z=="object"&&c(z))return!0}return!1}function a(h){let f=0;for(let z in h){if(z==="$ref")return 1/0;if(f++,!n.has(z)&&(typeof h[z]=="object"&&(0,t.eachItem)(h[z],y=>f+=a(y)),f===1/0))return 1/0}return f}function u(h,f="",z){return z!==!1&&(f=g(f)),d(h,h.parse(f))}e.getFullPath=u;function d(h,f){return h.serialize(f).split("#")[0]+"#"}e._getFullPath=d;let m=/#\/?$/;function g(h){return h?h.replace(m,""):""}e.normalizeId=g;function v(h,f,z){return z=g(z),h.resolve(f,z)}e.resolveUrl=v;let p=/^[a-z_][-a-z0-9._]*$/i;function _(h,f){if(typeof h=="boolean")return{};let{schemaId:z,uriResolver:y}=this.opts,R=g(h[z]||f),w={"":R},b=u(y,R,!1),S={},E=new Set;return o(h,{allKeys:!0},(M,Z,Y,G)=>{if(G===void 0)return;let fe=b+Z,$e=w[G];typeof M[z]=="string"&&($e=be.call(this,M[z])),Oe.call(this,M.$anchor),Oe.call(this,M.$dynamicAnchor),w[Z]=$e;function be(he){let k=this.opts.uriResolver.resolve;if(he=g($e?k($e,he):he),E.has(he))throw F(he);E.add(he);let x=this.refs[he];return typeof x=="string"&&(x=this.refs[x]),typeof x=="object"?j(M,x.schema,he):he!==g(fe)&&(he[0]==="#"?(j(M,S[he],he),S[he]=M):this.refs[he]=fe),he}function Oe(he){if(typeof he=="string"){if(!p.test(he))throw new Error(`invalid anchor "${he}"`);be.call(this,`#${he}`)}}}),S;function j(M,Z,Y){if(Z!==void 0&&!r(M,Z))throw F(Y)}function F(M){return new Error(`reference "${M}" resolves to more than one schema`)}}e.getSchemaRefs=_})),so=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=nz(),r=Ba(),o=Yg(),n=Ba(),s=sz(),i=iz(),c=az(),a=le(),u=dt(),d=Ga(),m=_e(),g=Ka();function v(T){if(b(T)&&(E(T),w(T))){f(T);return}p(T,()=>(0,t.topBoolOrEmptySchema)(T))}e.validateFunctionCode=v;function p({gen:T,validateName:A,schema:D,schemaEnv:ne,opts:se},de){se.code.es5?T.func(A,(0,a._)`${u.default.data}, ${u.default.valCxt}`,ne.$async,()=>{T.code((0,a._)`"use strict"; ${y(D,se)}`),h(T,se),T.code(de)}):T.func(A,(0,a._)`${u.default.data}, ${_(se)}`,ne.$async,()=>T.code(y(D,se)).code(de))}function _(T){return(0,a._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${T.dynamicRef?(0,a._)`, ${u.default.dynamicAnchors}={}`:a.nil}}={}`}function h(T,A){T.if(u.default.valCxt,()=>{T.var(u.default.instancePath,(0,a._)`${u.default.valCxt}.${u.default.instancePath}`),T.var(u.default.parentData,(0,a._)`${u.default.valCxt}.${u.default.parentData}`),T.var(u.default.parentDataProperty,(0,a._)`${u.default.valCxt}.${u.default.parentDataProperty}`),T.var(u.default.rootData,(0,a._)`${u.default.valCxt}.${u.default.rootData}`),A.dynamicRef&&T.var(u.default.dynamicAnchors,(0,a._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{T.var(u.default.instancePath,(0,a._)`""`),T.var(u.default.parentData,(0,a._)`undefined`),T.var(u.default.parentDataProperty,(0,a._)`undefined`),T.var(u.default.rootData,u.default.data),A.dynamicRef&&T.var(u.default.dynamicAnchors,(0,a._)`{}`)})}function f(T){let{schema:A,opts:D,gen:ne}=T;p(T,()=>{D.$comment&&A.$comment&&G(T),M(T),ne.let(u.default.vErrors,null),ne.let(u.default.errors,0),D.unevaluated&&z(T),j(T),fe(T)})}function z(T){let{gen:A,validateName:D}=T;T.evaluated=A.const("evaluated",(0,a._)`${D}.evaluated`),A.if((0,a._)`${T.evaluated}.dynamicProps`,()=>A.assign((0,a._)`${T.evaluated}.props`,(0,a._)`undefined`)),A.if((0,a._)`${T.evaluated}.dynamicItems`,()=>A.assign((0,a._)`${T.evaluated}.items`,(0,a._)`undefined`))}function y(T,A){let D=typeof T=="object"&&T[A.schemaId];return D&&(A.code.source||A.code.process)?(0,a._)`/*# sourceURL=${D} */`:a.nil}function R(T,A){if(b(T)&&(E(T),w(T))){S(T,A);return}(0,t.boolOrEmptySchema)(T,A)}function w({schema:T,self:A}){if(typeof T=="boolean")return!T;for(let D in T)if(A.RULES.all[D])return!0;return!1}function b(T){return typeof T.schema!="boolean"}function S(T,A){let{schema:D,gen:ne,opts:se}=T;se.$comment&&D.$comment&&G(T),Z(T),Y(T);let de=ne.const("_errs",u.default.errors);j(T,de),ne.var(A,(0,a._)`${de} === ${u.default.errors}`)}function E(T){(0,m.checkUnknownRules)(T),F(T)}function j(T,A){if(T.opts.jtd)return be(T,[],!1,A);let D=(0,r.getSchemaTypes)(T.schema);be(T,D,!(0,r.coerceAndCheckDataType)(T,D),A)}function F(T){let{schema:A,errSchemaPath:D,opts:ne,self:se}=T;A.$ref&&ne.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(A,se.RULES)&&se.logger.warn(`$ref: keywords ignored in schema at path "${D}"`)}function M(T){let{schema:A,opts:D}=T;A.default!==void 0&&D.useDefaults&&D.strictSchema&&(0,m.checkStrictMode)(T,"default is ignored in the schema root")}function Z(T){let A=T.schema[T.opts.schemaId];A&&(T.baseId=(0,d.resolveUrl)(T.opts.uriResolver,T.baseId,A))}function Y(T){if(T.schema.$async&&!T.schemaEnv.$async)throw new Error("async schema in sync schema")}function G({gen:T,schemaEnv:A,schema:D,errSchemaPath:ne,opts:se}){let de=D.$comment;if(se.$comment===!0)T.code((0,a._)`${u.default.self}.logger.log(${de})`);else if(typeof se.$comment=="function"){let ke=(0,a.str)`${ne}/$comment`,je=T.scopeValue("root",{ref:A.root});T.code((0,a._)`${u.default.self}.opts.$comment(${de}, ${ke}, ${je}.schema)`)}}function fe(T){let{gen:A,schemaEnv:D,validateName:ne,ValidationError:se,opts:de}=T;D.$async?A.if((0,a._)`${u.default.errors} === 0`,()=>A.return(u.default.data),()=>A.throw((0,a._)`new ${se}(${u.default.vErrors})`)):(A.assign((0,a._)`${ne}.errors`,u.default.vErrors),de.unevaluated&&$e(T),A.return((0,a._)`${u.default.errors} === 0`))}function $e({gen:T,evaluated:A,props:D,items:ne}){D instanceof a.Name&&T.assign((0,a._)`${A}.props`,D),ne instanceof a.Name&&T.assign((0,a._)`${A}.items`,ne)}function be(T,A,D,ne){let{gen:se,schema:de,data:ke,allErrors:je,opts:Ze,self:Ne}=T,{RULES:we}=Ne;if(de.$ref&&(Ze.ignoreKeywordsWithRef||!(0,m.schemaHasRulesButRef)(de,we))){se.block(()=>pe(T,"$ref",we.all.$ref.definition));return}Ze.jtd||he(T,A),se.block(()=>{for(let Ae of we.rules)ot(Ae);ot(we.post)});function ot(Ae){(0,o.shouldUseGroup)(de,Ae)&&(Ae.type?(se.if((0,n.checkDataType)(Ae.type,ke,Ze.strictNumbers)),Oe(T,Ae),A.length===1&&A[0]===Ae.type&&D&&(se.else(),(0,n.reportTypeError)(T)),se.endIf()):Oe(T,Ae),je||se.if((0,a._)`${u.default.errors} === ${ne||0}`))}}function Oe(T,A){let{gen:D,schema:ne,opts:{useDefaults:se}}=T;se&&(0,s.assignDefaults)(T,A.type),D.block(()=>{for(let de of A.rules)(0,o.shouldUseRule)(ne,de)&&pe(T,de.keyword,de.definition,A.type)})}function he(T,A){T.schemaEnv.meta||!T.opts.strictTypes||(k(T,A),T.opts.allowUnionTypes||x(T,A),V(T,T.dataTypes))}function k(T,A){if(A.length){if(!T.dataTypes.length){T.dataTypes=A;return}A.forEach(D=>{C(T.dataTypes,D)||J(T,`type "${D}" not allowed by context "${T.dataTypes.join(",")}"`)}),N(T,A)}}function x(T,A){A.length>1&&!(A.length===2&&A.includes("null"))&&J(T,"use allowUnionTypes to allow union type keyword")}function V(T,A){let D=T.self.RULES.all;for(let ne in D){let se=D[ne];if(typeof se=="object"&&(0,o.shouldUseRule)(T.schema,se)){let{type:de}=se.definition;de.length&&!de.some(ke=>$(A,ke))&&J(T,`missing type "${de.join(",")}" for keyword "${ne}"`)}}}function $(T,A){return T.includes(A)||A==="number"&&T.includes("integer")}function C(T,A){return T.includes(A)||A==="integer"&&T.includes("number")}function N(T,A){let D=[];for(let ne of T.dataTypes)C(A,ne)?D.push(ne):A.includes("integer")&&ne==="number"&&D.push("integer");T.dataTypes=D}function J(T,A){let D=T.schemaEnv.baseId+T.errSchemaPath;A+=` at "${D}" (strictTypes)`,(0,m.checkStrictMode)(T,A,T.opts.strictTypes)}var ee=class{constructor(T,A,D){if((0,i.validateKeywordUsage)(T,A,D),this.gen=T.gen,this.allErrors=T.allErrors,this.keyword=D,this.data=T.data,this.schema=T.schema[D],this.$data=A.$data&&T.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.schemaRefOrVal)(T,this.schema,D,this.$data),this.schemaType=A.schemaType,this.parentSchema=T.schema,this.params={},this.it=T,this.def=A,this.$data)this.schemaCode=T.gen.const("vSchema",Je(this.$data,T));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,A.schemaType,A.allowUndefined))throw new Error(`${D} value must be ${JSON.stringify(A.schemaType)}`);("code"in A?A.trackErrors:A.errors!==!1)&&(this.errsCount=T.gen.const("_errs",u.default.errors))}result(T,A,D){this.failResult((0,a.not)(T),A,D)}failResult(T,A,D){this.gen.if(T),D?D():this.error(),A?(this.gen.else(),A(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(T,A){this.failResult((0,a.not)(T),void 0,A)}fail(T){if(T===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(T),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(T){if(!this.$data)return this.fail(T);let{schemaCode:A}=this;this.fail((0,a._)`${A} !== undefined && (${(0,a.or)(this.invalid$data(),T)})`)}error(T,A,D){if(A){this.setParams(A),this._error(T,D),this.setParams({});return}this._error(T,D)}_error(T,A){(T?g.reportExtraError:g.reportError)(this,this.def.error,A)}$dataError(){(0,g.reportError)(this,this.def.$dataError||g.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,g.resetErrorsCount)(this.gen,this.errsCount)}ok(T){this.allErrors||this.gen.if(T)}setParams(T,A){A?Object.assign(this.params,T):this.params=T}block$data(T,A,D=a.nil){this.gen.block(()=>{this.check$data(T,D),A()})}check$data(T=a.nil,A=a.nil){if(!this.$data)return;let{gen:D,schemaCode:ne,schemaType:se,def:de}=this;D.if((0,a.or)((0,a._)`${ne} === undefined`,A)),T!==a.nil&&D.assign(T,!0),(se.length||de.validateSchema)&&(D.elseIf(this.invalid$data()),this.$dataError(),T!==a.nil&&D.assign(T,!1)),D.else()}invalid$data(){let{gen:T,schemaCode:A,schemaType:D,def:ne,it:se}=this;return(0,a.or)(de(),ke());function de(){if(D.length){if(!(A instanceof a.Name))throw new Error("ajv implementation error");let je=Array.isArray(D)?D:[D];return(0,a._)`${(0,n.checkDataTypes)(je,A,se.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function ke(){if(ne.validateSchema){let je=T.scopeValue("validate$data",{ref:ne.validateSchema});return(0,a._)`!${je}(${A})`}return a.nil}}subschema(T,A){let D=(0,c.getSubschema)(this.it,T);(0,c.extendSubschemaData)(D,this.it,T),(0,c.extendSubschemaMode)(D,T);let ne={...this.it,...D,items:void 0,props:void 0};return R(ne,A),ne}mergeEvaluated(T,A){let{it:D,gen:ne}=this;D.opts.unevaluated&&(D.props!==!0&&T.props!==void 0&&(D.props=m.mergeEvaluated.props(ne,T.props,D.props,A)),D.items!==!0&&T.items!==void 0&&(D.items=m.mergeEvaluated.items(ne,T.items,D.items,A)))}mergeValidEvaluated(T,A){let{it:D,gen:ne}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return ne.if(A,()=>this.mergeEvaluated(T,a.Name)),!0}};e.KeywordCxt=ee;function pe(T,A,D,ne){let se=new ee(T,D,A);"code"in D?D.code(se,ne):se.$data&&D.validate?(0,i.funcKeywordCode)(se,D):"macro"in D?(0,i.macroKeywordCode)(se,D):(D.compile||D.validate)&&(0,i.funcKeywordCode)(se,D)}let ie=/^\/(?:[^~]|~0|~1)*$/,ze=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Je(T,{dataLevel:A,dataNames:D,dataPathArr:ne}){let se,de;if(T==="")return u.default.rootData;if(T[0]==="/"){if(!ie.test(T))throw new Error(`Invalid JSON-pointer: ${T}`);se=T,de=u.default.rootData}else{let Ne=ze.exec(T);if(!Ne)throw new Error(`Invalid JSON-pointer: ${T}`);let we=+Ne[1];if(se=Ne[2],se==="#"){if(we>=A)throw new Error(Ze("property/index",we));return ne[A-we]}if(we>A)throw new Error(Ze("data",we));if(de=D[A-we],!se)return de}let ke=de,je=se.split("/");for(let Ne of je)Ne&&(de=(0,a._)`${de}${(0,a.getProperty)((0,m.unescapeJsonPointer)(Ne))}`,ke=(0,a._)`${ke} && ${de}`);return ke;function Ze(Ne,we){return`Cannot access ${Ne} ${we} levels up, current level is ${A}`}}e.getData=Je})),qn=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}};e.default=t})),io=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ga();var r=class extends Error{constructor(o,n,s,i){super(i||`can't resolve reference ${s} from id ${n}`),this.missingRef=(0,t.resolveUrl)(o,n,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(o,this.missingRef))}};e.default=r})),Wa=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=le(),r=qn(),o=dt(),n=Ga(),s=_e(),i=so();var c=class{constructor(f){var z;this.refs={},this.dynamicAnchors={};let y;typeof f.schema=="object"&&(y=f.schema),this.schema=f.schema,this.schemaId=f.schemaId,this.root=f.root||this,this.baseId=(z=f.baseId)!==null&&z!==void 0?z:(0,n.normalizeId)(y?.[f.schemaId||"$id"]),this.schemaPath=f.schemaPath,this.localRefs=f.localRefs,this.meta=f.meta,this.$async=y?.$async,this.refs={}}};e.SchemaEnv=c;function a(f){let z=m.call(this,f);if(z)return z;let y=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:R,lines:w}=this.opts.code,{ownProperties:b}=this.opts,S=new t.CodeGen(this.scope,{es5:R,lines:w,ownProperties:b}),E;f.$async&&(E=S.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let j=S.scopeName("validate");f.validateName=j;let F={gen:S,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:S.scopeValue("schema",this.opts.code.source===!0?{ref:f.schema,code:(0,t.stringify)(f.schema)}:{ref:f.schema}),validateName:j,ValidationError:E,schema:f.schema,schemaEnv:f,rootId:y,baseId:f.baseId||y,schemaPath:t.nil,errSchemaPath:f.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this},M;try{this._compilations.add(f),(0,i.validateFunctionCode)(F),S.optimize(this.opts.code.optimize);let Z=S.toString();M=`${S.scopeRefs(o.default.scope)}return ${Z}`,this.opts.code.process&&(M=this.opts.code.process(M,f));let Y=new Function(`${o.default.self}`,`${o.default.scope}`,M)(this,this.scope.get());if(this.scope.value(j,{ref:Y}),Y.errors=null,Y.schema=f.schema,Y.schemaEnv=f,f.$async&&(Y.$async=!0),this.opts.code.source===!0&&(Y.source={validateName:j,validateCode:Z,scopeValues:S._values}),this.opts.unevaluated){let{props:G,items:fe}=F;Y.evaluated={props:G instanceof t.Name?void 0:G,items:fe instanceof t.Name?void 0:fe,dynamicProps:G instanceof t.Name,dynamicItems:fe instanceof t.Name},Y.source&&(Y.source.evaluated=(0,t.stringify)(Y.evaluated))}return f.validate=Y,f}catch(Z){throw delete f.validate,delete f.validateName,M&&this.logger.error("Error compiling schema, function code:",M),Z}finally{this._compilations.delete(f)}}e.compileSchema=a;function u(f,z,y){var R;y=(0,n.resolveUrl)(this.opts.uriResolver,z,y);let w=f.refs[y];if(w)return w;let b=v.call(this,f,y);if(b===void 0){let S=(R=f.localRefs)===null||R===void 0?void 0:R[y],{schemaId:E}=this.opts;S&&(b=new c({schema:S,schemaId:E,root:f,baseId:z}))}if(b!==void 0)return f.refs[y]=d.call(this,b)}e.resolveRef=u;function d(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:a.call(this,f)}function m(f){for(let z of this._compilations)if(g(z,f))return z}e.getCompilingSchema=m;function g(f,z){return f.schema===z.schema&&f.root===z.root&&f.baseId===z.baseId}function v(f,z){let y;for(;typeof(y=this.refs[z])=="string";)z=y;return y||this.schemas[z]||p.call(this,f,z)}function p(f,z){let y=this.opts.uriResolver.parse(z),R=(0,n._getFullPath)(this.opts.uriResolver,y),w=(0,n.getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&R===w)return h.call(this,y,f);let b=(0,n.normalizeId)(R),S=this.refs[b]||this.schemas[b];if(typeof S=="string"){let E=p.call(this,f,S);return typeof E?.schema!="object"?void 0:h.call(this,y,E)}if(typeof S?.schema=="object"){if(S.validate||a.call(this,S),b===(0,n.normalizeId)(z)){let{schema:E}=S,{schemaId:j}=this.opts,F=E[j];return F&&(w=(0,n.resolveUrl)(this.opts.uriResolver,w,F)),new c({schema:E,schemaId:j,root:f,baseId:w})}return h.call(this,y,S)}}e.resolveSchema=p;let _=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(f,{baseId:z,schema:y,root:R}){var w;if(((w=f.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let E of f.fragment.slice(1).split("/")){if(typeof y=="boolean")return;let j=y[(0,s.unescapeFragment)(E)];if(j===void 0)return;y=j;let F=typeof y=="object"&&y[this.opts.schemaId];!_.has(E)&&F&&(z=(0,n.resolveUrl)(this.opts.uriResolver,z,F))}let b;if(typeof y!="boolean"&&y.$ref&&!(0,s.schemaHasRulesButRef)(y,this.RULES)){let E=(0,n.resolveUrl)(this.opts.uriResolver,z,y.$ref);b=p.call(this,R,E)}let{schemaId:S}=this.opts;if(b=b||new c({schema:y,schemaId:S,root:R,baseId:z}),b.schema!==b.root.schema)return b}})),uz=U(((e,t)=>{t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}})),Qg=U(((e,t)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(p){let _="",h=0,f=0;for(f=0;f<p.length;f++)if(h=p[f].charCodeAt(0),h!==48){if(!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";_+=p[f];break}for(f+=1;f<p.length;f++){if(h=p[f].charCodeAt(0),!(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))return"";_+=p[f]}return _}let s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(p){return p.length=0,!0}function c(p,_,h){if(p.length){let f=n(p);if(f!=="")_.push(f);else return h.error=!0,!1;p.length=0}return!0}function a(p){let _=0,h={error:!1,address:"",zone:""},f=[],z=[],y=!1,R=!1,w=c;for(let b=0;b<p.length;b++){let S=p[b];if(!(S==="["||S==="]"))if(S===":"){if(y===!0&&(R=!0),!w(z,f,h))break;if(++_>7){h.error=!0;break}b>0&&p[b-1]===":"&&(y=!0),f.push(":");continue}else if(S==="%"){if(!w(z,f,h))break;w=i}else{z.push(S);continue}}return z.length&&(w===i?h.zone=z.join(""):R?f.push(z.join("")):f.push(n(z))),h.address=f.join(""),h}function u(p){if(d(p,":")<2)return{host:p,isIPV6:!1};let _=a(p);if(_.error)return{host:p,isIPV6:!1};{let h=_.address,f=_.address;return _.zone&&(h+="%"+_.zone,f+="%25"+_.zone),{host:h,isIPV6:!0,escapedHost:f}}}function d(p,_){let h=0;for(let f=0;f<p.length;f++)p[f]===_&&h++;return h}function m(p){let _=p,h=[],f=-1,z=0;for(;z=_.length;){if(z===1){if(_===".")break;if(_==="/"){h.push("/");break}else{h.push(_);break}}else if(z===2){if(_[0]==="."){if(_[1]===".")break;if(_[1]==="/"){_=_.slice(2);continue}}else if(_[0]==="/"&&(_[1]==="."||_[1]==="/")){h.push("/");break}}else if(z===3&&_==="/.."){h.length!==0&&h.pop(),h.push("/");break}if(_[0]==="."){if(_[1]==="."){if(_[2]==="/"){_=_.slice(3);continue}}else if(_[1]==="/"){_=_.slice(2);continue}}else if(_[0]==="/"&&_[1]==="."){if(_[2]==="/"){_=_.slice(2);continue}else if(_[2]==="."&&_[3]==="/"){_=_.slice(3),h.length!==0&&h.pop();continue}}if((f=_.indexOf("/",1))===-1){h.push(_);break}else h.push(_.slice(0,f)),_=_.slice(f)}return h.join("")}function g(p,_){let h=_!==!0?escape:unescape;return p.scheme!==void 0&&(p.scheme=h(p.scheme)),p.userinfo!==void 0&&(p.userinfo=h(p.userinfo)),p.host!==void 0&&(p.host=h(p.host)),p.path!==void 0&&(p.path=h(p.path)),p.query!==void 0&&(p.query=h(p.query)),p.fragment!==void 0&&(p.fragment=h(p.fragment)),p}function v(p){let _=[];if(p.userinfo!==void 0&&(_.push(p.userinfo),_.push("@")),p.host!==void 0){let h=unescape(p.host);if(!o(h)){let f=u(h);f.isIPV6===!0?h=`[${f.escapedHost}]`:h=p.host}_.push(h)}return(typeof p.port=="number"||typeof p.port=="string")&&(_.push(":"),_.push(String(p.port))),_.length?_.join(""):void 0}t.exports={nonSimpleDomain:s,recomposeAuthority:v,normalizeComponentEncoding:g,removeDotSegments:m,isIPv4:o,isUUID:r,normalizeIPv6:u,stringArrayToHexStripped:n}})),lz=U(((e,t)=>{let{isUUID:r}=Qg(),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(S){return n.indexOf(S)!==-1}function i(S){return S.secure===!0?!0:S.secure===!1?!1:S.scheme?S.scheme.length===3&&(S.scheme[0]==="w"||S.scheme[0]==="W")&&(S.scheme[1]==="s"||S.scheme[1]==="S")&&(S.scheme[2]==="s"||S.scheme[2]==="S"):!1}function c(S){return S.host||(S.error=S.error||"HTTP URIs must have a host."),S}function a(S){let E=String(S.scheme).toLowerCase()==="https";return(S.port===(E?443:80)||S.port==="")&&(S.port=void 0),S.path||(S.path="/"),S}function u(S){return S.secure=i(S),S.resourceName=(S.path||"/")+(S.query?"?"+S.query:""),S.path=void 0,S.query=void 0,S}function d(S){if((S.port===(i(S)?443:80)||S.port==="")&&(S.port=void 0),typeof S.secure=="boolean"&&(S.scheme=S.secure?"wss":"ws",S.secure=void 0),S.resourceName){let[E,j]=S.resourceName.split("?");S.path=E&&E!=="/"?E:void 0,S.query=j,S.resourceName=void 0}return S.fragment=void 0,S}function m(S,E){if(!S.path)return S.error="URN can not be parsed",S;let j=S.path.match(o);if(j){let F=E.scheme||S.scheme||"urn";S.nid=j[1].toLowerCase(),S.nss=j[2];let M=b(`${F}:${E.nid||S.nid}`);S.path=void 0,M&&(S=M.parse(S,E))}else S.error=S.error||"URN can not be parsed.";return S}function g(S,E){if(S.nid===void 0)throw new Error("URN without nid cannot be serialized");let j=E.scheme||S.scheme||"urn",F=S.nid.toLowerCase(),M=b(`${j}:${E.nid||F}`);M&&(S=M.serialize(S,E));let Z=S,Y=S.nss;return Z.path=`${F||E.nid}:${Y}`,E.skipEscape=!0,Z}function v(S,E){let j=S;return j.uuid=j.nss,j.nss=void 0,!E.tolerant&&(!j.uuid||!r(j.uuid))&&(j.error=j.error||"UUID is not valid."),j}function p(S){let E=S;return E.nss=(S.uuid||"").toLowerCase(),E}let _={scheme:"http",domainHost:!0,parse:c,serialize:a},h={scheme:"https",domainHost:_.domainHost,parse:c,serialize:a},f={scheme:"ws",domainHost:!0,parse:u,serialize:d},z={scheme:"wss",domainHost:f.domainHost,parse:f.parse,serialize:f.serialize},w={http:_,https:h,ws:f,wss:z,urn:{scheme:"urn",parse:m,serialize:g,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:v,serialize:p,skipNormalize:!0}};Object.setPrototypeOf(w,null);function b(S){return S&&(w[S]||w[S.toLowerCase()])||void 0}t.exports={wsIsSecure:i,SCHEMES:w,isValidSchemeName:s,getSchemeHandler:b}})),dz=U(((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:i,nonSimpleDomain:c}=Qg(),{SCHEMES:a,getSchemeHandler:u}=lz();function d(z,y){return typeof z=="string"?z=p(h(z,y),y):typeof z=="object"&&(z=h(p(z,y),y)),z}function m(z,y,R){let w=R?Object.assign({scheme:"null"},R):{scheme:"null"},b=g(h(z,w),h(y,w),w,!0);return w.skipEscape=!0,p(b,w)}function g(z,y,R,w){let b={};return w||(z=h(p(z,R),R),y=h(p(y,R),R)),R=R||{},!R.tolerant&&y.scheme?(b.scheme=y.scheme,b.userinfo=y.userinfo,b.host=y.host,b.port=y.port,b.path=o(y.path||""),b.query=y.query):(y.userinfo!==void 0||y.host!==void 0||y.port!==void 0?(b.userinfo=y.userinfo,b.host=y.host,b.port=y.port,b.path=o(y.path||""),b.query=y.query):(y.path?(y.path[0]==="/"?b.path=o(y.path):((z.userinfo!==void 0||z.host!==void 0||z.port!==void 0)&&!z.path?b.path="/"+y.path:z.path?b.path=z.path.slice(0,z.path.lastIndexOf("/")+1)+y.path:b.path=y.path,b.path=o(b.path)),b.query=y.query):(b.path=z.path,y.query!==void 0?b.query=y.query:b.query=z.query),b.userinfo=z.userinfo,b.host=z.host,b.port=z.port),b.scheme=z.scheme),b.fragment=y.fragment,b}function v(z,y,R){return typeof z=="string"?(z=unescape(z),z=p(s(h(z,R),!0),{...R,skipEscape:!0})):typeof z=="object"&&(z=p(s(z,!0),{...R,skipEscape:!0})),typeof y=="string"?(y=unescape(y),y=p(s(h(y,R),!0),{...R,skipEscape:!0})):typeof y=="object"&&(y=p(s(y,!0),{...R,skipEscape:!0})),z.toLowerCase()===y.toLowerCase()}function p(z,y){let R={host:z.host,scheme:z.scheme,userinfo:z.userinfo,port:z.port,path:z.path,query:z.query,nid:z.nid,nss:z.nss,uuid:z.uuid,fragment:z.fragment,reference:z.reference,resourceName:z.resourceName,secure:z.secure,error:""},w=Object.assign({},y),b=[],S=u(w.scheme||R.scheme);S&&S.serialize&&S.serialize(R,w),R.path!==void 0&&(w.skipEscape?R.path=unescape(R.path):(R.path=escape(R.path),R.scheme!==void 0&&(R.path=R.path.split("%3A").join(":")))),w.reference!=="suffix"&&R.scheme&&b.push(R.scheme,":");let E=n(R);if(E!==void 0&&(w.reference!=="suffix"&&b.push("//"),b.push(E),R.path&&R.path[0]!=="/"&&b.push("/")),R.path!==void 0){let j=R.path;!w.absolutePath&&(!S||!S.absolutePath)&&(j=o(j)),E===void 0&&j[0]==="/"&&j[1]==="/"&&(j="/%2F"+j.slice(2)),b.push(j)}return R.query!==void 0&&b.push("?",R.query),R.fragment!==void 0&&b.push("#",R.fragment),b.join("")}let _=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function h(z,y){let R=Object.assign({},y),w={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},b=!1;R.reference==="suffix"&&(R.scheme?z=R.scheme+":"+z:z="//"+z);let S=z.match(_);if(S){if(w.scheme=S[1],w.userinfo=S[3],w.host=S[4],w.port=parseInt(S[5],10),w.path=S[6]||"",w.query=S[7],w.fragment=S[8],isNaN(w.port)&&(w.port=S[5]),w.host)if(i(w.host)===!1){let j=r(w.host);w.host=j.host.toLowerCase(),b=j.isIPV6}else b=!0;w.scheme===void 0&&w.userinfo===void 0&&w.host===void 0&&w.port===void 0&&w.query===void 0&&!w.path?w.reference="same-document":w.scheme===void 0?w.reference="relative":w.fragment===void 0?w.reference="absolute":w.reference="uri",R.reference&&R.reference!=="suffix"&&R.reference!==w.reference&&(w.error=w.error||"URI is not a "+R.reference+" reference.");let E=u(R.scheme||w.scheme);if(!R.unicodeSupport&&(!E||!E.unicodeSupport)&&w.host&&(R.domainHost||E&&E.domainHost)&&b===!1&&c(w.host))try{w.host=URL.domainToASCII(w.host.toLowerCase())}catch(j){w.error=w.error||"Host's domain name can not be converted to ASCII: "+j}(!E||E&&!E.skipNormalize)&&(z.indexOf("%")!==-1&&(w.scheme!==void 0&&(w.scheme=unescape(w.scheme)),w.host!==void 0&&(w.host=unescape(w.host))),w.path&&(w.path=escape(unescape(w.path))),w.fragment&&(w.fragment=encodeURI(decodeURIComponent(w.fragment)))),E&&E.parse&&E.parse(w,R)}else w.error=w.error||"URI can not be parsed.";return w}let f={SCHEMES:a,normalize:d,resolve:m,resolveComponent:g,equal:v,serialize:p,parse:h};t.exports=f,t.exports.default=f,t.exports.fastUri=f})),pz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dz();t.code='require("ajv/dist/runtime/uri").default',e.default=t})),Xl=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=so();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=le();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=qn(),n=io(),s=Wg(),i=Wa(),c=le(),a=Ga(),u=Ba(),d=_e(),m=uz(),g=pz(),v=(k,x)=>new RegExp(k,x);v.code="new RegExp";let p=["removeAdditional","useDefaults","coerceTypes"],_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),h={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},f={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},z=200;function y(k){var x,V,$,C,N,J,ee,pe,ie,ze,Je,T,A,D,ne,se,de,ke,je,Ze,Ne,we,ot,Ae,mt;let it=k.strict,ft=(x=k.code)===null||x===void 0?void 0:x.optimize,Tt=ft===!0||ft===void 0?1:ft||0,Ct=($=(V=k.code)===null||V===void 0?void 0:V.regExp)!==null&&$!==void 0?$:v,Wt=(C=k.uriResolver)!==null&&C!==void 0?C:g.default;return{strictSchema:(J=(N=k.strictSchema)!==null&&N!==void 0?N:it)!==null&&J!==void 0?J:!0,strictNumbers:(pe=(ee=k.strictNumbers)!==null&&ee!==void 0?ee:it)!==null&&pe!==void 0?pe:!0,strictTypes:(ze=(ie=k.strictTypes)!==null&&ie!==void 0?ie:it)!==null&&ze!==void 0?ze:"log",strictTuples:(T=(Je=k.strictTuples)!==null&&Je!==void 0?Je:it)!==null&&T!==void 0?T:"log",strictRequired:(D=(A=k.strictRequired)!==null&&A!==void 0?A:it)!==null&&D!==void 0?D:!1,code:k.code?{...k.code,optimize:Tt,regExp:Ct}:{optimize:Tt,regExp:Ct},loopRequired:(ne=k.loopRequired)!==null&&ne!==void 0?ne:z,loopEnum:(se=k.loopEnum)!==null&&se!==void 0?se:z,meta:(de=k.meta)!==null&&de!==void 0?de:!0,messages:(ke=k.messages)!==null&&ke!==void 0?ke:!0,inlineRefs:(je=k.inlineRefs)!==null&&je!==void 0?je:!0,schemaId:(Ze=k.schemaId)!==null&&Ze!==void 0?Ze:"$id",addUsedSchema:(Ne=k.addUsedSchema)!==null&&Ne!==void 0?Ne:!0,validateSchema:(we=k.validateSchema)!==null&&we!==void 0?we:!0,validateFormats:(ot=k.validateFormats)!==null&&ot!==void 0?ot:!0,unicodeRegExp:(Ae=k.unicodeRegExp)!==null&&Ae!==void 0?Ae:!0,int32range:(mt=k.int32range)!==null&&mt!==void 0?mt:!0,uriResolver:Wt}}var R=class{constructor(k={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,k=this.opts={...k,...y(k)};let{es5:x,lines:V}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:_,es5:x,lines:V}),this.logger=Z(k.logger);let $=k.validateFormats;k.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,h,k,"NOT SUPPORTED"),w.call(this,f,k,"DEPRECATED","warn"),this._metaOpts=F.call(this),k.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&j.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),S.call(this),k.validateFormats=$}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:k,meta:x,schemaId:V}=this.opts,$=m;V==="id"&&($={...m},$.id=$.$id,delete $.$id),x&&k&&this.addMetaSchema($,$[V],!1)}defaultMeta(){let{meta:k,schemaId:x}=this.opts;return this.opts.defaultMeta=typeof k=="object"?k[x]||k:void 0}validate(k,x){let V;if(typeof k=="string"){if(V=this.getSchema(k),!V)throw new Error(`no schema with key or ref "${k}"`)}else V=this.compile(k);let $=V(x);return"$async"in V||(this.errors=V.errors),$}compile(k,x){let V=this._addSchema(k,x);return V.validate||this._compileSchemaEnv(V)}compileAsync(k,x){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:V}=this.opts;return $.call(this,k,x);async function $(ie,ze){await C.call(this,ie.$schema);let Je=this._addSchema(ie,ze);return Je.validate||N.call(this,Je)}async function C(ie){ie&&!this.getSchema(ie)&&await $.call(this,{$ref:ie},!0)}async function N(ie){try{return this._compileSchemaEnv(ie)}catch(ze){if(!(ze instanceof n.default))throw ze;return J.call(this,ze),await ee.call(this,ze.missingSchema),N.call(this,ie)}}function J({missingSchema:ie,missingRef:ze}){if(this.refs[ie])throw new Error(`AnySchema ${ie} is loaded but ${ze} cannot be resolved`)}async function ee(ie){let ze=await pe.call(this,ie);this.refs[ie]||await C.call(this,ze.$schema),this.refs[ie]||this.addSchema(ze,ie,x)}async function pe(ie){let ze=this._loading[ie];if(ze)return ze;try{return await(this._loading[ie]=V(ie))}finally{delete this._loading[ie]}}}addSchema(k,x,V,$=this.opts.validateSchema){if(Array.isArray(k)){for(let N of k)this.addSchema(N,void 0,V,$);return this}let C;if(typeof k=="object"){let{schemaId:N}=this.opts;if(C=k[N],C!==void 0&&typeof C!="string")throw new Error(`schema ${N} must be string`)}return x=(0,a.normalizeId)(x||C),this._checkUnique(x),this.schemas[x]=this._addSchema(k,V,x,$,!0),this}addMetaSchema(k,x,V=this.opts.validateSchema){return this.addSchema(k,x,!0,V),this}validateSchema(k,x){if(typeof k=="boolean")return!0;let V;if(V=k.$schema,V!==void 0&&typeof V!="string")throw new 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 $=this.validate(V,k);if(!$&&x){let C="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(C);else throw new Error(C)}return $}getSchema(k){let x;for(;typeof(x=b.call(this,k))=="string";)k=x;if(x===void 0){let{schemaId:V}=this.opts,$=new i.SchemaEnv({schema:{},schemaId:V});if(x=i.resolveSchema.call(this,$,k),!x)return;this.refs[k]=x}return x.validate||this._compileSchemaEnv(x)}removeSchema(k){if(k instanceof RegExp)return this._removeAllSchemas(this.schemas,k),this._removeAllSchemas(this.refs,k),this;switch(typeof k){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let x=b.call(this,k);return typeof x=="object"&&this._cache.delete(x.schema),delete this.schemas[k],delete this.refs[k],this}case"object":{let x=k;this._cache.delete(x);let V=k[this.opts.schemaId];return V&&(V=(0,a.normalizeId)(V),delete this.schemas[V],delete this.refs[V]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(k){for(let x of k)this.addKeyword(x);return this}addKeyword(k,x){let V;if(typeof k=="string")V=k,typeof x=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),x.keyword=V);else if(typeof k=="object"&&x===void 0){if(x=k,V=x.keyword,Array.isArray(V)&&!V.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(G.call(this,V,x),!x)return(0,d.eachItem)(V,C=>fe.call(this,C)),this;be.call(this,x);let $={...x,type:(0,u.getJSONTypes)(x.type),schemaType:(0,u.getJSONTypes)(x.schemaType)};return(0,d.eachItem)(V,$.type.length===0?C=>fe.call(this,C,$):C=>$.type.forEach(N=>fe.call(this,C,$,N))),this}getKeyword(k){let x=this.RULES.all[k];return typeof x=="object"?x.definition:!!x}removeKeyword(k){let{RULES:x}=this;delete x.keywords[k],delete x.all[k];for(let V of x.rules){let $=V.rules.findIndex(C=>C.keyword===k);$>=0&&V.rules.splice($,1)}return this}addFormat(k,x){return typeof x=="string"&&(x=new RegExp(x)),this.formats[k]=x,this}errorsText(k=this.errors,{separator:x=", ",dataVar:V="data"}={}){return!k||k.length===0?"No errors":k.map($=>`${V}${$.instancePath} ${$.message}`).reduce(($,C)=>$+x+C)}$dataMetaSchema(k,x){let V=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(let $ of x){let C=$.split("/").slice(1),N=k;for(let J of C)N=N[J];for(let J in V){let ee=V[J];if(typeof ee!="object")continue;let{$data:pe}=ee.definition,ie=N[J];pe&&ie&&(N[J]=he(ie))}}return k}_removeAllSchemas(k,x){for(let V in k){let $=k[V];(!x||x.test(V))&&(typeof $=="string"?delete k[V]:$&&!$.meta&&(this._cache.delete($.schema),delete k[V]))}}_addSchema(k,x,V,$=this.opts.validateSchema,C=this.opts.addUsedSchema){let N,{schemaId:J}=this.opts;if(typeof k=="object")N=k[J];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof k!="boolean")throw new Error("schema must be object or boolean")}let ee=this._cache.get(k);if(ee!==void 0)return ee;V=(0,a.normalizeId)(N||V);let pe=a.getSchemaRefs.call(this,k,V);return ee=new i.SchemaEnv({schema:k,schemaId:J,meta:x,baseId:V,localRefs:pe}),this._cache.set(ee.schema,ee),C&&!V.startsWith("#")&&(V&&this._checkUnique(V),this.refs[V]=ee),$&&this.validateSchema(k,!0),ee}_checkUnique(k){if(this.schemas[k]||this.refs[k])throw new Error(`schema with key or id "${k}" already exists`)}_compileSchemaEnv(k){if(k.meta?this._compileMetaSchema(k):i.compileSchema.call(this,k),!k.validate)throw new Error("ajv implementation error");return k.validate}_compileMetaSchema(k){let x=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,k)}finally{this.opts=x}}};R.ValidationError=o.default,R.MissingRefError=n.default,e.default=R;function w(k,x,V,$="error"){for(let C in k){let N=C;N in x&&this.logger[$](`${V}: option ${C}. ${k[N]}`)}}function b(k){return k=(0,a.normalizeId)(k),this.schemas[k]||this.refs[k]}function S(){let k=this.opts.schemas;if(k)if(Array.isArray(k))this.addSchema(k);else for(let x in k)this.addSchema(k[x],x)}function E(){for(let k in this.opts.formats){let x=this.opts.formats[k];x&&this.addFormat(k,x)}}function j(k){if(Array.isArray(k)){this.addVocabulary(k);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let x in k){let V=k[x];V.keyword||(V.keyword=x),this.addKeyword(V)}}function F(){let k={...this.opts};for(let x of p)delete k[x];return k}let M={log(){},warn(){},error(){}};function Z(k){if(k===!1)return M;if(k===void 0)return console;if(k.log&&k.warn&&k.error)return k;throw new Error("logger must implement log, warn and error methods")}let Y=/^[a-z_$][a-z0-9_$:-]*$/i;function G(k,x){let{RULES:V}=this;if((0,d.eachItem)(k,$=>{if(V.keywords[$])throw new Error(`Keyword ${$} is already defined`);if(!Y.test($))throw new Error(`Keyword ${$} has invalid name`)}),!!x&&x.$data&&!("code"in x||"validate"in x))throw new Error('$data keyword must have "code" or "validate" function')}function fe(k,x,V){var $;let C=x?.post;if(V&&C)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:N}=this,J=C?N.post:N.rules.find(({type:pe})=>pe===V);if(J||(J={type:V,rules:[]},N.rules.push(J)),N.keywords[k]=!0,!x)return;let ee={keyword:k,definition:{...x,type:(0,u.getJSONTypes)(x.type),schemaType:(0,u.getJSONTypes)(x.schemaType)}};x.before?$e.call(this,J,ee,x.before):J.rules.push(ee),N.all[k]=ee,($=x.implements)===null||$===void 0||$.forEach(pe=>this.addKeyword(pe))}function $e(k,x,V){let $=k.rules.findIndex(C=>C.keyword===V);$>=0?k.rules.splice($,0,x):(k.rules.push(x),this.logger.warn(`rule ${V} is not defined`))}function be(k){let{metaSchema:x}=k;x!==void 0&&(k.$data&&this.opts.$data&&(x=he(x)),k.validateSchema=this.compile(x,!0))}let Oe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function he(k){return{anyOf:[k,Oe]}}})),mz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t})),Ql=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=io(),r=pt(),o=le(),n=dt(),s=Wa(),i=_e(),c={keyword:"$ref",schemaType:"string",code(d){let{gen:m,schema:g,it:v}=d,{baseId:p,schemaEnv:_,validateName:h,opts:f,self:z}=v,{root:y}=_;if((g==="#"||g==="#/")&&p===y.baseId)return w();let R=s.resolveRef.call(z,y,p,g);if(R===void 0)throw new t.default(v.opts.uriResolver,p,g);if(R instanceof s.SchemaEnv)return b(R);return S(R);function w(){if(_===y)return u(d,h,_,_.$async);let E=m.scopeValue("root",{ref:y});return u(d,(0,o._)`${E}.validate`,y,y.$async)}function b(E){u(d,a(d,E),E,E.$async)}function S(E){let j=m.scopeValue("schema",f.code.source===!0?{ref:E,code:(0,o.stringify)(E)}:{ref:E}),F=m.name("valid"),M=d.subschema({schema:E,dataTypes:[],schemaPath:o.nil,topSchemaRef:j,errSchemaPath:g},F);d.mergeEvaluated(M),d.ok(F)}}};function a(d,m){let{gen:g}=d;return m.validate?g.scopeValue("validate",{ref:m.validate}):(0,o._)`${g.scopeValue("wrapper",{ref:m})}.validate`}e.getValidate=a;function u(d,m,g,v){let{gen:p,it:_}=d,{allErrors:h,schemaEnv:f,opts:z}=_,y=z.passContext?n.default.this:o.nil;v?R():w();function R(){if(!f.$async)throw new Error("async schema referenced by sync schema");let E=p.let("valid");p.try(()=>{p.code((0,o._)`await ${(0,r.callValidateCode)(d,m,y)}`),S(m),h||p.assign(E,!0)},j=>{p.if((0,o._)`!(${j} instanceof ${_.ValidationError})`,()=>p.throw(j)),b(j),h||p.assign(E,!1)}),d.ok(E)}function w(){d.result((0,r.callValidateCode)(d,m,y),()=>S(m),()=>b(m))}function b(E){let j=(0,o._)`${E}.errors`;p.assign(n.default.vErrors,(0,o._)`${n.default.vErrors} === null ? ${j} : ${n.default.vErrors}.concat(${j})`),p.assign(n.default.errors,(0,o._)`${n.default.vErrors}.length`)}function S(E){var j;if(!_.opts.unevaluated)return;let F=(j=g?.validate)===null||j===void 0?void 0:j.evaluated;if(_.props!==!0)if(F&&!F.dynamicProps)F.props!==void 0&&(_.props=i.mergeEvaluated.props(p,F.props,_.props));else{let M=p.var("props",(0,o._)`${E}.evaluated.props`);_.props=i.mergeEvaluated.props(p,M,_.props,o.Name)}if(_.items!==!0)if(F&&!F.dynamicItems)F.items!==void 0&&(_.items=i.mergeEvaluated.items(p,F.items,_.items));else{let M=p.var("items",(0,o._)`${E}.evaluated.items`);_.items=i.mergeEvaluated.items(p,M,_.items,o.Name)}}}e.callRef=u,e.default=c})),e_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=mz(),r=Ql(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o})),fz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=t.operators,o={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},n={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:s,schemaCode:i})=>(0,t.str)`must be ${o[s].okStr} ${i}`,params:({keyword:s,schemaCode:i})=>(0,t._)`{comparison: ${o[s].okStr}, limit: ${i}}`},code(s){let{keyword:i,data:c,schemaCode:a}=s;s.fail$data((0,t._)`${c} ${o[i].fail} ${a} || isNaN(${c})`)}};e.default=n})),hz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must be multiple of ${o}`,params:({schemaCode:o})=>(0,t._)`{multipleOf: ${o}}`},code(o){let{gen:n,data:s,schemaCode:i,it:c}=o,a=c.opts.multipleOfPrecision,u=n.let("res"),d=a?(0,t._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${a}`:(0,t._)`${u} !== parseInt(${u})`;o.fail$data((0,t._)`(${i} === 0 || (${u} = ${s}/${i}, ${d}))`)}};e.default=r})),gz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r){let o=r.length,n=0,s=0,i;for(;s<o;)n++,i=r.charCodeAt(s++),i>=55296&&i<=56319&&s<o&&(i=r.charCodeAt(s),(i&64512)===56320&&s++);return n}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'})),_z=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=gz(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:i}){let c=s==="maxLength"?"more":"fewer";return(0,t.str)`must NOT have ${c} than ${i} characters`},params:({schemaCode:s})=>(0,t._)`{limit: ${s}}`},code(s){let{keyword:i,data:c,schemaCode:a,it:u}=s,d=i==="maxLength"?t.operators.GT:t.operators.LT,m=u.opts.unicode===!1?(0,t._)`${c}.length`:(0,t._)`${(0,r.useFunc)(s.gen,o.default)}(${c})`;s.fail$data((0,t._)`${m} ${d} ${a}`)}};e.default=n})),Sz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pt(),r=_e(),o=le(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,o.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,o._)`{pattern: ${s}}`},code(s){let{gen:i,data:c,$data:a,schema:u,schemaCode:d,it:m}=s,g=m.opts.unicodeRegExp?"u":"";if(a){let{regExp:v}=m.opts.code,p=v.code==="new RegExp"?(0,o._)`new RegExp`:(0,r.useFunc)(i,v),_=i.let("valid");i.try(()=>i.assign(_,(0,o._)`${p}(${d}, ${g}).test(${c})`),()=>i.assign(_,!1)),s.fail$data((0,o._)`!${_}`)}else{let v=(0,t.usePattern)(s,u);s.fail$data((0,o._)`!${v}.test(${c})`)}}};e.default=n})),yz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxProperties"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${n} properties`},params:({schemaCode:o})=>(0,t._)`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,c=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data((0,t._)`Object.keys(${s}).length ${c} ${i}`)}};e.default=r})),vz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pt(),r=le(),o=_e(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,r.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,r._)`{missingProperty: ${s}}`},code(s){let{gen:i,schema:c,schemaCode:a,data:u,$data:d,it:m}=s,{opts:g}=m;if(!d&&c.length===0)return;let v=c.length>=g.loopRequired;if(m.allErrors?p():_(),g.strictRequired){let z=s.parentSchema.properties,{definedProperties:y}=s.it;for(let R of c)if(z?.[R]===void 0&&!y.has(R)){let w=`required property "${R}" is not defined at "${m.schemaEnv.baseId+m.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(m,w,m.opts.strictRequired)}}function p(){if(v||d)s.block$data(r.nil,h);else for(let z of c)(0,t.checkReportMissingProp)(s,z)}function _(){let z=i.let("missing");if(v||d){let y=i.let("valid",!0);s.block$data(y,()=>f(z,y)),s.ok(y)}else i.if((0,t.checkMissingProp)(s,c,z)),(0,t.reportMissingProp)(s,z),i.else()}function h(){i.forOf("prop",a,z=>{s.setParams({missingProperty:z}),i.if((0,t.noPropertyInData)(i,u,z,g.ownProperties),()=>s.error())})}function f(z,y){s.setParams({missingProperty:z}),i.forOf(z,a,()=>{i.assign(y,(0,t.propertyInData)(i,u,z,g.ownProperties)),i.if((0,r.not)(y),()=>{s.error(),i.break()})},r.nil)}}};e.default=n})),bz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxItems"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${n} items`},params:({schemaCode:o})=>(0,t._)`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,c=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data((0,t._)`${s}.length ${c} ${i}`)}};e.default=r})),ed=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Xg();t.code='require("ajv/dist/runtime/equal").default',e.default=t})),zz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ba(),r=le(),o=_e(),n=ed(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:c}})=>(0,r.str)`must NOT have duplicate items (items ## ${c} and ${i} are identical)`,params:({params:{i,j:c}})=>(0,r._)`{i: ${i}, j: ${c}}`},code(i){let{gen:c,data:a,$data:u,schema:d,parentSchema:m,schemaCode:g,it:v}=i;if(!u&&!d)return;let p=c.let("valid"),_=m.items?(0,t.getSchemaTypes)(m.items):[];i.block$data(p,h,(0,r._)`${g} === false`),i.ok(p);function h(){let R=c.let("i",(0,r._)`${a}.length`),w=c.let("j");i.setParams({i:R,j:w}),c.assign(p,!0),c.if((0,r._)`${R} > 1`,()=>(f()?z:y)(R,w))}function f(){return _.length>0&&!_.some(R=>R==="object"||R==="array")}function z(R,w){let b=c.name("item"),S=(0,t.checkDataTypes)(_,b,v.opts.strictNumbers,t.DataType.Wrong),E=c.const("indices",(0,r._)`{}`);c.for((0,r._)`;${R}--;`,()=>{c.let(b,(0,r._)`${a}[${R}]`),c.if(S,(0,r._)`continue`),_.length>1&&c.if((0,r._)`typeof ${b} == "string"`,(0,r._)`${b} += "_"`),c.if((0,r._)`typeof ${E}[${b}] == "number"`,()=>{c.assign(w,(0,r._)`${E}[${b}]`),i.error(),c.assign(p,!1).break()}).code((0,r._)`${E}[${b}] = ${R}`)})}function y(R,w){let b=(0,o.useFunc)(c,n.default),S=c.name("outer");c.label(S).for((0,r._)`;${R}--;`,()=>c.for((0,r._)`${w} = ${R}; ${w}--;`,()=>c.if((0,r._)`${b}(${a}[${R}], ${a}[${w}])`,()=>{i.error(),c.assign(p,!1).break(S)})))}}};e.default=s})),Rz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=ed(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,t._)`{allowedValue: ${s}}`},code(s){let{gen:i,data:c,$data:a,schemaCode:u,schema:d}=s;a||d&&typeof d=="object"?s.fail$data((0,t._)`!${(0,r.useFunc)(i,o.default)}(${c}, ${u})`):s.fail((0,t._)`${d} !== ${c}`)}};e.default=n})),$z=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=ed(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,t._)`{allowedValues: ${s}}`},code(s){let{gen:i,data:c,$data:a,schema:u,schemaCode:d,it:m}=s;if(!a&&u.length===0)throw new Error("enum must have non-empty array");let g=u.length>=m.opts.loopEnum,v,p=()=>v??(v=(0,r.useFunc)(i,o.default)),_;if(g||a)_=i.let("valid"),s.block$data(_,h);else{if(!Array.isArray(u))throw new Error("ajv implementation error");let z=i.const("vSchema",d);_=(0,t.or)(...u.map((y,R)=>f(z,R)))}s.pass(_);function h(){i.assign(_,!1),i.forOf("v",d,z=>i.if((0,t._)`${p()}(${c}, ${z})`,()=>i.assign(_,!0).break()))}function f(z,y){let R=u[y];return typeof R=="object"&&R!==null?(0,t._)`${p()}(${c}, ${z}[${y}])`:(0,t._)`${c} === ${R}`}}};e.default=n})),t_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fz(),r=hz(),o=_z(),n=Sz(),s=yz(),i=vz(),c=bz(),a=zz(),u=Rz(),d=$z(),m=[t.default,r.default,o.default,n.default,s.default,i.default,c.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,d.default];e.default=m})),r_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=le(),r=_e(),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,t.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,t._)`{limit: ${s}}`},code(s){let{parentSchema:i,it:c}=s,{items:a}=i;if(!Array.isArray(a)){(0,r.checkStrictMode)(c,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,a)}};function n(s,i){let{gen:c,schema:a,data:u,keyword:d,it:m}=s;m.items=!0;let g=c.const("len",(0,t._)`${u}.length`);if(a===!1)s.setParams({len:i.length}),s.pass((0,t._)`${g} <= ${i.length}`);else if(typeof a=="object"&&!(0,r.alwaysValidSchema)(m,a)){let p=c.var("valid",(0,t._)`${g} <= ${i.length}`);c.if((0,t.not)(p),()=>v(p)),s.ok(p)}function v(p){c.forRange("i",i.length,g,_=>{s.subschema({keyword:d,dataProp:_,dataPropType:r.Type.Num},p),m.allErrors||c.if((0,t.not)(p),()=>c.break())})}}e.validateAdditionalItems=n,e.default=o})),o_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=le(),r=_e(),o=pt(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){let{schema:c,it:a}=i;if(Array.isArray(c))return s(i,"additionalItems",c);a.items=!0,!(0,r.alwaysValidSchema)(a,c)&&i.ok((0,o.validateArray)(i))}};function s(i,c,a=i.schema){let{gen:u,parentSchema:d,data:m,keyword:g,it:v}=i;h(d),v.opts.unevaluated&&a.length&&v.items!==!0&&(v.items=r.mergeEvaluated.items(u,a.length,v.items));let p=u.name("valid"),_=u.const("len",(0,t._)`${m}.length`);a.forEach((f,z)=>{(0,r.alwaysValidSchema)(v,f)||(u.if((0,t._)`${_} > ${z}`,()=>i.subschema({keyword:g,schemaProp:z,dataProp:z},p)),i.ok(p))});function h(f){let{opts:z,errSchemaPath:y}=v,R=a.length,w=R===f.minItems&&(R===f.maxItems||f[c]===!1);if(z.strictTuples&&!w){let b=`"${g}" is ${R}-tuple, but minItems or maxItems/${c} are not specified or different at path "${y}"`;(0,r.checkStrictMode)(v,b,z.strictTuples)}}}e.validateTuple=s,e.default=n})),wz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=o_(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o=>(0,t.validateTuple)(o,"items")};e.default=r})),Pz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=pt(),n=r_(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,t.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,t._)`{limit: ${i}}`},code(i){let{schema:c,parentSchema:a,it:u}=i,{prefixItems:d}=a;u.items=!0,!(0,r.alwaysValidSchema)(u,c)&&(d?(0,n.validateAdditionalItems)(i,d):i.ok((0,o.validateArray)(i)))}};e.default=s})),Ez=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:s}})=>s===void 0?(0,t.str)`must contain at least ${n} valid item(s)`:(0,t.str)`must contain at least ${n} and no more than ${s} valid item(s)`,params:({params:{min:n,max:s}})=>s===void 0?(0,t._)`{minContains: ${n}}`:(0,t._)`{minContains: ${n}, maxContains: ${s}}`},code(n){let{gen:s,schema:i,parentSchema:c,data:a,it:u}=n,d,m,{minContains:g,maxContains:v}=c;u.opts.next?(d=g===void 0?1:g,m=v):d=1;let p=s.const("len",(0,t._)`${a}.length`);if(n.setParams({min:d,max:m}),m===void 0&&d===0){(0,r.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&d>m){(0,r.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(u,i)){let y=(0,t._)`${p} >= ${d}`;m!==void 0&&(y=(0,t._)`${y} && ${p} <= ${m}`),n.pass(y);return}u.items=!0;let _=s.name("valid");m===void 0&&d===1?f(_,()=>s.if(_,()=>s.break())):d===0?(s.let(_,!0),m!==void 0&&s.if((0,t._)`${a}.length > 0`,h)):(s.let(_,!1),h()),n.result(_,()=>n.reset());function h(){let y=s.name("_valid"),R=s.let("count",0);f(y,()=>s.if(y,()=>z(R)))}function f(y,R){s.forRange("i",0,p,w=>{n.subschema({keyword:"contains",dataProp:w,dataPropType:r.Type.Num,compositeRule:!0},y),R()})}function z(y){s.code((0,t._)`${y}++`),m===void 0?s.if((0,t._)`${y} >= ${d}`,()=>s.assign(_,!0).break()):(s.if((0,t._)`${y} > ${m}`,()=>s.assign(_,!1).break()),d===1?s.assign(_,!0):s.if((0,t._)`${y} >= ${d}`,()=>s.assign(_,!0)))}}};e.default=o})),td=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=le(),r=_e(),o=pt();e.error={message:({params:{property:a,depsCount:u,deps:d}})=>{let m=u===1?"property":"properties";return(0,t.str)`must have ${m} ${d} when property ${a} is present`},params:({params:{property:a,depsCount:u,deps:d,missingProperty:m}})=>(0,t._)`{property: ${a},
|
|
66
|
+
missingProperty: ${m},
|
|
67
|
+
depsCount: ${u},
|
|
68
|
+
deps: ${d}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(a){let[u,d]=s(a);i(a,u),c(a,d)}};function s({schema:a}){let u={},d={};for(let m in a){if(m==="__proto__")continue;let g=Array.isArray(a[m])?u:d;g[m]=a[m]}return[u,d]}function i(a,u=a.schema){let{gen:d,data:m,it:g}=a;if(Object.keys(u).length===0)return;let v=d.let("missing");for(let p in u){let _=u[p];if(_.length===0)continue;let h=(0,o.propertyInData)(d,m,p,g.opts.ownProperties);a.setParams({property:p,depsCount:_.length,deps:_.join(", ")}),g.allErrors?d.if(h,()=>{for(let f of _)(0,o.checkReportMissingProp)(a,f)}):(d.if((0,t._)`${h} && (${(0,o.checkMissingProp)(a,_,v)})`),(0,o.reportMissingProp)(a,v),d.else())}}e.validatePropertyDeps=i;function c(a,u=a.schema){let{gen:d,data:m,keyword:g,it:v}=a,p=d.name("valid");for(let _ in u)(0,r.alwaysValidSchema)(v,u[_])||(d.if((0,o.propertyInData)(d,m,_,v.opts.ownProperties),()=>{let h=a.subschema({keyword:g,schemaProp:_},p);a.mergeValidEvaluated(h,p)},()=>d.var(p,!0)),a.ok(p))}e.validateSchemaDeps=c,e.default=n})),Tz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0,t._)`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:i,data:c,it:a}=n;if((0,r.alwaysValidSchema)(a,i))return;let u=s.name("valid");s.forIn("key",c,d=>{n.setParams({propertyName:d}),n.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},u),s.if((0,t.not)(u),()=>{n.error(!0),a.allErrors||s.break()})}),n.ok(u)}};e.default=o})),n_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pt(),r=le(),o=dt(),n=_e(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>(0,r._)`{additionalProperty: ${i.additionalProperty}}`},code(i){let{gen:c,schema:a,parentSchema:u,data:d,errsCount:m,it:g}=i;if(!m)throw new Error("ajv implementation error");let{allErrors:v,opts:p}=g;if(g.props=!0,p.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(g,a))return;let _=(0,t.allSchemaProperties)(u.properties),h=(0,t.allSchemaProperties)(u.patternProperties);f(),i.ok((0,r._)`${m} === ${o.default.errors}`);function f(){c.forIn("key",d,b=>{!_.length&&!h.length?R(b):c.if(z(b),()=>R(b))})}function z(b){let S;if(_.length>8){let E=(0,n.schemaRefOrVal)(g,u.properties,"properties");S=(0,t.isOwnProperty)(c,E,b)}else _.length?S=(0,r.or)(..._.map(E=>(0,r._)`${b} === ${E}`)):S=r.nil;return h.length&&(S=(0,r.or)(S,...h.map(E=>(0,r._)`${(0,t.usePattern)(i,E)}.test(${b})`))),(0,r.not)(S)}function y(b){c.code((0,r._)`delete ${d}[${b}]`)}function R(b){if(p.removeAdditional==="all"||p.removeAdditional&&a===!1){y(b);return}if(a===!1){i.setParams({additionalProperty:b}),i.error(),v||c.break();return}if(typeof a=="object"&&!(0,n.alwaysValidSchema)(g,a)){let S=c.name("valid");p.removeAdditional==="failing"?(w(b,S,!1),c.if((0,r.not)(S),()=>{i.reset(),y(b)})):(w(b,S),v||c.if((0,r.not)(S),()=>c.break()))}}function w(b,S,E){let j={keyword:"additionalProperties",dataProp:b,dataPropType:n.Type.Str};E===!1&&Object.assign(j,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(j,S)}}};e.default=s})),Cz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=so(),r=pt(),o=_e(),n=n_(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,parentSchema:u,data:d,it:m}=i;m.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(m,n.default,"additionalProperties"));let g=(0,r.allSchemaProperties)(a);for(let f of g)m.definedProperties.add(f);m.opts.unevaluated&&g.length&&m.props!==!0&&(m.props=o.mergeEvaluated.props(c,(0,o.toHash)(g),m.props));let v=g.filter(f=>!(0,o.alwaysValidSchema)(m,a[f]));if(v.length===0)return;let p=c.name("valid");for(let f of v)_(f)?h(f):(c.if((0,r.propertyInData)(c,d,f,m.opts.ownProperties)),h(f),m.allErrors||c.else().var(p,!0),c.endIf()),i.it.definedProperties.add(f),i.ok(p);function _(f){return m.opts.useDefaults&&!m.compositeRule&&a[f].default!==void 0}function h(f){i.subschema({keyword:"properties",schemaProp:f,dataProp:f},p)}}};e.default=s})),kz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pt(),r=le(),o=_e(),n=_e(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:c,schema:a,data:u,parentSchema:d,it:m}=i,{opts:g}=m,v=(0,t.allSchemaProperties)(a),p=v.filter(w=>(0,o.alwaysValidSchema)(m,a[w]));if(v.length===0||p.length===v.length&&(!m.opts.unevaluated||m.props===!0))return;let _=g.strictSchema&&!g.allowMatchingProperties&&d.properties,h=c.name("valid");m.props!==!0&&!(m.props instanceof r.Name)&&(m.props=(0,n.evaluatedPropsToName)(c,m.props));let{props:f}=m;z();function z(){for(let w of v)_&&y(w),m.allErrors?R(w):(c.var(h,!0),R(w),c.if(h))}function y(w){for(let b in _)new RegExp(w).test(b)&&(0,o.checkStrictMode)(m,`property ${b} matches pattern ${w} (use allowMatchingProperties)`)}function R(w){c.forIn("key",u,b=>{c.if((0,r._)`${(0,t.usePattern)(i,w)}.test(${b})`,()=>{let S=p.includes(w);S||i.subschema({keyword:"patternProperties",schemaProp:w,dataProp:b,dataPropType:n.Type.Str},h),m.opts.unevaluated&&f!==!0?c.assign((0,r._)`${f}[${b}]`,!0):!S&&!m.allErrors&&c.if((0,r.not)(h),()=>c.break())})})}}};e.default=s})),Iz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:i}=o;if((0,t.alwaysValidSchema)(i,s)){o.fail();return}let c=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},c),o.failResult(c,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r})),Oz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:pt().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t})),Nz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0,t._)`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:i,parentSchema:c,it:a}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");if(a.opts.discriminator&&c.discriminator)return;let u=i,d=s.let("valid",!1),m=s.let("passing",null),g=s.name("_valid");n.setParams({passing:m}),s.block(v),n.result(d,()=>n.reset(),()=>n.error(!0));function v(){u.forEach((p,_)=>{let h;(0,r.alwaysValidSchema)(a,p)?s.var(g,!0):h=n.subschema({keyword:"oneOf",schemaProp:_,compositeRule:!0},g),_>0&&s.if((0,t._)`${g} && ${d}`).assign(d,!1).assign(m,(0,t._)`[${m}, ${_}]`).else(),s.if(g,()=>{s.assign(d,!0),s.assign(m,_),h&&n.mergeEvaluated(h,t.Name)})})}}};e.default=o})),jz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:s,it:i}=o;if(!Array.isArray(s))throw new Error("ajv implementation error");let c=n.name("valid");s.forEach((a,u)=>{if((0,t.alwaysValidSchema)(i,a))return;let d=o.subschema({keyword:"allOf",schemaProp:u},c);o.ok(c),o.mergeEvaluated(d)})}};e.default=r})),xz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,t.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,t._)`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:i,parentSchema:c,it:a}=s;c.then===void 0&&c.else===void 0&&(0,r.checkStrictMode)(a,'"if" without "then" and "else" is ignored');let u=n(a,"then"),d=n(a,"else");if(!u&&!d)return;let m=i.let("valid",!0),g=i.name("_valid");if(v(),s.reset(),u&&d){let _=i.let("ifClause");s.setParams({ifClause:_}),i.if(g,p("then",_),p("else",_))}else u?i.if(g,p("then")):i.if((0,t.not)(g),p("else"));s.pass(m,()=>s.error(!0));function v(){let _=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);s.mergeEvaluated(_)}function p(_,h){return()=>{let f=s.subschema({keyword:_},g);i.assign(m,g),s.mergeValidEvaluated(f,m),h?i.assign(h,(0,t._)`${_}`):s.setParams({ifClause:_})}}}};function n(s,i){let c=s.schema[i];return c!==void 0&&!(0,r.alwaysValidSchema)(s,c)}e.default=o})),Az=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){n.if===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r})),s_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=r_(),r=wz(),o=o_(),n=Pz(),s=Ez(),i=td(),c=Tz(),a=n_(),u=Cz(),d=kz(),m=Iz(),g=Oz(),v=Nz(),p=jz(),_=xz(),h=Az();function f(z=!1){let y=[m.default,g.default,v.default,p.default,_.default,h.default,c.default,a.default,i.default,u.default,d.default];return z?y.push(r.default,n.default):y.push(t.default,o.default),y.push(s.default),y}e.default=f})),qz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must match format "${o}"`,params:({schemaCode:o})=>(0,t._)`{format: ${o}}`},code(o,n){let{gen:s,data:i,$data:c,schema:a,schemaCode:u,it:d}=o,{opts:m,errSchemaPath:g,schemaEnv:v,self:p}=d;if(!m.validateFormats)return;c?_():h();function _(){let f=s.scopeValue("formats",{ref:p.formats,code:m.code.formats}),z=s.const("fDef",(0,t._)`${f}[${u}]`),y=s.let("fType"),R=s.let("format");s.if((0,t._)`typeof ${z} == "object" && !(${z} instanceof RegExp)`,()=>s.assign(y,(0,t._)`${z}.type || "string"`).assign(R,(0,t._)`${z}.validate`),()=>s.assign(y,(0,t._)`"string"`).assign(R,z)),o.fail$data((0,t.or)(w(),b()));function w(){return m.strictSchema===!1?t.nil:(0,t._)`${u} && !${R}`}function b(){let S=v.$async?(0,t._)`(${z}.async ? await ${R}(${i}) : ${R}(${i}))`:(0,t._)`${R}(${i})`,E=(0,t._)`(typeof ${R} == "function" ? ${S} : ${R}.test(${i}))`;return(0,t._)`${R} && ${R} !== true && ${y} === ${n} && !${E}`}}function h(){let f=p.formats[a];if(!f){w();return}if(f===!0)return;let[z,y,R]=b(f);z===n&&o.pass(S());function w(){if(m.strictSchema===!1){p.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${a}" ignored in schema at path "${g}"`}}function b(E){let j=E instanceof RegExp?(0,t.regexpCode)(E):m.code.formats?(0,t._)`${m.code.formats}${(0,t.getProperty)(a)}`:void 0,F=s.scopeValue("formats",{key:a,ref:E,code:j});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,t._)`${F}.validate`]:["string",E,F]}function S(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!v.$async)throw new Error("async format in sync schema");return(0,t._)`await ${R}(${i})`}return typeof y=="function"?(0,t._)`${R}(${i})`:(0,t._)`${R}.test(${i})`}}}};e.default=r})),i_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[qz().default];e.default=t})),a_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]})),c_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=e_(),r=t_(),o=s_(),n=i_(),s=a_(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i})),Mz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))})),rd=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=Mz(),o=Wa(),n=io(),s=_e(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:a}})=>c===r.DiscrError.Tag?`tag "${a}" must be string`:`value of tag "${a}" must be in oneOf`,params:({params:{discrError:c,tag:a,tagName:u}})=>(0,t._)`{error: ${c}, tag: ${u}, tagValue: ${a}}`},code(c){let{gen:a,data:u,schema:d,parentSchema:m,it:g}=c,{oneOf:v}=m;if(!g.opts.discriminator)throw new Error("discriminator: requires discriminator option");let p=d.propertyName;if(typeof p!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");let _=a.let("valid",!1),h=a.const("tag",(0,t._)`${u}${(0,t.getProperty)(p)}`);a.if((0,t._)`typeof ${h} == "string"`,()=>f(),()=>c.error(!1,{discrError:r.DiscrError.Tag,tag:h,tagName:p})),c.ok(_);function f(){let R=y();a.if(!1);for(let w in R)a.elseIf((0,t._)`${h} === ${w}`),a.assign(_,z(R[w]));a.else(),c.error(!1,{discrError:r.DiscrError.Mapping,tag:h,tagName:p}),a.endIf()}function z(R){let w=a.name("valid"),b=c.subschema({keyword:"oneOf",schemaProp:R},w);return c.mergeEvaluated(b,t.Name),w}function y(){var R;let w={},b=E(m),S=!0;for(let M=0;M<v.length;M++){let Z=v[M];if(Z?.$ref&&!(0,s.schemaHasRulesButRef)(Z,g.self.RULES)){let G=Z.$ref;if(Z=o.resolveRef.call(g.self,g.schemaEnv.root,g.baseId,G),Z instanceof o.SchemaEnv&&(Z=Z.schema),Z===void 0)throw new n.default(g.opts.uriResolver,g.baseId,G)}let Y=(R=Z?.properties)===null||R===void 0?void 0:R[p];if(typeof Y!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);S=S&&(b||E(Z)),j(Y,M)}if(!S)throw new Error(`discriminator: "${p}" must be required`);return w;function E({required:M}){return Array.isArray(M)&&M.includes(p)}function j(M,Z){if(M.const)F(M.const,Z);else if(M.enum)for(let Y of M.enum)F(Y,Z);else throw new Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}function F(M,Z){if(typeof M!="string"||M in w)throw new Error(`discriminator: "${p}" values must be unique strings`);w[M]=Z}}}};e.default=i})),Lz=U(((e,t)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}})),u_=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=Xl(),o=c_(),n=rd(),s=Lz(),i=["/properties"],c="http://json-schema.org/draft-07/schema";var a=class extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let v=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(v,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv=a,t.exports=e=a,t.exports.Ajv=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var u=so();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var m=qn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return m.default}});var g=io();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return g.default}})})),l_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=le(),r=dt(),o=Wa(),n=Ql(),s={keyword:"$dynamicAnchor",schemaType:"string",code:a=>i(a,a.schema)};function i(a,u){let{gen:d,it:m}=a;m.schemaEnv.root.dynamicAnchors[u]=!0;let g=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,v=m.errSchemaPath==="#"?m.validateName:c(a);d.if((0,t._)`!${g}`,()=>d.assign(g,v))}e.dynamicAnchor=i;function c(a){let{schemaEnv:u,schema:d,self:m}=a.it,{root:g,baseId:v,localRefs:p,meta:_}=u.root,{schemaId:h}=m.opts,f=new o.SchemaEnv({schema:d,schemaId:h,root:g,baseId:v,localRefs:p,meta:_});return o.compileSchema.call(m,f),(0,n.getValidate)(a,f)}e.default=s})),d_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=le(),r=dt(),o=Ql(),n={keyword:"$dynamicRef",schemaType:"string",code:i=>s(i,i.schema)};function s(i,c){let{gen:a,keyword:u,it:d}=i;if(c[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);let m=c.slice(1);if(d.allErrors)g();else{let p=a.let("valid",!1);g(p),i.ok(p)}function g(p){if(d.schemaEnv.root.dynamicAnchors[m]){let _=a.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(m)}`);a.if(_,v(_,p),v(d.validateName,p))}else v(d.validateName,p)()}function v(p,_){return _?()=>a.block(()=>{(0,o.callRef)(i,p),a.let(_,!0)}):()=>(0,o.callRef)(i,p)}}e.dynamicRef=s,e.default=n})),Dz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=l_(),r=_e(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o})),Zz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=d_(),r={keyword:"$recursiveRef",schemaType:"string",code:o=>(0,t.dynamicRef)(o,o.schema)};e.default=r})),p_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=l_(),r=d_(),o=Dz(),n=Zz(),s=[t.default,r.default,o.default,n.default];e.default=s})),Uz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=td(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:o=>(0,t.validatePropertyDeps)(o)};e.default=r})),Vz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=td(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o=>(0,t.validateSchemaDeps)(o)};e.default=r})),Fz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_e(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){n.contains===void 0&&(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r})),m_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Uz(),r=Vz(),o=Fz(),n=[t.default,r.default,o.default];e.default=n})),Hz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o=dt(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>(0,t._)`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:i,schema:c,data:a,errsCount:u,it:d}=s;if(!u)throw new Error("ajv implementation error");let{allErrors:m,props:g}=d;g instanceof t.Name?i.if((0,t._)`${g} !== true`,()=>i.forIn("key",a,h=>i.if(p(g,h),()=>v(h)))):g!==!0&&i.forIn("key",a,h=>g===void 0?v(h):i.if(_(g,h),()=>v(h))),d.props=!0,s.ok((0,t._)`${u} === ${o.default.errors}`);function v(h){if(c===!1){s.setParams({unevaluatedProperty:h}),s.error(),m||i.break();return}if(!(0,r.alwaysValidSchema)(d,c)){let f=i.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:h,dataPropType:r.Type.Str},f),m||i.if((0,t.not)(f),()=>i.break())}}function p(h,f){return(0,t._)`!${h} || !${h}[${f}]`}function _(h,f){let z=[];for(let y in h)h[y]===!0&&z.push((0,t._)`${f} !== ${y}`);return(0,t.and)(...z)}}};e.default=n})),Jz=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=le(),r=_e(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>(0,t.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,t._)`{limit: ${n}}`},code(n){let{gen:s,schema:i,data:c,it:a}=n,u=a.items||0;if(u===!0)return;let d=s.const("len",(0,t._)`${c}.length`);if(i===!1)n.setParams({len:u}),n.fail((0,t._)`${d} > ${u}`);else if(typeof i=="object"&&!(0,r.alwaysValidSchema)(a,i)){let g=s.var("valid",(0,t._)`${d} <= ${u}`);s.if((0,t.not)(g),()=>m(g,u)),n.ok(g)}a.items=!0;function m(g,v){s.forRange("i",v,d,p=>{n.subschema({keyword:"unevaluatedItems",dataProp:p,dataPropType:r.Type.Num},g),a.allErrors||s.if((0,t.not)(g),()=>s.break())})}}};e.default=o})),f_=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Hz(),r=Jz(),o=[t.default,r.default];e.default=o})),Bz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}})),Kz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}})),Gz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}})),Wz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}})),Yz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}})),Xz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}})),Qz=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}})),e0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Bz(),r=Kz(),o=Gz(),n=Wz(),s=Yz(),i=Xz(),c=Qz(),a=["/properties"];function u(d){return[t,r,o,n,m(this,s),i,m(this,c)].forEach(g=>this.addMetaSchema(g,void 0,!1)),this;function m(g,v){return d?g.$dataMetaSchema(v,a):v}}e.default=u})),t0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=Xl(),o=c_(),n=p_(),s=m_(),i=f_(),c=rd(),a=e0(),u="https://json-schema.org/draft/2019-09/schema";var d=class extends r.default{constructor(_={}){super({..._,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach(_=>this.addVocabulary(_)),this.addVocabulary(s.default),this.addVocabulary(i.default),this.opts.discriminator&&this.addKeyword(c.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:_,meta:h}=this.opts;h&&(a.default.call(this,_),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};e.Ajv2019=d,t.exports=e=d,t.exports.Ajv2019=d,Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var m=so();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return m.KeywordCxt}});var g=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return g.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return g.CodeGen}});var v=qn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return v.default}});var p=io();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})),r0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=e_(),r=t_(),o=s_(),n=p_(),s=m_(),i=f_(),c=i_(),a=a_(),u=[n.default,t.default,r.default,(0,o.default)(!0),c.default,a.metadataVocabulary,a.contentVocabulary,s.default,i.default];e.default=u})),o0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}})),n0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}})),s0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}})),i0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}})),a0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}})),c0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}})),u0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}})),l0=U(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}})),d0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=o0(),r=n0(),o=s0(),n=i0(),s=a0(),i=c0(),c=u0(),a=l0(),u=["/properties"];function d(m){return[t,r,o,n,s,g(this,i),c,g(this,a)].forEach(v=>this.addMetaSchema(v,void 0,!1)),this;function g(v,p){return m?v.$dataMetaSchema(p,u):p}}e.default=d})),p0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=Xl(),o=r0(),n=rd(),s=d0(),i="https://json-schema.org/draft/2020-12/schema";var c=class extends r.default{constructor(g={}){super({...g,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:g,meta:v}=this.opts;v&&(s.default.call(this,g),this.refs["http://json-schema.org/schema"]=i)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv2020=c,t.exports=e=c,t.exports.Ajv2020=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var a=so();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return a.KeywordCxt}});var u=le();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=qn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var m=io();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})),m0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(M,Z){return{validate:M,compare:Z}}e.fullFormats={date:t(s,i),time:t(a(!0),u),"date-time":t(g(!0),v),"iso-time":t(a(),d),"iso-date-time":t(g(),p),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:f,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:F,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:y,int32:{type:"number",validate:b},int64:{type:"number",validate:S},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$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"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,p),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(M){return M%4===0&&(M%100!==0||M%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(M){let Z=o.exec(M);if(!Z)return!1;let Y=+Z[1],G=+Z[2],fe=+Z[3];return G>=1&&G<=12&&fe>=1&&fe<=(G===2&&r(Y)?29:n[G])}function i(M,Z){if(M&&Z)return M>Z?1:M<Z?-1:0}let c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function a(M){return function(Y){let G=c.exec(Y);if(!G)return!1;let fe=+G[1],$e=+G[2],be=+G[3],Oe=G[4],he=G[5]==="-"?-1:1,k=+(G[6]||0),x=+(G[7]||0);if(k>23||x>59||M&&!Oe)return!1;if(fe<=23&&$e<=59&&be<60)return!0;let V=$e-x*he,$=fe-k*he-(V<0?1:0);return($===23||$===-1)&&(V===59||V===-1)&&be<61}}function u(M,Z){if(!(M&&Z))return;let Y=new Date("2020-01-01T"+M).valueOf(),G=new Date("2020-01-01T"+Z).valueOf();if(Y&&G)return Y-G}function d(M,Z){if(!(M&&Z))return;let Y=c.exec(M),G=c.exec(Z);if(Y&&G)return M=Y[1]+Y[2]+Y[3],Z=G[1]+G[2]+G[3],M>Z?1:M<Z?-1:0}let m=/t|\s/i;function g(M){let Z=a(M);return function(G){let fe=G.split(m);return fe.length===2&&s(fe[0])&&Z(fe[1])}}function v(M,Z){if(!(M&&Z))return;let Y=new Date(M).valueOf(),G=new Date(Z).valueOf();if(Y&&G)return Y-G}function p(M,Z){if(!(M&&Z))return;let[Y,G]=M.split(m),[fe,$e]=Z.split(m),be=i(Y,fe);if(be!==void 0)return be||u(G,$e)}let _=/\/|:/,h=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function f(M){return _.test(M)&&h.test(M)}let z=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(M){return z.lastIndex=0,z.test(M)}let R=-(2**31),w=2**31-1;function b(M){return Number.isInteger(M)&&M<=w&&M>=R}function S(M){return Number.isInteger(M)}function E(){return!0}let j=/[^\\]\\Z/;function F(M){if(j.test(M))return!1;try{return new RegExp(M),!0}catch{return!1}}})),f0=U((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=u_(),r=le(),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:c,schemaCode:a})=>(0,r.str)`should be ${n[c].okStr} ${a}`,params:({keyword:c,schemaCode:a})=>(0,r._)`{comparison: ${n[c].okStr}, limit: ${a}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(c){let{gen:a,data:u,schemaCode:d,keyword:m,it:g}=c,{opts:v,self:p}=g;if(!v.validateFormats)return;let _=new t.KeywordCxt(g,p.RULES.all.format.definition,"format");_.$data?h():f();function h(){let y=a.scopeValue("formats",{ref:p.formats,code:v.code.formats}),R=a.const("fmt",(0,r._)`${y}[${_.schemaCode}]`);c.fail$data((0,r.or)((0,r._)`typeof ${R} != "object"`,(0,r._)`${R} instanceof RegExp`,(0,r._)`typeof ${R}.compare != "function"`,z(R)))}function f(){let y=_.schema,R=p.formats[y];if(!R||R===!0)return;if(typeof R!="object"||R instanceof RegExp||typeof R.compare!="function")throw new Error(`"${m}": format "${y}" does not define "compare" function`);let w=a.scopeValue("formats",{key:y,ref:R,code:v.code.formats?(0,r._)`${v.code.formats}${(0,r.getProperty)(y)}`:void 0});c.fail$data(z(w))}function z(y){return(0,r._)`${y}.compare(${u}, ${d}) ${n[m].fail} 0`}},dependencies:["format"]};let i=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=i})),h0=U(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=m0(),o=f0(),n=le(),s=new n.Name("fullFormats"),i=new n.Name("fastFormats"),c=(u,d={keywords:!0})=>{if(Array.isArray(d))return a(u,d,r.fullFormats,s),u;let[m,g]=d.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];return a(u,d.formats||r.formatNames,m,g),d.keywords&&(0,o.default)(u),u};c.get=(u,d="full")=>{let m=(d==="fast"?r.fastFormats:r.fullFormats)[u];if(!m)throw new Error(`Unknown format "${u}"`);return m};function a(u,d,m,g){var v,p;(v=(p=u.opts.code).formats)!==null&&v!==void 0||(p.formats=(0,n._)`require("ajv-formats/dist/formats").${g}`);for(let _ of d)u.addFormat(_,m[_])}t.exports=e=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c})),h_=u_(),g0=t0(),_0=p0(),S0=ns(h0(),1),y0=S0.default;function Yl(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return y0(t),t}var Ya=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=Yl(_0.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Pd(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return t==="2020-12"?this.ajv:t==="2019-09"?this._ajv2019??=Yl(g0.Ajv2019):this._ajvDraft7??=Yl(h_.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)}}},Vw=h_.Ajv;import od from"node:process";var R_=Symbol.for("mcp.completable");function sd(e){return!!e&&typeof e=="object"&&R_ in e}function z0(e){return e[R_]?.complete}var jP=2**31-1;function R0(e){return typeof e=="object"&&e!==null&&"setScopeChallengeResolver"in e&&typeof e.setScopeChallengeResolver=="function"}var $0=8,w0=6e5;function P0(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??$0,roundTimeoutMs:e?.roundTimeoutMs??w0,legacyShim:e?.legacyShim??!0}}function $_(e,t,r){if(r===null||typeof r!="object"||typeof r.method!="string")throw new oe(B.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=yg(o);if(n===void 0)throw new oe(B.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 E0(){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 nd(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new oe(B.InternalError,t)}var T0=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:i}=this._host,c=o.mcpReq.signal,a=n,u=0;for(;;){if(u+=1,u>s)return nd(e,Dg(e,s));let d=a.inputRequests,m=d!=null&&Object.keys(d).length>0,g=typeof a.requestState=="string"?a.requestState:void 0;if(!m&&g===void 0)throw new oe(B.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 v;if(m){let h=this._host.resolvedClientCapabilities(o),f=[];for(let[y,R]of Object.entries(d)){let{embedded:w,required:b}=$_(e,y,R);if(w.method!=="roots/list"&&w.params===void 0)throw new oe(B.InternalError,`Handler for ${e} returned an input request '${y}' of kind '${w.method}' without params`);if(La(b,h)!==void 0)return nd(e,`Cannot request input '${y}' (${w.method}): the client on this 2025-era connection did not declare the required capability${h===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);f.push([y,w])}let z=Ug(c);try{let y={relatedRequestId:o.mcpReq.id,timeout:i,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:z.signal},R=await Promise.all(f.map(async([w,b])=>{try{return[w,await this._dispatchLeg(b,y)]}catch(S){throw z.abort(S),S}}));v=Object.fromEntries(R)}catch(y){if(c.aborted)throw y;return nd(e,`Fulfilling input required by '${e}' failed: ${y instanceof Error?y.message:String(y)}`)}finally{z.dispose()}}else await Zg(Lg,c);let p={...o,mcpReq:{...o.mcpReq,inputResponses:v,droppedInputResponseKeys:void 0,requestState:An(g)}};if(g!==void 0){let h=await this._host.verifyRequestState(g,p,e);h!==void 0&&(p=Hl(p,h))}let _=await t(r,p);if(!Et(_))return _;a=_}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;return r.mode==="url"&&r.elicitationId===void 0&&(r={...r,elicitationId:E0()}),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)}}},C0=new Set(["tools/call","prompts/get","resources/read"]),k0,I0,O0;var w_=class extends Jl{_clientCapabilities;_clientVersion;static{k0=(e,t)=>{t.clientCapabilities!==void 0&&(e._clientCapabilities=t.clientCapabilities),t.clientInfo!==void 0&&(e._clientVersion=t.clientInfo)},I0=(e,t)=>{let r=t.filter(o=>!e._supportedProtocolVersions.includes(o));r.length>0&&(e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r]),e.setRequestHandler("server/discover",()=>e._ondiscover())},O0=e=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new T0({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:e=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,r)=>this._verifyRequestState(e,t,r),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){if(super(t),this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Ya,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=P0(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))o!==void 0&&Nl(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),El(this._supportedProtocolVersions).length>0&&this.setRequestHandler("server/discover",()=>this._ondiscover()),this._capabilities.logging&&this._registerLoggingHandler()}async connect(e){if(this.transport!==void 0)throw new ue(me.AlreadyConnected,"Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");await super.connect(e)}_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=Va(Bt,o);return n.success&&this._loggingLevels.set(r,n.data),{}})}buildContext(e,t){let r=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,n,s)=>{if(!this._capabilities.logging)return Promise.resolve();let i;if(this._servedModernEra()){if(i=e.mcpReq.envelope?.[Zt],i===void 0)return Promise.resolve()}else i=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);return i!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i)?Promise.resolve():e.mcpReq.notify({method:"notifications/message",params:{level:o,data:n,logger:s}})},elicitInput:(o,n)=>this.elicitInput(o,n),requestSampling:(o,n)=>this.createMessage(o,n)},http:r?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(Bt.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return r?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r):!1};registerCapabilities(e){if(this.transport)throw new ue(me.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;this._capabilities=Bl(this._capabilities,e),!t&&this._capabilities.logging&&this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=C0.has(e);return r===void 0&&!o?async(n,s)=>{let i=await t(n,s);if(Et(i))throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}:async(n,s)=>{let i=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(Et(i)){if(!o)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}return r===void 0?i:Da(i,r)}}return async(r,o)=>{let n=oo(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new oe(s.reason==="not-in-era"?B.InternalError:B.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let i=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(Et(i))return i;let c=Tl(i),a=n.validateResult("tools/call",c);if(!a.ok)throw new oe(a.reason==="not-in-era"?B.InternalError:B.InvalidParams,a.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${a.message}`);return a.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&xn(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 oe(B.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let i=o;if(typeof s=="string"){let m=await this._verifyRequestState(s,o,e);m!==void 0&&(i=Hl(o,m))}let c;try{c=await t(r,i)}catch(m){throw m instanceof oe&&m.code===B.UrlElicitationRequired&&n?new oe(B.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { \u2026: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`):m}if(!Et(c))return c;if(!n){if(!this._inputRequiredServing.legacyShim)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??pr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,i,c)}let a=c.inputRequests,u=a!=null&&Object.keys(a).length>0,d=typeof c.requestState=="string";if(!u&&!d)throw new oe(B.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let m=this._inputRequestCapabilityView(o);for(let[g,v]of Object.entries(a)){let{embedded:p,required:_}=$_(e,g,v),h=La(_,m);if(h!==void 0)throw new Ua({requiredCapabilities:h},`Cannot request input '${g}' (${p.method}): the request's client capabilities do not declare the required capability`)}}return c}async _verifyRequestState(e,t,r){if(this._requestStateVerify!==void 0)try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(new Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new oe(B.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 ue(me.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead \u2014 the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new ue(me.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new ue(me.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new ue(me.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new ue(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new ue(me.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new ue(me.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new ue(me.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new ue(me.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new ue(me.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new ue(me.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new ue(me.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new ue(me.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let r=vg(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??pr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:El(this._supportedProtocolVersions),capabilities:N0(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new ue(me.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),i=Array.isArray(s.content)?s.content:[s.content],c=i.some(m=>m.type==="tool_result"),a=e.messages.length>1?e.messages.at(-2):void 0,u=a?Array.isArray(a.content)?a.content:[a.content]:[],d=u.some(m=>m.type==="tool_use");if(c){if(i.some(m=>m.type!=="tool_result"))throw new oe(B.InvalidParams,"The last message must contain only tool_result content if any is present");if(!d)throw new oe(B.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(d){let m=new Set(u.filter(v=>v.type==="tool_use").map(v=>v.id)),g=new Set(i.filter(v=>v.type==="tool_result").map(v=>v.toolUseId));if(m.size!==g.size||![...m].every(v=>g.has(v)))throw new oe(B.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=!!(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),n=this._wireCodec().samplingResultVariant(r,o);if(!n.ok)throw new ue(me.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new ue(me.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,r){let o=e.mode??"form",n=r?.validateAcceptedContent??!0;switch(o){case"url":{let s=e;return this.request({method:"elicitation/create",params:s},t)}case"form":{let s=e.mode==="form"?e:{...e,mode:"form"},i=await this.request({method:"elicitation/create",params:s},t);if(n&&i.action==="accept"&&i.content&&s.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(s.requestedSchema)(i.content);if(!c.valid)throw new oe(B.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(c){throw c instanceof oe?c:new oe(B.InternalError,`Error validating elicitation response: ${c instanceof Error?c.message:String(c)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new ue(me.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function N0(e){return{...e}}function j0(e,t){let r=0,o=[e];for(;o.length>0;){let n=o.pop();if(!(n===null||typeof n!="object"))if(Array.isArray(n))for(let s of n){if(++r>t)return r;s!==null&&typeof s=="object"&&o.push(s)}else for(let s in n){if(!Object.prototype.hasOwnProperty.call(n,s))continue;if(++r>t)return r;let i=n[s];i!==null&&typeof i=="object"&&o.push(i)}}return r}function x0(e){if(!(e===void 0||e===1/0)){if(typeof e!="number"||Number.isNaN(e)||e<1)throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(e)}`);return e}}var Xa=class{server;_maxToolInputElements;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(!(t===void 0||!t.enabled)){if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return __;try{let r=_r(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}}constructor(e,t){this.server=new w_(e,t),this._maxToolInputElements=x0(t?.maxToolInputElements),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}async connect(e){return R0(e)&&e.setScopeChallengeResolver(t=>this.resolveScopeChallenge(t)),await this.server.connect(e)}async close(){await this.server.close()}resolveScopeChallenge=e=>{switch(e.request.method){case"tools/call":{let t=e.request.params?.name;if(typeof t!="string")return;let r=this._registeredTools[t];return r===void 0||!r.enabled?void 0:r.scopeChallenge?.(e)}case"resources/read":{let t=e.request.params?.uri;if(typeof t!="string")return;let r;try{r=new URL(t)}catch{return}let o=this._registeredResources[r.toString()];if(o!==void 0)return o.enabled?o.scopeChallenge?.(e):void 0;for(let n of Object.values(this._registeredResourceTemplates))if(n.resourceTemplate.uriTemplate.match(r.toString()))return n.enabled?n.scopeChallenge?.(e):void 0;return}case"prompts/get":{let t=e.request.params?.name;if(typeof t!="string")return;let r=this._registeredPrompts[t];return r===void 0||!r.enabled?void 0:r.scopeChallenge?.(e)}default:return}};_toolHandlersInitialized=!1;setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?A0(e,t.inputSchema):__,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};return t.outputSchema&&(r.outputSchema=_r(t.outputSchema,"output")),r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new oe(B.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(r,e.params.arguments,e.params.name),n=await this.executeToolHandler(r,o,t);return await this.validateToolOutput(r,n,e.params.name),Et(n)?n:this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof oe&&o.code===B.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(this._maxToolInputElements!==void 0&&j0(t,this._maxToolInputElements)>this._maxToolInputElements)throw new oe(B.InvalidParams,`Invalid arguments for tool ${r}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!e.inputSchema)return;let o=await gr(e.inputSchema,t??{});if(!o.success)throw new oe(B.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema||Et(t)||t.isError)return;if(t.structuredContent===void 0)throw new oe(B.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let o=await gr(e.outputSchema,t.structuredContent);if(!o.success)throw new oe(B.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${o.error}`)}async executeToolHandler(e,t,r){return e.executor(t,r)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async e=>{switch(e.params.ref.type){case"ref/prompt":return Zl(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Ul(e),this.handleResourceCompletion(e,e.params.ref);default:throw new oe(B.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new oe(B.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Mn;let o=z_(b_(r.argsSchema)?.[e.params.argument.name]);if(!sd(o))return Mn;let n=z0(o);return n?v_(await n(e.params.argument.value,e.params.context)):Mn}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find(n=>n.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return Mn;throw new oe(B.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);return o?v_(await o(e.params.argument.value,e.params.context)):Mn}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,s])=>s.enabled).map(([n,s])=>({uri:n,name:s.name,...s.metadata})),o=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let s=await n.resourceTemplate.listCallback(t);for(let i of s.resources)o.push({...n.metadata,...i})}return{resources:[...r,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let r;try{r=new URL(e.params.uri)}catch{throw new oe(B.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[r.toString()];if(o){if(!o.enabled)throw new oe(B.InvalidParams,`Resource ${r} disabled`);return Da(await o.readCallback(r,t),o.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let s=n.resourceTemplate.uriTemplate.match(r.toString());if(s){if(!n.enabled)throw new oe(B.InvalidParams,`Resource template ${n.resourceTemplate.uriTemplate} disabled`);return Da(await n.readCallback(r,s,t),n.cacheHint)}}throw new Za(e.params.uri)}),this._resourceHandlersInitialized=!0)}_promptHandlersInitialized=!1;setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?Mg(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new oe(B.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new oe(B.InvalidParams,`Prompt ${e.params.name} disabled`);return r.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0)}registerResource(e,t,r,o){let{cacheHint:n,scopeChallenge:s,...i}=r,c=i;if(n!==void 0&&Nl(n,`resource ${e}`),typeof t=="string"){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);let a=this._createRegisteredResource(e,r.title,t,c,s,o);return n!==void 0&&(a.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let a=this._createRegisteredResourceTemplate(e,r.title,t,c,s,o);return n!==void 0&&(a.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}_createRegisteredResource(e,t,r,o,n,s){let i={name:e,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:c=>{c.uri!==void 0&&c.uri!==r&&(delete this._registeredResources[r],c.uri&&(this._registeredResources[c.uri]=i)),c.name!==void 0&&(i.name=c.name),c.title!==void 0&&(i.title=c.title),c.metadata!==void 0&&(i.metadata=c.metadata),c.callback!==void 0&&(i.readCallback=c.callback),c.scopeChallenge!==void 0&&(i.scopeChallenge=c.scopeChallenge===null?void 0:c.scopeChallenge),c.enabled!==void 0&&(i.enabled=c.enabled),this.sendResourceListChanged()}};return this._registeredResources[r]=i,i}_createRegisteredResourceTemplate(e,t,r,o,n,s){let i={resourceTemplate:r,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:a=>{a.name!==void 0&&a.name!==e&&(delete this._registeredResourceTemplates[e],a.name&&(this._registeredResourceTemplates[a.name]=i)),a.title!==void 0&&(i.title=a.title),a.template!==void 0&&(i.resourceTemplate=a.template),a.metadata!==void 0&&(i.metadata=a.metadata),a.callback!==void 0&&(i.readCallback=a.callback),a.scopeChallenge!==void 0&&(i.scopeChallenge=a.scopeChallenge===null?void 0:a.scopeChallenge),a.enabled!==void 0&&(i.enabled=a.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let c=r.uriTemplate.variableNames;return Array.isArray(c)&&c.some(a=>!!r.completeCallback(a))&&this.setCompletionRequestHandler(),i}_createRegisteredPrompt(e,t,r,o,n,s,i,c){let a=o,u=n,d={title:t,description:r,argsSchema:o,icons:s,scopeChallenge:i,_meta:c,handler:y_(e,o,n),enabled:!0,disable:()=>d.update({enabled:!1}),enable:()=>d.update({enabled:!0}),remove:()=>d.update({name:null}),update:m=>{m.name!==void 0&&m.name!==e&&(delete this._registeredPrompts[e],m.name&&(this._registeredPrompts[m.name]=d)),m.title!==void 0&&(d.title=m.title),m.description!==void 0&&(d.description=m.description),m.icons!==void 0&&(d.icons=m.icons),m.scopeChallenge!==void 0&&(d.scopeChallenge=m.scopeChallenge===null?void 0:m.scopeChallenge),m._meta!==void 0&&(d._meta=m._meta);let g=!1;m.argsSchema!==void 0&&(d.argsSchema=m.argsSchema,a=m.argsSchema,g=!0),m.callback!==void 0&&(u=m.callback,g=!0),g&&(d.handler=y_(e,a,u)),m.enabled!==void 0&&(d.enabled=m.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[e]=d,o){let m=b_(o);m&&Object.values(m).some(g=>sd(z_(g)))&&this.setCompletionRequestHandler()}return d}_createRegisteredTool(e,t,r,o,n,s,i,c,a,u,d){Wl(e);let m=d,g,v={title:t,description:r,inputSchema:o,outputSchema:n,get outputSchemaJson(){return g??=S_(v.outputSchema)},set outputSchemaJson(p){g=p},annotations:s,icons:i,execution:c,scopeChallenge:a,_meta:u,handler:d,executor:g_(o,d),enabled:!0,disable:()=>v.update({enabled:!1}),enable:()=>v.update({enabled:!0}),remove:()=>v.update({name:null}),update:p=>{p.name!==void 0&&p.name!==e&&(typeof p.name=="string"&&Wl(p.name),delete this._registeredTools[e],delete this._toolInputSchemaJson[e],p.name&&(delete this._toolInputSchemaJson[p.name],this._registeredTools[p.name]=v,e=p.name)),p.title!==void 0&&(v.title=p.title),p.description!==void 0&&(v.description=p.description);let _=!1;p.paramsSchema!==void 0&&(v.inputSchema=p.paramsSchema,delete this._toolInputSchemaJson[e],_=!0),p.callback!==void 0&&(v.handler=p.callback,m=p.callback,_=!0),_&&(v.executor=g_(v.inputSchema,m)),p.outputSchema!==void 0&&(v.outputSchema=p.outputSchema,v.outputSchemaJson=S_(p.outputSchema)),p.annotations!==void 0&&(v.annotations=p.annotations),p.icons!==void 0&&(v.icons=p.icons),p.scopeChallenge!==void 0&&(v.scopeChallenge=p.scopeChallenge===null?void 0:p.scopeChallenge),p._meta!==void 0&&(v._meta=p._meta),p.enabled!==void 0&&(v.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=v,this.setToolRequestHandlers(),this.sendToolListChanged(),v}registerTool(e,t,r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:o,description:n,inputSchema:s,outputSchema:i,annotations:c,icons:a,scopeChallenge:u,_meta:d}=t;return this._createRegisteredTool(e,o,n,Fa(s),Fa(i),c,a,void 0,u,d,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:o,description:n,argsSchema:s,icons:i,scopeChallenge:c,_meta:a}=t,u=this._createRegisteredPrompt(e,o,n,Fa(s),r,i,c,a);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),u}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};function g_(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var __={type:"object",properties:{}};function A0(e,t){let r=_r(t,"input"),o=Vl(r);return o.valid||console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${o.reason}`),r}function S_(e){if(e!==void 0)try{return _r(e,"output")}catch{return}}function y_(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await gr(t,n??{});if(!i.success)throw new oe(B.InvalidParams,`Invalid arguments for prompt ${e}: ${i.error}`);return o(i.data,s)}}else{let o=r;return async(n,s)=>o(s)}}function v_(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var Mn={completion:{values:[],hasMore:!1}};function b_(e){let t=e;if(t.shape&&typeof t.shape=="object")return t.shape}function q0(e){return e?.type==="optional"}function z_(e){return q0(e)?e.def?.innerType??e:e}var TE=4*1024*1024;var P_=Symbol("swallowsErrorsAfterClose"),E_=class{_readBuffer;_started=!1;_closed=!1;constructor(e=od.stdin,t=od.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new Kl({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._closed||(this.onerror?.(e),this.close().catch(()=>{}))};_onstdinclose=()=>{this.close().catch(()=>{})};async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0;for(let e of this._stdout.listeners("error"))e[P_]&&this._stdout.off("error",e);(this._stdin.readableEnded||this._stdin.destroyed)&&setImmediate(this._onstdinclose),this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdin.on("end",this._onstdinclose),this._stdin.on("close",this._onstdinclose),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._closed||(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.off("end",this._onstdinclose),this._stdin.off("close",this._onstdinclose),this._onstdouterror[P_]=!0,this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.())}send(e){return this._closed?Promise.reject(new Error("StdioServerTransport is closed")):new Promise((t,r)=>{let o=Gl(e),n=!1,s=c=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),r(c))},i=()=>{n||(n=!0,this._stdout.off("error",s),this._stdout.off("drain",i),t())};if(this._stdout.once("error",s),this._stdout.write(o)){if(n)return;n=!0,this._stdout.off("error",s),t()}else n||this._stdout.once("drain",i)})}};import{isAbsolute as H0}from"node:path";function T_(e,t){let r=e.find(o=>o.id===t);if(r?.kind!=="select")throw new Error(`no select option "${t}"`);return r.choices.map(o=>o.value)}var C_={kind:"document",path:"/forge.pdf",format:"pdf",bytes:0,pages:2,encrypted:!1},J0=hd(),B0=yd.map(e=>e.id).filter(e=>e!=="convert"&&e!=="compress"),K0=T_(_d.options([C_],{},cc),"degrees").map(Number),HE=T_(Sd.options([C_],{},cc),"mode");var Qa=l().refine(H0,"must be an absolute path").describe("An absolute path."),ec=I(Qa).min(1),G0=Lt("mode",[P({mode:O("every-page")}),P({mode:O("every-n"),n:L().int().min(1)}),P({mode:O("points"),after:I(L().int().min(1)).min(1).describe("Cut after these pages (1-based).")})]).describe("How to split: every page, every N pages, or after the given pages."),k_=P({paths:ec.describe("Absolute paths of files (or folders) to inspect.")}),I_=P({}),O_=P({paths:ec.describe("Absolute paths of files, folders or globs to convert."),to:ce(J0).describe('Target format id. Use "jpeg" for JPG.'),output:Qa.optional().describe("A folder (or, for one input, a file) to write to. Default: beside each source."),quality:L().int().min(1).max(100).optional().describe("For lossy targets, 1-100."),dpi:L().int().min(36).max(600).optional().describe("PDF \u2192 image resolution. Default 150."),pages:l().optional().describe('PDF \u2192 image page selection, e.g. "3-7,12". Default all.'),background:l().optional().describe("Fill colour when transparency must be flattened. Default #ffffff."),keepMetadata:H().optional().describe("Keep EXIF and GPS data. Default false."),password:l().optional().describe("Password for an encrypted PDF. Never echoed back."),overwrite:H().optional().describe("Replace existing outputs. Default false \u2014 only when the user asked."),recursive:H().optional().describe("Descend into subfolders of a folder input."),sharpen:H().optional().describe("Images only: sharpen at the same size with the optional boost extension, writing name-sharp. `to` is then the output format. Fails with extension-missing when it is not installed; the fix is `forge extensions add boost`."),boost:W([O(2),O(4)]).optional().describe("Images only: enlarge 2 or 4 times with the optional boost extension, writing name-2x / name-4x. `to` is then the output format (png keeps transparency). Fails with extension-missing when it is not installed; the fix is `forge extensions add boost`."),removeBackground:H().optional().describe("Images only: cut out the subject with the optional remove-background extension, writing name-cutout. `to` must carry transparency (png, webp, avif, tiff). Fails with extension-missing when it is not installed; the fix is `forge extensions add remove-background`.")}),N_=P({paths:ec.describe("Absolute paths of files to compress."),quality:L().int().min(1).max(100).optional().describe("Compress to this quality."),maxSize:l().optional().describe('Compress until it fits, e.g. "500kb" or "2mb".'),dpi:L().int().min(36).max(600).optional().describe("For a PDF: image resolution."),output:Qa.optional().describe("A folder or file to write to."),overwrite:H().optional().describe("Replace existing outputs. Default false.")}).refine(e=>e.quality===void 0!=(e.maxSize===void 0),{message:"Give exactly one of quality or maxSize."}),j_=P({op:ce(B0).describe("The page operation."),paths:ec.describe("Absolute PDF paths. merge takes two or more, in order; the others take one."),pages:l().optional().describe('extract / delete: which pages, e.g. "3-7,12".'),separate:H().optional().describe("extract: one file per page."),degrees:O(K0).optional().describe("rotate: degrees clockwise."),split:G0.optional(),overwrite:H().optional().describe("Replace existing outputs. Default false.")}),Ln=Ge({path:l().optional(),code:l(),title:l(),detail:l(),hint:l().optional()}),W0=Ge({op:l(),source:l(),sources:I(l()),outputs:I(l()),inputBytes:L(),outputBytes:L(),warnings:I(Ge({code:l(),message:l()}))}),tc=Ge({forge:l(),ok:H(),results:I(W0),failures:I(Ln)}),x_=Ge({forge:l(),ok:H(),probes:I(Ge({path:l(),kind:ce(["image","document"]),format:l(),bytes:L(),width:L().optional(),height:L().optional(),pages:L().optional(),encrypted:H().optional(),targets:I(l()),actions:I(l())})),failures:I(Ln)}),A_=Ge({forge:l(),ok:H(),formats:I(Ge({id:l(),label:l(),extensions:I(l()),read:H(),write:H(),lossy:H()})),failures:I(Ln)}),q_=l().describe("A hex colour: #RRGGBB, #RGB, or without the #"),M_=P({path:Qa.describe("An image file (absolute path): a photo, a screenshot or artwork"),inside:q_.optional().describe("Show the shades of the palette colour nearest this one")}),L_=P({colour:q_}),D_=Ge({forge:l(),ok:H(),palette:Ge({source:l(),inside:l().optional(),colours:I(Ge({hex:l(),rgb:l(),oklch:l(),share:L()}))}),failures:I(Ln)}),Z_=Ge({forge:l(),ok:H(),scale:Ge({reference:l(),steps:I(Ge({step:L(),hex:l(),oklch:l(),white:L(),black:L()}))}),failures:I(Ln)});import{Writable as Y0}from"node:stream";function U_(e=process.stdout,t=process.stderr){let r=e.write.bind(e);return e.write=t.write.bind(t),new Y0({write(o,n,s){r(o,n,s)}})}import{basename as X0}from"node:path";import{pathToFileURL as Q0}from"node:url";var V_={interactive:!1},F_=Promise.resolve();function eR(e){let t=F_.then(e,e);return F_=t.catch(()=>{}),t}var rc=(e,t)=>eR(()=>zd(e,t===void 0?V_:{...V_,signal:t}));function H_(e){let t=e.path===void 0?"":` (${e.path})`,r=e.hint===void 0?"":` ${e.hint}`;return`\u2715 ${e.title}${t}: ${e.detail}${r}`}function J_(e){let t=e.results.map(o=>`\u2713 ${o.source} \u2192 ${o.outputs.join(", ")}`);t.push(...e.failures.map(H_));let r=e.results.flatMap(o=>o.outputs).map(o=>({type:"resource_link",uri:Q0(o).href,name:X0(o)}));return{content:[{type:"text",text:t.join(`
|
|
69
|
+
`)||"Nothing to do."},...r],structuredContent:{...e},isError:!e.ok}}var oc=e=>J_(dd(ir,e)),Dn=e=>J_(pd(ir,e));async function B_(e){let t=fd(ir,await vd(e.paths)),r=t.probes.map(o=>{let n=o.pages===void 0?`${o.width}\xD7${o.height}`:`${o.pages} pages`;return`${o.path}: ${o.format}, ${o.bytes} bytes, ${n}${o.encrypted?", password-protected":""}. Can become: ${o.targets.join(", ")}. Actions: ${o.actions.join(", ")}.`});return r.push(...t.failures.map(H_)),{content:[{type:"text",text:r.join(`
|
|
70
|
+
`)}],structuredContent:{...t},isError:!t.ok}}function K_(){let e=md(ir,gd());return{content:[{type:"text",text:e.formats.map(r=>{let o=r.read&&r.write?"read and write":r.read?"read only":"write only";return`${r.id} (${r.extensions.join(" ")}): ${o}`}).join(`
|
|
71
|
+
`)}],structuredContent:{...e}}}async function G_(e,t){let r=[...e.sharpen===!0?["sharpen"]:[],...e.boost!==void 0?["boost"]:[],...e.removeBackground===!0?["removeBackground"]:[]];if(r.length>0){if(r.length>1)return Dn(Nt(`Use one operation at a time \u2014 got ${r.join(" and ")}.`));let n=e.sharpen===!0?1:e.boost,s={kind:"extension-op",op:n!==void 0?"boost":"remove-background",inputs:e.paths,target:e.to,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,...n===void 0?{}:{scale:n},...e.output===void 0?{}:{output:e.output}};return oc(await rc(s,t))}let o={kind:"convert",inputs:e.paths,target:e.to,options:{background:e.background??"#ffffff",keepMetadata:e.keepMetadata??!1,...e.quality===void 0?{}:{quality:e.quality}},force:e.overwrite??!1,recursive:e.recursive??!1,debug:!1,dpi:e.dpi??150,passwordStdin:!1,...e.output===void 0?{}:{output:e.output},...e.pages===void 0?{}:{pages:e.pages},...e.password===void 0?{}:{password:e.password}};return oc(await rc(o))}async function W_(e){let t={kind:"compress",inputs:e.paths,options:{background:"#ffffff",keepMetadata:!1},force:e.overwrite??!1,recursive:!1,debug:!1};if(e.quality!==void 0&&(t.quality=e.quality),e.maxSize!==void 0){let r=ud(e.maxSize);if(r===void 0)return Dn(Nt(`${e.maxSize} is not a size.`,"Try a number with a unit, for example 500kb, 2mb or 1.5mb."));t.maxBytes=r}return e.dpi!==void 0&&(t.dpi=e.dpi),e.output!==void 0&&(t.output=e.output),oc(await rc(t))}async function Y_(e){let t={kind:"pageop",action:e.op,inputs:e.paths,force:e.overwrite??!1,debug:!1};if(e.op==="extract"||e.op==="delete"){if(e.pages===void 0)return Dn(Nt(`${e.op} needs pages, for example "3-7,12".`));t.pages=e.pages,e.op==="extract"&&e.separate===!0&&(t.separate=!0)}if(e.op==="rotate"){if(e.degrees===void 0)return Dn(Nt("rotate needs degrees: 90, 180 or 270."));t.rotate=e.degrees}if(e.op==="split"){if(e.split===void 0)return Dn(Nt("split needs a split mode: every-page, every-n or points."));t.split=e.split}return oc(await rc(t))}function id(e){return{content:[{type:"text",text:e}],isError:!0}}async function X_(e){let t=e.inside===void 0?void 0:ac(e.inside);if(e.inside!==void 0&&!t)return id(`${e.inside} is not a colour. Try #RRGGBB.`);try{let{runPalette:r}=await import("./colour-QV2C3R7R.js"),o=await r({kind:"palette",input:e.path,svg:!1,...t?{inside:t}:{}},{json:!0,colour:!1}),n=JSON.parse(o.stdout[0]??"{}"),s=bd(n.palette.colours.map(c=>c.share));return{content:[{type:"text",text:n.palette.colours.map((c,a)=>`${c.hex} ${s[a]}%`).join(`
|
|
72
|
+
`)}],structuredContent:{...n}}}catch(r){if(ld(r))return id(`${r.title}: ${r.detail}${r.hint?` ${r.hint}`:""}`);throw r}}async function Q_(e){let t=ac(e.colour);if(!t)return id(`${e.colour} is not a colour. Try #RRGGBB.`);let{runScale:r}=await import("./colour-QV2C3R7R.js"),o=await r({kind:"scale",colour:t,svg:!1},{json:!0,colour:!1}),n=JSON.parse(o.stdout[0]??"{}");return{content:[{type:"text",text:n.scale.steps.map(i=>`${i.step} ${i.hex} white ${i.white} black ${i.black}`).join(`
|
|
73
|
+
`)}],structuredContent:{...n}}}var tR=["Forge converts, compresses and edits files on this Mac, locally.","Every path must be absolute.","Call forge_probe first: it says what a file is, every format it can become, and every action that applies.","Nothing is overwritten unless you pass overwrite: true \u2014 only do that when the user asked to replace a file.","A failure hint that mentions --force means overwrite: true here; --output means the output argument; --password-stdin means the password argument."].join(" "),nc={readOnlyHint:!0,openWorldHint:!1},ad={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1};function rR(){let e=new Xa({name:"forge",version:ir},{instructions:tR});return e.registerTool("forge_probe",{title:"Inspect files",description:"What each file is and what Forge can do with it: format (read from content, not the extension), size, pages or dimensions, whether it is password-protected, every format it can become, and every action that applies. Writes nothing.",inputSchema:k_,outputSchema:x_,annotations:nc},t=>B_(t)),e.registerTool("forge_formats",{title:"List formats",description:"Every format Forge reads and writes. Writes nothing.",inputSchema:I_,outputSchema:A_,annotations:nc},()=>K_()),e.registerTool("forge_convert",{title:"Convert files",description:"Convert files to another format, beside each source unless output is given. A PDF becomes one image per page (choose pages and dpi); Word documents become PDF; images convert between formats. Returns every output path and a file:// link to each.",inputSchema:O_,outputSchema:tc,annotations:ad},(t,r)=>G_(t,r.mcpReq.signal)),e.registerTool("forge_compress",{title:"Compress files",description:'Make files smaller without changing their format: by quality (1-100) or to fit a size such as "500kb". Writes <name>-small.<ext> beside the source unless output is given. A lossless format such as PNG cannot be compressed; convert it instead.',inputSchema:N_,outputSchema:tc,annotations:ad},t=>W_(t)),e.registerTool("forge_pdf",{title:"PDF page operations",description:"merge (two or more PDFs, in order), split, extract, delete or rotate pages. Writes new files beside the source and never edits the original. Password-protected PDFs are refused.",inputSchema:j_,outputSchema:tc,annotations:ad},t=>Y_(t)),e.registerTool("forge_palette",{title:"Colours of an image",description:"An image's main colours, most of the image first, each as hex, rgb and OKLCH with its share. With inside, the shades that one colour is made of. Writes nothing.",inputSchema:M_,outputSchema:D_,annotations:nc},t=>X_(t)),e.registerTool("forge_scale",{title:"Tonal scale",description:"A 50\u2013950 tonal scale built in OKLCH with the given colour at 500, each step with its contrast against white and black text. Writes nothing.",inputSchema:L_,outputSchema:Z_,annotations:nc},t=>Q_(t)),e}async function fT(e){if(e.length>0)throw Nt(`forge mcp takes no arguments, got: ${e.join(" ")}.`,"Register it with your agent, for example: claude mcp add forge -- forge mcp");let t=U_();await rR().connect(new E_(process.stdin,t))}export{tR as INSTRUCTIONS,rR as createForgeServer,fT as runMcpServer};
|