broods 0.50.0 → 0.51.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account.d.ts +1 -1
- package/dist/{chunk-qtvbrzvd.js → chunk-2p90qa7a.js} +1 -1
- package/dist/{chunk-187pvsnt.js → chunk-8c952qsc.js} +4 -4
- package/dist/{chunk-7ajf29ec.js → chunk-e2z6q3rv.js} +1 -1
- package/dist/{chunk-tgw6cmbm.js → chunk-entg5vra.js} +1 -1
- package/dist/chunk-gqyk7vva.js +5 -0
- package/dist/{chunk-4jqe5w5p.js → chunk-hvdejkn6.js} +1 -1
- package/dist/{chunk-463bn8qa.js → chunk-qxxrmem2.js} +6 -6
- package/dist/{chunk-2xb3wm7w.js → chunk-ware5wzj.js} +9 -9
- package/dist/cli/index.js +86 -64
- package/dist/index.d.ts +13 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-rv0n0evv.js +0 -5
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{Pe,xe,Se,D,be,ie,e,Ae,ae,ce,o,a,O,Oe,l,n,t,d,c,k,E,s,p,r,u,V,M}from"./chunk-463bn8qa.js";var{create:ul,defineProperty:fo,getOwnPropertyDescriptor:dl,getOwnPropertyNames:ml,getPrototypeOf:hl}=Object,pl=Object.prototype.hasOwnProperty,ye=(m,h)=>()=>(h||m((h={exports:{}}).exports,h),h.exports),Ni=(m,h)=>{let f={};for(var g in m)fo(f,g,{get:m[g],enumerable:!0});if(h)fo(f,Symbol.toStringTag,{value:"Module"});return f},fl=(m,h,f,g)=>{if(h&&typeof h==="object"||typeof h==="function"){for(var S=ml(h),b=0,_=S.length,R;b<_;b++)if(R=S[b],!pl.call(m,R)&&R!==f)fo(m,R,{get:((y)=>h[y]).bind(null,R),enumerable:!(g=dl(h,R))||g.enumerable})}return m},go=(m,h,f)=>(f=m!=null?ul(hl(m)):{},fl(h||!m||!m.__esModule?fo(f,"default",{value:m,enumerable:!0}):f,m));var gl=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Ii=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),Sl=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),_l=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Oi(m){return typeof m==="string"&&Ii.has(m.replace(/#$/,""))}function ki(m,h){if(!("$schema"in m)||typeof m.$schema!=="string")return"2020-12";let f=m.$schema.replace(/#$/,"");if(gl.has(f))return"2020-12";if(Ii.has(f))return"2019-09";if(Sl.has(f)||_l.has(f))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${m.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${h}`)}var Ai={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 Mi;(function(m){})(Mi||(Mi={}));function yl(m){return xe(ce,m)}var za="2025-11-25";var Rn=[za,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],zn="io.modelcontextprotocol/related-task",Dt="io.modelcontextprotocol/protocolVersion",gr="io.modelcontextprotocol/clientInfo",jt="io.modelcontextprotocol/serverInfo",Vt="io.modelcontextprotocol/clientCapabilities",$a="io.modelcontextprotocol/subscriptionId",la="io.modelcontextprotocol/logLevel";var Pa="2.0";var Lt=V(()=>c([e(),o(),a(),O(),s(e(),Lt),n(Lt)])),tt=s(e(),Lt),$n=n(Lt),Sr=c([e(),o().int()]),_r=e(),So=t({ttl:o().optional()}),_o=t({taskId:e()}),yr=d({progressToken:Sr.optional(),[zn]:_o.optional()}),dt=t({_meta:yr.optional()}),ua=dt.extend({task:So.optional()}),at=t({method:e(),params:dt.loose().optional()}),ft=t({_meta:yr.optional()}),gt=t({method:e(),params:ft.loose().optional()}),vr=d({get[jt](){return Ta.optional().catch(void 0)}}),rt=d({_meta:vr.optional()}),Ut=c([e(),o().int()]),br=t({jsonrpc:r(Pa),id:Ut,...at.shape}).strict(),Rr=t({jsonrpc:r(Pa),...gt.shape}).strict(),Ea=t({jsonrpc:r(Pa),id:Ut,result:rt}).strict(),wa=t({jsonrpc:r(Pa),id:Ut.optional(),error:t({code:o().int(),message:e(),data:l().optional()})}).strict(),yo=c([br,Rr,Ea,wa]),Pn=c([Ea,wa]),zr=rt.strict(),vo=ft.extend({requestId:Ut.optional(),reason:e().optional()}),$r=gt.extend({method:r("notifications/cancelled"),params:vo}),bo=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),Ht=t({icons:n(bo).optional()}),qt=t({name:e(),title:e().optional()}),Ta=qt.extend({...qt.shape,...Ht.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),zl=E(t({applyDefaults:a().optional()}),tt),$l=M((m)=>{if(m&&typeof m==="object"&&!Array.isArray(m)&&Object.keys(m).length===0)return{form:{}};return m},E(t({form:zl.optional(),url:tt.optional()}),tt.optional())),Ro=d({list:tt.optional(),cancel:tt.optional(),requests:d({sampling:d({createMessage:tt.optional()}).optional(),elicitation:d({create:tt.optional()}).optional()}).optional()}),zo=d({list:tt.optional(),cancel:tt.optional(),requests:d({tools:d({call:tt.optional()}).optional()}).optional()}),$o=t({experimental:s(e(),tt).optional(),sampling:t({context:tt.optional(),tools:tt.optional()}).optional(),elicitation:$l.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:Ro.optional(),extensions:s(e(),tt).optional()}),Po=dt.extend({protocolVersion:e(),capabilities:$o,clientInfo:Ta}),Eo=at.extend({method:r("initialize"),params:Po}),Pr=t({experimental:s(e(),tt).optional(),logging:tt.optional(),completions:tt.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:zo.optional(),extensions:s(e(),tt).optional()}),wo=rt.extend({protocolVersion:e(),capabilities:Pr,serverInfo:Ta,instructions:e().optional()}),To=gt.extend({method:r("notifications/initialized"),params:ft.optional()}),Co=at.extend({method:r("server/discover"),params:dt.optional()}),qo=rt.extend({supportedVersions:n(e()),capabilities:Pr,instructions:e().optional()}),Er=at.extend({method:r("ping"),params:dt.optional()}),jo=t({progress:o(),total:u(o()),message:u(e())}),No=t({...ft.shape,...jo.shape,progressToken:Sr}),wr=gt.extend({method:r("notifications/progress"),params:No}),Io=dt.extend({cursor:_r.optional()}),Ft=at.extend({params:Io.optional()}),xt=rt.extend({nextCursor:_r.optional()}),Tr=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),Cr=Tr.extend({text:e()}),En=e().refine((m)=>{try{return atob(m),!0}catch{return!1}},{message:"Invalid Base64 string"}),qr=Tr.extend({blob:En}),Kt=p(["user","assistant"]),Nt=t({audience:n(Kt).optional(),priority:o().min(0).max(1).optional(),lastModified:D({offset:!0}).optional()}),jr=t({...qt.shape,...Ht.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Nt.optional(),_meta:u(d({}))}),Oo=t({...qt.shape,...Ht.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Nt.optional(),_meta:u(d({}))}),ko=Ft.extend({method:r("resources/list")}),Mo=xt.extend({resources:n(jr)}),Ao=Ft.extend({method:r("resources/templates/list")}),Lo=xt.extend({resourceTemplates:n(Oo)}),Ca=dt.extend({uri:e()}),Do=Ca,Vo=at.extend({method:r("resources/read"),params:Do}),Uo=rt.extend({contents:n(c([Cr,qr]))}),Ho=gt.extend({method:r("notifications/resources/list_changed"),params:ft.optional()}),Fo=Ca,xo=at.extend({method:r("resources/subscribe"),params:Fo}),Ko=Ca,Bo=at.extend({method:r("resources/unsubscribe"),params:Ko}),Nr=t({toolsListChanged:a().optional(),promptsListChanged:a().optional(),resourcesListChanged:a().optional(),resourceSubscriptions:n(e()).optional()}),Go=dt.extend({notifications:Nr}),Jo=at.extend({method:r("subscriptions/listen"),params:Go}),Wo=ft.extend({notifications:Nr}),Yo=gt.extend({method:r("notifications/subscriptions/acknowledged"),params:Wo}),Zo=vr.extend({[$a]:Ut}),Xo=rt.extend({_meta:Zo}),Qo=ft.extend({uri:e()}),es=gt.extend({method:r("notifications/resources/updated"),params:Qo}),ts=t({name:e(),description:u(e()),required:u(a())}),as=t({...qt.shape,...Ht.shape,description:u(e()),arguments:u(n(ts)),_meta:u(d({}))}),rs=Ft.extend({method:r("prompts/list")}),os=xt.extend({prompts:n(as)}),ss=dt.extend({name:e(),arguments:s(e(),e()).optional()}),ns=at.extend({method:r("prompts/get"),params:ss}),qa=t({type:r("text"),text:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),ja=t({type:r("image"),data:En,mimeType:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),Na=t({type:r("audio"),data:En,mimeType:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),is=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),cs=t({type:r("resource"),resource:c([Cr,qr]),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),ls=jr.extend({type:r("resource_link")}),Ia=c([qa,ja,Na,ls,cs]),us=t({role:Kt,content:Ia}),ds=rt.extend({description:e().optional(),messages:n(us)}),ms=gt.extend({method:r("notifications/prompts/list_changed"),params:ft.optional()}),hs=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),ps=t({taskSupport:p(["required","optional","forbidden"]).optional()}),Ir=t({...qt.shape,...Ht.shape,description:e().optional(),inputSchema:t({type:r("object"),properties:s(e(),Lt).optional(),required:n(e()).optional()}).catchall(l()),outputSchema:d({$schema:e().optional()}).optional(),annotations:hs.optional(),execution:ps.optional(),_meta:s(e(),l()).optional()}),fs=Ft.extend({method:r("tools/list")}),gs=xt.extend({tools:n(Ir)}),Or=rt.extend({content:n(Ia).default([]),structuredContent:l().optional(),isError:a().optional()}),wn=Or.or(rt.extend({toolResult:l()})),Ss=ua.extend({name:e(),arguments:s(e(),l()).optional()}),_s=at.extend({method:r("tools/call"),params:Ss}),ys=gt.extend({method:r("notifications/tools/list_changed"),params:ft.optional()}),Tn=t({autoRefresh:a().default(!0),debounceMs:o().int().nonnegative().default(300)}),Bt=p(["debug","info","notice","warning","error","critical","alert","emergency"]),vs=dt.extend({level:Bt}),bs=at.extend({method:r("logging/setLevel"),params:vs}),Rs=ft.extend({level:Bt,logger:e().optional(),data:l()}),zs=gt.extend({method:r("notifications/message"),params:Rs}),$s=t({name:e().optional()}),Ps=t({hints:n($s).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),Es=t({mode:p(["auto","required","none"]).optional()}),ws=t({type:r("tool_result"),toolUseId:e().describe("The unique identifier for the corresponding tool call."),content:n(Ia),structuredContent:l().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),Ts=k("type",[qa,ja,Na]),ca=k("type",[qa,ja,Na,is,ws]),Cs=t({role:Kt,content:c([ca,n(ca)]),_meta:s(e(),l()).optional()}),qs=ua.extend({messages:n(Cs),modelPreferences:Ps.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:tt.optional(),tools:n(Ir).optional(),toolChoice:Es.optional()}),js=at.extend({method:r("sampling/createMessage"),params:qs}),Ns=rt.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens"]).or(e())),role:Kt,content:Ts}),Is=rt.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens","toolUse"]).or(e())),role:Kt,content:c([ca,n(ca)])}),kr=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),Oa=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),ka=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),Mr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),Ar=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),Lr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),Os=c([Mr,Ar]),Dr=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),Vr=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),ks=c([Dr,Vr]),Ms=c([Lr,Os,ks]),Ur=c([Ms,kr,Oa,ka]),Ma=ua.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),Ur),required:n(e()).optional()}).catchall(l())}),As=ua.extend({mode:r("url"),message:e(),elicitationId:e(),url:e().url()}),Ls=c([Ma,As]),Ds=at.extend({method:r("elicitation/create"),params:Ls}),Vs=ft.extend({elicitationId:e()}),Us=gt.extend({method:r("notifications/elicitation/complete"),params:Vs}),Hs=rt.extend({action:p(["accept","decline","cancel"]),content:M((m)=>m===null?void 0:m,s(e(),c([e(),o(),a(),n(e())])).optional())}),Fs=t({type:r("ref/resource"),uri:e()}),xs=t({type:r("ref/prompt"),name:e()}),Ks=dt.extend({ref:c([xs,Fs]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()}),Bs=at.extend({method:r("completion/complete"),params:Ks}),Gs=rt.extend({completion:d({values:n(e()).max(100),total:u(o().int()),hasMore:u(a())})}),Js=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),Ws=at.extend({method:r("roots/list"),params:dt.optional()}),Ys=rt.extend({roots:n(Js)}),Zs=gt.extend({method:r("notifications/roots/list_changed"),params:ft.optional()}),Cn=d({ttl:o().optional(),pollInterval:o().optional()}),Xs=p(["working","input_required","completed","failed","cancelled"]),Gt=t({taskId:e(),status:Xs,ttl:c([o(),O()]),createdAt:e(),lastUpdatedAt:e(),pollInterval:u(o()),statusMessage:u(e())}),qn=rt.extend({task:Gt}),Qs=ft.merge(Gt),jn=gt.extend({method:r("notifications/tasks/status"),params:Qs}),Nn=at.extend({method:r("tasks/get"),params:dt.extend({taskId:e()})}),In=rt.merge(Gt),On=at.extend({method:r("tasks/result"),params:dt.extend({taskId:e()})}),kn=rt.loose(),Mn=Ft.extend({method:r("tasks/list")}),An=xt.extend({tasks:n(Gt)}),Ln=at.extend({method:r("tasks/cancel"),params:dt.extend({taskId:e()})}),Dn=rt.merge(Gt),Vn=c([Er,Eo,Co,Bs,bs,ns,rs,ko,Ao,Vo,xo,Bo,Jo,_s,fs]),Un=c([$r,wr,To,Zs]),Hn=c([zr,Ns,Is,Hs,Ys]),Fn=c([Er,js,Ds,Ws]),xn=c([$r,wr,zs,es,Ho,ys,ms,Yo,Us]),Kn=c([zr,wo,qo,Gs,ds,os,Mo,Lo,Uo,Or,gs,Xo]),ut=ae().superRefine((m,h)=>{if(!URL.canParse(m))return h.addIssue({code:Ai.custom,message:"URL must be parseable",fatal:!0}),Pe}).refine((m)=>{let h=new URL(m);return h.protocol!=="javascript:"&&h.protocol!=="data:"&&h.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Bn=d({resource:e().url(),authorization_servers:n(ut).optional(),jwks_uri:e().url().optional(),scopes_supported:n(e()).optional(),bearer_methods_supported:n(e()).optional(),resource_signing_alg_values_supported:n(e()).optional(),resource_name:e().optional(),resource_documentation:e().optional(),resource_policy_uri:e().url().optional(),resource_tos_uri:e().url().optional(),tls_client_certificate_bound_access_tokens:a().optional(),authorization_details_types_supported:n(e()).optional(),dpop_signing_alg_values_supported:n(e()).optional(),dpop_bound_access_tokens_required:a().optional()}),en=d({issuer:e(),authorization_endpoint:ut,token_endpoint:ut,registration_endpoint:ut.optional(),scopes_supported:n(e()).optional(),response_types_supported:n(e()),response_modes_supported:n(e()).optional(),grant_types_supported:n(e()).optional(),token_endpoint_auth_methods_supported:n(e()).optional(),token_endpoint_auth_signing_alg_values_supported:n(e()).optional(),service_documentation:ut.optional(),revocation_endpoint:ut.optional(),revocation_endpoint_auth_methods_supported:n(e()).optional(),revocation_endpoint_auth_signing_alg_values_supported:n(e()).optional(),introspection_endpoint:e().optional(),introspection_endpoint_auth_methods_supported:n(e()).optional(),introspection_endpoint_auth_signing_alg_values_supported:n(e()).optional(),code_challenge_methods_supported:n(e()).optional(),client_id_metadata_document_supported:a().optional(),authorization_response_iss_parameter_supported:a().optional().catch(void 0),dpop_signing_alg_values_supported:n(e()).optional()}),tn=d({issuer:e(),authorization_endpoint:ut,token_endpoint:ut,userinfo_endpoint:ut.optional(),jwks_uri:ut,registration_endpoint:ut.optional(),scopes_supported:n(e()).optional(),response_types_supported:n(e()),response_modes_supported:n(e()).optional(),grant_types_supported:n(e()).optional(),acr_values_supported:n(e()).optional(),subject_types_supported:n(e()),id_token_signing_alg_values_supported:n(e()),id_token_encryption_alg_values_supported:n(e()).optional(),id_token_encryption_enc_values_supported:n(e()).optional(),userinfo_signing_alg_values_supported:n(e()).optional(),userinfo_encryption_alg_values_supported:n(e()).optional(),userinfo_encryption_enc_values_supported:n(e()).optional(),request_object_signing_alg_values_supported:n(e()).optional(),request_object_encryption_alg_values_supported:n(e()).optional(),request_object_encryption_enc_values_supported:n(e()).optional(),token_endpoint_auth_methods_supported:n(e()).optional(),token_endpoint_auth_signing_alg_values_supported:n(e()).optional(),display_values_supported:n(e()).optional(),claim_types_supported:n(e()).optional(),claims_supported:n(e()).optional(),service_documentation:e().optional(),claims_locales_supported:n(e()).optional(),ui_locales_supported:n(e()).optional(),claims_parameter_supported:a().optional(),request_parameter_supported:a().optional(),request_uri_parameter_supported:a().optional(),require_request_uri_registration:a().optional(),op_policy_uri:ut.optional(),op_tos_uri:ut.optional(),client_id_metadata_document_supported:a().optional(),authorization_response_iss_parameter_supported:a().optional().catch(void 0)}),Gn=t({...tn.shape,...en.pick({code_challenge_methods_supported:!0}).shape}),Jn=t({access_token:e(),id_token:e().optional(),token_type:e(),expires_in:yl().optional(),scope:e().optional(),refresh_token:e().optional(),issuer:e().optional().catch(void 0)}).strip(),Wn=t({issued_token_type:r("urn:ietf:params:oauth:token-type:id-jag"),access_token:e(),token_type:e().optional(),expires_in:o().optional(),scope:e().optional()}).strip(),Yn=t({error:e(),error_description:e().optional(),error_uri:e().optional()}),bn=ut.optional().or(r("").transform(()=>{return})),an=t({redirect_uris:n(ut),token_endpoint_auth_method:e().optional(),grant_types:n(e()).optional(),response_types:n(e()).optional(),application_type:e().optional(),client_name:e().optional(),client_uri:ut.optional(),logo_uri:bn,scope:e().optional(),contacts:n(e()).optional(),tos_uri:bn,policy_uri:e().optional(),jwks_uri:ut.optional(),jwks:Oe().optional(),software_id:e().optional(),software_version:e().optional(),software_statement:e().optional()}).strip(),rn=t({client_id:e(),client_secret:e().optional(),client_id_issued_at:o().optional(),client_secret_expires_at:o().optional(),issuer:e().optional().catch(void 0)}).strip(),Zn=an.merge(rn),Xn=t({error:e(),error_description:e().optional()}).strip(),Qn=t({token:e(),token_type_hint:e().optional()}).strip();var ri=Symbol.for("mcp.sdk.errorBrands");function ii(m,h){let f=new Set,g=h;while(typeof g==="function"){let S=g.mcpBrand;if(Object.prototype.hasOwnProperty.call(g,"mcpBrand")&&typeof S==="string")f.add(S);g=Object.getPrototypeOf(g)}if(f.size===0)return;Object.defineProperty(m,ri,{value:f,enumerable:!1,configurable:!0})}function La(m,h){try{if(typeof h==="object"&&h!==null&&Object.prototype.hasOwnProperty.call(m,"mcpBrand")&&typeof m.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(h,ri)){let f=h[ri];if(f&&typeof f.has==="function"&&f.has(m.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(m,h)}var Ol=class m extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](h){return La(this,h)}static isInstance(h){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,h)}constructor(h,f,g){super(f);this.code=h,this.errorUri=g,this.name="OAuthError",ii(this,new.target)}toResponseObject(){let h={error:this.code,error_description:this.message};if(this.errorUri)h.error_uri=this.errorUri;return h}static fromResponse(h){return new m(h.error,h.error_description??h.error,h.error_uri)}},Je=function(m){return m.NotConnected="NOT_CONNECTED",m.AlreadyConnected="ALREADY_CONNECTED",m.NotInitialized="NOT_INITIALIZED",m.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",m.RequestTimeout="REQUEST_TIMEOUT",m.ConnectionClosed="CONNECTION_CLOSED",m.SendFailed="SEND_FAILED",m.InvalidResult="INVALID_RESULT",m.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",m.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",m.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",m.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",m.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",m.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",m.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",m.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",m.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",m.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",m.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",m}({}),Ke=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](m){return La(this,m)}static isInstance(m){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,m)}constructor(m,h,f,g){super(h,g);this.code=m,this.data=f,this.name="SdkError",ii(this,new.target)}},eh=class extends Ke{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(m,h,f,g){super(m,h,f,g);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function Li(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function kl(m,h,f){return m==="elicitation"&&h==="form"&&f.form===void 0&&f.url===void 0}function Zi(m){switch(m.method){case"elicitation/create":if(m.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let h=m.params;if(h!==void 0&&(h.tools!==void 0||h.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function ci(m,h){let f={};for(let[g,S]of Object.entries(m)){if(S===void 0)continue;let b=h===void 0?void 0:h[g];if(b===void 0){f[g]=S;continue}if(Li(S)&&Li(b)){let _={};for(let[R,y]of Object.entries(S))if(y!==void 0&&b[R]===void 0&&!kl(g,R,b))_[R]=y;if(Object.keys(_).length>0)f[g]=_}}return Object.keys(f).length>0?f:void 0}var Xi="2026-07-28",x=[Xi];function Va(m){return m>=Xi}function Qi(m){return m.filter((h)=>!Va(h))}function li(m){return m.filter((h)=>Va(h))}function ec(m){let h=m.structuredContent;if(h===void 0)return m;if(!(typeof h!=="object"||h===null||Array.isArray(h)))return m;if(m.content?.some((f)=>f.type==="text")??!1)return m;return{...m,content:[...m.content??[],{type:"text",text:JSON.stringify(h)}]}}var tc=["task","inputRequests","requestState"];function ui(m){if(m===null||typeof m!=="object"||Array.isArray(m)||m.content!==void 0||tc.some((h)=>(h in m)))return m;return{...m,content:[]}}function Ml(){let m=V(()=>c([e(),o(),a(),O(),s(e(),m),n(m)])),h=s(e(),m),f=c([e(),o().int()]),g=e(),S=t({ttl:o().optional()}),b=t({taskId:e()}),_=d({progressToken:f.optional(),"io.modelcontextprotocol/related-task":b.optional()}),R=t({_meta:_.optional()}),y=R.extend({task:S.optional()}),P=t({method:e(),params:R.loose().optional()}),C=t({_meta:_.optional()}),N=t({method:e(),params:C.loose().optional()}),J=d({_meta:_.optional()}),W=c([e(),o().int()]),L=J.strict(),K=C.extend({requestId:W.optional(),reason:e().optional()}),I=N.extend({method:r("notifications/cancelled"),params:K}),z=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),F=t({icons:n(z).optional()}),w=t({name:e(),title:e().optional()}),B=w.extend({...w.shape,...F.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),Y=E(t({applyDefaults:a().optional()}),h),U=M((pt)=>{if(pt&&typeof pt==="object"&&!Array.isArray(pt)&&Object.keys(pt).length===0)return{form:{}};return pt},E(t({form:Y.optional(),url:h.optional()}),h.optional())),T=d({list:h.optional(),cancel:h.optional(),requests:d({sampling:d({createMessage:h.optional()}).optional(),elicitation:d({create:h.optional()}).optional()}).optional()}),Z=d({list:h.optional(),cancel:h.optional(),requests:d({tools:d({call:h.optional()}).optional()}).optional()}),de=t({experimental:s(e(),h).optional(),sampling:t({context:h.optional(),tools:h.optional()}).optional(),elicitation:U.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:T.optional(),extensions:s(e(),h).optional()}),qe=R.extend({protocolVersion:e(),capabilities:de,clientInfo:B}),ge=P.extend({method:r("initialize"),params:qe}),ve=t({experimental:s(e(),h).optional(),logging:h.optional(),completions:h.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:Z.optional(),extensions:s(e(),h).optional()}),Ie=J.extend({protocolVersion:e(),capabilities:ve,serverInfo:B,instructions:e().optional()}),Ne=N.extend({method:r("notifications/initialized"),params:C.optional()}),Ge=P.extend({method:r("ping"),params:R.optional()}),Qe=t({progress:o(),total:u(o()),message:u(e())}),Ze=t({...C.shape,...Qe.shape,progressToken:f}),nt=N.extend({method:r("notifications/progress"),params:Ze}),We=R.extend({cursor:g.optional()}),ee=P.extend({params:We.optional()}),le=J.extend({nextCursor:g.optional()}),we=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),G=we.extend({text:e()}),Q=e().refine((pt)=>{try{return atob(pt),!0}catch{return!1}},{message:"Invalid Base64 string"}),te=we.extend({blob:Q}),je=p(["user","assistant"]),Me=t({audience:n(je).optional(),priority:o().min(0).max(1).optional(),lastModified:D({offset:!0}).optional()}),Be=t({...w.shape,...F.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Me.optional(),_meta:u(d({}))}),Ue=t({...w.shape,...F.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Me.optional(),_meta:u(d({}))}),Xe=ee.extend({method:r("resources/list")}),St=le.extend({resources:n(Be)}),X=ee.extend({method:r("resources/templates/list")}),ue=le.extend({resourceTemplates:n(Ue)}),_e=R.extend({uri:e()}),De=_e,Ve=P.extend({method:r("resources/read"),params:De}),Fe=J.extend({contents:n(c([G,te]))}),ot=N.extend({method:r("notifications/resources/list_changed"),params:C.optional()}),ct=_e,mt=P.extend({method:r("resources/subscribe"),params:ct}),it=_e,et=P.extend({method:r("resources/unsubscribe"),params:it}),Rt=C.extend({uri:e()}),lt=N.extend({method:r("notifications/resources/updated"),params:Rt}),Tt=t({name:e(),description:u(e()),required:u(a())}),$t=t({...w.shape,...F.shape,description:u(e()),arguments:u(n(Tt)),_meta:u(d({}))}),Ct=ee.extend({method:r("prompts/list")}),It=le.extend({prompts:n($t)}),Ot=R.extend({name:e(),arguments:s(e(),e()).optional()}),Xt=P.extend({method:r("prompts/get"),params:Ot}),Qt=t({type:r("text"),text:e(),annotations:Me.optional(),_meta:s(e(),l()).optional()}),ea=t({type:r("image"),data:Q,mimeType:e(),annotations:Me.optional(),_meta:s(e(),l()).optional()}),ta=t({type:r("audio"),data:Q,mimeType:e(),annotations:Me.optional(),_meta:s(e(),l()).optional()}),Fa=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),kt=t({type:r("resource"),resource:c([G,te]),annotations:Me.optional(),_meta:s(e(),l()).optional()}),xa=Be.extend({type:r("resource_link")}),zt=c([Qt,ea,ta,xa,kt]),ma=t({role:je,content:zt}),ha=J.extend({description:e().optional(),messages:n(ma)}),aa=N.extend({method:r("notifications/prompts/list_changed"),params:C.optional()}),Ka=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),pa=t({taskSupport:p(["required","optional","forbidden"]).optional()}),ra=t({...w.shape,...F.shape,description:e().optional(),inputSchema:t({type:r("object"),properties:s(e(),m).optional(),required:n(e()).optional()}).catchall(l()),outputSchema:t({type:r("object"),properties:s(e(),m).optional(),required:n(e()).optional()}).catchall(l()).optional(),annotations:Ka.optional(),execution:pa.optional(),_meta:s(e(),l()).optional()}),fa=ee.extend({method:r("tools/list")}),ga=le.extend({tools:n(ra)}),Sa=J.extend({content:n(zt),structuredContent:s(e(),l()).optional(),isError:a().optional()}),ht=y.extend({name:e(),arguments:s(e(),l()).optional()}),Ba=P.extend({method:r("tools/call"),params:ht}),Zr=N.extend({method:r("notifications/tools/list_changed"),params:C.optional()}),_a=p(["debug","info","notice","warning","error","critical","alert","emergency"]),Ga=R.extend({level:_a}),Ja=P.extend({method:r("logging/setLevel"),params:Ga}),Wa=C.extend({level:_a,logger:e().optional(),data:l()}),Ya=N.extend({method:r("notifications/message"),params:Wa}),Za=t({name:e().optional()}),Xa=t({hints:n(Za).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),Qa=t({mode:p(["auto","required","none"]).optional()}),Xr=t({type:r("tool_result"),toolUseId:e().describe("The unique identifier for the corresponding tool call."),content:n(zt),structuredContent:t({}).loose().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),er=k("type",[Qt,ea,ta]),Mt=k("type",[Qt,ea,ta,Fa,Xr]),tr=t({role:je,content:c([Mt,n(Mt)]),_meta:s(e(),l()).optional()}),ar=y.extend({messages:n(tr),modelPreferences:Xa.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:h.optional(),tools:n(ra).optional(),toolChoice:Qa.optional()}),rr=P.extend({method:r("sampling/createMessage"),params:ar}),or=J.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens"]).or(e())),role:je,content:er}),sr=J.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens","toolUse"]).or(e())),role:je,content:c([Mt,n(Mt)])}),nr=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),ir=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),cr=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),lr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),ur=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),dr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),mr=c([lr,ur]),oa=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),sa=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),Qr=c([oa,sa]),eo=c([dr,mr,Qr]),vt=c([eo,nr,ir,cr]),bt=y.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),vt),required:n(e()).optional()}).catchall(l())}),hr=y.extend({mode:r("url"),message:e(),elicitationId:e(),url:e().url()}),Pt=c([bt,hr]),to=P.extend({method:r("elicitation/create"),params:Pt}),ao=C.extend({elicitationId:e()}),ro=N.extend({method:r("notifications/elicitation/complete"),params:ao}),oo=J.extend({action:p(["accept","decline","cancel"]),content:M((pt)=>pt===null?void 0:pt,s(e(),c([e(),o(),a(),n(e())])).optional())}),so=t({type:r("ref/resource"),uri:e()}),no=t({type:r("ref/prompt"),name:e()}),io=R.extend({ref:c([no,so]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()}),pr=P.extend({method:r("completion/complete"),params:io}),co=J.extend({completion:d({values:n(e()).max(100),total:u(o().int()),hasMore:u(a())})}),lo=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),ya=P.extend({method:r("roots/list"),params:R.optional()}),fr=J.extend({roots:n(lo)}),uo=N.extend({method:r("notifications/roots/list_changed"),params:C.optional()}),mo=d({ttl:o().optional(),pollInterval:o().optional()}),ho=p(["working","input_required","completed","failed","cancelled"]),At=t({taskId:e(),status:ho,ttl:c([o(),O()]),createdAt:e(),lastUpdatedAt:e(),pollInterval:u(o()),statusMessage:u(e())}),_t=J.extend({task:At}),po=C.merge(At),na=N.extend({method:r("notifications/tasks/status"),params:po}),va=P.extend({method:r("tasks/get"),params:R.extend({taskId:e()})}),ba=J.merge(At),Ra=P.extend({method:r("tasks/result"),params:R.extend({taskId:e()})}),vn=J.loose(),yt=ee.extend({method:r("tasks/list")}),st=le.extend({tasks:n(At)}),ia=P.extend({method:r("tasks/cancel"),params:R.extend({taskId:e()})});return{JSONValueSchema:m,JSONObjectSchema:h,ProgressTokenSchema:f,CursorSchema:g,TaskMetadataSchema:S,RelatedTaskMetadataSchema:b,RequestMetaSchema:_,BaseRequestParamsSchema:R,TaskAugmentedRequestParamsSchema:y,RequestSchema:P,NotificationsParamsSchema:C,NotificationSchema:N,ResultSchema:J,RequestIdSchema:W,EmptyResultSchema:L,CancelledNotificationParamsSchema:K,CancelledNotificationSchema:I,IconSchema:z,IconsSchema:F,BaseMetadataSchema:w,ImplementationSchema:B,ClientTasksCapabilitySchema:T,ServerTasksCapabilitySchema:Z,ClientCapabilitiesSchema:de,InitializeRequestParamsSchema:qe,InitializeRequestSchema:ge,ServerCapabilitiesSchema:ve,InitializeResultSchema:Ie,InitializedNotificationSchema:Ne,PingRequestSchema:Ge,ProgressSchema:Qe,ProgressNotificationParamsSchema:Ze,ProgressNotificationSchema:nt,PaginatedRequestParamsSchema:We,PaginatedRequestSchema:ee,PaginatedResultSchema:le,ResourceContentsSchema:we,TextResourceContentsSchema:G,BlobResourceContentsSchema:te,RoleSchema:je,AnnotationsSchema:Me,ResourceSchema:Be,ResourceTemplateSchema:Ue,ListResourcesRequestSchema:Xe,ListResourcesResultSchema:St,ListResourceTemplatesRequestSchema:X,ListResourceTemplatesResultSchema:ue,ResourceRequestParamsSchema:_e,ReadResourceRequestParamsSchema:De,ReadResourceRequestSchema:Ve,ReadResourceResultSchema:Fe,ResourceListChangedNotificationSchema:ot,SubscribeRequestParamsSchema:ct,SubscribeRequestSchema:mt,UnsubscribeRequestParamsSchema:it,UnsubscribeRequestSchema:et,ResourceUpdatedNotificationParamsSchema:Rt,ResourceUpdatedNotificationSchema:lt,PromptArgumentSchema:Tt,PromptSchema:$t,ListPromptsRequestSchema:Ct,ListPromptsResultSchema:It,GetPromptRequestParamsSchema:Ot,GetPromptRequestSchema:Xt,TextContentSchema:Qt,ImageContentSchema:ea,AudioContentSchema:ta,ToolUseContentSchema:Fa,EmbeddedResourceSchema:kt,ResourceLinkSchema:xa,ContentBlockSchema:zt,PromptMessageSchema:ma,GetPromptResultSchema:ha,PromptListChangedNotificationSchema:aa,ToolAnnotationsSchema:Ka,ToolExecutionSchema:pa,ToolSchema:ra,ListToolsRequestSchema:fa,ListToolsResultSchema:ga,CallToolResultSchema:Sa,CallToolRequestParamsSchema:ht,CallToolRequestSchema:Ba,ToolListChangedNotificationSchema:Zr,LoggingLevelSchema:_a,SetLevelRequestParamsSchema:Ga,SetLevelRequestSchema:Ja,LoggingMessageNotificationParamsSchema:Wa,LoggingMessageNotificationSchema:Ya,ModelHintSchema:Za,ModelPreferencesSchema:Xa,ToolChoiceSchema:Qa,ToolResultContentSchema:Xr,SamplingContentSchema:er,SamplingMessageContentBlockSchema:Mt,SamplingMessageSchema:tr,CreateMessageRequestParamsSchema:ar,CreateMessageRequestSchema:rr,CreateMessageResultSchema:or,CreateMessageResultWithToolsSchema:sr,BooleanSchemaSchema:nr,StringSchemaSchema:ir,NumberSchemaSchema:cr,UntitledSingleSelectEnumSchemaSchema:lr,TitledSingleSelectEnumSchemaSchema:ur,LegacyTitledEnumSchemaSchema:dr,SingleSelectEnumSchemaSchema:mr,UntitledMultiSelectEnumSchemaSchema:oa,TitledMultiSelectEnumSchemaSchema:sa,MultiSelectEnumSchemaSchema:Qr,EnumSchemaSchema:eo,PrimitiveSchemaDefinitionSchema:vt,ElicitRequestFormParamsSchema:bt,ElicitRequestURLParamsSchema:hr,ElicitRequestParamsSchema:Pt,ElicitRequestSchema:to,ElicitationCompleteNotificationParamsSchema:ao,ElicitationCompleteNotificationSchema:ro,ElicitResultSchema:oo,ResourceTemplateReferenceSchema:so,PromptReferenceSchema:no,CompleteRequestParamsSchema:io,CompleteRequestSchema:pr,CompleteResultSchema:co,RootSchema:lo,ListRootsRequestSchema:ya,ListRootsResultSchema:fr,RootsListChangedNotificationSchema:uo,TaskCreationParamsSchema:mo,TaskStatusSchema:ho,TaskSchema:At,CreateTaskResultSchema:_t,TaskStatusNotificationParamsSchema:po,TaskStatusNotificationSchema:na,GetTaskRequestSchema:va,GetTaskResultSchema:ba,GetTaskPayloadRequestSchema:Ra,GetTaskPayloadResultSchema:vn,ListTasksRequestSchema:yt,ListTasksResultSchema:st,CancelTaskRequestSchema:ia,CancelTaskResultSchema:J.merge(At),ClientRequestSchema:c([Ge,ge,pr,Ja,Xt,Ct,Xe,X,Ve,mt,et,Ba,fa,va,Ra,yt,ia]),ClientNotificationSchema:c([I,nt,Ne,uo,na]),ClientResultSchema:c([L,or,sr,oo,fr,ba,st,_t]),ServerRequestSchema:c([Ge,rr,to,ya,va,Ra,yt,ia]),ServerNotificationSchema:c([I,nt,Ya,lt,ot,Zr,aa,na,ro]),ServerResultSchema:c([L,Ie,co,ha,It,St,ue,Fe,Sa,ga,ba,st,_t]),CallToolResultWireSchema:l().superRefine((pt,ll)=>{if(typeof pt!=="object"||pt===null||Array.isArray(pt)||pt.content!==void 0)return;for(let ji of tc)if(ji in pt){ll.addIssue({code:"custom",message:`content is required when the body carries '${ji}' — another result family cannot default into an empty tools/call success`});return}}).transform(ui).pipe(Sa)}}var Al;function ac(){return Al??=Ml()}function rc(m){return m.type!=="object"}var Ll=new Set(["const","enum","default","examples"]),Dl=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Di(m){return m!==void 0&&!(typeof m==="string"&&m.startsWith("#"))}function Vl(m){let h=typeof m.$schema==="string"?m.$schema:void 0;if(Di(m.$id))return{...h!==void 0&&{$schema:h},type:"object",properties:{result:m},required:["result"]};let f=Oi(m.$schema)&&m.$recursiveAnchor!==!0,g=(S,b)=>{if(Array.isArray(S))return S.map((y)=>g(y,!1));if(S===null||typeof S!=="object")return S;if(!b&&Di(S.$id))return S;let _={},R=!1;for(let[y,P]of Object.entries(S))if(b)_[y]=g(P,!1);else if((y==="$ref"||y==="$dynamicRef")&&typeof P==="string")_[y]=P==="#"?"#/properties/result":P.startsWith("#/")?`#/properties/result${P.slice(1)}`:P;else if(y==="$recursiveRef"&&P==="#"&&f)R=!0;else if(Ll.has(y))_[y]=P;else if(Dl.has(y))_[y]=g(P,!0);else _[y]=g(P,!1);if(R)if("$ref"in _)_.allOf=[...Array.isArray(_.allOf)?_.allOf:[],{$ref:"#/properties/result"}];else _.$ref="#/properties/result";return _};return{...h!==void 0&&{$schema:h},type:"object",properties:{result:g(m,!1)},required:["result"]}}var oc={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},sc={"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},Ul={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},on;function di(){if(on)return on;let m=ac();return on={requestSchemas:{ping:m.PingRequestSchema,initialize:m.InitializeRequestSchema,"completion/complete":m.CompleteRequestSchema,"logging/setLevel":m.SetLevelRequestSchema,"prompts/get":m.GetPromptRequestSchema,"prompts/list":m.ListPromptsRequestSchema,"resources/list":m.ListResourcesRequestSchema,"resources/templates/list":m.ListResourceTemplatesRequestSchema,"resources/read":m.ReadResourceRequestSchema,"resources/subscribe":m.SubscribeRequestSchema,"resources/unsubscribe":m.UnsubscribeRequestSchema,"tools/call":m.CallToolRequestSchema,"tools/list":m.ListToolsRequestSchema,"tasks/get":m.GetTaskRequestSchema,"tasks/result":m.GetTaskPayloadRequestSchema,"tasks/list":m.ListTasksRequestSchema,"tasks/cancel":m.CancelTaskRequestSchema,"sampling/createMessage":m.CreateMessageRequestSchema,"elicitation/create":m.ElicitRequestSchema,"roots/list":m.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":m.CancelledNotificationSchema,"notifications/progress":m.ProgressNotificationSchema,"notifications/initialized":m.InitializedNotificationSchema,"notifications/roots/list_changed":m.RootsListChangedNotificationSchema,"notifications/tasks/status":m.TaskStatusNotificationSchema,"notifications/message":m.LoggingMessageNotificationSchema,"notifications/resources/updated":m.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":m.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":m.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":m.PromptListChangedNotificationSchema,"notifications/elicitation/complete":m.ElicitationCompleteNotificationSchema},resultSchemas:{ping:m.EmptyResultSchema,initialize:m.InitializeResultSchema,"completion/complete":m.CompleteResultSchema,"logging/setLevel":m.EmptyResultSchema,"prompts/get":m.GetPromptResultSchema,"prompts/list":m.ListPromptsResultSchema,"resources/list":m.ListResourcesResultSchema,"resources/templates/list":m.ListResourceTemplatesResultSchema,"resources/read":m.ReadResourceResultSchema,"resources/subscribe":m.EmptyResultSchema,"resources/unsubscribe":m.EmptyResultSchema,"tools/call":m.CallToolResultWireSchema,"tools/list":m.ListToolsResultSchema,"sampling/createMessage":m.CreateMessageResultWithToolsSchema,"elicitation/create":m.ElicitResultSchema,"roots/list":m.ListRootsResultSchema}},on}function nc(m){return Object.prototype.hasOwnProperty.call(oc,m)}function ic(m){return Object.prototype.hasOwnProperty.call(sc,m)}function Hl(m){return Object.prototype.hasOwnProperty.call(Ul,m)}function Fl(m){return Hl(m)?di().resultSchemas[m]:void 0}function xl(m){return nc(m)?di().requestSchemas[m]:void 0}function Kl(m){return ic(m)?di().notificationSchemas[m]:void 0}var th=Object.keys(oc),ah=Object.keys(sc);function oi(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function sn(m,h){if(m===void 0)return{ok:!1,reason:"not-in-era"};let f=m.safeParse(h);return f.success?{ok:!0,value:f.data}:{ok:!1,reason:"invalid",message:String(f.error)}}var Vi={ok:!1,reason:"not-in-era"};function Ui(m){return oi(m)&&oi(m.outputSchema)&&rc(m.outputSchema)}function Hi(m){return m}var mi={era:"2025-11-25",hasRequestMethod:nc,hasNotificationMethod:ic,validateRequest:(m,h)=>sn(xl(m),h),validateResult:(m,h)=>sn(Fl(m),h),validateNotification:(m,h)=>sn(Kl(m),h),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Vi,validateInputResponse:()=>Vi,samplingResultVariant:(m,h)=>{let f=ac();return sn(m?f.CreateMessageResultWithToolsSchema:f.CreateMessageResultSchema,h)},outboundEnvelope:(m)=>{return},validateEnvelopeMeta:(m)=>[],projectCallToolResult(m,h){let f=ec(m),g=f.structuredContent;if(g===void 0)return f;let S=typeof g!=="object"||g===null||Array.isArray(g),b=h!==void 0&&rc(h);if(!S&&!b)return f;return{...f,structuredContent:{result:g}}},decodeResult(m,h){if(oi(h)&&"resultType"in h){let f={...h};return delete f.resultType,{kind:"complete",result:Hi(f)}}return{kind:"complete",result:Hi(h)}},encodeResult(m,h){if(m!=="tools/list")return h;let f=h.tools;if(!Array.isArray(f)||!f.some((g)=>Ui(g)))return h;return{...h,tools:f.map((g)=>Ui(g)?{...g,outputSchema:Vl(g.outputSchema)}:g)}},encodeErrorCode:(m)=>m===-32002?-32602:m,checkInboundEnvelope:(m)=>{return}};function Bl(){let m=V(()=>c([e(),o(),a(),O(),s(e(),m),n(m)])),h=s(e(),m),f=c([e(),o().int()]),g=e(),S=c([e(),o().int()]),b=p(["user","assistant"]),_=p(["debug","info","notice","warning","error","critical","alert","emergency"]),R=e().refine((st)=>{try{return atob(st),!0}catch{return!1}},{message:"Invalid Base64 string"}),y=t({ttl:o().optional()}),P=t({taskId:e()}),C=d({progressToken:f.optional(),"io.modelcontextprotocol/related-task":P.optional()}),N=t({_meta:C.optional()}),J=N.extend({task:y.optional()}),W=t({_meta:C.optional()}),L=t({method:e(),params:W.loose().optional()}),K=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),I=t({icons:n(K).optional()}),z=t({name:e(),title:e().optional()}),F=z.extend({...z.shape,...I.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),w=E(t({applyDefaults:a().optional()}),h),B=M((st)=>{if(st&&typeof st==="object"&&!Array.isArray(st)&&Object.keys(st).length===0)return{form:{}};return st},E(t({form:w.optional(),url:h.optional()}),h.optional())),Y=d({list:h.optional(),cancel:h.optional(),requests:d({sampling:d({createMessage:h.optional()}).optional(),elicitation:d({create:h.optional()}).optional()}).optional()}),U=d({list:h.optional(),cancel:h.optional(),requests:d({tools:d({call:h.optional()}).optional()}).optional()}),T=t({experimental:s(e(),h).optional(),sampling:t({context:h.optional(),tools:h.optional()}).optional(),elicitation:B.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:Y.optional(),extensions:s(e(),h).optional()}),Z=t({experimental:s(e(),h).optional(),logging:h.optional(),completions:h.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:U.optional(),extensions:s(e(),h).optional()}),de=t({progress:o(),total:u(o()),message:u(e())}),qe=t({...W.shape,...de.shape,progressToken:f}),ge=L.extend({method:r("notifications/progress"),params:qe}),ve=W.extend({level:_,logger:e().optional(),data:l()}),Ie=L.extend({method:r("notifications/message"),params:ve}),Ne=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),Ge=Ne.extend({text:e()}),Qe=Ne.extend({blob:R}),Ze=t({audience:n(b).optional(),priority:o().min(0).max(1).optional(),lastModified:D({offset:!0}).optional()}),nt=t({...z.shape,...I.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Ze.optional(),_meta:u(d({}))}),We=t({...z.shape,...I.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Ze.optional(),_meta:u(d({}))}),ee=L.extend({method:r("notifications/resources/list_changed"),params:W.optional()}),le=W.extend({uri:e()}),we=L.extend({method:r("notifications/resources/updated"),params:le}),G=t({name:e(),description:u(e()),required:u(a())}),Q=t({...z.shape,...I.shape,description:u(e()),arguments:u(n(G)),_meta:u(d({}))}),te=L.extend({method:r("notifications/prompts/list_changed"),params:W.optional()}),je=t({type:r("text"),text:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),Me=t({type:r("image"),data:R,mimeType:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),Be=t({type:r("audio"),data:R,mimeType:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),Ue=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),Xe=t({type:r("resource"),resource:c([Ge,Qe]),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),St=nt.extend({type:r("resource_link")}),X=c([je,Me,Be,St,Xe]),ue=t({role:b,content:X}),_e=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),De=L.extend({method:r("notifications/tools/list_changed"),params:W.optional()}),Ve=t({name:e().optional()}),Fe=t({hints:n(Ve).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),ot=t({mode:p(["auto","required","none"]).optional()}),ct=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),mt=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),it=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),et=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),Rt=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),lt=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),Tt=c([et,Rt]),$t=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),Ct=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),It=c([$t,Ct]),Ot=c([lt,Tt,It]),Xt=c([Ot,ct,mt,it]),Qt=J.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),Xt),required:n(e()).optional()}).catchall(l())}),ea=t({type:r("ref/resource"),uri:e()}),ta=t({type:r("ref/prompt"),name:e()}),Fa=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),kt=T.shape,xa=t({experimental:kt.experimental,sampling:kt.sampling,elicitation:kt.elicitation,roots:kt.roots,extensions:kt.extensions}),zt=Z.shape,ma=t({experimental:zt.experimental,logging:zt.logging,completions:zt.completions,prompts:zt.prompts,resources:zt.resources,tools:zt.tools,extensions:zt.extensions}),ha=d({progressToken:f.optional(),[Dt]:e(),[gr]:F.optional(),[Vt]:xa,[la]:_.optional()}),aa=t({...z.shape,...I.shape,description:e().optional(),inputSchema:d({$schema:e().optional(),type:r("object")}),outputSchema:d({$schema:e().optional()}).optional(),annotations:_e.optional(),_meta:s(e(),l()).optional()}),Ka=t({type:r("tool_result"),toolUseId:e(),content:n(X),structuredContent:l().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),pa=c([je,Me,Be,Ue,Ka]),ra=t({role:b,content:c([pa,n(pa)]),_meta:s(e(),l()).optional()}),fa=e(),ga=d({[jt]:F.optional().catch(void 0)}),Sa=ga.optional();function ht(st){return d({_meta:Sa,resultType:fa.default("complete"),...st})}let Ba=ht({}),Zr=ht({nextCursor:g.optional()}),_a=ht({content:n(X),structuredContent:l().optional(),isError:a().optional()}),Ga=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),tools:n(aa),nextCursor:g.optional()}),Ja=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),prompts:n(Q),nextCursor:g.optional()}),Wa=ht({description:e().optional(),messages:n(ue)}),Ya=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resources:n(nt),nextCursor:g.optional()}),Za=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resourceTemplates:n(We),nextCursor:g.optional()}),Xa=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),contents:n(c([Ge,Qe]))}),Qa=ht({completion:t({values:n(e()).max(100),total:o().int().optional(),hasMore:a().optional()}).loose()}),Xr=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"])}),er=ht({ttlMs:o().int().min(0).catch(0),cacheScope:p(["public","private"]).catch("private"),supportedVersions:n(e()),capabilities:ma,instructions:e().optional()}),Mt=t({messages:n(ra),modelPreferences:Fe.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:h.optional(),tools:n(aa).optional(),toolChoice:ot.optional()}),tr=t({method:r("sampling/createMessage"),params:Mt}),ar=t({method:r("roots/list"),params:t({_meta:s(e(),l()).optional()}).optional()}),rr=t({...ra.shape,model:e(),stopReason:e().optional()}),or=t({roots:n(Fa)}),sr=t({action:p(["accept","decline","cancel"]),content:s(e(),c([e(),o(),a(),n(e())])).optional()}),nr=t({mode:r("url"),message:e(),url:e().url()}),ir=c([Qt,nr]),cr=t({method:r("elicitation/create"),params:ir}),lr=c([tr,ar,cr]),ur=c([rr,or,sr]),dr=s(e(),lr),mr=s(e(),ur),oa=ht({inputRequests:dr.optional(),requestState:e().optional()}),sa={inputResponses:mr.optional(),requestState:e().optional()},Qr=t({_meta:ha,...sa}),eo=d({progressToken:f.optional()});function vt(st,ia){return t({method:r(st),params:t({_meta:ha,...ia})})}function bt(st,ia){return t({method:r(st),params:t({_meta:eo.optional(),...ia}).optional()})}let hr={name:e(),arguments:s(e(),l()).optional(),...sa},Pt={cursor:g.optional()},to=vt("tools/call",hr),ao=vt("tools/list",Pt),ro=vt("prompts/list",Pt),oo=vt("prompts/get",{name:e(),arguments:s(e(),e()).optional(),...sa}),so=vt("resources/list",Pt),no=vt("resources/templates/list",Pt),io=vt("resources/read",{uri:e(),...sa}),pr={ref:c([ta,ea]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()},co=vt("completion/complete",pr),lo=vt("server/discover",{}),ya=t({toolsListChanged:a().optional(),promptsListChanged:a().optional(),resourcesListChanged:a().optional(),resourceSubscriptions:n(e()).optional()}),fr={notifications:ya},uo=vt("subscriptions/listen",fr),mo=ga.extend({"io.modelcontextprotocol/subscriptionId":S}),ho=d({_meta:mo,resultType:fa.default("complete")}),At={"tools/call":bt("tools/call",hr),"tools/list":bt("tools/list",Pt),"prompts/get":bt("prompts/get",{name:e(),arguments:s(e(),e()).optional()}),"prompts/list":bt("prompts/list",Pt),"resources/list":bt("resources/list",Pt),"resources/templates/list":bt("resources/templates/list",Pt),"resources/read":bt("resources/read",{uri:e()}),"completion/complete":bt("completion/complete",pr),"server/discover":bt("server/discover",{}),"subscriptions/listen":bt("subscriptions/listen",fr)};function _t(st){return d({_meta:Sa,...st})}let po={"tools/call":_t({content:n(X),structuredContent:l().optional(),isError:a().optional()}),"tools/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),tools:n(aa),nextCursor:g.optional()}),"prompts/get":_t({description:e().optional(),messages:n(ue)}),"prompts/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),prompts:n(Q),nextCursor:g.optional()}),"resources/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resources:n(nt),nextCursor:g.optional()}),"resources/templates/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resourceTemplates:n(We),nextCursor:g.optional()}),"resources/read":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),contents:n(c([Ge,Qe]))}),"completion/complete":_t({completion:t({values:n(e()).max(100),total:o().int().optional(),hasMore:a().optional()}).loose()}),"server/discover":_t({ttlMs:o().int().min(0).catch(0),cacheScope:p(["public","private"]).catch("private"),supportedVersions:n(e()),capabilities:ma,instructions:e().optional()}),"subscriptions/listen":_t({})},na=d({"io.modelcontextprotocol/subscriptionId":S.optional()}),va=t({method:r("notifications/subscriptions/acknowledged"),params:t({_meta:na.optional(),notifications:ya})}),ba=t({_meta:na.optional(),requestId:S,reason:e().optional()}),Ra=t({method:r("notifications/cancelled"),params:ba}),vn={"notifications/cancelled":Ra,"notifications/progress":ge,"notifications/message":Ie,"notifications/resources/updated":we,"notifications/resources/list_changed":ee,"notifications/tools/list_changed":De,"notifications/prompts/list_changed":te,"notifications/subscriptions/acknowledged":va},yt=(st)=>t({jsonrpc:r("2.0"),id:c([e(),o().int()]),result:st}).strict();return{JSONValueSchema:m,JSONObjectSchema:h,ProgressTokenSchema:f,CursorSchema:g,RequestIdSchema:S,RoleSchema:b,LoggingLevelSchema:_,TaskMetadataSchema:y,RelatedTaskMetadataSchema:P,RequestMetaSchema:C,BaseRequestParamsSchema:N,TaskAugmentedRequestParamsSchema:J,NotificationsParamsSchema:W,NotificationSchema:L,IconSchema:K,IconsSchema:I,BaseMetadataSchema:z,ImplementationSchema:F,ClientTasksCapabilitySchema:Y,ServerTasksCapabilitySchema:U,ClientCapabilitiesSchema:T,ServerCapabilitiesSchema:Z,ProgressSchema:de,ProgressNotificationParamsSchema:qe,ProgressNotificationSchema:ge,LoggingMessageNotificationParamsSchema:ve,LoggingMessageNotificationSchema:Ie,ResourceContentsSchema:Ne,TextResourceContentsSchema:Ge,BlobResourceContentsSchema:Qe,AnnotationsSchema:Ze,ResourceSchema:nt,ResourceTemplateSchema:We,ResourceListChangedNotificationSchema:ee,ResourceUpdatedNotificationParamsSchema:le,ResourceUpdatedNotificationSchema:we,PromptArgumentSchema:G,PromptSchema:Q,PromptListChangedNotificationSchema:te,TextContentSchema:je,ImageContentSchema:Me,AudioContentSchema:Be,ToolUseContentSchema:Ue,EmbeddedResourceSchema:Xe,ResourceLinkSchema:St,ContentBlockSchema:X,PromptMessageSchema:ue,ToolAnnotationsSchema:_e,ToolListChangedNotificationSchema:De,ModelHintSchema:Ve,ModelPreferencesSchema:Fe,ToolChoiceSchema:ot,BooleanSchemaSchema:ct,StringSchemaSchema:mt,NumberSchemaSchema:it,UntitledSingleSelectEnumSchemaSchema:et,TitledSingleSelectEnumSchemaSchema:Rt,LegacyTitledEnumSchemaSchema:lt,SingleSelectEnumSchemaSchema:Tt,UntitledMultiSelectEnumSchemaSchema:$t,TitledMultiSelectEnumSchemaSchema:Ct,MultiSelectEnumSchemaSchema:It,EnumSchemaSchema:Ot,PrimitiveSchemaDefinitionSchema:Xt,ElicitRequestFormParamsSchema:Qt,ResourceTemplateReferenceSchema:ea,PromptReferenceSchema:ta,RootSchema:Fa,ClientCapabilities2026Schema:xa,ServerCapabilities2026Schema:ma,RequestMetaEnvelopeSchema:ha,ToolSchema:aa,ToolResultContentSchema:Ka,SamplingMessageContentBlockSchema:pa,SamplingMessageSchema:ra,ResultTypeSchema:fa,ResultMetaSchema:ga,ResultSchema:Ba,PaginatedResultSchema:Zr,CallToolResultSchema:_a,ListToolsResultSchema:Ga,ListPromptsResultSchema:Ja,GetPromptResultSchema:Wa,ListResourcesResultSchema:Ya,ListResourceTemplatesResultSchema:Za,ReadResourceResultSchema:Xa,CompleteResultSchema:Qa,CacheableResultSchema:Xr,DiscoverResultSchema:er,CreateMessageRequestParamsSchema:Mt,CreateMessageRequestSchema:tr,ListRootsRequestSchema:ar,CreateMessageResultSchema:rr,ListRootsResultSchema:or,ElicitResultSchema:sr,ElicitRequestURLParamsSchema:nr,ElicitRequestParamsSchema:ir,ElicitRequestSchema:cr,InputRequestSchema:lr,InputResponseSchema:ur,InputRequestsSchema:dr,InputResponsesSchema:mr,InputRequiredResultSchema:oa,InputResponseRequestParamsSchema:Qr,CallToolRequestSchema:to,ListToolsRequestSchema:ao,ListPromptsRequestSchema:ro,GetPromptRequestSchema:oo,ListResourcesRequestSchema:so,ListResourceTemplatesRequestSchema:no,ReadResourceRequestSchema:io,CompleteRequestSchema:co,DiscoverRequestSchema:lo,SubscriptionFilterSchema:ya,SubscriptionsListenRequestSchema:uo,SubscriptionsListenResultMetaSchema:mo,SubscriptionsListenResultSchema:ho,dispatchRequestSchemas:At,dispatchResultSchemas:po,NotificationMetaSchema:na,SubscriptionsAcknowledgedNotificationSchema:va,CancelledNotificationParamsSchema:ba,CancelledNotificationSchema:Ra,notificationSchemas2026:vn,JSONRPCResultResponseSchema:yt(Ba),CallToolResultResponseSchema:yt(c([_a,oa])),ListToolsResultResponseSchema:yt(Ga),ListPromptsResultResponseSchema:yt(Ja),GetPromptResultResponseSchema:yt(c([Wa,oa])),ListResourcesResultResponseSchema:yt(Ya),ListResourceTemplatesResultResponseSchema:yt(Za),ReadResourceResultResponseSchema:yt(c([Xa,oa])),CompleteResultResponseSchema:yt(Qa),DiscoverResultResponseSchema:yt(er)}}var Gl;function Jt(){return Gl??=Bl()}var Jl=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Wl(m){return Jl.includes(m)}var Aa=Symbol("modelcontextprotocol.resultCacheHintFallback");function mn(m,h){if(h===void 0)return m;let f=m[Aa];if(f===void 0)return{...m,[Aa]:h};let g={},S=f.ttlMs??h.ttlMs;if(S!==void 0)g.ttlMs=S;let b=f.cacheScope??h.cacheScope;if(b!==void 0)g.cacheScope=b;return{...m,[Aa]:g}}function Yl(m){return m[Aa]}function hi(m){return typeof m==="number"&&Number.isSafeInteger(m)&&m>=0}function pi(m){return m==="public"||m==="private"}function fi(m,h){if(m.ttlMs!==void 0&&!hi(m.ttlMs))throw RangeError(`Invalid cache hint for ${h}: ttlMs must be a non-negative safe integer (got ${String(m.ttlMs)})`);if(m.cacheScope!==void 0&&!pi(m.cacheScope))throw RangeError(`Invalid cache hint for ${h}: cacheScope must be 'public' or 'private' (got ${String(m.cacheScope)})`)}var i=function(m){return m[m.ParseError=-32700]="ParseError",m[m.InvalidRequest=-32600]="InvalidRequest",m[m.MethodNotFound=-32601]="MethodNotFound",m[m.InvalidParams=-32602]="InvalidParams",m[m.InternalError=-32603]="InternalError",m[m.ResourceNotFound=-32002]="ResourceNotFound",m[m.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",m[m.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",m[m.UrlElicitationRequired=-32042]="UrlElicitationRequired",m}({}),Le=class m extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](h){return La(this,h)}static isInstance(h){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,h)}constructor(h,f,g){super(f);this.code=h,this.data=g,this.name="ProtocolError",ii(this,new.target)}static fromError(h,f,g){if(h===i.UrlElicitationRequired&&g){let S=g;if(S.elicitations)return new Zl(S.elicitations,f)}if(h===i.UnsupportedProtocolVersion&&g){let S=g;if(Array.isArray(S.supported)&&typeof S.requested==="string")return new H({supported:S.supported,requested:S.requested},f)}if(h===i.InvalidParams||h===i.ResourceNotFound){let S=g;if(typeof S?.uri==="string"&&(h===i.ResourceNotFound||Object.keys(S).length===1))return new gi(S.uri,f)}if(h===i.MissingRequiredClientCapability&&g){let S=g;if(S.requiredCapabilities!==null&&typeof S.requiredCapabilities==="object"&&!Array.isArray(S.requiredCapabilities))return new Si({requiredCapabilities:S.requiredCapabilities},f)}return new m(h,f,g)}},gi=class extends Le{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(m,h=`Resource not found: ${m}`){super(i.InvalidParams,h,{uri:m})}get uri(){return this.data.uri}},Zl=class extends Le{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(m,h=`URL elicitation${m.length>1?"s":""} required`){super(i.UrlElicitationRequired,h,{elicitations:m})}get elicitations(){return this.data?.elicitations??[]}},H=class extends Le{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(m,h=`Unsupported protocol version: ${m.requested}`){super(i.UnsupportedProtocolVersion,h,m)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Si=class extends Le{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(m,h=`Missing required client capabilities: ${Object.keys(m.requiredCapabilities).join(", ")}`){super(i.MissingRequiredClientCapability,h,m)}get requiredCapabilities(){return this.data.requiredCapabilities}},Xl=0,Ql="private",eu=["tools/call","prompts/get","resources/read"];function tu(m,h){let f=h.resultType;if(f===void 0)return{...h,resultType:"complete"};if(f==="complete")return h;if(eu.includes(m))return h;throw new Le(i.InternalError,`Handler for ${m} returned resultType '${String(f)}', but results of ${m} only support 'complete' on protocol revision 2026-07-28`)}function au(m,h){let f=Yl(h);if(h.resultType!=="complete"||!Wl(m))return f===void 0?h:iu(h);let g=h,S=hi(g.ttlMs)?g.ttlMs:su(f),b=pi(g.cacheScope)?g.cacheScope:nu(f),_={...g,ttlMs:S,cacheScope:b};return delete _[Aa],_}function ru(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function ou(m,h){if(h===void 0)return m;let f=m._meta;if(f===void 0)return{...m,_meta:{[jt]:h}};if(!ru(f))return m;if(f[jt]!==void 0)return m;return{...m,_meta:{...f,[jt]:h}}}function su(m){return m!==void 0&&hi(m.ttlMs)?m.ttlMs:Xl}function nu(m){return m!==void 0&&pi(m.cacheScope)?m.cacheScope:Ql}function iu(m){let h={...m};return delete h[Aa],h}var cu=["elicitation/create","sampling/createMessage","roots/list"],nn;function cc(){if(nn)return nn;let m=Jt();return nn={request:{"elicitation/create":t({method:r("elicitation/create"),params:m.ElicitRequestParamsSchema}),"sampling/createMessage":t({method:r("sampling/createMessage"),params:m.CreateMessageRequestParamsSchema}),"roots/list":t({method:r("roots/list"),params:d({}).optional()})},response:{"elicitation/create":m.ElicitResultSchema,"sampling/createMessage":m.CreateMessageResultSchema,"roots/list":m.ListRootsResultSchema}},nn}function lc(m){return cu.includes(m)}function ei(m){return lc(m)?cc().request[m]:void 0}function lu(m){return lc(m)?cc().response[m]:void 0}var _i={"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},uc={"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 dc(m){return Object.prototype.hasOwnProperty.call(_i,m)}function mc(m){return Object.prototype.hasOwnProperty.call(uc,m)}function uu(m){return Object.prototype.hasOwnProperty.call(_i,m)}function du(m){return dc(m)?Jt().dispatchRequestSchemas[m]:void 0}function mu(m){return uu(m)?Jt().dispatchResultSchemas[m]:void 0}function hu(m){return mc(m)?Jt().notificationSchemas2026[m]:void 0}var rh=Object.keys(_i),oh=Object.keys(uc);function xr(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function Hr(m,h){if(m===void 0)return{ok:!1,reason:"not-in-era"};let f=m.safeParse(h);return f.success?{ok:!0,value:f.data}:{ok:!1,reason:"invalid",message:String(f.error)}}var pu={ok:!1,reason:"not-in-era"},fu=[Dt,Vt];function gu(m,h){let f=h,g=!1,S=()=>{if(!g)f={...f},g=!0;return f},b=h.tools;if(m==="tools/list"&&Array.isArray(b)&&b.some((R)=>xr(R)&&("execution"in R)))S().tools=b.map((R)=>{if(!xr(R)||!("execution"in R))return R;let y={...R};return delete y.execution,y});let _=h.capabilities;if(xr(_)&&"tasks"in _){let R={..._};delete R.tasks,S().capabilities=R}return f}var yi={era:"2026-07-28",hasRequestMethod:dc,hasNotificationMethod:mc,hasInputRequestMethod:(m)=>ei(m)!==void 0,validateRequest:(m,h)=>Hr(du(m),h),validateResult:(m,h)=>Hr(mu(m),h),validateNotification:(m,h)=>Hr(hu(m),h),validateInputRequest:(m,h)=>Hr(ei(m),h),validateInputResponse:(m,h)=>Hr(lu(m),h),samplingResultVariant:()=>pu,outboundEnvelope(m){return{[Dt]:m.protocolVersion,[gr]:m.clientInfo,[Vt]:m.clientCapabilities,...m.logLevel!==void 0&&{[la]:m.logLevel}}},validateEnvelopeMeta(m){let h=[];for(let g of fu)if(!(g in m))h.push({key:g,problem:"missing"});let f=Jt().RequestMetaEnvelopeSchema.safeParse(m);if(!f.success)for(let g of f.error.issues){let S=g.path.map(String),b=S.length>0?S.join("."):"_meta";if(S.length===1&&h.some((_)=>_.key===b&&_.problem==="missing"))continue;h.push({key:b,problem:g.message})}return h},projectCallToolResult:(m)=>ec(m),inputRequestSchema:ei,decodeResult(m,h){if(!xr(h))return{kind:"invalid",error:new Ke(Je.InvalidResult,`Invalid result for ${m}: not an object`,{method:m})};let f=h.resultType;if(f===void 0)return{kind:"invalid",error:new Ke(Je.InvalidResult,`Invalid result for ${m}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:m,violation:"missing-resultType"})};if(typeof f!=="string")return{kind:"invalid",error:new Ke(Je.InvalidResult,`Invalid result for ${m}: non-string resultType`,{method:m,resultType:f})};if(f==="input_required"){let _=h.inputRequests,R=xr(_)?_:{},y=h.requestState,P=h._meta===void 0?void 0:Jt().ResultMetaSchema.safeParse(h._meta),C=P?.success?P.data:void 0;if(Object.keys(R).length===0&&typeof y!=="string")return{kind:"invalid",error:new Ke(Je.InvalidResult,`Invalid result for ${m}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:m,violation:"input-required-missing-both"})};return{kind:"input_required",inputRequests:R,...typeof y==="string"&&{requestState:y},...C!==void 0&&{_meta:C}}}if(f!=="complete")return{kind:"invalid",error:new Ke(Je.UnsupportedResultType,`Unsupported result type '${f}' for ${m}`,{resultType:f,method:m})};let g=Su(),S=Object.hasOwn(g,m)?g[m]:void 0;if(S!==void 0){let _=S.safeParse(h);if(!_.success)return{kind:"invalid",error:new Ke(Je.InvalidResult,`Invalid result for ${m}: ${_.error}`,{method:m})}}let b={...h};return delete b.resultType,{kind:"complete",result:b}},encodeResult(m,h,f){return ou(au(m,tu(m,gu(m,h))),f)},encodeErrorCode:(m)=>m===-32002?-32602:m,checkInboundEnvelope(m){if(m.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let h=Jt().RequestMetaEnvelopeSchema.safeParse(m.envelope);if(!h.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${h.error.issues.map((f)=>f.message).join("; ")}`}},cn;function Su(){if(cn)return cn;let m=Jt();return cn={"tools/call":m.CallToolResultSchema,"tools/list":m.ListToolsResultSchema,"prompts/get":m.GetPromptResultSchema,"prompts/list":m.ListPromptsResultSchema,"resources/list":m.ListResourcesResultSchema,"resources/templates/list":m.ListResourceTemplatesResultSchema,"resources/read":m.ReadResourceResultSchema,"completion/complete":m.CompleteResultSchema,"server/discover":m.DiscoverResultSchema},cn}var Gr="2026-07-28";function Wt(m){return m!==void 0&&Va(m)?yi:mi}function Fi(m){if(m.revision!==void 0)return Wt(m.revision).era;return m.era==="modern"?yi.era:mi.era}function ti(m){return hc.some((h)=>h.hasRequestMethod(m))}function ai(m){return hc.some((h)=>h.hasNotificationMethod(m))}var hc=[mi,yi];function xi(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function j(m){if(!xi(m))return;let h=m._meta;return xi(h)?h:void 0}function ne(m){let h=j(m);return h!==void 0&&Dt in h}function re(m){let h=j(m)?.[Dt];return typeof h==="string"?h:void 0}function oe(m){return Wt(Gr).validateEnvelopeMeta(m)}var _u=Ni({AnnotationsSchema:()=>Nt,AudioContentSchema:()=>Na,BaseMetadataSchema:()=>qt,BaseRequestParamsSchema:()=>dt,BlobResourceContentsSchema:()=>qr,BooleanSchemaSchema:()=>kr,CallToolRequestParamsSchema:()=>Ss,CallToolRequestSchema:()=>_s,CallToolResultSchema:()=>Or,CancelTaskRequestSchema:()=>Ln,CancelTaskResultSchema:()=>Dn,CancelledNotificationParamsSchema:()=>vo,CancelledNotificationSchema:()=>$r,ClientCapabilitiesSchema:()=>$o,ClientNotificationSchema:()=>Un,ClientRequestSchema:()=>Vn,ClientResultSchema:()=>Hn,ClientTasksCapabilitySchema:()=>Ro,CompatibilityCallToolResultSchema:()=>wn,CompleteRequestParamsSchema:()=>Ks,CompleteRequestSchema:()=>Bs,CompleteResultSchema:()=>Gs,ContentBlockSchema:()=>Ia,CreateMessageRequestParamsSchema:()=>qs,CreateMessageRequestSchema:()=>js,CreateMessageResultSchema:()=>Ns,CreateMessageResultWithToolsSchema:()=>Is,CreateTaskResultSchema:()=>qn,CursorSchema:()=>_r,DiscoverRequestSchema:()=>Co,DiscoverResultSchema:()=>qo,ElicitRequestFormParamsSchema:()=>Ma,ElicitRequestParamsSchema:()=>Ls,ElicitRequestSchema:()=>Ds,ElicitRequestURLParamsSchema:()=>As,ElicitResultSchema:()=>Hs,ElicitationCompleteNotificationParamsSchema:()=>Vs,ElicitationCompleteNotificationSchema:()=>Us,EmbeddedResourceSchema:()=>cs,EmptyResultSchema:()=>zr,EnumSchemaSchema:()=>Ms,GetPromptRequestParamsSchema:()=>ss,GetPromptRequestSchema:()=>ns,GetPromptResultSchema:()=>ds,GetTaskPayloadRequestSchema:()=>On,GetTaskPayloadResultSchema:()=>kn,GetTaskRequestSchema:()=>Nn,GetTaskResultSchema:()=>In,IconSchema:()=>bo,IconsSchema:()=>Ht,ImageContentSchema:()=>ja,ImplementationSchema:()=>Ta,InitializeRequestParamsSchema:()=>Po,InitializeRequestSchema:()=>Eo,InitializeResultSchema:()=>wo,InitializedNotificationSchema:()=>To,JSONArraySchema:()=>$n,JSONObjectSchema:()=>tt,JSONRPCErrorResponseSchema:()=>wa,JSONRPCMessageSchema:()=>yo,JSONRPCNotificationSchema:()=>Rr,JSONRPCRequestSchema:()=>br,JSONRPCResponseSchema:()=>Pn,JSONRPCResultResponseSchema:()=>Ea,JSONValueSchema:()=>Lt,LegacyTitledEnumSchemaSchema:()=>Lr,ListChangedOptionsBaseSchema:()=>Tn,ListPromptsRequestSchema:()=>rs,ListPromptsResultSchema:()=>os,ListResourceTemplatesRequestSchema:()=>Ao,ListResourceTemplatesResultSchema:()=>Lo,ListResourcesRequestSchema:()=>ko,ListResourcesResultSchema:()=>Mo,ListRootsRequestSchema:()=>Ws,ListRootsResultSchema:()=>Ys,ListTasksRequestSchema:()=>Mn,ListTasksResultSchema:()=>An,ListToolsRequestSchema:()=>fs,ListToolsResultSchema:()=>gs,LoggingLevelSchema:()=>Bt,LoggingMessageNotificationParamsSchema:()=>Rs,LoggingMessageNotificationSchema:()=>zs,ModelHintSchema:()=>$s,ModelPreferencesSchema:()=>Ps,MultiSelectEnumSchemaSchema:()=>ks,NotificationSchema:()=>gt,NotificationsParamsSchema:()=>ft,NumberSchemaSchema:()=>ka,PaginatedRequestParamsSchema:()=>Io,PaginatedRequestSchema:()=>Ft,PaginatedResultSchema:()=>xt,PingRequestSchema:()=>Er,PrimitiveSchemaDefinitionSchema:()=>Ur,ProgressNotificationParamsSchema:()=>No,ProgressNotificationSchema:()=>wr,ProgressSchema:()=>jo,ProgressTokenSchema:()=>Sr,PromptArgumentSchema:()=>ts,PromptListChangedNotificationSchema:()=>ms,PromptMessageSchema:()=>us,PromptReferenceSchema:()=>xs,PromptSchema:()=>as,ReadResourceRequestParamsSchema:()=>Do,ReadResourceRequestSchema:()=>Vo,ReadResourceResultSchema:()=>Uo,RelatedTaskMetadataSchema:()=>_o,RequestIdSchema:()=>Ut,RequestMetaSchema:()=>yr,RequestSchema:()=>at,ResourceContentsSchema:()=>Tr,ResourceLinkSchema:()=>ls,ResourceListChangedNotificationSchema:()=>Ho,ResourceRequestParamsSchema:()=>Ca,ResourceSchema:()=>jr,ResourceTemplateReferenceSchema:()=>Fs,ResourceTemplateSchema:()=>Oo,ResourceUpdatedNotificationParamsSchema:()=>Qo,ResourceUpdatedNotificationSchema:()=>es,ResultMetaObjectSchema:()=>vr,ResultSchema:()=>rt,RoleSchema:()=>Kt,RootSchema:()=>Js,RootsListChangedNotificationSchema:()=>Zs,SamplingContentSchema:()=>Ts,SamplingMessageContentBlockSchema:()=>ca,SamplingMessageSchema:()=>Cs,ServerCapabilitiesSchema:()=>Pr,ServerNotificationSchema:()=>xn,ServerRequestSchema:()=>Fn,ServerResultSchema:()=>Kn,ServerTasksCapabilitySchema:()=>zo,SetLevelRequestParamsSchema:()=>vs,SetLevelRequestSchema:()=>bs,SingleSelectEnumSchemaSchema:()=>Os,StringSchemaSchema:()=>Oa,SubscribeRequestParamsSchema:()=>Fo,SubscribeRequestSchema:()=>xo,SubscriptionFilterSchema:()=>Nr,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Wo,SubscriptionsAcknowledgedNotificationSchema:()=>Yo,SubscriptionsListenRequestParamsSchema:()=>Go,SubscriptionsListenRequestSchema:()=>Jo,SubscriptionsListenResultMetaSchema:()=>Zo,SubscriptionsListenResultSchema:()=>Xo,TaskAugmentedRequestParamsSchema:()=>ua,TaskCreationParamsSchema:()=>Cn,TaskMetadataSchema:()=>So,TaskSchema:()=>Gt,TaskStatusNotificationParamsSchema:()=>Qs,TaskStatusNotificationSchema:()=>jn,TaskStatusSchema:()=>Xs,TextContentSchema:()=>qa,TextResourceContentsSchema:()=>Cr,TitledMultiSelectEnumSchemaSchema:()=>Vr,TitledSingleSelectEnumSchemaSchema:()=>Ar,ToolAnnotationsSchema:()=>hs,ToolChoiceSchema:()=>Es,ToolExecutionSchema:()=>ps,ToolListChangedNotificationSchema:()=>ys,ToolResultContentSchema:()=>ws,ToolSchema:()=>Ir,ToolUseContentSchema:()=>is,UnsubscribeRequestParamsSchema:()=>Ko,UnsubscribeRequestSchema:()=>Bo,UntitledMultiSelectEnumSchemaSchema:()=>Dr,UntitledSingleSelectEnumSchemaSchema:()=>Mr});var v=(m)=>br.safeParse(m).success,A=(m)=>Rr.safeParse(m).success,se=(m)=>Ea.safeParse(m).success,pe=(m)=>wa.safeParse(m).success;var Yt=(m)=>typeof m==="object"&&m!==null&&!Array.isArray(m)&&m.resultType==="input_required";function pc(m){if(m.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${m.params.ref.type}`)}function fc(m){if(m.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${m.params.ref.type}`)}var Ki="x-mcp-header",yu=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,vu=new Set(["string","integer","boolean","number"]);function gc(m){let h=[],f=new Map,g=(b,_,R)=>{if(b===null||typeof b!=="object")return;let y=b;if(Ki in y){if(!R||_.length===0)return`${ln(_)}: 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 C=y[Ki];if(typeof C!=="string"||C.length===0)return`${ln(_)}: x-mcp-header MUST be a non-empty string`;if(!yu.test(C))return`${ln(_)}: x-mcp-header '${C}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let N=typeof y.type==="string"?y.type:void 0;if(N===void 0||!vu.has(N))return`${ln(_)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${N??"<none>"}`;let J=C.toLowerCase(),W=f.get(J);if(W!==void 0)return`x-mcp-header '${C}' is not case-insensitively unique (also declared as '${W}')`;f.set(J,C),h.push({path:_,headerName:C,type:N})}let P=y.properties;if(P!==null&&typeof P==="object")for(let[C,N]of Object.entries(P)){let J=g(N,[..._,C],R);if(J!==void 0)return J}for(let C of bu){let N=y[C];if(N===void 0)continue;let J=Array.isArray(N)?N:N!==null&&typeof N==="object"&&Ru.has(C)?Object.values(N):[N];for(let W of J){let L=g(W,[..._,`<${C}>`],!1);if(L!==void 0)return L}}},S=g(m,[],!0);return S===void 0?{valid:!0,declarations:h}:{valid:!1,reason:S}}var bu=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],Ru=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function ln(m){return m.length===0?"<root>":m.join(".")}var dn=-32020,sh=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32000],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[i.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:[dn,i.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:[i.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope — and a missing envelope on a request whose protocol-version header names a modern revision — is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[i.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision’s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[i.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:[dn],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The 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’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half — 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–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[i.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced — pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[dn],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool’s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],nh={[i.ParseError]:400,[i.InvalidRequest]:400,[i.MethodNotFound]:404,[i.UnsupportedProtocolVersion]:400,[i.MissingRequiredClientCapability]:400,[dn]:400};function un(m,h,f,g,S){return{kind:"reject",rung:m,cell:h,httpStatus:f,code:g.code,message:g.message,...g.data!==void 0&&{data:g.data},settled:S}}function me(m){if(!ne(m))return!1;let h=re(m);if(h===void 0||!Va(h))return!1;let f=j(m);return f!==void 0&&oe(f).length===0}function Re(m,h){switch(m.reason){case"http-method":return un("http-method","modern-only-method-not-allowed",405,new Le(-32000,"Method not allowed."),!0);case"batch":return un("jsonrpc-shape","modern-only-batch-not-supported",400,new Le(i.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return un("jsonrpc-shape","modern-only-response-post",400,new Le(i.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let f=m.requestedVersion;return un("era-classification","modern-only-missing-envelope",400,f===void 0?new Le(i.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...h]}):new H({supported:[...h],requested:f}),!0)}}}function hn(m,h){return ie(m,h)}function Fr(m){return new Set(m.flatMap((h)=>Object.keys(h.shape)))}function Da(m){if(m==null)return!1;let h=typeof m;if(h!=="object"&&h!=="function")return!1;if(!("~standard"in m))return!1;return typeof m["~standard"]?.validate==="function"}var Bi=!1,si="draft-2020-12";function Zt(m,h="input"){let f=m["~standard"],g;if(f.jsonSchema)g=f.jsonSchema[h]({target:si});else if(f.vendor==="zod"){if(!("_zod"in m))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");if(!Bi)Bi=!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.");g=Se(m,{target:si,io:h})}else throw Error(`Schema library "${f.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(h==="output"){if(g.type!==void 0)return g;return Sc(g)?{type:"object",...g}:g}if(g.type!==void 0&&g.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(g.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...g}}function Sc(m){if("properties"in m||"patternProperties"in m||"additionalProperties"in m||"required"in m)return!0;for(let h of["oneOf","anyOf","allOf"]){let f=m[h];if(Array.isArray(f)&&f.length>0)return f.every((g)=>g!==null&&typeof g==="object"&&(g.type==="object"||Sc(g)))}return!1}function zu(m){if(!m.path?.length)return m.message;return`${m.path.map((h)=>String(typeof h==="object"?h.key:h)).join(".")}: ${m.message}`}async function da(m,h){let f=await m["~standard"].validate(h);if(f.issues&&f.issues.length>0)return{success:!1,error:f.issues.map((g)=>zu(g)).join(", ")};return{success:!0,data:f.value}}function $u(m){let h=Se(m,{target:si,io:"input"});return typeof h.pattern==="string"?h.pattern:void 0}var Pu=/\\\.\\d\{(\d+)\}/;function Eu(m){let h=Pu.exec(m),f=[void 0,-1,0];if(h)f.push(Number(h[1]));return[!1,!0].flatMap((g)=>[!1,!0].flatMap((S)=>f.map((b)=>D({local:g,offset:S,precision:b}))))}function wu(m,h){let f;switch(m){case"email":f=[Ae()];break;case"uri":f=[ae()];break;case"date":f=[be()];break;case"date-time":f=Eu(h);break}return new Set(f.map((g)=>$u(g)).filter((g)=>g!==void 0))}function Tu(m,h,f){if(f!=="zod")return!0;return wu(m,h).has(h)}function _c(m){let h=Zt(m,"input"),f=h.properties||{},g=h.required||[];return Object.entries(f).map(([S,b])=>({name:S,description:b?.description,required:g.includes(S)}))}function Br(m){return typeof m==="object"&&m!==null&&!Array.isArray(m)}function Cu(m){try{return Zt(m,"input")}catch(h){let f=h instanceof Error?h.message:String(h);throw new Le(i.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${f}`)}}var qu=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function vi(m){return qu.has(m)||m.startsWith("x-")}var ju=new Set(["$schema",...Object.keys(Ma.shape.requestedSchema.shape)]),Gi={string:Fr([Oa,Mr,Ar,Lr]),number:Fr([ka]),integer:Fr([ka]),boolean:Fr([kr]),array:Fr([Dr,Vr])},Nu=new Set(Oa.shape.format.unwrap().options);function Iu(m,h,f,g){if(!Br(m))return m;let S=typeof m.type==="string"&&Object.hasOwn(Gi,m.type)?Gi[m.type]:void 0;if(S===void 0)return m;let b={};for(let[_,R]of Object.entries(m))if(S.has(_)||vi(_))b[_]=R;else if(_==="pattern"&&m.type==="string"&&typeof m.format==="string"){if(!Nu.has(m.format))b[_]=R;else if(typeof R!=="string"||!Tu(m.format,R,f))g.push(`${h}.${_}`)}else g.push(`${h}.${_}`);return b}function Ou(m,h){let f={},g=[];for(let[S,b]of Object.entries(m))if(S==="properties"&&Br(b))f[S]=Object.fromEntries(Object.entries(b).map(([_,R])=>[_,Iu(R,`properties.${_}`,h,g)]));else if(ju.has(S))f[S]=b;else if(!vi(S))g.push(S);if(g.length>0)throw new Le(i.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${g.join(", ")}`);return f}function ku(m,h){if(!Br(m.properties))return h;let f=Object.entries(m.properties).filter(([,g])=>!hn(Ur,g).success).map(([g])=>`properties.${g}`);return f.length>0?f.join(", "):h}function ni(m,h,f=""){if(Array.isArray(m)&&Array.isArray(h))return m.flatMap((g,S)=>ni(g,h[S],`${f}[${S}]`));if(!Br(m)||!Br(h))return[];return Object.entries(m).flatMap(([g,S])=>{let b=f?`${f}.${g}`:g;if(!Object.prototype.hasOwnProperty.call(h,g))return vi(g)?[]:[b];return ni(S,h[g],b)})}function Mu(m){if(!Da(m.requestedSchema))return{...m,mode:"form",requestedSchema:m.requestedSchema};let h=m.requestedSchema["~standard"].vendor,f=Ou(Cu(m.requestedSchema),h),g=hn(Ma.shape.requestedSchema,f);if(!g.success)throw new Le(i.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${ku(f,g.error.message)}`);let S=ni(f,g.data);if(S.length>0)throw new Le(i.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${S.join(", ")}`);let b=(g.data.required??[]).filter((_)=>!Object.prototype.hasOwnProperty.call(g.data.properties,_));if(b.length>0)throw new Le(i.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${b.join(", ")}`);return{...m,mode:"form",requestedSchema:g.data}}function Au(m){let h=m.inputRequests!==void 0&&Object.keys(m.inputRequests).length>0,f=typeof m.requestState==="string";if(!h&&!f)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...m.inputRequests!==void 0&&{inputRequests:m.inputRequests},...m.requestState!==void 0&&{requestState:m.requestState}}}var ih=Object.assign(Au,{elicit(m){try{return{method:"elicitation/create",params:Mu(m)}}catch(h){throw h instanceof Le?TypeError(h.message,{cause:h}):h}},elicitUrl(m){return{method:"elicitation/create",params:{...m,mode:"url"}}},createMessage(m){return{method:"sampling/createMessage",params:m}},listRoots(){return{method:"roots/list"}}});var yc=250;function vc(m,h){return`Multi-round-trip request '${m}' still required input after ${h} rounds (inputRequired.maxRounds)`}function bc(m,h){return new Promise((f,g)=>{if(h?.aborted){g(h.reason instanceof Ke?h.reason:new Ke(Je.RequestTimeout,String(h.reason)));return}let S=setTimeout(()=>{h?.removeEventListener("abort",b),f()},m),b=()=>{clearTimeout(S),g(h?.reason instanceof Ke?h.reason:new Ke(Je.RequestTimeout,String(h?.reason)))};h?.addEventListener("abort",b,{once:!0})})}function Rc(m){let h=new AbortController,f=()=>h.abort(m?.reason);if(m?.addEventListener("abort",f,{once:!0}),m?.aborted)h.abort(m.reason);return{signal:h.signal,abort:(g)=>h.abort(g),dispose:()=>m?.removeEventListener("abort",f)}}var Lu=["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"],Du={IdJagTokenExchangeResponseSchema:Wn,OAuthClientInformationFullSchema:Zn,OAuthClientInformationSchema:rn,OAuthClientMetadataSchema:an,OAuthClientRegistrationErrorSchema:Xn,OAuthErrorResponseSchema:Yn,OAuthMetadataSchema:en,OAuthProtectedResourceMetadataSchema:Bn,OAuthTokenRevocationRequestSchema:Qn,OAuthTokensSchema:Jn,OpenIdProviderDiscoveryMetadataSchema:Gn,OpenIdProviderMetadataSchema:tn},zc={},$c={};function Pc(m,h){let f=m.slice(0,-6);zc[f]=h,$c[f]=(g)=>h.safeParse(g).success}for(let m of Lu)Pc(m,_u[m]);for(let[m,h]of Object.entries(Du))Pc(m,h);var ch=Object.freeze(zc),lh=Object.freeze($c);function Vu(m){switch(m){case"initialize":case"notifications/initialized":return Wt(void 0);case"server/discover":return Wt(Gr);default:return}}var Uu=60000,Hu=[Dt,gr,Vt,la],Fu=["inputResponses","requestState"];function Ji(m,h){let f=m.params;if(!Kr(f))return{message:m,lifted:{}};let g=f._meta,S=Kr(g)?Hu.filter((y)=>(y in g)):[],b=h==="request"?Fu.filter((y)=>(y in f)):[];if(S.length===0&&b.length===0)return{message:m,lifted:{}};let _={},R={...f};if(S.length>0&&Kr(g)){let y={},P={...g};for(let C of S)y[C]=g[C],delete P[C];if(_.envelope=y,Object.keys(P).length>0)R._meta=P;else delete R._meta}for(let y of b){if(y==="inputResponses")_.inputResponses=R[y];if(y==="requestState")_.requestState=R[y];delete R[y]}return{message:{...m,params:R},lifted:_}}function Wi(m,h){let f=m.validateResult(h,void 0);if(!f.ok&&f.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(g){let S=m.validateResult(h,g);if(S.ok)return{value:S.value};return{issues:[{message:S.reason==="invalid"?S.message:`not-in-era: ${h}`}]}}}}}function Jr(m){return()=>m}var xu=Jr(void 0);function bi(m,h){return{...m,mcpReq:{...m.mcpReq,requestState:Jr(h)}}}var Ec;function $e(m,h){Ec(m,h)}var wc=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{Ec=(m,h)=>{m._negotiatedProtocolVersion=h}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(m){this._options=m,this._supportedProtocolVersions=m?.supportedProtocolVersions??Rn,this.setNotificationHandler("notifications/cancelled",(h)=>{this._oncancel(h)}),this.setNotificationHandler("notifications/progress",(h)=>{this._onprogress(h)}),this.setRequestHandler("ping",(h)=>({}))}_shouldDropInbound(m){}_outboundMetaEnvelope(){}_envelopeOutbound(m){let h=this._outboundMetaEnvelope();if(h===void 0)return m;let f=m.params??{};return{...m,params:{...f,_meta:{...h,...f._meta}}}}_resolveNonCompleteResult(m,h){return Promise.reject(new Ke(Je.UnsupportedResultType,`Unsupported result type '${m.kind}' for ${h.request.method}`,{resultType:m.kind,method:h.request.method}))}_getRequestHandler(m){return this._requestHandlers.get(m)}async _oncancel(m){if(m.params.requestId===void 0)return;this._requestHandlerAbortControllers.get(m.params.requestId)?.abort(m.params.reason)}_setupTimeout(m,h,f,g,S=!1){this._timeoutInfo.set(m,{timeoutId:setTimeout(g,h),startTime:Date.now(),timeout:h,maxTotalTimeout:f,resetTimeoutOnProgress:S,onTimeout:g})}_resetTimeout(m){let h=this._timeoutInfo.get(m);if(!h)return!1;let f=Date.now()-h.startTime;if(h.maxTotalTimeout&&f>=h.maxTotalTimeout)throw this._timeoutInfo.delete(m),new Ke(Je.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:h.maxTotalTimeout,totalElapsed:f});return clearTimeout(h.timeoutId),h.timeoutId=setTimeout(h.onTimeout,h.timeout),!0}_cleanupTimeout(m){let h=this._timeoutInfo.get(m);if(h)clearTimeout(h.timeoutId),this._timeoutInfo.delete(m)}async connect(m){this._transport=m;let h=this.transport?.onclose;this._transport.onclose=()=>{try{h?.()}finally{this._onclose()}};let f=this.transport?.onerror;this._transport.onerror=(S)=>{f?.(S),this._onerror(S)};let g=this._transport?.onmessage;this._transport.onmessage=(S,b)=>{if(g?.(S,b),se(S)||pe(S))this._onresponse(S);else if(v(S))this._onrequest(S,b);else if(A(S))this._onnotification(S,b);else this._onerror(Error(`Unknown message type: ${JSON.stringify(S)}`))},m.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let m=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let g of this._timeoutInfo.values())clearTimeout(g.timeoutId);this._timeoutInfo.clear();let h=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let f=new Ke(Je.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let g of m.values())g(f);for(let g of h.values())g.abort(f)}}_onerror(m){this.onerror?.(m)}_onnotification(m,h){let{message:f}=Ji(m,"notification"),g=this._negotiatedWireCodec();if(h?.classification===void 0&&this._shouldDropInbound(m)==="drop")return;if(h?.classification!==void 0){let _=Fi(h.classification);if(_!==g.era){this._onerror(Error(`Era mismatch on inbound notification '${f.method}': classified as ${_} but this instance serves ${g.era}`));return}}if(ai(f.method)&&!g.hasNotificationMethod(f.method))return;let S=this._notificationHandlers.get(f.method),b=this.fallbackNotificationHandler;if(S===void 0&&b===void 0)return;Promise.resolve().then(()=>S===void 0?b(f):S(f,g)).catch((_)=>this._onerror(Error(`Uncaught error in notification handler: ${_}`)))}_onrequest(m,h){let{message:f,lifted:g}=Ji(m,"request"),S=this._negotiatedWireCodec();if(h?.classification===void 0&&this._shouldDropInbound(m)==="drop"){this._onerror(Error(`Dropped inbound request '${m.method}': not servable on this connection's protocol era`));return}let b=this._transport,_=(K,I,z)=>{let F={jsonrpc:"2.0",id:f.id,error:{code:K,message:I,...z!==void 0&&{data:z}}};b?.send(F).catch((w)=>this._onerror(Error(`Failed to send an error response: ${w}`)))};if(h?.classification!==void 0){let K=Fi(h.classification);if(K!==S.era){this._onerror(Error(`Era mismatch on inbound request '${f.method}': classified as ${K} but this instance serves ${S.era}`));let I=h.classification.revision??K;_(i.UnsupportedProtocolVersion,`Unsupported protocol version: ${I}`,{supported:this._supportedProtocolVersions,requested:I});return}}if(ti(f.method)&&!S.hasRequestMethod(f.method)){_(i.MethodNotFound,"Method not found");return}let R=this._requestHandlers.get(f.method)??this.fallbackRequestHandler;if(R===void 0){_(i.MethodNotFound,"Method not found");return}let y=S.checkInboundEnvelope(g);if(y!==void 0){_(i.InvalidParams,y);return}let P=(K,I)=>this._notificationViaCodec(this._resolveOutboundCodec(K.method),K,{...I,relatedRequestId:f.id}),C=(K,I,z)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(K.method),K,I,{...z,relatedRequestId:f.id}),N=new AbortController;this._requestHandlerAbortControllers.set(f.id,N);let J=g.inputResponses===void 0?void 0:Ku(g.inputResponses),W={sessionId:b?.sessionId,mcpReq:{id:f.id,method:f.method,_meta:f.params?._meta,...g.envelope!==void 0&&{envelope:g.envelope},...J!==void 0&&{inputResponses:J.accepted},...J!==void 0&&J.droppedKeys.length>0&&{droppedInputResponseKeys:J.droppedKeys},requestState:g.requestState===void 0?xu:Jr(g.requestState),signal:N.signal,send:(K,I,z)=>{let F=this._resolveOutboundCodec(K.method);if(this._assertOutboundRequestInEra(F,K.method),Da(I))return C(K,I,z);let w=Wi(F,K.method);if(w===void 0)throw TypeError(`'${K.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return C(K,w,I)},notify:P},http:h?.authInfo?{authInfo:h.authInfo}:void 0},L=this.buildContext(W,h);Promise.resolve().then(()=>R(f,L)).then(async(K)=>{if(N.signal.aborted)return;let I;try{I=S.encodeResult(f.method,K,this._outboundServerInfo())}catch(F){this._onerror(Error(`Failed to encode result for ${f.method}: ${F}`)),_(i.InternalError,"Internal error");return}let z={result:I,jsonrpc:"2.0",id:f.id};await b?.send(z)},async(K)=>{if(N.signal.aborted)return;let I=Number.isSafeInteger(K.code)?K.code:i.InternalError,z={jsonrpc:"2.0",id:f.id,error:{code:S.encodeErrorCode(I),message:K.message??"Internal error",...K.data!==void 0&&{data:K.data}}};await b?.send(z)}).catch((K)=>this._onerror(Error(`Failed to send response: ${K}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(f.id)===N)this._requestHandlerAbortControllers.delete(f.id)})}_onprogress(m){let{progressToken:h,...f}=m.params,g=Number(h),S=this._progressHandlers.get(g);if(!S){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(m)}`));return}let b=this._responseHandlers.get(g),_=this._timeoutInfo.get(g);if(_&&b&&_.resetTimeoutOnProgress)try{this._resetTimeout(g)}catch(R){this._responseHandlers.delete(g),this._progressHandlers.delete(g),this._cleanupTimeout(g),b(R);return}S(f)}_onresponse(m){let h=Number(m.id),f=this._responseHandlers.get(h);if(f===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(m)}`));return}if(this._responseHandlers.delete(h),this._cleanupTimeout(h),this._progressHandlers.delete(h),se(m))f(m);else f(Le.fromError(m.error.code,m.error.message,m.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(m,h,f){let g=this._resolveOutboundCodec(m.method);if(this._assertOutboundRequestInEra(g,m.method),Da(h))return this._requestWithSchemaViaCodec(g,m,h,f);let S=Wi(g,m.method);if(S===void 0)throw TypeError(`'${m.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(g,m,S,h)}_negotiatedWireCodec(){return Wt(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(m){if(this._negotiatedProtocolVersion===void 0){let h=Vu(m);if(h)return h}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(m,h){if(ti(h)&&!m.hasRequestMethod(h))throw new Ke(Je.MethodNotSupportedByProtocolVersion,`Method '${h}' is not supported by the negotiated protocol version (wire era ${m.era})`,{method:h,era:m.era})}_requestWithSchema(m,h,f){let g=this._resolveOutboundCodec(m.method);return this._assertOutboundRequestInEra(g,m.method),this._requestWithSchemaViaCodec(g,m,h,f)}_requestWithSchemaViaCodec(m,h,f,g){let{relatedRequestId:S,resumptionToken:b,onresumptiontoken:_,headers:R}=g??{},y=Date.now(),P,C;return new Promise((N,J)=>{let W=(U)=>{J(U)};if(!this._transport){W(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(h.method)}catch(U){W(U);return}if(g?.signal?.aborted){let U=g.signal.reason;throw U instanceof Ke?U:new Ke(Je.RequestTimeout,String(U))}let L=m.era===Gr&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,K=this._requestMessageId++;C=K;let I={...h,jsonrpc:"2.0",id:K};if(g?.onprogress)this._progressHandlers.set(K,g.onprogress),I.params={...h.params,_meta:{...h.params?._meta,progressToken:K}};let z=this._envelopeOutbound(I),F=!1,w=(U)=>{if(F)return;if(this._progressHandlers.delete(K),L===void 0){if(h.method!=="initialize")this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:K,reason:String(U)}}),{relatedRequestId:S,resumptionToken:b,onresumptiontoken:_}).catch((T)=>this._onerror(Error(`Failed to send cancellation: ${T}`)))}else L.abort();J(U instanceof Ke?U:new Ke(Je.RequestTimeout,String(U)))};this._responseHandlers.set(K,(U)=>{if(g?.signal?.aborted)return;if(F=!0,U instanceof Error)return J(U);let T;try{T=m.decodeResult(h.method,U.result)}catch(de){return J(de instanceof Error?de:Error(String(de)))}if(T.kind==="invalid")return J(T.error);if(T.kind==="input_required"){if(g?.allowInputRequired===!0)return N(Bu(T));let de={codec:m,request:h,resultSchema:f,options:g,flowStartedAt:y,retry:(qe,ge)=>this._requestWithSchemaViaCodec(m,qe===void 0?{method:h.method}:{method:h.method,params:qe},f,ge)};return N(this._resolveNonCompleteResult(T,de))}let Z=T.result;da(f,Z).then((de)=>{if(de.success)N(de.data);else J(new Ke(Je.InvalidResult,`Invalid result for ${h.method}: ${de.error}`))},J)}),P=()=>w(g?.signal?.reason),g?.signal?.addEventListener("abort",P,{once:!0});let B=g?.timeout??Uu,Y=()=>w(new Ke(Je.RequestTimeout,"Request timed out",{timeout:B}));this._setupTimeout(K,B,g?.maxTotalTimeout,Y,g?.resetTimeoutOnProgress??!1),this._transport.send(z,{relatedRequestId:S,resumptionToken:b,onresumptiontoken:_,headers:R,requestSignal:L?.signal}).catch((U)=>{this._progressHandlers.delete(K),J(U)})}).finally(()=>{if(P)g?.signal?.removeEventListener("abort",P);if(C!==void 0)this._responseHandlers.delete(C),this._cleanupTimeout(C)})}async notification(m,h){return await this._notificationViaCodec(this._resolveOutboundCodec(m.method),m,h)}async _notificationViaCodec(m,h,f){if(!this._transport)throw new Ke(Je.NotConnected,"Not connected");if(ai(h.method)&&!m.hasNotificationMethod(h.method))throw new Ke(Je.MethodNotSupportedByProtocolVersion,`Notification '${h.method}' is not supported by the negotiated protocol version (wire era ${m.era})`,{method:h.method,era:m.era});this.assertNotificationCapability(h.method);let g=this._envelopeOutbound({jsonrpc:"2.0",...h});if((this._options?.debouncedNotificationMethods??[]).includes(h.method)&&!h.params&&f?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(h.method))return;this._pendingDebouncedNotifications.add(h.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(h.method),!this._transport)return;this._transport?.send(g,f).catch((S)=>this._onerror(S))});return}await this._transport.send(g,f)}setRequestHandler(m,h,f){this.assertRequestHandlerCapability(m);let g;if(typeof h==="function"){if(!ti(m))throw TypeError(`'${m}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);g=(S,b)=>{let _=this._negotiatedWireCodec(),R=_.validateRequest(m,S);if(!R.ok&&R.reason==="not-in-era")R=_.validateInputRequest(m,S);if(!R.ok){if(R.reason==="not-in-era")throw new Le(i.InternalError,`No wire schema for ${m} in the resolved era`);throw Error(R.message)}return Promise.resolve(h(R.value,b))}}else if(f)g=async(S,b)=>{let _=await da(h.params,{...S.params});if(!_.success)throw new Le(i.InvalidParams,`Invalid params for ${m}: ${_.error}`);return f(_.data,b)};else throw TypeError("setRequestHandler: handler is required");this._requestHandlers.set(m,this._wrapHandler(m,g))}_wrapHandler(m,h){return h}_outboundServerInfo(){}removeRequestHandler(m){this._requestHandlers.delete(m)}assertCanSetRequestHandler(m){if(this._requestHandlers.has(m))throw Error(`A request handler for ${m} already exists, which would be overridden`)}setNotificationHandler(m,h,f){if(typeof h==="function"){if(!ai(m))throw TypeError(`'${m}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(m,(g,S)=>{let b=S.validateNotification(m,g);if(!b.ok){if(b.reason==="not-in-era")throw new Le(i.InternalError,`No wire schema for ${m} in the resolved era`);throw Error(b.message)}return Promise.resolve(h(b.value))});return}if(!f)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(m,async(g)=>{let S=await da(h.params,{...g.params});if(!S.success)throw new Le(i.InvalidParams,`Invalid params for notification ${m}: ${S.error}`);await f(S.data,g)})}removeNotificationHandler(m){this._notificationHandlers.delete(m)}};function Kr(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function Tc(m,h){let f={...m};for(let g in h){let S=g,b=h[S];if(b===void 0)continue;let _=f[S];f[S]=Kr(_)&&Kr(b)?{..._,...b}:b}return f}function Yi(m){return typeof m==="object"&&m!==null&&!Array.isArray(m)}function Ku(m){let h={},f=[];if(!Yi(m))return{accepted:h,droppedKeys:f};for(let[g,S]of Object.entries(m)){if(!Yi(S)||"method"in S||"result"in S){f.push(g);continue}h[g]=S}return{accepted:h,droppedKeys:f}}function Bu(m){return{resultType:"input_required",inputRequests:m.inputRequests,...m.requestState!==void 0&&{requestState:m.requestState},...m._meta!==void 0&&{_meta:m._meta}}}/*!
|
|
1
|
+
import{Ie,Ae,be,D,ve,ae,e,Oe,ce,le,o,a,O,Me,l,n,t,d,c,E,k,s,p,r,u,V,M}from"./chunk-qxxrmem2.js";var{create:ul,defineProperty:fo,getOwnPropertyDescriptor:dl,getOwnPropertyNames:ml,getPrototypeOf:hl}=Object,pl=Object.prototype.hasOwnProperty,_e=(m,h)=>()=>(h||m((h={exports:{}}).exports,h),h.exports),Ni=(m,h)=>{let f={};for(var g in m)fo(f,g,{get:m[g],enumerable:!0});if(h)fo(f,Symbol.toStringTag,{value:"Module"});return f},fl=(m,h,f,g)=>{if(h&&typeof h==="object"||typeof h==="function"){for(var S=ml(h),b=0,_=S.length,R;b<_;b++)if(R=S[b],!pl.call(m,R)&&R!==f)fo(m,R,{get:((y)=>h[y]).bind(null,R),enumerable:!(g=dl(h,R))||g.enumerable})}return m},go=(m,h,f)=>(f=m!=null?ul(hl(m)):{},fl(h||!m||!m.__esModule?fo(f,"default",{value:m,enumerable:!0}):f,m));var gl=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Ii=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),Sl=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),_l=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Oi(m){return typeof m==="string"&&Ii.has(m.replace(/#$/,""))}function ki(m,h){if(!("$schema"in m)||typeof m.$schema!=="string")return"2020-12";let f=m.$schema.replace(/#$/,"");if(gl.has(f))return"2020-12";if(Ii.has(f))return"2019-09";if(Sl.has(f)||_l.has(f))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${m.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${h}`)}var Ai={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 Mi;(function(m){})(Mi||(Mi={}));function yl(m){return Ae(le,m)}var za="2025-11-25";var Rn=[za,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],zn="io.modelcontextprotocol/related-task",Dt="io.modelcontextprotocol/protocolVersion",gr="io.modelcontextprotocol/clientInfo",jt="io.modelcontextprotocol/serverInfo",Vt="io.modelcontextprotocol/clientCapabilities",$a="io.modelcontextprotocol/subscriptionId",la="io.modelcontextprotocol/logLevel";var Pa="2.0";var Lt=V(()=>c([e(),o(),a(),O(),s(e(),Lt),n(Lt)])),tt=s(e(),Lt),$n=n(Lt),Sr=c([e(),o().int()]),_r=e(),So=t({ttl:o().optional()}),_o=t({taskId:e()}),yr=d({progressToken:Sr.optional(),[zn]:_o.optional()}),dt=t({_meta:yr.optional()}),ua=dt.extend({task:So.optional()}),at=t({method:e(),params:dt.loose().optional()}),ft=t({_meta:yr.optional()}),gt=t({method:e(),params:ft.loose().optional()}),vr=d({get[jt](){return Ta.optional().catch(void 0)}}),rt=d({_meta:vr.optional()}),Ut=c([e(),o().int()]),br=t({jsonrpc:r(Pa),id:Ut,...at.shape}).strict(),Rr=t({jsonrpc:r(Pa),...gt.shape}).strict(),Ea=t({jsonrpc:r(Pa),id:Ut,result:rt}).strict(),wa=t({jsonrpc:r(Pa),id:Ut.optional(),error:t({code:o().int(),message:e(),data:l().optional()})}).strict(),yo=c([br,Rr,Ea,wa]),Pn=c([Ea,wa]),zr=rt.strict(),vo=ft.extend({requestId:Ut.optional(),reason:e().optional()}),$r=gt.extend({method:r("notifications/cancelled"),params:vo}),bo=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),Ht=t({icons:n(bo).optional()}),qt=t({name:e(),title:e().optional()}),Ta=qt.extend({...qt.shape,...Ht.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),zl=k(t({applyDefaults:a().optional()}),tt),$l=M((m)=>{if(m&&typeof m==="object"&&!Array.isArray(m)&&Object.keys(m).length===0)return{form:{}};return m},k(t({form:zl.optional(),url:tt.optional()}),tt.optional())),Ro=d({list:tt.optional(),cancel:tt.optional(),requests:d({sampling:d({createMessage:tt.optional()}).optional(),elicitation:d({create:tt.optional()}).optional()}).optional()}),zo=d({list:tt.optional(),cancel:tt.optional(),requests:d({tools:d({call:tt.optional()}).optional()}).optional()}),$o=t({experimental:s(e(),tt).optional(),sampling:t({context:tt.optional(),tools:tt.optional()}).optional(),elicitation:$l.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:Ro.optional(),extensions:s(e(),tt).optional()}),Po=dt.extend({protocolVersion:e(),capabilities:$o,clientInfo:Ta}),Eo=at.extend({method:r("initialize"),params:Po}),Pr=t({experimental:s(e(),tt).optional(),logging:tt.optional(),completions:tt.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:zo.optional(),extensions:s(e(),tt).optional()}),wo=rt.extend({protocolVersion:e(),capabilities:Pr,serverInfo:Ta,instructions:e().optional()}),To=gt.extend({method:r("notifications/initialized"),params:ft.optional()}),Co=at.extend({method:r("server/discover"),params:dt.optional()}),qo=rt.extend({supportedVersions:n(e()),capabilities:Pr,instructions:e().optional()}),Er=at.extend({method:r("ping"),params:dt.optional()}),jo=t({progress:o(),total:u(o()),message:u(e())}),No=t({...ft.shape,...jo.shape,progressToken:Sr}),wr=gt.extend({method:r("notifications/progress"),params:No}),Io=dt.extend({cursor:_r.optional()}),Ft=at.extend({params:Io.optional()}),xt=rt.extend({nextCursor:_r.optional()}),Tr=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),Cr=Tr.extend({text:e()}),En=e().refine((m)=>{try{return atob(m),!0}catch{return!1}},{message:"Invalid Base64 string"}),qr=Tr.extend({blob:En}),Kt=p(["user","assistant"]),Nt=t({audience:n(Kt).optional(),priority:o().min(0).max(1).optional(),lastModified:D({offset:!0}).optional()}),jr=t({...qt.shape,...Ht.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Nt.optional(),_meta:u(d({}))}),Oo=t({...qt.shape,...Ht.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Nt.optional(),_meta:u(d({}))}),ko=Ft.extend({method:r("resources/list")}),Mo=xt.extend({resources:n(jr)}),Ao=Ft.extend({method:r("resources/templates/list")}),Lo=xt.extend({resourceTemplates:n(Oo)}),Ca=dt.extend({uri:e()}),Do=Ca,Vo=at.extend({method:r("resources/read"),params:Do}),Uo=rt.extend({contents:n(c([Cr,qr]))}),Ho=gt.extend({method:r("notifications/resources/list_changed"),params:ft.optional()}),Fo=Ca,xo=at.extend({method:r("resources/subscribe"),params:Fo}),Ko=Ca,Bo=at.extend({method:r("resources/unsubscribe"),params:Ko}),Nr=t({toolsListChanged:a().optional(),promptsListChanged:a().optional(),resourcesListChanged:a().optional(),resourceSubscriptions:n(e()).optional()}),Go=dt.extend({notifications:Nr}),Jo=at.extend({method:r("subscriptions/listen"),params:Go}),Wo=ft.extend({notifications:Nr}),Yo=gt.extend({method:r("notifications/subscriptions/acknowledged"),params:Wo}),Zo=vr.extend({[$a]:Ut}),Xo=rt.extend({_meta:Zo}),Qo=ft.extend({uri:e()}),es=gt.extend({method:r("notifications/resources/updated"),params:Qo}),ts=t({name:e(),description:u(e()),required:u(a())}),as=t({...qt.shape,...Ht.shape,description:u(e()),arguments:u(n(ts)),_meta:u(d({}))}),rs=Ft.extend({method:r("prompts/list")}),os=xt.extend({prompts:n(as)}),ss=dt.extend({name:e(),arguments:s(e(),e()).optional()}),ns=at.extend({method:r("prompts/get"),params:ss}),qa=t({type:r("text"),text:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),ja=t({type:r("image"),data:En,mimeType:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),Na=t({type:r("audio"),data:En,mimeType:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),is=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),cs=t({type:r("resource"),resource:c([Cr,qr]),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),ls=jr.extend({type:r("resource_link")}),Ia=c([qa,ja,Na,ls,cs]),us=t({role:Kt,content:Ia}),ds=rt.extend({description:e().optional(),messages:n(us)}),ms=gt.extend({method:r("notifications/prompts/list_changed"),params:ft.optional()}),hs=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),ps=t({taskSupport:p(["required","optional","forbidden"]).optional()}),Ir=t({...qt.shape,...Ht.shape,description:e().optional(),inputSchema:t({type:r("object"),properties:s(e(),Lt).optional(),required:n(e()).optional()}).catchall(l()),outputSchema:d({$schema:e().optional()}).optional(),annotations:hs.optional(),execution:ps.optional(),_meta:s(e(),l()).optional()}),fs=Ft.extend({method:r("tools/list")}),gs=xt.extend({tools:n(Ir)}),Or=rt.extend({content:n(Ia).default([]),structuredContent:l().optional(),isError:a().optional()}),wn=Or.or(rt.extend({toolResult:l()})),Ss=ua.extend({name:e(),arguments:s(e(),l()).optional()}),_s=at.extend({method:r("tools/call"),params:Ss}),ys=gt.extend({method:r("notifications/tools/list_changed"),params:ft.optional()}),Tn=t({autoRefresh:a().default(!0),debounceMs:o().int().nonnegative().default(300)}),Bt=p(["debug","info","notice","warning","error","critical","alert","emergency"]),vs=dt.extend({level:Bt}),bs=at.extend({method:r("logging/setLevel"),params:vs}),Rs=ft.extend({level:Bt,logger:e().optional(),data:l()}),zs=gt.extend({method:r("notifications/message"),params:Rs}),$s=t({name:e().optional()}),Ps=t({hints:n($s).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),Es=t({mode:p(["auto","required","none"]).optional()}),ws=t({type:r("tool_result"),toolUseId:e().describe("The unique identifier for the corresponding tool call."),content:n(Ia),structuredContent:l().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),Ts=E("type",[qa,ja,Na]),ca=E("type",[qa,ja,Na,is,ws]),Cs=t({role:Kt,content:c([ca,n(ca)]),_meta:s(e(),l()).optional()}),qs=ua.extend({messages:n(Cs),modelPreferences:Ps.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:tt.optional(),tools:n(Ir).optional(),toolChoice:Es.optional()}),js=at.extend({method:r("sampling/createMessage"),params:qs}),Ns=rt.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens"]).or(e())),role:Kt,content:Ts}),Is=rt.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens","toolUse"]).or(e())),role:Kt,content:c([ca,n(ca)])}),kr=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),Oa=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),ka=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),Mr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),Ar=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),Lr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),Os=c([Mr,Ar]),Dr=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),Vr=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),ks=c([Dr,Vr]),Ms=c([Lr,Os,ks]),Ur=c([Ms,kr,Oa,ka]),Ma=ua.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),Ur),required:n(e()).optional()}).catchall(l())}),As=ua.extend({mode:r("url"),message:e(),elicitationId:e(),url:e().url()}),Ls=c([Ma,As]),Ds=at.extend({method:r("elicitation/create"),params:Ls}),Vs=ft.extend({elicitationId:e()}),Us=gt.extend({method:r("notifications/elicitation/complete"),params:Vs}),Hs=rt.extend({action:p(["accept","decline","cancel"]),content:M((m)=>m===null?void 0:m,s(e(),c([e(),o(),a(),n(e())])).optional())}),Fs=t({type:r("ref/resource"),uri:e()}),xs=t({type:r("ref/prompt"),name:e()}),Ks=dt.extend({ref:c([xs,Fs]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()}),Bs=at.extend({method:r("completion/complete"),params:Ks}),Gs=rt.extend({completion:d({values:n(e()).max(100),total:u(o().int()),hasMore:u(a())})}),Js=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),Ws=at.extend({method:r("roots/list"),params:dt.optional()}),Ys=rt.extend({roots:n(Js)}),Zs=gt.extend({method:r("notifications/roots/list_changed"),params:ft.optional()}),Cn=d({ttl:o().optional(),pollInterval:o().optional()}),Xs=p(["working","input_required","completed","failed","cancelled"]),Gt=t({taskId:e(),status:Xs,ttl:c([o(),O()]),createdAt:e(),lastUpdatedAt:e(),pollInterval:u(o()),statusMessage:u(e())}),qn=rt.extend({task:Gt}),Qs=ft.merge(Gt),jn=gt.extend({method:r("notifications/tasks/status"),params:Qs}),Nn=at.extend({method:r("tasks/get"),params:dt.extend({taskId:e()})}),In=rt.merge(Gt),On=at.extend({method:r("tasks/result"),params:dt.extend({taskId:e()})}),kn=rt.loose(),Mn=Ft.extend({method:r("tasks/list")}),An=xt.extend({tasks:n(Gt)}),Ln=at.extend({method:r("tasks/cancel"),params:dt.extend({taskId:e()})}),Dn=rt.merge(Gt),Vn=c([Er,Eo,Co,Bs,bs,ns,rs,ko,Ao,Vo,xo,Bo,Jo,_s,fs]),Un=c([$r,wr,To,Zs]),Hn=c([zr,Ns,Is,Hs,Ys]),Fn=c([Er,js,Ds,Ws]),xn=c([$r,wr,zs,es,Ho,ys,ms,Yo,Us]),Kn=c([zr,wo,qo,Gs,ds,os,Mo,Lo,Uo,Or,gs,Xo]),ut=ce().superRefine((m,h)=>{if(!URL.canParse(m))return h.addIssue({code:Ai.custom,message:"URL must be parseable",fatal:!0}),Ie}).refine((m)=>{let h=new URL(m);return h.protocol!=="javascript:"&&h.protocol!=="data:"&&h.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Bn=d({resource:e().url(),authorization_servers:n(ut).optional(),jwks_uri:e().url().optional(),scopes_supported:n(e()).optional(),bearer_methods_supported:n(e()).optional(),resource_signing_alg_values_supported:n(e()).optional(),resource_name:e().optional(),resource_documentation:e().optional(),resource_policy_uri:e().url().optional(),resource_tos_uri:e().url().optional(),tls_client_certificate_bound_access_tokens:a().optional(),authorization_details_types_supported:n(e()).optional(),dpop_signing_alg_values_supported:n(e()).optional(),dpop_bound_access_tokens_required:a().optional()}),en=d({issuer:e(),authorization_endpoint:ut,token_endpoint:ut,registration_endpoint:ut.optional(),scopes_supported:n(e()).optional(),response_types_supported:n(e()),response_modes_supported:n(e()).optional(),grant_types_supported:n(e()).optional(),token_endpoint_auth_methods_supported:n(e()).optional(),token_endpoint_auth_signing_alg_values_supported:n(e()).optional(),service_documentation:ut.optional(),revocation_endpoint:ut.optional(),revocation_endpoint_auth_methods_supported:n(e()).optional(),revocation_endpoint_auth_signing_alg_values_supported:n(e()).optional(),introspection_endpoint:e().optional(),introspection_endpoint_auth_methods_supported:n(e()).optional(),introspection_endpoint_auth_signing_alg_values_supported:n(e()).optional(),code_challenge_methods_supported:n(e()).optional(),client_id_metadata_document_supported:a().optional(),authorization_response_iss_parameter_supported:a().optional().catch(void 0),dpop_signing_alg_values_supported:n(e()).optional()}),tn=d({issuer:e(),authorization_endpoint:ut,token_endpoint:ut,userinfo_endpoint:ut.optional(),jwks_uri:ut,registration_endpoint:ut.optional(),scopes_supported:n(e()).optional(),response_types_supported:n(e()),response_modes_supported:n(e()).optional(),grant_types_supported:n(e()).optional(),acr_values_supported:n(e()).optional(),subject_types_supported:n(e()),id_token_signing_alg_values_supported:n(e()),id_token_encryption_alg_values_supported:n(e()).optional(),id_token_encryption_enc_values_supported:n(e()).optional(),userinfo_signing_alg_values_supported:n(e()).optional(),userinfo_encryption_alg_values_supported:n(e()).optional(),userinfo_encryption_enc_values_supported:n(e()).optional(),request_object_signing_alg_values_supported:n(e()).optional(),request_object_encryption_alg_values_supported:n(e()).optional(),request_object_encryption_enc_values_supported:n(e()).optional(),token_endpoint_auth_methods_supported:n(e()).optional(),token_endpoint_auth_signing_alg_values_supported:n(e()).optional(),display_values_supported:n(e()).optional(),claim_types_supported:n(e()).optional(),claims_supported:n(e()).optional(),service_documentation:e().optional(),claims_locales_supported:n(e()).optional(),ui_locales_supported:n(e()).optional(),claims_parameter_supported:a().optional(),request_parameter_supported:a().optional(),request_uri_parameter_supported:a().optional(),require_request_uri_registration:a().optional(),op_policy_uri:ut.optional(),op_tos_uri:ut.optional(),client_id_metadata_document_supported:a().optional(),authorization_response_iss_parameter_supported:a().optional().catch(void 0)}),Gn=t({...tn.shape,...en.pick({code_challenge_methods_supported:!0}).shape}),Jn=t({access_token:e(),id_token:e().optional(),token_type:e(),expires_in:yl().optional(),scope:e().optional(),refresh_token:e().optional(),issuer:e().optional().catch(void 0)}).strip(),Wn=t({issued_token_type:r("urn:ietf:params:oauth:token-type:id-jag"),access_token:e(),token_type:e().optional(),expires_in:o().optional(),scope:e().optional()}).strip(),Yn=t({error:e(),error_description:e().optional(),error_uri:e().optional()}),bn=ut.optional().or(r("").transform(()=>{return})),an=t({redirect_uris:n(ut),token_endpoint_auth_method:e().optional(),grant_types:n(e()).optional(),response_types:n(e()).optional(),application_type:e().optional(),client_name:e().optional(),client_uri:ut.optional(),logo_uri:bn,scope:e().optional(),contacts:n(e()).optional(),tos_uri:bn,policy_uri:e().optional(),jwks_uri:ut.optional(),jwks:Me().optional(),software_id:e().optional(),software_version:e().optional(),software_statement:e().optional()}).strip(),rn=t({client_id:e(),client_secret:e().optional(),client_id_issued_at:o().optional(),client_secret_expires_at:o().optional(),issuer:e().optional().catch(void 0)}).strip(),Zn=an.merge(rn),Xn=t({error:e(),error_description:e().optional()}).strip(),Qn=t({token:e(),token_type_hint:e().optional()}).strip();var ri=Symbol.for("mcp.sdk.errorBrands");function ii(m,h){let f=new Set,g=h;while(typeof g==="function"){let S=g.mcpBrand;if(Object.prototype.hasOwnProperty.call(g,"mcpBrand")&&typeof S==="string")f.add(S);g=Object.getPrototypeOf(g)}if(f.size===0)return;Object.defineProperty(m,ri,{value:f,enumerable:!1,configurable:!0})}function La(m,h){try{if(typeof h==="object"&&h!==null&&Object.prototype.hasOwnProperty.call(m,"mcpBrand")&&typeof m.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(h,ri)){let f=h[ri];if(f&&typeof f.has==="function"&&f.has(m.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(m,h)}var Ol=class m extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](h){return La(this,h)}static isInstance(h){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,h)}constructor(h,f,g){super(f);this.code=h,this.errorUri=g,this.name="OAuthError",ii(this,new.target)}toResponseObject(){let h={error:this.code,error_description:this.message};if(this.errorUri)h.error_uri=this.errorUri;return h}static fromResponse(h){return new m(h.error,h.error_description??h.error,h.error_uri)}},Je=function(m){return m.NotConnected="NOT_CONNECTED",m.AlreadyConnected="ALREADY_CONNECTED",m.NotInitialized="NOT_INITIALIZED",m.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",m.RequestTimeout="REQUEST_TIMEOUT",m.ConnectionClosed="CONNECTION_CLOSED",m.SendFailed="SEND_FAILED",m.InvalidResult="INVALID_RESULT",m.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",m.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",m.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",m.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",m.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",m.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",m.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",m.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",m.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",m.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",m.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",m}({}),Ke=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](m){return La(this,m)}static isInstance(m){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,m)}constructor(m,h,f,g){super(h,g);this.code=m,this.data=f,this.name="SdkError",ii(this,new.target)}},eh=class extends Ke{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(m,h,f,g){super(m,h,f,g);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function Li(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function kl(m,h,f){return m==="elicitation"&&h==="form"&&f.form===void 0&&f.url===void 0}function Zi(m){switch(m.method){case"elicitation/create":if(m.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let h=m.params;if(h!==void 0&&(h.tools!==void 0||h.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function ci(m,h){let f={};for(let[g,S]of Object.entries(m)){if(S===void 0)continue;let b=h===void 0?void 0:h[g];if(b===void 0){f[g]=S;continue}if(Li(S)&&Li(b)){let _={};for(let[R,y]of Object.entries(S))if(y!==void 0&&b[R]===void 0&&!kl(g,R,b))_[R]=y;if(Object.keys(_).length>0)f[g]=_}}return Object.keys(f).length>0?f:void 0}var Xi="2026-07-28",x=[Xi];function Va(m){return m>=Xi}function Qi(m){return m.filter((h)=>!Va(h))}function li(m){return m.filter((h)=>Va(h))}function ec(m){let h=m.structuredContent;if(h===void 0)return m;if(!(typeof h!=="object"||h===null||Array.isArray(h)))return m;if(m.content?.some((f)=>f.type==="text")??!1)return m;return{...m,content:[...m.content??[],{type:"text",text:JSON.stringify(h)}]}}var tc=["task","inputRequests","requestState"];function ui(m){if(m===null||typeof m!=="object"||Array.isArray(m)||m.content!==void 0||tc.some((h)=>(h in m)))return m;return{...m,content:[]}}function Ml(){let m=V(()=>c([e(),o(),a(),O(),s(e(),m),n(m)])),h=s(e(),m),f=c([e(),o().int()]),g=e(),S=t({ttl:o().optional()}),b=t({taskId:e()}),_=d({progressToken:f.optional(),"io.modelcontextprotocol/related-task":b.optional()}),R=t({_meta:_.optional()}),y=R.extend({task:S.optional()}),P=t({method:e(),params:R.loose().optional()}),C=t({_meta:_.optional()}),N=t({method:e(),params:C.loose().optional()}),J=d({_meta:_.optional()}),W=c([e(),o().int()]),L=J.strict(),K=C.extend({requestId:W.optional(),reason:e().optional()}),I=N.extend({method:r("notifications/cancelled"),params:K}),z=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),F=t({icons:n(z).optional()}),w=t({name:e(),title:e().optional()}),B=w.extend({...w.shape,...F.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),Y=k(t({applyDefaults:a().optional()}),h),U=M((pt)=>{if(pt&&typeof pt==="object"&&!Array.isArray(pt)&&Object.keys(pt).length===0)return{form:{}};return pt},k(t({form:Y.optional(),url:h.optional()}),h.optional())),T=d({list:h.optional(),cancel:h.optional(),requests:d({sampling:d({createMessage:h.optional()}).optional(),elicitation:d({create:h.optional()}).optional()}).optional()}),Z=d({list:h.optional(),cancel:h.optional(),requests:d({tools:d({call:h.optional()}).optional()}).optional()}),de=t({experimental:s(e(),h).optional(),sampling:t({context:h.optional(),tools:h.optional()}).optional(),elicitation:U.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:T.optional(),extensions:s(e(),h).optional()}),we=R.extend({protocolVersion:e(),capabilities:de,clientInfo:B}),pe=P.extend({method:r("initialize"),params:we}),ye=t({experimental:s(e(),h).optional(),logging:h.optional(),completions:h.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:Z.optional(),extensions:s(e(),h).optional()}),Ne=J.extend({protocolVersion:e(),capabilities:ye,serverInfo:B,instructions:e().optional()}),je=N.extend({method:r("notifications/initialized"),params:C.optional()}),Ge=P.extend({method:r("ping"),params:R.optional()}),Qe=t({progress:o(),total:u(o()),message:u(e())}),Ze=t({...C.shape,...Qe.shape,progressToken:f}),nt=N.extend({method:r("notifications/progress"),params:Ze}),We=R.extend({cursor:g.optional()}),ee=P.extend({params:We.optional()}),ne=J.extend({nextCursor:g.optional()}),Re=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),G=Re.extend({text:e()}),Q=e().refine((pt)=>{try{return atob(pt),!0}catch{return!1}},{message:"Invalid Base64 string"}),te=Re.extend({blob:Q}),qe=p(["user","assistant"]),Le=t({audience:n(qe).optional(),priority:o().min(0).max(1).optional(),lastModified:D({offset:!0}).optional()}),Be=t({...w.shape,...F.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Le.optional(),_meta:u(d({}))}),He=t({...w.shape,...F.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Le.optional(),_meta:u(d({}))}),Xe=ee.extend({method:r("resources/list")}),St=ne.extend({resources:n(Be)}),X=ee.extend({method:r("resources/templates/list")}),ue=ne.extend({resourceTemplates:n(He)}),Se=R.extend({uri:e()}),Ve=Se,Ue=P.extend({method:r("resources/read"),params:Ve}),xe=J.extend({contents:n(c([G,te]))}),ot=N.extend({method:r("notifications/resources/list_changed"),params:C.optional()}),ct=Se,mt=P.extend({method:r("resources/subscribe"),params:ct}),it=Se,et=P.extend({method:r("resources/unsubscribe"),params:it}),Rt=C.extend({uri:e()}),lt=N.extend({method:r("notifications/resources/updated"),params:Rt}),Tt=t({name:e(),description:u(e()),required:u(a())}),$t=t({...w.shape,...F.shape,description:u(e()),arguments:u(n(Tt)),_meta:u(d({}))}),Ct=ee.extend({method:r("prompts/list")}),It=ne.extend({prompts:n($t)}),Ot=R.extend({name:e(),arguments:s(e(),e()).optional()}),Xt=P.extend({method:r("prompts/get"),params:Ot}),Qt=t({type:r("text"),text:e(),annotations:Le.optional(),_meta:s(e(),l()).optional()}),ea=t({type:r("image"),data:Q,mimeType:e(),annotations:Le.optional(),_meta:s(e(),l()).optional()}),ta=t({type:r("audio"),data:Q,mimeType:e(),annotations:Le.optional(),_meta:s(e(),l()).optional()}),Fa=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),kt=t({type:r("resource"),resource:c([G,te]),annotations:Le.optional(),_meta:s(e(),l()).optional()}),xa=Be.extend({type:r("resource_link")}),zt=c([Qt,ea,ta,xa,kt]),ma=t({role:qe,content:zt}),ha=J.extend({description:e().optional(),messages:n(ma)}),aa=N.extend({method:r("notifications/prompts/list_changed"),params:C.optional()}),Ka=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),pa=t({taskSupport:p(["required","optional","forbidden"]).optional()}),ra=t({...w.shape,...F.shape,description:e().optional(),inputSchema:t({type:r("object"),properties:s(e(),m).optional(),required:n(e()).optional()}).catchall(l()),outputSchema:t({type:r("object"),properties:s(e(),m).optional(),required:n(e()).optional()}).catchall(l()).optional(),annotations:Ka.optional(),execution:pa.optional(),_meta:s(e(),l()).optional()}),fa=ee.extend({method:r("tools/list")}),ga=ne.extend({tools:n(ra)}),Sa=J.extend({content:n(zt),structuredContent:s(e(),l()).optional(),isError:a().optional()}),ht=y.extend({name:e(),arguments:s(e(),l()).optional()}),Ba=P.extend({method:r("tools/call"),params:ht}),Zr=N.extend({method:r("notifications/tools/list_changed"),params:C.optional()}),_a=p(["debug","info","notice","warning","error","critical","alert","emergency"]),Ga=R.extend({level:_a}),Ja=P.extend({method:r("logging/setLevel"),params:Ga}),Wa=C.extend({level:_a,logger:e().optional(),data:l()}),Ya=N.extend({method:r("notifications/message"),params:Wa}),Za=t({name:e().optional()}),Xa=t({hints:n(Za).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),Qa=t({mode:p(["auto","required","none"]).optional()}),Xr=t({type:r("tool_result"),toolUseId:e().describe("The unique identifier for the corresponding tool call."),content:n(zt),structuredContent:t({}).loose().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),er=E("type",[Qt,ea,ta]),Mt=E("type",[Qt,ea,ta,Fa,Xr]),tr=t({role:qe,content:c([Mt,n(Mt)]),_meta:s(e(),l()).optional()}),ar=y.extend({messages:n(tr),modelPreferences:Xa.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:h.optional(),tools:n(ra).optional(),toolChoice:Qa.optional()}),rr=P.extend({method:r("sampling/createMessage"),params:ar}),or=J.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens"]).or(e())),role:qe,content:er}),sr=J.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens","toolUse"]).or(e())),role:qe,content:c([Mt,n(Mt)])}),nr=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),ir=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),cr=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),lr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),ur=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),dr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),mr=c([lr,ur]),oa=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),sa=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),Qr=c([oa,sa]),eo=c([dr,mr,Qr]),vt=c([eo,nr,ir,cr]),bt=y.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),vt),required:n(e()).optional()}).catchall(l())}),hr=y.extend({mode:r("url"),message:e(),elicitationId:e(),url:e().url()}),Pt=c([bt,hr]),to=P.extend({method:r("elicitation/create"),params:Pt}),ao=C.extend({elicitationId:e()}),ro=N.extend({method:r("notifications/elicitation/complete"),params:ao}),oo=J.extend({action:p(["accept","decline","cancel"]),content:M((pt)=>pt===null?void 0:pt,s(e(),c([e(),o(),a(),n(e())])).optional())}),so=t({type:r("ref/resource"),uri:e()}),no=t({type:r("ref/prompt"),name:e()}),io=R.extend({ref:c([no,so]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()}),pr=P.extend({method:r("completion/complete"),params:io}),co=J.extend({completion:d({values:n(e()).max(100),total:u(o().int()),hasMore:u(a())})}),lo=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),ya=P.extend({method:r("roots/list"),params:R.optional()}),fr=J.extend({roots:n(lo)}),uo=N.extend({method:r("notifications/roots/list_changed"),params:C.optional()}),mo=d({ttl:o().optional(),pollInterval:o().optional()}),ho=p(["working","input_required","completed","failed","cancelled"]),At=t({taskId:e(),status:ho,ttl:c([o(),O()]),createdAt:e(),lastUpdatedAt:e(),pollInterval:u(o()),statusMessage:u(e())}),_t=J.extend({task:At}),po=C.merge(At),na=N.extend({method:r("notifications/tasks/status"),params:po}),va=P.extend({method:r("tasks/get"),params:R.extend({taskId:e()})}),ba=J.merge(At),Ra=P.extend({method:r("tasks/result"),params:R.extend({taskId:e()})}),vn=J.loose(),yt=ee.extend({method:r("tasks/list")}),st=ne.extend({tasks:n(At)}),ia=P.extend({method:r("tasks/cancel"),params:R.extend({taskId:e()})});return{JSONValueSchema:m,JSONObjectSchema:h,ProgressTokenSchema:f,CursorSchema:g,TaskMetadataSchema:S,RelatedTaskMetadataSchema:b,RequestMetaSchema:_,BaseRequestParamsSchema:R,TaskAugmentedRequestParamsSchema:y,RequestSchema:P,NotificationsParamsSchema:C,NotificationSchema:N,ResultSchema:J,RequestIdSchema:W,EmptyResultSchema:L,CancelledNotificationParamsSchema:K,CancelledNotificationSchema:I,IconSchema:z,IconsSchema:F,BaseMetadataSchema:w,ImplementationSchema:B,ClientTasksCapabilitySchema:T,ServerTasksCapabilitySchema:Z,ClientCapabilitiesSchema:de,InitializeRequestParamsSchema:we,InitializeRequestSchema:pe,ServerCapabilitiesSchema:ye,InitializeResultSchema:Ne,InitializedNotificationSchema:je,PingRequestSchema:Ge,ProgressSchema:Qe,ProgressNotificationParamsSchema:Ze,ProgressNotificationSchema:nt,PaginatedRequestParamsSchema:We,PaginatedRequestSchema:ee,PaginatedResultSchema:ne,ResourceContentsSchema:Re,TextResourceContentsSchema:G,BlobResourceContentsSchema:te,RoleSchema:qe,AnnotationsSchema:Le,ResourceSchema:Be,ResourceTemplateSchema:He,ListResourcesRequestSchema:Xe,ListResourcesResultSchema:St,ListResourceTemplatesRequestSchema:X,ListResourceTemplatesResultSchema:ue,ResourceRequestParamsSchema:Se,ReadResourceRequestParamsSchema:Ve,ReadResourceRequestSchema:Ue,ReadResourceResultSchema:xe,ResourceListChangedNotificationSchema:ot,SubscribeRequestParamsSchema:ct,SubscribeRequestSchema:mt,UnsubscribeRequestParamsSchema:it,UnsubscribeRequestSchema:et,ResourceUpdatedNotificationParamsSchema:Rt,ResourceUpdatedNotificationSchema:lt,PromptArgumentSchema:Tt,PromptSchema:$t,ListPromptsRequestSchema:Ct,ListPromptsResultSchema:It,GetPromptRequestParamsSchema:Ot,GetPromptRequestSchema:Xt,TextContentSchema:Qt,ImageContentSchema:ea,AudioContentSchema:ta,ToolUseContentSchema:Fa,EmbeddedResourceSchema:kt,ResourceLinkSchema:xa,ContentBlockSchema:zt,PromptMessageSchema:ma,GetPromptResultSchema:ha,PromptListChangedNotificationSchema:aa,ToolAnnotationsSchema:Ka,ToolExecutionSchema:pa,ToolSchema:ra,ListToolsRequestSchema:fa,ListToolsResultSchema:ga,CallToolResultSchema:Sa,CallToolRequestParamsSchema:ht,CallToolRequestSchema:Ba,ToolListChangedNotificationSchema:Zr,LoggingLevelSchema:_a,SetLevelRequestParamsSchema:Ga,SetLevelRequestSchema:Ja,LoggingMessageNotificationParamsSchema:Wa,LoggingMessageNotificationSchema:Ya,ModelHintSchema:Za,ModelPreferencesSchema:Xa,ToolChoiceSchema:Qa,ToolResultContentSchema:Xr,SamplingContentSchema:er,SamplingMessageContentBlockSchema:Mt,SamplingMessageSchema:tr,CreateMessageRequestParamsSchema:ar,CreateMessageRequestSchema:rr,CreateMessageResultSchema:or,CreateMessageResultWithToolsSchema:sr,BooleanSchemaSchema:nr,StringSchemaSchema:ir,NumberSchemaSchema:cr,UntitledSingleSelectEnumSchemaSchema:lr,TitledSingleSelectEnumSchemaSchema:ur,LegacyTitledEnumSchemaSchema:dr,SingleSelectEnumSchemaSchema:mr,UntitledMultiSelectEnumSchemaSchema:oa,TitledMultiSelectEnumSchemaSchema:sa,MultiSelectEnumSchemaSchema:Qr,EnumSchemaSchema:eo,PrimitiveSchemaDefinitionSchema:vt,ElicitRequestFormParamsSchema:bt,ElicitRequestURLParamsSchema:hr,ElicitRequestParamsSchema:Pt,ElicitRequestSchema:to,ElicitationCompleteNotificationParamsSchema:ao,ElicitationCompleteNotificationSchema:ro,ElicitResultSchema:oo,ResourceTemplateReferenceSchema:so,PromptReferenceSchema:no,CompleteRequestParamsSchema:io,CompleteRequestSchema:pr,CompleteResultSchema:co,RootSchema:lo,ListRootsRequestSchema:ya,ListRootsResultSchema:fr,RootsListChangedNotificationSchema:uo,TaskCreationParamsSchema:mo,TaskStatusSchema:ho,TaskSchema:At,CreateTaskResultSchema:_t,TaskStatusNotificationParamsSchema:po,TaskStatusNotificationSchema:na,GetTaskRequestSchema:va,GetTaskResultSchema:ba,GetTaskPayloadRequestSchema:Ra,GetTaskPayloadResultSchema:vn,ListTasksRequestSchema:yt,ListTasksResultSchema:st,CancelTaskRequestSchema:ia,CancelTaskResultSchema:J.merge(At),ClientRequestSchema:c([Ge,pe,pr,Ja,Xt,Ct,Xe,X,Ue,mt,et,Ba,fa,va,Ra,yt,ia]),ClientNotificationSchema:c([I,nt,je,uo,na]),ClientResultSchema:c([L,or,sr,oo,fr,ba,st,_t]),ServerRequestSchema:c([Ge,rr,to,ya,va,Ra,yt,ia]),ServerNotificationSchema:c([I,nt,Ya,lt,ot,Zr,aa,na,ro]),ServerResultSchema:c([L,Ne,co,ha,It,St,ue,xe,Sa,ga,ba,st,_t]),CallToolResultWireSchema:l().superRefine((pt,ll)=>{if(typeof pt!=="object"||pt===null||Array.isArray(pt)||pt.content!==void 0)return;for(let ji of tc)if(ji in pt){ll.addIssue({code:"custom",message:`content is required when the body carries '${ji}' — another result family cannot default into an empty tools/call success`});return}}).transform(ui).pipe(Sa)}}var Al;function ac(){return Al??=Ml()}function rc(m){return m.type!=="object"}var Ll=new Set(["const","enum","default","examples"]),Dl=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Di(m){return m!==void 0&&!(typeof m==="string"&&m.startsWith("#"))}function Vl(m){let h=typeof m.$schema==="string"?m.$schema:void 0;if(Di(m.$id))return{...h!==void 0&&{$schema:h},type:"object",properties:{result:m},required:["result"]};let f=Oi(m.$schema)&&m.$recursiveAnchor!==!0,g=(S,b)=>{if(Array.isArray(S))return S.map((y)=>g(y,!1));if(S===null||typeof S!=="object")return S;if(!b&&Di(S.$id))return S;let _={},R=!1;for(let[y,P]of Object.entries(S))if(b)_[y]=g(P,!1);else if((y==="$ref"||y==="$dynamicRef")&&typeof P==="string")_[y]=P==="#"?"#/properties/result":P.startsWith("#/")?`#/properties/result${P.slice(1)}`:P;else if(y==="$recursiveRef"&&P==="#"&&f)R=!0;else if(Ll.has(y))_[y]=P;else if(Dl.has(y))_[y]=g(P,!0);else _[y]=g(P,!1);if(R)if("$ref"in _)_.allOf=[...Array.isArray(_.allOf)?_.allOf:[],{$ref:"#/properties/result"}];else _.$ref="#/properties/result";return _};return{...h!==void 0&&{$schema:h},type:"object",properties:{result:g(m,!1)},required:["result"]}}var oc={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},sc={"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},Ul={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},on;function di(){if(on)return on;let m=ac();return on={requestSchemas:{ping:m.PingRequestSchema,initialize:m.InitializeRequestSchema,"completion/complete":m.CompleteRequestSchema,"logging/setLevel":m.SetLevelRequestSchema,"prompts/get":m.GetPromptRequestSchema,"prompts/list":m.ListPromptsRequestSchema,"resources/list":m.ListResourcesRequestSchema,"resources/templates/list":m.ListResourceTemplatesRequestSchema,"resources/read":m.ReadResourceRequestSchema,"resources/subscribe":m.SubscribeRequestSchema,"resources/unsubscribe":m.UnsubscribeRequestSchema,"tools/call":m.CallToolRequestSchema,"tools/list":m.ListToolsRequestSchema,"tasks/get":m.GetTaskRequestSchema,"tasks/result":m.GetTaskPayloadRequestSchema,"tasks/list":m.ListTasksRequestSchema,"tasks/cancel":m.CancelTaskRequestSchema,"sampling/createMessage":m.CreateMessageRequestSchema,"elicitation/create":m.ElicitRequestSchema,"roots/list":m.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":m.CancelledNotificationSchema,"notifications/progress":m.ProgressNotificationSchema,"notifications/initialized":m.InitializedNotificationSchema,"notifications/roots/list_changed":m.RootsListChangedNotificationSchema,"notifications/tasks/status":m.TaskStatusNotificationSchema,"notifications/message":m.LoggingMessageNotificationSchema,"notifications/resources/updated":m.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":m.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":m.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":m.PromptListChangedNotificationSchema,"notifications/elicitation/complete":m.ElicitationCompleteNotificationSchema},resultSchemas:{ping:m.EmptyResultSchema,initialize:m.InitializeResultSchema,"completion/complete":m.CompleteResultSchema,"logging/setLevel":m.EmptyResultSchema,"prompts/get":m.GetPromptResultSchema,"prompts/list":m.ListPromptsResultSchema,"resources/list":m.ListResourcesResultSchema,"resources/templates/list":m.ListResourceTemplatesResultSchema,"resources/read":m.ReadResourceResultSchema,"resources/subscribe":m.EmptyResultSchema,"resources/unsubscribe":m.EmptyResultSchema,"tools/call":m.CallToolResultWireSchema,"tools/list":m.ListToolsResultSchema,"sampling/createMessage":m.CreateMessageResultWithToolsSchema,"elicitation/create":m.ElicitResultSchema,"roots/list":m.ListRootsResultSchema}},on}function nc(m){return Object.prototype.hasOwnProperty.call(oc,m)}function ic(m){return Object.prototype.hasOwnProperty.call(sc,m)}function Hl(m){return Object.prototype.hasOwnProperty.call(Ul,m)}function Fl(m){return Hl(m)?di().resultSchemas[m]:void 0}function xl(m){return nc(m)?di().requestSchemas[m]:void 0}function Kl(m){return ic(m)?di().notificationSchemas[m]:void 0}var th=Object.keys(oc),ah=Object.keys(sc);function oi(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function sn(m,h){if(m===void 0)return{ok:!1,reason:"not-in-era"};let f=m.safeParse(h);return f.success?{ok:!0,value:f.data}:{ok:!1,reason:"invalid",message:String(f.error)}}var Vi={ok:!1,reason:"not-in-era"};function Ui(m){return oi(m)&&oi(m.outputSchema)&&rc(m.outputSchema)}function Hi(m){return m}var mi={era:"2025-11-25",hasRequestMethod:nc,hasNotificationMethod:ic,validateRequest:(m,h)=>sn(xl(m),h),validateResult:(m,h)=>sn(Fl(m),h),validateNotification:(m,h)=>sn(Kl(m),h),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Vi,validateInputResponse:()=>Vi,samplingResultVariant:(m,h)=>{let f=ac();return sn(m?f.CreateMessageResultWithToolsSchema:f.CreateMessageResultSchema,h)},outboundEnvelope:(m)=>{return},validateEnvelopeMeta:(m)=>[],projectCallToolResult(m,h){let f=ec(m),g=f.structuredContent;if(g===void 0)return f;let S=typeof g!=="object"||g===null||Array.isArray(g),b=h!==void 0&&rc(h);if(!S&&!b)return f;return{...f,structuredContent:{result:g}}},decodeResult(m,h){if(oi(h)&&"resultType"in h){let f={...h};return delete f.resultType,{kind:"complete",result:Hi(f)}}return{kind:"complete",result:Hi(h)}},encodeResult(m,h){if(m!=="tools/list")return h;let f=h.tools;if(!Array.isArray(f)||!f.some((g)=>Ui(g)))return h;return{...h,tools:f.map((g)=>Ui(g)?{...g,outputSchema:Vl(g.outputSchema)}:g)}},encodeErrorCode:(m)=>m===-32002?-32602:m,checkInboundEnvelope:(m)=>{return}};function Bl(){let m=V(()=>c([e(),o(),a(),O(),s(e(),m),n(m)])),h=s(e(),m),f=c([e(),o().int()]),g=e(),S=c([e(),o().int()]),b=p(["user","assistant"]),_=p(["debug","info","notice","warning","error","critical","alert","emergency"]),R=e().refine((st)=>{try{return atob(st),!0}catch{return!1}},{message:"Invalid Base64 string"}),y=t({ttl:o().optional()}),P=t({taskId:e()}),C=d({progressToken:f.optional(),"io.modelcontextprotocol/related-task":P.optional()}),N=t({_meta:C.optional()}),J=N.extend({task:y.optional()}),W=t({_meta:C.optional()}),L=t({method:e(),params:W.loose().optional()}),K=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),I=t({icons:n(K).optional()}),z=t({name:e(),title:e().optional()}),F=z.extend({...z.shape,...I.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),w=k(t({applyDefaults:a().optional()}),h),B=M((st)=>{if(st&&typeof st==="object"&&!Array.isArray(st)&&Object.keys(st).length===0)return{form:{}};return st},k(t({form:w.optional(),url:h.optional()}),h.optional())),Y=d({list:h.optional(),cancel:h.optional(),requests:d({sampling:d({createMessage:h.optional()}).optional(),elicitation:d({create:h.optional()}).optional()}).optional()}),U=d({list:h.optional(),cancel:h.optional(),requests:d({tools:d({call:h.optional()}).optional()}).optional()}),T=t({experimental:s(e(),h).optional(),sampling:t({context:h.optional(),tools:h.optional()}).optional(),elicitation:B.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:Y.optional(),extensions:s(e(),h).optional()}),Z=t({experimental:s(e(),h).optional(),logging:h.optional(),completions:h.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:U.optional(),extensions:s(e(),h).optional()}),de=t({progress:o(),total:u(o()),message:u(e())}),we=t({...W.shape,...de.shape,progressToken:f}),pe=L.extend({method:r("notifications/progress"),params:we}),ye=W.extend({level:_,logger:e().optional(),data:l()}),Ne=L.extend({method:r("notifications/message"),params:ye}),je=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),Ge=je.extend({text:e()}),Qe=je.extend({blob:R}),Ze=t({audience:n(b).optional(),priority:o().min(0).max(1).optional(),lastModified:D({offset:!0}).optional()}),nt=t({...z.shape,...I.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Ze.optional(),_meta:u(d({}))}),We=t({...z.shape,...I.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Ze.optional(),_meta:u(d({}))}),ee=L.extend({method:r("notifications/resources/list_changed"),params:W.optional()}),ne=W.extend({uri:e()}),Re=L.extend({method:r("notifications/resources/updated"),params:ne}),G=t({name:e(),description:u(e()),required:u(a())}),Q=t({...z.shape,...I.shape,description:u(e()),arguments:u(n(G)),_meta:u(d({}))}),te=L.extend({method:r("notifications/prompts/list_changed"),params:W.optional()}),qe=t({type:r("text"),text:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),Le=t({type:r("image"),data:R,mimeType:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),Be=t({type:r("audio"),data:R,mimeType:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),He=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),Xe=t({type:r("resource"),resource:c([Ge,Qe]),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),St=nt.extend({type:r("resource_link")}),X=c([qe,Le,Be,St,Xe]),ue=t({role:b,content:X}),Se=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),Ve=L.extend({method:r("notifications/tools/list_changed"),params:W.optional()}),Ue=t({name:e().optional()}),xe=t({hints:n(Ue).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),ot=t({mode:p(["auto","required","none"]).optional()}),ct=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),mt=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),it=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),et=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),Rt=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),lt=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),Tt=c([et,Rt]),$t=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),Ct=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),It=c([$t,Ct]),Ot=c([lt,Tt,It]),Xt=c([Ot,ct,mt,it]),Qt=J.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),Xt),required:n(e()).optional()}).catchall(l())}),ea=t({type:r("ref/resource"),uri:e()}),ta=t({type:r("ref/prompt"),name:e()}),Fa=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),kt=T.shape,xa=t({experimental:kt.experimental,sampling:kt.sampling,elicitation:kt.elicitation,roots:kt.roots,extensions:kt.extensions}),zt=Z.shape,ma=t({experimental:zt.experimental,logging:zt.logging,completions:zt.completions,prompts:zt.prompts,resources:zt.resources,tools:zt.tools,extensions:zt.extensions}),ha=d({progressToken:f.optional(),[Dt]:e(),[gr]:F.optional(),[Vt]:xa,[la]:_.optional()}),aa=t({...z.shape,...I.shape,description:e().optional(),inputSchema:d({$schema:e().optional(),type:r("object")}),outputSchema:d({$schema:e().optional()}).optional(),annotations:Se.optional(),_meta:s(e(),l()).optional()}),Ka=t({type:r("tool_result"),toolUseId:e(),content:n(X),structuredContent:l().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),pa=c([qe,Le,Be,He,Ka]),ra=t({role:b,content:c([pa,n(pa)]),_meta:s(e(),l()).optional()}),fa=e(),ga=d({[jt]:F.optional().catch(void 0)}),Sa=ga.optional();function ht(st){return d({_meta:Sa,resultType:fa.default("complete"),...st})}let Ba=ht({}),Zr=ht({nextCursor:g.optional()}),_a=ht({content:n(X),structuredContent:l().optional(),isError:a().optional()}),Ga=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),tools:n(aa),nextCursor:g.optional()}),Ja=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),prompts:n(Q),nextCursor:g.optional()}),Wa=ht({description:e().optional(),messages:n(ue)}),Ya=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resources:n(nt),nextCursor:g.optional()}),Za=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resourceTemplates:n(We),nextCursor:g.optional()}),Xa=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),contents:n(c([Ge,Qe]))}),Qa=ht({completion:t({values:n(e()).max(100),total:o().int().optional(),hasMore:a().optional()}).loose()}),Xr=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"])}),er=ht({ttlMs:o().int().min(0).catch(0),cacheScope:p(["public","private"]).catch("private"),supportedVersions:n(e()),capabilities:ma,instructions:e().optional()}),Mt=t({messages:n(ra),modelPreferences:xe.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:h.optional(),tools:n(aa).optional(),toolChoice:ot.optional()}),tr=t({method:r("sampling/createMessage"),params:Mt}),ar=t({method:r("roots/list"),params:t({_meta:s(e(),l()).optional()}).optional()}),rr=t({...ra.shape,model:e(),stopReason:e().optional()}),or=t({roots:n(Fa)}),sr=t({action:p(["accept","decline","cancel"]),content:s(e(),c([e(),o(),a(),n(e())])).optional()}),nr=t({mode:r("url"),message:e(),url:e().url()}),ir=c([Qt,nr]),cr=t({method:r("elicitation/create"),params:ir}),lr=c([tr,ar,cr]),ur=c([rr,or,sr]),dr=s(e(),lr),mr=s(e(),ur),oa=ht({inputRequests:dr.optional(),requestState:e().optional()}),sa={inputResponses:mr.optional(),requestState:e().optional()},Qr=t({_meta:ha,...sa}),eo=d({progressToken:f.optional()});function vt(st,ia){return t({method:r(st),params:t({_meta:ha,...ia})})}function bt(st,ia){return t({method:r(st),params:t({_meta:eo.optional(),...ia}).optional()})}let hr={name:e(),arguments:s(e(),l()).optional(),...sa},Pt={cursor:g.optional()},to=vt("tools/call",hr),ao=vt("tools/list",Pt),ro=vt("prompts/list",Pt),oo=vt("prompts/get",{name:e(),arguments:s(e(),e()).optional(),...sa}),so=vt("resources/list",Pt),no=vt("resources/templates/list",Pt),io=vt("resources/read",{uri:e(),...sa}),pr={ref:c([ta,ea]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()},co=vt("completion/complete",pr),lo=vt("server/discover",{}),ya=t({toolsListChanged:a().optional(),promptsListChanged:a().optional(),resourcesListChanged:a().optional(),resourceSubscriptions:n(e()).optional()}),fr={notifications:ya},uo=vt("subscriptions/listen",fr),mo=ga.extend({"io.modelcontextprotocol/subscriptionId":S}),ho=d({_meta:mo,resultType:fa.default("complete")}),At={"tools/call":bt("tools/call",hr),"tools/list":bt("tools/list",Pt),"prompts/get":bt("prompts/get",{name:e(),arguments:s(e(),e()).optional()}),"prompts/list":bt("prompts/list",Pt),"resources/list":bt("resources/list",Pt),"resources/templates/list":bt("resources/templates/list",Pt),"resources/read":bt("resources/read",{uri:e()}),"completion/complete":bt("completion/complete",pr),"server/discover":bt("server/discover",{}),"subscriptions/listen":bt("subscriptions/listen",fr)};function _t(st){return d({_meta:Sa,...st})}let po={"tools/call":_t({content:n(X),structuredContent:l().optional(),isError:a().optional()}),"tools/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),tools:n(aa),nextCursor:g.optional()}),"prompts/get":_t({description:e().optional(),messages:n(ue)}),"prompts/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),prompts:n(Q),nextCursor:g.optional()}),"resources/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resources:n(nt),nextCursor:g.optional()}),"resources/templates/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resourceTemplates:n(We),nextCursor:g.optional()}),"resources/read":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),contents:n(c([Ge,Qe]))}),"completion/complete":_t({completion:t({values:n(e()).max(100),total:o().int().optional(),hasMore:a().optional()}).loose()}),"server/discover":_t({ttlMs:o().int().min(0).catch(0),cacheScope:p(["public","private"]).catch("private"),supportedVersions:n(e()),capabilities:ma,instructions:e().optional()}),"subscriptions/listen":_t({})},na=d({"io.modelcontextprotocol/subscriptionId":S.optional()}),va=t({method:r("notifications/subscriptions/acknowledged"),params:t({_meta:na.optional(),notifications:ya})}),ba=t({_meta:na.optional(),requestId:S,reason:e().optional()}),Ra=t({method:r("notifications/cancelled"),params:ba}),vn={"notifications/cancelled":Ra,"notifications/progress":pe,"notifications/message":Ne,"notifications/resources/updated":Re,"notifications/resources/list_changed":ee,"notifications/tools/list_changed":Ve,"notifications/prompts/list_changed":te,"notifications/subscriptions/acknowledged":va},yt=(st)=>t({jsonrpc:r("2.0"),id:c([e(),o().int()]),result:st}).strict();return{JSONValueSchema:m,JSONObjectSchema:h,ProgressTokenSchema:f,CursorSchema:g,RequestIdSchema:S,RoleSchema:b,LoggingLevelSchema:_,TaskMetadataSchema:y,RelatedTaskMetadataSchema:P,RequestMetaSchema:C,BaseRequestParamsSchema:N,TaskAugmentedRequestParamsSchema:J,NotificationsParamsSchema:W,NotificationSchema:L,IconSchema:K,IconsSchema:I,BaseMetadataSchema:z,ImplementationSchema:F,ClientTasksCapabilitySchema:Y,ServerTasksCapabilitySchema:U,ClientCapabilitiesSchema:T,ServerCapabilitiesSchema:Z,ProgressSchema:de,ProgressNotificationParamsSchema:we,ProgressNotificationSchema:pe,LoggingMessageNotificationParamsSchema:ye,LoggingMessageNotificationSchema:Ne,ResourceContentsSchema:je,TextResourceContentsSchema:Ge,BlobResourceContentsSchema:Qe,AnnotationsSchema:Ze,ResourceSchema:nt,ResourceTemplateSchema:We,ResourceListChangedNotificationSchema:ee,ResourceUpdatedNotificationParamsSchema:ne,ResourceUpdatedNotificationSchema:Re,PromptArgumentSchema:G,PromptSchema:Q,PromptListChangedNotificationSchema:te,TextContentSchema:qe,ImageContentSchema:Le,AudioContentSchema:Be,ToolUseContentSchema:He,EmbeddedResourceSchema:Xe,ResourceLinkSchema:St,ContentBlockSchema:X,PromptMessageSchema:ue,ToolAnnotationsSchema:Se,ToolListChangedNotificationSchema:Ve,ModelHintSchema:Ue,ModelPreferencesSchema:xe,ToolChoiceSchema:ot,BooleanSchemaSchema:ct,StringSchemaSchema:mt,NumberSchemaSchema:it,UntitledSingleSelectEnumSchemaSchema:et,TitledSingleSelectEnumSchemaSchema:Rt,LegacyTitledEnumSchemaSchema:lt,SingleSelectEnumSchemaSchema:Tt,UntitledMultiSelectEnumSchemaSchema:$t,TitledMultiSelectEnumSchemaSchema:Ct,MultiSelectEnumSchemaSchema:It,EnumSchemaSchema:Ot,PrimitiveSchemaDefinitionSchema:Xt,ElicitRequestFormParamsSchema:Qt,ResourceTemplateReferenceSchema:ea,PromptReferenceSchema:ta,RootSchema:Fa,ClientCapabilities2026Schema:xa,ServerCapabilities2026Schema:ma,RequestMetaEnvelopeSchema:ha,ToolSchema:aa,ToolResultContentSchema:Ka,SamplingMessageContentBlockSchema:pa,SamplingMessageSchema:ra,ResultTypeSchema:fa,ResultMetaSchema:ga,ResultSchema:Ba,PaginatedResultSchema:Zr,CallToolResultSchema:_a,ListToolsResultSchema:Ga,ListPromptsResultSchema:Ja,GetPromptResultSchema:Wa,ListResourcesResultSchema:Ya,ListResourceTemplatesResultSchema:Za,ReadResourceResultSchema:Xa,CompleteResultSchema:Qa,CacheableResultSchema:Xr,DiscoverResultSchema:er,CreateMessageRequestParamsSchema:Mt,CreateMessageRequestSchema:tr,ListRootsRequestSchema:ar,CreateMessageResultSchema:rr,ListRootsResultSchema:or,ElicitResultSchema:sr,ElicitRequestURLParamsSchema:nr,ElicitRequestParamsSchema:ir,ElicitRequestSchema:cr,InputRequestSchema:lr,InputResponseSchema:ur,InputRequestsSchema:dr,InputResponsesSchema:mr,InputRequiredResultSchema:oa,InputResponseRequestParamsSchema:Qr,CallToolRequestSchema:to,ListToolsRequestSchema:ao,ListPromptsRequestSchema:ro,GetPromptRequestSchema:oo,ListResourcesRequestSchema:so,ListResourceTemplatesRequestSchema:no,ReadResourceRequestSchema:io,CompleteRequestSchema:co,DiscoverRequestSchema:lo,SubscriptionFilterSchema:ya,SubscriptionsListenRequestSchema:uo,SubscriptionsListenResultMetaSchema:mo,SubscriptionsListenResultSchema:ho,dispatchRequestSchemas:At,dispatchResultSchemas:po,NotificationMetaSchema:na,SubscriptionsAcknowledgedNotificationSchema:va,CancelledNotificationParamsSchema:ba,CancelledNotificationSchema:Ra,notificationSchemas2026:vn,JSONRPCResultResponseSchema:yt(Ba),CallToolResultResponseSchema:yt(c([_a,oa])),ListToolsResultResponseSchema:yt(Ga),ListPromptsResultResponseSchema:yt(Ja),GetPromptResultResponseSchema:yt(c([Wa,oa])),ListResourcesResultResponseSchema:yt(Ya),ListResourceTemplatesResultResponseSchema:yt(Za),ReadResourceResultResponseSchema:yt(c([Xa,oa])),CompleteResultResponseSchema:yt(Qa),DiscoverResultResponseSchema:yt(er)}}var Gl;function Jt(){return Gl??=Bl()}var Jl=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Wl(m){return Jl.includes(m)}var Aa=Symbol("modelcontextprotocol.resultCacheHintFallback");function mn(m,h){if(h===void 0)return m;let f=m[Aa];if(f===void 0)return{...m,[Aa]:h};let g={},S=f.ttlMs??h.ttlMs;if(S!==void 0)g.ttlMs=S;let b=f.cacheScope??h.cacheScope;if(b!==void 0)g.cacheScope=b;return{...m,[Aa]:g}}function Yl(m){return m[Aa]}function hi(m){return typeof m==="number"&&Number.isSafeInteger(m)&&m>=0}function pi(m){return m==="public"||m==="private"}function fi(m,h){if(m.ttlMs!==void 0&&!hi(m.ttlMs))throw RangeError(`Invalid cache hint for ${h}: ttlMs must be a non-negative safe integer (got ${String(m.ttlMs)})`);if(m.cacheScope!==void 0&&!pi(m.cacheScope))throw RangeError(`Invalid cache hint for ${h}: cacheScope must be 'public' or 'private' (got ${String(m.cacheScope)})`)}var i=function(m){return m[m.ParseError=-32700]="ParseError",m[m.InvalidRequest=-32600]="InvalidRequest",m[m.MethodNotFound=-32601]="MethodNotFound",m[m.InvalidParams=-32602]="InvalidParams",m[m.InternalError=-32603]="InternalError",m[m.ResourceNotFound=-32002]="ResourceNotFound",m[m.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",m[m.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",m[m.UrlElicitationRequired=-32042]="UrlElicitationRequired",m}({}),De=class m extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](h){return La(this,h)}static isInstance(h){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,h)}constructor(h,f,g){super(f);this.code=h,this.data=g,this.name="ProtocolError",ii(this,new.target)}static fromError(h,f,g){if(h===i.UrlElicitationRequired&&g){let S=g;if(S.elicitations)return new Zl(S.elicitations,f)}if(h===i.UnsupportedProtocolVersion&&g){let S=g;if(Array.isArray(S.supported)&&typeof S.requested==="string")return new H({supported:S.supported,requested:S.requested},f)}if(h===i.InvalidParams||h===i.ResourceNotFound){let S=g;if(typeof S?.uri==="string"&&(h===i.ResourceNotFound||Object.keys(S).length===1))return new gi(S.uri,f)}if(h===i.MissingRequiredClientCapability&&g){let S=g;if(S.requiredCapabilities!==null&&typeof S.requiredCapabilities==="object"&&!Array.isArray(S.requiredCapabilities))return new Si({requiredCapabilities:S.requiredCapabilities},f)}return new m(h,f,g)}},gi=class extends De{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(m,h=`Resource not found: ${m}`){super(i.InvalidParams,h,{uri:m})}get uri(){return this.data.uri}},Zl=class extends De{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(m,h=`URL elicitation${m.length>1?"s":""} required`){super(i.UrlElicitationRequired,h,{elicitations:m})}get elicitations(){return this.data?.elicitations??[]}},H=class extends De{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(m,h=`Unsupported protocol version: ${m.requested}`){super(i.UnsupportedProtocolVersion,h,m)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Si=class extends De{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(m,h=`Missing required client capabilities: ${Object.keys(m.requiredCapabilities).join(", ")}`){super(i.MissingRequiredClientCapability,h,m)}get requiredCapabilities(){return this.data.requiredCapabilities}},Xl=0,Ql="private",eu=["tools/call","prompts/get","resources/read"];function tu(m,h){let f=h.resultType;if(f===void 0)return{...h,resultType:"complete"};if(f==="complete")return h;if(eu.includes(m))return h;throw new De(i.InternalError,`Handler for ${m} returned resultType '${String(f)}', but results of ${m} only support 'complete' on protocol revision 2026-07-28`)}function au(m,h){let f=Yl(h);if(h.resultType!=="complete"||!Wl(m))return f===void 0?h:iu(h);let g=h,S=hi(g.ttlMs)?g.ttlMs:su(f),b=pi(g.cacheScope)?g.cacheScope:nu(f),_={...g,ttlMs:S,cacheScope:b};return delete _[Aa],_}function ru(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function ou(m,h){if(h===void 0)return m;let f=m._meta;if(f===void 0)return{...m,_meta:{[jt]:h}};if(!ru(f))return m;if(f[jt]!==void 0)return m;return{...m,_meta:{...f,[jt]:h}}}function su(m){return m!==void 0&&hi(m.ttlMs)?m.ttlMs:Xl}function nu(m){return m!==void 0&&pi(m.cacheScope)?m.cacheScope:Ql}function iu(m){let h={...m};return delete h[Aa],h}var cu=["elicitation/create","sampling/createMessage","roots/list"],nn;function cc(){if(nn)return nn;let m=Jt();return nn={request:{"elicitation/create":t({method:r("elicitation/create"),params:m.ElicitRequestParamsSchema}),"sampling/createMessage":t({method:r("sampling/createMessage"),params:m.CreateMessageRequestParamsSchema}),"roots/list":t({method:r("roots/list"),params:d({}).optional()})},response:{"elicitation/create":m.ElicitResultSchema,"sampling/createMessage":m.CreateMessageResultSchema,"roots/list":m.ListRootsResultSchema}},nn}function lc(m){return cu.includes(m)}function ei(m){return lc(m)?cc().request[m]:void 0}function lu(m){return lc(m)?cc().response[m]:void 0}var _i={"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},uc={"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 dc(m){return Object.prototype.hasOwnProperty.call(_i,m)}function mc(m){return Object.prototype.hasOwnProperty.call(uc,m)}function uu(m){return Object.prototype.hasOwnProperty.call(_i,m)}function du(m){return dc(m)?Jt().dispatchRequestSchemas[m]:void 0}function mu(m){return uu(m)?Jt().dispatchResultSchemas[m]:void 0}function hu(m){return mc(m)?Jt().notificationSchemas2026[m]:void 0}var rh=Object.keys(_i),oh=Object.keys(uc);function xr(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function Hr(m,h){if(m===void 0)return{ok:!1,reason:"not-in-era"};let f=m.safeParse(h);return f.success?{ok:!0,value:f.data}:{ok:!1,reason:"invalid",message:String(f.error)}}var pu={ok:!1,reason:"not-in-era"},fu=[Dt,Vt];function gu(m,h){let f=h,g=!1,S=()=>{if(!g)f={...f},g=!0;return f},b=h.tools;if(m==="tools/list"&&Array.isArray(b)&&b.some((R)=>xr(R)&&("execution"in R)))S().tools=b.map((R)=>{if(!xr(R)||!("execution"in R))return R;let y={...R};return delete y.execution,y});let _=h.capabilities;if(xr(_)&&"tasks"in _){let R={..._};delete R.tasks,S().capabilities=R}return f}var yi={era:"2026-07-28",hasRequestMethod:dc,hasNotificationMethod:mc,hasInputRequestMethod:(m)=>ei(m)!==void 0,validateRequest:(m,h)=>Hr(du(m),h),validateResult:(m,h)=>Hr(mu(m),h),validateNotification:(m,h)=>Hr(hu(m),h),validateInputRequest:(m,h)=>Hr(ei(m),h),validateInputResponse:(m,h)=>Hr(lu(m),h),samplingResultVariant:()=>pu,outboundEnvelope(m){return{[Dt]:m.protocolVersion,[gr]:m.clientInfo,[Vt]:m.clientCapabilities,...m.logLevel!==void 0&&{[la]:m.logLevel}}},validateEnvelopeMeta(m){let h=[];for(let g of fu)if(!(g in m))h.push({key:g,problem:"missing"});let f=Jt().RequestMetaEnvelopeSchema.safeParse(m);if(!f.success)for(let g of f.error.issues){let S=g.path.map(String),b=S.length>0?S.join("."):"_meta";if(S.length===1&&h.some((_)=>_.key===b&&_.problem==="missing"))continue;h.push({key:b,problem:g.message})}return h},projectCallToolResult:(m)=>ec(m),inputRequestSchema:ei,decodeResult(m,h){if(!xr(h))return{kind:"invalid",error:new Ke(Je.InvalidResult,`Invalid result for ${m}: not an object`,{method:m})};let f=h.resultType;if(f===void 0)return{kind:"invalid",error:new Ke(Je.InvalidResult,`Invalid result for ${m}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:m,violation:"missing-resultType"})};if(typeof f!=="string")return{kind:"invalid",error:new Ke(Je.InvalidResult,`Invalid result for ${m}: non-string resultType`,{method:m,resultType:f})};if(f==="input_required"){let _=h.inputRequests,R=xr(_)?_:{},y=h.requestState,P=h._meta===void 0?void 0:Jt().ResultMetaSchema.safeParse(h._meta),C=P?.success?P.data:void 0;if(Object.keys(R).length===0&&typeof y!=="string")return{kind:"invalid",error:new Ke(Je.InvalidResult,`Invalid result for ${m}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:m,violation:"input-required-missing-both"})};return{kind:"input_required",inputRequests:R,...typeof y==="string"&&{requestState:y},...C!==void 0&&{_meta:C}}}if(f!=="complete")return{kind:"invalid",error:new Ke(Je.UnsupportedResultType,`Unsupported result type '${f}' for ${m}`,{resultType:f,method:m})};let g=Su(),S=Object.hasOwn(g,m)?g[m]:void 0;if(S!==void 0){let _=S.safeParse(h);if(!_.success)return{kind:"invalid",error:new Ke(Je.InvalidResult,`Invalid result for ${m}: ${_.error}`,{method:m})}}let b={...h};return delete b.resultType,{kind:"complete",result:b}},encodeResult(m,h,f){return ou(au(m,tu(m,gu(m,h))),f)},encodeErrorCode:(m)=>m===-32002?-32602:m,checkInboundEnvelope(m){if(m.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let h=Jt().RequestMetaEnvelopeSchema.safeParse(m.envelope);if(!h.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${h.error.issues.map((f)=>f.message).join("; ")}`}},cn;function Su(){if(cn)return cn;let m=Jt();return cn={"tools/call":m.CallToolResultSchema,"tools/list":m.ListToolsResultSchema,"prompts/get":m.GetPromptResultSchema,"prompts/list":m.ListPromptsResultSchema,"resources/list":m.ListResourcesResultSchema,"resources/templates/list":m.ListResourceTemplatesResultSchema,"resources/read":m.ReadResourceResultSchema,"completion/complete":m.CompleteResultSchema,"server/discover":m.DiscoverResultSchema},cn}var Gr="2026-07-28";function Wt(m){return m!==void 0&&Va(m)?yi:mi}function Fi(m){if(m.revision!==void 0)return Wt(m.revision).era;return m.era==="modern"?yi.era:mi.era}function ti(m){return hc.some((h)=>h.hasRequestMethod(m))}function ai(m){return hc.some((h)=>h.hasNotificationMethod(m))}var hc=[mi,yi];function xi(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function j(m){if(!xi(m))return;let h=m._meta;return xi(h)?h:void 0}function re(m){let h=j(m);return h!==void 0&&Dt in h}function oe(m){let h=j(m)?.[Dt];return typeof h==="string"?h:void 0}function se(m){return Wt(Gr).validateEnvelopeMeta(m)}var _u=Ni({AnnotationsSchema:()=>Nt,AudioContentSchema:()=>Na,BaseMetadataSchema:()=>qt,BaseRequestParamsSchema:()=>dt,BlobResourceContentsSchema:()=>qr,BooleanSchemaSchema:()=>kr,CallToolRequestParamsSchema:()=>Ss,CallToolRequestSchema:()=>_s,CallToolResultSchema:()=>Or,CancelTaskRequestSchema:()=>Ln,CancelTaskResultSchema:()=>Dn,CancelledNotificationParamsSchema:()=>vo,CancelledNotificationSchema:()=>$r,ClientCapabilitiesSchema:()=>$o,ClientNotificationSchema:()=>Un,ClientRequestSchema:()=>Vn,ClientResultSchema:()=>Hn,ClientTasksCapabilitySchema:()=>Ro,CompatibilityCallToolResultSchema:()=>wn,CompleteRequestParamsSchema:()=>Ks,CompleteRequestSchema:()=>Bs,CompleteResultSchema:()=>Gs,ContentBlockSchema:()=>Ia,CreateMessageRequestParamsSchema:()=>qs,CreateMessageRequestSchema:()=>js,CreateMessageResultSchema:()=>Ns,CreateMessageResultWithToolsSchema:()=>Is,CreateTaskResultSchema:()=>qn,CursorSchema:()=>_r,DiscoverRequestSchema:()=>Co,DiscoverResultSchema:()=>qo,ElicitRequestFormParamsSchema:()=>Ma,ElicitRequestParamsSchema:()=>Ls,ElicitRequestSchema:()=>Ds,ElicitRequestURLParamsSchema:()=>As,ElicitResultSchema:()=>Hs,ElicitationCompleteNotificationParamsSchema:()=>Vs,ElicitationCompleteNotificationSchema:()=>Us,EmbeddedResourceSchema:()=>cs,EmptyResultSchema:()=>zr,EnumSchemaSchema:()=>Ms,GetPromptRequestParamsSchema:()=>ss,GetPromptRequestSchema:()=>ns,GetPromptResultSchema:()=>ds,GetTaskPayloadRequestSchema:()=>On,GetTaskPayloadResultSchema:()=>kn,GetTaskRequestSchema:()=>Nn,GetTaskResultSchema:()=>In,IconSchema:()=>bo,IconsSchema:()=>Ht,ImageContentSchema:()=>ja,ImplementationSchema:()=>Ta,InitializeRequestParamsSchema:()=>Po,InitializeRequestSchema:()=>Eo,InitializeResultSchema:()=>wo,InitializedNotificationSchema:()=>To,JSONArraySchema:()=>$n,JSONObjectSchema:()=>tt,JSONRPCErrorResponseSchema:()=>wa,JSONRPCMessageSchema:()=>yo,JSONRPCNotificationSchema:()=>Rr,JSONRPCRequestSchema:()=>br,JSONRPCResponseSchema:()=>Pn,JSONRPCResultResponseSchema:()=>Ea,JSONValueSchema:()=>Lt,LegacyTitledEnumSchemaSchema:()=>Lr,ListChangedOptionsBaseSchema:()=>Tn,ListPromptsRequestSchema:()=>rs,ListPromptsResultSchema:()=>os,ListResourceTemplatesRequestSchema:()=>Ao,ListResourceTemplatesResultSchema:()=>Lo,ListResourcesRequestSchema:()=>ko,ListResourcesResultSchema:()=>Mo,ListRootsRequestSchema:()=>Ws,ListRootsResultSchema:()=>Ys,ListTasksRequestSchema:()=>Mn,ListTasksResultSchema:()=>An,ListToolsRequestSchema:()=>fs,ListToolsResultSchema:()=>gs,LoggingLevelSchema:()=>Bt,LoggingMessageNotificationParamsSchema:()=>Rs,LoggingMessageNotificationSchema:()=>zs,ModelHintSchema:()=>$s,ModelPreferencesSchema:()=>Ps,MultiSelectEnumSchemaSchema:()=>ks,NotificationSchema:()=>gt,NotificationsParamsSchema:()=>ft,NumberSchemaSchema:()=>ka,PaginatedRequestParamsSchema:()=>Io,PaginatedRequestSchema:()=>Ft,PaginatedResultSchema:()=>xt,PingRequestSchema:()=>Er,PrimitiveSchemaDefinitionSchema:()=>Ur,ProgressNotificationParamsSchema:()=>No,ProgressNotificationSchema:()=>wr,ProgressSchema:()=>jo,ProgressTokenSchema:()=>Sr,PromptArgumentSchema:()=>ts,PromptListChangedNotificationSchema:()=>ms,PromptMessageSchema:()=>us,PromptReferenceSchema:()=>xs,PromptSchema:()=>as,ReadResourceRequestParamsSchema:()=>Do,ReadResourceRequestSchema:()=>Vo,ReadResourceResultSchema:()=>Uo,RelatedTaskMetadataSchema:()=>_o,RequestIdSchema:()=>Ut,RequestMetaSchema:()=>yr,RequestSchema:()=>at,ResourceContentsSchema:()=>Tr,ResourceLinkSchema:()=>ls,ResourceListChangedNotificationSchema:()=>Ho,ResourceRequestParamsSchema:()=>Ca,ResourceSchema:()=>jr,ResourceTemplateReferenceSchema:()=>Fs,ResourceTemplateSchema:()=>Oo,ResourceUpdatedNotificationParamsSchema:()=>Qo,ResourceUpdatedNotificationSchema:()=>es,ResultMetaObjectSchema:()=>vr,ResultSchema:()=>rt,RoleSchema:()=>Kt,RootSchema:()=>Js,RootsListChangedNotificationSchema:()=>Zs,SamplingContentSchema:()=>Ts,SamplingMessageContentBlockSchema:()=>ca,SamplingMessageSchema:()=>Cs,ServerCapabilitiesSchema:()=>Pr,ServerNotificationSchema:()=>xn,ServerRequestSchema:()=>Fn,ServerResultSchema:()=>Kn,ServerTasksCapabilitySchema:()=>zo,SetLevelRequestParamsSchema:()=>vs,SetLevelRequestSchema:()=>bs,SingleSelectEnumSchemaSchema:()=>Os,StringSchemaSchema:()=>Oa,SubscribeRequestParamsSchema:()=>Fo,SubscribeRequestSchema:()=>xo,SubscriptionFilterSchema:()=>Nr,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Wo,SubscriptionsAcknowledgedNotificationSchema:()=>Yo,SubscriptionsListenRequestParamsSchema:()=>Go,SubscriptionsListenRequestSchema:()=>Jo,SubscriptionsListenResultMetaSchema:()=>Zo,SubscriptionsListenResultSchema:()=>Xo,TaskAugmentedRequestParamsSchema:()=>ua,TaskCreationParamsSchema:()=>Cn,TaskMetadataSchema:()=>So,TaskSchema:()=>Gt,TaskStatusNotificationParamsSchema:()=>Qs,TaskStatusNotificationSchema:()=>jn,TaskStatusSchema:()=>Xs,TextContentSchema:()=>qa,TextResourceContentsSchema:()=>Cr,TitledMultiSelectEnumSchemaSchema:()=>Vr,TitledSingleSelectEnumSchemaSchema:()=>Ar,ToolAnnotationsSchema:()=>hs,ToolChoiceSchema:()=>Es,ToolExecutionSchema:()=>ps,ToolListChangedNotificationSchema:()=>ys,ToolResultContentSchema:()=>ws,ToolSchema:()=>Ir,ToolUseContentSchema:()=>is,UnsubscribeRequestParamsSchema:()=>Ko,UnsubscribeRequestSchema:()=>Bo,UntitledMultiSelectEnumSchemaSchema:()=>Dr,UntitledSingleSelectEnumSchemaSchema:()=>Mr});var v=(m)=>br.safeParse(m).success,A=(m)=>Rr.safeParse(m).success,ie=(m)=>Ea.safeParse(m).success,me=(m)=>wa.safeParse(m).success;var Yt=(m)=>typeof m==="object"&&m!==null&&!Array.isArray(m)&&m.resultType==="input_required";function pc(m){if(m.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${m.params.ref.type}`)}function fc(m){if(m.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${m.params.ref.type}`)}var Ki="x-mcp-header",yu=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,vu=new Set(["string","integer","boolean","number"]);function gc(m){let h=[],f=new Map,g=(b,_,R)=>{if(b===null||typeof b!=="object")return;let y=b;if(Ki in y){if(!R||_.length===0)return`${ln(_)}: 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 C=y[Ki];if(typeof C!=="string"||C.length===0)return`${ln(_)}: x-mcp-header MUST be a non-empty string`;if(!yu.test(C))return`${ln(_)}: x-mcp-header '${C}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let N=typeof y.type==="string"?y.type:void 0;if(N===void 0||!vu.has(N))return`${ln(_)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${N??"<none>"}`;let J=C.toLowerCase(),W=f.get(J);if(W!==void 0)return`x-mcp-header '${C}' is not case-insensitively unique (also declared as '${W}')`;f.set(J,C),h.push({path:_,headerName:C,type:N})}let P=y.properties;if(P!==null&&typeof P==="object")for(let[C,N]of Object.entries(P)){let J=g(N,[..._,C],R);if(J!==void 0)return J}for(let C of bu){let N=y[C];if(N===void 0)continue;let J=Array.isArray(N)?N:N!==null&&typeof N==="object"&&Ru.has(C)?Object.values(N):[N];for(let W of J){let L=g(W,[..._,`<${C}>`],!1);if(L!==void 0)return L}}},S=g(m,[],!0);return S===void 0?{valid:!0,declarations:h}:{valid:!1,reason:S}}var bu=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],Ru=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function ln(m){return m.length===0?"<root>":m.join(".")}var dn=-32020,sh=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32000],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[i.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:[dn,i.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:[i.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope — and a missing envelope on a request whose protocol-version header names a modern revision — is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[i.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision’s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[i.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:[dn],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The 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’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half — 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–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[i.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced — pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[dn],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool’s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],nh={[i.ParseError]:400,[i.InvalidRequest]:400,[i.MethodNotFound]:404,[i.UnsupportedProtocolVersion]:400,[i.MissingRequiredClientCapability]:400,[dn]:400};function un(m,h,f,g,S){return{kind:"reject",rung:m,cell:h,httpStatus:f,code:g.code,message:g.message,...g.data!==void 0&&{data:g.data},settled:S}}function fe(m){if(!re(m))return!1;let h=oe(m);if(h===void 0||!Va(h))return!1;let f=j(m);return f!==void 0&&se(f).length===0}function $e(m,h){switch(m.reason){case"http-method":return un("http-method","modern-only-method-not-allowed",405,new De(-32000,"Method not allowed."),!0);case"batch":return un("jsonrpc-shape","modern-only-batch-not-supported",400,new De(i.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return un("jsonrpc-shape","modern-only-response-post",400,new De(i.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let f=m.requestedVersion;return un("era-classification","modern-only-missing-envelope",400,f===void 0?new De(i.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...h]}):new H({supported:[...h],requested:f}),!0)}}}function hn(m,h){return ae(m,h)}function Fr(m){return new Set(m.flatMap((h)=>Object.keys(h.shape)))}function Da(m){if(m==null)return!1;let h=typeof m;if(h!=="object"&&h!=="function")return!1;if(!("~standard"in m))return!1;return typeof m["~standard"]?.validate==="function"}var Bi=!1,si="draft-2020-12";function Zt(m,h="input"){let f=m["~standard"],g;if(f.jsonSchema)g=f.jsonSchema[h]({target:si});else if(f.vendor==="zod"){if(!("_zod"in m))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");if(!Bi)Bi=!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.");g=be(m,{target:si,io:h})}else throw Error(`Schema library "${f.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(h==="output"){if(g.type!==void 0)return g;return Sc(g)?{type:"object",...g}:g}if(g.type!==void 0&&g.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(g.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...g}}function Sc(m){if("properties"in m||"patternProperties"in m||"additionalProperties"in m||"required"in m)return!0;for(let h of["oneOf","anyOf","allOf"]){let f=m[h];if(Array.isArray(f)&&f.length>0)return f.every((g)=>g!==null&&typeof g==="object"&&(g.type==="object"||Sc(g)))}return!1}function zu(m){if(!m.path?.length)return m.message;return`${m.path.map((h)=>String(typeof h==="object"?h.key:h)).join(".")}: ${m.message}`}async function da(m,h){let f=await m["~standard"].validate(h);if(f.issues&&f.issues.length>0)return{success:!1,error:f.issues.map((g)=>zu(g)).join(", ")};return{success:!0,data:f.value}}function $u(m){let h=be(m,{target:si,io:"input"});return typeof h.pattern==="string"?h.pattern:void 0}var Pu=/\\\.\\d\{(\d+)\}/;function Eu(m){let h=Pu.exec(m),f=[void 0,-1,0];if(h)f.push(Number(h[1]));return[!1,!0].flatMap((g)=>[!1,!0].flatMap((S)=>f.map((b)=>D({local:g,offset:S,precision:b}))))}function wu(m,h){let f;switch(m){case"email":f=[Oe()];break;case"uri":f=[ce()];break;case"date":f=[ve()];break;case"date-time":f=Eu(h);break}return new Set(f.map((g)=>$u(g)).filter((g)=>g!==void 0))}function Tu(m,h,f){if(f!=="zod")return!0;return wu(m,h).has(h)}function _c(m){let h=Zt(m,"input"),f=h.properties||{},g=h.required||[];return Object.entries(f).map(([S,b])=>({name:S,description:b?.description,required:g.includes(S)}))}function Br(m){return typeof m==="object"&&m!==null&&!Array.isArray(m)}function Cu(m){try{return Zt(m,"input")}catch(h){let f=h instanceof Error?h.message:String(h);throw new De(i.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${f}`)}}var qu=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function vi(m){return qu.has(m)||m.startsWith("x-")}var ju=new Set(["$schema",...Object.keys(Ma.shape.requestedSchema.shape)]),Gi={string:Fr([Oa,Mr,Ar,Lr]),number:Fr([ka]),integer:Fr([ka]),boolean:Fr([kr]),array:Fr([Dr,Vr])},Nu=new Set(Oa.shape.format.unwrap().options);function Iu(m,h,f,g){if(!Br(m))return m;let S=typeof m.type==="string"&&Object.hasOwn(Gi,m.type)?Gi[m.type]:void 0;if(S===void 0)return m;let b={};for(let[_,R]of Object.entries(m))if(S.has(_)||vi(_))b[_]=R;else if(_==="pattern"&&m.type==="string"&&typeof m.format==="string"){if(!Nu.has(m.format))b[_]=R;else if(typeof R!=="string"||!Tu(m.format,R,f))g.push(`${h}.${_}`)}else g.push(`${h}.${_}`);return b}function Ou(m,h){let f={},g=[];for(let[S,b]of Object.entries(m))if(S==="properties"&&Br(b))f[S]=Object.fromEntries(Object.entries(b).map(([_,R])=>[_,Iu(R,`properties.${_}`,h,g)]));else if(ju.has(S))f[S]=b;else if(!vi(S))g.push(S);if(g.length>0)throw new De(i.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${g.join(", ")}`);return f}function ku(m,h){if(!Br(m.properties))return h;let f=Object.entries(m.properties).filter(([,g])=>!hn(Ur,g).success).map(([g])=>`properties.${g}`);return f.length>0?f.join(", "):h}function ni(m,h,f=""){if(Array.isArray(m)&&Array.isArray(h))return m.flatMap((g,S)=>ni(g,h[S],`${f}[${S}]`));if(!Br(m)||!Br(h))return[];return Object.entries(m).flatMap(([g,S])=>{let b=f?`${f}.${g}`:g;if(!Object.prototype.hasOwnProperty.call(h,g))return vi(g)?[]:[b];return ni(S,h[g],b)})}function Mu(m){if(!Da(m.requestedSchema))return{...m,mode:"form",requestedSchema:m.requestedSchema};let h=m.requestedSchema["~standard"].vendor,f=Ou(Cu(m.requestedSchema),h),g=hn(Ma.shape.requestedSchema,f);if(!g.success)throw new De(i.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${ku(f,g.error.message)}`);let S=ni(f,g.data);if(S.length>0)throw new De(i.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${S.join(", ")}`);let b=(g.data.required??[]).filter((_)=>!Object.prototype.hasOwnProperty.call(g.data.properties,_));if(b.length>0)throw new De(i.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${b.join(", ")}`);return{...m,mode:"form",requestedSchema:g.data}}function Au(m){let h=m.inputRequests!==void 0&&Object.keys(m.inputRequests).length>0,f=typeof m.requestState==="string";if(!h&&!f)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...m.inputRequests!==void 0&&{inputRequests:m.inputRequests},...m.requestState!==void 0&&{requestState:m.requestState}}}var ih=Object.assign(Au,{elicit(m){try{return{method:"elicitation/create",params:Mu(m)}}catch(h){throw h instanceof De?TypeError(h.message,{cause:h}):h}},elicitUrl(m){return{method:"elicitation/create",params:{...m,mode:"url"}}},createMessage(m){return{method:"sampling/createMessage",params:m}},listRoots(){return{method:"roots/list"}}});var yc=250;function vc(m,h){return`Multi-round-trip request '${m}' still required input after ${h} rounds (inputRequired.maxRounds)`}function bc(m,h){return new Promise((f,g)=>{if(h?.aborted){g(h.reason instanceof Ke?h.reason:new Ke(Je.RequestTimeout,String(h.reason)));return}let S=setTimeout(()=>{h?.removeEventListener("abort",b),f()},m),b=()=>{clearTimeout(S),g(h?.reason instanceof Ke?h.reason:new Ke(Je.RequestTimeout,String(h?.reason)))};h?.addEventListener("abort",b,{once:!0})})}function Rc(m){let h=new AbortController,f=()=>h.abort(m?.reason);if(m?.addEventListener("abort",f,{once:!0}),m?.aborted)h.abort(m.reason);return{signal:h.signal,abort:(g)=>h.abort(g),dispose:()=>m?.removeEventListener("abort",f)}}var Lu=["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"],Du={IdJagTokenExchangeResponseSchema:Wn,OAuthClientInformationFullSchema:Zn,OAuthClientInformationSchema:rn,OAuthClientMetadataSchema:an,OAuthClientRegistrationErrorSchema:Xn,OAuthErrorResponseSchema:Yn,OAuthMetadataSchema:en,OAuthProtectedResourceMetadataSchema:Bn,OAuthTokenRevocationRequestSchema:Qn,OAuthTokensSchema:Jn,OpenIdProviderDiscoveryMetadataSchema:Gn,OpenIdProviderMetadataSchema:tn},zc={},$c={};function Pc(m,h){let f=m.slice(0,-6);zc[f]=h,$c[f]=(g)=>h.safeParse(g).success}for(let m of Lu)Pc(m,_u[m]);for(let[m,h]of Object.entries(Du))Pc(m,h);var ch=Object.freeze(zc),lh=Object.freeze($c);function Vu(m){switch(m){case"initialize":case"notifications/initialized":return Wt(void 0);case"server/discover":return Wt(Gr);default:return}}var Uu=60000,Hu=[Dt,gr,Vt,la],Fu=["inputResponses","requestState"];function Ji(m,h){let f=m.params;if(!Kr(f))return{message:m,lifted:{}};let g=f._meta,S=Kr(g)?Hu.filter((y)=>(y in g)):[],b=h==="request"?Fu.filter((y)=>(y in f)):[];if(S.length===0&&b.length===0)return{message:m,lifted:{}};let _={},R={...f};if(S.length>0&&Kr(g)){let y={},P={...g};for(let C of S)y[C]=g[C],delete P[C];if(_.envelope=y,Object.keys(P).length>0)R._meta=P;else delete R._meta}for(let y of b){if(y==="inputResponses")_.inputResponses=R[y];if(y==="requestState")_.requestState=R[y];delete R[y]}return{message:{...m,params:R},lifted:_}}function Wi(m,h){let f=m.validateResult(h,void 0);if(!f.ok&&f.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(g){let S=m.validateResult(h,g);if(S.ok)return{value:S.value};return{issues:[{message:S.reason==="invalid"?S.message:`not-in-era: ${h}`}]}}}}}function Jr(m){return()=>m}var xu=Jr(void 0);function bi(m,h){return{...m,mcpReq:{...m.mcpReq,requestState:Jr(h)}}}var Ec;function Ce(m,h){Ec(m,h)}var wc=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{Ec=(m,h)=>{m._negotiatedProtocolVersion=h}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(m){this._options=m,this._supportedProtocolVersions=m?.supportedProtocolVersions??Rn,this.setNotificationHandler("notifications/cancelled",(h)=>{this._oncancel(h)}),this.setNotificationHandler("notifications/progress",(h)=>{this._onprogress(h)}),this.setRequestHandler("ping",(h)=>({}))}_shouldDropInbound(m){}_outboundMetaEnvelope(){}_envelopeOutbound(m){let h=this._outboundMetaEnvelope();if(h===void 0)return m;let f=m.params??{};return{...m,params:{...f,_meta:{...h,...f._meta}}}}_resolveNonCompleteResult(m,h){return Promise.reject(new Ke(Je.UnsupportedResultType,`Unsupported result type '${m.kind}' for ${h.request.method}`,{resultType:m.kind,method:h.request.method}))}_getRequestHandler(m){return this._requestHandlers.get(m)}async _oncancel(m){if(m.params.requestId===void 0)return;this._requestHandlerAbortControllers.get(m.params.requestId)?.abort(m.params.reason)}_setupTimeout(m,h,f,g,S=!1){this._timeoutInfo.set(m,{timeoutId:setTimeout(g,h),startTime:Date.now(),timeout:h,maxTotalTimeout:f,resetTimeoutOnProgress:S,onTimeout:g})}_resetTimeout(m){let h=this._timeoutInfo.get(m);if(!h)return!1;let f=Date.now()-h.startTime;if(h.maxTotalTimeout&&f>=h.maxTotalTimeout)throw this._timeoutInfo.delete(m),new Ke(Je.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:h.maxTotalTimeout,totalElapsed:f});return clearTimeout(h.timeoutId),h.timeoutId=setTimeout(h.onTimeout,h.timeout),!0}_cleanupTimeout(m){let h=this._timeoutInfo.get(m);if(h)clearTimeout(h.timeoutId),this._timeoutInfo.delete(m)}async connect(m){this._transport=m;let h=this.transport?.onclose;this._transport.onclose=()=>{try{h?.()}finally{this._onclose()}};let f=this.transport?.onerror;this._transport.onerror=(S)=>{f?.(S),this._onerror(S)};let g=this._transport?.onmessage;this._transport.onmessage=(S,b)=>{if(g?.(S,b),ie(S)||me(S))this._onresponse(S);else if(v(S))this._onrequest(S,b);else if(A(S))this._onnotification(S,b);else this._onerror(Error(`Unknown message type: ${JSON.stringify(S)}`))},m.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let m=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let g of this._timeoutInfo.values())clearTimeout(g.timeoutId);this._timeoutInfo.clear();let h=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let f=new Ke(Je.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let g of m.values())g(f);for(let g of h.values())g.abort(f)}}_onerror(m){this.onerror?.(m)}_onnotification(m,h){let{message:f}=Ji(m,"notification"),g=this._negotiatedWireCodec();if(h?.classification===void 0&&this._shouldDropInbound(m)==="drop")return;if(h?.classification!==void 0){let _=Fi(h.classification);if(_!==g.era){this._onerror(Error(`Era mismatch on inbound notification '${f.method}': classified as ${_} but this instance serves ${g.era}`));return}}if(ai(f.method)&&!g.hasNotificationMethod(f.method))return;let S=this._notificationHandlers.get(f.method),b=this.fallbackNotificationHandler;if(S===void 0&&b===void 0)return;Promise.resolve().then(()=>S===void 0?b(f):S(f,g)).catch((_)=>this._onerror(Error(`Uncaught error in notification handler: ${_}`)))}_onrequest(m,h){let{message:f,lifted:g}=Ji(m,"request"),S=this._negotiatedWireCodec();if(h?.classification===void 0&&this._shouldDropInbound(m)==="drop"){this._onerror(Error(`Dropped inbound request '${m.method}': not servable on this connection's protocol era`));return}let b=this._transport,_=(K,I,z)=>{let F={jsonrpc:"2.0",id:f.id,error:{code:K,message:I,...z!==void 0&&{data:z}}};b?.send(F).catch((w)=>this._onerror(Error(`Failed to send an error response: ${w}`)))};if(h?.classification!==void 0){let K=Fi(h.classification);if(K!==S.era){this._onerror(Error(`Era mismatch on inbound request '${f.method}': classified as ${K} but this instance serves ${S.era}`));let I=h.classification.revision??K;_(i.UnsupportedProtocolVersion,`Unsupported protocol version: ${I}`,{supported:this._supportedProtocolVersions,requested:I});return}}if(ti(f.method)&&!S.hasRequestMethod(f.method)){_(i.MethodNotFound,"Method not found");return}let R=this._requestHandlers.get(f.method)??this.fallbackRequestHandler;if(R===void 0){_(i.MethodNotFound,"Method not found");return}let y=S.checkInboundEnvelope(g);if(y!==void 0){_(i.InvalidParams,y);return}let P=(K,I)=>this._notificationViaCodec(this._resolveOutboundCodec(K.method),K,{...I,relatedRequestId:f.id}),C=(K,I,z)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(K.method),K,I,{...z,relatedRequestId:f.id}),N=new AbortController;this._requestHandlerAbortControllers.set(f.id,N);let J=g.inputResponses===void 0?void 0:Ku(g.inputResponses),W={sessionId:b?.sessionId,mcpReq:{id:f.id,method:f.method,_meta:f.params?._meta,...g.envelope!==void 0&&{envelope:g.envelope},...J!==void 0&&{inputResponses:J.accepted},...J!==void 0&&J.droppedKeys.length>0&&{droppedInputResponseKeys:J.droppedKeys},requestState:g.requestState===void 0?xu:Jr(g.requestState),signal:N.signal,send:(K,I,z)=>{let F=this._resolveOutboundCodec(K.method);if(this._assertOutboundRequestInEra(F,K.method),Da(I))return C(K,I,z);let w=Wi(F,K.method);if(w===void 0)throw TypeError(`'${K.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return C(K,w,I)},notify:P},http:h?.authInfo?{authInfo:h.authInfo}:void 0},L=this.buildContext(W,h);Promise.resolve().then(()=>R(f,L)).then(async(K)=>{if(N.signal.aborted)return;let I;try{I=S.encodeResult(f.method,K,this._outboundServerInfo())}catch(F){this._onerror(Error(`Failed to encode result for ${f.method}: ${F}`)),_(i.InternalError,"Internal error");return}let z={result:I,jsonrpc:"2.0",id:f.id};await b?.send(z)},async(K)=>{if(N.signal.aborted)return;let I=Number.isSafeInteger(K.code)?K.code:i.InternalError,z={jsonrpc:"2.0",id:f.id,error:{code:S.encodeErrorCode(I),message:K.message??"Internal error",...K.data!==void 0&&{data:K.data}}};await b?.send(z)}).catch((K)=>this._onerror(Error(`Failed to send response: ${K}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(f.id)===N)this._requestHandlerAbortControllers.delete(f.id)})}_onprogress(m){let{progressToken:h,...f}=m.params,g=Number(h),S=this._progressHandlers.get(g);if(!S){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(m)}`));return}let b=this._responseHandlers.get(g),_=this._timeoutInfo.get(g);if(_&&b&&_.resetTimeoutOnProgress)try{this._resetTimeout(g)}catch(R){this._responseHandlers.delete(g),this._progressHandlers.delete(g),this._cleanupTimeout(g),b(R);return}S(f)}_onresponse(m){let h=Number(m.id),f=this._responseHandlers.get(h);if(f===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(m)}`));return}if(this._responseHandlers.delete(h),this._cleanupTimeout(h),this._progressHandlers.delete(h),ie(m))f(m);else f(De.fromError(m.error.code,m.error.message,m.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(m,h,f){let g=this._resolveOutboundCodec(m.method);if(this._assertOutboundRequestInEra(g,m.method),Da(h))return this._requestWithSchemaViaCodec(g,m,h,f);let S=Wi(g,m.method);if(S===void 0)throw TypeError(`'${m.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(g,m,S,h)}_negotiatedWireCodec(){return Wt(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(m){if(this._negotiatedProtocolVersion===void 0){let h=Vu(m);if(h)return h}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(m,h){if(ti(h)&&!m.hasRequestMethod(h))throw new Ke(Je.MethodNotSupportedByProtocolVersion,`Method '${h}' is not supported by the negotiated protocol version (wire era ${m.era})`,{method:h,era:m.era})}_requestWithSchema(m,h,f){let g=this._resolveOutboundCodec(m.method);return this._assertOutboundRequestInEra(g,m.method),this._requestWithSchemaViaCodec(g,m,h,f)}_requestWithSchemaViaCodec(m,h,f,g){let{relatedRequestId:S,resumptionToken:b,onresumptiontoken:_,headers:R}=g??{},y=Date.now(),P,C;return new Promise((N,J)=>{let W=(U)=>{J(U)};if(!this._transport){W(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(h.method)}catch(U){W(U);return}if(g?.signal?.aborted){let U=g.signal.reason;throw U instanceof Ke?U:new Ke(Je.RequestTimeout,String(U))}let L=m.era===Gr&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,K=this._requestMessageId++;C=K;let I={...h,jsonrpc:"2.0",id:K};if(g?.onprogress)this._progressHandlers.set(K,g.onprogress),I.params={...h.params,_meta:{...h.params?._meta,progressToken:K}};let z=this._envelopeOutbound(I),F=!1,w=(U)=>{if(F)return;if(this._progressHandlers.delete(K),L===void 0){if(h.method!=="initialize")this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:K,reason:String(U)}}),{relatedRequestId:S,resumptionToken:b,onresumptiontoken:_}).catch((T)=>this._onerror(Error(`Failed to send cancellation: ${T}`)))}else L.abort();J(U instanceof Ke?U:new Ke(Je.RequestTimeout,String(U)))};this._responseHandlers.set(K,(U)=>{if(g?.signal?.aborted)return;if(F=!0,U instanceof Error)return J(U);let T;try{T=m.decodeResult(h.method,U.result)}catch(de){return J(de instanceof Error?de:Error(String(de)))}if(T.kind==="invalid")return J(T.error);if(T.kind==="input_required"){if(g?.allowInputRequired===!0)return N(Bu(T));let de={codec:m,request:h,resultSchema:f,options:g,flowStartedAt:y,retry:(we,pe)=>this._requestWithSchemaViaCodec(m,we===void 0?{method:h.method}:{method:h.method,params:we},f,pe)};return N(this._resolveNonCompleteResult(T,de))}let Z=T.result;da(f,Z).then((de)=>{if(de.success)N(de.data);else J(new Ke(Je.InvalidResult,`Invalid result for ${h.method}: ${de.error}`))},J)}),P=()=>w(g?.signal?.reason),g?.signal?.addEventListener("abort",P,{once:!0});let B=g?.timeout??Uu,Y=()=>w(new Ke(Je.RequestTimeout,"Request timed out",{timeout:B}));this._setupTimeout(K,B,g?.maxTotalTimeout,Y,g?.resetTimeoutOnProgress??!1),this._transport.send(z,{relatedRequestId:S,resumptionToken:b,onresumptiontoken:_,headers:R,requestSignal:L?.signal}).catch((U)=>{this._progressHandlers.delete(K),J(U)})}).finally(()=>{if(P)g?.signal?.removeEventListener("abort",P);if(C!==void 0)this._responseHandlers.delete(C),this._cleanupTimeout(C)})}async notification(m,h){return await this._notificationViaCodec(this._resolveOutboundCodec(m.method),m,h)}async _notificationViaCodec(m,h,f){if(!this._transport)throw new Ke(Je.NotConnected,"Not connected");if(ai(h.method)&&!m.hasNotificationMethod(h.method))throw new Ke(Je.MethodNotSupportedByProtocolVersion,`Notification '${h.method}' is not supported by the negotiated protocol version (wire era ${m.era})`,{method:h.method,era:m.era});this.assertNotificationCapability(h.method);let g=this._envelopeOutbound({jsonrpc:"2.0",...h});if((this._options?.debouncedNotificationMethods??[]).includes(h.method)&&!h.params&&f?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(h.method))return;this._pendingDebouncedNotifications.add(h.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(h.method),!this._transport)return;this._transport?.send(g,f).catch((S)=>this._onerror(S))});return}await this._transport.send(g,f)}setRequestHandler(m,h,f){this.assertRequestHandlerCapability(m);let g;if(typeof h==="function"){if(!ti(m))throw TypeError(`'${m}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);g=(S,b)=>{let _=this._negotiatedWireCodec(),R=_.validateRequest(m,S);if(!R.ok&&R.reason==="not-in-era")R=_.validateInputRequest(m,S);if(!R.ok){if(R.reason==="not-in-era")throw new De(i.InternalError,`No wire schema for ${m} in the resolved era`);throw Error(R.message)}return Promise.resolve(h(R.value,b))}}else if(f)g=async(S,b)=>{let _=await da(h.params,{...S.params});if(!_.success)throw new De(i.InvalidParams,`Invalid params for ${m}: ${_.error}`);return f(_.data,b)};else throw TypeError("setRequestHandler: handler is required");this._requestHandlers.set(m,this._wrapHandler(m,g))}_wrapHandler(m,h){return h}_outboundServerInfo(){}removeRequestHandler(m){this._requestHandlers.delete(m)}assertCanSetRequestHandler(m){if(this._requestHandlers.has(m))throw Error(`A request handler for ${m} already exists, which would be overridden`)}setNotificationHandler(m,h,f){if(typeof h==="function"){if(!ai(m))throw TypeError(`'${m}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(m,(g,S)=>{let b=S.validateNotification(m,g);if(!b.ok){if(b.reason==="not-in-era")throw new De(i.InternalError,`No wire schema for ${m} in the resolved era`);throw Error(b.message)}return Promise.resolve(h(b.value))});return}if(!f)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(m,async(g)=>{let S=await da(h.params,{...g.params});if(!S.success)throw new De(i.InvalidParams,`Invalid params for notification ${m}: ${S.error}`);await f(S.data,g)})}removeNotificationHandler(m){this._notificationHandlers.delete(m)}};function Kr(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function Tc(m,h){let f={...m};for(let g in h){let S=g,b=h[S];if(b===void 0)continue;let _=f[S];f[S]=Kr(_)&&Kr(b)?{..._,...b}:b}return f}function Yi(m){return typeof m==="object"&&m!==null&&!Array.isArray(m)}function Ku(m){let h={},f=[];if(!Yi(m))return{accepted:h,droppedKeys:f};for(let[g,S]of Object.entries(m)){if(!Yi(S)||"method"in S||"result"in S){f.push(g);continue}h[g]=S}return{accepted:h,droppedKeys:f}}function Bu(m){return{resultType:"input_required",inputRequests:m.inputRequests,...m.requestState!==void 0&&{requestState:m.requestState},...m._meta!==void 0&&{_meta:m._meta}}}/*!
|
|
2
2
|
* content-type
|
|
3
3
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
4
4
|
* MIT Licensed
|
|
5
|
-
*/var Gu=
|
|
5
|
+
*/var Gu=_e((m)=>{var h=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,f=/\\([\u000b\u0020-\u00ff])/g,g=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;m.parse=S;function S(R){if(!R)throw TypeError("argument string is required");var y=typeof R==="object"?b(R):R;if(typeof y!=="string")throw TypeError("argument string is required to be a string");var P=y.indexOf(";"),C=P!==-1?y.slice(0,P).trim():y.trim();if(!g.test(C))throw TypeError("invalid media type");var N=new _(C.toLowerCase());if(P!==-1){var J,W,L;h.lastIndex=P;while(W=h.exec(y)){if(W.index!==P)throw TypeError("invalid parameter format");if(P+=W[0].length,J=W[1].toLowerCase(),L=W[2],L.charCodeAt(0)===34){if(L=L.slice(1,-1),L.indexOf("\\")!==-1)L=L.replace(f,"$1")}N.parameters[J]=L}if(P!==y.length)throw TypeError("invalid parameter format")}return N}function b(R){var y;if(typeof R.getHeader==="function")y=R.getHeader("content-type");else if(typeof R.headers==="object")y=R.headers&&R.headers["content-type"];if(typeof y!=="string")throw TypeError("content-type header is missing from object");return y}function _(R){this.parameters=Object.create(null),this.type=R}}),uh=go(Gu(),1);var Ju=10485760,Ee=class{_buffer;_maxBufferSize;constructor(m){this._maxBufferSize=m?.maxBufferSize??Ju}append(m){if((this._buffer?.length??0)+m.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,m]):m}readMessage(){while(this._buffer){let m=this._buffer.indexOf(`
|
|
6
6
|
`);if(m===-1)return null;let h=this._buffer.toString("utf8",0,m).replace(/\r$/,"");this._buffer=this._buffer.subarray(m+1);try{return Wu(h)}catch(f){if(f instanceof SyntaxError)continue;throw f}}return null}clear(){this._buffer=void 0}};function Wu(m){return yo.parse(JSON.parse(m))}function ke(m){return JSON.stringify(m)+`
|
|
7
|
-
`}var Yu=/^[A-Za-z0-9._-]{1,128}$/;function Zu(m){let h=[];if(m.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(m.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${m.length})`]};if(m.includes(" "))h.push("Tool name contains spaces, which may cause parsing issues");if(m.includes(","))h.push("Tool name contains commas, which may cause parsing issues");if(m.startsWith("-")||m.endsWith("-"))h.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(m.startsWith(".")||m.endsWith("."))h.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Yu.test(m)){let f=[...m].filter((g)=>!/[A-Za-z0-9._-]/.test(g)).filter((g,S,b)=>b.indexOf(g)===S);return h.push(`Tool name contains invalid characters: ${f.map((g)=>`"${g}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:h}}return{isValid:!0,warnings:h}}function Xu(m,h){if(h.length>0){console.warn(`Tool name validation warning for "${m}":`);for(let f of h)console.warn(` - ${f}`);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 Ri(m){let h=Zu(m);return Xu(m,h.warnings),h.isValid}function Qu(m){return typeof m==="object"&&m!==null&&"_zod"in m}function ed(m){return typeof m==="object"&&m!==null&&!("_zod"in m)&&"_def"in m&&typeof m._def?.typeName==="string"}function td(m){if(typeof m!=="object"||m===null)return!1;if(Da(m))return!1;let h=Object.getPrototypeOf(m);if(h!==Object.prototype&&h!==null)return!1;return Object.values(m).every((f)=>Qu(f))}function pn(m){if(m===void 0)return;if(td(m))return t(m);if(typeof m==="object"&&m!==null&&!Da(m)&&Object.values(m).some((h)=>ed(h)))throw 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(!Da(m))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return m}var fn=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.regexpCode=m.getEsmExportName=m.getProperty=m.safeStringify=m.stringify=m.strConcat=m.addCodeArg=m.str=m._=m.nil=m._Code=m.Name=m.IDENTIFIER=m._CodeOrName=void 0;var h=class{};m._CodeOrName=h,m.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var f=class extends h{constructor(z){super();if(!m.IDENTIFIER.test(z))throw Error("CodeGen: name must be a valid identifier");this.str=z}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};m.Name=f;var g=class extends h{constructor(z){super();this._items=typeof z==="string"?[z]:z}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let z=this._items[0];return z===""||z==='""'}get str(){var z;return(z=this._str)!==null&&z!==void 0?z:this._str=this._items.reduce((F,w)=>`${F}${w}`,"")}get names(){var z;return(z=this._names)!==null&&z!==void 0?z:this._names=this._items.reduce((F,w)=>{if(w instanceof f)F[w.str]=(F[w.str]||0)+1;return F},{})}};m._Code=g,m.nil=new g("");function S(z,...F){let w=[z[0]],B=0;while(B<F.length)R(w,F[B]),w.push(z[++B]);return new g(w)}m._=S;let b=new g("+");function _(z,...F){let w=[W(z[0])],B=0;while(B<F.length)w.push(b),R(w,F[B]),w.push(b,W(z[++B]));return y(w),new g(w)}m.str=_;function R(z,F){if(F instanceof g)z.push(...F._items);else if(F instanceof f)z.push(F);else z.push(N(F))}m.addCodeArg=R;function y(z){let F=1;while(F<z.length-1){if(z[F]===b){let w=P(z[F-1],z[F+1]);if(w!==void 0){z.splice(F-1,3,w);continue}z[F++]="+"}F++}}function P(z,F){if(F==='""')return z;if(z==='""')return F;if(typeof z=="string"){if(F instanceof f||z[z.length-1]!=='"')return;if(typeof F!="string")return`${z.slice(0,-1)}${F}"`;if(F[0]==='"')return z.slice(0,-1)+F.slice(1);return}if(typeof F=="string"&&F[0]==='"'&&!(z instanceof f))return`"${z}${F.slice(1)}`}function C(z,F){return F.emptyStr()?z:z.emptyStr()?F:_`${z}${F}`}m.strConcat=C;function N(z){return typeof z=="number"||typeof z=="boolean"||z===null?z:W(Array.isArray(z)?z.join(","):z)}function J(z){return new g(W(z))}m.stringify=J;function W(z){return JSON.stringify(z).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}m.safeStringify=W;function L(z){return typeof z=="string"&&m.IDENTIFIER.test(z)?new g(`.${z}`):S`[${z}]`}m.getProperty=L;function K(z){if(typeof z=="string"&&m.IDENTIFIER.test(z))return new g(`${z}`);throw Error(`CodeGen: invalid export name: ${z}, use explicit $id name mapping`)}m.getEsmExportName=K;function I(z){return new g(z.toString())}m.regexpCode=I}),Cc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.ValueScope=m.ValueScopeName=m.Scope=m.varKinds=m.UsedValueState=void 0;let h=fn();var f=class extends Error{constructor(y){super(`CodeGen: "code" for ${y} not defined`);this.value=y.value}},g;(function(y){y[y.Started=0]="Started",y[y.Completed=1]="Completed"})(g||(m.UsedValueState=g={})),m.varKinds={const:new h.Name("const"),let:new h.Name("let"),var:new h.Name("var")};var S=class{constructor({prefixes:y,parent:P}={}){this._names={},this._prefixes=y,this._parent=P}toName(y){return y instanceof h.Name?y:this.name(y)}name(y){return new h.Name(this._newName(y))}_newName(y){let P=this._names[y]||this._nameGroup(y);return`${y}${P.index++}`}_nameGroup(y){var P,C;if(((C=(P=this._parent)===null||P===void 0?void 0:P._prefixes)===null||C===void 0?void 0:C.has(y))||this._prefixes&&!this._prefixes.has(y))throw Error(`CodeGen: prefix "${y}" is not allowed in this scope`);return this._names[y]={prefix:y,index:0}}};m.Scope=S;var b=class extends h.Name{constructor(y,P){super(P);this.prefix=y}setValue(y,{property:P,itemIndex:C}){this.value=y,this.scopePath=h._`.${new h.Name(P)}[${C}]`}};m.ValueScopeName=b;let _=h._`\n`;var R=class extends S{constructor(y){super(y);this._values={},this._scope=y.scope,this.opts={...y,_n:y.lines?_:h.nil}}get(){return this._scope}name(y){return new b(y,this._newName(y))}value(y,P){var C;if(P.ref===void 0)throw Error("CodeGen: ref must be passed in value");let N=this.toName(y),{prefix:J}=N,W=(C=P.key)!==null&&C!==void 0?C:P.ref,L=this._values[J];if(L){let z=L.get(W);if(z)return z}else L=this._values[J]=new Map;L.set(W,N);let K=this._scope[J]||(this._scope[J]=[]),I=K.length;return K[I]=P.ref,N.setValue(P,{property:J,itemIndex:I}),N}getValue(y,P){let C=this._values[y];if(!C)return;return C.get(P)}scopeRefs(y,P=this._values){return this._reduceValues(P,(C)=>{if(C.scopePath===void 0)throw Error(`CodeGen: name "${C}" has no value`);return h._`${y}${C.scopePath}`})}scopeCode(y=this._values,P,C){return this._reduceValues(y,(N)=>{if(N.value===void 0)throw Error(`CodeGen: name "${N}" has no value`);return N.value.code},P,C)}_reduceValues(y,P,C={},N){let J=h.nil;for(let W in y){let L=y[W];if(!L)continue;let K=C[W]=C[W]||new Map;L.forEach((I)=>{if(K.has(I))return;K.set(I,g.Started);let z=P(I);if(z){let F=this.opts.es5?m.varKinds.var:m.varKinds.const;J=h._`${J}${F} ${I} = ${z};${this.opts._n}`}else if(z=N===null||N===void 0?void 0:N(I))J=h._`${J}${z}${this.opts._n}`;else throw new f(I);K.set(I,g.Completed)})}return J}};m.ValueScope=R}),He=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.or=m.and=m.not=m.CodeGen=m.operators=m.varKinds=m.ValueScopeName=m.ValueScope=m.Scope=m.Name=m.regexpCode=m.stringify=m.getProperty=m.nil=m.strConcat=m.str=m._=void 0;let h=fn(),f=Cc();var g=fn();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(m,"strConcat",{enumerable:!0,get:function(){return g.strConcat}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(m,"getProperty",{enumerable:!0,get:function(){return g.getProperty}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(m,"regexpCode",{enumerable:!0,get:function(){return g.regexpCode}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return g.Name}});var S=Cc();Object.defineProperty(m,"Scope",{enumerable:!0,get:function(){return S.Scope}}),Object.defineProperty(m,"ValueScope",{enumerable:!0,get:function(){return S.ValueScope}}),Object.defineProperty(m,"ValueScopeName",{enumerable:!0,get:function(){return S.ValueScopeName}}),Object.defineProperty(m,"varKinds",{enumerable:!0,get:function(){return S.varKinds}}),m.operators={GT:new h._Code(">"),GTE:new h._Code(">="),LT:new h._Code("<"),LTE:new h._Code("<="),EQ:new h._Code("==="),NEQ:new h._Code("!=="),NOT:new h._Code("!"),OR:new h._Code("||"),AND:new h._Code("&&"),ADD:new h._Code("+")};var b=class{optimizeNodes(){return this}optimizeNames(G,Q){return this}},_=class extends b{constructor(G,Q,te){super();this.varKind=G,this.name=Q,this.rhs=te}render({es5:G,_n:Q}){let te=G?f.varKinds.var:this.varKind,je=this.rhs===void 0?"":` = ${this.rhs}`;return`${te} ${this.name}${je};`+Q}optimizeNames(G,Q){if(!G[this.name.str])return;if(this.rhs)this.rhs=Ne(this.rhs,G,Q);return this}get names(){return this.rhs instanceof h._CodeOrName?this.rhs.names:{}}},R=class extends b{constructor(G,Q,te){super();this.lhs=G,this.rhs=Q,this.sideEffects=te}render({_n:G}){return`${this.lhs} = ${this.rhs};`+G}optimizeNames(G,Q){if(this.lhs instanceof h.Name&&!G[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Ne(this.rhs,G,Q),this}get names(){return Ie(this.lhs instanceof h.Name?{}:{...this.lhs.names},this.rhs)}},y=class extends R{constructor(G,Q,te,je){super(G,te,je);this.op=Q}render({_n:G}){return`${this.lhs} ${this.op}= ${this.rhs};`+G}},P=class extends b{constructor(G){super();this.label=G,this.names={}}render({_n:G}){return`${this.label}:`+G}},C=class extends b{constructor(G){super();this.label=G,this.names={}}render({_n:G}){return`break${this.label?` ${this.label}`:""};`+G}},N=class extends b{constructor(G){super();this.error=G}render({_n:G}){return`throw ${this.error};`+G}get names(){return this.error.names}},J=class extends b{constructor(G){super();this.code=G}render({_n:G}){return`${this.code};`+G}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(G,Q){return this.code=Ne(this.code,G,Q),this}get names(){return this.code instanceof h._CodeOrName?this.code.names:{}}},W=class extends b{constructor(G=[]){super();this.nodes=G}render(G){return this.nodes.reduce((Q,te)=>Q+te.render(G),"")}optimizeNodes(){let{nodes:G}=this,Q=G.length;while(Q--){let te=G[Q].optimizeNodes();if(Array.isArray(te))G.splice(Q,1,...te);else if(te)G[Q]=te;else G.splice(Q,1)}return G.length>0?this:void 0}optimizeNames(G,Q){let{nodes:te}=this,je=te.length;while(je--){let Me=te[je];if(Me.optimizeNames(G,Q))continue;Ge(G,Me.names),te.splice(je,1)}return te.length>0?this:void 0}get names(){return this.nodes.reduce((G,Q)=>ve(G,Q.names),{})}},L=class extends W{render(G){return"{"+G._n+super.render(G)+"}"+G._n}},K=class extends W{},I=class extends L{};I.kind="else";var z=class G extends L{constructor(Q,te){super(te);this.condition=Q}render(Q){let te=`if(${this.condition})`+super.render(Q);if(this.else)te+="else "+this.else.render(Q);return te}optimizeNodes(){super.optimizeNodes();let Q=this.condition;if(Q===!0)return this.nodes;let te=this.else;if(te){let je=te.optimizeNodes();te=this.else=Array.isArray(je)?new I(je):je}if(te){if(Q===!1)return te instanceof G?te:te.nodes;if(this.nodes.length)return this;return new G(Qe(Q),te instanceof G?[te]:te.nodes)}if(Q===!1||!this.nodes.length)return;return this}optimizeNames(Q,te){var je;if(this.else=(je=this.else)===null||je===void 0?void 0:je.optimizeNames(Q,te),!(super.optimizeNames(Q,te)||this.else))return;return this.condition=Ne(this.condition,Q,te),this}get names(){let Q=super.names;if(Ie(Q,this.condition),this.else)ve(Q,this.else.names);return Q}};z.kind="if";var F=class extends L{};F.kind="for";var w=class extends F{constructor(G){super();this.iteration=G}render(G){return`for(${this.iteration})`+super.render(G)}optimizeNames(G,Q){if(!super.optimizeNames(G,Q))return;return this.iteration=Ne(this.iteration,G,Q),this}get names(){return ve(super.names,this.iteration.names)}},B=class extends F{constructor(G,Q,te,je){super();this.varKind=G,this.name=Q,this.from=te,this.to=je}render(G){let Q=G.es5?f.varKinds.var:this.varKind,{name:te,from:je,to:Me}=this;return`for(${Q} ${te}=${je}; ${te}<${Me}; ${te}++)`+super.render(G)}get names(){return Ie(Ie(super.names,this.from),this.to)}},Y=class extends F{constructor(G,Q,te,je){super();this.loop=G,this.varKind=Q,this.name=te,this.iterable=je}render(G){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(G)}optimizeNames(G,Q){if(!super.optimizeNames(G,Q))return;return this.iterable=Ne(this.iterable,G,Q),this}get names(){return ve(super.names,this.iterable.names)}},U=class extends L{constructor(G,Q,te){super();this.name=G,this.args=Q,this.async=te}render(G){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(G)}};U.kind="func";var T=class extends W{render(G){return"return "+super.render(G)}};T.kind="return";var Z=class extends L{render(G){let Q="try"+super.render(G);if(this.catch)Q+=this.catch.render(G);if(this.finally)Q+=this.finally.render(G);return Q}optimizeNodes(){var G,Q;return super.optimizeNodes(),(G=this.catch)===null||G===void 0||G.optimizeNodes(),(Q=this.finally)===null||Q===void 0||Q.optimizeNodes(),this}optimizeNames(G,Q){var te,je;return super.optimizeNames(G,Q),(te=this.catch)===null||te===void 0||te.optimizeNames(G,Q),(je=this.finally)===null||je===void 0||je.optimizeNames(G,Q),this}get names(){let G=super.names;if(this.catch)ve(G,this.catch.names);if(this.finally)ve(G,this.finally.names);return G}},de=class extends L{constructor(G){super();this.error=G}render(G){return`catch(${this.error})`+super.render(G)}};de.kind="catch";var qe=class extends L{render(G){return"finally"+super.render(G)}};qe.kind="finally";var ge=class{constructor(G,Q={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...Q,_n:Q.lines?`
|
|
8
|
-
`:""},this._extScope=G,this._scope=new f.Scope({parent:G}),this._nodes=[new K]}toString(){return this._root.render(this.opts)}name(G){return this._scope.name(G)}scopeName(G){return this._extScope.name(G)}scopeValue(G,Q){let te=this._extScope.value(G,Q);return(this._values[te.prefix]||(this._values[te.prefix]=new Set)).add(te),te}getScopeValue(G,Q){return this._extScope.getValue(G,Q)}scopeRefs(G){return this._extScope.scopeRefs(G,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(G,Q,te,je){let Me=this._scope.toName(Q);if(te!==void 0&&je)this._constants[Me.str]=te;return this._leafNode(new _(G,Me,te)),Me}const(G,Q,te){return this._def(f.varKinds.const,G,Q,te)}let(G,Q,te){return this._def(f.varKinds.let,G,Q,te)}var(G,Q,te){return this._def(f.varKinds.var,G,Q,te)}assign(G,Q,te){return this._leafNode(new R(G,Q,te))}add(G,Q){return this._leafNode(new y(G,m.operators.ADD,Q))}code(G){if(typeof G=="function")G();else if(G!==h.nil)this._leafNode(new J(G));return this}object(...G){let Q=["{"];for(let[te,je]of G){if(Q.length>1)Q.push(",");if(Q.push(te),te!==je||this.opts.es5)Q.push(":"),(0,h.addCodeArg)(Q,je)}return Q.push("}"),new h._Code(Q)}if(G,Q,te){if(this._blockNode(new z(G)),Q&&te)this.code(Q).else().code(te).endIf();else if(Q)this.code(Q).endIf();else if(te)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(G){return this._elseNode(new z(G))}else(){return this._elseNode(new I)}endIf(){return this._endBlockNode(z,I)}_for(G,Q){if(this._blockNode(G),Q)this.code(Q).endFor();return this}for(G,Q){return this._for(new w(G),Q)}forRange(G,Q,te,je,Me=this.opts.es5?f.varKinds.var:f.varKinds.let){let Be=this._scope.toName(G);return this._for(new B(Me,Be,Q,te),()=>je(Be))}forOf(G,Q,te,je=f.varKinds.const){let Me=this._scope.toName(G);if(this.opts.es5){let Be=Q instanceof h.Name?Q:this.var("_arr",Q);return this.forRange("_i",0,h._`${Be}.length`,(Ue)=>{this.var(Me,h._`${Be}[${Ue}]`),te(Me)})}return this._for(new Y("of",je,Me,Q),()=>te(Me))}forIn(G,Q,te,je=this.opts.es5?f.varKinds.var:f.varKinds.const){if(this.opts.ownProperties)return this.forOf(G,h._`Object.keys(${Q})`,te);let Me=this._scope.toName(G);return this._for(new Y("in",je,Me,Q),()=>te(Me))}endFor(){return this._endBlockNode(F)}label(G){return this._leafNode(new P(G))}break(G){return this._leafNode(new C(G))}return(G){let Q=new T;if(this._blockNode(Q),this.code(G),Q.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(T)}try(G,Q,te){if(!Q&&!te)throw Error('CodeGen: "try" without "catch" and "finally"');let je=new Z;if(this._blockNode(je),this.code(G),Q){let Me=this.name("e");this._currNode=je.catch=new de(Me),Q(Me)}if(te)this._currNode=je.finally=new qe,this.code(te);return this._endBlockNode(de,qe)}throw(G){return this._leafNode(new N(G))}block(G,Q){if(this._blockStarts.push(this._nodes.length),G)this.code(G).endBlock(Q);return this}endBlock(G){let Q=this._blockStarts.pop();if(Q===void 0)throw Error("CodeGen: not in self-balancing block");let te=this._nodes.length-Q;if(te<0||G!==void 0&&te!==G)throw Error(`CodeGen: wrong number of nodes: ${te} vs ${G} expected`);return this._nodes.length=Q,this}func(G,Q=h.nil,te,je){if(this._blockNode(new U(G,Q,te)),je)this.code(je).endFunc();return this}endFunc(){return this._endBlockNode(U)}optimize(G=1){while(G-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(G){return this._currNode.nodes.push(G),this}_blockNode(G){this._currNode.nodes.push(G),this._nodes.push(G)}_endBlockNode(G,Q){let te=this._currNode;if(te instanceof G||Q&&te instanceof Q)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${Q?`${G.kind}/${Q.kind}`:G.kind}"`)}_elseNode(G){let Q=this._currNode;if(!(Q instanceof z))throw Error('CodeGen: "else" without "if"');return this._currNode=Q.else=G,this}get _root(){return this._nodes[0]}get _currNode(){let G=this._nodes;return G[G.length-1]}set _currNode(G){let Q=this._nodes;Q[Q.length-1]=G}};m.CodeGen=ge;function ve(G,Q){for(let te in Q)G[te]=(G[te]||0)+(Q[te]||0);return G}function Ie(G,Q){return Q instanceof h._CodeOrName?ve(G,Q.names):G}function Ne(G,Q,te){if(G instanceof h.Name)return je(G);if(!Me(G))return G;return new h._Code(G._items.reduce((Be,Ue)=>{if(Ue instanceof h.Name)Ue=je(Ue);if(Ue instanceof h._Code)Be.push(...Ue._items);else Be.push(Ue);return Be},[]));function je(Be){let Ue=te[Be.str];if(Ue===void 0||Q[Be.str]!==1)return Be;return delete Q[Be.str],Ue}function Me(Be){return Be instanceof h._Code&&Be._items.some((Ue)=>Ue instanceof h.Name&&Q[Ue.str]===1&&te[Ue.str]!==void 0)}}function Ge(G,Q){for(let te in Q)G[te]=(G[te]||0)-(Q[te]||0)}function Qe(G){return typeof G=="boolean"||typeof G=="number"||G===null?!G:h._`!${we(G)}`}m.not=Qe;let Ze=le(m.operators.AND);function nt(...G){return G.reduce(Ze)}m.and=nt;let We=le(m.operators.OR);function ee(...G){return G.reduce(We)}m.or=ee;function le(G){return(Q,te)=>Q===h.nil?te:te===h.nil?Q:h._`${we(Q)} ${G} ${we(te)}`}function we(G){return G instanceof h.Name?G:h._`(${G})`}}),Ye=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.checkStrictMode=m.getErrorPath=m.Type=m.useFunc=m.setEvaluated=m.evaluatedPropsToName=m.mergeEvaluated=m.eachItem=m.unescapeJsonPointer=m.escapeJsonPointer=m.escapeFragment=m.unescapeFragment=m.schemaRefOrVal=m.schemaHasRulesButRef=m.schemaHasRules=m.checkUnknownRules=m.alwaysValidSchema=m.toHash=void 0;let h=He(),f=fn();function g(U){let T={};for(let Z of U)T[Z]=!0;return T}m.toHash=g;function S(U,T){if(typeof T=="boolean")return T;if(Object.keys(T).length===0)return!0;return b(U,T),!_(T,U.self.RULES.all)}m.alwaysValidSchema=S;function b(U,T=U.schema){let{opts:Z,self:de}=U;if(!Z.strictSchema)return;if(typeof T==="boolean")return;let qe=de.RULES.keywords;for(let ge in T)if(!qe[ge])Y(U,`unknown keyword: "${ge}"`)}m.checkUnknownRules=b;function _(U,T){if(typeof U=="boolean")return!U;for(let Z in U)if(T[Z])return!0;return!1}m.schemaHasRules=_;function R(U,T){if(typeof U=="boolean")return!U;for(let Z in U)if(Z!=="$ref"&&T.all[Z])return!0;return!1}m.schemaHasRulesButRef=R;function y({topSchemaRef:U,schemaPath:T},Z,de,qe){if(!qe){if(typeof Z=="number"||typeof Z=="boolean")return Z;if(typeof Z=="string")return h._`${Z}`}return h._`${U}${T}${(0,h.getProperty)(de)}`}m.schemaRefOrVal=y;function P(U){return J(decodeURIComponent(U))}m.unescapeFragment=P;function C(U){return encodeURIComponent(N(U))}m.escapeFragment=C;function N(U){if(typeof U=="number")return`${U}`;return U.replace(/~/g,"~0").replace(/\//g,"~1")}m.escapeJsonPointer=N;function J(U){return U.replace(/~1/g,"/").replace(/~0/g,"~")}m.unescapeJsonPointer=J;function W(U,T){if(Array.isArray(U))for(let Z of U)T(Z);else T(U)}m.eachItem=W;function L({mergeNames:U,mergeToName:T,mergeValues:Z,resultToName:de}){return(qe,ge,ve,Ie)=>{let Ne=ve===void 0?ge:ve instanceof h.Name?(ge instanceof h.Name?U(qe,ge,ve):T(qe,ge,ve),ve):ge instanceof h.Name?(T(qe,ve,ge),ge):Z(ge,ve);return Ie===h.Name&&!(Ne instanceof h.Name)?de(qe,Ne):Ne}}m.mergeEvaluated={props:L({mergeNames:(U,T,Z)=>U.if(h._`${Z} !== true && ${T} !== undefined`,()=>{U.if(h._`${T} === true`,()=>U.assign(Z,!0),()=>U.assign(Z,h._`${Z} || {}`).code(h._`Object.assign(${Z}, ${T})`))}),mergeToName:(U,T,Z)=>U.if(h._`${Z} !== true`,()=>{if(T===!0)U.assign(Z,!0);else U.assign(Z,h._`${Z} || {}`),I(U,Z,T)}),mergeValues:(U,T)=>U===!0?!0:{...U,...T},resultToName:K}),items:L({mergeNames:(U,T,Z)=>U.if(h._`${Z} !== true && ${T} !== undefined`,()=>U.assign(Z,h._`${T} === true ? true : ${Z} > ${T} ? ${Z} : ${T}`)),mergeToName:(U,T,Z)=>U.if(h._`${Z} !== true`,()=>U.assign(Z,T===!0?!0:h._`${Z} > ${T} ? ${Z} : ${T}`)),mergeValues:(U,T)=>U===!0?!0:Math.max(U,T),resultToName:(U,T)=>U.var("items",T)})};function K(U,T){if(T===!0)return U.var("props",!0);let Z=U.var("props",h._`{}`);if(T!==void 0)I(U,Z,T);return Z}m.evaluatedPropsToName=K;function I(U,T,Z){Object.keys(Z).forEach((de)=>U.assign(h._`${T}${(0,h.getProperty)(de)}`,!0))}m.setEvaluated=I;let z={};function F(U,T){return U.scopeValue("func",{ref:T,code:z[T.code]||(z[T.code]=new f._Code(T.code))})}m.useFunc=F;var w;(function(U){U[U.Num=0]="Num",U[U.Str=1]="Str"})(w||(m.Type=w={}));function B(U,T,Z){if(U instanceof h.Name){let de=T===w.Num;return Z?de?h._`"[" + ${U} + "]"`:h._`"['" + ${U} + "']"`:de?h._`"/" + ${U}`:h._`"/" + ${U}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return Z?(0,h.getProperty)(U).toString():"/"+N(U)}m.getErrorPath=B;function Y(U,T,Z=U.opts.strictSchema){if(!Z)return;if(T=`strict mode: ${T}`,Z===!0)throw Error(T);U.self.logger.warn(T)}m.checkStrictMode=Y}),Et=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f={data:new h.Name("data"),valCxt:new h.Name("valCxt"),instancePath:new h.Name("instancePath"),parentData:new h.Name("parentData"),parentDataProperty:new h.Name("parentDataProperty"),rootData:new h.Name("rootData"),dynamicAnchors:new h.Name("dynamicAnchors"),vErrors:new h.Name("vErrors"),errors:new h.Name("errors"),this:new h.Name("this"),self:new h.Name("self"),scope:new h.Name("scope"),json:new h.Name("json"),jsonPos:new h.Name("jsonPos"),jsonLen:new h.Name("jsonLen"),jsonPart:new h.Name("jsonPart")};m.default=f}),Sn=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.extendErrors=m.resetErrorsCount=m.reportExtraError=m.reportError=m.keyword$DataError=m.keywordError=void 0;let h=He(),f=Ye(),g=Et();m.keywordError={message:({keyword:I})=>h.str`must pass "${I}" keyword validation`},m.keyword$DataError={message:({keyword:I,schemaType:z})=>z?h.str`"${I}" keyword must be ${z} ($data)`:h.str`"${I}" keyword is invalid ($data)`};function S(I,z=m.keywordError,F,w){let{it:B}=I,{gen:Y,compositeRule:U,allErrors:T}=B,Z=N(I,z,F);if(w!==null&&w!==void 0?w:U||T)y(Y,Z);else P(B,h._`[${Z}]`)}m.reportError=S;function b(I,z=m.keywordError,F){let{it:w}=I,{gen:B,compositeRule:Y,allErrors:U}=w;if(y(B,N(I,z,F)),!(Y||U))P(w,g.default.vErrors)}m.reportExtraError=b;function _(I,z){I.assign(g.default.errors,z),I.if(h._`${g.default.vErrors} !== null`,()=>I.if(z,()=>I.assign(h._`${g.default.vErrors}.length`,z),()=>I.assign(g.default.vErrors,null)))}m.resetErrorsCount=_;function R({gen:I,keyword:z,schemaValue:F,data:w,errsCount:B,it:Y}){if(B===void 0)throw Error("ajv implementation error");let U=I.name("err");I.forRange("i",B,g.default.errors,(T)=>{if(I.const(U,h._`${g.default.vErrors}[${T}]`),I.if(h._`${U}.instancePath === undefined`,()=>I.assign(h._`${U}.instancePath`,(0,h.strConcat)(g.default.instancePath,Y.errorPath))),I.assign(h._`${U}.schemaPath`,h.str`${Y.errSchemaPath}/${z}`),Y.opts.verbose)I.assign(h._`${U}.schema`,F),I.assign(h._`${U}.data`,w)})}m.extendErrors=R;function y(I,z){let F=I.const("err",z);I.if(h._`${g.default.vErrors} === null`,()=>I.assign(g.default.vErrors,h._`[${F}]`),h._`${g.default.vErrors}.push(${F})`),I.code(h._`${g.default.errors}++`)}function P(I,z){let{gen:F,validateName:w,schemaEnv:B}=I;if(B.$async)F.throw(h._`new ${I.ValidationError}(${z})`);else F.assign(h._`${w}.errors`,z),F.return(!1)}let C={keyword:new h.Name("keyword"),schemaPath:new h.Name("schemaPath"),params:new h.Name("params"),propertyName:new h.Name("propertyName"),message:new h.Name("message"),schema:new h.Name("schema"),parentSchema:new h.Name("parentSchema")};function N(I,z,F){let{createErrors:w}=I.it;if(w===!1)return h._`{}`;return J(I,z,F)}function J(I,z,F={}){let{gen:w,it:B}=I,Y=[W(B,F),L(I,F)];return K(I,z,Y),w.object(...Y)}function W({errorPath:I},{instancePath:z}){let F=z?h.str`${I}${(0,f.getErrorPath)(z,f.Type.Str)}`:I;return[g.default.instancePath,(0,h.strConcat)(g.default.instancePath,F)]}function L({keyword:I,it:{errSchemaPath:z}},{schemaPath:F,parentSchema:w}){let B=w?z:h.str`${z}/${I}`;if(F)B=h.str`${B}${(0,f.getErrorPath)(F,f.Type.Str)}`;return[C.schemaPath,B]}function K(I,{params:z,message:F},w){let{keyword:B,data:Y,schemaValue:U,it:T}=I,{opts:Z,propertyName:de,topSchemaRef:qe,schemaPath:ge}=T;if(w.push([C.keyword,B],[C.params,typeof z=="function"?z(I):z||h._`{}`]),Z.messages)w.push([C.message,typeof F=="function"?F(I):F]);if(Z.verbose)w.push([C.schema,U],[C.parentSchema,h._`${qe}${ge}`],[g.default.data,Y]);if(de)w.push([C.propertyName,de])}}),ad=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.boolOrEmptySchema=m.topBoolOrEmptySchema=void 0;let h=Sn(),f=He(),g=Et(),S={message:"boolean schema is false"};function b(y){let{gen:P,schema:C,validateName:N}=y;if(C===!1)R(y,!1);else if(typeof C=="object"&&C.$async===!0)P.return(g.default.data);else P.assign(f._`${N}.errors`,null),P.return(!0)}m.topBoolOrEmptySchema=b;function _(y,P){let{gen:C,schema:N}=y;if(N===!1)C.var(P,!1),R(y);else C.var(P,!0)}m.boolOrEmptySchema=_;function R(y,P){let{gen:C,data:N}=y,J={gen:C,keyword:"false schema",data:N,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:y};(0,h.reportError)(J,S,void 0,P)}}),qc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getRules=m.isJSONType=void 0;let h=new Set(["string","number","integer","boolean","null","object","array"]);function f(S){return typeof S=="string"&&h.has(S)}m.isJSONType=f;function g(){let S={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...S,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},S.number,S.string,S.array,S.object],post:{rules:[]},all:{},keywords:{}}}m.getRules=g}),jc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.shouldUseRule=m.shouldUseGroup=m.schemaHasRulesForType=void 0;function h({schema:S,self:b},_){let R=b.RULES.types[_];return R&&R!==!0&&f(S,R)}m.schemaHasRulesForType=h;function f(S,b){return b.rules.some((_)=>g(S,_))}m.shouldUseGroup=f;function g(S,b){var _;return S[b.keyword]!==void 0||((_=b.definition.implements)===null||_===void 0?void 0:_.some((R)=>S[R]!==void 0))}m.shouldUseRule=g}),gn=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.reportTypeError=m.checkDataTypes=m.checkDataType=m.coerceAndCheckDataType=m.getJSONTypes=m.getSchemaTypes=m.DataType=void 0;let h=qc(),f=jc(),g=Sn(),S=He(),b=Ye();var _;(function(w){w[w.Correct=0]="Correct",w[w.Wrong=1]="Wrong"})(_||(m.DataType=_={}));function R(w){let B=y(w.type);if(B.includes("null")){if(w.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!B.length&&w.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(w.nullable===!0)B.push("null")}return B}m.getSchemaTypes=R;function y(w){let B=Array.isArray(w)?w:w?[w]:[];if(B.every(h.isJSONType))return B;throw Error("type must be JSONType or JSONType[]: "+B.join(","))}m.getJSONTypes=y;function P(w,B){let{gen:Y,data:U,opts:T}=w,Z=N(B,T.coerceTypes),de=B.length>0&&!(Z.length===0&&B.length===1&&(0,f.schemaHasRulesForType)(w,B[0]));if(de){let qe=K(B,U,T.strictNumbers,_.Wrong);Y.if(qe,()=>{if(Z.length)J(w,B,Z);else z(w)})}return de}m.coerceAndCheckDataType=P;let C=new Set(["string","number","integer","boolean","null"]);function N(w,B){return B?w.filter((Y)=>C.has(Y)||B==="array"&&Y==="array"):[]}function J(w,B,Y){let{gen:U,data:T,opts:Z}=w,de=U.let("dataType",S._`typeof ${T}`),qe=U.let("coerced",S._`undefined`);if(Z.coerceTypes==="array")U.if(S._`${de} == 'object' && Array.isArray(${T}) && ${T}.length == 1`,()=>U.assign(T,S._`${T}[0]`).assign(de,S._`typeof ${T}`).if(K(B,T,Z.strictNumbers),()=>U.assign(qe,T)));U.if(S._`${qe} !== undefined`);for(let ve of Y)if(C.has(ve)||ve==="array"&&Z.coerceTypes==="array")ge(ve);U.else(),z(w),U.endIf(),U.if(S._`${qe} !== undefined`,()=>{U.assign(T,qe),W(w,qe)});function ge(ve){switch(ve){case"string":U.elseIf(S._`${de} == "number" || ${de} == "boolean"`).assign(qe,S._`"" + ${T}`).elseIf(S._`${T} === null`).assign(qe,S._`""`);return;case"number":U.elseIf(S._`${de} == "boolean" || ${T} === null
|
|
9
|
-
|| (${de} == "string" && ${T} && ${T} == +${T})`).assign(
|
|
10
|
-
|| (${de} === "string" && ${T} && ${T} == +${T} && !(${T} % 1))`).assign(
|
|
11
|
-
|| ${de} === "boolean" || ${T} === null`).assign(qe,S._`[${T}]`)}}}function W({gen:w,parentData:B,parentDataProperty:Y},U){w.if(S._`${B} !== undefined`,()=>w.assign(S._`${B}[${Y}]`,U))}function L(w,B,Y,U=_.Correct){let T=U===_.Correct?S.operators.EQ:S.operators.NEQ,Z;switch(w){case"null":return S._`${B} ${T} null`;case"array":Z=S._`Array.isArray(${B})`;break;case"object":Z=S._`${B} && typeof ${B} == "object" && !Array.isArray(${B})`;break;case"integer":Z=de(S._`!(${B} % 1) && !isNaN(${B})`);break;case"number":Z=de();break;default:return S._`typeof ${B} ${T} ${w}`}return U===_.Correct?Z:(0,S.not)(Z);function de(qe=S.nil){return(0,S.and)(S._`typeof ${B} == "number"`,qe,Y?S._`isFinite(${B})`:S.nil)}}m.checkDataType=L;function K(w,B,Y,U){if(w.length===1)return L(w[0],B,Y,U);let T,Z=(0,b.toHash)(w);if(Z.array&&Z.object){let de=S._`typeof ${B} != "object"`;T=Z.null?de:S._`!${B} || ${de}`,delete Z.null,delete Z.array,delete Z.object}else T=S.nil;if(Z.number)delete Z.integer;for(let de in Z)T=(0,S.and)(T,L(de,B,Y,U));return T}m.checkDataTypes=K;let I={message:({schema:w})=>`must be ${w}`,params:({schema:w,schemaValue:B})=>typeof w=="string"?S._`{type: ${w}}`:S._`{type: ${B}}`};function z(w){let B=F(w);(0,g.reportError)(B,I)}m.reportTypeError=z;function F(w){let{gen:B,data:Y,schema:U}=w,T=(0,b.schemaRefOrVal)(w,U,"type");return{gen:B,keyword:"type",data:Y,schema:U.type,schemaCode:T,schemaValue:T,parentSchema:U,params:{},it:w}}}),rd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.assignDefaults=void 0;let h=He(),f=Ye();function g(b,_){let{properties:R,items:y}=b.schema;if(_==="object"&&R)for(let P in R)S(b,P,R[P].default);else if(_==="array"&&Array.isArray(y))y.forEach((P,C)=>S(b,C,P.default))}m.assignDefaults=g;function S(b,_,R){let{gen:y,compositeRule:P,data:C,opts:N}=b;if(R===void 0)return;let J=h._`${C}${(0,h.getProperty)(_)}`;if(P){(0,f.checkStrictMode)(b,`default is ignored for: ${J}`);return}let W=h._`${J} === undefined`;if(N.useDefaults==="empty")W=h._`${W} || ${J} === null || ${J} === ""`;y.if(W,h._`${J} = ${(0,h.stringify)(R)}`)}}),wt=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateUnion=m.validateArray=m.usePattern=m.callValidateCode=m.schemaProperties=m.allSchemaProperties=m.noPropertyInData=m.propertyInData=m.isOwnProperty=m.hasPropFunc=m.reportMissingProp=m.checkMissingProp=m.checkReportMissingProp=void 0;let h=He(),f=Ye(),g=Et(),S=Ye();function b(w,B){let{gen:Y,data:U,it:T}=w;Y.if(N(Y,U,B,T.opts.ownProperties),()=>{w.setParams({missingProperty:h._`${B}`},!0),w.error()})}m.checkReportMissingProp=b;function _({gen:w,data:B,it:{opts:Y}},U,T){return(0,h.or)(...U.map((Z)=>(0,h.and)(N(w,B,Z,Y.ownProperties),h._`${T} = ${Z}`)))}m.checkMissingProp=_;function R(w,B){w.setParams({missingProperty:B},!0),w.error()}m.reportMissingProp=R;function y(w){return w.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:h._`Object.prototype.hasOwnProperty`})}m.hasPropFunc=y;function P(w,B,Y){return h._`${y(w)}.call(${B}, ${Y})`}m.isOwnProperty=P;function C(w,B,Y,U){let T=h._`${B}${(0,h.getProperty)(Y)} !== undefined`;return U?h._`${T} && ${P(w,B,Y)}`:T}m.propertyInData=C;function N(w,B,Y,U){let T=h._`${B}${(0,h.getProperty)(Y)} === undefined`;return U?(0,h.or)(T,(0,h.not)(P(w,B,Y))):T}m.noPropertyInData=N;function J(w){return w?Object.keys(w).filter((B)=>B!=="__proto__"):[]}m.allSchemaProperties=J;function W(w,B){return J(B).filter((Y)=>!(0,f.alwaysValidSchema)(w,B[Y]))}m.schemaProperties=W;function L({schemaCode:w,data:B,it:{gen:Y,topSchemaRef:U,schemaPath:T,errorPath:Z},it:de},qe,ge,ve){let Ie=ve?h._`${w}, ${B}, ${U}${T}`:B,Ne=[[g.default.instancePath,(0,h.strConcat)(g.default.instancePath,Z)],[g.default.parentData,de.parentData],[g.default.parentDataProperty,de.parentDataProperty],[g.default.rootData,g.default.rootData]];if(de.opts.dynamicRef)Ne.push([g.default.dynamicAnchors,g.default.dynamicAnchors]);let Ge=h._`${Ie}, ${Y.object(...Ne)}`;return ge!==h.nil?h._`${qe}.call(${ge}, ${Ge})`:h._`${qe}(${Ge})`}m.callValidateCode=L;let K=h._`new RegExp`;function I({gen:w,it:{opts:B}},Y){let U=B.unicodeRegExp?"u":"",{regExp:T}=B.code,Z=T(Y,U);return w.scopeValue("pattern",{key:Z.toString(),ref:Z,code:h._`${T.code==="new RegExp"?K:(0,S.useFunc)(w,T)}(${Y}, ${U})`})}m.usePattern=I;function z(w){let{gen:B,data:Y,keyword:U,it:T}=w,Z=B.name("valid");if(T.allErrors){let qe=B.let("valid",!0);return de(()=>B.assign(qe,!1)),qe}return B.var(Z,!0),de(()=>B.break()),Z;function de(qe){let ge=B.const("len",h._`${Y}.length`);B.forRange("i",0,ge,(ve)=>{w.subschema({keyword:U,dataProp:ve,dataPropType:f.Type.Num},Z),B.if((0,h.not)(Z),qe)})}}m.validateArray=z;function F(w){let{gen:B,schema:Y,keyword:U,it:T}=w;if(!Array.isArray(Y))throw Error("ajv implementation error");if(Y.some((qe)=>(0,f.alwaysValidSchema)(T,qe))&&!T.opts.unevaluated)return;let Z=B.let("valid",!1),de=B.name("_valid");B.block(()=>Y.forEach((qe,ge)=>{let ve=w.subschema({keyword:U,schemaProp:ge,compositeRule:!0},de);if(B.assign(Z,h._`${Z} || ${de}`),!w.mergeValidEvaluated(ve,de))B.if((0,h.not)(Z))})),w.result(Z,()=>w.reset(),()=>w.error(!0))}m.validateUnion=F}),od=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateKeywordUsage=m.validSchemaType=m.funcKeywordCode=m.macroKeywordCode=void 0;let h=He(),f=Et(),g=wt(),S=Sn();function b(W,L){let{gen:K,keyword:I,schema:z,parentSchema:F,it:w}=W,B=L.macro.call(w.self,z,F,w),Y=C(K,I,B);if(w.opts.validateSchema!==!1)w.self.validateSchema(B,!0);let U=K.name("valid");W.subschema({schema:B,schemaPath:h.nil,errSchemaPath:`${w.errSchemaPath}/${I}`,topSchemaRef:Y,compositeRule:!0},U),W.pass(U,()=>W.error(!0))}m.macroKeywordCode=b;function _(W,L){var K;let{gen:I,keyword:z,schema:F,parentSchema:w,$data:B,it:Y}=W;P(Y,L);let U=C(I,z,!B&&L.compile?L.compile.call(Y.self,F,w,Y):L.validate),T=I.let("valid");W.block$data(T,Z),W.ok((K=L.valid)!==null&&K!==void 0?K:T);function Z(){if(L.errors===!1){if(ge(),L.modifying)R(W);ve(()=>W.error())}else{let Ie=L.async?de():qe();if(L.modifying)R(W);ve(()=>y(W,Ie))}}function de(){let Ie=I.let("ruleErrs",null);return I.try(()=>ge(h._`await `),(Ne)=>I.assign(T,!1).if(h._`${Ne} instanceof ${Y.ValidationError}`,()=>I.assign(Ie,h._`${Ne}.errors`),()=>I.throw(Ne))),Ie}function qe(){let Ie=h._`${U}.errors`;return I.assign(Ie,null),ge(h.nil),Ie}function ge(Ie=L.async?h._`await `:h.nil){let Ne=Y.opts.passContext?f.default.this:f.default.self,Ge=!(("compile"in L)&&!B||L.schema===!1);I.assign(T,h._`${Ie}${(0,g.callValidateCode)(W,U,Ne,Ge)}`,L.modifying)}function ve(Ie){var Ne;I.if((0,h.not)((Ne=L.valid)!==null&&Ne!==void 0?Ne:T),Ie)}}m.funcKeywordCode=_;function R(W){let{gen:L,data:K,it:I}=W;L.if(I.parentData,()=>L.assign(K,h._`${I.parentData}[${I.parentDataProperty}]`))}function y(W,L){let{gen:K}=W;K.if(h._`Array.isArray(${L})`,()=>{K.assign(f.default.vErrors,h._`${f.default.vErrors} === null ? ${L} : ${f.default.vErrors}.concat(${L})`).assign(f.default.errors,h._`${f.default.vErrors}.length`),(0,S.extendErrors)(W)},()=>W.error())}function P({schemaEnv:W},L){if(L.async&&!W.$async)throw Error("async keyword in sync schema")}function C(W,L,K){if(K===void 0)throw Error(`keyword "${L}" failed to compile`);return W.scopeValue("keyword",typeof K=="function"?{ref:K}:{ref:K,code:(0,h.stringify)(K)})}function N(W,L,K=!1){return!L.length||L.some((I)=>I==="array"?Array.isArray(W):I==="object"?W&&typeof W=="object"&&!Array.isArray(W):typeof W==I||K&&typeof W>"u")}m.validSchemaType=N;function J({schema:W,opts:L,self:K,errSchemaPath:I},z,F){if(Array.isArray(z.keyword)?!z.keyword.includes(F):z.keyword!==F)throw Error("ajv implementation error");let w=z.dependencies;if(w===null||w===void 0?void 0:w.some((B)=>!Object.prototype.hasOwnProperty.call(W,B)))throw Error(`parent schema must have dependencies of ${F}: ${w.join(",")}`);if(z.validateSchema){if(!z.validateSchema(W[F])){let B=`keyword "${F}" value is invalid at path "${I}": `+K.errorsText(z.validateSchema.errors);if(L.validateSchema==="log")K.logger.error(B);else throw Error(B)}}}m.validateKeywordUsage=J}),sd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.extendSubschemaMode=m.extendSubschemaData=m.getSubschema=void 0;let h=He(),f=Ye();function g(_,{keyword:R,schemaProp:y,schema:P,schemaPath:C,errSchemaPath:N,topSchemaRef:J}){if(R!==void 0&&P!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(R!==void 0){let W=_.schema[R];return y===void 0?{schema:W,schemaPath:h._`${_.schemaPath}${(0,h.getProperty)(R)}`,errSchemaPath:`${_.errSchemaPath}/${R}`}:{schema:W[y],schemaPath:h._`${_.schemaPath}${(0,h.getProperty)(R)}${(0,h.getProperty)(y)}`,errSchemaPath:`${_.errSchemaPath}/${R}/${(0,f.escapeFragment)(y)}`}}if(P!==void 0){if(C===void 0||N===void 0||J===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:P,schemaPath:C,topSchemaRef:J,errSchemaPath:N}}throw Error('either "keyword" or "schema" must be passed')}m.getSubschema=g;function S(_,R,{dataProp:y,dataPropType:P,data:C,dataTypes:N,propertyName:J}){if(C!==void 0&&y!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:W}=R;if(y!==void 0){let{errorPath:K,dataPathArr:I,opts:z}=R;L(W.let("data",h._`${R.data}${(0,h.getProperty)(y)}`,!0)),_.errorPath=h.str`${K}${(0,f.getErrorPath)(y,P,z.jsPropertySyntax)}`,_.parentDataProperty=h._`${y}`,_.dataPathArr=[...I,_.parentDataProperty]}if(C!==void 0){if(L(C instanceof h.Name?C:W.let("data",C,!0)),J!==void 0)_.propertyName=J}if(N)_.dataTypes=N;function L(K){_.data=K,_.dataLevel=R.dataLevel+1,_.dataTypes=[],R.definedProperties=new Set,_.parentData=R.data,_.dataNames=[...R.dataNames,K]}}m.extendSubschemaData=S;function b(_,{jtdDiscriminator:R,jtdMetadata:y,compositeRule:P,createErrors:C,allErrors:N}){if(P!==void 0)_.compositeRule=P;if(C!==void 0)_.createErrors=C;if(N!==void 0)_.allErrors=N;_.jtdDiscriminator=R,_.jtdMetadata=y}m.extendSubschemaMode=b}),Nc=ye((m,h)=>{h.exports=function f(g,S){if(g===S)return!0;if(g&&S&&typeof g=="object"&&typeof S=="object"){if(g.constructor!==S.constructor)return!1;var b,_,R;if(Array.isArray(g)){if(b=g.length,b!=S.length)return!1;for(_=b;_--!==0;)if(!f(g[_],S[_]))return!1;return!0}if(g.constructor===RegExp)return g.source===S.source&&g.flags===S.flags;if(g.valueOf!==Object.prototype.valueOf)return g.valueOf()===S.valueOf();if(g.toString!==Object.prototype.toString)return g.toString()===S.toString();if(R=Object.keys(g),b=R.length,b!==Object.keys(S).length)return!1;for(_=b;_--!==0;)if(!Object.prototype.hasOwnProperty.call(S,R[_]))return!1;for(_=b;_--!==0;){var y=R[_];if(!f(g[y],S[y]))return!1}return!0}return g!==g&&S!==S}}),nd=ye((m,h)=>{var f=h.exports=function(b,_,R){if(typeof _=="function")R=_,_={};R=_.cb||R;var y=typeof R=="function"?R:R.pre||function(){},P=R.post||function(){};g(_,y,P,b,"",b)};f.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},f.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},f.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},f.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 g(b,_,R,y,P,C,N,J,W,L){if(y&&typeof y=="object"&&!Array.isArray(y)){_(y,P,C,N,J,W,L);for(var K in y){var I=y[K];if(Array.isArray(I)){if(K in f.arrayKeywords)for(var z=0;z<I.length;z++)g(b,_,R,I[z],P+"/"+K+"/"+z,C,P,K,y,z)}else if(K in f.propsKeywords){if(I&&typeof I=="object")for(var F in I)g(b,_,R,I[F],P+"/"+K+"/"+S(F),C,P,K,y,F)}else if(K in f.keywords||b.allKeys&&!(K in f.skipKeywords))g(b,_,R,I,P+"/"+K,C,P,K,y)}R(y,P,C,N,J,W,L)}}function S(b){return b.replace(/~/g,"~0").replace(/\//g,"~1")}}),_n=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getSchemaRefs=m.resolveUrl=m.normalizeId=m._getFullPath=m.getFullPath=m.inlineRef=void 0;let h=Ye(),f=Nc(),g=nd(),S=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function b(I,z=!0){if(typeof I=="boolean")return!0;if(z===!0)return!R(I);if(!z)return!1;return y(I)<=z}m.inlineRef=b;let _=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function R(I){for(let z in I){if(_.has(z))return!0;let F=I[z];if(Array.isArray(F)&&F.some(R))return!0;if(typeof F=="object"&&R(F))return!0}return!1}function y(I){let z=0;for(let F in I){if(F==="$ref")return 1/0;if(z++,S.has(F))continue;if(typeof I[F]=="object")(0,h.eachItem)(I[F],(w)=>z+=y(w));if(z===1/0)return 1/0}return z}function P(I,z="",F){if(F!==!1)z=J(z);return C(I,I.parse(z))}m.getFullPath=P;function C(I,z){return I.serialize(z).split("#")[0]+"#"}m._getFullPath=C;let N=/#\/?$/;function J(I){return I?I.replace(N,""):""}m.normalizeId=J;function W(I,z,F){return F=J(F),I.resolve(z,F)}m.resolveUrl=W;let L=/^[a-z_][-a-z0-9._]*$/i;function K(I,z){if(typeof I=="boolean")return{};let{schemaId:F,uriResolver:w}=this.opts,B=J(I[F]||z),Y={"":B},U=P(w,B,!1),T={},Z=new Set;return g(I,{allKeys:!0},(ge,ve,Ie,Ne)=>{if(Ne===void 0)return;let Ge=U+ve,Qe=Y[Ne];if(typeof ge[F]=="string")Qe=Ze.call(this,ge[F]);nt.call(this,ge.$anchor),nt.call(this,ge.$dynamicAnchor),Y[ve]=Qe;function Ze(We){let ee=this.opts.uriResolver.resolve;if(We=J(Qe?ee(Qe,We):We),Z.has(We))throw qe(We);Z.add(We);let le=this.refs[We];if(typeof le=="string")le=this.refs[le];if(typeof le=="object")de(ge,le.schema,We);else if(We!==J(Ge))if(We[0]==="#")de(ge,T[We],We),T[We]=ge;else this.refs[We]=Ge;return We}function nt(We){if(typeof We=="string"){if(!L.test(We))throw Error(`invalid anchor "${We}"`);Ze.call(this,`#${We}`)}}}),T;function de(ge,ve,Ie){if(ve!==void 0&&!f(ge,ve))throw qe(Ie)}function qe(ge){return Error(`reference "${ge}" resolves to more than one schema`)}}m.getSchemaRefs=K}),Ua=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getData=m.KeywordCxt=m.validateFunctionCode=void 0;let h=ad(),f=gn(),g=jc(),S=gn(),b=rd(),_=od(),R=sd(),y=He(),P=Et(),C=_n(),N=Ye(),J=Sn();function W(X){if(U(X)){if(Z(X),Y(X)){z(X);return}}L(X,()=>(0,h.topBoolOrEmptySchema)(X))}m.validateFunctionCode=W;function L({gen:X,validateName:ue,schema:_e,schemaEnv:De,opts:Ve},Fe){if(Ve.code.es5)X.func(ue,y._`${P.default.data}, ${P.default.valCxt}`,De.$async,()=>{X.code(y._`"use strict"; ${w(_e,Ve)}`),I(X,Ve),X.code(Fe)});else X.func(ue,y._`${P.default.data}, ${K(Ve)}`,De.$async,()=>X.code(w(_e,Ve)).code(Fe))}function K(X){return y._`{${P.default.instancePath}="", ${P.default.parentData}, ${P.default.parentDataProperty}, ${P.default.rootData}=${P.default.data}${X.dynamicRef?y._`, ${P.default.dynamicAnchors}={}`:y.nil}}={}`}function I(X,ue){X.if(P.default.valCxt,()=>{if(X.var(P.default.instancePath,y._`${P.default.valCxt}.${P.default.instancePath}`),X.var(P.default.parentData,y._`${P.default.valCxt}.${P.default.parentData}`),X.var(P.default.parentDataProperty,y._`${P.default.valCxt}.${P.default.parentDataProperty}`),X.var(P.default.rootData,y._`${P.default.valCxt}.${P.default.rootData}`),ue.dynamicRef)X.var(P.default.dynamicAnchors,y._`${P.default.valCxt}.${P.default.dynamicAnchors}`)},()=>{if(X.var(P.default.instancePath,y._`""`),X.var(P.default.parentData,y._`undefined`),X.var(P.default.parentDataProperty,y._`undefined`),X.var(P.default.rootData,P.default.data),ue.dynamicRef)X.var(P.default.dynamicAnchors,y._`{}`)})}function z(X){let{schema:ue,opts:_e,gen:De}=X;L(X,()=>{if(_e.$comment&&ue.$comment)Ne(X);if(ge(X),De.let(P.default.vErrors,null),De.let(P.default.errors,0),_e.unevaluated)F(X);de(X),Ge(X)})}function F(X){let{gen:ue,validateName:_e}=X;X.evaluated=ue.const("evaluated",y._`${_e}.evaluated`),ue.if(y._`${X.evaluated}.dynamicProps`,()=>ue.assign(y._`${X.evaluated}.props`,y._`undefined`)),ue.if(y._`${X.evaluated}.dynamicItems`,()=>ue.assign(y._`${X.evaluated}.items`,y._`undefined`))}function w(X,ue){let _e=typeof X=="object"&&X[ue.schemaId];return _e&&(ue.code.source||ue.code.process)?y._`/*# sourceURL=${_e} */`:y.nil}function B(X,ue){if(U(X)){if(Z(X),Y(X)){T(X,ue);return}}(0,h.boolOrEmptySchema)(X,ue)}function Y({schema:X,self:ue}){if(typeof X=="boolean")return!X;for(let _e in X)if(ue.RULES.all[_e])return!0;return!1}function U(X){return typeof X.schema!="boolean"}function T(X,ue){let{schema:_e,gen:De,opts:Ve}=X;if(Ve.$comment&&_e.$comment)Ne(X);ve(X),Ie(X);let Fe=De.const("_errs",P.default.errors);de(X,Fe),De.var(ue,y._`${Fe} === ${P.default.errors}`)}function Z(X){(0,N.checkUnknownRules)(X),qe(X)}function de(X,ue){if(X.opts.jtd)return Ze(X,[],!1,ue);let _e=(0,f.getSchemaTypes)(X.schema);Ze(X,_e,!(0,f.coerceAndCheckDataType)(X,_e),ue)}function qe(X){let{schema:ue,errSchemaPath:_e,opts:De,self:Ve}=X;if(ue.$ref&&De.ignoreKeywordsWithRef&&(0,N.schemaHasRulesButRef)(ue,Ve.RULES))Ve.logger.warn(`$ref: keywords ignored in schema at path "${_e}"`)}function ge(X){let{schema:ue,opts:_e}=X;if(ue.default!==void 0&&_e.useDefaults&&_e.strictSchema)(0,N.checkStrictMode)(X,"default is ignored in the schema root")}function ve(X){let ue=X.schema[X.opts.schemaId];if(ue)X.baseId=(0,C.resolveUrl)(X.opts.uriResolver,X.baseId,ue)}function Ie(X){if(X.schema.$async&&!X.schemaEnv.$async)throw Error("async schema in sync schema")}function Ne({gen:X,schemaEnv:ue,schema:_e,errSchemaPath:De,opts:Ve}){let Fe=_e.$comment;if(Ve.$comment===!0)X.code(y._`${P.default.self}.logger.log(${Fe})`);else if(typeof Ve.$comment=="function"){let ot=y.str`${De}/$comment`,ct=X.scopeValue("root",{ref:ue.root});X.code(y._`${P.default.self}.opts.$comment(${Fe}, ${ot}, ${ct}.schema)`)}}function Ge(X){let{gen:ue,schemaEnv:_e,validateName:De,ValidationError:Ve,opts:Fe}=X;if(_e.$async)ue.if(y._`${P.default.errors} === 0`,()=>ue.return(P.default.data),()=>ue.throw(y._`new ${Ve}(${P.default.vErrors})`));else{if(ue.assign(y._`${De}.errors`,P.default.vErrors),Fe.unevaluated)Qe(X);ue.return(y._`${P.default.errors} === 0`)}}function Qe({gen:X,evaluated:ue,props:_e,items:De}){if(_e instanceof y.Name)X.assign(y._`${ue}.props`,_e);if(De instanceof y.Name)X.assign(y._`${ue}.items`,De)}function Ze(X,ue,_e,De){let{gen:Ve,schema:Fe,data:ot,allErrors:ct,opts:mt,self:it}=X,{RULES:et}=it;if(Fe.$ref&&(mt.ignoreKeywordsWithRef||!(0,N.schemaHasRulesButRef)(Fe,et))){Ve.block(()=>Be(X,"$ref",et.all.$ref.definition));return}if(!mt.jtd)We(X,ue);Ve.block(()=>{for(let lt of et.rules)Rt(lt);Rt(et.post)});function Rt(lt){if(!(0,g.shouldUseGroup)(Fe,lt))return;if(lt.type){if(Ve.if((0,S.checkDataType)(lt.type,ot,mt.strictNumbers)),nt(X,lt),ue.length===1&&ue[0]===lt.type&&_e)Ve.else(),(0,S.reportTypeError)(X);Ve.endIf()}else nt(X,lt);if(!ct)Ve.if(y._`${P.default.errors} === ${De||0}`)}}function nt(X,ue){let{gen:_e,schema:De,opts:{useDefaults:Ve}}=X;if(Ve)(0,b.assignDefaults)(X,ue.type);_e.block(()=>{for(let Fe of ue.rules)if((0,g.shouldUseRule)(De,Fe))Be(X,Fe.keyword,Fe.definition,ue.type)})}function We(X,ue){if(X.schemaEnv.meta||!X.opts.strictTypes)return;if(ee(X,ue),!X.opts.allowUnionTypes)le(X,ue);we(X,X.dataTypes)}function ee(X,ue){if(!ue.length)return;if(!X.dataTypes.length){X.dataTypes=ue;return}ue.forEach((_e)=>{if(!Q(X.dataTypes,_e))je(X,`type "${_e}" not allowed by context "${X.dataTypes.join(",")}"`)}),te(X,ue)}function le(X,ue){if(ue.length>1&&!(ue.length===2&&ue.includes("null")))je(X,"use allowUnionTypes to allow union type keyword")}function we(X,ue){let _e=X.self.RULES.all;for(let De in _e){let Ve=_e[De];if(typeof Ve=="object"&&(0,g.shouldUseRule)(X.schema,Ve)){let{type:Fe}=Ve.definition;if(Fe.length&&!Fe.some((ot)=>G(ue,ot)))je(X,`missing type "${Fe.join(",")}" for keyword "${De}"`)}}}function G(X,ue){return X.includes(ue)||ue==="number"&&X.includes("integer")}function Q(X,ue){return X.includes(ue)||ue==="integer"&&X.includes("number")}function te(X,ue){let _e=[];for(let De of X.dataTypes)if(Q(ue,De))_e.push(De);else if(ue.includes("integer")&&De==="number")_e.push("integer");X.dataTypes=_e}function je(X,ue){let _e=X.schemaEnv.baseId+X.errSchemaPath;ue+=` at "${_e}" (strictTypes)`,(0,N.checkStrictMode)(X,ue,X.opts.strictTypes)}var Me=class{constructor(X,ue,_e){if((0,_.validateKeywordUsage)(X,ue,_e),this.gen=X.gen,this.allErrors=X.allErrors,this.keyword=_e,this.data=X.data,this.schema=X.schema[_e],this.$data=ue.$data&&X.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,N.schemaRefOrVal)(X,this.schema,_e,this.$data),this.schemaType=ue.schemaType,this.parentSchema=X.schema,this.params={},this.it=X,this.def=ue,this.$data)this.schemaCode=X.gen.const("vSchema",St(this.$data,X));else if(this.schemaCode=this.schemaValue,!(0,_.validSchemaType)(this.schema,ue.schemaType,ue.allowUndefined))throw Error(`${_e} value must be ${JSON.stringify(ue.schemaType)}`);if("code"in ue?ue.trackErrors:ue.errors!==!1)this.errsCount=X.gen.const("_errs",P.default.errors)}result(X,ue,_e){this.failResult((0,y.not)(X),ue,_e)}failResult(X,ue,_e){if(this.gen.if(X),_e)_e();else this.error();if(ue){if(this.gen.else(),ue(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(X,ue){this.failResult((0,y.not)(X),void 0,ue)}fail(X){if(X===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(X),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(X){if(!this.$data)return this.fail(X);let{schemaCode:ue}=this;this.fail(y._`${ue} !== undefined && (${(0,y.or)(this.invalid$data(),X)})`)}error(X,ue,_e){if(ue){this.setParams(ue),this._error(X,_e),this.setParams({});return}this._error(X,_e)}_error(X,ue){(X?J.reportExtraError:J.reportError)(this,this.def.error,ue)}$dataError(){(0,J.reportError)(this,this.def.$dataError||J.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,J.resetErrorsCount)(this.gen,this.errsCount)}ok(X){if(!this.allErrors)this.gen.if(X)}setParams(X,ue){if(ue)Object.assign(this.params,X);else this.params=X}block$data(X,ue,_e=y.nil){this.gen.block(()=>{this.check$data(X,_e),ue()})}check$data(X=y.nil,ue=y.nil){if(!this.$data)return;let{gen:_e,schemaCode:De,schemaType:Ve,def:Fe}=this;if(_e.if((0,y.or)(y._`${De} === undefined`,ue)),X!==y.nil)_e.assign(X,!0);if(Ve.length||Fe.validateSchema){if(_e.elseIf(this.invalid$data()),this.$dataError(),X!==y.nil)_e.assign(X,!1)}_e.else()}invalid$data(){let{gen:X,schemaCode:ue,schemaType:_e,def:De,it:Ve}=this;return(0,y.or)(Fe(),ot());function Fe(){if(_e.length){if(!(ue instanceof y.Name))throw Error("ajv implementation error");let ct=Array.isArray(_e)?_e:[_e];return y._`${(0,S.checkDataTypes)(ct,ue,Ve.opts.strictNumbers,S.DataType.Wrong)}`}return y.nil}function ot(){if(De.validateSchema){let ct=X.scopeValue("validate$data",{ref:De.validateSchema});return y._`!${ct}(${ue})`}return y.nil}}subschema(X,ue){let _e=(0,R.getSubschema)(this.it,X);(0,R.extendSubschemaData)(_e,this.it,X),(0,R.extendSubschemaMode)(_e,X);let De={...this.it,..._e,items:void 0,props:void 0};return B(De,ue),De}mergeEvaluated(X,ue){let{it:_e,gen:De}=this;if(!_e.opts.unevaluated)return;if(_e.props!==!0&&X.props!==void 0)_e.props=N.mergeEvaluated.props(De,X.props,_e.props,ue);if(_e.items!==!0&&X.items!==void 0)_e.items=N.mergeEvaluated.items(De,X.items,_e.items,ue)}mergeValidEvaluated(X,ue){let{it:_e,gen:De}=this;if(_e.opts.unevaluated&&(_e.props!==!0||_e.items!==!0))return De.if(ue,()=>this.mergeEvaluated(X,y.Name)),!0}};m.KeywordCxt=Me;function Be(X,ue,_e,De){let Ve=new Me(X,_e,ue);if("code"in _e)_e.code(Ve,De);else if(Ve.$data&&_e.validate)(0,_.funcKeywordCode)(Ve,_e);else if("macro"in _e)(0,_.macroKeywordCode)(Ve,_e);else if(_e.compile||_e.validate)(0,_.funcKeywordCode)(Ve,_e)}let Ue=/^\/(?:[^~]|~0|~1)*$/,Xe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function St(X,{dataLevel:ue,dataNames:_e,dataPathArr:De}){let Ve,Fe;if(X==="")return P.default.rootData;if(X[0]==="/"){if(!Ue.test(X))throw Error(`Invalid JSON-pointer: ${X}`);Ve=X,Fe=P.default.rootData}else{let it=Xe.exec(X);if(!it)throw Error(`Invalid JSON-pointer: ${X}`);let et=+it[1];if(Ve=it[2],Ve==="#"){if(et>=ue)throw Error(mt("property/index",et));return De[ue-et]}if(et>ue)throw Error(mt("data",et));if(Fe=_e[ue-et],!Ve)return Fe}let ot=Fe,ct=Ve.split("/");for(let it of ct)if(it)Fe=y._`${Fe}${(0,y.getProperty)((0,N.unescapeJsonPointer)(it))}`,ot=y._`${ot} && ${Fe}`;return ot;function mt(it,et){return`Cannot access ${it} ${et} levels up, current level is ${ue}`}}m.getData=St}),Wr=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});var h=class extends Error{constructor(f){super("validation failed");this.errors=f,this.ajv=this.validation=!0}};m.default=h}),Ha=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=_n();var f=class extends Error{constructor(g,S,b,_){super(_||`can't resolve reference ${b} from id ${S}`);this.missingRef=(0,h.resolveUrl)(g,S,b),this.missingSchema=(0,h.normalizeId)((0,h.getFullPath)(g,this.missingRef))}};m.default=f}),yn=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.resolveSchema=m.getCompilingSchema=m.resolveRef=m.compileSchema=m.SchemaEnv=void 0;let h=He(),f=Wr(),g=Et(),S=_n(),b=Ye(),_=Ua();var R=class{constructor(z){var F;this.refs={},this.dynamicAnchors={};let w;if(typeof z.schema=="object")w=z.schema;this.schema=z.schema,this.schemaId=z.schemaId,this.root=z.root||this,this.baseId=(F=z.baseId)!==null&&F!==void 0?F:(0,S.normalizeId)(w===null||w===void 0?void 0:w[z.schemaId||"$id"]),this.schemaPath=z.schemaPath,this.localRefs=z.localRefs,this.meta=z.meta,this.$async=w===null||w===void 0?void 0:w.$async,this.refs={}}};m.SchemaEnv=R;function y(z){let F=N.call(this,z);if(F)return F;let w=(0,S.getFullPath)(this.opts.uriResolver,z.root.baseId),{es5:B,lines:Y}=this.opts.code,{ownProperties:U}=this.opts,T=new h.CodeGen(this.scope,{es5:B,lines:Y,ownProperties:U}),Z;if(z.$async)Z=T.scopeValue("Error",{ref:f.default,code:h._`require("ajv/dist/runtime/validation_error").default`});let de=T.scopeName("validate");z.validateName=de;let qe={gen:T,allErrors:this.opts.allErrors,data:g.default.data,parentData:g.default.parentData,parentDataProperty:g.default.parentDataProperty,dataNames:[g.default.data],dataPathArr:[h.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:T.scopeValue("schema",this.opts.code.source===!0?{ref:z.schema,code:(0,h.stringify)(z.schema)}:{ref:z.schema}),validateName:de,ValidationError:Z,schema:z.schema,schemaEnv:z,rootId:w,baseId:z.baseId||w,schemaPath:h.nil,errSchemaPath:z.schemaPath||(this.opts.jtd?"":"#"),errorPath:h._`""`,opts:this.opts,self:this},ge;try{this._compilations.add(z),(0,_.validateFunctionCode)(qe),T.optimize(this.opts.code.optimize);let ve=T.toString();if(ge=`${T.scopeRefs(g.default.scope)}return ${ve}`,this.opts.code.process)ge=this.opts.code.process(ge,z);let Ie=Function(`${g.default.self}`,`${g.default.scope}`,ge)(this,this.scope.get());if(this.scope.value(de,{ref:Ie}),Ie.errors=null,Ie.schema=z.schema,Ie.schemaEnv=z,z.$async)Ie.$async=!0;if(this.opts.code.source===!0)Ie.source={validateName:de,validateCode:ve,scopeValues:T._values};if(this.opts.unevaluated){let{props:Ne,items:Ge}=qe;if(Ie.evaluated={props:Ne instanceof h.Name?void 0:Ne,items:Ge instanceof h.Name?void 0:Ge,dynamicProps:Ne instanceof h.Name,dynamicItems:Ge instanceof h.Name},Ie.source)Ie.source.evaluated=(0,h.stringify)(Ie.evaluated)}return z.validate=Ie,z}catch(ve){if(delete z.validate,delete z.validateName,ge)this.logger.error("Error compiling schema, function code:",ge);throw ve}finally{this._compilations.delete(z)}}m.compileSchema=y;function P(z,F,w){var B;w=(0,S.resolveUrl)(this.opts.uriResolver,F,w);let Y=z.refs[w];if(Y)return Y;let U=W.call(this,z,w);if(U===void 0){let T=(B=z.localRefs)===null||B===void 0?void 0:B[w],{schemaId:Z}=this.opts;if(T)U=new R({schema:T,schemaId:Z,root:z,baseId:F})}if(U===void 0)return;return z.refs[w]=C.call(this,U)}m.resolveRef=P;function C(z){if((0,S.inlineRef)(z.schema,this.opts.inlineRefs))return z.schema;return z.validate?z:y.call(this,z)}function N(z){for(let F of this._compilations)if(J(F,z))return F}m.getCompilingSchema=N;function J(z,F){return z.schema===F.schema&&z.root===F.root&&z.baseId===F.baseId}function W(z,F){let w;while(typeof(w=this.refs[F])=="string")F=w;return w||this.schemas[F]||L.call(this,z,F)}function L(z,F){let w=this.opts.uriResolver.parse(F),B=(0,S._getFullPath)(this.opts.uriResolver,w),Y=(0,S.getFullPath)(this.opts.uriResolver,z.baseId,void 0);if(Object.keys(z.schema).length>0&&B===Y)return I.call(this,w,z);let U=(0,S.normalizeId)(B),T=this.refs[U]||this.schemas[U];if(typeof T=="string"){let Z=L.call(this,z,T);if(typeof(Z===null||Z===void 0?void 0:Z.schema)!=="object")return;return I.call(this,w,Z)}if(typeof(T===null||T===void 0?void 0:T.schema)!=="object")return;if(!T.validate)y.call(this,T);if(U===(0,S.normalizeId)(F)){let{schema:Z}=T,{schemaId:de}=this.opts,qe=Z[de];if(qe)Y=(0,S.resolveUrl)(this.opts.uriResolver,Y,qe);return new R({schema:Z,schemaId:de,root:z,baseId:Y})}return I.call(this,w,T)}m.resolveSchema=L;let K=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function I(z,{baseId:F,schema:w,root:B}){var Y;if(((Y=z.fragment)===null||Y===void 0?void 0:Y[0])!=="/")return;for(let Z of z.fragment.slice(1).split("/")){if(typeof w==="boolean")return;let de=w[(0,b.unescapeFragment)(Z)];if(de===void 0)return;w=de;let qe=typeof w==="object"&&w[this.opts.schemaId];if(!K.has(Z)&&qe)F=(0,S.resolveUrl)(this.opts.uriResolver,F,qe)}let U;if(typeof w!="boolean"&&w.$ref&&!(0,b.schemaHasRulesButRef)(w,this.RULES)){let Z=(0,S.resolveUrl)(this.opts.uriResolver,F,w.$ref);U=L.call(this,B,Z)}let{schemaId:T}=this.opts;if(U=U||new R({schema:w,schemaId:T,root:B,baseId:F}),U.schema!==U.root.schema)return U}}),id=ye((m,h)=>{h.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}}),Ic=ye((m,h)=>{let f=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),g=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 S(L){let K="",I=0,z=0;for(z=0;z<L.length;z++){if(I=L[z].charCodeAt(0),I===48)continue;if(!(I>=48&&I<=57||I>=65&&I<=70||I>=97&&I<=102))return"";K+=L[z];break}for(z+=1;z<L.length;z++){if(I=L[z].charCodeAt(0),!(I>=48&&I<=57||I>=65&&I<=70||I>=97&&I<=102))return"";K+=L[z]}return K}let b=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function _(L){return L.length=0,!0}function R(L,K,I){if(L.length){let z=S(L);if(z!=="")K.push(z);else return I.error=!0,!1;L.length=0}return!0}function y(L){let K=0,I={error:!1,address:"",zone:""},z=[],F=[],w=!1,B=!1,Y=R;for(let U=0;U<L.length;U++){let T=L[U];if(T==="["||T==="]")continue;if(T===":"){if(w===!0)B=!0;if(!Y(F,z,I))break;if(++K>7){I.error=!0;break}if(U>0&&L[U-1]===":")w=!0;z.push(":");continue}else if(T==="%"){if(!Y(F,z,I))break;Y=_}else{F.push(T);continue}}if(F.length)if(Y===_)I.zone=F.join("");else if(B)z.push(F.join(""));else z.push(S(F));return I.address=z.join(""),I}function P(L){if(C(L,":")<2)return{host:L,isIPV6:!1};let K=y(L);if(!K.error){let{address:I,address:z}=K;if(K.zone)I+="%"+K.zone,z+="%25"+K.zone;return{host:I,isIPV6:!0,escapedHost:z}}else return{host:L,isIPV6:!1}}function C(L,K){let I=0;for(let z=0;z<L.length;z++)if(L[z]===K)I++;return I}function N(L){let K=L,I=[],z=-1,F=0;while(F=K.length){if(F===1)if(K===".")break;else if(K==="/"){I.push("/");break}else{I.push(K);break}else if(F===2){if(K[0]==="."){if(K[1]===".")break;else if(K[1]==="/"){K=K.slice(2);continue}}else if(K[0]==="/"){if(K[1]==="."||K[1]==="/"){I.push("/");break}}}else if(F===3){if(K==="/.."){if(I.length!==0)I.pop();I.push("/");break}}if(K[0]==="."){if(K[1]==="."){if(K[2]==="/"){K=K.slice(3);continue}}else if(K[1]==="/"){K=K.slice(2);continue}}else if(K[0]==="/"){if(K[1]==="."){if(K[2]==="/"){K=K.slice(2);continue}else if(K[2]==="."){if(K[3]==="/"){if(K=K.slice(3),I.length!==0)I.pop();continue}}}}if((z=K.indexOf("/",1))===-1){I.push(K);break}else I.push(K.slice(0,z)),K=K.slice(z)}return I.join("")}function J(L,K){let I=K!==!0?escape:unescape;if(L.scheme!==void 0)L.scheme=I(L.scheme);if(L.userinfo!==void 0)L.userinfo=I(L.userinfo);if(L.host!==void 0)L.host=I(L.host);if(L.path!==void 0)L.path=I(L.path);if(L.query!==void 0)L.query=I(L.query);if(L.fragment!==void 0)L.fragment=I(L.fragment);return L}function W(L){let K=[];if(L.userinfo!==void 0)K.push(L.userinfo),K.push("@");if(L.host!==void 0){let I=unescape(L.host);if(!g(I)){let z=P(I);if(z.isIPV6===!0)I=`[${z.escapedHost}]`;else I=L.host}K.push(I)}if(typeof L.port==="number"||typeof L.port==="string")K.push(":"),K.push(String(L.port));return K.length?K.join(""):void 0}h.exports={nonSimpleDomain:b,recomposeAuthority:W,normalizeComponentEncoding:J,removeDotSegments:N,isIPv4:g,isUUID:f,normalizeIPv6:P,stringArrayToHexStripped:S}}),cd=ye((m,h)=>{let{isUUID:f}=Ic(),g=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,S=["http","https","ws","wss","urn","urn:uuid"];function b(T){return S.indexOf(T)!==-1}function _(T){if(T.secure===!0)return!0;else if(T.secure===!1)return!1;else if(T.scheme)return T.scheme.length===3&&(T.scheme[0]==="w"||T.scheme[0]==="W")&&(T.scheme[1]==="s"||T.scheme[1]==="S")&&(T.scheme[2]==="s"||T.scheme[2]==="S");else return!1}function R(T){if(!T.host)T.error=T.error||"HTTP URIs must have a host.";return T}function y(T){let Z=String(T.scheme).toLowerCase()==="https";if(T.port===(Z?443:80)||T.port==="")T.port=void 0;if(!T.path)T.path="/";return T}function P(T){return T.secure=_(T),T.resourceName=(T.path||"/")+(T.query?"?"+T.query:""),T.path=void 0,T.query=void 0,T}function C(T){if(T.port===(_(T)?443:80)||T.port==="")T.port=void 0;if(typeof T.secure==="boolean")T.scheme=T.secure?"wss":"ws",T.secure=void 0;if(T.resourceName){let[Z,de]=T.resourceName.split("?");T.path=Z&&Z!=="/"?Z:void 0,T.query=de,T.resourceName=void 0}return T.fragment=void 0,T}function N(T,Z){if(!T.path)return T.error="URN can not be parsed",T;let de=T.path.match(g);if(de){let qe=Z.scheme||T.scheme||"urn";T.nid=de[1].toLowerCase(),T.nss=de[2];let ge=U(`${qe}:${Z.nid||T.nid}`);if(T.path=void 0,ge)T=ge.parse(T,Z)}else T.error=T.error||"URN can not be parsed.";return T}function J(T,Z){if(T.nid===void 0)throw Error("URN without nid cannot be serialized");let de=Z.scheme||T.scheme||"urn",qe=T.nid.toLowerCase(),ge=U(`${de}:${Z.nid||qe}`);if(ge)T=ge.serialize(T,Z);let ve=T,Ie=T.nss;return ve.path=`${qe||Z.nid}:${Ie}`,Z.skipEscape=!0,ve}function W(T,Z){let de=T;if(de.uuid=de.nss,de.nss=void 0,!Z.tolerant&&(!de.uuid||!f(de.uuid)))de.error=de.error||"UUID is not valid.";return de}function L(T){let Z=T;return Z.nss=(T.uuid||"").toLowerCase(),Z}let K={scheme:"http",domainHost:!0,parse:R,serialize:y},I={scheme:"https",domainHost:K.domainHost,parse:R,serialize:y},z={scheme:"ws",domainHost:!0,parse:P,serialize:C},F={scheme:"wss",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize},Y={http:K,https:I,ws:z,wss:F,urn:{scheme:"urn",parse:N,serialize:J,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:W,serialize:L,skipNormalize:!0}};Object.setPrototypeOf(Y,null);function U(T){return T&&(Y[T]||Y[T.toLowerCase()])||void 0}h.exports={wsIsSecure:_,SCHEMES:Y,isValidSchemeName:b,getSchemeHandler:U}}),ld=ye((m,h)=>{let{normalizeIPv6:f,removeDotSegments:g,recomposeAuthority:S,normalizeComponentEncoding:b,isIPv4:_,nonSimpleDomain:R}=Ic(),{SCHEMES:y,getSchemeHandler:P}=cd();function C(F,w){if(typeof F==="string")F=L(I(F,w),w);else if(typeof F==="object")F=I(L(F,w),w);return F}function N(F,w,B){let Y=B?Object.assign({scheme:"null"},B):{scheme:"null"},U=J(I(F,Y),I(w,Y),Y,!0);return Y.skipEscape=!0,L(U,Y)}function J(F,w,B,Y){let U={};if(!Y)F=I(L(F,B),B),w=I(L(w,B),B);if(B=B||{},!B.tolerant&&w.scheme)U.scheme=w.scheme,U.userinfo=w.userinfo,U.host=w.host,U.port=w.port,U.path=g(w.path||""),U.query=w.query;else{if(w.userinfo!==void 0||w.host!==void 0||w.port!==void 0)U.userinfo=w.userinfo,U.host=w.host,U.port=w.port,U.path=g(w.path||""),U.query=w.query;else{if(!w.path)if(U.path=F.path,w.query!==void 0)U.query=w.query;else U.query=F.query;else{if(w.path[0]==="/")U.path=g(w.path);else{if((F.userinfo!==void 0||F.host!==void 0||F.port!==void 0)&&!F.path)U.path="/"+w.path;else if(!F.path)U.path=w.path;else U.path=F.path.slice(0,F.path.lastIndexOf("/")+1)+w.path;U.path=g(U.path)}U.query=w.query}U.userinfo=F.userinfo,U.host=F.host,U.port=F.port}U.scheme=F.scheme}return U.fragment=w.fragment,U}function W(F,w,B){if(typeof F==="string")F=unescape(F),F=L(b(I(F,B),!0),{...B,skipEscape:!0});else if(typeof F==="object")F=L(b(F,!0),{...B,skipEscape:!0});if(typeof w==="string")w=unescape(w),w=L(b(I(w,B),!0),{...B,skipEscape:!0});else if(typeof w==="object")w=L(b(w,!0),{...B,skipEscape:!0});return F.toLowerCase()===w.toLowerCase()}function L(F,w){let B={host:F.host,scheme:F.scheme,userinfo:F.userinfo,port:F.port,path:F.path,query:F.query,nid:F.nid,nss:F.nss,uuid:F.uuid,fragment:F.fragment,reference:F.reference,resourceName:F.resourceName,secure:F.secure,error:""},Y=Object.assign({},w),U=[],T=P(Y.scheme||B.scheme);if(T&&T.serialize)T.serialize(B,Y);if(B.path!==void 0)if(!Y.skipEscape){if(B.path=escape(B.path),B.scheme!==void 0)B.path=B.path.split("%3A").join(":")}else B.path=unescape(B.path);if(Y.reference!=="suffix"&&B.scheme)U.push(B.scheme,":");let Z=S(B);if(Z!==void 0){if(Y.reference!=="suffix")U.push("//");if(U.push(Z),B.path&&B.path[0]!=="/")U.push("/")}if(B.path!==void 0){let de=B.path;if(!Y.absolutePath&&(!T||!T.absolutePath))de=g(de);if(Z===void 0&&de[0]==="/"&&de[1]==="/")de="/%2F"+de.slice(2);U.push(de)}if(B.query!==void 0)U.push("?",B.query);if(B.fragment!==void 0)U.push("#",B.fragment);return U.join("")}let K=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function I(F,w){let B=Object.assign({},w),Y={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},U=!1;if(B.reference==="suffix")if(B.scheme)F=B.scheme+":"+F;else F="//"+F;let T=F.match(K);if(T){if(Y.scheme=T[1],Y.userinfo=T[3],Y.host=T[4],Y.port=parseInt(T[5],10),Y.path=T[6]||"",Y.query=T[7],Y.fragment=T[8],isNaN(Y.port))Y.port=T[5];if(Y.host)if(_(Y.host)===!1){let de=f(Y.host);Y.host=de.host.toLowerCase(),U=de.isIPV6}else U=!0;if(Y.scheme===void 0&&Y.userinfo===void 0&&Y.host===void 0&&Y.port===void 0&&Y.query===void 0&&!Y.path)Y.reference="same-document";else if(Y.scheme===void 0)Y.reference="relative";else if(Y.fragment===void 0)Y.reference="absolute";else Y.reference="uri";if(B.reference&&B.reference!=="suffix"&&B.reference!==Y.reference)Y.error=Y.error||"URI is not a "+B.reference+" reference.";let Z=P(B.scheme||Y.scheme);if(!B.unicodeSupport&&(!Z||!Z.unicodeSupport)){if(Y.host&&(B.domainHost||Z&&Z.domainHost)&&U===!1&&R(Y.host))try{Y.host=URL.domainToASCII(Y.host.toLowerCase())}catch(de){Y.error=Y.error||"Host's domain name can not be converted to ASCII: "+de}}if(!Z||Z&&!Z.skipNormalize){if(F.indexOf("%")!==-1){if(Y.scheme!==void 0)Y.scheme=unescape(Y.scheme);if(Y.host!==void 0)Y.host=unescape(Y.host)}if(Y.path)Y.path=escape(unescape(Y.path));if(Y.fragment)Y.fragment=encodeURI(decodeURIComponent(Y.fragment))}if(Z&&Z.parse)Z.parse(Y,B)}else Y.error=Y.error||"URI can not be parsed.";return Y}let z={SCHEMES:y,normalize:C,resolve:N,resolveComponent:J,equal:W,serialize:L,parse:I};h.exports=z,h.exports.default=z,h.exports.fastUri=z}),ud=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=ld();h.code='require("ajv/dist/runtime/uri").default',m.default=h}),$i=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=void 0;var h=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var f=He();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});let g=Wr(),S=Ha(),b=qc(),_=yn(),R=He(),y=_n(),P=gn(),C=Ye(),N=id(),J=ud(),W=(ee,le)=>new RegExp(ee,le);W.code="new RegExp";let L=["removeAdditional","useDefaults","coerceTypes"],K=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),I={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."},z={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},F=200;function w(ee){var le,we,G,Q,te,je,Me,Be,Ue,Xe,St,X,ue,_e,De,Ve,Fe,ot,ct,mt,it,et,Rt,lt,Tt;let $t=ee.strict,Ct=(le=ee.code)===null||le===void 0?void 0:le.optimize,It=Ct===!0||Ct===void 0?1:Ct||0,Ot=(G=(we=ee.code)===null||we===void 0?void 0:we.regExp)!==null&&G!==void 0?G:W,Xt=(Q=ee.uriResolver)!==null&&Q!==void 0?Q:J.default;return{strictSchema:(je=(te=ee.strictSchema)!==null&&te!==void 0?te:$t)!==null&&je!==void 0?je:!0,strictNumbers:(Be=(Me=ee.strictNumbers)!==null&&Me!==void 0?Me:$t)!==null&&Be!==void 0?Be:!0,strictTypes:(Xe=(Ue=ee.strictTypes)!==null&&Ue!==void 0?Ue:$t)!==null&&Xe!==void 0?Xe:"log",strictTuples:(X=(St=ee.strictTuples)!==null&&St!==void 0?St:$t)!==null&&X!==void 0?X:"log",strictRequired:(_e=(ue=ee.strictRequired)!==null&&ue!==void 0?ue:$t)!==null&&_e!==void 0?_e:!1,code:ee.code?{...ee.code,optimize:It,regExp:Ot}:{optimize:It,regExp:Ot},loopRequired:(De=ee.loopRequired)!==null&&De!==void 0?De:F,loopEnum:(Ve=ee.loopEnum)!==null&&Ve!==void 0?Ve:F,meta:(Fe=ee.meta)!==null&&Fe!==void 0?Fe:!0,messages:(ot=ee.messages)!==null&&ot!==void 0?ot:!0,inlineRefs:(ct=ee.inlineRefs)!==null&&ct!==void 0?ct:!0,schemaId:(mt=ee.schemaId)!==null&&mt!==void 0?mt:"$id",addUsedSchema:(it=ee.addUsedSchema)!==null&&it!==void 0?it:!0,validateSchema:(et=ee.validateSchema)!==null&&et!==void 0?et:!0,validateFormats:(Rt=ee.validateFormats)!==null&&Rt!==void 0?Rt:!0,unicodeRegExp:(lt=ee.unicodeRegExp)!==null&<!==void 0?lt:!0,int32range:(Tt=ee.int32range)!==null&&Tt!==void 0?Tt:!0,uriResolver:Xt}}var B=class{constructor(ee={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,ee=this.opts={...ee,...w(ee)};let{es5:le,lines:we}=this.opts.code;this.scope=new R.ValueScope({scope:{},prefixes:K,es5:le,lines:we}),this.logger=ve(ee.logger);let G=ee.validateFormats;if(ee.validateFormats=!1,this.RULES=(0,b.getRules)(),Y.call(this,I,ee,"NOT SUPPORTED"),Y.call(this,z,ee,"DEPRECATED","warn"),this._metaOpts=qe.call(this),ee.formats)Z.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),ee.keywords)de.call(this,ee.keywords);if(typeof ee.meta=="object")this.addMetaSchema(ee.meta);T.call(this),ee.validateFormats=G}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:ee,meta:le,schemaId:we}=this.opts,G=N;if(we==="id")G={...N},G.id=G.$id,delete G.$id;if(le&&ee)this.addMetaSchema(G,G[we],!1)}defaultMeta(){let{meta:ee,schemaId:le}=this.opts;return this.opts.defaultMeta=typeof ee=="object"?ee[le]||ee:void 0}validate(ee,le){let we;if(typeof ee=="string"){if(we=this.getSchema(ee),!we)throw Error(`no schema with key or ref "${ee}"`)}else we=this.compile(ee);let G=we(le);if(!("$async"in we))this.errors=we.errors;return G}compile(ee,le){let we=this._addSchema(ee,le);return we.validate||this._compileSchemaEnv(we)}compileAsync(ee,le){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:we}=this.opts;return G.call(this,ee,le);async function G(Ue,Xe){await Q.call(this,Ue.$schema);let St=this._addSchema(Ue,Xe);return St.validate||te.call(this,St)}async function Q(Ue){if(Ue&&!this.getSchema(Ue))await G.call(this,{$ref:Ue},!0)}async function te(Ue){try{return this._compileSchemaEnv(Ue)}catch(Xe){if(!(Xe instanceof S.default))throw Xe;return je.call(this,Xe),await Me.call(this,Xe.missingSchema),te.call(this,Ue)}}function je({missingSchema:Ue,missingRef:Xe}){if(this.refs[Ue])throw Error(`AnySchema ${Ue} is loaded but ${Xe} cannot be resolved`)}async function Me(Ue){let Xe=await Be.call(this,Ue);if(!this.refs[Ue])await Q.call(this,Xe.$schema);if(!this.refs[Ue])this.addSchema(Xe,Ue,le)}async function Be(Ue){let Xe=this._loading[Ue];if(Xe)return Xe;try{return await(this._loading[Ue]=we(Ue))}finally{delete this._loading[Ue]}}}addSchema(ee,le,we,G=this.opts.validateSchema){if(Array.isArray(ee)){for(let te of ee)this.addSchema(te,void 0,we,G);return this}let Q;if(typeof ee==="object"){let{schemaId:te}=this.opts;if(Q=ee[te],Q!==void 0&&typeof Q!="string")throw Error(`schema ${te} must be string`)}return le=(0,y.normalizeId)(le||Q),this._checkUnique(le),this.schemas[le]=this._addSchema(ee,we,le,G,!0),this}addMetaSchema(ee,le,we=this.opts.validateSchema){return this.addSchema(ee,le,!0,we),this}validateSchema(ee,le){if(typeof ee=="boolean")return!0;let we;if(we=ee.$schema,we!==void 0&&typeof we!="string")throw Error("$schema must be a string");if(we=we||this.opts.defaultMeta||this.defaultMeta(),!we)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let G=this.validate(we,ee);if(!G&&le){let Q="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(Q);else throw Error(Q)}return G}getSchema(ee){let le;while(typeof(le=U.call(this,ee))=="string")ee=le;if(le===void 0){let{schemaId:we}=this.opts,G=new _.SchemaEnv({schema:{},schemaId:we});if(le=_.resolveSchema.call(this,G,ee),!le)return;this.refs[ee]=le}return le.validate||this._compileSchemaEnv(le)}removeSchema(ee){if(ee instanceof RegExp)return this._removeAllSchemas(this.schemas,ee),this._removeAllSchemas(this.refs,ee),this;switch(typeof ee){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let le=U.call(this,ee);if(typeof le=="object")this._cache.delete(le.schema);return delete this.schemas[ee],delete this.refs[ee],this}case"object":{let le=ee;this._cache.delete(le);let we=ee[this.opts.schemaId];if(we)we=(0,y.normalizeId)(we),delete this.schemas[we],delete this.refs[we];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(ee){for(let le of ee)this.addKeyword(le);return this}addKeyword(ee,le){let we;if(typeof ee=="string"){if(we=ee,typeof le=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),le.keyword=we}else if(typeof ee=="object"&&le===void 0){if(le=ee,we=le.keyword,Array.isArray(we)&&!we.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Ne.call(this,we,le),!le)return(0,C.eachItem)(we,(Q)=>Ge.call(this,Q)),this;Ze.call(this,le);let G={...le,type:(0,P.getJSONTypes)(le.type),schemaType:(0,P.getJSONTypes)(le.schemaType)};return(0,C.eachItem)(we,G.type.length===0?(Q)=>Ge.call(this,Q,G):(Q)=>G.type.forEach((te)=>Ge.call(this,Q,G,te))),this}getKeyword(ee){let le=this.RULES.all[ee];return typeof le=="object"?le.definition:!!le}removeKeyword(ee){let{RULES:le}=this;delete le.keywords[ee],delete le.all[ee];for(let we of le.rules){let G=we.rules.findIndex((Q)=>Q.keyword===ee);if(G>=0)we.rules.splice(G,1)}return this}addFormat(ee,le){if(typeof le=="string")le=new RegExp(le);return this.formats[ee]=le,this}errorsText(ee=this.errors,{separator:le=", ",dataVar:we="data"}={}){if(!ee||ee.length===0)return"No errors";return ee.map((G)=>`${we}${G.instancePath} ${G.message}`).reduce((G,Q)=>G+le+Q)}$dataMetaSchema(ee,le){let we=this.RULES.all;ee=JSON.parse(JSON.stringify(ee));for(let G of le){let Q=G.split("/").slice(1),te=ee;for(let je of Q)te=te[je];for(let je in we){let Me=we[je];if(typeof Me!="object")continue;let{$data:Be}=Me.definition,Ue=te[je];if(Be&&Ue)te[je]=We(Ue)}}return ee}_removeAllSchemas(ee,le){for(let we in ee){let G=ee[we];if(!le||le.test(we)){if(typeof G=="string")delete ee[we];else if(G&&!G.meta)this._cache.delete(G.schema),delete ee[we]}}}_addSchema(ee,le,we,G=this.opts.validateSchema,Q=this.opts.addUsedSchema){let te,{schemaId:je}=this.opts;if(typeof ee=="object")te=ee[je];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof ee!="boolean")throw Error("schema must be object or boolean");let Me=this._cache.get(ee);if(Me!==void 0)return Me;we=(0,y.normalizeId)(te||we);let Be=y.getSchemaRefs.call(this,ee,we);if(Me=new _.SchemaEnv({schema:ee,schemaId:je,meta:le,baseId:we,localRefs:Be}),this._cache.set(Me.schema,Me),Q&&!we.startsWith("#")){if(we)this._checkUnique(we);this.refs[we]=Me}if(G)this.validateSchema(ee,!0);return Me}_checkUnique(ee){if(this.schemas[ee]||this.refs[ee])throw Error(`schema with key or id "${ee}" already exists`)}_compileSchemaEnv(ee){if(ee.meta)this._compileMetaSchema(ee);else _.compileSchema.call(this,ee);if(!ee.validate)throw Error("ajv implementation error");return ee.validate}_compileMetaSchema(ee){let le=this.opts;this.opts=this._metaOpts;try{_.compileSchema.call(this,ee)}finally{this.opts=le}}};B.ValidationError=g.default,B.MissingRefError=S.default,m.default=B;function Y(ee,le,we,G="error"){for(let Q in ee){let te=Q;if(te in le)this.logger[G](`${we}: option ${Q}. ${ee[te]}`)}}function U(ee){return ee=(0,y.normalizeId)(ee),this.schemas[ee]||this.refs[ee]}function T(){let ee=this.opts.schemas;if(!ee)return;if(Array.isArray(ee))this.addSchema(ee);else for(let le in ee)this.addSchema(ee[le],le)}function Z(){for(let ee in this.opts.formats){let le=this.opts.formats[ee];if(le)this.addFormat(ee,le)}}function de(ee){if(Array.isArray(ee)){this.addVocabulary(ee);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let le in ee){let we=ee[le];if(!we.keyword)we.keyword=le;this.addKeyword(we)}}function qe(){let ee={...this.opts};for(let le of L)delete ee[le];return ee}let ge={log(){},warn(){},error(){}};function ve(ee){if(ee===!1)return ge;if(ee===void 0)return console;if(ee.log&&ee.warn&&ee.error)return ee;throw Error("logger must implement log, warn and error methods")}let Ie=/^[a-z_$][a-z0-9_$:-]*$/i;function Ne(ee,le){let{RULES:we}=this;if((0,C.eachItem)(ee,(G)=>{if(we.keywords[G])throw Error(`Keyword ${G} is already defined`);if(!Ie.test(G))throw Error(`Keyword ${G} has invalid name`)}),!le)return;if(le.$data&&!(("code"in le)||("validate"in le)))throw Error('$data keyword must have "code" or "validate" function')}function Ge(ee,le,we){var G;let Q=le===null||le===void 0?void 0:le.post;if(we&&Q)throw Error('keyword with "post" flag cannot have "type"');let{RULES:te}=this,je=Q?te.post:te.rules.find(({type:Be})=>Be===we);if(!je)je={type:we,rules:[]},te.rules.push(je);if(te.keywords[ee]=!0,!le)return;let Me={keyword:ee,definition:{...le,type:(0,P.getJSONTypes)(le.type),schemaType:(0,P.getJSONTypes)(le.schemaType)}};if(le.before)Qe.call(this,je,Me,le.before);else je.rules.push(Me);te.all[ee]=Me,(G=le.implements)===null||G===void 0||G.forEach((Be)=>this.addKeyword(Be))}function Qe(ee,le,we){let G=ee.rules.findIndex((Q)=>Q.keyword===we);if(G>=0)ee.rules.splice(G,0,le);else ee.rules.push(le),this.logger.warn(`rule ${we} is not defined`)}function Ze(ee){let{metaSchema:le}=ee;if(le===void 0)return;if(ee.$data&&this.opts.$data)le=We(le);ee.validateSchema=this.compile(le,!0)}let nt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function We(ee){return{anyOf:[ee,nt]}}});var dd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};m.default=h}),Pi=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.callRef=m.getValidate=void 0;let h=Ha(),f=wt(),g=He(),S=Et(),b=yn(),_=Ye(),R={keyword:"$ref",schemaType:"string",code(C){let{gen:N,schema:J,it:W}=C,{baseId:L,schemaEnv:K,validateName:I,opts:z,self:F}=W,{root:w}=K;if((J==="#"||J==="#/")&&L===w.baseId)return Y();let B=b.resolveRef.call(F,w,L,J);if(B===void 0)throw new h.default(W.opts.uriResolver,L,J);if(B instanceof b.SchemaEnv)return U(B);return T(B);function Y(){if(K===w)return P(C,I,K,K.$async);let Z=N.scopeValue("root",{ref:w});return P(C,g._`${Z}.validate`,w,w.$async)}function U(Z){P(C,y(C,Z),Z,Z.$async)}function T(Z){let de=N.scopeValue("schema",z.code.source===!0?{ref:Z,code:(0,g.stringify)(Z)}:{ref:Z}),qe=N.name("valid"),ge=C.subschema({schema:Z,dataTypes:[],schemaPath:g.nil,topSchemaRef:de,errSchemaPath:J},qe);C.mergeEvaluated(ge),C.ok(qe)}}};function y(C,N){let{gen:J}=C;return N.validate?J.scopeValue("validate",{ref:N.validate}):g._`${J.scopeValue("wrapper",{ref:N})}.validate`}m.getValidate=y;function P(C,N,J,W){let{gen:L,it:K}=C,{allErrors:I,schemaEnv:z,opts:F}=K,w=F.passContext?S.default.this:g.nil;if(W)B();else Y();function B(){if(!z.$async)throw Error("async schema referenced by sync schema");let Z=L.let("valid");L.try(()=>{if(L.code(g._`await ${(0,f.callValidateCode)(C,N,w)}`),T(N),!I)L.assign(Z,!0)},(de)=>{if(L.if(g._`!(${de} instanceof ${K.ValidationError})`,()=>L.throw(de)),U(de),!I)L.assign(Z,!1)}),C.ok(Z)}function Y(){C.result((0,f.callValidateCode)(C,N,w),()=>T(N),()=>U(N))}function U(Z){let de=g._`${Z}.errors`;L.assign(S.default.vErrors,g._`${S.default.vErrors} === null ? ${de} : ${S.default.vErrors}.concat(${de})`),L.assign(S.default.errors,g._`${S.default.vErrors}.length`)}function T(Z){var de;if(!K.opts.unevaluated)return;let qe=(de=J===null||J===void 0?void 0:J.validate)===null||de===void 0?void 0:de.evaluated;if(K.props!==!0)if(qe&&!qe.dynamicProps){if(qe.props!==void 0)K.props=_.mergeEvaluated.props(L,qe.props,K.props)}else{let ge=L.var("props",g._`${Z}.evaluated.props`);K.props=_.mergeEvaluated.props(L,ge,K.props,g.Name)}if(K.items!==!0)if(qe&&!qe.dynamicItems){if(qe.items!==void 0)K.items=_.mergeEvaluated.items(L,qe.items,K.items)}else{let ge=L.var("items",g._`${Z}.evaluated.items`);K.items=_.mergeEvaluated.items(L,ge,K.items,g.Name)}}}m.callRef=P,m.default=R}),Oc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=dd(),f=Pi(),g=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",h.default,f.default];m.default=g}),md=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f=h.operators,g={maximum:{okStr:"<=",ok:f.LTE,fail:f.GT},minimum:{okStr:">=",ok:f.GTE,fail:f.LT},exclusiveMaximum:{okStr:"<",ok:f.LT,fail:f.GTE},exclusiveMinimum:{okStr:">",ok:f.GT,fail:f.LTE}},S={keyword:Object.keys(g),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:b,schemaCode:_})=>h.str`must be ${g[b].okStr} ${_}`,params:({keyword:b,schemaCode:_})=>h._`{comparison: ${g[b].okStr}, limit: ${_}}`},code(b){let{keyword:_,data:R,schemaCode:y}=b;b.fail$data(h._`${R} ${g[_].fail} ${y} || isNaN(${R})`)}};m.default=S}),hd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:g})=>h.str`must be multiple of ${g}`,params:({schemaCode:g})=>h._`{multipleOf: ${g}}`},code(g){let{gen:S,data:b,schemaCode:_,it:R}=g,y=R.opts.multipleOfPrecision,P=S.let("res"),C=y?h._`Math.abs(Math.round(${P}) - ${P}) > 1e-${y}`:h._`${P} !== parseInt(${P})`;g.fail$data(h._`(${_} === 0 || (${P} = ${b}/${_}, ${C}))`)}};m.default=f}),pd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});function h(f){let g=f.length,S=0,b=0,_;while(b<g)if(S++,_=f.charCodeAt(b++),_>=55296&&_<=56319&&b<g){if(_=f.charCodeAt(b),(_&64512)===56320)b++}return S}m.default=h,h.code='require("ajv/dist/runtime/ucs2length").default'}),fd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f=Ye(),g=pd(),S={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:b,schemaCode:_}){let R=b==="maxLength"?"more":"fewer";return h.str`must NOT have ${R} than ${_} characters`},params:({schemaCode:b})=>h._`{limit: ${b}}`},code(b){let{keyword:_,data:R,schemaCode:y,it:P}=b,C=_==="maxLength"?h.operators.GT:h.operators.LT,N=P.opts.unicode===!1?h._`${R}.length`:h._`${(0,f.useFunc)(b.gen,g.default)}(${R})`;b.fail$data(h._`${N} ${C} ${y}`)}};m.default=S}),gd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Ye(),g=He(),S={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:b})=>g.str`must match pattern "${b}"`,params:({schemaCode:b})=>g._`{pattern: ${b}}`},code(b){let{gen:_,data:R,$data:y,schema:P,schemaCode:C,it:N}=b,J=N.opts.unicodeRegExp?"u":"";if(y){let{regExp:W}=N.opts.code,L=W.code==="new RegExp"?g._`new RegExp`:(0,f.useFunc)(_,W),K=_.let("valid");_.try(()=>_.assign(K,g._`${L}(${C}, ${J}).test(${R})`),()=>_.assign(K,!1)),b.fail$data(g._`!${K}`)}else{let W=(0,h.usePattern)(b,P);b.fail$data(g._`!${W}.test(${R})`)}}};m.default=S}),Sd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:g,schemaCode:S}){let b=g==="maxProperties"?"more":"fewer";return h.str`must NOT have ${b} than ${S} properties`},params:({schemaCode:g})=>h._`{limit: ${g}}`},code(g){let{keyword:S,data:b,schemaCode:_}=g,R=S==="maxProperties"?h.operators.GT:h.operators.LT;g.fail$data(h._`Object.keys(${b}).length ${R} ${_}`)}};m.default=f}),_d=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=He(),g=Ye(),S={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:b}})=>f.str`must have required property '${b}'`,params:({params:{missingProperty:b}})=>f._`{missingProperty: ${b}}`},code(b){let{gen:_,schema:R,schemaCode:y,data:P,$data:C,it:N}=b,{opts:J}=N;if(!C&&R.length===0)return;let W=R.length>=J.loopRequired;if(N.allErrors)L();else K();if(J.strictRequired){let F=b.parentSchema.properties,{definedProperties:w}=b.it;for(let B of R)if((F===null||F===void 0?void 0:F[B])===void 0&&!w.has(B)){let Y=`required property "${B}" is not defined at "${N.schemaEnv.baseId+N.errSchemaPath}" (strictRequired)`;(0,g.checkStrictMode)(N,Y,N.opts.strictRequired)}}function L(){if(W||C)b.block$data(f.nil,I);else for(let F of R)(0,h.checkReportMissingProp)(b,F)}function K(){let F=_.let("missing");if(W||C){let w=_.let("valid",!0);b.block$data(w,()=>z(F,w)),b.ok(w)}else _.if((0,h.checkMissingProp)(b,R,F)),(0,h.reportMissingProp)(b,F),_.else()}function I(){_.forOf("prop",y,(F)=>{b.setParams({missingProperty:F}),_.if((0,h.noPropertyInData)(_,P,F,J.ownProperties),()=>b.error())})}function z(F,w){b.setParams({missingProperty:F}),_.forOf(F,y,()=>{_.assign(w,(0,h.propertyInData)(_,P,F,J.ownProperties)),_.if((0,f.not)(w),()=>{b.error(),_.break()})},f.nil)}}};m.default=S}),yd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:g,schemaCode:S}){let b=g==="maxItems"?"more":"fewer";return h.str`must NOT have ${b} than ${S} items`},params:({schemaCode:g})=>h._`{limit: ${g}}`},code(g){let{keyword:S,data:b,schemaCode:_}=g,R=S==="maxItems"?h.operators.GT:h.operators.LT;g.fail$data(h._`${b}.length ${R} ${_}`)}};m.default=f}),Ei=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Nc();h.code='require("ajv/dist/runtime/equal").default',m.default=h}),vd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=gn(),f=He(),g=Ye(),S=Ei(),b={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:_,j:R}})=>f.str`must NOT have duplicate items (items ## ${R} and ${_} are identical)`,params:({params:{i:_,j:R}})=>f._`{i: ${_}, j: ${R}}`},code(_){let{gen:R,data:y,$data:P,schema:C,parentSchema:N,schemaCode:J,it:W}=_;if(!P&&!C)return;let L=R.let("valid"),K=N.items?(0,h.getSchemaTypes)(N.items):[];_.block$data(L,I,f._`${J} === false`),_.ok(L);function I(){let B=R.let("i",f._`${y}.length`),Y=R.let("j");_.setParams({i:B,j:Y}),R.assign(L,!0),R.if(f._`${B} > 1`,()=>(z()?F:w)(B,Y))}function z(){return K.length>0&&!K.some((B)=>B==="object"||B==="array")}function F(B,Y){let U=R.name("item"),T=(0,h.checkDataTypes)(K,U,W.opts.strictNumbers,h.DataType.Wrong),Z=R.const("indices",f._`{}`);R.for(f._`;${B}--;`,()=>{if(R.let(U,f._`${y}[${B}]`),R.if(T,f._`continue`),K.length>1)R.if(f._`typeof ${U} == "string"`,f._`${U} += "_"`);R.if(f._`typeof ${Z}[${U}] == "number"`,()=>{R.assign(Y,f._`${Z}[${U}]`),_.error(),R.assign(L,!1).break()}).code(f._`${Z}[${U}] = ${B}`)})}function w(B,Y){let U=(0,g.useFunc)(R,S.default),T=R.name("outer");R.label(T).for(f._`;${B}--;`,()=>R.for(f._`${Y} = ${B}; ${Y}--;`,()=>R.if(f._`${U}(${y}[${B}], ${y}[${Y}])`,()=>{_.error(),R.assign(L,!1).break(T)})))}}};m.default=b}),bd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f=Ye(),g=Ei(),S={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:b})=>h._`{allowedValue: ${b}}`},code(b){let{gen:_,data:R,$data:y,schemaCode:P,schema:C}=b;if(y||C&&typeof C=="object")b.fail$data(h._`!${(0,f.useFunc)(_,g.default)}(${R}, ${P})`);else b.fail(h._`${C} !== ${R}`)}};m.default=S}),Rd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f=Ye(),g=Ei(),S={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:b})=>h._`{allowedValues: ${b}}`},code(b){let{gen:_,data:R,$data:y,schema:P,schemaCode:C,it:N}=b;if(!y&&P.length===0)throw Error("enum must have non-empty array");let J=P.length>=N.opts.loopEnum,W,L=()=>W!==null&&W!==void 0?W:W=(0,f.useFunc)(_,g.default),K;if(J||y)K=_.let("valid"),b.block$data(K,I);else{if(!Array.isArray(P))throw Error("ajv implementation error");let F=_.const("vSchema",C);K=(0,h.or)(...P.map((w,B)=>z(F,B)))}b.pass(K);function I(){_.assign(K,!1),_.forOf("v",C,(F)=>_.if(h._`${L()}(${R}, ${F})`,()=>_.assign(K,!0).break()))}function z(F,w){let B=P[w];return typeof B==="object"&&B!==null?h._`${L()}(${R}, ${F}[${w}])`:h._`${R} === ${B}`}}};m.default=S}),kc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=md(),f=hd(),g=fd(),S=gd(),b=Sd(),_=_d(),R=yd(),y=vd(),P=bd(),C=Rd(),N=[h.default,f.default,g.default,S.default,b.default,_.default,R.default,y.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},P.default,C.default];m.default=N}),Mc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateAdditionalItems=void 0;let h=He(),f=Ye(),g={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:b}})=>h.str`must NOT have more than ${b} items`,params:({params:{len:b}})=>h._`{limit: ${b}}`},code(b){let{parentSchema:_,it:R}=b,{items:y}=_;if(!Array.isArray(y)){(0,f.checkStrictMode)(R,'"additionalItems" is ignored when "items" is not an array of schemas');return}S(b,y)}};function S(b,_){let{gen:R,schema:y,data:P,keyword:C,it:N}=b;N.items=!0;let J=R.const("len",h._`${P}.length`);if(y===!1)b.setParams({len:_.length}),b.pass(h._`${J} <= ${_.length}`);else if(typeof y=="object"&&!(0,f.alwaysValidSchema)(N,y)){let L=R.var("valid",h._`${J} <= ${_.length}`);R.if((0,h.not)(L),()=>W(L)),b.ok(L)}function W(L){R.forRange("i",_.length,J,(K)=>{if(b.subschema({keyword:C,dataProp:K,dataPropType:f.Type.Num},L),!N.allErrors)R.if((0,h.not)(L),()=>R.break())})}}m.validateAdditionalItems=S,m.default=g}),Ac=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateTuple=void 0;let h=He(),f=Ye(),g=wt(),S={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(_){let{schema:R,it:y}=_;if(Array.isArray(R))return b(_,"additionalItems",R);if(y.items=!0,(0,f.alwaysValidSchema)(y,R))return;_.ok((0,g.validateArray)(_))}};function b(_,R,y=_.schema){let{gen:P,parentSchema:C,data:N,keyword:J,it:W}=_;if(I(C),W.opts.unevaluated&&y.length&&W.items!==!0)W.items=f.mergeEvaluated.items(P,y.length,W.items);let L=P.name("valid"),K=P.const("len",h._`${N}.length`);y.forEach((z,F)=>{if((0,f.alwaysValidSchema)(W,z))return;P.if(h._`${K} > ${F}`,()=>_.subschema({keyword:J,schemaProp:F,dataProp:F},L)),_.ok(L)});function I(z){let{opts:F,errSchemaPath:w}=W,B=y.length,Y=B===z.minItems&&(B===z.maxItems||z[R]===!1);if(F.strictTuples&&!Y){let U=`"${J}" is ${B}-tuple, but minItems or maxItems/${R} are not specified or different at path "${w}"`;(0,f.checkStrictMode)(W,U,F.strictTuples)}}}m.validateTuple=b,m.default=S}),zd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ac(),f={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(g)=>(0,h.validateTuple)(g,"items")};m.default=f}),$d=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f=Ye(),g=wt(),S=Mc(),b={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:_}})=>h.str`must NOT have more than ${_} items`,params:({params:{len:_}})=>h._`{limit: ${_}}`},code(_){let{schema:R,parentSchema:y,it:P}=_,{prefixItems:C}=y;if(P.items=!0,(0,f.alwaysValidSchema)(P,R))return;if(C)(0,S.validateAdditionalItems)(_,C);else _.ok((0,g.validateArray)(_))}};m.default=b}),Pd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f=Ye(),g={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:S,max:b}})=>b===void 0?h.str`must contain at least ${S} valid item(s)`:h.str`must contain at least ${S} and no more than ${b} valid item(s)`,params:({params:{min:S,max:b}})=>b===void 0?h._`{minContains: ${S}}`:h._`{minContains: ${S}, maxContains: ${b}}`},code(S){let{gen:b,schema:_,parentSchema:R,data:y,it:P}=S,C,N,{minContains:J,maxContains:W}=R;if(P.opts.next)C=J===void 0?1:J,N=W;else C=1;let L=b.const("len",h._`${y}.length`);if(S.setParams({min:C,max:N}),N===void 0&&C===0){(0,f.checkStrictMode)(P,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(N!==void 0&&C>N){(0,f.checkStrictMode)(P,'"minContains" > "maxContains" is always invalid'),S.fail();return}if((0,f.alwaysValidSchema)(P,_)){let w=h._`${L} >= ${C}`;if(N!==void 0)w=h._`${w} && ${L} <= ${N}`;S.pass(w);return}P.items=!0;let K=b.name("valid");if(N===void 0&&C===1)z(K,()=>b.if(K,()=>b.break()));else if(C===0){if(b.let(K,!0),N!==void 0)b.if(h._`${y}.length > 0`,I)}else b.let(K,!1),I();S.result(K,()=>S.reset());function I(){let w=b.name("_valid"),B=b.let("count",0);z(w,()=>b.if(w,()=>F(B)))}function z(w,B){b.forRange("i",0,L,(Y)=>{S.subschema({keyword:"contains",dataProp:Y,dataPropType:f.Type.Num,compositeRule:!0},w),B()})}function F(w){if(b.code(h._`${w}++`),N===void 0)b.if(h._`${w} >= ${C}`,()=>b.assign(K,!0).break());else if(b.if(h._`${w} > ${N}`,()=>b.assign(K,!1).break()),C===1)b.assign(K,!0);else b.if(h._`${w} >= ${C}`,()=>b.assign(K,!0))}}};m.default=g}),wi=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateSchemaDeps=m.validatePropertyDeps=m.error=void 0;let h=He(),f=Ye(),g=wt();m.error={message:({params:{property:y,depsCount:P,deps:C}})=>{let N=P===1?"property":"properties";return h.str`must have ${N} ${C} when property ${y} is present`},params:({params:{property:y,depsCount:P,deps:C,missingProperty:N}})=>h._`{property: ${y},
|
|
7
|
+
`}var Yu=/^[A-Za-z0-9._-]{1,128}$/;function Zu(m){let h=[];if(m.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(m.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${m.length})`]};if(m.includes(" "))h.push("Tool name contains spaces, which may cause parsing issues");if(m.includes(","))h.push("Tool name contains commas, which may cause parsing issues");if(m.startsWith("-")||m.endsWith("-"))h.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(m.startsWith(".")||m.endsWith("."))h.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Yu.test(m)){let f=[...m].filter((g)=>!/[A-Za-z0-9._-]/.test(g)).filter((g,S,b)=>b.indexOf(g)===S);return h.push(`Tool name contains invalid characters: ${f.map((g)=>`"${g}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:h}}return{isValid:!0,warnings:h}}function Xu(m,h){if(h.length>0){console.warn(`Tool name validation warning for "${m}":`);for(let f of h)console.warn(` - ${f}`);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 Ri(m){let h=Zu(m);return Xu(m,h.warnings),h.isValid}function Qu(m){return typeof m==="object"&&m!==null&&"_zod"in m}function ed(m){return typeof m==="object"&&m!==null&&!("_zod"in m)&&"_def"in m&&typeof m._def?.typeName==="string"}function td(m){if(typeof m!=="object"||m===null)return!1;if(Da(m))return!1;let h=Object.getPrototypeOf(m);if(h!==Object.prototype&&h!==null)return!1;return Object.values(m).every((f)=>Qu(f))}function pn(m){if(m===void 0)return;if(td(m))return t(m);if(typeof m==="object"&&m!==null&&!Da(m)&&Object.values(m).some((h)=>ed(h)))throw 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(!Da(m))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return m}var fn=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.regexpCode=m.getEsmExportName=m.getProperty=m.safeStringify=m.stringify=m.strConcat=m.addCodeArg=m.str=m._=m.nil=m._Code=m.Name=m.IDENTIFIER=m._CodeOrName=void 0;var h=class{};m._CodeOrName=h,m.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var f=class extends h{constructor(z){super();if(!m.IDENTIFIER.test(z))throw Error("CodeGen: name must be a valid identifier");this.str=z}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};m.Name=f;var g=class extends h{constructor(z){super();this._items=typeof z==="string"?[z]:z}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let z=this._items[0];return z===""||z==='""'}get str(){var z;return(z=this._str)!==null&&z!==void 0?z:this._str=this._items.reduce((F,w)=>`${F}${w}`,"")}get names(){var z;return(z=this._names)!==null&&z!==void 0?z:this._names=this._items.reduce((F,w)=>{if(w instanceof f)F[w.str]=(F[w.str]||0)+1;return F},{})}};m._Code=g,m.nil=new g("");function S(z,...F){let w=[z[0]],B=0;while(B<F.length)R(w,F[B]),w.push(z[++B]);return new g(w)}m._=S;let b=new g("+");function _(z,...F){let w=[W(z[0])],B=0;while(B<F.length)w.push(b),R(w,F[B]),w.push(b,W(z[++B]));return y(w),new g(w)}m.str=_;function R(z,F){if(F instanceof g)z.push(...F._items);else if(F instanceof f)z.push(F);else z.push(N(F))}m.addCodeArg=R;function y(z){let F=1;while(F<z.length-1){if(z[F]===b){let w=P(z[F-1],z[F+1]);if(w!==void 0){z.splice(F-1,3,w);continue}z[F++]="+"}F++}}function P(z,F){if(F==='""')return z;if(z==='""')return F;if(typeof z=="string"){if(F instanceof f||z[z.length-1]!=='"')return;if(typeof F!="string")return`${z.slice(0,-1)}${F}"`;if(F[0]==='"')return z.slice(0,-1)+F.slice(1);return}if(typeof F=="string"&&F[0]==='"'&&!(z instanceof f))return`"${z}${F.slice(1)}`}function C(z,F){return F.emptyStr()?z:z.emptyStr()?F:_`${z}${F}`}m.strConcat=C;function N(z){return typeof z=="number"||typeof z=="boolean"||z===null?z:W(Array.isArray(z)?z.join(","):z)}function J(z){return new g(W(z))}m.stringify=J;function W(z){return JSON.stringify(z).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}m.safeStringify=W;function L(z){return typeof z=="string"&&m.IDENTIFIER.test(z)?new g(`.${z}`):S`[${z}]`}m.getProperty=L;function K(z){if(typeof z=="string"&&m.IDENTIFIER.test(z))return new g(`${z}`);throw Error(`CodeGen: invalid export name: ${z}, use explicit $id name mapping`)}m.getEsmExportName=K;function I(z){return new g(z.toString())}m.regexpCode=I}),Cc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.ValueScope=m.ValueScopeName=m.Scope=m.varKinds=m.UsedValueState=void 0;let h=fn();var f=class extends Error{constructor(y){super(`CodeGen: "code" for ${y} not defined`);this.value=y.value}},g;(function(y){y[y.Started=0]="Started",y[y.Completed=1]="Completed"})(g||(m.UsedValueState=g={})),m.varKinds={const:new h.Name("const"),let:new h.Name("let"),var:new h.Name("var")};var S=class{constructor({prefixes:y,parent:P}={}){this._names={},this._prefixes=y,this._parent=P}toName(y){return y instanceof h.Name?y:this.name(y)}name(y){return new h.Name(this._newName(y))}_newName(y){let P=this._names[y]||this._nameGroup(y);return`${y}${P.index++}`}_nameGroup(y){var P,C;if(((C=(P=this._parent)===null||P===void 0?void 0:P._prefixes)===null||C===void 0?void 0:C.has(y))||this._prefixes&&!this._prefixes.has(y))throw Error(`CodeGen: prefix "${y}" is not allowed in this scope`);return this._names[y]={prefix:y,index:0}}};m.Scope=S;var b=class extends h.Name{constructor(y,P){super(P);this.prefix=y}setValue(y,{property:P,itemIndex:C}){this.value=y,this.scopePath=h._`.${new h.Name(P)}[${C}]`}};m.ValueScopeName=b;let _=h._`\n`;var R=class extends S{constructor(y){super(y);this._values={},this._scope=y.scope,this.opts={...y,_n:y.lines?_:h.nil}}get(){return this._scope}name(y){return new b(y,this._newName(y))}value(y,P){var C;if(P.ref===void 0)throw Error("CodeGen: ref must be passed in value");let N=this.toName(y),{prefix:J}=N,W=(C=P.key)!==null&&C!==void 0?C:P.ref,L=this._values[J];if(L){let z=L.get(W);if(z)return z}else L=this._values[J]=new Map;L.set(W,N);let K=this._scope[J]||(this._scope[J]=[]),I=K.length;return K[I]=P.ref,N.setValue(P,{property:J,itemIndex:I}),N}getValue(y,P){let C=this._values[y];if(!C)return;return C.get(P)}scopeRefs(y,P=this._values){return this._reduceValues(P,(C)=>{if(C.scopePath===void 0)throw Error(`CodeGen: name "${C}" has no value`);return h._`${y}${C.scopePath}`})}scopeCode(y=this._values,P,C){return this._reduceValues(y,(N)=>{if(N.value===void 0)throw Error(`CodeGen: name "${N}" has no value`);return N.value.code},P,C)}_reduceValues(y,P,C={},N){let J=h.nil;for(let W in y){let L=y[W];if(!L)continue;let K=C[W]=C[W]||new Map;L.forEach((I)=>{if(K.has(I))return;K.set(I,g.Started);let z=P(I);if(z){let F=this.opts.es5?m.varKinds.var:m.varKinds.const;J=h._`${J}${F} ${I} = ${z};${this.opts._n}`}else if(z=N===null||N===void 0?void 0:N(I))J=h._`${J}${z}${this.opts._n}`;else throw new f(I);K.set(I,g.Completed)})}return J}};m.ValueScope=R}),Fe=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.or=m.and=m.not=m.CodeGen=m.operators=m.varKinds=m.ValueScopeName=m.ValueScope=m.Scope=m.Name=m.regexpCode=m.stringify=m.getProperty=m.nil=m.strConcat=m.str=m._=void 0;let h=fn(),f=Cc();var g=fn();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(m,"strConcat",{enumerable:!0,get:function(){return g.strConcat}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(m,"getProperty",{enumerable:!0,get:function(){return g.getProperty}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(m,"regexpCode",{enumerable:!0,get:function(){return g.regexpCode}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return g.Name}});var S=Cc();Object.defineProperty(m,"Scope",{enumerable:!0,get:function(){return S.Scope}}),Object.defineProperty(m,"ValueScope",{enumerable:!0,get:function(){return S.ValueScope}}),Object.defineProperty(m,"ValueScopeName",{enumerable:!0,get:function(){return S.ValueScopeName}}),Object.defineProperty(m,"varKinds",{enumerable:!0,get:function(){return S.varKinds}}),m.operators={GT:new h._Code(">"),GTE:new h._Code(">="),LT:new h._Code("<"),LTE:new h._Code("<="),EQ:new h._Code("==="),NEQ:new h._Code("!=="),NOT:new h._Code("!"),OR:new h._Code("||"),AND:new h._Code("&&"),ADD:new h._Code("+")};var b=class{optimizeNodes(){return this}optimizeNames(G,Q){return this}},_=class extends b{constructor(G,Q,te){super();this.varKind=G,this.name=Q,this.rhs=te}render({es5:G,_n:Q}){let te=G?f.varKinds.var:this.varKind,qe=this.rhs===void 0?"":` = ${this.rhs}`;return`${te} ${this.name}${qe};`+Q}optimizeNames(G,Q){if(!G[this.name.str])return;if(this.rhs)this.rhs=je(this.rhs,G,Q);return this}get names(){return this.rhs instanceof h._CodeOrName?this.rhs.names:{}}},R=class extends b{constructor(G,Q,te){super();this.lhs=G,this.rhs=Q,this.sideEffects=te}render({_n:G}){return`${this.lhs} = ${this.rhs};`+G}optimizeNames(G,Q){if(this.lhs instanceof h.Name&&!G[this.lhs.str]&&!this.sideEffects)return;return this.rhs=je(this.rhs,G,Q),this}get names(){return Ne(this.lhs instanceof h.Name?{}:{...this.lhs.names},this.rhs)}},y=class extends R{constructor(G,Q,te,qe){super(G,te,qe);this.op=Q}render({_n:G}){return`${this.lhs} ${this.op}= ${this.rhs};`+G}},P=class extends b{constructor(G){super();this.label=G,this.names={}}render({_n:G}){return`${this.label}:`+G}},C=class extends b{constructor(G){super();this.label=G,this.names={}}render({_n:G}){return`break${this.label?` ${this.label}`:""};`+G}},N=class extends b{constructor(G){super();this.error=G}render({_n:G}){return`throw ${this.error};`+G}get names(){return this.error.names}},J=class extends b{constructor(G){super();this.code=G}render({_n:G}){return`${this.code};`+G}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(G,Q){return this.code=je(this.code,G,Q),this}get names(){return this.code instanceof h._CodeOrName?this.code.names:{}}},W=class extends b{constructor(G=[]){super();this.nodes=G}render(G){return this.nodes.reduce((Q,te)=>Q+te.render(G),"")}optimizeNodes(){let{nodes:G}=this,Q=G.length;while(Q--){let te=G[Q].optimizeNodes();if(Array.isArray(te))G.splice(Q,1,...te);else if(te)G[Q]=te;else G.splice(Q,1)}return G.length>0?this:void 0}optimizeNames(G,Q){let{nodes:te}=this,qe=te.length;while(qe--){let Le=te[qe];if(Le.optimizeNames(G,Q))continue;Ge(G,Le.names),te.splice(qe,1)}return te.length>0?this:void 0}get names(){return this.nodes.reduce((G,Q)=>ye(G,Q.names),{})}},L=class extends W{render(G){return"{"+G._n+super.render(G)+"}"+G._n}},K=class extends W{},I=class extends L{};I.kind="else";var z=class G extends L{constructor(Q,te){super(te);this.condition=Q}render(Q){let te=`if(${this.condition})`+super.render(Q);if(this.else)te+="else "+this.else.render(Q);return te}optimizeNodes(){super.optimizeNodes();let Q=this.condition;if(Q===!0)return this.nodes;let te=this.else;if(te){let qe=te.optimizeNodes();te=this.else=Array.isArray(qe)?new I(qe):qe}if(te){if(Q===!1)return te instanceof G?te:te.nodes;if(this.nodes.length)return this;return new G(Qe(Q),te instanceof G?[te]:te.nodes)}if(Q===!1||!this.nodes.length)return;return this}optimizeNames(Q,te){var qe;if(this.else=(qe=this.else)===null||qe===void 0?void 0:qe.optimizeNames(Q,te),!(super.optimizeNames(Q,te)||this.else))return;return this.condition=je(this.condition,Q,te),this}get names(){let Q=super.names;if(Ne(Q,this.condition),this.else)ye(Q,this.else.names);return Q}};z.kind="if";var F=class extends L{};F.kind="for";var w=class extends F{constructor(G){super();this.iteration=G}render(G){return`for(${this.iteration})`+super.render(G)}optimizeNames(G,Q){if(!super.optimizeNames(G,Q))return;return this.iteration=je(this.iteration,G,Q),this}get names(){return ye(super.names,this.iteration.names)}},B=class extends F{constructor(G,Q,te,qe){super();this.varKind=G,this.name=Q,this.from=te,this.to=qe}render(G){let Q=G.es5?f.varKinds.var:this.varKind,{name:te,from:qe,to:Le}=this;return`for(${Q} ${te}=${qe}; ${te}<${Le}; ${te}++)`+super.render(G)}get names(){return Ne(Ne(super.names,this.from),this.to)}},Y=class extends F{constructor(G,Q,te,qe){super();this.loop=G,this.varKind=Q,this.name=te,this.iterable=qe}render(G){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(G)}optimizeNames(G,Q){if(!super.optimizeNames(G,Q))return;return this.iterable=je(this.iterable,G,Q),this}get names(){return ye(super.names,this.iterable.names)}},U=class extends L{constructor(G,Q,te){super();this.name=G,this.args=Q,this.async=te}render(G){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(G)}};U.kind="func";var T=class extends W{render(G){return"return "+super.render(G)}};T.kind="return";var Z=class extends L{render(G){let Q="try"+super.render(G);if(this.catch)Q+=this.catch.render(G);if(this.finally)Q+=this.finally.render(G);return Q}optimizeNodes(){var G,Q;return super.optimizeNodes(),(G=this.catch)===null||G===void 0||G.optimizeNodes(),(Q=this.finally)===null||Q===void 0||Q.optimizeNodes(),this}optimizeNames(G,Q){var te,qe;return super.optimizeNames(G,Q),(te=this.catch)===null||te===void 0||te.optimizeNames(G,Q),(qe=this.finally)===null||qe===void 0||qe.optimizeNames(G,Q),this}get names(){let G=super.names;if(this.catch)ye(G,this.catch.names);if(this.finally)ye(G,this.finally.names);return G}},de=class extends L{constructor(G){super();this.error=G}render(G){return`catch(${this.error})`+super.render(G)}};de.kind="catch";var we=class extends L{render(G){return"finally"+super.render(G)}};we.kind="finally";var pe=class{constructor(G,Q={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...Q,_n:Q.lines?`
|
|
8
|
+
`:""},this._extScope=G,this._scope=new f.Scope({parent:G}),this._nodes=[new K]}toString(){return this._root.render(this.opts)}name(G){return this._scope.name(G)}scopeName(G){return this._extScope.name(G)}scopeValue(G,Q){let te=this._extScope.value(G,Q);return(this._values[te.prefix]||(this._values[te.prefix]=new Set)).add(te),te}getScopeValue(G,Q){return this._extScope.getValue(G,Q)}scopeRefs(G){return this._extScope.scopeRefs(G,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(G,Q,te,qe){let Le=this._scope.toName(Q);if(te!==void 0&&qe)this._constants[Le.str]=te;return this._leafNode(new _(G,Le,te)),Le}const(G,Q,te){return this._def(f.varKinds.const,G,Q,te)}let(G,Q,te){return this._def(f.varKinds.let,G,Q,te)}var(G,Q,te){return this._def(f.varKinds.var,G,Q,te)}assign(G,Q,te){return this._leafNode(new R(G,Q,te))}add(G,Q){return this._leafNode(new y(G,m.operators.ADD,Q))}code(G){if(typeof G=="function")G();else if(G!==h.nil)this._leafNode(new J(G));return this}object(...G){let Q=["{"];for(let[te,qe]of G){if(Q.length>1)Q.push(",");if(Q.push(te),te!==qe||this.opts.es5)Q.push(":"),(0,h.addCodeArg)(Q,qe)}return Q.push("}"),new h._Code(Q)}if(G,Q,te){if(this._blockNode(new z(G)),Q&&te)this.code(Q).else().code(te).endIf();else if(Q)this.code(Q).endIf();else if(te)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(G){return this._elseNode(new z(G))}else(){return this._elseNode(new I)}endIf(){return this._endBlockNode(z,I)}_for(G,Q){if(this._blockNode(G),Q)this.code(Q).endFor();return this}for(G,Q){return this._for(new w(G),Q)}forRange(G,Q,te,qe,Le=this.opts.es5?f.varKinds.var:f.varKinds.let){let Be=this._scope.toName(G);return this._for(new B(Le,Be,Q,te),()=>qe(Be))}forOf(G,Q,te,qe=f.varKinds.const){let Le=this._scope.toName(G);if(this.opts.es5){let Be=Q instanceof h.Name?Q:this.var("_arr",Q);return this.forRange("_i",0,h._`${Be}.length`,(He)=>{this.var(Le,h._`${Be}[${He}]`),te(Le)})}return this._for(new Y("of",qe,Le,Q),()=>te(Le))}forIn(G,Q,te,qe=this.opts.es5?f.varKinds.var:f.varKinds.const){if(this.opts.ownProperties)return this.forOf(G,h._`Object.keys(${Q})`,te);let Le=this._scope.toName(G);return this._for(new Y("in",qe,Le,Q),()=>te(Le))}endFor(){return this._endBlockNode(F)}label(G){return this._leafNode(new P(G))}break(G){return this._leafNode(new C(G))}return(G){let Q=new T;if(this._blockNode(Q),this.code(G),Q.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(T)}try(G,Q,te){if(!Q&&!te)throw Error('CodeGen: "try" without "catch" and "finally"');let qe=new Z;if(this._blockNode(qe),this.code(G),Q){let Le=this.name("e");this._currNode=qe.catch=new de(Le),Q(Le)}if(te)this._currNode=qe.finally=new we,this.code(te);return this._endBlockNode(de,we)}throw(G){return this._leafNode(new N(G))}block(G,Q){if(this._blockStarts.push(this._nodes.length),G)this.code(G).endBlock(Q);return this}endBlock(G){let Q=this._blockStarts.pop();if(Q===void 0)throw Error("CodeGen: not in self-balancing block");let te=this._nodes.length-Q;if(te<0||G!==void 0&&te!==G)throw Error(`CodeGen: wrong number of nodes: ${te} vs ${G} expected`);return this._nodes.length=Q,this}func(G,Q=h.nil,te,qe){if(this._blockNode(new U(G,Q,te)),qe)this.code(qe).endFunc();return this}endFunc(){return this._endBlockNode(U)}optimize(G=1){while(G-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(G){return this._currNode.nodes.push(G),this}_blockNode(G){this._currNode.nodes.push(G),this._nodes.push(G)}_endBlockNode(G,Q){let te=this._currNode;if(te instanceof G||Q&&te instanceof Q)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${Q?`${G.kind}/${Q.kind}`:G.kind}"`)}_elseNode(G){let Q=this._currNode;if(!(Q instanceof z))throw Error('CodeGen: "else" without "if"');return this._currNode=Q.else=G,this}get _root(){return this._nodes[0]}get _currNode(){let G=this._nodes;return G[G.length-1]}set _currNode(G){let Q=this._nodes;Q[Q.length-1]=G}};m.CodeGen=pe;function ye(G,Q){for(let te in Q)G[te]=(G[te]||0)+(Q[te]||0);return G}function Ne(G,Q){return Q instanceof h._CodeOrName?ye(G,Q.names):G}function je(G,Q,te){if(G instanceof h.Name)return qe(G);if(!Le(G))return G;return new h._Code(G._items.reduce((Be,He)=>{if(He instanceof h.Name)He=qe(He);if(He instanceof h._Code)Be.push(...He._items);else Be.push(He);return Be},[]));function qe(Be){let He=te[Be.str];if(He===void 0||Q[Be.str]!==1)return Be;return delete Q[Be.str],He}function Le(Be){return Be instanceof h._Code&&Be._items.some((He)=>He instanceof h.Name&&Q[He.str]===1&&te[He.str]!==void 0)}}function Ge(G,Q){for(let te in Q)G[te]=(G[te]||0)-(Q[te]||0)}function Qe(G){return typeof G=="boolean"||typeof G=="number"||G===null?!G:h._`!${Re(G)}`}m.not=Qe;let Ze=ne(m.operators.AND);function nt(...G){return G.reduce(Ze)}m.and=nt;let We=ne(m.operators.OR);function ee(...G){return G.reduce(We)}m.or=ee;function ne(G){return(Q,te)=>Q===h.nil?te:te===h.nil?Q:h._`${Re(Q)} ${G} ${Re(te)}`}function Re(G){return G instanceof h.Name?G:h._`(${G})`}}),Ye=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.checkStrictMode=m.getErrorPath=m.Type=m.useFunc=m.setEvaluated=m.evaluatedPropsToName=m.mergeEvaluated=m.eachItem=m.unescapeJsonPointer=m.escapeJsonPointer=m.escapeFragment=m.unescapeFragment=m.schemaRefOrVal=m.schemaHasRulesButRef=m.schemaHasRules=m.checkUnknownRules=m.alwaysValidSchema=m.toHash=void 0;let h=Fe(),f=fn();function g(U){let T={};for(let Z of U)T[Z]=!0;return T}m.toHash=g;function S(U,T){if(typeof T=="boolean")return T;if(Object.keys(T).length===0)return!0;return b(U,T),!_(T,U.self.RULES.all)}m.alwaysValidSchema=S;function b(U,T=U.schema){let{opts:Z,self:de}=U;if(!Z.strictSchema)return;if(typeof T==="boolean")return;let we=de.RULES.keywords;for(let pe in T)if(!we[pe])Y(U,`unknown keyword: "${pe}"`)}m.checkUnknownRules=b;function _(U,T){if(typeof U=="boolean")return!U;for(let Z in U)if(T[Z])return!0;return!1}m.schemaHasRules=_;function R(U,T){if(typeof U=="boolean")return!U;for(let Z in U)if(Z!=="$ref"&&T.all[Z])return!0;return!1}m.schemaHasRulesButRef=R;function y({topSchemaRef:U,schemaPath:T},Z,de,we){if(!we){if(typeof Z=="number"||typeof Z=="boolean")return Z;if(typeof Z=="string")return h._`${Z}`}return h._`${U}${T}${(0,h.getProperty)(de)}`}m.schemaRefOrVal=y;function P(U){return J(decodeURIComponent(U))}m.unescapeFragment=P;function C(U){return encodeURIComponent(N(U))}m.escapeFragment=C;function N(U){if(typeof U=="number")return`${U}`;return U.replace(/~/g,"~0").replace(/\//g,"~1")}m.escapeJsonPointer=N;function J(U){return U.replace(/~1/g,"/").replace(/~0/g,"~")}m.unescapeJsonPointer=J;function W(U,T){if(Array.isArray(U))for(let Z of U)T(Z);else T(U)}m.eachItem=W;function L({mergeNames:U,mergeToName:T,mergeValues:Z,resultToName:de}){return(we,pe,ye,Ne)=>{let je=ye===void 0?pe:ye instanceof h.Name?(pe instanceof h.Name?U(we,pe,ye):T(we,pe,ye),ye):pe instanceof h.Name?(T(we,ye,pe),pe):Z(pe,ye);return Ne===h.Name&&!(je instanceof h.Name)?de(we,je):je}}m.mergeEvaluated={props:L({mergeNames:(U,T,Z)=>U.if(h._`${Z} !== true && ${T} !== undefined`,()=>{U.if(h._`${T} === true`,()=>U.assign(Z,!0),()=>U.assign(Z,h._`${Z} || {}`).code(h._`Object.assign(${Z}, ${T})`))}),mergeToName:(U,T,Z)=>U.if(h._`${Z} !== true`,()=>{if(T===!0)U.assign(Z,!0);else U.assign(Z,h._`${Z} || {}`),I(U,Z,T)}),mergeValues:(U,T)=>U===!0?!0:{...U,...T},resultToName:K}),items:L({mergeNames:(U,T,Z)=>U.if(h._`${Z} !== true && ${T} !== undefined`,()=>U.assign(Z,h._`${T} === true ? true : ${Z} > ${T} ? ${Z} : ${T}`)),mergeToName:(U,T,Z)=>U.if(h._`${Z} !== true`,()=>U.assign(Z,T===!0?!0:h._`${Z} > ${T} ? ${Z} : ${T}`)),mergeValues:(U,T)=>U===!0?!0:Math.max(U,T),resultToName:(U,T)=>U.var("items",T)})};function K(U,T){if(T===!0)return U.var("props",!0);let Z=U.var("props",h._`{}`);if(T!==void 0)I(U,Z,T);return Z}m.evaluatedPropsToName=K;function I(U,T,Z){Object.keys(Z).forEach((de)=>U.assign(h._`${T}${(0,h.getProperty)(de)}`,!0))}m.setEvaluated=I;let z={};function F(U,T){return U.scopeValue("func",{ref:T,code:z[T.code]||(z[T.code]=new f._Code(T.code))})}m.useFunc=F;var w;(function(U){U[U.Num=0]="Num",U[U.Str=1]="Str"})(w||(m.Type=w={}));function B(U,T,Z){if(U instanceof h.Name){let de=T===w.Num;return Z?de?h._`"[" + ${U} + "]"`:h._`"['" + ${U} + "']"`:de?h._`"/" + ${U}`:h._`"/" + ${U}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return Z?(0,h.getProperty)(U).toString():"/"+N(U)}m.getErrorPath=B;function Y(U,T,Z=U.opts.strictSchema){if(!Z)return;if(T=`strict mode: ${T}`,Z===!0)throw Error(T);U.self.logger.warn(T)}m.checkStrictMode=Y}),Et=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={data:new h.Name("data"),valCxt:new h.Name("valCxt"),instancePath:new h.Name("instancePath"),parentData:new h.Name("parentData"),parentDataProperty:new h.Name("parentDataProperty"),rootData:new h.Name("rootData"),dynamicAnchors:new h.Name("dynamicAnchors"),vErrors:new h.Name("vErrors"),errors:new h.Name("errors"),this:new h.Name("this"),self:new h.Name("self"),scope:new h.Name("scope"),json:new h.Name("json"),jsonPos:new h.Name("jsonPos"),jsonLen:new h.Name("jsonLen"),jsonPart:new h.Name("jsonPart")};m.default=f}),Sn=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.extendErrors=m.resetErrorsCount=m.reportExtraError=m.reportError=m.keyword$DataError=m.keywordError=void 0;let h=Fe(),f=Ye(),g=Et();m.keywordError={message:({keyword:I})=>h.str`must pass "${I}" keyword validation`},m.keyword$DataError={message:({keyword:I,schemaType:z})=>z?h.str`"${I}" keyword must be ${z} ($data)`:h.str`"${I}" keyword is invalid ($data)`};function S(I,z=m.keywordError,F,w){let{it:B}=I,{gen:Y,compositeRule:U,allErrors:T}=B,Z=N(I,z,F);if(w!==null&&w!==void 0?w:U||T)y(Y,Z);else P(B,h._`[${Z}]`)}m.reportError=S;function b(I,z=m.keywordError,F){let{it:w}=I,{gen:B,compositeRule:Y,allErrors:U}=w;if(y(B,N(I,z,F)),!(Y||U))P(w,g.default.vErrors)}m.reportExtraError=b;function _(I,z){I.assign(g.default.errors,z),I.if(h._`${g.default.vErrors} !== null`,()=>I.if(z,()=>I.assign(h._`${g.default.vErrors}.length`,z),()=>I.assign(g.default.vErrors,null)))}m.resetErrorsCount=_;function R({gen:I,keyword:z,schemaValue:F,data:w,errsCount:B,it:Y}){if(B===void 0)throw Error("ajv implementation error");let U=I.name("err");I.forRange("i",B,g.default.errors,(T)=>{if(I.const(U,h._`${g.default.vErrors}[${T}]`),I.if(h._`${U}.instancePath === undefined`,()=>I.assign(h._`${U}.instancePath`,(0,h.strConcat)(g.default.instancePath,Y.errorPath))),I.assign(h._`${U}.schemaPath`,h.str`${Y.errSchemaPath}/${z}`),Y.opts.verbose)I.assign(h._`${U}.schema`,F),I.assign(h._`${U}.data`,w)})}m.extendErrors=R;function y(I,z){let F=I.const("err",z);I.if(h._`${g.default.vErrors} === null`,()=>I.assign(g.default.vErrors,h._`[${F}]`),h._`${g.default.vErrors}.push(${F})`),I.code(h._`${g.default.errors}++`)}function P(I,z){let{gen:F,validateName:w,schemaEnv:B}=I;if(B.$async)F.throw(h._`new ${I.ValidationError}(${z})`);else F.assign(h._`${w}.errors`,z),F.return(!1)}let C={keyword:new h.Name("keyword"),schemaPath:new h.Name("schemaPath"),params:new h.Name("params"),propertyName:new h.Name("propertyName"),message:new h.Name("message"),schema:new h.Name("schema"),parentSchema:new h.Name("parentSchema")};function N(I,z,F){let{createErrors:w}=I.it;if(w===!1)return h._`{}`;return J(I,z,F)}function J(I,z,F={}){let{gen:w,it:B}=I,Y=[W(B,F),L(I,F)];return K(I,z,Y),w.object(...Y)}function W({errorPath:I},{instancePath:z}){let F=z?h.str`${I}${(0,f.getErrorPath)(z,f.Type.Str)}`:I;return[g.default.instancePath,(0,h.strConcat)(g.default.instancePath,F)]}function L({keyword:I,it:{errSchemaPath:z}},{schemaPath:F,parentSchema:w}){let B=w?z:h.str`${z}/${I}`;if(F)B=h.str`${B}${(0,f.getErrorPath)(F,f.Type.Str)}`;return[C.schemaPath,B]}function K(I,{params:z,message:F},w){let{keyword:B,data:Y,schemaValue:U,it:T}=I,{opts:Z,propertyName:de,topSchemaRef:we,schemaPath:pe}=T;if(w.push([C.keyword,B],[C.params,typeof z=="function"?z(I):z||h._`{}`]),Z.messages)w.push([C.message,typeof F=="function"?F(I):F]);if(Z.verbose)w.push([C.schema,U],[C.parentSchema,h._`${we}${pe}`],[g.default.data,Y]);if(de)w.push([C.propertyName,de])}}),ad=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.boolOrEmptySchema=m.topBoolOrEmptySchema=void 0;let h=Sn(),f=Fe(),g=Et(),S={message:"boolean schema is false"};function b(y){let{gen:P,schema:C,validateName:N}=y;if(C===!1)R(y,!1);else if(typeof C=="object"&&C.$async===!0)P.return(g.default.data);else P.assign(f._`${N}.errors`,null),P.return(!0)}m.topBoolOrEmptySchema=b;function _(y,P){let{gen:C,schema:N}=y;if(N===!1)C.var(P,!1),R(y);else C.var(P,!0)}m.boolOrEmptySchema=_;function R(y,P){let{gen:C,data:N}=y,J={gen:C,keyword:"false schema",data:N,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:y};(0,h.reportError)(J,S,void 0,P)}}),qc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getRules=m.isJSONType=void 0;let h=new Set(["string","number","integer","boolean","null","object","array"]);function f(S){return typeof S=="string"&&h.has(S)}m.isJSONType=f;function g(){let S={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...S,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},S.number,S.string,S.array,S.object],post:{rules:[]},all:{},keywords:{}}}m.getRules=g}),jc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.shouldUseRule=m.shouldUseGroup=m.schemaHasRulesForType=void 0;function h({schema:S,self:b},_){let R=b.RULES.types[_];return R&&R!==!0&&f(S,R)}m.schemaHasRulesForType=h;function f(S,b){return b.rules.some((_)=>g(S,_))}m.shouldUseGroup=f;function g(S,b){var _;return S[b.keyword]!==void 0||((_=b.definition.implements)===null||_===void 0?void 0:_.some((R)=>S[R]!==void 0))}m.shouldUseRule=g}),gn=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.reportTypeError=m.checkDataTypes=m.checkDataType=m.coerceAndCheckDataType=m.getJSONTypes=m.getSchemaTypes=m.DataType=void 0;let h=qc(),f=jc(),g=Sn(),S=Fe(),b=Ye();var _;(function(w){w[w.Correct=0]="Correct",w[w.Wrong=1]="Wrong"})(_||(m.DataType=_={}));function R(w){let B=y(w.type);if(B.includes("null")){if(w.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!B.length&&w.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(w.nullable===!0)B.push("null")}return B}m.getSchemaTypes=R;function y(w){let B=Array.isArray(w)?w:w?[w]:[];if(B.every(h.isJSONType))return B;throw Error("type must be JSONType or JSONType[]: "+B.join(","))}m.getJSONTypes=y;function P(w,B){let{gen:Y,data:U,opts:T}=w,Z=N(B,T.coerceTypes),de=B.length>0&&!(Z.length===0&&B.length===1&&(0,f.schemaHasRulesForType)(w,B[0]));if(de){let we=K(B,U,T.strictNumbers,_.Wrong);Y.if(we,()=>{if(Z.length)J(w,B,Z);else z(w)})}return de}m.coerceAndCheckDataType=P;let C=new Set(["string","number","integer","boolean","null"]);function N(w,B){return B?w.filter((Y)=>C.has(Y)||B==="array"&&Y==="array"):[]}function J(w,B,Y){let{gen:U,data:T,opts:Z}=w,de=U.let("dataType",S._`typeof ${T}`),we=U.let("coerced",S._`undefined`);if(Z.coerceTypes==="array")U.if(S._`${de} == 'object' && Array.isArray(${T}) && ${T}.length == 1`,()=>U.assign(T,S._`${T}[0]`).assign(de,S._`typeof ${T}`).if(K(B,T,Z.strictNumbers),()=>U.assign(we,T)));U.if(S._`${we} !== undefined`);for(let ye of Y)if(C.has(ye)||ye==="array"&&Z.coerceTypes==="array")pe(ye);U.else(),z(w),U.endIf(),U.if(S._`${we} !== undefined`,()=>{U.assign(T,we),W(w,we)});function pe(ye){switch(ye){case"string":U.elseIf(S._`${de} == "number" || ${de} == "boolean"`).assign(we,S._`"" + ${T}`).elseIf(S._`${T} === null`).assign(we,S._`""`);return;case"number":U.elseIf(S._`${de} == "boolean" || ${T} === null
|
|
9
|
+
|| (${de} == "string" && ${T} && ${T} == +${T})`).assign(we,S._`+${T}`);return;case"integer":U.elseIf(S._`${de} === "boolean" || ${T} === null
|
|
10
|
+
|| (${de} === "string" && ${T} && ${T} == +${T} && !(${T} % 1))`).assign(we,S._`+${T}`);return;case"boolean":U.elseIf(S._`${T} === "false" || ${T} === 0 || ${T} === null`).assign(we,!1).elseIf(S._`${T} === "true" || ${T} === 1`).assign(we,!0);return;case"null":U.elseIf(S._`${T} === "" || ${T} === 0 || ${T} === false`),U.assign(we,null);return;case"array":U.elseIf(S._`${de} === "string" || ${de} === "number"
|
|
11
|
+
|| ${de} === "boolean" || ${T} === null`).assign(we,S._`[${T}]`)}}}function W({gen:w,parentData:B,parentDataProperty:Y},U){w.if(S._`${B} !== undefined`,()=>w.assign(S._`${B}[${Y}]`,U))}function L(w,B,Y,U=_.Correct){let T=U===_.Correct?S.operators.EQ:S.operators.NEQ,Z;switch(w){case"null":return S._`${B} ${T} null`;case"array":Z=S._`Array.isArray(${B})`;break;case"object":Z=S._`${B} && typeof ${B} == "object" && !Array.isArray(${B})`;break;case"integer":Z=de(S._`!(${B} % 1) && !isNaN(${B})`);break;case"number":Z=de();break;default:return S._`typeof ${B} ${T} ${w}`}return U===_.Correct?Z:(0,S.not)(Z);function de(we=S.nil){return(0,S.and)(S._`typeof ${B} == "number"`,we,Y?S._`isFinite(${B})`:S.nil)}}m.checkDataType=L;function K(w,B,Y,U){if(w.length===1)return L(w[0],B,Y,U);let T,Z=(0,b.toHash)(w);if(Z.array&&Z.object){let de=S._`typeof ${B} != "object"`;T=Z.null?de:S._`!${B} || ${de}`,delete Z.null,delete Z.array,delete Z.object}else T=S.nil;if(Z.number)delete Z.integer;for(let de in Z)T=(0,S.and)(T,L(de,B,Y,U));return T}m.checkDataTypes=K;let I={message:({schema:w})=>`must be ${w}`,params:({schema:w,schemaValue:B})=>typeof w=="string"?S._`{type: ${w}}`:S._`{type: ${B}}`};function z(w){let B=F(w);(0,g.reportError)(B,I)}m.reportTypeError=z;function F(w){let{gen:B,data:Y,schema:U}=w,T=(0,b.schemaRefOrVal)(w,U,"type");return{gen:B,keyword:"type",data:Y,schema:U.type,schemaCode:T,schemaValue:T,parentSchema:U,params:{},it:w}}}),rd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.assignDefaults=void 0;let h=Fe(),f=Ye();function g(b,_){let{properties:R,items:y}=b.schema;if(_==="object"&&R)for(let P in R)S(b,P,R[P].default);else if(_==="array"&&Array.isArray(y))y.forEach((P,C)=>S(b,C,P.default))}m.assignDefaults=g;function S(b,_,R){let{gen:y,compositeRule:P,data:C,opts:N}=b;if(R===void 0)return;let J=h._`${C}${(0,h.getProperty)(_)}`;if(P){(0,f.checkStrictMode)(b,`default is ignored for: ${J}`);return}let W=h._`${J} === undefined`;if(N.useDefaults==="empty")W=h._`${W} || ${J} === null || ${J} === ""`;y.if(W,h._`${J} = ${(0,h.stringify)(R)}`)}}),wt=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateUnion=m.validateArray=m.usePattern=m.callValidateCode=m.schemaProperties=m.allSchemaProperties=m.noPropertyInData=m.propertyInData=m.isOwnProperty=m.hasPropFunc=m.reportMissingProp=m.checkMissingProp=m.checkReportMissingProp=void 0;let h=Fe(),f=Ye(),g=Et(),S=Ye();function b(w,B){let{gen:Y,data:U,it:T}=w;Y.if(N(Y,U,B,T.opts.ownProperties),()=>{w.setParams({missingProperty:h._`${B}`},!0),w.error()})}m.checkReportMissingProp=b;function _({gen:w,data:B,it:{opts:Y}},U,T){return(0,h.or)(...U.map((Z)=>(0,h.and)(N(w,B,Z,Y.ownProperties),h._`${T} = ${Z}`)))}m.checkMissingProp=_;function R(w,B){w.setParams({missingProperty:B},!0),w.error()}m.reportMissingProp=R;function y(w){return w.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:h._`Object.prototype.hasOwnProperty`})}m.hasPropFunc=y;function P(w,B,Y){return h._`${y(w)}.call(${B}, ${Y})`}m.isOwnProperty=P;function C(w,B,Y,U){let T=h._`${B}${(0,h.getProperty)(Y)} !== undefined`;return U?h._`${T} && ${P(w,B,Y)}`:T}m.propertyInData=C;function N(w,B,Y,U){let T=h._`${B}${(0,h.getProperty)(Y)} === undefined`;return U?(0,h.or)(T,(0,h.not)(P(w,B,Y))):T}m.noPropertyInData=N;function J(w){return w?Object.keys(w).filter((B)=>B!=="__proto__"):[]}m.allSchemaProperties=J;function W(w,B){return J(B).filter((Y)=>!(0,f.alwaysValidSchema)(w,B[Y]))}m.schemaProperties=W;function L({schemaCode:w,data:B,it:{gen:Y,topSchemaRef:U,schemaPath:T,errorPath:Z},it:de},we,pe,ye){let Ne=ye?h._`${w}, ${B}, ${U}${T}`:B,je=[[g.default.instancePath,(0,h.strConcat)(g.default.instancePath,Z)],[g.default.parentData,de.parentData],[g.default.parentDataProperty,de.parentDataProperty],[g.default.rootData,g.default.rootData]];if(de.opts.dynamicRef)je.push([g.default.dynamicAnchors,g.default.dynamicAnchors]);let Ge=h._`${Ne}, ${Y.object(...je)}`;return pe!==h.nil?h._`${we}.call(${pe}, ${Ge})`:h._`${we}(${Ge})`}m.callValidateCode=L;let K=h._`new RegExp`;function I({gen:w,it:{opts:B}},Y){let U=B.unicodeRegExp?"u":"",{regExp:T}=B.code,Z=T(Y,U);return w.scopeValue("pattern",{key:Z.toString(),ref:Z,code:h._`${T.code==="new RegExp"?K:(0,S.useFunc)(w,T)}(${Y}, ${U})`})}m.usePattern=I;function z(w){let{gen:B,data:Y,keyword:U,it:T}=w,Z=B.name("valid");if(T.allErrors){let we=B.let("valid",!0);return de(()=>B.assign(we,!1)),we}return B.var(Z,!0),de(()=>B.break()),Z;function de(we){let pe=B.const("len",h._`${Y}.length`);B.forRange("i",0,pe,(ye)=>{w.subschema({keyword:U,dataProp:ye,dataPropType:f.Type.Num},Z),B.if((0,h.not)(Z),we)})}}m.validateArray=z;function F(w){let{gen:B,schema:Y,keyword:U,it:T}=w;if(!Array.isArray(Y))throw Error("ajv implementation error");if(Y.some((we)=>(0,f.alwaysValidSchema)(T,we))&&!T.opts.unevaluated)return;let Z=B.let("valid",!1),de=B.name("_valid");B.block(()=>Y.forEach((we,pe)=>{let ye=w.subschema({keyword:U,schemaProp:pe,compositeRule:!0},de);if(B.assign(Z,h._`${Z} || ${de}`),!w.mergeValidEvaluated(ye,de))B.if((0,h.not)(Z))})),w.result(Z,()=>w.reset(),()=>w.error(!0))}m.validateUnion=F}),od=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateKeywordUsage=m.validSchemaType=m.funcKeywordCode=m.macroKeywordCode=void 0;let h=Fe(),f=Et(),g=wt(),S=Sn();function b(W,L){let{gen:K,keyword:I,schema:z,parentSchema:F,it:w}=W,B=L.macro.call(w.self,z,F,w),Y=C(K,I,B);if(w.opts.validateSchema!==!1)w.self.validateSchema(B,!0);let U=K.name("valid");W.subschema({schema:B,schemaPath:h.nil,errSchemaPath:`${w.errSchemaPath}/${I}`,topSchemaRef:Y,compositeRule:!0},U),W.pass(U,()=>W.error(!0))}m.macroKeywordCode=b;function _(W,L){var K;let{gen:I,keyword:z,schema:F,parentSchema:w,$data:B,it:Y}=W;P(Y,L);let U=C(I,z,!B&&L.compile?L.compile.call(Y.self,F,w,Y):L.validate),T=I.let("valid");W.block$data(T,Z),W.ok((K=L.valid)!==null&&K!==void 0?K:T);function Z(){if(L.errors===!1){if(pe(),L.modifying)R(W);ye(()=>W.error())}else{let Ne=L.async?de():we();if(L.modifying)R(W);ye(()=>y(W,Ne))}}function de(){let Ne=I.let("ruleErrs",null);return I.try(()=>pe(h._`await `),(je)=>I.assign(T,!1).if(h._`${je} instanceof ${Y.ValidationError}`,()=>I.assign(Ne,h._`${je}.errors`),()=>I.throw(je))),Ne}function we(){let Ne=h._`${U}.errors`;return I.assign(Ne,null),pe(h.nil),Ne}function pe(Ne=L.async?h._`await `:h.nil){let je=Y.opts.passContext?f.default.this:f.default.self,Ge=!(("compile"in L)&&!B||L.schema===!1);I.assign(T,h._`${Ne}${(0,g.callValidateCode)(W,U,je,Ge)}`,L.modifying)}function ye(Ne){var je;I.if((0,h.not)((je=L.valid)!==null&&je!==void 0?je:T),Ne)}}m.funcKeywordCode=_;function R(W){let{gen:L,data:K,it:I}=W;L.if(I.parentData,()=>L.assign(K,h._`${I.parentData}[${I.parentDataProperty}]`))}function y(W,L){let{gen:K}=W;K.if(h._`Array.isArray(${L})`,()=>{K.assign(f.default.vErrors,h._`${f.default.vErrors} === null ? ${L} : ${f.default.vErrors}.concat(${L})`).assign(f.default.errors,h._`${f.default.vErrors}.length`),(0,S.extendErrors)(W)},()=>W.error())}function P({schemaEnv:W},L){if(L.async&&!W.$async)throw Error("async keyword in sync schema")}function C(W,L,K){if(K===void 0)throw Error(`keyword "${L}" failed to compile`);return W.scopeValue("keyword",typeof K=="function"?{ref:K}:{ref:K,code:(0,h.stringify)(K)})}function N(W,L,K=!1){return!L.length||L.some((I)=>I==="array"?Array.isArray(W):I==="object"?W&&typeof W=="object"&&!Array.isArray(W):typeof W==I||K&&typeof W>"u")}m.validSchemaType=N;function J({schema:W,opts:L,self:K,errSchemaPath:I},z,F){if(Array.isArray(z.keyword)?!z.keyword.includes(F):z.keyword!==F)throw Error("ajv implementation error");let w=z.dependencies;if(w===null||w===void 0?void 0:w.some((B)=>!Object.prototype.hasOwnProperty.call(W,B)))throw Error(`parent schema must have dependencies of ${F}: ${w.join(",")}`);if(z.validateSchema){if(!z.validateSchema(W[F])){let B=`keyword "${F}" value is invalid at path "${I}": `+K.errorsText(z.validateSchema.errors);if(L.validateSchema==="log")K.logger.error(B);else throw Error(B)}}}m.validateKeywordUsage=J}),sd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.extendSubschemaMode=m.extendSubschemaData=m.getSubschema=void 0;let h=Fe(),f=Ye();function g(_,{keyword:R,schemaProp:y,schema:P,schemaPath:C,errSchemaPath:N,topSchemaRef:J}){if(R!==void 0&&P!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(R!==void 0){let W=_.schema[R];return y===void 0?{schema:W,schemaPath:h._`${_.schemaPath}${(0,h.getProperty)(R)}`,errSchemaPath:`${_.errSchemaPath}/${R}`}:{schema:W[y],schemaPath:h._`${_.schemaPath}${(0,h.getProperty)(R)}${(0,h.getProperty)(y)}`,errSchemaPath:`${_.errSchemaPath}/${R}/${(0,f.escapeFragment)(y)}`}}if(P!==void 0){if(C===void 0||N===void 0||J===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:P,schemaPath:C,topSchemaRef:J,errSchemaPath:N}}throw Error('either "keyword" or "schema" must be passed')}m.getSubschema=g;function S(_,R,{dataProp:y,dataPropType:P,data:C,dataTypes:N,propertyName:J}){if(C!==void 0&&y!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:W}=R;if(y!==void 0){let{errorPath:K,dataPathArr:I,opts:z}=R;L(W.let("data",h._`${R.data}${(0,h.getProperty)(y)}`,!0)),_.errorPath=h.str`${K}${(0,f.getErrorPath)(y,P,z.jsPropertySyntax)}`,_.parentDataProperty=h._`${y}`,_.dataPathArr=[...I,_.parentDataProperty]}if(C!==void 0){if(L(C instanceof h.Name?C:W.let("data",C,!0)),J!==void 0)_.propertyName=J}if(N)_.dataTypes=N;function L(K){_.data=K,_.dataLevel=R.dataLevel+1,_.dataTypes=[],R.definedProperties=new Set,_.parentData=R.data,_.dataNames=[...R.dataNames,K]}}m.extendSubschemaData=S;function b(_,{jtdDiscriminator:R,jtdMetadata:y,compositeRule:P,createErrors:C,allErrors:N}){if(P!==void 0)_.compositeRule=P;if(C!==void 0)_.createErrors=C;if(N!==void 0)_.allErrors=N;_.jtdDiscriminator=R,_.jtdMetadata=y}m.extendSubschemaMode=b}),Nc=_e((m,h)=>{h.exports=function f(g,S){if(g===S)return!0;if(g&&S&&typeof g=="object"&&typeof S=="object"){if(g.constructor!==S.constructor)return!1;var b,_,R;if(Array.isArray(g)){if(b=g.length,b!=S.length)return!1;for(_=b;_--!==0;)if(!f(g[_],S[_]))return!1;return!0}if(g.constructor===RegExp)return g.source===S.source&&g.flags===S.flags;if(g.valueOf!==Object.prototype.valueOf)return g.valueOf()===S.valueOf();if(g.toString!==Object.prototype.toString)return g.toString()===S.toString();if(R=Object.keys(g),b=R.length,b!==Object.keys(S).length)return!1;for(_=b;_--!==0;)if(!Object.prototype.hasOwnProperty.call(S,R[_]))return!1;for(_=b;_--!==0;){var y=R[_];if(!f(g[y],S[y]))return!1}return!0}return g!==g&&S!==S}}),nd=_e((m,h)=>{var f=h.exports=function(b,_,R){if(typeof _=="function")R=_,_={};R=_.cb||R;var y=typeof R=="function"?R:R.pre||function(){},P=R.post||function(){};g(_,y,P,b,"",b)};f.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},f.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},f.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},f.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 g(b,_,R,y,P,C,N,J,W,L){if(y&&typeof y=="object"&&!Array.isArray(y)){_(y,P,C,N,J,W,L);for(var K in y){var I=y[K];if(Array.isArray(I)){if(K in f.arrayKeywords)for(var z=0;z<I.length;z++)g(b,_,R,I[z],P+"/"+K+"/"+z,C,P,K,y,z)}else if(K in f.propsKeywords){if(I&&typeof I=="object")for(var F in I)g(b,_,R,I[F],P+"/"+K+"/"+S(F),C,P,K,y,F)}else if(K in f.keywords||b.allKeys&&!(K in f.skipKeywords))g(b,_,R,I,P+"/"+K,C,P,K,y)}R(y,P,C,N,J,W,L)}}function S(b){return b.replace(/~/g,"~0").replace(/\//g,"~1")}}),_n=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getSchemaRefs=m.resolveUrl=m.normalizeId=m._getFullPath=m.getFullPath=m.inlineRef=void 0;let h=Ye(),f=Nc(),g=nd(),S=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function b(I,z=!0){if(typeof I=="boolean")return!0;if(z===!0)return!R(I);if(!z)return!1;return y(I)<=z}m.inlineRef=b;let _=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function R(I){for(let z in I){if(_.has(z))return!0;let F=I[z];if(Array.isArray(F)&&F.some(R))return!0;if(typeof F=="object"&&R(F))return!0}return!1}function y(I){let z=0;for(let F in I){if(F==="$ref")return 1/0;if(z++,S.has(F))continue;if(typeof I[F]=="object")(0,h.eachItem)(I[F],(w)=>z+=y(w));if(z===1/0)return 1/0}return z}function P(I,z="",F){if(F!==!1)z=J(z);return C(I,I.parse(z))}m.getFullPath=P;function C(I,z){return I.serialize(z).split("#")[0]+"#"}m._getFullPath=C;let N=/#\/?$/;function J(I){return I?I.replace(N,""):""}m.normalizeId=J;function W(I,z,F){return F=J(F),I.resolve(z,F)}m.resolveUrl=W;let L=/^[a-z_][-a-z0-9._]*$/i;function K(I,z){if(typeof I=="boolean")return{};let{schemaId:F,uriResolver:w}=this.opts,B=J(I[F]||z),Y={"":B},U=P(w,B,!1),T={},Z=new Set;return g(I,{allKeys:!0},(pe,ye,Ne,je)=>{if(je===void 0)return;let Ge=U+ye,Qe=Y[je];if(typeof pe[F]=="string")Qe=Ze.call(this,pe[F]);nt.call(this,pe.$anchor),nt.call(this,pe.$dynamicAnchor),Y[ye]=Qe;function Ze(We){let ee=this.opts.uriResolver.resolve;if(We=J(Qe?ee(Qe,We):We),Z.has(We))throw we(We);Z.add(We);let ne=this.refs[We];if(typeof ne=="string")ne=this.refs[ne];if(typeof ne=="object")de(pe,ne.schema,We);else if(We!==J(Ge))if(We[0]==="#")de(pe,T[We],We),T[We]=pe;else this.refs[We]=Ge;return We}function nt(We){if(typeof We=="string"){if(!L.test(We))throw Error(`invalid anchor "${We}"`);Ze.call(this,`#${We}`)}}}),T;function de(pe,ye,Ne){if(ye!==void 0&&!f(pe,ye))throw we(Ne)}function we(pe){return Error(`reference "${pe}" resolves to more than one schema`)}}m.getSchemaRefs=K}),Ua=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getData=m.KeywordCxt=m.validateFunctionCode=void 0;let h=ad(),f=gn(),g=jc(),S=gn(),b=rd(),_=od(),R=sd(),y=Fe(),P=Et(),C=_n(),N=Ye(),J=Sn();function W(X){if(U(X)){if(Z(X),Y(X)){z(X);return}}L(X,()=>(0,h.topBoolOrEmptySchema)(X))}m.validateFunctionCode=W;function L({gen:X,validateName:ue,schema:Se,schemaEnv:Ve,opts:Ue},xe){if(Ue.code.es5)X.func(ue,y._`${P.default.data}, ${P.default.valCxt}`,Ve.$async,()=>{X.code(y._`"use strict"; ${w(Se,Ue)}`),I(X,Ue),X.code(xe)});else X.func(ue,y._`${P.default.data}, ${K(Ue)}`,Ve.$async,()=>X.code(w(Se,Ue)).code(xe))}function K(X){return y._`{${P.default.instancePath}="", ${P.default.parentData}, ${P.default.parentDataProperty}, ${P.default.rootData}=${P.default.data}${X.dynamicRef?y._`, ${P.default.dynamicAnchors}={}`:y.nil}}={}`}function I(X,ue){X.if(P.default.valCxt,()=>{if(X.var(P.default.instancePath,y._`${P.default.valCxt}.${P.default.instancePath}`),X.var(P.default.parentData,y._`${P.default.valCxt}.${P.default.parentData}`),X.var(P.default.parentDataProperty,y._`${P.default.valCxt}.${P.default.parentDataProperty}`),X.var(P.default.rootData,y._`${P.default.valCxt}.${P.default.rootData}`),ue.dynamicRef)X.var(P.default.dynamicAnchors,y._`${P.default.valCxt}.${P.default.dynamicAnchors}`)},()=>{if(X.var(P.default.instancePath,y._`""`),X.var(P.default.parentData,y._`undefined`),X.var(P.default.parentDataProperty,y._`undefined`),X.var(P.default.rootData,P.default.data),ue.dynamicRef)X.var(P.default.dynamicAnchors,y._`{}`)})}function z(X){let{schema:ue,opts:Se,gen:Ve}=X;L(X,()=>{if(Se.$comment&&ue.$comment)je(X);if(pe(X),Ve.let(P.default.vErrors,null),Ve.let(P.default.errors,0),Se.unevaluated)F(X);de(X),Ge(X)})}function F(X){let{gen:ue,validateName:Se}=X;X.evaluated=ue.const("evaluated",y._`${Se}.evaluated`),ue.if(y._`${X.evaluated}.dynamicProps`,()=>ue.assign(y._`${X.evaluated}.props`,y._`undefined`)),ue.if(y._`${X.evaluated}.dynamicItems`,()=>ue.assign(y._`${X.evaluated}.items`,y._`undefined`))}function w(X,ue){let Se=typeof X=="object"&&X[ue.schemaId];return Se&&(ue.code.source||ue.code.process)?y._`/*# sourceURL=${Se} */`:y.nil}function B(X,ue){if(U(X)){if(Z(X),Y(X)){T(X,ue);return}}(0,h.boolOrEmptySchema)(X,ue)}function Y({schema:X,self:ue}){if(typeof X=="boolean")return!X;for(let Se in X)if(ue.RULES.all[Se])return!0;return!1}function U(X){return typeof X.schema!="boolean"}function T(X,ue){let{schema:Se,gen:Ve,opts:Ue}=X;if(Ue.$comment&&Se.$comment)je(X);ye(X),Ne(X);let xe=Ve.const("_errs",P.default.errors);de(X,xe),Ve.var(ue,y._`${xe} === ${P.default.errors}`)}function Z(X){(0,N.checkUnknownRules)(X),we(X)}function de(X,ue){if(X.opts.jtd)return Ze(X,[],!1,ue);let Se=(0,f.getSchemaTypes)(X.schema);Ze(X,Se,!(0,f.coerceAndCheckDataType)(X,Se),ue)}function we(X){let{schema:ue,errSchemaPath:Se,opts:Ve,self:Ue}=X;if(ue.$ref&&Ve.ignoreKeywordsWithRef&&(0,N.schemaHasRulesButRef)(ue,Ue.RULES))Ue.logger.warn(`$ref: keywords ignored in schema at path "${Se}"`)}function pe(X){let{schema:ue,opts:Se}=X;if(ue.default!==void 0&&Se.useDefaults&&Se.strictSchema)(0,N.checkStrictMode)(X,"default is ignored in the schema root")}function ye(X){let ue=X.schema[X.opts.schemaId];if(ue)X.baseId=(0,C.resolveUrl)(X.opts.uriResolver,X.baseId,ue)}function Ne(X){if(X.schema.$async&&!X.schemaEnv.$async)throw Error("async schema in sync schema")}function je({gen:X,schemaEnv:ue,schema:Se,errSchemaPath:Ve,opts:Ue}){let xe=Se.$comment;if(Ue.$comment===!0)X.code(y._`${P.default.self}.logger.log(${xe})`);else if(typeof Ue.$comment=="function"){let ot=y.str`${Ve}/$comment`,ct=X.scopeValue("root",{ref:ue.root});X.code(y._`${P.default.self}.opts.$comment(${xe}, ${ot}, ${ct}.schema)`)}}function Ge(X){let{gen:ue,schemaEnv:Se,validateName:Ve,ValidationError:Ue,opts:xe}=X;if(Se.$async)ue.if(y._`${P.default.errors} === 0`,()=>ue.return(P.default.data),()=>ue.throw(y._`new ${Ue}(${P.default.vErrors})`));else{if(ue.assign(y._`${Ve}.errors`,P.default.vErrors),xe.unevaluated)Qe(X);ue.return(y._`${P.default.errors} === 0`)}}function Qe({gen:X,evaluated:ue,props:Se,items:Ve}){if(Se instanceof y.Name)X.assign(y._`${ue}.props`,Se);if(Ve instanceof y.Name)X.assign(y._`${ue}.items`,Ve)}function Ze(X,ue,Se,Ve){let{gen:Ue,schema:xe,data:ot,allErrors:ct,opts:mt,self:it}=X,{RULES:et}=it;if(xe.$ref&&(mt.ignoreKeywordsWithRef||!(0,N.schemaHasRulesButRef)(xe,et))){Ue.block(()=>Be(X,"$ref",et.all.$ref.definition));return}if(!mt.jtd)We(X,ue);Ue.block(()=>{for(let lt of et.rules)Rt(lt);Rt(et.post)});function Rt(lt){if(!(0,g.shouldUseGroup)(xe,lt))return;if(lt.type){if(Ue.if((0,S.checkDataType)(lt.type,ot,mt.strictNumbers)),nt(X,lt),ue.length===1&&ue[0]===lt.type&&Se)Ue.else(),(0,S.reportTypeError)(X);Ue.endIf()}else nt(X,lt);if(!ct)Ue.if(y._`${P.default.errors} === ${Ve||0}`)}}function nt(X,ue){let{gen:Se,schema:Ve,opts:{useDefaults:Ue}}=X;if(Ue)(0,b.assignDefaults)(X,ue.type);Se.block(()=>{for(let xe of ue.rules)if((0,g.shouldUseRule)(Ve,xe))Be(X,xe.keyword,xe.definition,ue.type)})}function We(X,ue){if(X.schemaEnv.meta||!X.opts.strictTypes)return;if(ee(X,ue),!X.opts.allowUnionTypes)ne(X,ue);Re(X,X.dataTypes)}function ee(X,ue){if(!ue.length)return;if(!X.dataTypes.length){X.dataTypes=ue;return}ue.forEach((Se)=>{if(!Q(X.dataTypes,Se))qe(X,`type "${Se}" not allowed by context "${X.dataTypes.join(",")}"`)}),te(X,ue)}function ne(X,ue){if(ue.length>1&&!(ue.length===2&&ue.includes("null")))qe(X,"use allowUnionTypes to allow union type keyword")}function Re(X,ue){let Se=X.self.RULES.all;for(let Ve in Se){let Ue=Se[Ve];if(typeof Ue=="object"&&(0,g.shouldUseRule)(X.schema,Ue)){let{type:xe}=Ue.definition;if(xe.length&&!xe.some((ot)=>G(ue,ot)))qe(X,`missing type "${xe.join(",")}" for keyword "${Ve}"`)}}}function G(X,ue){return X.includes(ue)||ue==="number"&&X.includes("integer")}function Q(X,ue){return X.includes(ue)||ue==="integer"&&X.includes("number")}function te(X,ue){let Se=[];for(let Ve of X.dataTypes)if(Q(ue,Ve))Se.push(Ve);else if(ue.includes("integer")&&Ve==="number")Se.push("integer");X.dataTypes=Se}function qe(X,ue){let Se=X.schemaEnv.baseId+X.errSchemaPath;ue+=` at "${Se}" (strictTypes)`,(0,N.checkStrictMode)(X,ue,X.opts.strictTypes)}var Le=class{constructor(X,ue,Se){if((0,_.validateKeywordUsage)(X,ue,Se),this.gen=X.gen,this.allErrors=X.allErrors,this.keyword=Se,this.data=X.data,this.schema=X.schema[Se],this.$data=ue.$data&&X.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,N.schemaRefOrVal)(X,this.schema,Se,this.$data),this.schemaType=ue.schemaType,this.parentSchema=X.schema,this.params={},this.it=X,this.def=ue,this.$data)this.schemaCode=X.gen.const("vSchema",St(this.$data,X));else if(this.schemaCode=this.schemaValue,!(0,_.validSchemaType)(this.schema,ue.schemaType,ue.allowUndefined))throw Error(`${Se} value must be ${JSON.stringify(ue.schemaType)}`);if("code"in ue?ue.trackErrors:ue.errors!==!1)this.errsCount=X.gen.const("_errs",P.default.errors)}result(X,ue,Se){this.failResult((0,y.not)(X),ue,Se)}failResult(X,ue,Se){if(this.gen.if(X),Se)Se();else this.error();if(ue){if(this.gen.else(),ue(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(X,ue){this.failResult((0,y.not)(X),void 0,ue)}fail(X){if(X===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(X),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(X){if(!this.$data)return this.fail(X);let{schemaCode:ue}=this;this.fail(y._`${ue} !== undefined && (${(0,y.or)(this.invalid$data(),X)})`)}error(X,ue,Se){if(ue){this.setParams(ue),this._error(X,Se),this.setParams({});return}this._error(X,Se)}_error(X,ue){(X?J.reportExtraError:J.reportError)(this,this.def.error,ue)}$dataError(){(0,J.reportError)(this,this.def.$dataError||J.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,J.resetErrorsCount)(this.gen,this.errsCount)}ok(X){if(!this.allErrors)this.gen.if(X)}setParams(X,ue){if(ue)Object.assign(this.params,X);else this.params=X}block$data(X,ue,Se=y.nil){this.gen.block(()=>{this.check$data(X,Se),ue()})}check$data(X=y.nil,ue=y.nil){if(!this.$data)return;let{gen:Se,schemaCode:Ve,schemaType:Ue,def:xe}=this;if(Se.if((0,y.or)(y._`${Ve} === undefined`,ue)),X!==y.nil)Se.assign(X,!0);if(Ue.length||xe.validateSchema){if(Se.elseIf(this.invalid$data()),this.$dataError(),X!==y.nil)Se.assign(X,!1)}Se.else()}invalid$data(){let{gen:X,schemaCode:ue,schemaType:Se,def:Ve,it:Ue}=this;return(0,y.or)(xe(),ot());function xe(){if(Se.length){if(!(ue instanceof y.Name))throw Error("ajv implementation error");let ct=Array.isArray(Se)?Se:[Se];return y._`${(0,S.checkDataTypes)(ct,ue,Ue.opts.strictNumbers,S.DataType.Wrong)}`}return y.nil}function ot(){if(Ve.validateSchema){let ct=X.scopeValue("validate$data",{ref:Ve.validateSchema});return y._`!${ct}(${ue})`}return y.nil}}subschema(X,ue){let Se=(0,R.getSubschema)(this.it,X);(0,R.extendSubschemaData)(Se,this.it,X),(0,R.extendSubschemaMode)(Se,X);let Ve={...this.it,...Se,items:void 0,props:void 0};return B(Ve,ue),Ve}mergeEvaluated(X,ue){let{it:Se,gen:Ve}=this;if(!Se.opts.unevaluated)return;if(Se.props!==!0&&X.props!==void 0)Se.props=N.mergeEvaluated.props(Ve,X.props,Se.props,ue);if(Se.items!==!0&&X.items!==void 0)Se.items=N.mergeEvaluated.items(Ve,X.items,Se.items,ue)}mergeValidEvaluated(X,ue){let{it:Se,gen:Ve}=this;if(Se.opts.unevaluated&&(Se.props!==!0||Se.items!==!0))return Ve.if(ue,()=>this.mergeEvaluated(X,y.Name)),!0}};m.KeywordCxt=Le;function Be(X,ue,Se,Ve){let Ue=new Le(X,Se,ue);if("code"in Se)Se.code(Ue,Ve);else if(Ue.$data&&Se.validate)(0,_.funcKeywordCode)(Ue,Se);else if("macro"in Se)(0,_.macroKeywordCode)(Ue,Se);else if(Se.compile||Se.validate)(0,_.funcKeywordCode)(Ue,Se)}let He=/^\/(?:[^~]|~0|~1)*$/,Xe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function St(X,{dataLevel:ue,dataNames:Se,dataPathArr:Ve}){let Ue,xe;if(X==="")return P.default.rootData;if(X[0]==="/"){if(!He.test(X))throw Error(`Invalid JSON-pointer: ${X}`);Ue=X,xe=P.default.rootData}else{let it=Xe.exec(X);if(!it)throw Error(`Invalid JSON-pointer: ${X}`);let et=+it[1];if(Ue=it[2],Ue==="#"){if(et>=ue)throw Error(mt("property/index",et));return Ve[ue-et]}if(et>ue)throw Error(mt("data",et));if(xe=Se[ue-et],!Ue)return xe}let ot=xe,ct=Ue.split("/");for(let it of ct)if(it)xe=y._`${xe}${(0,y.getProperty)((0,N.unescapeJsonPointer)(it))}`,ot=y._`${ot} && ${xe}`;return ot;function mt(it,et){return`Cannot access ${it} ${et} levels up, current level is ${ue}`}}m.getData=St}),Wr=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});var h=class extends Error{constructor(f){super("validation failed");this.errors=f,this.ajv=this.validation=!0}};m.default=h}),Ha=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=_n();var f=class extends Error{constructor(g,S,b,_){super(_||`can't resolve reference ${b} from id ${S}`);this.missingRef=(0,h.resolveUrl)(g,S,b),this.missingSchema=(0,h.normalizeId)((0,h.getFullPath)(g,this.missingRef))}};m.default=f}),yn=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.resolveSchema=m.getCompilingSchema=m.resolveRef=m.compileSchema=m.SchemaEnv=void 0;let h=Fe(),f=Wr(),g=Et(),S=_n(),b=Ye(),_=Ua();var R=class{constructor(z){var F;this.refs={},this.dynamicAnchors={};let w;if(typeof z.schema=="object")w=z.schema;this.schema=z.schema,this.schemaId=z.schemaId,this.root=z.root||this,this.baseId=(F=z.baseId)!==null&&F!==void 0?F:(0,S.normalizeId)(w===null||w===void 0?void 0:w[z.schemaId||"$id"]),this.schemaPath=z.schemaPath,this.localRefs=z.localRefs,this.meta=z.meta,this.$async=w===null||w===void 0?void 0:w.$async,this.refs={}}};m.SchemaEnv=R;function y(z){let F=N.call(this,z);if(F)return F;let w=(0,S.getFullPath)(this.opts.uriResolver,z.root.baseId),{es5:B,lines:Y}=this.opts.code,{ownProperties:U}=this.opts,T=new h.CodeGen(this.scope,{es5:B,lines:Y,ownProperties:U}),Z;if(z.$async)Z=T.scopeValue("Error",{ref:f.default,code:h._`require("ajv/dist/runtime/validation_error").default`});let de=T.scopeName("validate");z.validateName=de;let we={gen:T,allErrors:this.opts.allErrors,data:g.default.data,parentData:g.default.parentData,parentDataProperty:g.default.parentDataProperty,dataNames:[g.default.data],dataPathArr:[h.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:T.scopeValue("schema",this.opts.code.source===!0?{ref:z.schema,code:(0,h.stringify)(z.schema)}:{ref:z.schema}),validateName:de,ValidationError:Z,schema:z.schema,schemaEnv:z,rootId:w,baseId:z.baseId||w,schemaPath:h.nil,errSchemaPath:z.schemaPath||(this.opts.jtd?"":"#"),errorPath:h._`""`,opts:this.opts,self:this},pe;try{this._compilations.add(z),(0,_.validateFunctionCode)(we),T.optimize(this.opts.code.optimize);let ye=T.toString();if(pe=`${T.scopeRefs(g.default.scope)}return ${ye}`,this.opts.code.process)pe=this.opts.code.process(pe,z);let Ne=Function(`${g.default.self}`,`${g.default.scope}`,pe)(this,this.scope.get());if(this.scope.value(de,{ref:Ne}),Ne.errors=null,Ne.schema=z.schema,Ne.schemaEnv=z,z.$async)Ne.$async=!0;if(this.opts.code.source===!0)Ne.source={validateName:de,validateCode:ye,scopeValues:T._values};if(this.opts.unevaluated){let{props:je,items:Ge}=we;if(Ne.evaluated={props:je instanceof h.Name?void 0:je,items:Ge instanceof h.Name?void 0:Ge,dynamicProps:je instanceof h.Name,dynamicItems:Ge instanceof h.Name},Ne.source)Ne.source.evaluated=(0,h.stringify)(Ne.evaluated)}return z.validate=Ne,z}catch(ye){if(delete z.validate,delete z.validateName,pe)this.logger.error("Error compiling schema, function code:",pe);throw ye}finally{this._compilations.delete(z)}}m.compileSchema=y;function P(z,F,w){var B;w=(0,S.resolveUrl)(this.opts.uriResolver,F,w);let Y=z.refs[w];if(Y)return Y;let U=W.call(this,z,w);if(U===void 0){let T=(B=z.localRefs)===null||B===void 0?void 0:B[w],{schemaId:Z}=this.opts;if(T)U=new R({schema:T,schemaId:Z,root:z,baseId:F})}if(U===void 0)return;return z.refs[w]=C.call(this,U)}m.resolveRef=P;function C(z){if((0,S.inlineRef)(z.schema,this.opts.inlineRefs))return z.schema;return z.validate?z:y.call(this,z)}function N(z){for(let F of this._compilations)if(J(F,z))return F}m.getCompilingSchema=N;function J(z,F){return z.schema===F.schema&&z.root===F.root&&z.baseId===F.baseId}function W(z,F){let w;while(typeof(w=this.refs[F])=="string")F=w;return w||this.schemas[F]||L.call(this,z,F)}function L(z,F){let w=this.opts.uriResolver.parse(F),B=(0,S._getFullPath)(this.opts.uriResolver,w),Y=(0,S.getFullPath)(this.opts.uriResolver,z.baseId,void 0);if(Object.keys(z.schema).length>0&&B===Y)return I.call(this,w,z);let U=(0,S.normalizeId)(B),T=this.refs[U]||this.schemas[U];if(typeof T=="string"){let Z=L.call(this,z,T);if(typeof(Z===null||Z===void 0?void 0:Z.schema)!=="object")return;return I.call(this,w,Z)}if(typeof(T===null||T===void 0?void 0:T.schema)!=="object")return;if(!T.validate)y.call(this,T);if(U===(0,S.normalizeId)(F)){let{schema:Z}=T,{schemaId:de}=this.opts,we=Z[de];if(we)Y=(0,S.resolveUrl)(this.opts.uriResolver,Y,we);return new R({schema:Z,schemaId:de,root:z,baseId:Y})}return I.call(this,w,T)}m.resolveSchema=L;let K=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function I(z,{baseId:F,schema:w,root:B}){var Y;if(((Y=z.fragment)===null||Y===void 0?void 0:Y[0])!=="/")return;for(let Z of z.fragment.slice(1).split("/")){if(typeof w==="boolean")return;let de=w[(0,b.unescapeFragment)(Z)];if(de===void 0)return;w=de;let we=typeof w==="object"&&w[this.opts.schemaId];if(!K.has(Z)&&we)F=(0,S.resolveUrl)(this.opts.uriResolver,F,we)}let U;if(typeof w!="boolean"&&w.$ref&&!(0,b.schemaHasRulesButRef)(w,this.RULES)){let Z=(0,S.resolveUrl)(this.opts.uriResolver,F,w.$ref);U=L.call(this,B,Z)}let{schemaId:T}=this.opts;if(U=U||new R({schema:w,schemaId:T,root:B,baseId:F}),U.schema!==U.root.schema)return U}}),id=_e((m,h)=>{h.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}}),Ic=_e((m,h)=>{let f=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),g=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 S(L){let K="",I=0,z=0;for(z=0;z<L.length;z++){if(I=L[z].charCodeAt(0),I===48)continue;if(!(I>=48&&I<=57||I>=65&&I<=70||I>=97&&I<=102))return"";K+=L[z];break}for(z+=1;z<L.length;z++){if(I=L[z].charCodeAt(0),!(I>=48&&I<=57||I>=65&&I<=70||I>=97&&I<=102))return"";K+=L[z]}return K}let b=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function _(L){return L.length=0,!0}function R(L,K,I){if(L.length){let z=S(L);if(z!=="")K.push(z);else return I.error=!0,!1;L.length=0}return!0}function y(L){let K=0,I={error:!1,address:"",zone:""},z=[],F=[],w=!1,B=!1,Y=R;for(let U=0;U<L.length;U++){let T=L[U];if(T==="["||T==="]")continue;if(T===":"){if(w===!0)B=!0;if(!Y(F,z,I))break;if(++K>7){I.error=!0;break}if(U>0&&L[U-1]===":")w=!0;z.push(":");continue}else if(T==="%"){if(!Y(F,z,I))break;Y=_}else{F.push(T);continue}}if(F.length)if(Y===_)I.zone=F.join("");else if(B)z.push(F.join(""));else z.push(S(F));return I.address=z.join(""),I}function P(L){if(C(L,":")<2)return{host:L,isIPV6:!1};let K=y(L);if(!K.error){let{address:I,address:z}=K;if(K.zone)I+="%"+K.zone,z+="%25"+K.zone;return{host:I,isIPV6:!0,escapedHost:z}}else return{host:L,isIPV6:!1}}function C(L,K){let I=0;for(let z=0;z<L.length;z++)if(L[z]===K)I++;return I}function N(L){let K=L,I=[],z=-1,F=0;while(F=K.length){if(F===1)if(K===".")break;else if(K==="/"){I.push("/");break}else{I.push(K);break}else if(F===2){if(K[0]==="."){if(K[1]===".")break;else if(K[1]==="/"){K=K.slice(2);continue}}else if(K[0]==="/"){if(K[1]==="."||K[1]==="/"){I.push("/");break}}}else if(F===3){if(K==="/.."){if(I.length!==0)I.pop();I.push("/");break}}if(K[0]==="."){if(K[1]==="."){if(K[2]==="/"){K=K.slice(3);continue}}else if(K[1]==="/"){K=K.slice(2);continue}}else if(K[0]==="/"){if(K[1]==="."){if(K[2]==="/"){K=K.slice(2);continue}else if(K[2]==="."){if(K[3]==="/"){if(K=K.slice(3),I.length!==0)I.pop();continue}}}}if((z=K.indexOf("/",1))===-1){I.push(K);break}else I.push(K.slice(0,z)),K=K.slice(z)}return I.join("")}function J(L,K){let I=K!==!0?escape:unescape;if(L.scheme!==void 0)L.scheme=I(L.scheme);if(L.userinfo!==void 0)L.userinfo=I(L.userinfo);if(L.host!==void 0)L.host=I(L.host);if(L.path!==void 0)L.path=I(L.path);if(L.query!==void 0)L.query=I(L.query);if(L.fragment!==void 0)L.fragment=I(L.fragment);return L}function W(L){let K=[];if(L.userinfo!==void 0)K.push(L.userinfo),K.push("@");if(L.host!==void 0){let I=unescape(L.host);if(!g(I)){let z=P(I);if(z.isIPV6===!0)I=`[${z.escapedHost}]`;else I=L.host}K.push(I)}if(typeof L.port==="number"||typeof L.port==="string")K.push(":"),K.push(String(L.port));return K.length?K.join(""):void 0}h.exports={nonSimpleDomain:b,recomposeAuthority:W,normalizeComponentEncoding:J,removeDotSegments:N,isIPv4:g,isUUID:f,normalizeIPv6:P,stringArrayToHexStripped:S}}),cd=_e((m,h)=>{let{isUUID:f}=Ic(),g=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,S=["http","https","ws","wss","urn","urn:uuid"];function b(T){return S.indexOf(T)!==-1}function _(T){if(T.secure===!0)return!0;else if(T.secure===!1)return!1;else if(T.scheme)return T.scheme.length===3&&(T.scheme[0]==="w"||T.scheme[0]==="W")&&(T.scheme[1]==="s"||T.scheme[1]==="S")&&(T.scheme[2]==="s"||T.scheme[2]==="S");else return!1}function R(T){if(!T.host)T.error=T.error||"HTTP URIs must have a host.";return T}function y(T){let Z=String(T.scheme).toLowerCase()==="https";if(T.port===(Z?443:80)||T.port==="")T.port=void 0;if(!T.path)T.path="/";return T}function P(T){return T.secure=_(T),T.resourceName=(T.path||"/")+(T.query?"?"+T.query:""),T.path=void 0,T.query=void 0,T}function C(T){if(T.port===(_(T)?443:80)||T.port==="")T.port=void 0;if(typeof T.secure==="boolean")T.scheme=T.secure?"wss":"ws",T.secure=void 0;if(T.resourceName){let[Z,de]=T.resourceName.split("?");T.path=Z&&Z!=="/"?Z:void 0,T.query=de,T.resourceName=void 0}return T.fragment=void 0,T}function N(T,Z){if(!T.path)return T.error="URN can not be parsed",T;let de=T.path.match(g);if(de){let we=Z.scheme||T.scheme||"urn";T.nid=de[1].toLowerCase(),T.nss=de[2];let pe=U(`${we}:${Z.nid||T.nid}`);if(T.path=void 0,pe)T=pe.parse(T,Z)}else T.error=T.error||"URN can not be parsed.";return T}function J(T,Z){if(T.nid===void 0)throw Error("URN without nid cannot be serialized");let de=Z.scheme||T.scheme||"urn",we=T.nid.toLowerCase(),pe=U(`${de}:${Z.nid||we}`);if(pe)T=pe.serialize(T,Z);let ye=T,Ne=T.nss;return ye.path=`${we||Z.nid}:${Ne}`,Z.skipEscape=!0,ye}function W(T,Z){let de=T;if(de.uuid=de.nss,de.nss=void 0,!Z.tolerant&&(!de.uuid||!f(de.uuid)))de.error=de.error||"UUID is not valid.";return de}function L(T){let Z=T;return Z.nss=(T.uuid||"").toLowerCase(),Z}let K={scheme:"http",domainHost:!0,parse:R,serialize:y},I={scheme:"https",domainHost:K.domainHost,parse:R,serialize:y},z={scheme:"ws",domainHost:!0,parse:P,serialize:C},F={scheme:"wss",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize},Y={http:K,https:I,ws:z,wss:F,urn:{scheme:"urn",parse:N,serialize:J,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:W,serialize:L,skipNormalize:!0}};Object.setPrototypeOf(Y,null);function U(T){return T&&(Y[T]||Y[T.toLowerCase()])||void 0}h.exports={wsIsSecure:_,SCHEMES:Y,isValidSchemeName:b,getSchemeHandler:U}}),ld=_e((m,h)=>{let{normalizeIPv6:f,removeDotSegments:g,recomposeAuthority:S,normalizeComponentEncoding:b,isIPv4:_,nonSimpleDomain:R}=Ic(),{SCHEMES:y,getSchemeHandler:P}=cd();function C(F,w){if(typeof F==="string")F=L(I(F,w),w);else if(typeof F==="object")F=I(L(F,w),w);return F}function N(F,w,B){let Y=B?Object.assign({scheme:"null"},B):{scheme:"null"},U=J(I(F,Y),I(w,Y),Y,!0);return Y.skipEscape=!0,L(U,Y)}function J(F,w,B,Y){let U={};if(!Y)F=I(L(F,B),B),w=I(L(w,B),B);if(B=B||{},!B.tolerant&&w.scheme)U.scheme=w.scheme,U.userinfo=w.userinfo,U.host=w.host,U.port=w.port,U.path=g(w.path||""),U.query=w.query;else{if(w.userinfo!==void 0||w.host!==void 0||w.port!==void 0)U.userinfo=w.userinfo,U.host=w.host,U.port=w.port,U.path=g(w.path||""),U.query=w.query;else{if(!w.path)if(U.path=F.path,w.query!==void 0)U.query=w.query;else U.query=F.query;else{if(w.path[0]==="/")U.path=g(w.path);else{if((F.userinfo!==void 0||F.host!==void 0||F.port!==void 0)&&!F.path)U.path="/"+w.path;else if(!F.path)U.path=w.path;else U.path=F.path.slice(0,F.path.lastIndexOf("/")+1)+w.path;U.path=g(U.path)}U.query=w.query}U.userinfo=F.userinfo,U.host=F.host,U.port=F.port}U.scheme=F.scheme}return U.fragment=w.fragment,U}function W(F,w,B){if(typeof F==="string")F=unescape(F),F=L(b(I(F,B),!0),{...B,skipEscape:!0});else if(typeof F==="object")F=L(b(F,!0),{...B,skipEscape:!0});if(typeof w==="string")w=unescape(w),w=L(b(I(w,B),!0),{...B,skipEscape:!0});else if(typeof w==="object")w=L(b(w,!0),{...B,skipEscape:!0});return F.toLowerCase()===w.toLowerCase()}function L(F,w){let B={host:F.host,scheme:F.scheme,userinfo:F.userinfo,port:F.port,path:F.path,query:F.query,nid:F.nid,nss:F.nss,uuid:F.uuid,fragment:F.fragment,reference:F.reference,resourceName:F.resourceName,secure:F.secure,error:""},Y=Object.assign({},w),U=[],T=P(Y.scheme||B.scheme);if(T&&T.serialize)T.serialize(B,Y);if(B.path!==void 0)if(!Y.skipEscape){if(B.path=escape(B.path),B.scheme!==void 0)B.path=B.path.split("%3A").join(":")}else B.path=unescape(B.path);if(Y.reference!=="suffix"&&B.scheme)U.push(B.scheme,":");let Z=S(B);if(Z!==void 0){if(Y.reference!=="suffix")U.push("//");if(U.push(Z),B.path&&B.path[0]!=="/")U.push("/")}if(B.path!==void 0){let de=B.path;if(!Y.absolutePath&&(!T||!T.absolutePath))de=g(de);if(Z===void 0&&de[0]==="/"&&de[1]==="/")de="/%2F"+de.slice(2);U.push(de)}if(B.query!==void 0)U.push("?",B.query);if(B.fragment!==void 0)U.push("#",B.fragment);return U.join("")}let K=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function I(F,w){let B=Object.assign({},w),Y={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},U=!1;if(B.reference==="suffix")if(B.scheme)F=B.scheme+":"+F;else F="//"+F;let T=F.match(K);if(T){if(Y.scheme=T[1],Y.userinfo=T[3],Y.host=T[4],Y.port=parseInt(T[5],10),Y.path=T[6]||"",Y.query=T[7],Y.fragment=T[8],isNaN(Y.port))Y.port=T[5];if(Y.host)if(_(Y.host)===!1){let de=f(Y.host);Y.host=de.host.toLowerCase(),U=de.isIPV6}else U=!0;if(Y.scheme===void 0&&Y.userinfo===void 0&&Y.host===void 0&&Y.port===void 0&&Y.query===void 0&&!Y.path)Y.reference="same-document";else if(Y.scheme===void 0)Y.reference="relative";else if(Y.fragment===void 0)Y.reference="absolute";else Y.reference="uri";if(B.reference&&B.reference!=="suffix"&&B.reference!==Y.reference)Y.error=Y.error||"URI is not a "+B.reference+" reference.";let Z=P(B.scheme||Y.scheme);if(!B.unicodeSupport&&(!Z||!Z.unicodeSupport)){if(Y.host&&(B.domainHost||Z&&Z.domainHost)&&U===!1&&R(Y.host))try{Y.host=URL.domainToASCII(Y.host.toLowerCase())}catch(de){Y.error=Y.error||"Host's domain name can not be converted to ASCII: "+de}}if(!Z||Z&&!Z.skipNormalize){if(F.indexOf("%")!==-1){if(Y.scheme!==void 0)Y.scheme=unescape(Y.scheme);if(Y.host!==void 0)Y.host=unescape(Y.host)}if(Y.path)Y.path=escape(unescape(Y.path));if(Y.fragment)Y.fragment=encodeURI(decodeURIComponent(Y.fragment))}if(Z&&Z.parse)Z.parse(Y,B)}else Y.error=Y.error||"URI can not be parsed.";return Y}let z={SCHEMES:y,normalize:C,resolve:N,resolveComponent:J,equal:W,serialize:L,parse:I};h.exports=z,h.exports.default=z,h.exports.fastUri=z}),ud=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=ld();h.code='require("ajv/dist/runtime/uri").default',m.default=h}),$i=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=void 0;var h=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var f=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});let g=Wr(),S=Ha(),b=qc(),_=yn(),R=Fe(),y=_n(),P=gn(),C=Ye(),N=id(),J=ud(),W=(ee,ne)=>new RegExp(ee,ne);W.code="new RegExp";let L=["removeAdditional","useDefaults","coerceTypes"],K=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),I={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."},z={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},F=200;function w(ee){var ne,Re,G,Q,te,qe,Le,Be,He,Xe,St,X,ue,Se,Ve,Ue,xe,ot,ct,mt,it,et,Rt,lt,Tt;let $t=ee.strict,Ct=(ne=ee.code)===null||ne===void 0?void 0:ne.optimize,It=Ct===!0||Ct===void 0?1:Ct||0,Ot=(G=(Re=ee.code)===null||Re===void 0?void 0:Re.regExp)!==null&&G!==void 0?G:W,Xt=(Q=ee.uriResolver)!==null&&Q!==void 0?Q:J.default;return{strictSchema:(qe=(te=ee.strictSchema)!==null&&te!==void 0?te:$t)!==null&&qe!==void 0?qe:!0,strictNumbers:(Be=(Le=ee.strictNumbers)!==null&&Le!==void 0?Le:$t)!==null&&Be!==void 0?Be:!0,strictTypes:(Xe=(He=ee.strictTypes)!==null&&He!==void 0?He:$t)!==null&&Xe!==void 0?Xe:"log",strictTuples:(X=(St=ee.strictTuples)!==null&&St!==void 0?St:$t)!==null&&X!==void 0?X:"log",strictRequired:(Se=(ue=ee.strictRequired)!==null&&ue!==void 0?ue:$t)!==null&&Se!==void 0?Se:!1,code:ee.code?{...ee.code,optimize:It,regExp:Ot}:{optimize:It,regExp:Ot},loopRequired:(Ve=ee.loopRequired)!==null&&Ve!==void 0?Ve:F,loopEnum:(Ue=ee.loopEnum)!==null&&Ue!==void 0?Ue:F,meta:(xe=ee.meta)!==null&&xe!==void 0?xe:!0,messages:(ot=ee.messages)!==null&&ot!==void 0?ot:!0,inlineRefs:(ct=ee.inlineRefs)!==null&&ct!==void 0?ct:!0,schemaId:(mt=ee.schemaId)!==null&&mt!==void 0?mt:"$id",addUsedSchema:(it=ee.addUsedSchema)!==null&&it!==void 0?it:!0,validateSchema:(et=ee.validateSchema)!==null&&et!==void 0?et:!0,validateFormats:(Rt=ee.validateFormats)!==null&&Rt!==void 0?Rt:!0,unicodeRegExp:(lt=ee.unicodeRegExp)!==null&<!==void 0?lt:!0,int32range:(Tt=ee.int32range)!==null&&Tt!==void 0?Tt:!0,uriResolver:Xt}}var B=class{constructor(ee={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,ee=this.opts={...ee,...w(ee)};let{es5:ne,lines:Re}=this.opts.code;this.scope=new R.ValueScope({scope:{},prefixes:K,es5:ne,lines:Re}),this.logger=ye(ee.logger);let G=ee.validateFormats;if(ee.validateFormats=!1,this.RULES=(0,b.getRules)(),Y.call(this,I,ee,"NOT SUPPORTED"),Y.call(this,z,ee,"DEPRECATED","warn"),this._metaOpts=we.call(this),ee.formats)Z.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),ee.keywords)de.call(this,ee.keywords);if(typeof ee.meta=="object")this.addMetaSchema(ee.meta);T.call(this),ee.validateFormats=G}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:ee,meta:ne,schemaId:Re}=this.opts,G=N;if(Re==="id")G={...N},G.id=G.$id,delete G.$id;if(ne&&ee)this.addMetaSchema(G,G[Re],!1)}defaultMeta(){let{meta:ee,schemaId:ne}=this.opts;return this.opts.defaultMeta=typeof ee=="object"?ee[ne]||ee:void 0}validate(ee,ne){let Re;if(typeof ee=="string"){if(Re=this.getSchema(ee),!Re)throw Error(`no schema with key or ref "${ee}"`)}else Re=this.compile(ee);let G=Re(ne);if(!("$async"in Re))this.errors=Re.errors;return G}compile(ee,ne){let Re=this._addSchema(ee,ne);return Re.validate||this._compileSchemaEnv(Re)}compileAsync(ee,ne){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:Re}=this.opts;return G.call(this,ee,ne);async function G(He,Xe){await Q.call(this,He.$schema);let St=this._addSchema(He,Xe);return St.validate||te.call(this,St)}async function Q(He){if(He&&!this.getSchema(He))await G.call(this,{$ref:He},!0)}async function te(He){try{return this._compileSchemaEnv(He)}catch(Xe){if(!(Xe instanceof S.default))throw Xe;return qe.call(this,Xe),await Le.call(this,Xe.missingSchema),te.call(this,He)}}function qe({missingSchema:He,missingRef:Xe}){if(this.refs[He])throw Error(`AnySchema ${He} is loaded but ${Xe} cannot be resolved`)}async function Le(He){let Xe=await Be.call(this,He);if(!this.refs[He])await Q.call(this,Xe.$schema);if(!this.refs[He])this.addSchema(Xe,He,ne)}async function Be(He){let Xe=this._loading[He];if(Xe)return Xe;try{return await(this._loading[He]=Re(He))}finally{delete this._loading[He]}}}addSchema(ee,ne,Re,G=this.opts.validateSchema){if(Array.isArray(ee)){for(let te of ee)this.addSchema(te,void 0,Re,G);return this}let Q;if(typeof ee==="object"){let{schemaId:te}=this.opts;if(Q=ee[te],Q!==void 0&&typeof Q!="string")throw Error(`schema ${te} must be string`)}return ne=(0,y.normalizeId)(ne||Q),this._checkUnique(ne),this.schemas[ne]=this._addSchema(ee,Re,ne,G,!0),this}addMetaSchema(ee,ne,Re=this.opts.validateSchema){return this.addSchema(ee,ne,!0,Re),this}validateSchema(ee,ne){if(typeof ee=="boolean")return!0;let Re;if(Re=ee.$schema,Re!==void 0&&typeof Re!="string")throw Error("$schema must be a string");if(Re=Re||this.opts.defaultMeta||this.defaultMeta(),!Re)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let G=this.validate(Re,ee);if(!G&&ne){let Q="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(Q);else throw Error(Q)}return G}getSchema(ee){let ne;while(typeof(ne=U.call(this,ee))=="string")ee=ne;if(ne===void 0){let{schemaId:Re}=this.opts,G=new _.SchemaEnv({schema:{},schemaId:Re});if(ne=_.resolveSchema.call(this,G,ee),!ne)return;this.refs[ee]=ne}return ne.validate||this._compileSchemaEnv(ne)}removeSchema(ee){if(ee instanceof RegExp)return this._removeAllSchemas(this.schemas,ee),this._removeAllSchemas(this.refs,ee),this;switch(typeof ee){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let ne=U.call(this,ee);if(typeof ne=="object")this._cache.delete(ne.schema);return delete this.schemas[ee],delete this.refs[ee],this}case"object":{let ne=ee;this._cache.delete(ne);let Re=ee[this.opts.schemaId];if(Re)Re=(0,y.normalizeId)(Re),delete this.schemas[Re],delete this.refs[Re];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(ee){for(let ne of ee)this.addKeyword(ne);return this}addKeyword(ee,ne){let Re;if(typeof ee=="string"){if(Re=ee,typeof ne=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),ne.keyword=Re}else if(typeof ee=="object"&&ne===void 0){if(ne=ee,Re=ne.keyword,Array.isArray(Re)&&!Re.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(je.call(this,Re,ne),!ne)return(0,C.eachItem)(Re,(Q)=>Ge.call(this,Q)),this;Ze.call(this,ne);let G={...ne,type:(0,P.getJSONTypes)(ne.type),schemaType:(0,P.getJSONTypes)(ne.schemaType)};return(0,C.eachItem)(Re,G.type.length===0?(Q)=>Ge.call(this,Q,G):(Q)=>G.type.forEach((te)=>Ge.call(this,Q,G,te))),this}getKeyword(ee){let ne=this.RULES.all[ee];return typeof ne=="object"?ne.definition:!!ne}removeKeyword(ee){let{RULES:ne}=this;delete ne.keywords[ee],delete ne.all[ee];for(let Re of ne.rules){let G=Re.rules.findIndex((Q)=>Q.keyword===ee);if(G>=0)Re.rules.splice(G,1)}return this}addFormat(ee,ne){if(typeof ne=="string")ne=new RegExp(ne);return this.formats[ee]=ne,this}errorsText(ee=this.errors,{separator:ne=", ",dataVar:Re="data"}={}){if(!ee||ee.length===0)return"No errors";return ee.map((G)=>`${Re}${G.instancePath} ${G.message}`).reduce((G,Q)=>G+ne+Q)}$dataMetaSchema(ee,ne){let Re=this.RULES.all;ee=JSON.parse(JSON.stringify(ee));for(let G of ne){let Q=G.split("/").slice(1),te=ee;for(let qe of Q)te=te[qe];for(let qe in Re){let Le=Re[qe];if(typeof Le!="object")continue;let{$data:Be}=Le.definition,He=te[qe];if(Be&&He)te[qe]=We(He)}}return ee}_removeAllSchemas(ee,ne){for(let Re in ee){let G=ee[Re];if(!ne||ne.test(Re)){if(typeof G=="string")delete ee[Re];else if(G&&!G.meta)this._cache.delete(G.schema),delete ee[Re]}}}_addSchema(ee,ne,Re,G=this.opts.validateSchema,Q=this.opts.addUsedSchema){let te,{schemaId:qe}=this.opts;if(typeof ee=="object")te=ee[qe];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof ee!="boolean")throw Error("schema must be object or boolean");let Le=this._cache.get(ee);if(Le!==void 0)return Le;Re=(0,y.normalizeId)(te||Re);let Be=y.getSchemaRefs.call(this,ee,Re);if(Le=new _.SchemaEnv({schema:ee,schemaId:qe,meta:ne,baseId:Re,localRefs:Be}),this._cache.set(Le.schema,Le),Q&&!Re.startsWith("#")){if(Re)this._checkUnique(Re);this.refs[Re]=Le}if(G)this.validateSchema(ee,!0);return Le}_checkUnique(ee){if(this.schemas[ee]||this.refs[ee])throw Error(`schema with key or id "${ee}" already exists`)}_compileSchemaEnv(ee){if(ee.meta)this._compileMetaSchema(ee);else _.compileSchema.call(this,ee);if(!ee.validate)throw Error("ajv implementation error");return ee.validate}_compileMetaSchema(ee){let ne=this.opts;this.opts=this._metaOpts;try{_.compileSchema.call(this,ee)}finally{this.opts=ne}}};B.ValidationError=g.default,B.MissingRefError=S.default,m.default=B;function Y(ee,ne,Re,G="error"){for(let Q in ee){let te=Q;if(te in ne)this.logger[G](`${Re}: option ${Q}. ${ee[te]}`)}}function U(ee){return ee=(0,y.normalizeId)(ee),this.schemas[ee]||this.refs[ee]}function T(){let ee=this.opts.schemas;if(!ee)return;if(Array.isArray(ee))this.addSchema(ee);else for(let ne in ee)this.addSchema(ee[ne],ne)}function Z(){for(let ee in this.opts.formats){let ne=this.opts.formats[ee];if(ne)this.addFormat(ee,ne)}}function de(ee){if(Array.isArray(ee)){this.addVocabulary(ee);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let ne in ee){let Re=ee[ne];if(!Re.keyword)Re.keyword=ne;this.addKeyword(Re)}}function we(){let ee={...this.opts};for(let ne of L)delete ee[ne];return ee}let pe={log(){},warn(){},error(){}};function ye(ee){if(ee===!1)return pe;if(ee===void 0)return console;if(ee.log&&ee.warn&&ee.error)return ee;throw Error("logger must implement log, warn and error methods")}let Ne=/^[a-z_$][a-z0-9_$:-]*$/i;function je(ee,ne){let{RULES:Re}=this;if((0,C.eachItem)(ee,(G)=>{if(Re.keywords[G])throw Error(`Keyword ${G} is already defined`);if(!Ne.test(G))throw Error(`Keyword ${G} has invalid name`)}),!ne)return;if(ne.$data&&!(("code"in ne)||("validate"in ne)))throw Error('$data keyword must have "code" or "validate" function')}function Ge(ee,ne,Re){var G;let Q=ne===null||ne===void 0?void 0:ne.post;if(Re&&Q)throw Error('keyword with "post" flag cannot have "type"');let{RULES:te}=this,qe=Q?te.post:te.rules.find(({type:Be})=>Be===Re);if(!qe)qe={type:Re,rules:[]},te.rules.push(qe);if(te.keywords[ee]=!0,!ne)return;let Le={keyword:ee,definition:{...ne,type:(0,P.getJSONTypes)(ne.type),schemaType:(0,P.getJSONTypes)(ne.schemaType)}};if(ne.before)Qe.call(this,qe,Le,ne.before);else qe.rules.push(Le);te.all[ee]=Le,(G=ne.implements)===null||G===void 0||G.forEach((Be)=>this.addKeyword(Be))}function Qe(ee,ne,Re){let G=ee.rules.findIndex((Q)=>Q.keyword===Re);if(G>=0)ee.rules.splice(G,0,ne);else ee.rules.push(ne),this.logger.warn(`rule ${Re} is not defined`)}function Ze(ee){let{metaSchema:ne}=ee;if(ne===void 0)return;if(ee.$data&&this.opts.$data)ne=We(ne);ee.validateSchema=this.compile(ne,!0)}let nt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function We(ee){return{anyOf:[ee,nt]}}});var dd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};m.default=h}),Pi=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.callRef=m.getValidate=void 0;let h=Ha(),f=wt(),g=Fe(),S=Et(),b=yn(),_=Ye(),R={keyword:"$ref",schemaType:"string",code(C){let{gen:N,schema:J,it:W}=C,{baseId:L,schemaEnv:K,validateName:I,opts:z,self:F}=W,{root:w}=K;if((J==="#"||J==="#/")&&L===w.baseId)return Y();let B=b.resolveRef.call(F,w,L,J);if(B===void 0)throw new h.default(W.opts.uriResolver,L,J);if(B instanceof b.SchemaEnv)return U(B);return T(B);function Y(){if(K===w)return P(C,I,K,K.$async);let Z=N.scopeValue("root",{ref:w});return P(C,g._`${Z}.validate`,w,w.$async)}function U(Z){P(C,y(C,Z),Z,Z.$async)}function T(Z){let de=N.scopeValue("schema",z.code.source===!0?{ref:Z,code:(0,g.stringify)(Z)}:{ref:Z}),we=N.name("valid"),pe=C.subschema({schema:Z,dataTypes:[],schemaPath:g.nil,topSchemaRef:de,errSchemaPath:J},we);C.mergeEvaluated(pe),C.ok(we)}}};function y(C,N){let{gen:J}=C;return N.validate?J.scopeValue("validate",{ref:N.validate}):g._`${J.scopeValue("wrapper",{ref:N})}.validate`}m.getValidate=y;function P(C,N,J,W){let{gen:L,it:K}=C,{allErrors:I,schemaEnv:z,opts:F}=K,w=F.passContext?S.default.this:g.nil;if(W)B();else Y();function B(){if(!z.$async)throw Error("async schema referenced by sync schema");let Z=L.let("valid");L.try(()=>{if(L.code(g._`await ${(0,f.callValidateCode)(C,N,w)}`),T(N),!I)L.assign(Z,!0)},(de)=>{if(L.if(g._`!(${de} instanceof ${K.ValidationError})`,()=>L.throw(de)),U(de),!I)L.assign(Z,!1)}),C.ok(Z)}function Y(){C.result((0,f.callValidateCode)(C,N,w),()=>T(N),()=>U(N))}function U(Z){let de=g._`${Z}.errors`;L.assign(S.default.vErrors,g._`${S.default.vErrors} === null ? ${de} : ${S.default.vErrors}.concat(${de})`),L.assign(S.default.errors,g._`${S.default.vErrors}.length`)}function T(Z){var de;if(!K.opts.unevaluated)return;let we=(de=J===null||J===void 0?void 0:J.validate)===null||de===void 0?void 0:de.evaluated;if(K.props!==!0)if(we&&!we.dynamicProps){if(we.props!==void 0)K.props=_.mergeEvaluated.props(L,we.props,K.props)}else{let pe=L.var("props",g._`${Z}.evaluated.props`);K.props=_.mergeEvaluated.props(L,pe,K.props,g.Name)}if(K.items!==!0)if(we&&!we.dynamicItems){if(we.items!==void 0)K.items=_.mergeEvaluated.items(L,we.items,K.items)}else{let pe=L.var("items",g._`${Z}.evaluated.items`);K.items=_.mergeEvaluated.items(L,pe,K.items,g.Name)}}}m.callRef=P,m.default=R}),Oc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=dd(),f=Pi(),g=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",h.default,f.default];m.default=g}),md=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=h.operators,g={maximum:{okStr:"<=",ok:f.LTE,fail:f.GT},minimum:{okStr:">=",ok:f.GTE,fail:f.LT},exclusiveMaximum:{okStr:"<",ok:f.LT,fail:f.GTE},exclusiveMinimum:{okStr:">",ok:f.GT,fail:f.LTE}},S={keyword:Object.keys(g),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:b,schemaCode:_})=>h.str`must be ${g[b].okStr} ${_}`,params:({keyword:b,schemaCode:_})=>h._`{comparison: ${g[b].okStr}, limit: ${_}}`},code(b){let{keyword:_,data:R,schemaCode:y}=b;b.fail$data(h._`${R} ${g[_].fail} ${y} || isNaN(${R})`)}};m.default=S}),hd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:g})=>h.str`must be multiple of ${g}`,params:({schemaCode:g})=>h._`{multipleOf: ${g}}`},code(g){let{gen:S,data:b,schemaCode:_,it:R}=g,y=R.opts.multipleOfPrecision,P=S.let("res"),C=y?h._`Math.abs(Math.round(${P}) - ${P}) > 1e-${y}`:h._`${P} !== parseInt(${P})`;g.fail$data(h._`(${_} === 0 || (${P} = ${b}/${_}, ${C}))`)}};m.default=f}),pd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});function h(f){let g=f.length,S=0,b=0,_;while(b<g)if(S++,_=f.charCodeAt(b++),_>=55296&&_<=56319&&b<g){if(_=f.charCodeAt(b),(_&64512)===56320)b++}return S}m.default=h,h.code='require("ajv/dist/runtime/ucs2length").default'}),fd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=Ye(),g=pd(),S={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:b,schemaCode:_}){let R=b==="maxLength"?"more":"fewer";return h.str`must NOT have ${R} than ${_} characters`},params:({schemaCode:b})=>h._`{limit: ${b}}`},code(b){let{keyword:_,data:R,schemaCode:y,it:P}=b,C=_==="maxLength"?h.operators.GT:h.operators.LT,N=P.opts.unicode===!1?h._`${R}.length`:h._`${(0,f.useFunc)(b.gen,g.default)}(${R})`;b.fail$data(h._`${N} ${C} ${y}`)}};m.default=S}),gd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Ye(),g=Fe(),S={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:b})=>g.str`must match pattern "${b}"`,params:({schemaCode:b})=>g._`{pattern: ${b}}`},code(b){let{gen:_,data:R,$data:y,schema:P,schemaCode:C,it:N}=b,J=N.opts.unicodeRegExp?"u":"";if(y){let{regExp:W}=N.opts.code,L=W.code==="new RegExp"?g._`new RegExp`:(0,f.useFunc)(_,W),K=_.let("valid");_.try(()=>_.assign(K,g._`${L}(${C}, ${J}).test(${R})`),()=>_.assign(K,!1)),b.fail$data(g._`!${K}`)}else{let W=(0,h.usePattern)(b,P);b.fail$data(g._`!${W}.test(${R})`)}}};m.default=S}),Sd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:g,schemaCode:S}){let b=g==="maxProperties"?"more":"fewer";return h.str`must NOT have ${b} than ${S} properties`},params:({schemaCode:g})=>h._`{limit: ${g}}`},code(g){let{keyword:S,data:b,schemaCode:_}=g,R=S==="maxProperties"?h.operators.GT:h.operators.LT;g.fail$data(h._`Object.keys(${b}).length ${R} ${_}`)}};m.default=f}),_d=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Fe(),g=Ye(),S={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:b}})=>f.str`must have required property '${b}'`,params:({params:{missingProperty:b}})=>f._`{missingProperty: ${b}}`},code(b){let{gen:_,schema:R,schemaCode:y,data:P,$data:C,it:N}=b,{opts:J}=N;if(!C&&R.length===0)return;let W=R.length>=J.loopRequired;if(N.allErrors)L();else K();if(J.strictRequired){let F=b.parentSchema.properties,{definedProperties:w}=b.it;for(let B of R)if((F===null||F===void 0?void 0:F[B])===void 0&&!w.has(B)){let Y=`required property "${B}" is not defined at "${N.schemaEnv.baseId+N.errSchemaPath}" (strictRequired)`;(0,g.checkStrictMode)(N,Y,N.opts.strictRequired)}}function L(){if(W||C)b.block$data(f.nil,I);else for(let F of R)(0,h.checkReportMissingProp)(b,F)}function K(){let F=_.let("missing");if(W||C){let w=_.let("valid",!0);b.block$data(w,()=>z(F,w)),b.ok(w)}else _.if((0,h.checkMissingProp)(b,R,F)),(0,h.reportMissingProp)(b,F),_.else()}function I(){_.forOf("prop",y,(F)=>{b.setParams({missingProperty:F}),_.if((0,h.noPropertyInData)(_,P,F,J.ownProperties),()=>b.error())})}function z(F,w){b.setParams({missingProperty:F}),_.forOf(F,y,()=>{_.assign(w,(0,h.propertyInData)(_,P,F,J.ownProperties)),_.if((0,f.not)(w),()=>{b.error(),_.break()})},f.nil)}}};m.default=S}),yd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:g,schemaCode:S}){let b=g==="maxItems"?"more":"fewer";return h.str`must NOT have ${b} than ${S} items`},params:({schemaCode:g})=>h._`{limit: ${g}}`},code(g){let{keyword:S,data:b,schemaCode:_}=g,R=S==="maxItems"?h.operators.GT:h.operators.LT;g.fail$data(h._`${b}.length ${R} ${_}`)}};m.default=f}),Ei=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Nc();h.code='require("ajv/dist/runtime/equal").default',m.default=h}),vd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=gn(),f=Fe(),g=Ye(),S=Ei(),b={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:_,j:R}})=>f.str`must NOT have duplicate items (items ## ${R} and ${_} are identical)`,params:({params:{i:_,j:R}})=>f._`{i: ${_}, j: ${R}}`},code(_){let{gen:R,data:y,$data:P,schema:C,parentSchema:N,schemaCode:J,it:W}=_;if(!P&&!C)return;let L=R.let("valid"),K=N.items?(0,h.getSchemaTypes)(N.items):[];_.block$data(L,I,f._`${J} === false`),_.ok(L);function I(){let B=R.let("i",f._`${y}.length`),Y=R.let("j");_.setParams({i:B,j:Y}),R.assign(L,!0),R.if(f._`${B} > 1`,()=>(z()?F:w)(B,Y))}function z(){return K.length>0&&!K.some((B)=>B==="object"||B==="array")}function F(B,Y){let U=R.name("item"),T=(0,h.checkDataTypes)(K,U,W.opts.strictNumbers,h.DataType.Wrong),Z=R.const("indices",f._`{}`);R.for(f._`;${B}--;`,()=>{if(R.let(U,f._`${y}[${B}]`),R.if(T,f._`continue`),K.length>1)R.if(f._`typeof ${U} == "string"`,f._`${U} += "_"`);R.if(f._`typeof ${Z}[${U}] == "number"`,()=>{R.assign(Y,f._`${Z}[${U}]`),_.error(),R.assign(L,!1).break()}).code(f._`${Z}[${U}] = ${B}`)})}function w(B,Y){let U=(0,g.useFunc)(R,S.default),T=R.name("outer");R.label(T).for(f._`;${B}--;`,()=>R.for(f._`${Y} = ${B}; ${Y}--;`,()=>R.if(f._`${U}(${y}[${B}], ${y}[${Y}])`,()=>{_.error(),R.assign(L,!1).break(T)})))}}};m.default=b}),bd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=Ye(),g=Ei(),S={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:b})=>h._`{allowedValue: ${b}}`},code(b){let{gen:_,data:R,$data:y,schemaCode:P,schema:C}=b;if(y||C&&typeof C=="object")b.fail$data(h._`!${(0,f.useFunc)(_,g.default)}(${R}, ${P})`);else b.fail(h._`${C} !== ${R}`)}};m.default=S}),Rd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=Ye(),g=Ei(),S={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:b})=>h._`{allowedValues: ${b}}`},code(b){let{gen:_,data:R,$data:y,schema:P,schemaCode:C,it:N}=b;if(!y&&P.length===0)throw Error("enum must have non-empty array");let J=P.length>=N.opts.loopEnum,W,L=()=>W!==null&&W!==void 0?W:W=(0,f.useFunc)(_,g.default),K;if(J||y)K=_.let("valid"),b.block$data(K,I);else{if(!Array.isArray(P))throw Error("ajv implementation error");let F=_.const("vSchema",C);K=(0,h.or)(...P.map((w,B)=>z(F,B)))}b.pass(K);function I(){_.assign(K,!1),_.forOf("v",C,(F)=>_.if(h._`${L()}(${R}, ${F})`,()=>_.assign(K,!0).break()))}function z(F,w){let B=P[w];return typeof B==="object"&&B!==null?h._`${L()}(${R}, ${F}[${w}])`:h._`${R} === ${B}`}}};m.default=S}),kc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=md(),f=hd(),g=fd(),S=gd(),b=Sd(),_=_d(),R=yd(),y=vd(),P=bd(),C=Rd(),N=[h.default,f.default,g.default,S.default,b.default,_.default,R.default,y.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},P.default,C.default];m.default=N}),Mc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateAdditionalItems=void 0;let h=Fe(),f=Ye(),g={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:b}})=>h.str`must NOT have more than ${b} items`,params:({params:{len:b}})=>h._`{limit: ${b}}`},code(b){let{parentSchema:_,it:R}=b,{items:y}=_;if(!Array.isArray(y)){(0,f.checkStrictMode)(R,'"additionalItems" is ignored when "items" is not an array of schemas');return}S(b,y)}};function S(b,_){let{gen:R,schema:y,data:P,keyword:C,it:N}=b;N.items=!0;let J=R.const("len",h._`${P}.length`);if(y===!1)b.setParams({len:_.length}),b.pass(h._`${J} <= ${_.length}`);else if(typeof y=="object"&&!(0,f.alwaysValidSchema)(N,y)){let L=R.var("valid",h._`${J} <= ${_.length}`);R.if((0,h.not)(L),()=>W(L)),b.ok(L)}function W(L){R.forRange("i",_.length,J,(K)=>{if(b.subschema({keyword:C,dataProp:K,dataPropType:f.Type.Num},L),!N.allErrors)R.if((0,h.not)(L),()=>R.break())})}}m.validateAdditionalItems=S,m.default=g}),Ac=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateTuple=void 0;let h=Fe(),f=Ye(),g=wt(),S={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(_){let{schema:R,it:y}=_;if(Array.isArray(R))return b(_,"additionalItems",R);if(y.items=!0,(0,f.alwaysValidSchema)(y,R))return;_.ok((0,g.validateArray)(_))}};function b(_,R,y=_.schema){let{gen:P,parentSchema:C,data:N,keyword:J,it:W}=_;if(I(C),W.opts.unevaluated&&y.length&&W.items!==!0)W.items=f.mergeEvaluated.items(P,y.length,W.items);let L=P.name("valid"),K=P.const("len",h._`${N}.length`);y.forEach((z,F)=>{if((0,f.alwaysValidSchema)(W,z))return;P.if(h._`${K} > ${F}`,()=>_.subschema({keyword:J,schemaProp:F,dataProp:F},L)),_.ok(L)});function I(z){let{opts:F,errSchemaPath:w}=W,B=y.length,Y=B===z.minItems&&(B===z.maxItems||z[R]===!1);if(F.strictTuples&&!Y){let U=`"${J}" is ${B}-tuple, but minItems or maxItems/${R} are not specified or different at path "${w}"`;(0,f.checkStrictMode)(W,U,F.strictTuples)}}}m.validateTuple=b,m.default=S}),zd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ac(),f={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(g)=>(0,h.validateTuple)(g,"items")};m.default=f}),$d=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=Ye(),g=wt(),S=Mc(),b={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:_}})=>h.str`must NOT have more than ${_} items`,params:({params:{len:_}})=>h._`{limit: ${_}}`},code(_){let{schema:R,parentSchema:y,it:P}=_,{prefixItems:C}=y;if(P.items=!0,(0,f.alwaysValidSchema)(P,R))return;if(C)(0,S.validateAdditionalItems)(_,C);else _.ok((0,g.validateArray)(_))}};m.default=b}),Pd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=Ye(),g={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:S,max:b}})=>b===void 0?h.str`must contain at least ${S} valid item(s)`:h.str`must contain at least ${S} and no more than ${b} valid item(s)`,params:({params:{min:S,max:b}})=>b===void 0?h._`{minContains: ${S}}`:h._`{minContains: ${S}, maxContains: ${b}}`},code(S){let{gen:b,schema:_,parentSchema:R,data:y,it:P}=S,C,N,{minContains:J,maxContains:W}=R;if(P.opts.next)C=J===void 0?1:J,N=W;else C=1;let L=b.const("len",h._`${y}.length`);if(S.setParams({min:C,max:N}),N===void 0&&C===0){(0,f.checkStrictMode)(P,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(N!==void 0&&C>N){(0,f.checkStrictMode)(P,'"minContains" > "maxContains" is always invalid'),S.fail();return}if((0,f.alwaysValidSchema)(P,_)){let w=h._`${L} >= ${C}`;if(N!==void 0)w=h._`${w} && ${L} <= ${N}`;S.pass(w);return}P.items=!0;let K=b.name("valid");if(N===void 0&&C===1)z(K,()=>b.if(K,()=>b.break()));else if(C===0){if(b.let(K,!0),N!==void 0)b.if(h._`${y}.length > 0`,I)}else b.let(K,!1),I();S.result(K,()=>S.reset());function I(){let w=b.name("_valid"),B=b.let("count",0);z(w,()=>b.if(w,()=>F(B)))}function z(w,B){b.forRange("i",0,L,(Y)=>{S.subschema({keyword:"contains",dataProp:Y,dataPropType:f.Type.Num,compositeRule:!0},w),B()})}function F(w){if(b.code(h._`${w}++`),N===void 0)b.if(h._`${w} >= ${C}`,()=>b.assign(K,!0).break());else if(b.if(h._`${w} > ${N}`,()=>b.assign(K,!1).break()),C===1)b.assign(K,!0);else b.if(h._`${w} >= ${C}`,()=>b.assign(K,!0))}}};m.default=g}),wi=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateSchemaDeps=m.validatePropertyDeps=m.error=void 0;let h=Fe(),f=Ye(),g=wt();m.error={message:({params:{property:y,depsCount:P,deps:C}})=>{let N=P===1?"property":"properties";return h.str`must have ${N} ${C} when property ${y} is present`},params:({params:{property:y,depsCount:P,deps:C,missingProperty:N}})=>h._`{property: ${y},
|
|
12
12
|
missingProperty: ${N},
|
|
13
13
|
depsCount: ${P},
|
|
14
|
-
deps: ${C}}`};let S={keyword:"dependencies",type:"object",schemaType:"object",error:m.error,code(y){let[P,C]=b(y);_(y,P),R(y,C)}};function b({schema:y}){let P={},C={};for(let N in y){if(N==="__proto__")continue;let J=Array.isArray(y[N])?P:C;J[N]=y[N]}return[P,C]}function _(y,P=y.schema){let{gen:C,data:N,it:J}=y;if(Object.keys(P).length===0)return;let W=C.let("missing");for(let L in P){let K=P[L];if(K.length===0)continue;let I=(0,g.propertyInData)(C,N,L,J.opts.ownProperties);if(y.setParams({property:L,depsCount:K.length,deps:K.join(", ")}),J.allErrors)C.if(I,()=>{for(let z of K)(0,g.checkReportMissingProp)(y,z)});else C.if(h._`${I} && (${(0,g.checkMissingProp)(y,K,W)})`),(0,g.reportMissingProp)(y,W),C.else()}}m.validatePropertyDeps=_;function R(y,P=y.schema){let{gen:C,data:N,keyword:J,it:W}=y,L=C.name("valid");for(let K in P){if((0,f.alwaysValidSchema)(W,P[K]))continue;C.if((0,g.propertyInData)(C,N,K,W.opts.ownProperties),()=>{let I=y.subschema({keyword:J,schemaProp:K},L);y.mergeValidEvaluated(I,L)},()=>C.var(L,!0)),y.ok(L)}}m.validateSchemaDeps=R,m.default=S}),Ed=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f=Ye(),g={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:S})=>h._`{propertyName: ${S.propertyName}}`},code(S){let{gen:b,schema:_,data:R,it:y}=S;if((0,f.alwaysValidSchema)(y,_))return;let P=b.name("valid");b.forIn("key",R,(C)=>{S.setParams({propertyName:C}),S.subschema({keyword:"propertyNames",data:C,dataTypes:["string"],propertyName:C,compositeRule:!0},P),b.if((0,h.not)(P),()=>{if(S.error(!0),!y.allErrors)b.break()})}),S.ok(P)}};m.default=g}),Lc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=He(),g=Et(),S=Ye(),b={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:_})=>f._`{additionalProperty: ${_.additionalProperty}}`},code(_){let{gen:R,schema:y,parentSchema:P,data:C,errsCount:N,it:J}=_;if(!N)throw Error("ajv implementation error");let{allErrors:W,opts:L}=J;if(J.props=!0,L.removeAdditional!=="all"&&(0,S.alwaysValidSchema)(J,y))return;let K=(0,h.allSchemaProperties)(P.properties),I=(0,h.allSchemaProperties)(P.patternProperties);z(),_.ok(f._`${N} === ${g.default.errors}`);function z(){R.forIn("key",C,(U)=>{if(!K.length&&!I.length)B(U);else R.if(F(U),()=>B(U))})}function F(U){let T;if(K.length>8){let Z=(0,S.schemaRefOrVal)(J,P.properties,"properties");T=(0,h.isOwnProperty)(R,Z,U)}else if(K.length)T=(0,f.or)(...K.map((Z)=>f._`${U} === ${Z}`));else T=f.nil;if(I.length)T=(0,f.or)(T,...I.map((Z)=>f._`${(0,h.usePattern)(_,Z)}.test(${U})`));return(0,f.not)(T)}function w(U){R.code(f._`delete ${C}[${U}]`)}function B(U){if(L.removeAdditional==="all"||L.removeAdditional&&y===!1){w(U);return}if(y===!1){if(_.setParams({additionalProperty:U}),_.error(),!W)R.break();return}if(typeof y=="object"&&!(0,S.alwaysValidSchema)(J,y)){let T=R.name("valid");if(L.removeAdditional==="failing")Y(U,T,!1),R.if((0,f.not)(T),()=>{_.reset(),w(U)});else if(Y(U,T),!W)R.if((0,f.not)(T),()=>R.break())}}function Y(U,T,Z){let de={keyword:"additionalProperties",dataProp:U,dataPropType:S.Type.Str};if(Z===!1)Object.assign(de,{compositeRule:!0,createErrors:!1,allErrors:!1});_.subschema(de,T)}}};m.default=b}),wd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ua(),f=wt(),g=Ye(),S=Lc(),b={keyword:"properties",type:"object",schemaType:"object",code(_){let{gen:R,schema:y,parentSchema:P,data:C,it:N}=_;if(N.opts.removeAdditional==="all"&&P.additionalProperties===void 0)S.default.code(new h.KeywordCxt(N,S.default,"additionalProperties"));let J=(0,f.allSchemaProperties)(y);for(let z of J)N.definedProperties.add(z);if(N.opts.unevaluated&&J.length&&N.props!==!0)N.props=g.mergeEvaluated.props(R,(0,g.toHash)(J),N.props);let W=J.filter((z)=>!(0,g.alwaysValidSchema)(N,y[z]));if(W.length===0)return;let L=R.name("valid");for(let z of W){if(K(z))I(z);else{if(R.if((0,f.propertyInData)(R,C,z,N.opts.ownProperties)),I(z),!N.allErrors)R.else().var(L,!0);R.endIf()}_.it.definedProperties.add(z),_.ok(L)}function K(z){return N.opts.useDefaults&&!N.compositeRule&&y[z].default!==void 0}function I(z){_.subschema({keyword:"properties",schemaProp:z,dataProp:z},L)}}};m.default=b}),Td=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=He(),g=Ye(),S=Ye(),b={keyword:"patternProperties",type:"object",schemaType:"object",code(_){let{gen:R,schema:y,data:P,parentSchema:C,it:N}=_,{opts:J}=N,W=(0,h.allSchemaProperties)(y),L=W.filter((Y)=>(0,g.alwaysValidSchema)(N,y[Y]));if(W.length===0||L.length===W.length&&(!N.opts.unevaluated||N.props===!0))return;let K=J.strictSchema&&!J.allowMatchingProperties&&C.properties,I=R.name("valid");if(N.props!==!0&&!(N.props instanceof f.Name))N.props=(0,S.evaluatedPropsToName)(R,N.props);let{props:z}=N;F();function F(){for(let Y of W){if(K)w(Y);if(N.allErrors)B(Y);else R.var(I,!0),B(Y),R.if(I)}}function w(Y){for(let U in K)if(new RegExp(Y).test(U))(0,g.checkStrictMode)(N,`property ${U} matches pattern ${Y} (use allowMatchingProperties)`)}function B(Y){R.forIn("key",P,(U)=>{R.if(f._`${(0,h.usePattern)(_,Y)}.test(${U})`,()=>{let T=L.includes(Y);if(!T)_.subschema({keyword:"patternProperties",schemaProp:Y,dataProp:U,dataPropType:S.Type.Str},I);if(N.opts.unevaluated&&z!==!0)R.assign(f._`${z}[${U}]`,!0);else if(!T&&!N.allErrors)R.if((0,f.not)(I),()=>R.break())})})}}};m.default=b}),Cd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ye(),f={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(g){let{gen:S,schema:b,it:_}=g;if((0,h.alwaysValidSchema)(_,b)){g.fail();return}let R=S.name("valid");g.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},R),g.failResult(R,()=>g.reset(),()=>g.error())},error:{message:"must NOT be valid"}};m.default=f}),qd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:wt().validateUnion,error:{message:"must match a schema in anyOf"}};m.default=h}),jd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f=Ye(),g={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:S})=>h._`{passingSchemas: ${S.passing}}`},code(S){let{gen:b,schema:_,parentSchema:R,it:y}=S;if(!Array.isArray(_))throw Error("ajv implementation error");if(y.opts.discriminator&&R.discriminator)return;let P=_,C=b.let("valid",!1),N=b.let("passing",null),J=b.name("_valid");S.setParams({passing:N}),b.block(W),S.result(C,()=>S.reset(),()=>S.error(!0));function W(){P.forEach((L,K)=>{let I;if((0,f.alwaysValidSchema)(y,L))b.var(J,!0);else I=S.subschema({keyword:"oneOf",schemaProp:K,compositeRule:!0},J);if(K>0)b.if(h._`${J} && ${C}`).assign(C,!1).assign(N,h._`[${N}, ${K}]`).else();b.if(J,()=>{if(b.assign(C,!0),b.assign(N,K),I)S.mergeEvaluated(I,h.Name)})})}}};m.default=g}),Nd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ye(),f={keyword:"allOf",schemaType:"array",code(g){let{gen:S,schema:b,it:_}=g;if(!Array.isArray(b))throw Error("ajv implementation error");let R=S.name("valid");b.forEach((y,P)=>{if((0,h.alwaysValidSchema)(_,y))return;let C=g.subschema({keyword:"allOf",schemaProp:P},R);g.ok(R),g.mergeEvaluated(C)})}};m.default=f}),Id=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f=Ye(),g={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:b})=>h.str`must match "${b.ifClause}" schema`,params:({params:b})=>h._`{failingKeyword: ${b.ifClause}}`},code(b){let{gen:_,parentSchema:R,it:y}=b;if(R.then===void 0&&R.else===void 0)(0,f.checkStrictMode)(y,'"if" without "then" and "else" is ignored');let P=S(y,"then"),C=S(y,"else");if(!P&&!C)return;let N=_.let("valid",!0),J=_.name("_valid");if(W(),b.reset(),P&&C){let K=_.let("ifClause");b.setParams({ifClause:K}),_.if(J,L("then",K),L("else",K))}else if(P)_.if(J,L("then"));else _.if((0,h.not)(J),L("else"));b.pass(N,()=>b.error(!0));function W(){let K=b.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},J);b.mergeEvaluated(K)}function L(K,I){return()=>{let z=b.subschema({keyword:K},J);if(_.assign(N,J),b.mergeValidEvaluated(z,N),I)_.assign(I,h._`${K}`);else b.setParams({ifClause:K})}}}};function S(b,_){let R=b.schema[_];return R!==void 0&&!(0,f.alwaysValidSchema)(b,R)}m.default=g}),Od=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ye(),f={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:g,parentSchema:S,it:b}){if(S.if===void 0)(0,h.checkStrictMode)(b,`"${g}" without "if" is ignored`)}};m.default=f}),Dc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Mc(),f=zd(),g=Ac(),S=$d(),b=Pd(),_=wi(),R=Ed(),y=Lc(),P=wd(),C=Td(),N=Cd(),J=qd(),W=jd(),L=Nd(),K=Id(),I=Od();function z(F=!1){let w=[N.default,J.default,W.default,L.default,K.default,I.default,R.default,y.default,_.default,P.default,C.default];if(F)w.push(f.default,S.default);else w.push(h.default,g.default);return w.push(b.default),w}m.default=z}),kd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:g})=>h.str`must match format "${g}"`,params:({schemaCode:g})=>h._`{format: ${g}}`},code(g,S){let{gen:b,data:_,$data:R,schema:y,schemaCode:P,it:C}=g,{opts:N,errSchemaPath:J,schemaEnv:W,self:L}=C;if(!N.validateFormats)return;if(R)K();else I();function K(){let z=b.scopeValue("formats",{ref:L.formats,code:N.code.formats}),F=b.const("fDef",h._`${z}[${P}]`),w=b.let("fType"),B=b.let("format");b.if(h._`typeof ${F} == "object" && !(${F} instanceof RegExp)`,()=>b.assign(w,h._`${F}.type || "string"`).assign(B,h._`${F}.validate`),()=>b.assign(w,h._`"string"`).assign(B,F)),g.fail$data((0,h.or)(Y(),U()));function Y(){if(N.strictSchema===!1)return h.nil;return h._`${P} && !${B}`}function U(){let T=W.$async?h._`(${F}.async ? await ${B}(${_}) : ${B}(${_}))`:h._`${B}(${_})`,Z=h._`(typeof ${B} == "function" ? ${T} : ${B}.test(${_}))`;return h._`${B} && ${B} !== true && ${w} === ${S} && !${Z}`}}function I(){let z=L.formats[y];if(!z){Y();return}if(z===!0)return;let[F,w,B]=U(z);if(F===S)g.pass(T());function Y(){if(N.strictSchema===!1){L.logger.warn(Z());return}throw Error(Z());function Z(){return`unknown format "${y}" ignored in schema at path "${J}"`}}function U(Z){let de=Z instanceof RegExp?(0,h.regexpCode)(Z):N.code.formats?h._`${N.code.formats}${(0,h.getProperty)(y)}`:void 0,qe=b.scopeValue("formats",{key:y,ref:Z,code:de});if(typeof Z=="object"&&!(Z instanceof RegExp))return[Z.type||"string",Z.validate,h._`${qe}.validate`];return["string",Z,qe]}function T(){if(typeof z=="object"&&!(z instanceof RegExp)&&z.async){if(!W.$async)throw Error("async format in sync schema");return h._`await ${B}(${_})`}return typeof w=="function"?h._`${B}(${_})`:h._`${B}.test(${_})`}}}};m.default=f}),Vc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=[kd().default];m.default=h}),Uc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.contentVocabulary=m.metadataVocabulary=void 0,m.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],m.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),Hc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Oc(),f=kc(),g=Dc(),S=Vc(),b=Uc(),_=[h.default,f.default,(0,g.default)(),S.default,b.metadataVocabulary,b.contentVocabulary];m.default=_}),Md=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.DiscrError=void 0;var h;(function(f){f.Tag="tag",f.Mapping="mapping"})(h||(m.DiscrError=h={}))}),Ti=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f=Md(),g=yn(),S=Ha(),b=Ye(),_={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:R,tagName:y}})=>R===f.DiscrError.Tag?`tag "${y}" must be string`:`value of tag "${y}" must be in oneOf`,params:({params:{discrError:R,tag:y,tagName:P}})=>h._`{error: ${R}, tag: ${P}, tagValue: ${y}}`},code(R){let{gen:y,data:P,schema:C,parentSchema:N,it:J}=R,{oneOf:W}=N;if(!J.opts.discriminator)throw Error("discriminator: requires discriminator option");let L=C.propertyName;if(typeof L!="string")throw Error("discriminator: requires propertyName");if(C.mapping)throw Error("discriminator: mapping is not supported");if(!W)throw Error("discriminator: requires oneOf keyword");let K=y.let("valid",!1),I=y.const("tag",h._`${P}${(0,h.getProperty)(L)}`);y.if(h._`typeof ${I} == "string"`,()=>z(),()=>R.error(!1,{discrError:f.DiscrError.Tag,tag:I,tagName:L})),R.ok(K);function z(){let B=w();y.if(!1);for(let Y in B)y.elseIf(h._`${I} === ${Y}`),y.assign(K,F(B[Y]));y.else(),R.error(!1,{discrError:f.DiscrError.Mapping,tag:I,tagName:L}),y.endIf()}function F(B){let Y=y.name("valid"),U=R.subschema({keyword:"oneOf",schemaProp:B},Y);return R.mergeEvaluated(U,h.Name),Y}function w(){var B;let Y={},U=Z(N),T=!0;for(let ge=0;ge<W.length;ge++){let ve=W[ge];if((ve===null||ve===void 0?void 0:ve.$ref)&&!(0,b.schemaHasRulesButRef)(ve,J.self.RULES)){let Ne=ve.$ref;if(ve=g.resolveRef.call(J.self,J.schemaEnv.root,J.baseId,Ne),ve instanceof g.SchemaEnv)ve=ve.schema;if(ve===void 0)throw new S.default(J.opts.uriResolver,J.baseId,Ne)}let Ie=(B=ve===null||ve===void 0?void 0:ve.properties)===null||B===void 0?void 0:B[L];if(typeof Ie!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${L}"`);T=T&&(U||Z(ve)),de(Ie,ge)}if(!T)throw Error(`discriminator: "${L}" must be required`);return Y;function Z({required:ge}){return Array.isArray(ge)&&ge.includes(L)}function de(ge,ve){if(ge.const)qe(ge.const,ve);else if(ge.enum)for(let Ie of ge.enum)qe(Ie,ve);else throw Error(`discriminator: "properties/${L}" must have "const" or "enum"`)}function qe(ge,ve){if(typeof ge!="string"||ge in Y)throw Error(`discriminator: "${L}" values must be unique strings`);Y[ge]=ve}}}};m.default=_}),Ad=ye((m,h)=>{h.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}}),Fc=ye((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv=void 0;let f=$i(),g=Hc(),S=Ti(),b=Ad(),_=["/properties"],R="http://json-schema.org/draft-07/schema";var y=class extends f.default{_addVocabularies(){if(super._addVocabularies(),g.default.forEach((W)=>this.addVocabulary(W)),this.opts.discriminator)this.addKeyword(S.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let W=this.opts.$data?this.$dataMetaSchema(b,_):b;this.addMetaSchema(W,R,!1),this.refs["http://json-schema.org/schema"]=R}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(R)?R:void 0)}};m.Ajv=y,h.exports=m=y,h.exports.Ajv=y,Object.defineProperty(m,"__esModule",{value:!0}),m.default=y;var P=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return P.KeywordCxt}});var C=He();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return C._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return C.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return C.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return C.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return C.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return C.CodeGen}});var N=Wr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return N.default}});var J=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return J.default}})}),xc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.dynamicAnchor=void 0;let h=He(),f=Et(),g=yn(),S=Pi(),b={keyword:"$dynamicAnchor",schemaType:"string",code:(y)=>_(y,y.schema)};function _(y,P){let{gen:C,it:N}=y;N.schemaEnv.root.dynamicAnchors[P]=!0;let J=h._`${f.default.dynamicAnchors}${(0,h.getProperty)(P)}`,W=N.errSchemaPath==="#"?N.validateName:R(y);C.if(h._`!${J}`,()=>C.assign(J,W))}m.dynamicAnchor=_;function R(y){let{schemaEnv:P,schema:C,self:N}=y.it,{root:J,baseId:W,localRefs:L,meta:K}=P.root,{schemaId:I}=N.opts,z=new g.SchemaEnv({schema:C,schemaId:I,root:J,baseId:W,localRefs:L,meta:K});return g.compileSchema.call(N,z),(0,S.getValidate)(y,z)}m.default=b}),Kc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.dynamicRef=void 0;let h=He(),f=Et(),g=Pi(),S={keyword:"$dynamicRef",schemaType:"string",code:(_)=>b(_,_.schema)};function b(_,R){let{gen:y,keyword:P,it:C}=_;if(R[0]!=="#")throw Error(`"${P}" only supports hash fragment reference`);let N=R.slice(1);if(C.allErrors)J();else{let L=y.let("valid",!1);J(L),_.ok(L)}function J(L){if(C.schemaEnv.root.dynamicAnchors[N]){let K=y.let("_v",h._`${f.default.dynamicAnchors}${(0,h.getProperty)(N)}`);y.if(K,W(K,L),W(C.validateName,L))}else W(C.validateName,L)()}function W(L,K){return K?()=>y.block(()=>{(0,g.callRef)(_,L),y.let(K,!0)}):()=>(0,g.callRef)(_,L)}}m.dynamicRef=b,m.default=S}),Ld=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=xc(),f=Ye(),g={keyword:"$recursiveAnchor",schemaType:"boolean",code(S){if(S.schema)(0,h.dynamicAnchor)(S,"");else(0,f.checkStrictMode)(S.it,"$recursiveAnchor: false is ignored")}};m.default=g}),Dd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Kc(),f={keyword:"$recursiveRef",schemaType:"string",code:(g)=>(0,h.dynamicRef)(g,g.schema)};m.default=f}),Bc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=xc(),f=Kc(),g=Ld(),S=Dd(),b=[h.default,f.default,g.default,S.default];m.default=b}),Vd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wi(),f={keyword:"dependentRequired",type:"object",schemaType:"object",error:h.error,code:(g)=>(0,h.validatePropertyDeps)(g)};m.default=f}),Ud=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wi(),f={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(g)=>(0,h.validateSchemaDeps)(g)};m.default=f}),Hd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ye(),f={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:g,parentSchema:S,it:b}){if(S.contains===void 0)(0,h.checkStrictMode)(b,`"${g}" without "contains" is ignored`)}};m.default=f}),Gc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Vd(),f=Ud(),g=Hd(),S=[h.default,f.default,g.default];m.default=S}),Fd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f=Ye(),g=Et(),S={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:b})=>h._`{unevaluatedProperty: ${b.unevaluatedProperty}}`},code(b){let{gen:_,schema:R,data:y,errsCount:P,it:C}=b;if(!P)throw Error("ajv implementation error");let{allErrors:N,props:J}=C;if(J instanceof h.Name)_.if(h._`${J} !== true`,()=>_.forIn("key",y,(I)=>_.if(L(J,I),()=>W(I))));else if(J!==!0)_.forIn("key",y,(I)=>J===void 0?W(I):_.if(K(J,I),()=>W(I)));C.props=!0,b.ok(h._`${P} === ${g.default.errors}`);function W(I){if(R===!1){if(b.setParams({unevaluatedProperty:I}),b.error(),!N)_.break();return}if(!(0,f.alwaysValidSchema)(C,R)){let z=_.name("valid");if(b.subschema({keyword:"unevaluatedProperties",dataProp:I,dataPropType:f.Type.Str},z),!N)_.if((0,h.not)(z),()=>_.break())}}function L(I,z){return h._`!${I} || !${I}[${z}]`}function K(I,z){let F=[];for(let w in I)if(I[w]===!0)F.push(h._`${z} !== ${w}`);return(0,h.and)(...F)}}};m.default=S}),xd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=He(),f=Ye(),g={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:S}})=>h.str`must NOT have more than ${S} items`,params:({params:{len:S}})=>h._`{limit: ${S}}`},code(S){let{gen:b,schema:_,data:R,it:y}=S,P=y.items||0;if(P===!0)return;let C=b.const("len",h._`${R}.length`);if(_===!1)S.setParams({len:P}),S.fail(h._`${C} > ${P}`);else if(typeof _=="object"&&!(0,f.alwaysValidSchema)(y,_)){let J=b.var("valid",h._`${C} <= ${P}`);b.if((0,h.not)(J),()=>N(J,P)),S.ok(J)}y.items=!0;function N(J,W){b.forRange("i",W,C,(L)=>{if(S.subschema({keyword:"unevaluatedItems",dataProp:L,dataPropType:f.Type.Num},J),!y.allErrors)b.if((0,h.not)(J),()=>b.break())})}}};m.default=g}),Jc=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fd(),f=xd(),g=[h.default,f.default];m.default=g}),Kd=ye((m,h)=>{h.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"}]}}}}}),Bd=ye((m,h)=>{h.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:"#"}}}}}),Gd=ye((m,h)=>{h.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:"#"}}}}),Jd=ye((m,h)=>{h.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:{}}}}}),Wd=ye((m,h)=>{h.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"}}}}),Yd=ye((m,h)=>{h.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}}}}),Zd=ye((m,h)=>{h.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:[]}}}}),Xd=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Kd(),f=Bd(),g=Gd(),S=Jd(),b=Wd(),_=Yd(),R=Zd(),y=["/properties"];function P(C){return[h,f,g,S,N(this,b),_,N(this,R)].forEach((J)=>this.addMetaSchema(J,void 0,!1)),this;function N(J,W){return C?J.$dataMetaSchema(W,y):W}}m.default=P}),Qd=ye((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv2019=void 0;let f=$i(),g=Hc(),S=Bc(),b=Gc(),_=Jc(),R=Ti(),y=Xd(),P="https://json-schema.org/draft/2019-09/schema";var C=class extends f.default{constructor(K={}){super({...K,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(S.default),g.default.forEach((K)=>this.addVocabulary(K)),this.addVocabulary(b.default),this.addVocabulary(_.default),this.opts.discriminator)this.addKeyword(R.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:K,meta:I}=this.opts;if(!I)return;y.default.call(this,K),this.refs["http://json-schema.org/schema"]=P}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(P)?P:void 0)}};m.Ajv2019=C,h.exports=m=C,h.exports.Ajv2019=C,Object.defineProperty(m,"__esModule",{value:!0}),m.default=C;var N=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return N.KeywordCxt}});var J=He();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return J._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return J.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return J.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return J.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return J.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return J.CodeGen}});var W=Wr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return W.default}});var L=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return L.default}})}),em=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Oc(),f=kc(),g=Dc(),S=Bc(),b=Gc(),_=Jc(),R=Vc(),y=Uc(),P=[S.default,h.default,f.default,(0,g.default)(!0),R.default,y.metadataVocabulary,y.contentVocabulary,b.default,_.default];m.default=P}),tm=ye((m,h)=>{h.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}}}}),am=ye((m,h)=>{h.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"}}}}}),rm=ye((m,h)=>{h.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"}}}}),om=ye((m,h)=>{h.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"}}}}),sm=ye((m,h)=>{h.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"}}}}),nm=ye((m,h)=>{h.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"}}}}),im=ye((m,h)=>{h.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}}}}),cm=ye((m,h)=>{h.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:[]}}}}),lm=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=tm(),f=am(),g=rm(),S=om(),b=sm(),_=nm(),R=im(),y=cm(),P=["/properties"];function C(N){return[h,f,g,S,b,J(this,_),R,J(this,y)].forEach((W)=>this.addMetaSchema(W,void 0,!1)),this;function J(W,L){return N?W.$dataMetaSchema(L,P):L}}m.default=C}),um=ye((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv2020=void 0;let f=$i(),g=em(),S=Ti(),b=lm(),_="https://json-schema.org/draft/2020-12/schema";var R=class extends f.default{constructor(J={}){super({...J,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),g.default.forEach((J)=>this.addVocabulary(J)),this.opts.discriminator)this.addKeyword(S.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:J,meta:W}=this.opts;if(!W)return;b.default.call(this,J),this.refs["http://json-schema.org/schema"]=_}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(_)?_:void 0)}};m.Ajv2020=R,h.exports=m=R,h.exports.Ajv2020=R,Object.defineProperty(m,"__esModule",{value:!0}),m.default=R;var y=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return y.KeywordCxt}});var P=He();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return P._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return P.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return P.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return P.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return P.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return P.CodeGen}});var C=Wr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return C.default}});var N=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return N.default}})}),dm=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.formatNames=m.fastFormats=m.fullFormats=void 0;function h(ge,ve){return{validate:ge,compare:ve}}m.fullFormats={date:h(b,_),time:h(y(!0),P),"date-time":h(J(!0),W),"iso-time":h(y(),C),"iso-date-time":h(J(),L),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:z,"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:qe,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:w,int32:{type:"number",validate:U},int64:{type:"number",validate:T},float:{type:"number",validate:Z},double:{type:"number",validate:Z},password:!0,binary:!0},m.fastFormats={...m.fullFormats,date:h(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,_),time:h(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,P),"date-time":h(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,W),"iso-time":h(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,C),"iso-date-time":h(/^\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,L),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},m.formatNames=Object.keys(m.fullFormats);function f(ge){return ge%4===0&&(ge%100!==0||ge%400===0)}let g=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,S=[0,31,28,31,30,31,30,31,31,30,31,30,31];function b(ge){let ve=g.exec(ge);if(!ve)return!1;let Ie=+ve[1],Ne=+ve[2],Ge=+ve[3];return Ne>=1&&Ne<=12&&Ge>=1&&Ge<=(Ne===2&&f(Ie)?29:S[Ne])}function _(ge,ve){if(!(ge&&ve))return;if(ge>ve)return 1;if(ge<ve)return-1;return 0}let R=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function y(ge){return function(Ie){let Ne=R.exec(Ie);if(!Ne)return!1;let Ge=+Ne[1],Qe=+Ne[2],Ze=+Ne[3],nt=Ne[4],We=Ne[5]==="-"?-1:1,ee=+(Ne[6]||0),le=+(Ne[7]||0);if(ee>23||le>59||ge&&!nt)return!1;if(Ge<=23&&Qe<=59&&Ze<60)return!0;let we=Qe-le*We,G=Ge-ee*We-(we<0?1:0);return(G===23||G===-1)&&(we===59||we===-1)&&Ze<61}}function P(ge,ve){if(!(ge&&ve))return;let Ie=new Date("2020-01-01T"+ge).valueOf(),Ne=new Date("2020-01-01T"+ve).valueOf();if(!(Ie&&Ne))return;return Ie-Ne}function C(ge,ve){if(!(ge&&ve))return;let Ie=R.exec(ge),Ne=R.exec(ve);if(!(Ie&&Ne))return;if(ge=Ie[1]+Ie[2]+Ie[3],ve=Ne[1]+Ne[2]+Ne[3],ge>ve)return 1;if(ge<ve)return-1;return 0}let N=/t|\s/i;function J(ge){let ve=y(ge);return function(Ne){let Ge=Ne.split(N);return Ge.length===2&&b(Ge[0])&&ve(Ge[1])}}function W(ge,ve){if(!(ge&&ve))return;let Ie=new Date(ge).valueOf(),Ne=new Date(ve).valueOf();if(!(Ie&&Ne))return;return Ie-Ne}function L(ge,ve){if(!(ge&&ve))return;let[Ie,Ne]=ge.split(N),[Ge,Qe]=ve.split(N),Ze=_(Ie,Ge);if(Ze===void 0)return;return Ze||P(Ne,Qe)}let K=/\/|:/,I=/^(?:[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 z(ge){return K.test(ge)&&I.test(ge)}let F=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function w(ge){return F.lastIndex=0,F.test(ge)}let B=-2147483648,Y=2147483647;function U(ge){return Number.isInteger(ge)&&ge<=Y&&ge>=B}function T(ge){return Number.isInteger(ge)}function Z(){return!0}let de=/[^\\]\\Z/;function qe(ge){if(de.test(ge))return!1;try{return new RegExp(ge),!0}catch(ve){return!1}}}),mm=ye((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.formatLimitDefinition=void 0;let h=Fc(),f=He(),g=f.operators,S={formatMaximum:{okStr:"<=",ok:g.LTE,fail:g.GT},formatMinimum:{okStr:">=",ok:g.GTE,fail:g.LT},formatExclusiveMaximum:{okStr:"<",ok:g.LT,fail:g.GTE},formatExclusiveMinimum:{okStr:">",ok:g.GT,fail:g.LTE}},b={message:({keyword:R,schemaCode:y})=>f.str`should be ${S[R].okStr} ${y}`,params:({keyword:R,schemaCode:y})=>f._`{comparison: ${S[R].okStr}, limit: ${y}}`};m.formatLimitDefinition={keyword:Object.keys(S),type:"string",schemaType:"string",$data:!0,error:b,code(R){let{gen:y,data:P,schemaCode:C,keyword:N,it:J}=R,{opts:W,self:L}=J;if(!W.validateFormats)return;let K=new h.KeywordCxt(J,L.RULES.all.format.definition,"format");if(K.$data)I();else z();function I(){let w=y.scopeValue("formats",{ref:L.formats,code:W.code.formats}),B=y.const("fmt",f._`${w}[${K.schemaCode}]`);R.fail$data((0,f.or)(f._`typeof ${B} != "object"`,f._`${B} instanceof RegExp`,f._`typeof ${B}.compare != "function"`,F(B)))}function z(){let w=K.schema,B=L.formats[w];if(!B||B===!0)return;if(typeof B!="object"||B instanceof RegExp||typeof B.compare!="function")throw Error(`"${N}": format "${w}" does not define "compare" function`);let Y=y.scopeValue("formats",{key:w,ref:B,code:W.code.formats?f._`${W.code.formats}${(0,f.getProperty)(w)}`:void 0});R.fail$data(F(Y))}function F(w){return f._`${w}.compare(${P}, ${C}) ${S[N].fail} 0`}},dependencies:["format"]};let _=(R)=>(R.addKeyword(m.formatLimitDefinition),R);m.default=_}),hm=ye((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0});let f=dm(),g=mm(),S=He(),b=new S.Name("fullFormats"),_=new S.Name("fastFormats"),R=(P,C={keywords:!0})=>{if(Array.isArray(C))return y(P,C,f.fullFormats,b),P;let[N,J]=C.mode==="fast"?[f.fastFormats,_]:[f.fullFormats,b];if(y(P,C.formats||f.formatNames,N,J),C.keywords)(0,g.default)(P);return P};R.get=(P,C="full")=>{let N=(C==="fast"?f.fastFormats:f.fullFormats)[P];if(!N)throw Error(`Unknown format "${P}"`);return N};function y(P,C,N,J){var W,L;(W=(L=P.opts.code).formats)!==null&&W!==void 0||(L.formats=S._`require("ajv-formats/dist/formats").${J}`);for(let K of C)P.addFormat(K,N[K])}h.exports=m=R,Object.defineProperty(m,"__esModule",{value:!0}),m.default=R}),Wc=Fc(),pm=Qd(),fm=um(),gm=go(hm(),1),Sm=gm.default;function zi(m){let h=new m({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Sm(h),h}var Ci=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(m){this._userAjv=m!==void 0,this._ajv=m}get ajv(){return this._ajv??=zi(fm.Ajv2020)}_engineFor(m){if(this._userAjv)return this.ajv;let h=ki(m,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(h==="2020-12")return this.ajv;if(h==="2019-09")return this._ajv2019??=zi(pm.Ajv2019);return this._ajvDraft7??=zi(Wc.Ajv)}getValidator(m){let h=this._engineFor(m),f="$id"in m&&typeof m.$id==="string"?h.getSchema(m.$id)??h.compile(m):h.compile(m);return(g)=>f(g)?{valid:!0,data:g,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:h.errorsText(f.errors)}}},Rh=Wc.Ajv;import fe from"node:process";var sl=Symbol.for("mcp.completable");function Yc(m){return!!m&&typeof m==="object"&&sl in m}function _m(m){return m[sl]?.complete}function ym(m,h){switch(h.kind){case"tools_list_changed":return m.toolsListChanged===!0;case"prompts_list_changed":return m.promptsListChanged===!0;case"resources_list_changed":return m.resourcesListChanged===!0;case"resource_updated":return m.resourceSubscriptions!==void 0&&m.resourceSubscriptions.includes(h.uri)}}function vm(m,h){let f={},g=(S)=>h===void 0||S===!0;if(m.toolsListChanged===!0&&g(h?.tools?.listChanged))f.toolsListChanged=!0;if(m.promptsListChanged===!0&&g(h?.prompts?.listChanged))f.promptsListChanged=!0;if(m.resourcesListChanged===!0&&g(h?.resources?.listChanged))f.resourcesListChanged=!0;if(m.resourceSubscriptions!==void 0&&m.resourceSubscriptions.length>0&&g(h?.resources?.subscribe))f.resourceSubscriptions=[...m.resourceSubscriptions];return f}var he=1024;function Zc(m,h){return{method:m.method,params:{...m.params,_meta:{...m.params?._meta,[$a]:h}}}}function bm(m){let h=Wt(Gr).validateRequest("subscriptions/listen",m);return h.ok?h.value.params?.notifications:void 0}var Rm=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]),Ee=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor(m=he,h,f){this._maxSubscriptions=m,this._serverCapabilities=h,this._serverInfo=f}setServerCapabilities(m,h){if(this._serverCapabilities=m,h!==void 0)this._serverInfo=h}has(m){return this._subs.has(m)}serve(m){if(this._serverCapabilities===void 0)throw Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:m.id,error:{code:-32603,message:"Subscription limit reached"}};let h=bm(m);if(h===void 0)return{jsonrpc:"2.0",id:m.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let f=vm(h,this._serverCapabilities);return this._subs.set(m.id,f),Zc({method:"notifications/subscriptions/acknowledged",params:{notifications:f}},m.id)}cancel(m){return this._subs.delete(m)}routeOutbound(m){if(!Rm.has(m.method))return"passthrough";let h=m.params?.uri,f=typeof h==="string"?h:void 0,g=zm(m.method,f),S=[];for(let[b,_]of this._subs)if(ym(_,g))S.push(Zc({method:m.method,params:m.params??{}},b));return S}teardownAll(){let m=[];for(let h of this._subs.keys())m.push({jsonrpc:"2.0",id:h,result:{resultType:"complete",_meta:{[$a]:h,...this._serverInfo!==void 0&&{[jt]:this._serverInfo}}}});return this._subs.clear(),m}};function zm(m,h){switch(m){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:h??""}}}function $m(m){return typeof m==="object"&&m!==null&&"setScopeChallengeResolver"in m&&typeof m.setScopeChallengeResolver==="function"}var Pm=8,Em=600000;function wm(m){if(m?.maxRounds!==void 0&&(!Number.isInteger(m.maxRounds)||m.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${m.maxRounds})`);if(m?.roundTimeoutMs!==void 0&&(!Number.isFinite(m.roundTimeoutMs)||m.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${m.roundTimeoutMs})`);return{maxRounds:m?.maxRounds??Pm,roundTimeoutMs:m?.roundTimeoutMs??Em,legacyShim:m?.legacyShim??!0}}function nl(m,h,f){if(f===null||typeof f!=="object"||typeof f.method!=="string")throw new Le(i.InternalError,`Handler for ${m} returned an invalid input request '${h}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let g=f,S=Zi(g);if(S===void 0)throw new Le(i.InternalError,`Handler for ${m} returned an input request '${h}' of kind '${g.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:g,required:S}}function Tm(){let m=globalThis.crypto;if(m?.randomUUID!==void 0)return m.randomUUID();let h=new Uint8Array(16);m.getRandomValues(h),h[6]=h[6]&15|64,h[8]=h[8]&63|128;let f=[...h].map((g)=>g.toString(16).padStart(2,"0")).join("");return`${f.slice(0,8)}-${f.slice(8,12)}-${f.slice(12,16)}-${f.slice(16,20)}-${f.slice(20)}`}function qi(m,h){if(m==="tools/call")return{content:[{type:"text",text:h}],isError:!0};throw new Le(i.InternalError,h)}var Cm=class{constructor(m){this._host=m}async fulfill(m,h,f,g,S){let{maxRounds:b,roundTimeoutMs:_}=this._host,R=g.mcpReq.signal,y=S,P=0;while(!0){if(P+=1,P>b)return qi(m,vc(m,b));let C=y.inputRequests,N=C!=null&&Object.keys(C).length>0,J=typeof y.requestState==="string"?y.requestState:void 0;if(!N&&J===void 0)throw new Le(i.InternalError,`Handler for ${m} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let W;if(N){let I=this._host.resolvedClientCapabilities(g),z=[];for(let[w,B]of Object.entries(C)){let{embedded:Y,required:U}=nl(m,w,B);if(Y.method!=="roots/list"&&Y.params===void 0)throw new Le(i.InternalError,`Handler for ${m} returned an input request '${w}' of kind '${Y.method}' without params`);if(ci(U,I)!==void 0)return qi(m,`Cannot request input '${w}' (${Y.method}): the client on this 2025-era connection did not declare the required capability${I===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);z.push([w,Y])}let F=Rc(R);try{let w={relatedRequestId:g.mcpReq.id,timeout:_,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:F.signal},B=await Promise.all(z.map(async([Y,U])=>{try{return[Y,await this._dispatchLeg(U,w)]}catch(T){throw F.abort(T),T}}));W=Object.fromEntries(B)}catch(w){if(R.aborted)throw w;return qi(m,`Fulfilling input required by '${m}' failed: ${w instanceof Error?w.message:String(w)}`)}finally{F.dispose()}}else await bc(yc,R);let L={...g,mcpReq:{...g.mcpReq,inputResponses:W,droppedInputResponseKeys:void 0,requestState:Jr(J)}};if(J!==void 0){let I=await this._host.verifyRequestState(J,L,m);if(I!==void 0)L=bi(L,I)}let K=await h(f,L);if(!Yt(K))return K;y=K}}async _dispatchLeg(m,h){switch(m.method){case"elicitation/create":{let f=m.params;if(f.mode==="url"&&f.elicitationId===void 0)f={...f,elicitationId:Tm()};return await this._host.sendElicitation(f,h)}case"sampling/createMessage":return await this._host.sendSampling(m.params,h);case"roots/list":return await this._host.listRoots(m.params,h)}}},qm=new Set(["tools/call","prompts/get","resources/read"]),jm,il,cl;function Te(m,h){il(m,h)}function ze(m){return cl(m)}var Nm=class extends wc{_clientCapabilities;_clientVersion;static{jm=(m,h)=>{if(h.clientCapabilities!==void 0)m._clientCapabilities=h.clientCapabilities;if(h.clientInfo!==void 0)m._clientVersion=h.clientInfo},il=(m,h)=>{let f=h.filter((g)=>!m._supportedProtocolVersions.includes(g));if(f.length>0)m._supportedProtocolVersions=[...m._supportedProtocolVersions,...f];m.setRequestHandler("server/discover",()=>m._ondiscover())},cl=(m)=>m._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Cm({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:(m)=>this._inputRequestCapabilityView(m),verifyRequestState:(m,h,f)=>this._verifyRequestState(m,h,f),sendElicitation:(m,h)=>this._sendElicitationLeg(m,h,{validateAcceptedContent:!1}),sendSampling:(m,h)=>this.createMessage(m,h),listRoots:(m,h)=>this.listRoots(m,h)})}oninitialized;constructor(m,h){super(h);if(this._serverInfo=m,this._capabilities=h?.capabilities?{...h.capabilities}:{},this._instructions=h?.instructions,this._jsonSchemaValidator=h?.jsonSchemaValidator??new Ci,this._requestStateVerify=h?.requestState?.verify,this._inputRequiredServing=wm(h?.inputRequired),h?.cacheHints!==void 0){for(let[f,g]of Object.entries(h.cacheHints))if(g!==void 0)fi(g,`cacheHints['${f}']`);this._cacheHints=h.cacheHints}if(this.setRequestHandler("initialize",(f)=>this._oninitialize(f)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),li(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(m,h)=>{let f=h.sessionId||h.http?.req?.headers.get("mcp-session-id")||void 0,{level:g}=m.params,S=hn(Bt,g);if(S.success)this._loggingLevels.set(f,S.data);return{}})}buildContext(m,h){let f=m.http||h?.request||h?.closeSSEStream||h?.closeStandaloneSSEStream;return{...m,mcpReq:{...m.mcpReq,log:(g,S,b)=>{if(!this._capabilities.logging)return Promise.resolve();let _;if(this._servedModernEra()){if(_=m.mcpReq.envelope?.[la],_===void 0)return Promise.resolve()}else _=this._loggingLevels.get(m.sessionId)??this._loggingLevels.get(void 0);if(_!==void 0&&this.LOG_LEVEL_SEVERITY.get(g)<this.LOG_LEVEL_SEVERITY.get(_))return Promise.resolve();return m.mcpReq.notify({method:"notifications/message",params:{level:g,data:S,logger:b}})},elicitInput:(g,S)=>this.elicitInput(g,S),requestSampling:(g,S)=>this.createMessage(g,S)},http:f?{...m.http,req:h?.request,closeSSE:h?.closeSSEStream,closeStandaloneSSE:h?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(Bt.options.map((m,h)=>[m,h]));isMessageIgnored=(m,h)=>{let f=this._loggingLevels.get(h);return f?this.LOG_LEVEL_SEVERITY.get(m)<this.LOG_LEVEL_SEVERITY.get(f):!1};registerCapabilities(m){if(this.transport)throw new Ke(Je.AlreadyConnected,"Cannot register capabilities after connecting to transport");let h=!!this._capabilities.logging;if(this._capabilities=Tc(this._capabilities,m),!h&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(m,h){if(m!=="tools/call"){let f=this._cacheHints?.[m],g=qm.has(m);if(f===void 0&&!g)return async(S,b)=>{let _=await h(S,b);if(Yt(_))throw new Le(i.InternalError,`Handler for ${m} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return _};return async(S,b)=>{let _=g?await this._invokeInputRequiredCapableHandler(m,h,S,b):await h(S,b);if(Yt(_)){if(!g)throw new Le(i.InternalError,`Handler for ${m} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return _}return f===void 0?_:mn(_,f)}}return async(f,g)=>{let S=Wt(this._negotiatedProtocolVersion),b=S.validateRequest("tools/call",f);if(!b.ok)throw new Le(b.reason==="not-in-era"?i.InternalError:i.InvalidParams,b.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${b.message}`);let _=await this._invokeInputRequiredCapableHandler("tools/call",h,f,g);if(Yt(_))return _;let R=ui(_),y=S.validateResult("tools/call",R);if(!y.ok)throw new Le(y.reason==="not-in-era"?i.InternalError:i.InvalidParams,y.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${y.message}`);return y.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&Va(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(m,h,f,g){let S=this._servedModernEra(),b=g.mcpReq.requestState();if(b!==void 0&&typeof b!=="string")throw new Le(i.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let _=g;if(typeof b==="string"){let N=await this._verifyRequestState(b,g,m);if(N!==void 0)_=bi(g,N)}let R;try{R=await h(f,_)}catch(N){if(N instanceof Le&&N.code===i.UrlElicitationRequired){if(!S)throw N;throw new Le(i.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw N}if(!Yt(R))return R;if(!S){if(!this._inputRequiredServing.legacyShim)throw new Le(i.InternalError,`Handler for ${m} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??za}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(m,h,f,_,R)}let y=R.inputRequests,P=y!=null&&Object.keys(y).length>0,C=typeof R.requestState==="string";if(!P&&!C)throw new Le(i.InternalError,`Handler for ${m} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(P){let N=this._inputRequestCapabilityView(g);for(let[J,W]of Object.entries(y)){let{embedded:L,required:K}=nl(m,J,W),I=ci(K,N);if(I!==void 0)throw new Si({requiredCapabilities:I},`Cannot request input '${J}' (${L.method}): the request's client capabilities do not declare the required capability`)}}return R}async _verifyRequestState(m,h,f){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(m,h)}catch(g){throw this.onerror?.(Error(`requestState verification rejected ${f}: ${g instanceof Error?g.message:String(g)}`)),new Le(i.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(m){return this._servedModernEra()?m.mcpReq.envelope?.[Vt]:this._clientCapabilities}_assertPushApiInServedEra(m){if(this._servedModernEra())throw new Ke(Je.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${m}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:m,era:"2026-07-28"})}assertCapabilityForMethod(m){switch(m){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Ke(Je.CapabilityNotSupported,`Client does not support sampling (required for ${m})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Ke(Je.CapabilityNotSupported,`Client does not support elicitation (required for ${m})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Ke(Je.CapabilityNotSupported,`Client does not support listing roots (required for ${m})`);break;case"ping":break}}assertNotificationCapability(m){switch(m){case"notifications/message":if(!this._capabilities.logging)throw new Ke(Je.CapabilityNotSupported,`Server does not support logging (required for ${m})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Ke(Je.CapabilityNotSupported,`Server does not support notifying about resources (required for ${m})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Ke(Je.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${m})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Ke(Je.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${m})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Je.CapabilityNotSupported,`Client does not support URL elicitation (required for ${m})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(m){switch(m){case"completion/complete":if(!this._capabilities.completions)throw new Ke(Je.CapabilityNotSupported,`Server does not support completions (required for ${m})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Ke(Je.CapabilityNotSupported,`Server does not support logging (required for ${m})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Ke(Je.CapabilityNotSupported,`Server does not support prompts (required for ${m})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Ke(Je.CapabilityNotSupported,`Server does not support resources (required for ${m})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Ke(Je.CapabilityNotSupported,`Server does not support tools (required for ${m})`);break;case"ping":case"initialize":break}}async _oninitialize(m){let h=m.params.protocolVersion;this._clientCapabilities=m.params.capabilities,this._clientVersion=m.params.clientInfo;let f=Qi(this._supportedProtocolVersions),g=f.includes(h)?h:f[0]??za;return this._negotiatedProtocolVersion=g,this.transport?.setProtocolVersion?.(g),{protocolVersion:g,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:li(this._supportedProtocolVersions),capabilities:Im(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(m,h){return this._wireCodec().projectCallToolResult(m,h)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(m,h){if(this._assertPushApiInServedEra("sampling/createMessage"),(m.tools||m.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Ke(Je.CapabilityNotSupported,"Client does not support sampling tools capability.");if(m.messages.length>0){let b=m.messages.at(-1),_=Array.isArray(b.content)?b.content:[b.content],R=_.some((N)=>N.type==="tool_result"),y=m.messages.length>1?m.messages.at(-2):void 0,P=y?Array.isArray(y.content)?y.content:[y.content]:[],C=P.some((N)=>N.type==="tool_use");if(R){if(_.some((N)=>N.type!=="tool_result"))throw new Le(i.InvalidParams,"The last message must contain only tool_result content if any is present");if(!C)throw new Le(i.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(C){let N=new Set(P.filter((W)=>W.type==="tool_use").map((W)=>W.id)),J=new Set(_.filter((W)=>W.type==="tool_result").map((W)=>W.toolUseId));if(N.size!==J.size||![...N].every((W)=>J.has(W)))throw new Le(i.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let f=Boolean(m.tools||m.toolChoice),g=await this.request({method:"sampling/createMessage",params:m},h),S=this._wireCodec().samplingResultVariant(f,g);if(!S.ok)throw new Ke(Je.InvalidResult,`Invalid sampling/createMessage result: ${S.reason==="invalid"?S.message:S.reason}`);return S.value}async elicitInput(m,h){switch(this._assertPushApiInServedEra("elicitation/create"),m.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Je.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new Ke(Je.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(m,h)}async _sendElicitationLeg(m,h,f){let g=m.mode??"form",S=f?.validateAcceptedContent??!0;switch(g){case"url":{let b=m;return this.request({method:"elicitation/create",params:b},h)}case"form":{let b=m.mode==="form"?m:{...m,mode:"form"},_=await this.request({method:"elicitation/create",params:b},h);if(S&&_.action==="accept"&&_.content&&b.requestedSchema)try{let R=this._jsonSchemaValidator.getValidator(b.requestedSchema)(_.content);if(!R.valid)throw new Le(i.InvalidParams,`Elicitation response content does not match requested schema: ${R.errorMessage}`)}catch(R){if(R instanceof Le)throw R;throw new Le(i.InternalError,`Error validating elicitation response: ${R instanceof Error?R.message:String(R)}`)}return _}}}createElicitationCompletionNotifier(m,h){if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Je.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:m}},h)}async listRoots(m,h){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:m},h)}async sendLoggingMessage(m,h){if(this._capabilities.logging&&!this.isMessageIgnored(m.level,h))return this.notification({method:"notifications/message",params:m})}async sendResourceUpdated(m){return this.notification({method:"notifications/resources/updated",params:m})}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 Im(m){return{...m}}var q=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(m){let h=this._registeredTools[m];if(h===void 0||!h.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,m))return this._toolInputSchemaJson[m];if(h.inputSchema===void 0)return Qc;try{let f=Zt(h.inputSchema,"input");return this._toolInputSchemaJson[m]=f,f}catch{return}}constructor(m,h){if(this.server=new Nm(m,h),h?.capabilities?.tools)this.setToolRequestHandlers();if(h?.capabilities?.resources)this.setResourceRequestHandlers();if(h?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect(m){if($m(m))m.setScopeChallengeResolver((h)=>this.resolveScopeChallenge(h));return await this.server.connect(m)}async close(){await this.server.close()}resolveScopeChallenge=(m)=>{switch(m.request.method){case"tools/call":{let h=m.request.params?.name;if(typeof h!=="string")return;let f=this._registeredTools[h];if(f===void 0||!f.enabled)return;return f.scopeChallenge?.(m)}case"resources/read":{let h=m.request.params?.uri;if(typeof h!=="string")return;let f;try{f=new URL(h)}catch{return}let g=this._registeredResources[f.toString()];if(g!==void 0)return g.enabled?g.scopeChallenge?.(m):void 0;for(let S of Object.values(this._registeredResourceTemplates))if(S.resourceTemplate.uriTemplate.match(f.toString()))return S.enabled?S.scopeChallenge?.(m):void 0;return}case"prompts/get":{let h=m.request.params?.name;if(typeof h!=="string")return;let f=this._registeredPrompts[h];if(f===void 0||!f.enabled)return;return f.scopeChallenge?.(m)}default:return}};_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;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(([,m])=>m.enabled).map(([m,h])=>{let f={name:m,title:h.title,description:h.description,inputSchema:h.inputSchema?Zt(h.inputSchema,"input"):Qc,annotations:h.annotations,icons:h.icons,execution:h.execution,_meta:h._meta};if(h.outputSchema)f.outputSchema=Zt(h.outputSchema,"output");return f})})),this.server.setRequestHandler("tools/call",async(m,h)=>{let f=this._registeredTools[m.params.name];if(!f)throw new Le(i.InvalidParams,`Tool ${m.params.name} not found`);if(!f.enabled)throw new Le(i.InvalidParams,`Tool ${m.params.name} disabled`);try{let g=await this.validateToolInput(f,m.params.arguments,m.params.name),S=await this.executeToolHandler(f,g,h);if(await this.validateToolOutput(f,S,m.params.name),Yt(S))return S;return this.server.projectCallToolResult(S,f.outputSchemaJson)}catch(g){if(g instanceof Le&&g.code===i.UrlElicitationRequired)throw g;return this.createToolError(g instanceof Error?g.message:String(g))}}),this._toolHandlersInitialized=!0}createToolError(m){return{content:[{type:"text",text:m}],isError:!0}}async validateToolInput(m,h,f){if(!m.inputSchema)return;let g=await da(m.inputSchema,h??{});if(!g.success)throw new Le(i.InvalidParams,`Input validation error: Invalid arguments for tool ${f}: ${g.error}`);return g.data}async validateToolOutput(m,h,f){if(!m.outputSchema)return;if(Yt(h))return;if(h.isError)return;if(h.structuredContent===void 0)throw new Le(i.InvalidParams,`Output validation error: Tool ${f} has an output schema but no structured content was provided`);let g=await da(m.outputSchema,h.structuredContent);if(!g.success)throw new Le(i.InvalidParams,`Output validation error: Invalid structured content for tool ${f}: ${g.error}`)}async executeToolHandler(m,h,f){return m.executor(h,f)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async(m)=>{switch(m.params.ref.type){case"ref/prompt":return pc(m),this.handlePromptCompletion(m,m.params.ref);case"ref/resource":return fc(m),this.handleResourceCompletion(m,m.params.ref);default:throw new Le(i.InvalidParams,`Invalid completion reference: ${m.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(m,h){let f=this._registeredPrompts[h.name];if(!f)throw new Le(i.InvalidParams,`Prompt ${h.name} not found`);if(!f.enabled)throw new Le(i.InvalidParams,`Prompt ${h.name} disabled`);if(!f.argsSchema)return Yr;let g=ol(rl(f.argsSchema)?.[m.params.argument.name]);if(!Yc(g))return Yr;let S=_m(g);if(!S)return Yr;return al(await S(m.params.argument.value,m.params.context))}async handleResourceCompletion(m,h){let f=Object.values(this._registeredResourceTemplates).find((S)=>S.resourceTemplate.uriTemplate.toString()===h.uri);if(!f){if(this._registeredResources[h.uri])return Yr;throw new Le(i.InvalidParams,`Resource template ${m.params.ref.uri} not found`)}let g=f.resourceTemplate.completeCallback(m.params.argument.name);if(!g)return Yr;return al(await g(m.params.argument.value,m.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;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(m,h)=>{let f=Object.entries(this._registeredResources).filter(([S,b])=>b.enabled).map(([S,b])=>({uri:S,name:b.name,...b.metadata})),g=[];for(let S of Object.values(this._registeredResourceTemplates)){if(!S.resourceTemplate.listCallback)continue;let b=await S.resourceTemplate.listCallback(h);for(let _ of b.resources)g.push({...S.metadata,..._})}return{resources:[...f,...g]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([m,h])=>({name:m,uriTemplate:h.resourceTemplate.uriTemplate.toString(),...h.metadata}))})),this.server.setRequestHandler("resources/read",async(m,h)=>{let f;try{f=new URL(m.params.uri)}catch{throw new Le(i.InvalidParams,`Resource URI ${m.params.uri} is invalid`,{uri:m.params.uri,reason:"invalid_uri"})}let g=this._registeredResources[f.toString()];if(g){if(!g.enabled)throw new Le(i.InvalidParams,`Resource ${f} disabled`);return mn(await g.readCallback(f,h),g.cacheHint)}for(let S of Object.values(this._registeredResourceTemplates)){let b=S.resourceTemplate.uriTemplate.match(f.toString());if(b){if(!S.enabled)throw new Le(i.InvalidParams,`Resource template ${S.resourceTemplate.uriTemplate} disabled`);return mn(await S.readCallback(f,b,h),S.cacheHint)}}throw new gi(m.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;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(([,m])=>m.enabled).map(([m,h])=>({name:m,title:h.title,description:h.description,arguments:h.argsSchema?_c(h.argsSchema):void 0,icons:h.icons,_meta:h._meta}))})),this.server.setRequestHandler("prompts/get",async(m,h)=>{let f=this._registeredPrompts[m.params.name];if(!f)throw new Le(i.InvalidParams,`Prompt ${m.params.name} not found`);if(!f.enabled)throw new Le(i.InvalidParams,`Prompt ${m.params.name} disabled`);return f.handler(m.params.arguments,h)}),this._promptHandlersInitialized=!0}registerResource(m,h,f,g){let{cacheHint:S,scopeChallenge:b,..._}=f,R=_;if(S!==void 0)fi(S,`resource ${m}`);if(typeof h==="string"){if(this._registeredResources[h])throw Error(`Resource ${h} is already registered`);let y=this._createRegisteredResource(m,f.title,h,R,b,g);if(S!==void 0)y.cacheHint=S;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),y}else{if(this._registeredResourceTemplates[m])throw Error(`Resource template ${m} is already registered`);let y=this._createRegisteredResourceTemplate(m,f.title,h,R,b,g);if(S!==void 0)y.cacheHint=S;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),y}}_createRegisteredResource(m,h,f,g,S,b){let _={name:m,title:h,metadata:g,readCallback:b,scopeChallenge:S,enabled:!0,disable:()=>_.update({enabled:!1}),enable:()=>_.update({enabled:!0}),remove:()=>_.update({uri:null}),update:(R)=>{if(R.uri!==void 0&&R.uri!==f){if(delete this._registeredResources[f],R.uri)this._registeredResources[R.uri]=_}if(R.name!==void 0)_.name=R.name;if(R.title!==void 0)_.title=R.title;if(R.metadata!==void 0)_.metadata=R.metadata;if(R.callback!==void 0)_.readCallback=R.callback;if(R.scopeChallenge!==void 0)_.scopeChallenge=R.scopeChallenge===null?void 0:R.scopeChallenge;if(R.enabled!==void 0)_.enabled=R.enabled;this.sendResourceListChanged()}};return this._registeredResources[f]=_,_}_createRegisteredResourceTemplate(m,h,f,g,S,b){let _={resourceTemplate:f,title:h,metadata:g,readCallback:b,scopeChallenge:S,enabled:!0,disable:()=>_.update({enabled:!1}),enable:()=>_.update({enabled:!0}),remove:()=>_.update({name:null}),update:(y)=>{if(y.name!==void 0&&y.name!==m){if(delete this._registeredResourceTemplates[m],y.name)this._registeredResourceTemplates[y.name]=_}if(y.title!==void 0)_.title=y.title;if(y.template!==void 0)_.resourceTemplate=y.template;if(y.metadata!==void 0)_.metadata=y.metadata;if(y.callback!==void 0)_.readCallback=y.callback;if(y.scopeChallenge!==void 0)_.scopeChallenge=y.scopeChallenge===null?void 0:y.scopeChallenge;if(y.enabled!==void 0)_.enabled=y.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[m]=_;let R=f.uriTemplate.variableNames;if(Array.isArray(R)&&R.some((y)=>!!f.completeCallback(y)))this.setCompletionRequestHandler();return _}_createRegisteredPrompt(m,h,f,g,S,b,_,R){let y=g,P=S,C={title:h,description:f,argsSchema:g,icons:b,scopeChallenge:_,_meta:R,handler:tl(m,g,S),enabled:!0,disable:()=>C.update({enabled:!1}),enable:()=>C.update({enabled:!0}),remove:()=>C.update({name:null}),update:(N)=>{if(N.name!==void 0&&N.name!==m){if(delete this._registeredPrompts[m],N.name)this._registeredPrompts[N.name]=C}if(N.title!==void 0)C.title=N.title;if(N.description!==void 0)C.description=N.description;if(N.icons!==void 0)C.icons=N.icons;if(N.scopeChallenge!==void 0)C.scopeChallenge=N.scopeChallenge===null?void 0:N.scopeChallenge;if(N._meta!==void 0)C._meta=N._meta;let J=!1;if(N.argsSchema!==void 0)C.argsSchema=N.argsSchema,y=N.argsSchema,J=!0;if(N.callback!==void 0)P=N.callback,J=!0;if(J)C.handler=tl(m,y,P);if(N.enabled!==void 0)C.enabled=N.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[m]=C,g){let N=rl(g);if(N){if(Object.values(N).some((J)=>Yc(ol(J))))this.setCompletionRequestHandler()}}return C}_createRegisteredTool(m,h,f,g,S,b,_,R,y,P,C){if(Ri(m),g!==void 0)try{let W=Zt(g,"input");this._toolInputSchemaJson[m]=W;let L=gc(W);if(!L.valid)console.warn(`[mcp-sdk] tool '${m}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${L.reason}`)}catch{}let N=C,J={title:h,description:f,inputSchema:g,outputSchema:S,outputSchemaJson:el(S),annotations:b,icons:_,execution:R,scopeChallenge:y,_meta:P,handler:C,executor:Xc(g,C),enabled:!0,disable:()=>J.update({enabled:!1}),enable:()=>J.update({enabled:!0}),remove:()=>J.update({name:null}),update:(W)=>{if(W.name!==void 0&&W.name!==m){if(typeof W.name==="string")Ri(W.name);if(delete this._registeredTools[m],delete this._toolInputSchemaJson[m],W.name)delete this._toolInputSchemaJson[W.name],this._registeredTools[W.name]=J,m=W.name}if(W.title!==void 0)J.title=W.title;if(W.description!==void 0)J.description=W.description;let L=!1;if(W.paramsSchema!==void 0)J.inputSchema=W.paramsSchema,delete this._toolInputSchemaJson[m],L=!0;if(W.callback!==void 0)J.handler=W.callback,N=W.callback,L=!0;if(L)J.executor=Xc(J.inputSchema,N);if(W.outputSchema!==void 0)J.outputSchema=W.outputSchema,J.outputSchemaJson=el(W.outputSchema);if(W.annotations!==void 0)J.annotations=W.annotations;if(W.icons!==void 0)J.icons=W.icons;if(W.scopeChallenge!==void 0)J.scopeChallenge=W.scopeChallenge===null?void 0:W.scopeChallenge;if(W._meta!==void 0)J._meta=W._meta;if(W.enabled!==void 0)J.enabled=W.enabled;this.sendToolListChanged()}};return this._registeredTools[m]=J,this.setToolRequestHandlers(),this.sendToolListChanged(),J}registerTool(m,h,f){if(this._registeredTools[m])throw Error(`Tool ${m} is already registered`);let{title:g,description:S,inputSchema:b,outputSchema:_,annotations:R,icons:y,scopeChallenge:P,_meta:C}=h;return this._createRegisteredTool(m,g,S,pn(b),pn(_),R,y,void 0,P,C,f)}registerPrompt(m,h,f){if(this._registeredPrompts[m])throw Error(`Prompt ${m} is already registered`);let{title:g,description:S,argsSchema:b,icons:_,scopeChallenge:R,_meta:y}=h,P=this._createRegisteredPrompt(m,g,S,pn(b),f,_,R,y);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),P}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(m,h){return this.server.sendLoggingMessage(m,h)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}};function Xc(m,h){if(m){let g=h;return async(S,b)=>g(S,b)}let f=h;return async(g,S)=>f(S)}var Qc={type:"object",properties:{}};function el(m){if(m===void 0)return;try{return Zt(m,"output")}catch{return}}function tl(m,h,f){if(h){let g=f;return async(S,b)=>{let _=await da(h,S);if(!_.success)throw new Le(i.InvalidParams,`Invalid arguments for prompt ${m}: ${_.error}`);return g(_.data,b)}}else{let g=f;return async(S,b)=>g(b)}}function al(m){return{completion:{values:m.map(String).slice(0,100),total:m.length,hasMore:m.length>100}}}var Yr={completion:{values:[],hasMore:!1}};function rl(m){let h=m;if(h.shape&&typeof h.shape==="object")return h.shape}function Om(m){return m?.type==="optional"}function ol(m){if(!Om(m))return m;return m.def?.innerType??m}
|
|
15
|
-
export{x,i,H,j,
|
|
14
|
+
deps: ${C}}`};let S={keyword:"dependencies",type:"object",schemaType:"object",error:m.error,code(y){let[P,C]=b(y);_(y,P),R(y,C)}};function b({schema:y}){let P={},C={};for(let N in y){if(N==="__proto__")continue;let J=Array.isArray(y[N])?P:C;J[N]=y[N]}return[P,C]}function _(y,P=y.schema){let{gen:C,data:N,it:J}=y;if(Object.keys(P).length===0)return;let W=C.let("missing");for(let L in P){let K=P[L];if(K.length===0)continue;let I=(0,g.propertyInData)(C,N,L,J.opts.ownProperties);if(y.setParams({property:L,depsCount:K.length,deps:K.join(", ")}),J.allErrors)C.if(I,()=>{for(let z of K)(0,g.checkReportMissingProp)(y,z)});else C.if(h._`${I} && (${(0,g.checkMissingProp)(y,K,W)})`),(0,g.reportMissingProp)(y,W),C.else()}}m.validatePropertyDeps=_;function R(y,P=y.schema){let{gen:C,data:N,keyword:J,it:W}=y,L=C.name("valid");for(let K in P){if((0,f.alwaysValidSchema)(W,P[K]))continue;C.if((0,g.propertyInData)(C,N,K,W.opts.ownProperties),()=>{let I=y.subschema({keyword:J,schemaProp:K},L);y.mergeValidEvaluated(I,L)},()=>C.var(L,!0)),y.ok(L)}}m.validateSchemaDeps=R,m.default=S}),Ed=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=Ye(),g={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:S})=>h._`{propertyName: ${S.propertyName}}`},code(S){let{gen:b,schema:_,data:R,it:y}=S;if((0,f.alwaysValidSchema)(y,_))return;let P=b.name("valid");b.forIn("key",R,(C)=>{S.setParams({propertyName:C}),S.subschema({keyword:"propertyNames",data:C,dataTypes:["string"],propertyName:C,compositeRule:!0},P),b.if((0,h.not)(P),()=>{if(S.error(!0),!y.allErrors)b.break()})}),S.ok(P)}};m.default=g}),Lc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Fe(),g=Et(),S=Ye(),b={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:_})=>f._`{additionalProperty: ${_.additionalProperty}}`},code(_){let{gen:R,schema:y,parentSchema:P,data:C,errsCount:N,it:J}=_;if(!N)throw Error("ajv implementation error");let{allErrors:W,opts:L}=J;if(J.props=!0,L.removeAdditional!=="all"&&(0,S.alwaysValidSchema)(J,y))return;let K=(0,h.allSchemaProperties)(P.properties),I=(0,h.allSchemaProperties)(P.patternProperties);z(),_.ok(f._`${N} === ${g.default.errors}`);function z(){R.forIn("key",C,(U)=>{if(!K.length&&!I.length)B(U);else R.if(F(U),()=>B(U))})}function F(U){let T;if(K.length>8){let Z=(0,S.schemaRefOrVal)(J,P.properties,"properties");T=(0,h.isOwnProperty)(R,Z,U)}else if(K.length)T=(0,f.or)(...K.map((Z)=>f._`${U} === ${Z}`));else T=f.nil;if(I.length)T=(0,f.or)(T,...I.map((Z)=>f._`${(0,h.usePattern)(_,Z)}.test(${U})`));return(0,f.not)(T)}function w(U){R.code(f._`delete ${C}[${U}]`)}function B(U){if(L.removeAdditional==="all"||L.removeAdditional&&y===!1){w(U);return}if(y===!1){if(_.setParams({additionalProperty:U}),_.error(),!W)R.break();return}if(typeof y=="object"&&!(0,S.alwaysValidSchema)(J,y)){let T=R.name("valid");if(L.removeAdditional==="failing")Y(U,T,!1),R.if((0,f.not)(T),()=>{_.reset(),w(U)});else if(Y(U,T),!W)R.if((0,f.not)(T),()=>R.break())}}function Y(U,T,Z){let de={keyword:"additionalProperties",dataProp:U,dataPropType:S.Type.Str};if(Z===!1)Object.assign(de,{compositeRule:!0,createErrors:!1,allErrors:!1});_.subschema(de,T)}}};m.default=b}),wd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ua(),f=wt(),g=Ye(),S=Lc(),b={keyword:"properties",type:"object",schemaType:"object",code(_){let{gen:R,schema:y,parentSchema:P,data:C,it:N}=_;if(N.opts.removeAdditional==="all"&&P.additionalProperties===void 0)S.default.code(new h.KeywordCxt(N,S.default,"additionalProperties"));let J=(0,f.allSchemaProperties)(y);for(let z of J)N.definedProperties.add(z);if(N.opts.unevaluated&&J.length&&N.props!==!0)N.props=g.mergeEvaluated.props(R,(0,g.toHash)(J),N.props);let W=J.filter((z)=>!(0,g.alwaysValidSchema)(N,y[z]));if(W.length===0)return;let L=R.name("valid");for(let z of W){if(K(z))I(z);else{if(R.if((0,f.propertyInData)(R,C,z,N.opts.ownProperties)),I(z),!N.allErrors)R.else().var(L,!0);R.endIf()}_.it.definedProperties.add(z),_.ok(L)}function K(z){return N.opts.useDefaults&&!N.compositeRule&&y[z].default!==void 0}function I(z){_.subschema({keyword:"properties",schemaProp:z,dataProp:z},L)}}};m.default=b}),Td=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Fe(),g=Ye(),S=Ye(),b={keyword:"patternProperties",type:"object",schemaType:"object",code(_){let{gen:R,schema:y,data:P,parentSchema:C,it:N}=_,{opts:J}=N,W=(0,h.allSchemaProperties)(y),L=W.filter((Y)=>(0,g.alwaysValidSchema)(N,y[Y]));if(W.length===0||L.length===W.length&&(!N.opts.unevaluated||N.props===!0))return;let K=J.strictSchema&&!J.allowMatchingProperties&&C.properties,I=R.name("valid");if(N.props!==!0&&!(N.props instanceof f.Name))N.props=(0,S.evaluatedPropsToName)(R,N.props);let{props:z}=N;F();function F(){for(let Y of W){if(K)w(Y);if(N.allErrors)B(Y);else R.var(I,!0),B(Y),R.if(I)}}function w(Y){for(let U in K)if(new RegExp(Y).test(U))(0,g.checkStrictMode)(N,`property ${U} matches pattern ${Y} (use allowMatchingProperties)`)}function B(Y){R.forIn("key",P,(U)=>{R.if(f._`${(0,h.usePattern)(_,Y)}.test(${U})`,()=>{let T=L.includes(Y);if(!T)_.subschema({keyword:"patternProperties",schemaProp:Y,dataProp:U,dataPropType:S.Type.Str},I);if(N.opts.unevaluated&&z!==!0)R.assign(f._`${z}[${U}]`,!0);else if(!T&&!N.allErrors)R.if((0,f.not)(I),()=>R.break())})})}}};m.default=b}),Cd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ye(),f={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(g){let{gen:S,schema:b,it:_}=g;if((0,h.alwaysValidSchema)(_,b)){g.fail();return}let R=S.name("valid");g.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},R),g.failResult(R,()=>g.reset(),()=>g.error())},error:{message:"must NOT be valid"}};m.default=f}),qd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:wt().validateUnion,error:{message:"must match a schema in anyOf"}};m.default=h}),jd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=Ye(),g={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:S})=>h._`{passingSchemas: ${S.passing}}`},code(S){let{gen:b,schema:_,parentSchema:R,it:y}=S;if(!Array.isArray(_))throw Error("ajv implementation error");if(y.opts.discriminator&&R.discriminator)return;let P=_,C=b.let("valid",!1),N=b.let("passing",null),J=b.name("_valid");S.setParams({passing:N}),b.block(W),S.result(C,()=>S.reset(),()=>S.error(!0));function W(){P.forEach((L,K)=>{let I;if((0,f.alwaysValidSchema)(y,L))b.var(J,!0);else I=S.subschema({keyword:"oneOf",schemaProp:K,compositeRule:!0},J);if(K>0)b.if(h._`${J} && ${C}`).assign(C,!1).assign(N,h._`[${N}, ${K}]`).else();b.if(J,()=>{if(b.assign(C,!0),b.assign(N,K),I)S.mergeEvaluated(I,h.Name)})})}}};m.default=g}),Nd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ye(),f={keyword:"allOf",schemaType:"array",code(g){let{gen:S,schema:b,it:_}=g;if(!Array.isArray(b))throw Error("ajv implementation error");let R=S.name("valid");b.forEach((y,P)=>{if((0,h.alwaysValidSchema)(_,y))return;let C=g.subschema({keyword:"allOf",schemaProp:P},R);g.ok(R),g.mergeEvaluated(C)})}};m.default=f}),Id=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=Ye(),g={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:b})=>h.str`must match "${b.ifClause}" schema`,params:({params:b})=>h._`{failingKeyword: ${b.ifClause}}`},code(b){let{gen:_,parentSchema:R,it:y}=b;if(R.then===void 0&&R.else===void 0)(0,f.checkStrictMode)(y,'"if" without "then" and "else" is ignored');let P=S(y,"then"),C=S(y,"else");if(!P&&!C)return;let N=_.let("valid",!0),J=_.name("_valid");if(W(),b.reset(),P&&C){let K=_.let("ifClause");b.setParams({ifClause:K}),_.if(J,L("then",K),L("else",K))}else if(P)_.if(J,L("then"));else _.if((0,h.not)(J),L("else"));b.pass(N,()=>b.error(!0));function W(){let K=b.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},J);b.mergeEvaluated(K)}function L(K,I){return()=>{let z=b.subschema({keyword:K},J);if(_.assign(N,J),b.mergeValidEvaluated(z,N),I)_.assign(I,h._`${K}`);else b.setParams({ifClause:K})}}}};function S(b,_){let R=b.schema[_];return R!==void 0&&!(0,f.alwaysValidSchema)(b,R)}m.default=g}),Od=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ye(),f={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:g,parentSchema:S,it:b}){if(S.if===void 0)(0,h.checkStrictMode)(b,`"${g}" without "if" is ignored`)}};m.default=f}),Dc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Mc(),f=zd(),g=Ac(),S=$d(),b=Pd(),_=wi(),R=Ed(),y=Lc(),P=wd(),C=Td(),N=Cd(),J=qd(),W=jd(),L=Nd(),K=Id(),I=Od();function z(F=!1){let w=[N.default,J.default,W.default,L.default,K.default,I.default,R.default,y.default,_.default,P.default,C.default];if(F)w.push(f.default,S.default);else w.push(h.default,g.default);return w.push(b.default),w}m.default=z}),kd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:g})=>h.str`must match format "${g}"`,params:({schemaCode:g})=>h._`{format: ${g}}`},code(g,S){let{gen:b,data:_,$data:R,schema:y,schemaCode:P,it:C}=g,{opts:N,errSchemaPath:J,schemaEnv:W,self:L}=C;if(!N.validateFormats)return;if(R)K();else I();function K(){let z=b.scopeValue("formats",{ref:L.formats,code:N.code.formats}),F=b.const("fDef",h._`${z}[${P}]`),w=b.let("fType"),B=b.let("format");b.if(h._`typeof ${F} == "object" && !(${F} instanceof RegExp)`,()=>b.assign(w,h._`${F}.type || "string"`).assign(B,h._`${F}.validate`),()=>b.assign(w,h._`"string"`).assign(B,F)),g.fail$data((0,h.or)(Y(),U()));function Y(){if(N.strictSchema===!1)return h.nil;return h._`${P} && !${B}`}function U(){let T=W.$async?h._`(${F}.async ? await ${B}(${_}) : ${B}(${_}))`:h._`${B}(${_})`,Z=h._`(typeof ${B} == "function" ? ${T} : ${B}.test(${_}))`;return h._`${B} && ${B} !== true && ${w} === ${S} && !${Z}`}}function I(){let z=L.formats[y];if(!z){Y();return}if(z===!0)return;let[F,w,B]=U(z);if(F===S)g.pass(T());function Y(){if(N.strictSchema===!1){L.logger.warn(Z());return}throw Error(Z());function Z(){return`unknown format "${y}" ignored in schema at path "${J}"`}}function U(Z){let de=Z instanceof RegExp?(0,h.regexpCode)(Z):N.code.formats?h._`${N.code.formats}${(0,h.getProperty)(y)}`:void 0,we=b.scopeValue("formats",{key:y,ref:Z,code:de});if(typeof Z=="object"&&!(Z instanceof RegExp))return[Z.type||"string",Z.validate,h._`${we}.validate`];return["string",Z,we]}function T(){if(typeof z=="object"&&!(z instanceof RegExp)&&z.async){if(!W.$async)throw Error("async format in sync schema");return h._`await ${B}(${_})`}return typeof w=="function"?h._`${B}(${_})`:h._`${B}.test(${_})`}}}};m.default=f}),Vc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=[kd().default];m.default=h}),Uc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.contentVocabulary=m.metadataVocabulary=void 0,m.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],m.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),Hc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Oc(),f=kc(),g=Dc(),S=Vc(),b=Uc(),_=[h.default,f.default,(0,g.default)(),S.default,b.metadataVocabulary,b.contentVocabulary];m.default=_}),Md=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.DiscrError=void 0;var h;(function(f){f.Tag="tag",f.Mapping="mapping"})(h||(m.DiscrError=h={}))}),Ti=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=Md(),g=yn(),S=Ha(),b=Ye(),_={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:R,tagName:y}})=>R===f.DiscrError.Tag?`tag "${y}" must be string`:`value of tag "${y}" must be in oneOf`,params:({params:{discrError:R,tag:y,tagName:P}})=>h._`{error: ${R}, tag: ${P}, tagValue: ${y}}`},code(R){let{gen:y,data:P,schema:C,parentSchema:N,it:J}=R,{oneOf:W}=N;if(!J.opts.discriminator)throw Error("discriminator: requires discriminator option");let L=C.propertyName;if(typeof L!="string")throw Error("discriminator: requires propertyName");if(C.mapping)throw Error("discriminator: mapping is not supported");if(!W)throw Error("discriminator: requires oneOf keyword");let K=y.let("valid",!1),I=y.const("tag",h._`${P}${(0,h.getProperty)(L)}`);y.if(h._`typeof ${I} == "string"`,()=>z(),()=>R.error(!1,{discrError:f.DiscrError.Tag,tag:I,tagName:L})),R.ok(K);function z(){let B=w();y.if(!1);for(let Y in B)y.elseIf(h._`${I} === ${Y}`),y.assign(K,F(B[Y]));y.else(),R.error(!1,{discrError:f.DiscrError.Mapping,tag:I,tagName:L}),y.endIf()}function F(B){let Y=y.name("valid"),U=R.subschema({keyword:"oneOf",schemaProp:B},Y);return R.mergeEvaluated(U,h.Name),Y}function w(){var B;let Y={},U=Z(N),T=!0;for(let pe=0;pe<W.length;pe++){let ye=W[pe];if((ye===null||ye===void 0?void 0:ye.$ref)&&!(0,b.schemaHasRulesButRef)(ye,J.self.RULES)){let je=ye.$ref;if(ye=g.resolveRef.call(J.self,J.schemaEnv.root,J.baseId,je),ye instanceof g.SchemaEnv)ye=ye.schema;if(ye===void 0)throw new S.default(J.opts.uriResolver,J.baseId,je)}let Ne=(B=ye===null||ye===void 0?void 0:ye.properties)===null||B===void 0?void 0:B[L];if(typeof Ne!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${L}"`);T=T&&(U||Z(ye)),de(Ne,pe)}if(!T)throw Error(`discriminator: "${L}" must be required`);return Y;function Z({required:pe}){return Array.isArray(pe)&&pe.includes(L)}function de(pe,ye){if(pe.const)we(pe.const,ye);else if(pe.enum)for(let Ne of pe.enum)we(Ne,ye);else throw Error(`discriminator: "properties/${L}" must have "const" or "enum"`)}function we(pe,ye){if(typeof pe!="string"||pe in Y)throw Error(`discriminator: "${L}" values must be unique strings`);Y[pe]=ye}}}};m.default=_}),Ad=_e((m,h)=>{h.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}}),Fc=_e((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv=void 0;let f=$i(),g=Hc(),S=Ti(),b=Ad(),_=["/properties"],R="http://json-schema.org/draft-07/schema";var y=class extends f.default{_addVocabularies(){if(super._addVocabularies(),g.default.forEach((W)=>this.addVocabulary(W)),this.opts.discriminator)this.addKeyword(S.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let W=this.opts.$data?this.$dataMetaSchema(b,_):b;this.addMetaSchema(W,R,!1),this.refs["http://json-schema.org/schema"]=R}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(R)?R:void 0)}};m.Ajv=y,h.exports=m=y,h.exports.Ajv=y,Object.defineProperty(m,"__esModule",{value:!0}),m.default=y;var P=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return P.KeywordCxt}});var C=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return C._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return C.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return C.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return C.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return C.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return C.CodeGen}});var N=Wr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return N.default}});var J=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return J.default}})}),xc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.dynamicAnchor=void 0;let h=Fe(),f=Et(),g=yn(),S=Pi(),b={keyword:"$dynamicAnchor",schemaType:"string",code:(y)=>_(y,y.schema)};function _(y,P){let{gen:C,it:N}=y;N.schemaEnv.root.dynamicAnchors[P]=!0;let J=h._`${f.default.dynamicAnchors}${(0,h.getProperty)(P)}`,W=N.errSchemaPath==="#"?N.validateName:R(y);C.if(h._`!${J}`,()=>C.assign(J,W))}m.dynamicAnchor=_;function R(y){let{schemaEnv:P,schema:C,self:N}=y.it,{root:J,baseId:W,localRefs:L,meta:K}=P.root,{schemaId:I}=N.opts,z=new g.SchemaEnv({schema:C,schemaId:I,root:J,baseId:W,localRefs:L,meta:K});return g.compileSchema.call(N,z),(0,S.getValidate)(y,z)}m.default=b}),Kc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.dynamicRef=void 0;let h=Fe(),f=Et(),g=Pi(),S={keyword:"$dynamicRef",schemaType:"string",code:(_)=>b(_,_.schema)};function b(_,R){let{gen:y,keyword:P,it:C}=_;if(R[0]!=="#")throw Error(`"${P}" only supports hash fragment reference`);let N=R.slice(1);if(C.allErrors)J();else{let L=y.let("valid",!1);J(L),_.ok(L)}function J(L){if(C.schemaEnv.root.dynamicAnchors[N]){let K=y.let("_v",h._`${f.default.dynamicAnchors}${(0,h.getProperty)(N)}`);y.if(K,W(K,L),W(C.validateName,L))}else W(C.validateName,L)()}function W(L,K){return K?()=>y.block(()=>{(0,g.callRef)(_,L),y.let(K,!0)}):()=>(0,g.callRef)(_,L)}}m.dynamicRef=b,m.default=S}),Ld=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=xc(),f=Ye(),g={keyword:"$recursiveAnchor",schemaType:"boolean",code(S){if(S.schema)(0,h.dynamicAnchor)(S,"");else(0,f.checkStrictMode)(S.it,"$recursiveAnchor: false is ignored")}};m.default=g}),Dd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Kc(),f={keyword:"$recursiveRef",schemaType:"string",code:(g)=>(0,h.dynamicRef)(g,g.schema)};m.default=f}),Bc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=xc(),f=Kc(),g=Ld(),S=Dd(),b=[h.default,f.default,g.default,S.default];m.default=b}),Vd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wi(),f={keyword:"dependentRequired",type:"object",schemaType:"object",error:h.error,code:(g)=>(0,h.validatePropertyDeps)(g)};m.default=f}),Ud=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wi(),f={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(g)=>(0,h.validateSchemaDeps)(g)};m.default=f}),Hd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ye(),f={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:g,parentSchema:S,it:b}){if(S.contains===void 0)(0,h.checkStrictMode)(b,`"${g}" without "contains" is ignored`)}};m.default=f}),Gc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Vd(),f=Ud(),g=Hd(),S=[h.default,f.default,g.default];m.default=S}),Fd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=Ye(),g=Et(),S={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:b})=>h._`{unevaluatedProperty: ${b.unevaluatedProperty}}`},code(b){let{gen:_,schema:R,data:y,errsCount:P,it:C}=b;if(!P)throw Error("ajv implementation error");let{allErrors:N,props:J}=C;if(J instanceof h.Name)_.if(h._`${J} !== true`,()=>_.forIn("key",y,(I)=>_.if(L(J,I),()=>W(I))));else if(J!==!0)_.forIn("key",y,(I)=>J===void 0?W(I):_.if(K(J,I),()=>W(I)));C.props=!0,b.ok(h._`${P} === ${g.default.errors}`);function W(I){if(R===!1){if(b.setParams({unevaluatedProperty:I}),b.error(),!N)_.break();return}if(!(0,f.alwaysValidSchema)(C,R)){let z=_.name("valid");if(b.subschema({keyword:"unevaluatedProperties",dataProp:I,dataPropType:f.Type.Str},z),!N)_.if((0,h.not)(z),()=>_.break())}}function L(I,z){return h._`!${I} || !${I}[${z}]`}function K(I,z){let F=[];for(let w in I)if(I[w]===!0)F.push(h._`${z} !== ${w}`);return(0,h.and)(...F)}}};m.default=S}),xd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=Ye(),g={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:S}})=>h.str`must NOT have more than ${S} items`,params:({params:{len:S}})=>h._`{limit: ${S}}`},code(S){let{gen:b,schema:_,data:R,it:y}=S,P=y.items||0;if(P===!0)return;let C=b.const("len",h._`${R}.length`);if(_===!1)S.setParams({len:P}),S.fail(h._`${C} > ${P}`);else if(typeof _=="object"&&!(0,f.alwaysValidSchema)(y,_)){let J=b.var("valid",h._`${C} <= ${P}`);b.if((0,h.not)(J),()=>N(J,P)),S.ok(J)}y.items=!0;function N(J,W){b.forRange("i",W,C,(L)=>{if(S.subschema({keyword:"unevaluatedItems",dataProp:L,dataPropType:f.Type.Num},J),!y.allErrors)b.if((0,h.not)(J),()=>b.break())})}}};m.default=g}),Jc=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fd(),f=xd(),g=[h.default,f.default];m.default=g}),Kd=_e((m,h)=>{h.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"}]}}}}}),Bd=_e((m,h)=>{h.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:"#"}}}}}),Gd=_e((m,h)=>{h.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:"#"}}}}),Jd=_e((m,h)=>{h.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:{}}}}}),Wd=_e((m,h)=>{h.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"}}}}),Yd=_e((m,h)=>{h.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}}}}),Zd=_e((m,h)=>{h.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:[]}}}}),Xd=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Kd(),f=Bd(),g=Gd(),S=Jd(),b=Wd(),_=Yd(),R=Zd(),y=["/properties"];function P(C){return[h,f,g,S,N(this,b),_,N(this,R)].forEach((J)=>this.addMetaSchema(J,void 0,!1)),this;function N(J,W){return C?J.$dataMetaSchema(W,y):W}}m.default=P}),Qd=_e((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv2019=void 0;let f=$i(),g=Hc(),S=Bc(),b=Gc(),_=Jc(),R=Ti(),y=Xd(),P="https://json-schema.org/draft/2019-09/schema";var C=class extends f.default{constructor(K={}){super({...K,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(S.default),g.default.forEach((K)=>this.addVocabulary(K)),this.addVocabulary(b.default),this.addVocabulary(_.default),this.opts.discriminator)this.addKeyword(R.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:K,meta:I}=this.opts;if(!I)return;y.default.call(this,K),this.refs["http://json-schema.org/schema"]=P}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(P)?P:void 0)}};m.Ajv2019=C,h.exports=m=C,h.exports.Ajv2019=C,Object.defineProperty(m,"__esModule",{value:!0}),m.default=C;var N=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return N.KeywordCxt}});var J=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return J._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return J.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return J.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return J.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return J.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return J.CodeGen}});var W=Wr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return W.default}});var L=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return L.default}})}),em=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Oc(),f=kc(),g=Dc(),S=Bc(),b=Gc(),_=Jc(),R=Vc(),y=Uc(),P=[S.default,h.default,f.default,(0,g.default)(!0),R.default,y.metadataVocabulary,y.contentVocabulary,b.default,_.default];m.default=P}),tm=_e((m,h)=>{h.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}}}}),am=_e((m,h)=>{h.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"}}}}}),rm=_e((m,h)=>{h.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"}}}}),om=_e((m,h)=>{h.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"}}}}),sm=_e((m,h)=>{h.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"}}}}),nm=_e((m,h)=>{h.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"}}}}),im=_e((m,h)=>{h.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}}}}),cm=_e((m,h)=>{h.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:[]}}}}),lm=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=tm(),f=am(),g=rm(),S=om(),b=sm(),_=nm(),R=im(),y=cm(),P=["/properties"];function C(N){return[h,f,g,S,b,J(this,_),R,J(this,y)].forEach((W)=>this.addMetaSchema(W,void 0,!1)),this;function J(W,L){return N?W.$dataMetaSchema(L,P):L}}m.default=C}),um=_e((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv2020=void 0;let f=$i(),g=em(),S=Ti(),b=lm(),_="https://json-schema.org/draft/2020-12/schema";var R=class extends f.default{constructor(J={}){super({...J,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),g.default.forEach((J)=>this.addVocabulary(J)),this.opts.discriminator)this.addKeyword(S.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:J,meta:W}=this.opts;if(!W)return;b.default.call(this,J),this.refs["http://json-schema.org/schema"]=_}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(_)?_:void 0)}};m.Ajv2020=R,h.exports=m=R,h.exports.Ajv2020=R,Object.defineProperty(m,"__esModule",{value:!0}),m.default=R;var y=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return y.KeywordCxt}});var P=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return P._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return P.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return P.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return P.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return P.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return P.CodeGen}});var C=Wr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return C.default}});var N=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return N.default}})}),dm=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.formatNames=m.fastFormats=m.fullFormats=void 0;function h(pe,ye){return{validate:pe,compare:ye}}m.fullFormats={date:h(b,_),time:h(y(!0),P),"date-time":h(J(!0),W),"iso-time":h(y(),C),"iso-date-time":h(J(),L),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:z,"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:we,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:w,int32:{type:"number",validate:U},int64:{type:"number",validate:T},float:{type:"number",validate:Z},double:{type:"number",validate:Z},password:!0,binary:!0},m.fastFormats={...m.fullFormats,date:h(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,_),time:h(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,P),"date-time":h(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,W),"iso-time":h(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,C),"iso-date-time":h(/^\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,L),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},m.formatNames=Object.keys(m.fullFormats);function f(pe){return pe%4===0&&(pe%100!==0||pe%400===0)}let g=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,S=[0,31,28,31,30,31,30,31,31,30,31,30,31];function b(pe){let ye=g.exec(pe);if(!ye)return!1;let Ne=+ye[1],je=+ye[2],Ge=+ye[3];return je>=1&&je<=12&&Ge>=1&&Ge<=(je===2&&f(Ne)?29:S[je])}function _(pe,ye){if(!(pe&&ye))return;if(pe>ye)return 1;if(pe<ye)return-1;return 0}let R=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function y(pe){return function(Ne){let je=R.exec(Ne);if(!je)return!1;let Ge=+je[1],Qe=+je[2],Ze=+je[3],nt=je[4],We=je[5]==="-"?-1:1,ee=+(je[6]||0),ne=+(je[7]||0);if(ee>23||ne>59||pe&&!nt)return!1;if(Ge<=23&&Qe<=59&&Ze<60)return!0;let Re=Qe-ne*We,G=Ge-ee*We-(Re<0?1:0);return(G===23||G===-1)&&(Re===59||Re===-1)&&Ze<61}}function P(pe,ye){if(!(pe&&ye))return;let Ne=new Date("2020-01-01T"+pe).valueOf(),je=new Date("2020-01-01T"+ye).valueOf();if(!(Ne&&je))return;return Ne-je}function C(pe,ye){if(!(pe&&ye))return;let Ne=R.exec(pe),je=R.exec(ye);if(!(Ne&&je))return;if(pe=Ne[1]+Ne[2]+Ne[3],ye=je[1]+je[2]+je[3],pe>ye)return 1;if(pe<ye)return-1;return 0}let N=/t|\s/i;function J(pe){let ye=y(pe);return function(je){let Ge=je.split(N);return Ge.length===2&&b(Ge[0])&&ye(Ge[1])}}function W(pe,ye){if(!(pe&&ye))return;let Ne=new Date(pe).valueOf(),je=new Date(ye).valueOf();if(!(Ne&&je))return;return Ne-je}function L(pe,ye){if(!(pe&&ye))return;let[Ne,je]=pe.split(N),[Ge,Qe]=ye.split(N),Ze=_(Ne,Ge);if(Ze===void 0)return;return Ze||P(je,Qe)}let K=/\/|:/,I=/^(?:[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 z(pe){return K.test(pe)&&I.test(pe)}let F=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function w(pe){return F.lastIndex=0,F.test(pe)}let B=-2147483648,Y=2147483647;function U(pe){return Number.isInteger(pe)&&pe<=Y&&pe>=B}function T(pe){return Number.isInteger(pe)}function Z(){return!0}let de=/[^\\]\\Z/;function we(pe){if(de.test(pe))return!1;try{return new RegExp(pe),!0}catch(ye){return!1}}}),mm=_e((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.formatLimitDefinition=void 0;let h=Fc(),f=Fe(),g=f.operators,S={formatMaximum:{okStr:"<=",ok:g.LTE,fail:g.GT},formatMinimum:{okStr:">=",ok:g.GTE,fail:g.LT},formatExclusiveMaximum:{okStr:"<",ok:g.LT,fail:g.GTE},formatExclusiveMinimum:{okStr:">",ok:g.GT,fail:g.LTE}},b={message:({keyword:R,schemaCode:y})=>f.str`should be ${S[R].okStr} ${y}`,params:({keyword:R,schemaCode:y})=>f._`{comparison: ${S[R].okStr}, limit: ${y}}`};m.formatLimitDefinition={keyword:Object.keys(S),type:"string",schemaType:"string",$data:!0,error:b,code(R){let{gen:y,data:P,schemaCode:C,keyword:N,it:J}=R,{opts:W,self:L}=J;if(!W.validateFormats)return;let K=new h.KeywordCxt(J,L.RULES.all.format.definition,"format");if(K.$data)I();else z();function I(){let w=y.scopeValue("formats",{ref:L.formats,code:W.code.formats}),B=y.const("fmt",f._`${w}[${K.schemaCode}]`);R.fail$data((0,f.or)(f._`typeof ${B} != "object"`,f._`${B} instanceof RegExp`,f._`typeof ${B}.compare != "function"`,F(B)))}function z(){let w=K.schema,B=L.formats[w];if(!B||B===!0)return;if(typeof B!="object"||B instanceof RegExp||typeof B.compare!="function")throw Error(`"${N}": format "${w}" does not define "compare" function`);let Y=y.scopeValue("formats",{key:w,ref:B,code:W.code.formats?f._`${W.code.formats}${(0,f.getProperty)(w)}`:void 0});R.fail$data(F(Y))}function F(w){return f._`${w}.compare(${P}, ${C}) ${S[N].fail} 0`}},dependencies:["format"]};let _=(R)=>(R.addKeyword(m.formatLimitDefinition),R);m.default=_}),hm=_e((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0});let f=dm(),g=mm(),S=Fe(),b=new S.Name("fullFormats"),_=new S.Name("fastFormats"),R=(P,C={keywords:!0})=>{if(Array.isArray(C))return y(P,C,f.fullFormats,b),P;let[N,J]=C.mode==="fast"?[f.fastFormats,_]:[f.fullFormats,b];if(y(P,C.formats||f.formatNames,N,J),C.keywords)(0,g.default)(P);return P};R.get=(P,C="full")=>{let N=(C==="fast"?f.fastFormats:f.fullFormats)[P];if(!N)throw Error(`Unknown format "${P}"`);return N};function y(P,C,N,J){var W,L;(W=(L=P.opts.code).formats)!==null&&W!==void 0||(L.formats=S._`require("ajv-formats/dist/formats").${J}`);for(let K of C)P.addFormat(K,N[K])}h.exports=m=R,Object.defineProperty(m,"__esModule",{value:!0}),m.default=R}),Wc=Fc(),pm=Qd(),fm=um(),gm=go(hm(),1),Sm=gm.default;function zi(m){let h=new m({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Sm(h),h}var Ci=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(m){this._userAjv=m!==void 0,this._ajv=m}get ajv(){return this._ajv??=zi(fm.Ajv2020)}_engineFor(m){if(this._userAjv)return this.ajv;let h=ki(m,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(h==="2020-12")return this.ajv;if(h==="2019-09")return this._ajv2019??=zi(pm.Ajv2019);return this._ajvDraft7??=zi(Wc.Ajv)}getValidator(m){let h=this._engineFor(m),f="$id"in m&&typeof m.$id==="string"?h.getSchema(m.$id)??h.compile(m):h.compile(m);return(g)=>f(g)?{valid:!0,data:g,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:h.errorsText(f.errors)}}},Rh=Wc.Ajv;import he from"node:process";var sl=Symbol.for("mcp.completable");function Yc(m){return!!m&&typeof m==="object"&&sl in m}function _m(m){return m[sl]?.complete}function ym(m,h){switch(h.kind){case"tools_list_changed":return m.toolsListChanged===!0;case"prompts_list_changed":return m.promptsListChanged===!0;case"resources_list_changed":return m.resourcesListChanged===!0;case"resource_updated":return m.resourceSubscriptions!==void 0&&m.resourceSubscriptions.includes(h.uri)}}function vm(m,h){let f={},g=(S)=>h===void 0||S===!0;if(m.toolsListChanged===!0&&g(h?.tools?.listChanged))f.toolsListChanged=!0;if(m.promptsListChanged===!0&&g(h?.prompts?.listChanged))f.promptsListChanged=!0;if(m.resourcesListChanged===!0&&g(h?.resources?.listChanged))f.resourcesListChanged=!0;if(m.resourceSubscriptions!==void 0&&m.resourceSubscriptions.length>0&&g(h?.resources?.subscribe))f.resourceSubscriptions=[...m.resourceSubscriptions];return f}var ge=1024;function Zc(m,h){return{method:m.method,params:{...m.params,_meta:{...m.params?._meta,[$a]:h}}}}function bm(m){let h=Wt(Gr).validateRequest("subscriptions/listen",m);return h.ok?h.value.params?.notifications:void 0}var Rm=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]),Te=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor(m=ge,h,f){this._maxSubscriptions=m,this._serverCapabilities=h,this._serverInfo=f}setServerCapabilities(m,h){if(this._serverCapabilities=m,h!==void 0)this._serverInfo=h}has(m){return this._subs.has(m)}serve(m){if(this._serverCapabilities===void 0)throw Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:m.id,error:{code:-32603,message:"Subscription limit reached"}};let h=bm(m);if(h===void 0)return{jsonrpc:"2.0",id:m.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let f=vm(h,this._serverCapabilities);return this._subs.set(m.id,f),Zc({method:"notifications/subscriptions/acknowledged",params:{notifications:f}},m.id)}cancel(m){return this._subs.delete(m)}routeOutbound(m){if(!Rm.has(m.method))return"passthrough";let h=m.params?.uri,f=typeof h==="string"?h:void 0,g=zm(m.method,f),S=[];for(let[b,_]of this._subs)if(ym(_,g))S.push(Zc({method:m.method,params:m.params??{}},b));return S}teardownAll(){let m=[];for(let h of this._subs.keys())m.push({jsonrpc:"2.0",id:h,result:{resultType:"complete",_meta:{[$a]:h,...this._serverInfo!==void 0&&{[jt]:this._serverInfo}}}});return this._subs.clear(),m}};function zm(m,h){switch(m){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:h??""}}}function $m(m){return typeof m==="object"&&m!==null&&"setScopeChallengeResolver"in m&&typeof m.setScopeChallengeResolver==="function"}var Pm=8,Em=600000;function wm(m){if(m?.maxRounds!==void 0&&(!Number.isInteger(m.maxRounds)||m.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${m.maxRounds})`);if(m?.roundTimeoutMs!==void 0&&(!Number.isFinite(m.roundTimeoutMs)||m.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${m.roundTimeoutMs})`);return{maxRounds:m?.maxRounds??Pm,roundTimeoutMs:m?.roundTimeoutMs??Em,legacyShim:m?.legacyShim??!0}}function nl(m,h,f){if(f===null||typeof f!=="object"||typeof f.method!=="string")throw new De(i.InternalError,`Handler for ${m} returned an invalid input request '${h}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let g=f,S=Zi(g);if(S===void 0)throw new De(i.InternalError,`Handler for ${m} returned an input request '${h}' of kind '${g.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:g,required:S}}function Tm(){let m=globalThis.crypto;if(m?.randomUUID!==void 0)return m.randomUUID();let h=new Uint8Array(16);m.getRandomValues(h),h[6]=h[6]&15|64,h[8]=h[8]&63|128;let f=[...h].map((g)=>g.toString(16).padStart(2,"0")).join("");return`${f.slice(0,8)}-${f.slice(8,12)}-${f.slice(12,16)}-${f.slice(16,20)}-${f.slice(20)}`}function qi(m,h){if(m==="tools/call")return{content:[{type:"text",text:h}],isError:!0};throw new De(i.InternalError,h)}var Cm=class{constructor(m){this._host=m}async fulfill(m,h,f,g,S){let{maxRounds:b,roundTimeoutMs:_}=this._host,R=g.mcpReq.signal,y=S,P=0;while(!0){if(P+=1,P>b)return qi(m,vc(m,b));let C=y.inputRequests,N=C!=null&&Object.keys(C).length>0,J=typeof y.requestState==="string"?y.requestState:void 0;if(!N&&J===void 0)throw new De(i.InternalError,`Handler for ${m} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let W;if(N){let I=this._host.resolvedClientCapabilities(g),z=[];for(let[w,B]of Object.entries(C)){let{embedded:Y,required:U}=nl(m,w,B);if(Y.method!=="roots/list"&&Y.params===void 0)throw new De(i.InternalError,`Handler for ${m} returned an input request '${w}' of kind '${Y.method}' without params`);if(ci(U,I)!==void 0)return qi(m,`Cannot request input '${w}' (${Y.method}): the client on this 2025-era connection did not declare the required capability${I===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);z.push([w,Y])}let F=Rc(R);try{let w={relatedRequestId:g.mcpReq.id,timeout:_,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:F.signal},B=await Promise.all(z.map(async([Y,U])=>{try{return[Y,await this._dispatchLeg(U,w)]}catch(T){throw F.abort(T),T}}));W=Object.fromEntries(B)}catch(w){if(R.aborted)throw w;return qi(m,`Fulfilling input required by '${m}' failed: ${w instanceof Error?w.message:String(w)}`)}finally{F.dispose()}}else await bc(yc,R);let L={...g,mcpReq:{...g.mcpReq,inputResponses:W,droppedInputResponseKeys:void 0,requestState:Jr(J)}};if(J!==void 0){let I=await this._host.verifyRequestState(J,L,m);if(I!==void 0)L=bi(L,I)}let K=await h(f,L);if(!Yt(K))return K;y=K}}async _dispatchLeg(m,h){switch(m.method){case"elicitation/create":{let f=m.params;if(f.mode==="url"&&f.elicitationId===void 0)f={...f,elicitationId:Tm()};return await this._host.sendElicitation(f,h)}case"sampling/createMessage":return await this._host.sendSampling(m.params,h);case"roots/list":return await this._host.listRoots(m.params,h)}}},qm=new Set(["tools/call","prompts/get","resources/read"]),jm,il,cl;function ze(m,h){il(m,h)}function Pe(m){return cl(m)}var Nm=class extends wc{_clientCapabilities;_clientVersion;static{jm=(m,h)=>{if(h.clientCapabilities!==void 0)m._clientCapabilities=h.clientCapabilities;if(h.clientInfo!==void 0)m._clientVersion=h.clientInfo},il=(m,h)=>{let f=h.filter((g)=>!m._supportedProtocolVersions.includes(g));if(f.length>0)m._supportedProtocolVersions=[...m._supportedProtocolVersions,...f];m.setRequestHandler("server/discover",()=>m._ondiscover())},cl=(m)=>m._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new Cm({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:(m)=>this._inputRequestCapabilityView(m),verifyRequestState:(m,h,f)=>this._verifyRequestState(m,h,f),sendElicitation:(m,h)=>this._sendElicitationLeg(m,h,{validateAcceptedContent:!1}),sendSampling:(m,h)=>this.createMessage(m,h),listRoots:(m,h)=>this.listRoots(m,h)})}oninitialized;constructor(m,h){super(h);if(this._serverInfo=m,this._capabilities=h?.capabilities?{...h.capabilities}:{},this._instructions=h?.instructions,this._jsonSchemaValidator=h?.jsonSchemaValidator??new Ci,this._requestStateVerify=h?.requestState?.verify,this._inputRequiredServing=wm(h?.inputRequired),h?.cacheHints!==void 0){for(let[f,g]of Object.entries(h.cacheHints))if(g!==void 0)fi(g,`cacheHints['${f}']`);this._cacheHints=h.cacheHints}if(this.setRequestHandler("initialize",(f)=>this._oninitialize(f)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),li(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(m,h)=>{let f=h.sessionId||h.http?.req?.headers.get("mcp-session-id")||void 0,{level:g}=m.params,S=hn(Bt,g);if(S.success)this._loggingLevels.set(f,S.data);return{}})}buildContext(m,h){let f=m.http||h?.request||h?.closeSSEStream||h?.closeStandaloneSSEStream;return{...m,mcpReq:{...m.mcpReq,log:(g,S,b)=>{if(!this._capabilities.logging)return Promise.resolve();let _;if(this._servedModernEra()){if(_=m.mcpReq.envelope?.[la],_===void 0)return Promise.resolve()}else _=this._loggingLevels.get(m.sessionId)??this._loggingLevels.get(void 0);if(_!==void 0&&this.LOG_LEVEL_SEVERITY.get(g)<this.LOG_LEVEL_SEVERITY.get(_))return Promise.resolve();return m.mcpReq.notify({method:"notifications/message",params:{level:g,data:S,logger:b}})},elicitInput:(g,S)=>this.elicitInput(g,S),requestSampling:(g,S)=>this.createMessage(g,S)},http:f?{...m.http,req:h?.request,closeSSE:h?.closeSSEStream,closeStandaloneSSE:h?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(Bt.options.map((m,h)=>[m,h]));isMessageIgnored=(m,h)=>{let f=this._loggingLevels.get(h);return f?this.LOG_LEVEL_SEVERITY.get(m)<this.LOG_LEVEL_SEVERITY.get(f):!1};registerCapabilities(m){if(this.transport)throw new Ke(Je.AlreadyConnected,"Cannot register capabilities after connecting to transport");let h=!!this._capabilities.logging;if(this._capabilities=Tc(this._capabilities,m),!h&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(m,h){if(m!=="tools/call"){let f=this._cacheHints?.[m],g=qm.has(m);if(f===void 0&&!g)return async(S,b)=>{let _=await h(S,b);if(Yt(_))throw new De(i.InternalError,`Handler for ${m} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return _};return async(S,b)=>{let _=g?await this._invokeInputRequiredCapableHandler(m,h,S,b):await h(S,b);if(Yt(_)){if(!g)throw new De(i.InternalError,`Handler for ${m} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return _}return f===void 0?_:mn(_,f)}}return async(f,g)=>{let S=Wt(this._negotiatedProtocolVersion),b=S.validateRequest("tools/call",f);if(!b.ok)throw new De(b.reason==="not-in-era"?i.InternalError:i.InvalidParams,b.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${b.message}`);let _=await this._invokeInputRequiredCapableHandler("tools/call",h,f,g);if(Yt(_))return _;let R=ui(_),y=S.validateResult("tools/call",R);if(!y.ok)throw new De(y.reason==="not-in-era"?i.InternalError:i.InvalidParams,y.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${y.message}`);return y.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&Va(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(m,h,f,g){let S=this._servedModernEra(),b=g.mcpReq.requestState();if(b!==void 0&&typeof b!=="string")throw new De(i.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let _=g;if(typeof b==="string"){let N=await this._verifyRequestState(b,g,m);if(N!==void 0)_=bi(g,N)}let R;try{R=await h(f,_)}catch(N){if(N instanceof De&&N.code===i.UrlElicitationRequired){if(!S)throw N;throw new De(i.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw N}if(!Yt(R))return R;if(!S){if(!this._inputRequiredServing.legacyShim)throw new De(i.InternalError,`Handler for ${m} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??za}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(m,h,f,_,R)}let y=R.inputRequests,P=y!=null&&Object.keys(y).length>0,C=typeof R.requestState==="string";if(!P&&!C)throw new De(i.InternalError,`Handler for ${m} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(P){let N=this._inputRequestCapabilityView(g);for(let[J,W]of Object.entries(y)){let{embedded:L,required:K}=nl(m,J,W),I=ci(K,N);if(I!==void 0)throw new Si({requiredCapabilities:I},`Cannot request input '${J}' (${L.method}): the request's client capabilities do not declare the required capability`)}}return R}async _verifyRequestState(m,h,f){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(m,h)}catch(g){throw this.onerror?.(Error(`requestState verification rejected ${f}: ${g instanceof Error?g.message:String(g)}`)),new De(i.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(m){return this._servedModernEra()?m.mcpReq.envelope?.[Vt]:this._clientCapabilities}_assertPushApiInServedEra(m){if(this._servedModernEra())throw new Ke(Je.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${m}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:m,era:"2026-07-28"})}assertCapabilityForMethod(m){switch(m){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Ke(Je.CapabilityNotSupported,`Client does not support sampling (required for ${m})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Ke(Je.CapabilityNotSupported,`Client does not support elicitation (required for ${m})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Ke(Je.CapabilityNotSupported,`Client does not support listing roots (required for ${m})`);break;case"ping":break}}assertNotificationCapability(m){switch(m){case"notifications/message":if(!this._capabilities.logging)throw new Ke(Je.CapabilityNotSupported,`Server does not support logging (required for ${m})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Ke(Je.CapabilityNotSupported,`Server does not support notifying about resources (required for ${m})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Ke(Je.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${m})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Ke(Je.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${m})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Je.CapabilityNotSupported,`Client does not support URL elicitation (required for ${m})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(m){switch(m){case"completion/complete":if(!this._capabilities.completions)throw new Ke(Je.CapabilityNotSupported,`Server does not support completions (required for ${m})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Ke(Je.CapabilityNotSupported,`Server does not support logging (required for ${m})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Ke(Je.CapabilityNotSupported,`Server does not support prompts (required for ${m})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Ke(Je.CapabilityNotSupported,`Server does not support resources (required for ${m})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Ke(Je.CapabilityNotSupported,`Server does not support tools (required for ${m})`);break;case"ping":case"initialize":break}}async _oninitialize(m){let h=m.params.protocolVersion;this._clientCapabilities=m.params.capabilities,this._clientVersion=m.params.clientInfo;let f=Qi(this._supportedProtocolVersions),g=f.includes(h)?h:f[0]??za;return this._negotiatedProtocolVersion=g,this.transport?.setProtocolVersion?.(g),{protocolVersion:g,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:li(this._supportedProtocolVersions),capabilities:Im(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(m,h){return this._wireCodec().projectCallToolResult(m,h)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(m,h){if(this._assertPushApiInServedEra("sampling/createMessage"),(m.tools||m.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Ke(Je.CapabilityNotSupported,"Client does not support sampling tools capability.");if(m.messages.length>0){let b=m.messages.at(-1),_=Array.isArray(b.content)?b.content:[b.content],R=_.some((N)=>N.type==="tool_result"),y=m.messages.length>1?m.messages.at(-2):void 0,P=y?Array.isArray(y.content)?y.content:[y.content]:[],C=P.some((N)=>N.type==="tool_use");if(R){if(_.some((N)=>N.type!=="tool_result"))throw new De(i.InvalidParams,"The last message must contain only tool_result content if any is present");if(!C)throw new De(i.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(C){let N=new Set(P.filter((W)=>W.type==="tool_use").map((W)=>W.id)),J=new Set(_.filter((W)=>W.type==="tool_result").map((W)=>W.toolUseId));if(N.size!==J.size||![...N].every((W)=>J.has(W)))throw new De(i.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let f=Boolean(m.tools||m.toolChoice),g=await this.request({method:"sampling/createMessage",params:m},h),S=this._wireCodec().samplingResultVariant(f,g);if(!S.ok)throw new Ke(Je.InvalidResult,`Invalid sampling/createMessage result: ${S.reason==="invalid"?S.message:S.reason}`);return S.value}async elicitInput(m,h){switch(this._assertPushApiInServedEra("elicitation/create"),m.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Je.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new Ke(Je.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(m,h)}async _sendElicitationLeg(m,h,f){let g=m.mode??"form",S=f?.validateAcceptedContent??!0;switch(g){case"url":{let b=m;return this.request({method:"elicitation/create",params:b},h)}case"form":{let b=m.mode==="form"?m:{...m,mode:"form"},_=await this.request({method:"elicitation/create",params:b},h);if(S&&_.action==="accept"&&_.content&&b.requestedSchema)try{let R=this._jsonSchemaValidator.getValidator(b.requestedSchema)(_.content);if(!R.valid)throw new De(i.InvalidParams,`Elicitation response content does not match requested schema: ${R.errorMessage}`)}catch(R){if(R instanceof De)throw R;throw new De(i.InternalError,`Error validating elicitation response: ${R instanceof Error?R.message:String(R)}`)}return _}}}createElicitationCompletionNotifier(m,h){if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Je.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:m}},h)}async listRoots(m,h){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:m},h)}async sendLoggingMessage(m,h){if(this._capabilities.logging&&!this.isMessageIgnored(m.level,h))return this.notification({method:"notifications/message",params:m})}async sendResourceUpdated(m){return this.notification({method:"notifications/resources/updated",params:m})}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 Im(m){return{...m}}var q=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(m){let h=this._registeredTools[m];if(h===void 0||!h.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,m))return this._toolInputSchemaJson[m];if(h.inputSchema===void 0)return Qc;try{let f=Zt(h.inputSchema,"input");return this._toolInputSchemaJson[m]=f,f}catch{return}}constructor(m,h){if(this.server=new Nm(m,h),h?.capabilities?.tools)this.setToolRequestHandlers();if(h?.capabilities?.resources)this.setResourceRequestHandlers();if(h?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect(m){if($m(m))m.setScopeChallengeResolver((h)=>this.resolveScopeChallenge(h));return await this.server.connect(m)}async close(){await this.server.close()}resolveScopeChallenge=(m)=>{switch(m.request.method){case"tools/call":{let h=m.request.params?.name;if(typeof h!=="string")return;let f=this._registeredTools[h];if(f===void 0||!f.enabled)return;return f.scopeChallenge?.(m)}case"resources/read":{let h=m.request.params?.uri;if(typeof h!=="string")return;let f;try{f=new URL(h)}catch{return}let g=this._registeredResources[f.toString()];if(g!==void 0)return g.enabled?g.scopeChallenge?.(m):void 0;for(let S of Object.values(this._registeredResourceTemplates))if(S.resourceTemplate.uriTemplate.match(f.toString()))return S.enabled?S.scopeChallenge?.(m):void 0;return}case"prompts/get":{let h=m.request.params?.name;if(typeof h!=="string")return;let f=this._registeredPrompts[h];if(f===void 0||!f.enabled)return;return f.scopeChallenge?.(m)}default:return}};_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;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(([,m])=>m.enabled).map(([m,h])=>{let f={name:m,title:h.title,description:h.description,inputSchema:h.inputSchema?Zt(h.inputSchema,"input"):Qc,annotations:h.annotations,icons:h.icons,execution:h.execution,_meta:h._meta};if(h.outputSchema)f.outputSchema=Zt(h.outputSchema,"output");return f})})),this.server.setRequestHandler("tools/call",async(m,h)=>{let f=this._registeredTools[m.params.name];if(!f)throw new De(i.InvalidParams,`Tool ${m.params.name} not found`);if(!f.enabled)throw new De(i.InvalidParams,`Tool ${m.params.name} disabled`);try{let g=await this.validateToolInput(f,m.params.arguments,m.params.name),S=await this.executeToolHandler(f,g,h);if(await this.validateToolOutput(f,S,m.params.name),Yt(S))return S;return this.server.projectCallToolResult(S,f.outputSchemaJson)}catch(g){if(g instanceof De&&g.code===i.UrlElicitationRequired)throw g;return this.createToolError(g instanceof Error?g.message:String(g))}}),this._toolHandlersInitialized=!0}createToolError(m){return{content:[{type:"text",text:m}],isError:!0}}async validateToolInput(m,h,f){if(!m.inputSchema)return;let g=await da(m.inputSchema,h??{});if(!g.success)throw new De(i.InvalidParams,`Input validation error: Invalid arguments for tool ${f}: ${g.error}`);return g.data}async validateToolOutput(m,h,f){if(!m.outputSchema)return;if(Yt(h))return;if(h.isError)return;if(h.structuredContent===void 0)throw new De(i.InvalidParams,`Output validation error: Tool ${f} has an output schema but no structured content was provided`);let g=await da(m.outputSchema,h.structuredContent);if(!g.success)throw new De(i.InvalidParams,`Output validation error: Invalid structured content for tool ${f}: ${g.error}`)}async executeToolHandler(m,h,f){return m.executor(h,f)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async(m)=>{switch(m.params.ref.type){case"ref/prompt":return pc(m),this.handlePromptCompletion(m,m.params.ref);case"ref/resource":return fc(m),this.handleResourceCompletion(m,m.params.ref);default:throw new De(i.InvalidParams,`Invalid completion reference: ${m.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(m,h){let f=this._registeredPrompts[h.name];if(!f)throw new De(i.InvalidParams,`Prompt ${h.name} not found`);if(!f.enabled)throw new De(i.InvalidParams,`Prompt ${h.name} disabled`);if(!f.argsSchema)return Yr;let g=ol(rl(f.argsSchema)?.[m.params.argument.name]);if(!Yc(g))return Yr;let S=_m(g);if(!S)return Yr;return al(await S(m.params.argument.value,m.params.context))}async handleResourceCompletion(m,h){let f=Object.values(this._registeredResourceTemplates).find((S)=>S.resourceTemplate.uriTemplate.toString()===h.uri);if(!f){if(this._registeredResources[h.uri])return Yr;throw new De(i.InvalidParams,`Resource template ${m.params.ref.uri} not found`)}let g=f.resourceTemplate.completeCallback(m.params.argument.name);if(!g)return Yr;return al(await g(m.params.argument.value,m.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;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(m,h)=>{let f=Object.entries(this._registeredResources).filter(([S,b])=>b.enabled).map(([S,b])=>({uri:S,name:b.name,...b.metadata})),g=[];for(let S of Object.values(this._registeredResourceTemplates)){if(!S.resourceTemplate.listCallback)continue;let b=await S.resourceTemplate.listCallback(h);for(let _ of b.resources)g.push({...S.metadata,..._})}return{resources:[...f,...g]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([m,h])=>({name:m,uriTemplate:h.resourceTemplate.uriTemplate.toString(),...h.metadata}))})),this.server.setRequestHandler("resources/read",async(m,h)=>{let f;try{f=new URL(m.params.uri)}catch{throw new De(i.InvalidParams,`Resource URI ${m.params.uri} is invalid`,{uri:m.params.uri,reason:"invalid_uri"})}let g=this._registeredResources[f.toString()];if(g){if(!g.enabled)throw new De(i.InvalidParams,`Resource ${f} disabled`);return mn(await g.readCallback(f,h),g.cacheHint)}for(let S of Object.values(this._registeredResourceTemplates)){let b=S.resourceTemplate.uriTemplate.match(f.toString());if(b){if(!S.enabled)throw new De(i.InvalidParams,`Resource template ${S.resourceTemplate.uriTemplate} disabled`);return mn(await S.readCallback(f,b,h),S.cacheHint)}}throw new gi(m.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;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(([,m])=>m.enabled).map(([m,h])=>({name:m,title:h.title,description:h.description,arguments:h.argsSchema?_c(h.argsSchema):void 0,icons:h.icons,_meta:h._meta}))})),this.server.setRequestHandler("prompts/get",async(m,h)=>{let f=this._registeredPrompts[m.params.name];if(!f)throw new De(i.InvalidParams,`Prompt ${m.params.name} not found`);if(!f.enabled)throw new De(i.InvalidParams,`Prompt ${m.params.name} disabled`);return f.handler(m.params.arguments,h)}),this._promptHandlersInitialized=!0}registerResource(m,h,f,g){let{cacheHint:S,scopeChallenge:b,..._}=f,R=_;if(S!==void 0)fi(S,`resource ${m}`);if(typeof h==="string"){if(this._registeredResources[h])throw Error(`Resource ${h} is already registered`);let y=this._createRegisteredResource(m,f.title,h,R,b,g);if(S!==void 0)y.cacheHint=S;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),y}else{if(this._registeredResourceTemplates[m])throw Error(`Resource template ${m} is already registered`);let y=this._createRegisteredResourceTemplate(m,f.title,h,R,b,g);if(S!==void 0)y.cacheHint=S;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),y}}_createRegisteredResource(m,h,f,g,S,b){let _={name:m,title:h,metadata:g,readCallback:b,scopeChallenge:S,enabled:!0,disable:()=>_.update({enabled:!1}),enable:()=>_.update({enabled:!0}),remove:()=>_.update({uri:null}),update:(R)=>{if(R.uri!==void 0&&R.uri!==f){if(delete this._registeredResources[f],R.uri)this._registeredResources[R.uri]=_}if(R.name!==void 0)_.name=R.name;if(R.title!==void 0)_.title=R.title;if(R.metadata!==void 0)_.metadata=R.metadata;if(R.callback!==void 0)_.readCallback=R.callback;if(R.scopeChallenge!==void 0)_.scopeChallenge=R.scopeChallenge===null?void 0:R.scopeChallenge;if(R.enabled!==void 0)_.enabled=R.enabled;this.sendResourceListChanged()}};return this._registeredResources[f]=_,_}_createRegisteredResourceTemplate(m,h,f,g,S,b){let _={resourceTemplate:f,title:h,metadata:g,readCallback:b,scopeChallenge:S,enabled:!0,disable:()=>_.update({enabled:!1}),enable:()=>_.update({enabled:!0}),remove:()=>_.update({name:null}),update:(y)=>{if(y.name!==void 0&&y.name!==m){if(delete this._registeredResourceTemplates[m],y.name)this._registeredResourceTemplates[y.name]=_}if(y.title!==void 0)_.title=y.title;if(y.template!==void 0)_.resourceTemplate=y.template;if(y.metadata!==void 0)_.metadata=y.metadata;if(y.callback!==void 0)_.readCallback=y.callback;if(y.scopeChallenge!==void 0)_.scopeChallenge=y.scopeChallenge===null?void 0:y.scopeChallenge;if(y.enabled!==void 0)_.enabled=y.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[m]=_;let R=f.uriTemplate.variableNames;if(Array.isArray(R)&&R.some((y)=>!!f.completeCallback(y)))this.setCompletionRequestHandler();return _}_createRegisteredPrompt(m,h,f,g,S,b,_,R){let y=g,P=S,C={title:h,description:f,argsSchema:g,icons:b,scopeChallenge:_,_meta:R,handler:tl(m,g,S),enabled:!0,disable:()=>C.update({enabled:!1}),enable:()=>C.update({enabled:!0}),remove:()=>C.update({name:null}),update:(N)=>{if(N.name!==void 0&&N.name!==m){if(delete this._registeredPrompts[m],N.name)this._registeredPrompts[N.name]=C}if(N.title!==void 0)C.title=N.title;if(N.description!==void 0)C.description=N.description;if(N.icons!==void 0)C.icons=N.icons;if(N.scopeChallenge!==void 0)C.scopeChallenge=N.scopeChallenge===null?void 0:N.scopeChallenge;if(N._meta!==void 0)C._meta=N._meta;let J=!1;if(N.argsSchema!==void 0)C.argsSchema=N.argsSchema,y=N.argsSchema,J=!0;if(N.callback!==void 0)P=N.callback,J=!0;if(J)C.handler=tl(m,y,P);if(N.enabled!==void 0)C.enabled=N.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[m]=C,g){let N=rl(g);if(N){if(Object.values(N).some((J)=>Yc(ol(J))))this.setCompletionRequestHandler()}}return C}_createRegisteredTool(m,h,f,g,S,b,_,R,y,P,C){if(Ri(m),g!==void 0)try{let W=Zt(g,"input");this._toolInputSchemaJson[m]=W;let L=gc(W);if(!L.valid)console.warn(`[mcp-sdk] tool '${m}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${L.reason}`)}catch{}let N=C,J={title:h,description:f,inputSchema:g,outputSchema:S,outputSchemaJson:el(S),annotations:b,icons:_,execution:R,scopeChallenge:y,_meta:P,handler:C,executor:Xc(g,C),enabled:!0,disable:()=>J.update({enabled:!1}),enable:()=>J.update({enabled:!0}),remove:()=>J.update({name:null}),update:(W)=>{if(W.name!==void 0&&W.name!==m){if(typeof W.name==="string")Ri(W.name);if(delete this._registeredTools[m],delete this._toolInputSchemaJson[m],W.name)delete this._toolInputSchemaJson[W.name],this._registeredTools[W.name]=J,m=W.name}if(W.title!==void 0)J.title=W.title;if(W.description!==void 0)J.description=W.description;let L=!1;if(W.paramsSchema!==void 0)J.inputSchema=W.paramsSchema,delete this._toolInputSchemaJson[m],L=!0;if(W.callback!==void 0)J.handler=W.callback,N=W.callback,L=!0;if(L)J.executor=Xc(J.inputSchema,N);if(W.outputSchema!==void 0)J.outputSchema=W.outputSchema,J.outputSchemaJson=el(W.outputSchema);if(W.annotations!==void 0)J.annotations=W.annotations;if(W.icons!==void 0)J.icons=W.icons;if(W.scopeChallenge!==void 0)J.scopeChallenge=W.scopeChallenge===null?void 0:W.scopeChallenge;if(W._meta!==void 0)J._meta=W._meta;if(W.enabled!==void 0)J.enabled=W.enabled;this.sendToolListChanged()}};return this._registeredTools[m]=J,this.setToolRequestHandlers(),this.sendToolListChanged(),J}registerTool(m,h,f){if(this._registeredTools[m])throw Error(`Tool ${m} is already registered`);let{title:g,description:S,inputSchema:b,outputSchema:_,annotations:R,icons:y,scopeChallenge:P,_meta:C}=h;return this._createRegisteredTool(m,g,S,pn(b),pn(_),R,y,void 0,P,C,f)}registerPrompt(m,h,f){if(this._registeredPrompts[m])throw Error(`Prompt ${m} is already registered`);let{title:g,description:S,argsSchema:b,icons:_,scopeChallenge:R,_meta:y}=h,P=this._createRegisteredPrompt(m,g,S,pn(b),f,_,R,y);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),P}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(m,h){return this.server.sendLoggingMessage(m,h)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}};function Xc(m,h){if(m){let g=h;return async(S,b)=>g(S,b)}let f=h;return async(g,S)=>f(S)}var Qc={type:"object",properties:{}};function el(m){if(m===void 0)return;try{return Zt(m,"output")}catch{return}}function tl(m,h,f){if(h){let g=f;return async(S,b)=>{let _=await da(h,S);if(!_.success)throw new De(i.InvalidParams,`Invalid arguments for prompt ${m}: ${_.error}`);return g(_.data,b)}}else{let g=f;return async(S,b)=>g(b)}}function al(m){return{completion:{values:m.map(String).slice(0,100),total:m.length,hasMore:m.length>100}}}var Yr={completion:{values:[],hasMore:!1}};function rl(m){let h=m;if(h.shape&&typeof h.shape==="object")return h.shape}function Om(m){return m?.type==="optional"}function ol(m){if(!Om(m))return m;return m.def?.innerType??m}
|
|
15
|
+
export{x,i,H,j,re,oe,se,v,A,ie,me,fe,$e,Ce,Ee,ke,he,ge,Te,ze,Pe,q};
|