@mcpcloud/runtime 0.18.0 → 0.19.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/index.js CHANGED
@@ -1,31 +1,31 @@
1
- /*! @mcpcloud/runtime v0.18.0 — (c) MCPCloud.sh. All rights reserved. SEE LICENSE: https://www.npmjs.com/package/@mcpcloud/runtime */
2
- var lR=Object.defineProperty;var uR=(e)=>e;function dR(e,t){this[e]=uR.bind(null,t)}var Ut=(e,t)=>{for(var n in t)lR(e,n,{get:t[n],enumerable:!0,configurable:!0,set:dR.bind(t,n)})};function Uu(){return typeof process>"u"?{}:process.env}var Mu=null,Aa=null;function mR(e){if(!e?.trim())return{};let t=JSON.parse(e);if(!t||typeof t!=="object"||Array.isArray(t))throw Error("UPSTREAM_CUSTOM_HEADERS must be a JSON object.");return Object.entries(t).reduce((n,[o,r])=>{if(typeof r==="string"&&r.trim())n[o]=r;return n},{})}function pR(e){if(!e?.trim())return{};try{let t=JSON.parse(e);if(!t||typeof t!=="object"||Array.isArray(t))return{};return Object.entries(t).reduce((n,[o,r])=>{if(r==="on"||r==="off")n[o]=r;return n},{})}catch{return{}}}function Ur(e,t){let n=t?.trim();if(!n)throw Error(`Set ${e} before starting the generated MCP server.`);return n}function fR(e){let t=Number.parseInt(Ur("MCP_RUNTIME_AUTH_DEPLOYMENT_VERSION",e),10);if(!Number.isFinite(t)||t<=0)throw Error("MCP_RUNTIME_AUTH_DEPLOYMENT_VERSION must be a positive integer.");return t}function Ma(e=Uu()){let t=e.MCP_RUNTIME_AUTH_ACCESS_MODE?.trim();return t==="privateOrg"||t==="unlisted"?t:"public"}function Ua(e,t=Uu()){let n=t.UPSTREAM_BASE_URL?.trim()||e.defaultUpstreamBaseUrl||"";if(e.defaultUpstreamBaseUrl&&!n)throw Error("Set UPSTREAM_BASE_URL before starting the generated MCP server.");let o=Ma(t);Mu=t.MCP_OAUTH_RUNTIME_TOKEN?.trim()||null,Aa=t.MCP_MEMBER_KEY_RUNTIME_TOKEN?.trim()||null;let r=t.MCP_MEMBER_KEY_MODE?.trim()==="perMember"&&Boolean(t.MCP_MEMBER_KEY_RUNTIME_URL?.trim())&&Boolean(Aa);return{serverName:e.serverName,serverVersion:e.serverVersion,upstreamBaseUrl:n,apiKey:t.UPSTREAM_API_KEY?.trim()||null,apiKeyHeader:t.UPSTREAM_API_KEY_HEADER?.trim()||e.apiKeyHeader,apiKeyPrefix:t.UPSTREAM_API_KEY_PREFIX??e.apiKeyPrefix,customHeaders:mR(t.UPSTREAM_CUSTOM_HEADERS),forwardClientIdentity:t.MCP_FORWARD_CLIENT_IDENTITY?.trim()==="true",accessMode:o,oauth:t.MCP_OAUTH_RUNTIME_URL?.trim()&&t.MCP_OAUTH_CONNECTION_ID?.trim()&&t.MCP_OAUTH_RUNTIME_TOKEN?.trim()?{runtimeUrl:t.MCP_OAUTH_RUNTIME_URL.trim(),connectionId:t.MCP_OAUTH_CONNECTION_ID.trim(),mode:t.MCP_OAUTH_MODE?.trim()==="perMember"?"perMember":"shared",applyToAllTools:t.MCP_OAUTH_APPLY_ALL?.trim()==="true",toolOverrides:pR(t.MCP_OAUTH_TOOL_OVERRIDES)}:null,memberKey:r?{runtimeUrl:t.MCP_MEMBER_KEY_RUNTIME_URL.trim(),connectPageUrl:t.MCP_MEMBER_KEY_CONNECT_URL?.trim()||null}:null,runtimeAuth:o==="public"?null:{audience:Ur("MCP_RUNTIME_AUTH_AUDIENCE",t.MCP_RUNTIME_AUTH_AUDIENCE),deploymentId:Ur("MCP_RUNTIME_AUTH_DEPLOYMENT_ID",t.MCP_RUNTIME_AUTH_DEPLOYMENT_ID),deploymentVersion:fR(t.MCP_RUNTIME_AUTH_DEPLOYMENT_VERSION),issuer:Ur("MCP_RUNTIME_AUTH_ISSUER",t.MCP_RUNTIME_AUTH_ISSUER),organizationId:Ur("MCP_RUNTIME_AUTH_ORGANIZATION_ID",t.MCP_RUNTIME_AUTH_ORGANIZATION_ID),publicKey:Ur("MCP_RUNTIME_AUTH_PUBLIC_KEY",t.MCP_RUNTIME_AUTH_PUBLIC_KEY),publicKeyPrevious:t.MCP_RUNTIME_AUTH_PUBLIC_KEY_PREVIOUS?.trim()||null,publicKeyPreviousUntil:t.MCP_RUNTIME_AUTH_PUBLIC_KEY_PREVIOUS_UNTIL?.trim()||null,serverId:Ur("MCP_RUNTIME_AUTH_SERVER_ID",t.MCP_RUNTIME_AUTH_SERVER_ID)}}}async function qu(e,t){if(!e.oauth)throw Error("OAuth runtime settings are not available for this generated server.");if(!Mu)throw Error("OAuth runtime credentials are not configured for this deployment.");return fetch(e.oauth.runtimeUrl,{method:"POST",headers:new Headers({"Content-Type":"application/json","x-mcpcloud-runtime-token":Mu}),body:JSON.stringify(t)})}async function f_(e,t){if(!e.memberKey)throw Error("Per-member upstream key settings are not available for this generated server.");if(!Aa)throw Error("Per-member upstream key credentials are not configured for this deployment.");return fetch(e.memberKey.runtimeUrl,{method:"POST",headers:new Headers({"Content-Type":"application/json","x-mcpcloud-runtime-token":Aa}),body:JSON.stringify(t)})}var{create:hR,defineProperty:qa,getOwnPropertyDescriptor:gR,getOwnPropertyNames:vR,getPrototypeOf:_R}=Object,SR=Object.prototype.hasOwnProperty,h_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),g_=(e,t)=>{let n={};for(var o in e)qa(n,o,{get:e[o],enumerable:!0});if(t)qa(n,Symbol.toStringTag,{value:"Module"});return n},yR=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var r=vR(t),i=0,a=r.length,s;i<a;i++)if(s=r[i],!SR.call(e,s)&&s!==n)qa(e,s,{get:((c)=>t[c]).bind(null,s),enumerable:!(o=gR(t,s))||o.enumerable})}return e},v_=(e,t,n)=>(n=e!=null?hR(_R(e)):{},yR(t||!e||!e.__esModule?qa(n,"default",{value:e,enumerable:!0}):n,e));var bR=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),__=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),$R=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),RR=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function S_(e){return typeof e==="string"&&__.has(e.replace(/#$/,""))}function y_(e,t){if(!("$schema"in e)||typeof e.$schema!=="string")return"2020-12";let n=e.$schema.replace(/#$/,"");if(bR.has(n))return"2020-12";if(__.has(n))return"2019-09";if($R.has(n)||RR.has(n))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Ti={};Ut(Ti,{$brand:()=>Lu,$input:()=>Qp,$output:()=>Xp,NEVER:()=>Fo,TimePrecision:()=>of,ZodAny:()=>Kh,ZodArray:()=>Bh,ZodBase64:()=>uc,ZodBase64URL:()=>dc,ZodBigInt:()=>Hn,ZodBigIntFormat:()=>fc,ZodBoolean:()=>Bn,ZodCIDRv4:()=>cc,ZodCIDRv6:()=>lc,ZodCUID:()=>tc,ZodCUID2:()=>rc,ZodCatch:()=>pg,ZodCodec:()=>Ri,ZodCustom:()=>zi,ZodCustomStringFormat:()=>Vn,ZodDate:()=>Si,ZodDefault:()=>sg,ZodDiscriminatedUnion:()=>Yh,ZodE164:()=>mc,ZodEmail:()=>Ws,ZodEmoji:()=>Qs,ZodEnum:()=>Zn,ZodError:()=>FT,ZodExactOptional:()=>og,ZodFile:()=>rg,ZodFirstPartyTypeKind:()=>Tg,ZodFunction:()=>$g,ZodGUID:()=>hi,ZodIPv4:()=>ac,ZodIPv6:()=>sc,ZodISODate:()=>Fs,ZodISODateTime:()=>Ks,ZodISODuration:()=>Bs,ZodISOTime:()=>Js,ZodIntersection:()=>Gh,ZodIssueCode:()=>xg,ZodJWT:()=>pc,ZodKSUID:()=>ic,ZodLazy:()=>yg,ZodLiteral:()=>tg,ZodMAC:()=>qh,ZodMap:()=>Qh,ZodNaN:()=>hg,ZodNanoID:()=>ec,ZodNever:()=>Vh,ZodNonOptional:()=>Sc,ZodNull:()=>Zh,ZodNullable:()=>ag,ZodNumber:()=>Jn,ZodNumberFormat:()=>Yr,ZodObject:()=>yi,ZodOptional:()=>_c,ZodPipe:()=>$i,ZodPrefault:()=>lg,ZodPreprocess:()=>gg,ZodPromise:()=>bg,ZodReadonly:()=>vg,ZodRealError:()=>He,ZodRecord:()=>Dn,ZodSet:()=>eg,ZodString:()=>Kn,ZodStringFormat:()=>pe,ZodSuccess:()=>mg,ZodSymbol:()=>Lh,ZodTemplateLiteral:()=>Sg,ZodTransform:()=>ng,ZodTuple:()=>Wh,ZodType:()=>se,ZodULID:()=>nc,ZodURL:()=>_i,ZodUUID:()=>It,ZodUndefined:()=>Dh,ZodUnion:()=>bi,ZodUnknown:()=>Fh,ZodVoid:()=>Jh,ZodXID:()=>oc,ZodXor:()=>Hh,_ZodString:()=>Gs,_default:()=>cg,_function:()=>vy,any:()=>hc,array:()=>v,base64:()=>AS,base64url:()=>MS,bigint:()=>HS,boolean:()=>N,catch:()=>fg,check:()=>_y,cidrv4:()=>NS,cidrv6:()=>jS,clone:()=>Ue,codec:()=>py,coerce:()=>yc,config:()=>ge,core:()=>Dt,cuid:()=>xS,cuid2:()=>kS,custom:()=>Sy,date:()=>ey,decode:()=>Oh,decodeAsync:()=>Nh,describe:()=>yy,discriminatedUnion:()=>dr,e164:()=>US,email:()=>Xs,emoji:()=>zS,encode:()=>Ph,encodeAsync:()=>Ch,endsWith:()=>On,enum:()=>Q,exactOptional:()=>ig,file:()=>ly,flattenError:()=>Qo,float32:()=>FS,float64:()=>VS,formatError:()=>ei,fromJSONSchema:()=>xy,function:()=>vy,getErrorMap:()=>BT,globalRegistry:()=>xe,gt:()=>Et,gte:()=>Le,guid:()=>_S,hash:()=>KS,hex:()=>ZS,hostname:()=>DS,httpUrl:()=>RS,includes:()=>In,instanceof:()=>$y,int:()=>Hs,int32:()=>JS,int64:()=>YS,intersection:()=>ft,invertCodec:()=>fy,ipv4:()=>PS,ipv6:()=>CS,iso:()=>ur,json:()=>zy,jwt:()=>qS,keyof:()=>ty,ksuid:()=>IS,lazy:()=>mr,length:()=>Jr,literal:()=>S,locales:()=>ui,looseObject:()=>H,looseRecord:()=>iy,lowercase:()=>En,lt:()=>kt,lte:()=>et,mac:()=>OS,map:()=>ay,maxLength:()=>Vr,maxSize:()=>ar,meta:()=>by,mime:()=>Cn,minLength:()=>Lt,minSize:()=>wt,multipleOf:()=>ir,nan:()=>my,nanoid:()=>TS,nativeEnum:()=>cy,negative:()=>js,never:()=>gc,nonnegative:()=>Ms,nonoptional:()=>dg,nonpositive:()=>As,normalize:()=>Nn,null:()=>pt,nullable:()=>gi,nullish:()=>uy,number:()=>x,object:()=>f,optional:()=>F,overwrite:()=>mt,parse:()=>Eh,parseAsync:()=>wh,partialRecord:()=>oy,pipe:()=>Ys,positive:()=>Ns,prefault:()=>ug,preprocess:()=>Zt,prettifyError:()=>Wu,promise:()=>gy,property:()=>Us,readonly:()=>_g,record:()=>C,refine:()=>Rg,regex:()=>kn,regexes:()=>qt,registry:()=>ps,safeDecode:()=>Ah,safeDecodeAsync:()=>Uh,safeEncode:()=>jh,safeEncodeAsync:()=>Mh,safeParse:()=>fi,safeParseAsync:()=>Ih,set:()=>sy,setErrorMap:()=>JT,size:()=>Fr,slugify:()=>Un,startsWith:()=>Pn,strictObject:()=>ry,string:()=>l,stringFormat:()=>LS,stringbool:()=>Ry,success:()=>dy,superRefine:()=>zg,symbol:()=>WS,templateLiteral:()=>hy,toJSONSchema:()=>Br,toLowerCase:()=>An,toUpperCase:()=>Mn,transform:()=>vc,treeifyError:()=>Gu,trim:()=>jn,tuple:()=>Xh,uint32:()=>BS,uint64:()=>GS,ulid:()=>ES,undefined:()=>XS,union:()=>j,unknown:()=>Z,uppercase:()=>wn,url:()=>Fn,util:()=>J,uuid:()=>SS,uuidv4:()=>yS,uuidv6:()=>bS,uuidv7:()=>$S,void:()=>QS,xid:()=>wS,xor:()=>ny});var Dt={};Ut(Dt,{$ZodAny:()=>Tm,$ZodArray:()=>Im,$ZodAsyncError:()=>Tt,$ZodBase64:()=>hm,$ZodBase64URL:()=>gm,$ZodBigInt:()=>ls,$ZodBigIntFormat:()=>bm,$ZodBoolean:()=>ni,$ZodCIDRv4:()=>mm,$ZodCIDRv6:()=>pm,$ZodCUID:()=>em,$ZodCUID2:()=>tm,$ZodCatch:()=>Hm,$ZodCheck:()=>fe,$ZodCheckBigIntFormat:()=>Id,$ZodCheckEndsWith:()=>Zd,$ZodCheckGreaterThan:()=>rs,$ZodCheckIncludes:()=>Ld,$ZodCheckLengthEquals:()=>Ad,$ZodCheckLessThan:()=>ts,$ZodCheckLowerCase:()=>Ud,$ZodCheckMaxLength:()=>Nd,$ZodCheckMaxSize:()=>Pd,$ZodCheckMimeType:()=>Fd,$ZodCheckMinLength:()=>jd,$ZodCheckMinSize:()=>Od,$ZodCheckMultipleOf:()=>Ed,$ZodCheckNumberFormat:()=>wd,$ZodCheckOverwrite:()=>Vd,$ZodCheckProperty:()=>Kd,$ZodCheckRegex:()=>Md,$ZodCheckSizeEquals:()=>Cd,$ZodCheckStartsWith:()=>Dd,$ZodCheckStringFormat:()=>Tn,$ZodCheckUpperCase:()=>qd,$ZodCodec:()=>ii,$ZodCustom:()=>rp,$ZodCustomStringFormat:()=>Sm,$ZodDate:()=>wm,$ZodDefault:()=>Fm,$ZodDiscriminatedUnion:()=>Cm,$ZodE164:()=>vm,$ZodEmail:()=>Gd,$ZodEmoji:()=>Xd,$ZodEncodeError:()=>Lr,$ZodEnum:()=>Um,$ZodError:()=>Xo,$ZodExactOptional:()=>Zm,$ZodFile:()=>Lm,$ZodFunction:()=>Qm,$ZodGUID:()=>Hd,$ZodIPv4:()=>lm,$ZodIPv6:()=>um,$ZodISODate:()=>am,$ZodISODateTime:()=>im,$ZodISODuration:()=>cm,$ZodISOTime:()=>sm,$ZodIntersection:()=>Nm,$ZodJWT:()=>_m,$ZodKSUID:()=>om,$ZodLazy:()=>tp,$ZodLiteral:()=>qm,$ZodMAC:()=>dm,$ZodMap:()=>Am,$ZodNaN:()=>Ym,$ZodNanoID:()=>Qd,$ZodNever:()=>km,$ZodNonOptional:()=>Jm,$ZodNull:()=>zm,$ZodNullable:()=>Km,$ZodNumber:()=>cs,$ZodNumberFormat:()=>ym,$ZodObject:()=>cS,$ZodObjectJIT:()=>Pm,$ZodOptional:()=>ds,$ZodPipe:()=>ms,$ZodPrefault:()=>Vm,$ZodPreprocess:()=>Gm,$ZodPromise:()=>ep,$ZodReadonly:()=>Wm,$ZodRealError:()=>Be,$ZodRecord:()=>jm,$ZodRegistry:()=>ef,$ZodSet:()=>Mm,$ZodString:()=>Kr,$ZodStringFormat:()=>me,$ZodSuccess:()=>Bm,$ZodSymbol:()=>$m,$ZodTemplateLiteral:()=>Xm,$ZodTransform:()=>Dm,$ZodTuple:()=>us,$ZodType:()=>re,$ZodULID:()=>rm,$ZodURL:()=>Wd,$ZodUUID:()=>Yd,$ZodUndefined:()=>Rm,$ZodUnion:()=>oi,$ZodUnknown:()=>xm,$ZodVoid:()=>Em,$ZodXID:()=>nm,$ZodXor:()=>Om,$brand:()=>Lu,$constructor:()=>g,$input:()=>Qp,$output:()=>Xp,Doc:()=>ns,JSONSchema:()=>hS,JSONSchemaGenerator:()=>Th,NEVER:()=>Fo,TimePrecision:()=>of,_any:()=>xf,_array:()=>Cf,_base64:()=>Is,_base64url:()=>Ps,_bigint:()=>Sf,_boolean:()=>vf,_catch:()=>AT,_check:()=>fS,_cidrv4:()=>Es,_cidrv6:()=>ws,_coercedBigint:()=>yf,_coercedBoolean:()=>_f,_coercedDate:()=>Pf,_coercedNumber:()=>df,_coercedString:()=>rf,_cuid:()=>bs,_cuid2:()=>$s,_custom:()=>jf,_date:()=>If,_decode:()=>Va,_decodeAsync:()=>Ba,_default:()=>CT,_discriminatedUnion:()=>bT,_e164:()=>Os,_email:()=>fs,_emoji:()=>Ss,_encode:()=>Fa,_encodeAsync:()=>Ja,_endsWith:()=>On,_enum:()=>kT,_file:()=>Nf,_float32:()=>pf,_float64:()=>ff,_gt:()=>Et,_gte:()=>Le,_guid:()=>di,_includes:()=>In,_int:()=>mf,_int32:()=>hf,_int64:()=>bf,_intersection:()=>$T,_ipv4:()=>xs,_ipv6:()=>ks,_isoDate:()=>sf,_isoDateTime:()=>af,_isoDuration:()=>lf,_isoTime:()=>cf,_jwt:()=>Cs,_ksuid:()=>Ts,_lazy:()=>LT,_length:()=>Jr,_literal:()=>wT,_lowercase:()=>En,_lt:()=>kt,_lte:()=>et,_mac:()=>nf,_map:()=>TT,_max:()=>et,_maxLength:()=>Vr,_maxSize:()=>ar,_mime:()=>Cn,_min:()=>Le,_minLength:()=>Lt,_minSize:()=>wt,_multipleOf:()=>ir,_nan:()=>Of,_nanoid:()=>ys,_nativeEnum:()=>ET,_negative:()=>js,_never:()=>Ef,_nonnegative:()=>Ms,_nonoptional:()=>NT,_nonpositive:()=>As,_normalize:()=>Nn,_null:()=>Tf,_nullable:()=>OT,_number:()=>uf,_optional:()=>PT,_overwrite:()=>mt,_parse:()=>bn,_parseAsync:()=>$n,_pipe:()=>MT,_positive:()=>Ns,_promise:()=>DT,_property:()=>Us,_readonly:()=>UT,_record:()=>zT,_refine:()=>Af,_regex:()=>kn,_safeDecode:()=>Ya,_safeDecodeAsync:()=>Wa,_safeEncode:()=>Ha,_safeEncodeAsync:()=>Ga,_safeParse:()=>Rn,_safeParseAsync:()=>zn,_set:()=>xT,_size:()=>Fr,_slugify:()=>Un,_startsWith:()=>Pn,_string:()=>tf,_stringFormat:()=>qn,_stringbool:()=>Lf,_success:()=>jT,_superRefine:()=>Mf,_symbol:()=>Rf,_templateLiteral:()=>qT,_toLowerCase:()=>An,_toUpperCase:()=>Mn,_transform:()=>IT,_trim:()=>jn,_tuple:()=>RT,_uint32:()=>gf,_uint64:()=>$f,_ulid:()=>Rs,_undefined:()=>zf,_union:()=>ST,_unknown:()=>kf,_uppercase:()=>wn,_url:()=>mi,_uuid:()=>hs,_uuidv4:()=>gs,_uuidv6:()=>vs,_uuidv7:()=>_s,_void:()=>wf,_xid:()=>zs,_xor:()=>yT,clone:()=>Ue,config:()=>ge,createStandardJSONSchemaMethod:()=>Ln,createToJSONSchemaMethod:()=>Df,decode:()=>FR,decodeAsync:()=>JR,describe:()=>Uf,encode:()=>KR,encodeAsync:()=>VR,extractDefs:()=>cr,finalize:()=>lr,flattenError:()=>Qo,formatError:()=>ei,globalConfig:()=>qr,globalRegistry:()=>xe,initializeContext:()=>sr,isValidBase64:()=>fm,isValidBase64URL:()=>oS,isValidJWT:()=>iS,locales:()=>ui,meta:()=>qf,parse:()=>Za,parseAsync:()=>Ka,prettifyError:()=>Wu,process:()=>de,regexes:()=>qt,registry:()=>ps,safeDecode:()=>HR,safeDecodeAsync:()=>GR,safeEncode:()=>BR,safeEncodeAsync:()=>YR,safeParse:()=>Xu,safeParseAsync:()=>Qu,toDotPath:()=>N_,toJSONSchema:()=>Br,treeifyError:()=>Gu,util:()=>J,version:()=>Jd});var b_,Fo=Object.freeze({status:"aborted"});function g(e,t,n){function o(s,c){if(!s._zod)Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1});if(s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);let u=a.prototype,d=Object.keys(u);for(let m=0;m<d.length;m++){let p=d[m];if(!(p in s))s[p]=u[p].bind(s)}}let r=n?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function a(s){var c;let u=n?.Parent?new i:this;o(u,s),(c=u._zod).deferred??(c.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:(s)=>{if(n?.Parent&&s instanceof n.Parent)return!0;return s?._zod?.traits?.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}var Lu=Symbol("zod_brand");class Tt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lr extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(b_=globalThis).__zod_globalConfig??(b_.__zod_globalConfig={});var qr=globalThis.__zod_globalConfig;function ge(e){if(e)Object.assign(qr,e);return qr}var J={};Ut(J,{BIGINT_FORMAT_RANGES:()=>Hu,Class:()=>O_,NUMBER_FORMAT_RANGES:()=>Bu,aborted:()=>nr,allowsEval:()=>Fu,assert:()=>ER,assertEqual:()=>zR,assertIs:()=>xR,assertNever:()=>kR,assertNotEqual:()=>TR,assignProp:()=>tr,base64ToUint8Array:()=>I_,base64urlToUint8Array:()=>UR,cached:()=>yn,captureStackTrace:()=>Da,cleanEnum:()=>MR,cleanRegex:()=>Bo,clone:()=>Ue,cloneDef:()=>IR,createTransparentProxy:()=>AR,defineLazy:()=>le,esc:()=>La,escapeRegex:()=>st,explicitlyAborted:()=>Yu,extend:()=>T_,finalizeIssue:()=>qe,floatSafeRemainder:()=>Zu,getElementAtPath:()=>PR,getEnumValues:()=>Jo,getLengthableOrigin:()=>Wo,getParsedType:()=>jR,getSizableOrigin:()=>Go,hexToUint8Array:()=>LR,isObject:()=>Dr,isPlainObject:()=>rr,issue:()=>or,joinValues:()=>y,jsonStringifyReplacer:()=>Sn,merge:()=>k_,mergeDefs:()=>xt,normalizeParams:()=>T,nullish:()=>er,numKeys:()=>NR,objectClone:()=>wR,omit:()=>z_,optionalKeys:()=>Ju,parsedType:()=>w,partial:()=>E_,pick:()=>R_,prefixIssues:()=>Je,primitiveTypes:()=>Vu,promiseAllObject:()=>OR,propertyKeyTypes:()=>Yo,randomString:()=>CR,required:()=>w_,safeExtend:()=>x_,shallowClone:()=>Ho,slugify:()=>Ku,stringifyPrimitive:()=>k,uint8ArrayToBase64:()=>P_,uint8ArrayToBase64url:()=>qR,uint8ArrayToHex:()=>DR,unwrapMessage:()=>Vo});function zR(e){return e}function TR(e){return e}function xR(e){}function kR(e){throw Error("Unexpected value in exhaustive check")}function ER(e){}function Jo(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function y(e,t="|"){return e.map((n)=>k(n)).join(t)}function Sn(e,t){if(typeof t==="bigint")return t.toString();return t}function yn(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function er(e){return e===null||e===void 0}function Bo(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Zu(e,t){let n=e/t,o=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);if(Math.abs(n-o)<r)return 0;return n-o}var $_=Symbol("evaluating");function le(e,t,n){let o=void 0;Object.defineProperty(e,t,{get(){if(o===$_)return;if(o===void 0)o=$_,o=n();return o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function wR(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function tr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function xt(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function IR(e){return xt(e._zod.def)}function PR(e,t){if(!t)return e;return t.reduce((n,o)=>n?.[o],e)}function OR(e){let t=Object.keys(e),n=t.map((o)=>e[o]);return Promise.all(n).then((o)=>{let r={};for(let i=0;i<t.length;i++)r[t[i]]=o[i];return r})}function CR(e=10){let n="";for(let o=0;o<e;o++)n+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return n}function La(e){return JSON.stringify(e)}function Ku(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Da="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Dr(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var Fu=yn(()=>{if(qr.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function rr(e){if(Dr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let n=t.prototype;if(Dr(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function Ho(e){if(rr(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}function NR(e){let t=0;for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n))t++;return t}var jR=(e)=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},Yo=new Set(["string","number","symbol"]),Vu=new Set(["string","number","bigint","boolean","symbol","undefined"]);function st(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ue(e,t,n){let o=new e._zod.constr(t??e._zod.def);if(!t||n?.parent)o._zod.parent=e;return o}function T(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function AR(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,i){return t??(t=e()),Reflect.set(t,o,r,i)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function k(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Ju(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Bu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Hu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function R_(e,t){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=xt(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in n.shape))throw Error(`Unrecognized key: "${s}"`);if(!t[s])continue;a[s]=n.shape[s]}return tr(this,"shape",a),a},checks:[]});return Ue(e,i)}function z_(e,t){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=xt(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in n.shape))throw Error(`Unrecognized key: "${s}"`);if(!t[s])continue;delete a[s]}return tr(this,"shape",a),a},checks:[]});return Ue(e,i)}function T_(e,t){if(!rr(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=xt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return tr(this,"shape",i),i}});return Ue(e,r)}function x_(e,t){if(!rr(t))throw Error("Invalid input to safeExtend: expected a plain object");let n=xt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return tr(this,"shape",o),o}});return Ue(e,n)}function k_(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=xt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return tr(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ue(e,n)}function E_(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let a=xt(t._zod.def,{get shape(){let s=t._zod.def.shape,c={...s};if(n)for(let u in n){if(!(u in s))throw Error(`Unrecognized key: "${u}"`);if(!n[u])continue;c[u]=e?new e({type:"optional",innerType:s[u]}):s[u]}else for(let u in s)c[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return tr(this,"shape",c),c},checks:[]});return Ue(t,a)}function w_(e,t,n){let o=xt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let a in n){if(!(a in i))throw Error(`Unrecognized key: "${a}"`);if(!n[a])continue;i[a]=new e({type:"nonoptional",innerType:r[a]})}else for(let a in r)i[a]=new e({type:"nonoptional",innerType:r[a]});return tr(this,"shape",i),i}});return Ue(t,o)}function nr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Yu(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Je(e,t){return t.map((n)=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Vo(e){return typeof e==="string"?e:e?.message}function qe(e,t,n){let o=e.message?e.message:Vo(e.inst?._zod.def?.error?.(e))??Vo(t?.error?.(e))??Vo(n.customError?.(e))??Vo(n.localeError?.(e))??"Invalid input",{inst:r,continue:i,input:a,...s}=e;if(s.path??(s.path=[]),s.message=o,t?.reportInput)s.input=a;return s}function Go(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function Wo(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function w(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function or(...e){let[t,n,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:n,inst:o};return{...t}}function MR(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map((t)=>t[1])}function I_(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function P_(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function UR(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return I_(t+n)}function qR(e){return P_(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function LR(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function DR(e){return Array.from(e).map((t)=>t.toString(16).padStart(2,"0")).join("")}class O_{constructor(...e){}}var C_=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Sn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xo=g("$ZodError",C_),Be=g("$ZodError",C_,{Parent:Error});function Qo(e,t=(n)=>n.message){let n={},o=[];for(let r of e.issues)if(r.path.length>0)n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r));else o.push(t(r));return{formErrors:o,fieldErrors:n}}function ei(e,t=(n)=>n.message){let n={_errors:[]},o=(r,i=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map((s)=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)n._errors.push(t(a));else{let c=n,u=0;while(u<s.length){let d=s[u];if(u!==s.length-1)c[d]=c[d]||{_errors:[]};else c[d]=c[d]||{_errors:[]},c[d]._errors.push(t(a));c=c[d],u++}}}};return o(e),n}function Gu(e,t=(n)=>n.message){let n={errors:[]},o=(r,i=[])=>{var a,s;for(let c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map((u)=>o({issues:u},[...i,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...i,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...i,...c.path]);else{let u=[...i,...c.path];if(u.length===0){n.errors.push(t(c));continue}let d=n,m=0;while(m<u.length){let p=u[m],h=m===u.length-1;if(typeof p==="string")d.properties??(d.properties={}),(a=d.properties)[p]??(a[p]={errors:[]}),d=d.properties[p];else d.items??(d.items=[]),(s=d.items)[p]??(s[p]={errors:[]}),d=d.items[p];if(h)d.errors.push(t(c));m++}}};return o(e),n}function N_(e){let t=[],n=e.map((o)=>typeof o==="object"?o.key:o);for(let o of n)if(typeof o==="number")t.push(`[${o}]`);else if(typeof o==="symbol")t.push(`[${JSON.stringify(String(o))}]`);else if(/[^\w$]/.test(o))t.push(`[${JSON.stringify(o)}]`);else{if(t.length)t.push(".");t.push(o)}return t.join("")}function Wu(e){let t=[],n=[...e.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(let o of n)if(t.push(`✖ ${o.message}`),o.path?.length)t.push(` → at ${N_(o.path)}`);return t.join(`
3
- `)}var bn=(e)=>(t,n,o,r)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Tt;if(a.issues.length){let s=new(r?.Err??e)(a.issues.map((c)=>qe(c,i,ge())));throw Da(s,r?.callee),s}return a.value},Za=bn(Be),$n=(e)=>async(t,n,o,r)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let s=new(r?.Err??e)(a.issues.map((c)=>qe(c,i,ge())));throw Da(s,r?.callee),s}return a.value},Ka=$n(Be),Rn=(e)=>(t,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new Tt;return i.issues.length?{success:!1,error:new(e??Xo)(i.issues.map((a)=>qe(a,r,ge())))}:{success:!0,data:i.value}},Xu=Rn(Be),zn=(e)=>async(t,n,o)=>{let r=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((a)=>qe(a,r,ge())))}:{success:!0,data:i.value}},Qu=zn(Be),Fa=(e)=>(t,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return bn(e)(t,n,r)},KR=Fa(Be),Va=(e)=>(t,n,o)=>bn(e)(t,n,o),FR=Va(Be),Ja=(e)=>async(t,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return $n(e)(t,n,r)},VR=Ja(Be),Ba=(e)=>async(t,n,o)=>$n(e)(t,n,o),JR=Ba(Be),Ha=(e)=>(t,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return Rn(e)(t,n,r)},BR=Ha(Be),Ya=(e)=>(t,n,o)=>Rn(e)(t,n,o),HR=Ya(Be),Ga=(e)=>async(t,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return zn(e)(t,n,r)},YR=Ga(Be),Wa=(e)=>async(t,n,o)=>zn(e)(t,n,o),GR=Wa(Be);var qt={};Ut(qt,{base64:()=>hd,base64url:()=>Xa,bigint:()=>bd,boolean:()=>Rd,browserEmail:()=>oz,cidrv4:()=>pd,cidrv6:()=>fd,cuid:()=>ed,cuid2:()=>td,date:()=>vd,datetime:()=>Sd,domain:()=>M_,duration:()=>ad,e164:()=>gd,email:()=>cd,emoji:()=>ld,extendedDuration:()=>WR,guid:()=>sd,hex:()=>L_,hostname:()=>A_,html5Email:()=>tz,httpProtocol:()=>Qa,idnEmail:()=>nz,integer:()=>$d,ipv4:()=>ud,ipv6:()=>dd,ksuid:()=>od,lowercase:()=>xd,mac:()=>md,md5_base64:()=>sz,md5_base64url:()=>cz,md5_hex:()=>az,nanoid:()=>id,null:()=>zd,number:()=>es,rfc5322Email:()=>rz,sha1_base64:()=>uz,sha1_base64url:()=>dz,sha1_hex:()=>lz,sha256_base64:()=>pz,sha256_base64url:()=>fz,sha256_hex:()=>mz,sha384_base64:()=>gz,sha384_base64url:()=>vz,sha384_hex:()=>hz,sha512_base64:()=>Sz,sha512_base64url:()=>yz,sha512_hex:()=>_z,string:()=>yd,time:()=>_d,ulid:()=>rd,undefined:()=>Td,unicodeEmail:()=>j_,uppercase:()=>kd,uuid:()=>Zr,uuid4:()=>XR,uuid6:()=>QR,uuid7:()=>ez,xid:()=>nd});var ed=/^[cC][0-9a-z]{6,}$/,td=/^[0-9a-z]+$/,rd=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nd=/^[0-9a-vA-V]{20}$/,od=/^[A-Za-z0-9]{27}$/,id=/^[a-zA-Z0-9_-]{21}$/,ad=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,WR=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,sd=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Zr=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},XR=Zr(4),QR=Zr(6),ez=Zr(7),cd=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tz=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,rz=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,j_=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,nz=j_,oz=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,iz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ld(){return new RegExp(iz,"u")}var ud=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dd=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,md=(e)=>{let t=st(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},pd=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,fd=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,hd=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xa=/^[A-Za-z0-9_-]*$/,A_=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,M_=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Qa=/^https?$/,gd=/^\+[1-9]\d{6,14}$/,U_="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",vd=new RegExp(`^${U_}$`);function q_(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function _d(e){return new RegExp(`^${q_(e)}$`)}function Sd(e){let t=q_({precision:e.precision}),n=["Z"];if(e.local)n.push("");if(e.offset)n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${U_}T(?:${o})$`)}var yd=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},bd=/^-?\d+n?$/,$d=/^-?\d+$/,es=/^-?\d+(?:\.\d+)?$/,Rd=/^(?:true|false)$/i,zd=/^null$/i;var Td=/^undefined$/i;var xd=/^[^A-Z]*$/,kd=/^[^a-z]*$/,L_=/^[0-9a-fA-F]*$/;function ti(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ri(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var az=/^[0-9a-fA-F]{32}$/,sz=ti(22,"=="),cz=ri(22),lz=/^[0-9a-fA-F]{40}$/,uz=ti(27,"="),dz=ri(27),mz=/^[0-9a-fA-F]{64}$/,pz=ti(43,"="),fz=ri(43),hz=/^[0-9a-fA-F]{96}$/,gz=ti(64,""),vz=ri(64),_z=/^[0-9a-fA-F]{128}$/,Sz=ti(86,"=="),yz=ri(86);var fe=g("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Z_={number:"number",bigint:"bigint",object:"date"},ts=g("$ZodCheckLessThan",(e,t)=>{fe.init(e,t);let n=Z_[typeof t.value];e._zod.onattach.push((o)=>{let r=o._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<i)if(t.inclusive)r.maximum=t.value;else r.exclusiveMaximum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:n,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rs=g("$ZodCheckGreaterThan",(e,t)=>{fe.init(e,t);let n=Z_[typeof t.value];e._zod.onattach.push((o)=>{let r=o._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>i)if(t.inclusive)r.minimum=t.value;else r.exclusiveMinimum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:n,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ed=g("$ZodCheckMultipleOf",(e,t)=>{fe.init(e,t),e._zod.onattach.push((n)=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=(n)=>{if(typeof n.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof n.value==="bigint"?n.value%t.value===BigInt(0):Zu(n.value,t.value)===0)return;n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),wd=g("$ZodCheckNumberFormat",(e,t)=>{fe.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),o=n?"int":"number",[r,i]=Bu[t.format];e._zod.onattach.push((a)=>{let s=a._zod.bag;if(s.format=t.format,s.minimum=r,s.maximum=i,n)s.pattern=$d}),e._zod.check=(a)=>{let s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){if(s>0)a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(s<r)a.issues.push({origin:"number",input:s,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort});if(s>i)a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Id=g("$ZodCheckBigIntFormat",(e,t)=>{fe.init(e,t);let[n,o]=Hu[t.format];e._zod.onattach.push((r)=>{let i=r._zod.bag;i.format=t.format,i.minimum=n,i.maximum=o}),e._zod.check=(r)=>{let i=r.value;if(i<n)r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(i>o)r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Pd=g("$ZodCheckMaxSize",(e,t)=>{var n;fe.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!er(r)&&r.size!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<r)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let r=o.value;if(r.size<=t.maximum)return;o.issues.push({origin:Go(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Od=g("$ZodCheckMinSize",(e,t)=>{var n;fe.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!er(r)&&r.size!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>r)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let r=o.value;if(r.size>=t.minimum)return;o.issues.push({origin:Go(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Cd=g("$ZodCheckSizeEquals",(e,t)=>{var n;fe.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!er(r)&&r.size!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=(o)=>{let r=o.value,i=r.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:Go(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Nd=g("$ZodCheckMaxLength",(e,t)=>{var n;fe.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!er(r)&&r.length!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<r)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let r=o.value;if(r.length<=t.maximum)return;let a=Wo(r);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jd=g("$ZodCheckMinLength",(e,t)=>{var n;fe.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!er(r)&&r.length!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>r)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let r=o.value;if(r.length>=t.minimum)return;let a=Wo(r);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ad=g("$ZodCheckLengthEquals",(e,t)=>{var n;fe.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!er(r)&&r.length!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=(o)=>{let r=o.value,i=r.length;if(i===t.length)return;let a=Wo(r),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Tn=g("$ZodCheckStringFormat",(e,t)=>{var n,o;if(fe.init(e,t),e._zod.onattach.push((r)=>{let i=r._zod.bag;if(i.format=t.format,t.pattern)i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern)}),t.pattern)(n=e._zod).check??(n.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(o=e._zod).check??(o.check=()=>{})}),Md=g("$ZodCheckRegex",(e,t)=>{Tn.init(e,t),e._zod.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ud=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=xd),Tn.init(e,t)}),qd=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=kd),Tn.init(e,t)}),Ld=g("$ZodCheckIncludes",(e,t)=>{fe.init(e,t);let n=st(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push((r)=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=(r)=>{if(r.value.includes(t.includes,t.position))return;r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Dd=g("$ZodCheckStartsWith",(e,t)=>{fe.init(e,t);let n=new RegExp(`^${st(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Zd=g("$ZodCheckEndsWith",(e,t)=>{fe.init(e,t);let n=new RegExp(`.*${st(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function D_(e,t,n){if(e.issues.length)t.issues.push(...Je(n,e.issues))}var Kd=g("$ZodCheckProperty",(e,t)=>{fe.init(e,t),e._zod.check=(n)=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then((r)=>D_(r,n,t.property));D_(o,n,t.property);return}}),Fd=g("$ZodCheckMimeType",(e,t)=>{fe.init(e,t);let n=new Set(t.mime);e._zod.onattach.push((o)=>{o._zod.bag.mime=t.mime}),e._zod.check=(o)=>{if(n.has(o.value.type))return;o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Vd=g("$ZodCheckOverwrite",(e,t)=>{fe.init(e,t),e._zod.check=(n)=>{n.value=t.tx(n.value)}});class ns{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
1
+ /*! @mcpcloud/runtime v0.19.1 — (c) MCPCloud.sh. All rights reserved. SEE LICENSE: https://www.npmjs.com/package/@mcpcloud/runtime */
2
+ var _R=Object.defineProperty;var SR=(e)=>e;function yR(e,t){this[e]=SR.bind(null,t)}var Ut=(e,t)=>{for(var n in t)_R(e,n,{get:t[n],enumerable:!0,configurable:!0,set:yR.bind(t,n)})};function Uu(){return typeof process>"u"?{}:process.env}var Mu=null,Aa=null;function bR(e){if(!e?.trim())return{};let t=JSON.parse(e);if(!t||typeof t!=="object"||Array.isArray(t))throw Error("UPSTREAM_CUSTOM_HEADERS must be a JSON object.");return Object.entries(t).reduce((n,[o,r])=>{if(typeof r==="string"&&r.trim())n[o]=r;return n},{})}function $R(e){if(!e?.trim())return{};try{let t=JSON.parse(e);if(!t||typeof t!=="object"||Array.isArray(t))return{};return Object.entries(t).reduce((n,[o,r])=>{if(r==="on"||r==="off")n[o]=r;return n},{})}catch{return{}}}function Ur(e,t){let n=t?.trim();if(!n)throw Error(`Set ${e} before starting the generated MCP server.`);return n}function RR(e){let t=Number.parseInt(Ur("MCP_RUNTIME_AUTH_DEPLOYMENT_VERSION",e),10);if(!Number.isFinite(t)||t<=0)throw Error("MCP_RUNTIME_AUTH_DEPLOYMENT_VERSION must be a positive integer.");return t}function Ma(e=Uu()){let t=e.MCP_RUNTIME_AUTH_ACCESS_MODE?.trim();return t==="privateOrg"||t==="unlisted"?t:"public"}function Ua(e,t=Uu()){let n=t.UPSTREAM_BASE_URL?.trim()||e.defaultUpstreamBaseUrl||"";if(e.defaultUpstreamBaseUrl&&!n)throw Error("Set UPSTREAM_BASE_URL before starting the generated MCP server.");let o=Ma(t);Mu=t.MCP_OAUTH_RUNTIME_TOKEN?.trim()||null,Aa=t.MCP_MEMBER_KEY_RUNTIME_TOKEN?.trim()||null;let r=t.MCP_MEMBER_KEY_MODE?.trim()==="perMember"&&Boolean(t.MCP_MEMBER_KEY_RUNTIME_URL?.trim())&&Boolean(Aa);return{serverName:e.serverName,serverVersion:e.serverVersion,upstreamBaseUrl:n,apiKey:t.UPSTREAM_API_KEY?.trim()||null,apiKeyHeader:t.UPSTREAM_API_KEY_HEADER?.trim()||e.apiKeyHeader,apiKeyPrefix:t.UPSTREAM_API_KEY_PREFIX??e.apiKeyPrefix,customHeaders:bR(t.UPSTREAM_CUSTOM_HEADERS),forwardClientIdentity:t.MCP_FORWARD_CLIENT_IDENTITY?.trim()==="true",catalogSessions:t.MCP_CATALOG_SESSIONS?.trim()==="true",accessMode:o,oauth:t.MCP_OAUTH_RUNTIME_URL?.trim()&&t.MCP_OAUTH_CONNECTION_ID?.trim()&&t.MCP_OAUTH_RUNTIME_TOKEN?.trim()?{runtimeUrl:t.MCP_OAUTH_RUNTIME_URL.trim(),connectionId:t.MCP_OAUTH_CONNECTION_ID.trim(),mode:t.MCP_OAUTH_MODE?.trim()==="perMember"?"perMember":"shared",applyToAllTools:t.MCP_OAUTH_APPLY_ALL?.trim()==="true",toolOverrides:$R(t.MCP_OAUTH_TOOL_OVERRIDES)}:null,memberKey:r?{runtimeUrl:t.MCP_MEMBER_KEY_RUNTIME_URL.trim(),connectPageUrl:t.MCP_MEMBER_KEY_CONNECT_URL?.trim()||null}:null,runtimeAuth:o==="public"?null:{audience:Ur("MCP_RUNTIME_AUTH_AUDIENCE",t.MCP_RUNTIME_AUTH_AUDIENCE),deploymentId:Ur("MCP_RUNTIME_AUTH_DEPLOYMENT_ID",t.MCP_RUNTIME_AUTH_DEPLOYMENT_ID),deploymentVersion:RR(t.MCP_RUNTIME_AUTH_DEPLOYMENT_VERSION),issuer:Ur("MCP_RUNTIME_AUTH_ISSUER",t.MCP_RUNTIME_AUTH_ISSUER),organizationId:Ur("MCP_RUNTIME_AUTH_ORGANIZATION_ID",t.MCP_RUNTIME_AUTH_ORGANIZATION_ID),publicKey:Ur("MCP_RUNTIME_AUTH_PUBLIC_KEY",t.MCP_RUNTIME_AUTH_PUBLIC_KEY),publicKeyPrevious:t.MCP_RUNTIME_AUTH_PUBLIC_KEY_PREVIOUS?.trim()||null,publicKeyPreviousUntil:t.MCP_RUNTIME_AUTH_PUBLIC_KEY_PREVIOUS_UNTIL?.trim()||null,serverId:Ur("MCP_RUNTIME_AUTH_SERVER_ID",t.MCP_RUNTIME_AUTH_SERVER_ID)}}}async function qu(e,t){if(!e.oauth)throw Error("OAuth runtime settings are not available for this generated server.");if(!Mu)throw Error("OAuth runtime credentials are not configured for this deployment.");return fetch(e.oauth.runtimeUrl,{method:"POST",headers:new Headers({"Content-Type":"application/json","x-mcpcloud-runtime-token":Mu}),body:JSON.stringify(t)})}async function f_(e,t){if(!e.memberKey)throw Error("Per-member upstream key settings are not available for this generated server.");if(!Aa)throw Error("Per-member upstream key credentials are not configured for this deployment.");return fetch(e.memberKey.runtimeUrl,{method:"POST",headers:new Headers({"Content-Type":"application/json","x-mcpcloud-runtime-token":Aa}),body:JSON.stringify(t)})}var{create:zR,defineProperty:qa,getOwnPropertyDescriptor:TR,getOwnPropertyNames:xR,getPrototypeOf:kR}=Object,ER=Object.prototype.hasOwnProperty,h_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),g_=(e,t)=>{let n={};for(var o in e)qa(n,o,{get:e[o],enumerable:!0});if(t)qa(n,Symbol.toStringTag,{value:"Module"});return n},wR=(e,t,n,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var r=xR(t),i=0,a=r.length,s;i<a;i++)if(s=r[i],!ER.call(e,s)&&s!==n)qa(e,s,{get:((c)=>t[c]).bind(null,s),enumerable:!(o=TR(t,s))||o.enumerable})}return e},v_=(e,t,n)=>(n=e!=null?zR(kR(e)):{},wR(t||!e||!e.__esModule?qa(n,"default",{value:e,enumerable:!0}):n,e));var IR=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),__=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),PR=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),OR=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function S_(e){return typeof e==="string"&&__.has(e.replace(/#$/,""))}function y_(e,t){if(!("$schema"in e)||typeof e.$schema!=="string")return"2020-12";let n=e.$schema.replace(/#$/,"");if(IR.has(n))return"2020-12";if(__.has(n))return"2019-09";if(PR.has(n)||OR.has(n))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Ti={};Ut(Ti,{$brand:()=>Lu,$input:()=>Qp,$output:()=>Xp,NEVER:()=>Ko,TimePrecision:()=>of,ZodAny:()=>Fh,ZodArray:()=>Bh,ZodBase64:()=>uc,ZodBase64URL:()=>dc,ZodBigInt:()=>Hn,ZodBigIntFormat:()=>fc,ZodBoolean:()=>Bn,ZodCIDRv4:()=>cc,ZodCIDRv6:()=>lc,ZodCUID:()=>tc,ZodCUID2:()=>rc,ZodCatch:()=>pg,ZodCodec:()=>Ri,ZodCustom:()=>zi,ZodCustomStringFormat:()=>Jn,ZodDate:()=>Si,ZodDefault:()=>sg,ZodDiscriminatedUnion:()=>Yh,ZodE164:()=>mc,ZodEmail:()=>Ws,ZodEmoji:()=>Qs,ZodEnum:()=>Zn,ZodError:()=>QT,ZodExactOptional:()=>og,ZodFile:()=>rg,ZodFirstPartyTypeKind:()=>Tg,ZodFunction:()=>$g,ZodGUID:()=>hi,ZodIPv4:()=>ac,ZodIPv6:()=>sc,ZodISODate:()=>Ks,ZodISODateTime:()=>Fs,ZodISODuration:()=>Bs,ZodISOTime:()=>Vs,ZodIntersection:()=>Gh,ZodIssueCode:()=>xg,ZodJWT:()=>pc,ZodKSUID:()=>ic,ZodLazy:()=>yg,ZodLiteral:()=>tg,ZodMAC:()=>qh,ZodMap:()=>Qh,ZodNaN:()=>hg,ZodNanoID:()=>ec,ZodNever:()=>Jh,ZodNonOptional:()=>Sc,ZodNull:()=>Zh,ZodNullable:()=>ag,ZodNumber:()=>Vn,ZodNumberFormat:()=>Yr,ZodObject:()=>yi,ZodOptional:()=>_c,ZodPipe:()=>$i,ZodPrefault:()=>lg,ZodPreprocess:()=>gg,ZodPromise:()=>bg,ZodReadonly:()=>vg,ZodRealError:()=>He,ZodRecord:()=>Dn,ZodSet:()=>eg,ZodString:()=>Fn,ZodStringFormat:()=>pe,ZodSuccess:()=>mg,ZodSymbol:()=>Lh,ZodTemplateLiteral:()=>Sg,ZodTransform:()=>ng,ZodTuple:()=>Wh,ZodType:()=>se,ZodULID:()=>nc,ZodURL:()=>_i,ZodUUID:()=>It,ZodUndefined:()=>Dh,ZodUnion:()=>bi,ZodUnknown:()=>Kh,ZodVoid:()=>Vh,ZodXID:()=>oc,ZodXor:()=>Hh,_ZodString:()=>Gs,_default:()=>cg,_function:()=>vy,any:()=>hc,array:()=>v,base64:()=>AS,base64url:()=>MS,bigint:()=>HS,boolean:()=>j,catch:()=>fg,check:()=>_y,cidrv4:()=>NS,cidrv6:()=>jS,clone:()=>Ue,codec:()=>py,coerce:()=>yc,config:()=>ge,core:()=>Dt,cuid:()=>xS,cuid2:()=>kS,custom:()=>Sy,date:()=>ey,decode:()=>Oh,decodeAsync:()=>Nh,describe:()=>yy,discriminatedUnion:()=>dr,e164:()=>US,email:()=>Xs,emoji:()=>zS,encode:()=>Ph,encodeAsync:()=>Ch,endsWith:()=>On,enum:()=>Q,exactOptional:()=>ig,file:()=>ly,flattenError:()=>Qo,float32:()=>KS,float64:()=>JS,formatError:()=>ei,fromJSONSchema:()=>xy,function:()=>vy,getErrorMap:()=>rx,globalRegistry:()=>xe,gt:()=>Et,gte:()=>Le,guid:()=>_S,hash:()=>FS,hex:()=>ZS,hostname:()=>DS,httpUrl:()=>RS,includes:()=>In,instanceof:()=>$y,int:()=>Hs,int32:()=>VS,int64:()=>YS,intersection:()=>ft,invertCodec:()=>fy,ipv4:()=>PS,ipv6:()=>CS,iso:()=>ur,json:()=>zy,jwt:()=>qS,keyof:()=>ty,ksuid:()=>IS,lazy:()=>mr,length:()=>Vr,literal:()=>S,locales:()=>ui,looseObject:()=>H,looseRecord:()=>iy,lowercase:()=>En,lt:()=>kt,lte:()=>et,mac:()=>OS,map:()=>ay,maxLength:()=>Jr,maxSize:()=>ar,meta:()=>by,mime:()=>Cn,minLength:()=>Lt,minSize:()=>wt,multipleOf:()=>ir,nan:()=>my,nanoid:()=>TS,nativeEnum:()=>cy,negative:()=>js,never:()=>gc,nonnegative:()=>Ms,nonoptional:()=>dg,nonpositive:()=>As,normalize:()=>Nn,null:()=>pt,nullable:()=>gi,nullish:()=>uy,number:()=>x,object:()=>f,optional:()=>K,overwrite:()=>mt,parse:()=>Eh,parseAsync:()=>wh,partialRecord:()=>oy,pipe:()=>Ys,positive:()=>Ns,prefault:()=>ug,preprocess:()=>Zt,prettifyError:()=>Wu,promise:()=>gy,property:()=>Us,readonly:()=>_g,record:()=>C,refine:()=>Rg,regex:()=>kn,regexes:()=>qt,registry:()=>ps,safeDecode:()=>Ah,safeDecodeAsync:()=>Uh,safeEncode:()=>jh,safeEncodeAsync:()=>Mh,safeParse:()=>fi,safeParseAsync:()=>Ih,set:()=>sy,setErrorMap:()=>tx,size:()=>Kr,slugify:()=>Un,startsWith:()=>Pn,strictObject:()=>ry,string:()=>l,stringFormat:()=>LS,stringbool:()=>Ry,success:()=>dy,superRefine:()=>zg,symbol:()=>WS,templateLiteral:()=>hy,toJSONSchema:()=>Br,toLowerCase:()=>An,toUpperCase:()=>Mn,transform:()=>vc,treeifyError:()=>Gu,trim:()=>jn,tuple:()=>Xh,uint32:()=>BS,uint64:()=>GS,ulid:()=>ES,undefined:()=>XS,union:()=>A,unknown:()=>Z,uppercase:()=>wn,url:()=>Kn,util:()=>V,uuid:()=>SS,uuidv4:()=>yS,uuidv6:()=>bS,uuidv7:()=>$S,void:()=>QS,xid:()=>wS,xor:()=>ny});var Dt={};Ut(Dt,{$ZodAny:()=>Tm,$ZodArray:()=>Im,$ZodAsyncError:()=>Tt,$ZodBase64:()=>hm,$ZodBase64URL:()=>gm,$ZodBigInt:()=>ls,$ZodBigIntFormat:()=>bm,$ZodBoolean:()=>ni,$ZodCIDRv4:()=>mm,$ZodCIDRv6:()=>pm,$ZodCUID:()=>em,$ZodCUID2:()=>tm,$ZodCatch:()=>Hm,$ZodCheck:()=>fe,$ZodCheckBigIntFormat:()=>Id,$ZodCheckEndsWith:()=>Zd,$ZodCheckGreaterThan:()=>rs,$ZodCheckIncludes:()=>Ld,$ZodCheckLengthEquals:()=>Ad,$ZodCheckLessThan:()=>ts,$ZodCheckLowerCase:()=>Ud,$ZodCheckMaxLength:()=>Nd,$ZodCheckMaxSize:()=>Pd,$ZodCheckMimeType:()=>Kd,$ZodCheckMinLength:()=>jd,$ZodCheckMinSize:()=>Od,$ZodCheckMultipleOf:()=>Ed,$ZodCheckNumberFormat:()=>wd,$ZodCheckOverwrite:()=>Jd,$ZodCheckProperty:()=>Fd,$ZodCheckRegex:()=>Md,$ZodCheckSizeEquals:()=>Cd,$ZodCheckStartsWith:()=>Dd,$ZodCheckStringFormat:()=>Tn,$ZodCheckUpperCase:()=>qd,$ZodCodec:()=>ii,$ZodCustom:()=>rp,$ZodCustomStringFormat:()=>Sm,$ZodDate:()=>wm,$ZodDefault:()=>Km,$ZodDiscriminatedUnion:()=>Cm,$ZodE164:()=>vm,$ZodEmail:()=>Gd,$ZodEmoji:()=>Xd,$ZodEncodeError:()=>Lr,$ZodEnum:()=>Um,$ZodError:()=>Xo,$ZodExactOptional:()=>Zm,$ZodFile:()=>Lm,$ZodFunction:()=>Qm,$ZodGUID:()=>Hd,$ZodIPv4:()=>lm,$ZodIPv6:()=>um,$ZodISODate:()=>am,$ZodISODateTime:()=>im,$ZodISODuration:()=>cm,$ZodISOTime:()=>sm,$ZodIntersection:()=>Nm,$ZodJWT:()=>_m,$ZodKSUID:()=>om,$ZodLazy:()=>tp,$ZodLiteral:()=>qm,$ZodMAC:()=>dm,$ZodMap:()=>Am,$ZodNaN:()=>Ym,$ZodNanoID:()=>Qd,$ZodNever:()=>km,$ZodNonOptional:()=>Vm,$ZodNull:()=>zm,$ZodNullable:()=>Fm,$ZodNumber:()=>cs,$ZodNumberFormat:()=>ym,$ZodObject:()=>cS,$ZodObjectJIT:()=>Pm,$ZodOptional:()=>ds,$ZodPipe:()=>ms,$ZodPrefault:()=>Jm,$ZodPreprocess:()=>Gm,$ZodPromise:()=>ep,$ZodReadonly:()=>Wm,$ZodRealError:()=>Be,$ZodRecord:()=>jm,$ZodRegistry:()=>ef,$ZodSet:()=>Mm,$ZodString:()=>Fr,$ZodStringFormat:()=>me,$ZodSuccess:()=>Bm,$ZodSymbol:()=>$m,$ZodTemplateLiteral:()=>Xm,$ZodTransform:()=>Dm,$ZodTuple:()=>us,$ZodType:()=>re,$ZodULID:()=>rm,$ZodURL:()=>Wd,$ZodUUID:()=>Yd,$ZodUndefined:()=>Rm,$ZodUnion:()=>oi,$ZodUnknown:()=>xm,$ZodVoid:()=>Em,$ZodXID:()=>nm,$ZodXor:()=>Om,$brand:()=>Lu,$constructor:()=>g,$input:()=>Qp,$output:()=>Xp,Doc:()=>ns,JSONSchema:()=>hS,JSONSchemaGenerator:()=>Th,NEVER:()=>Ko,TimePrecision:()=>of,_any:()=>xf,_array:()=>Cf,_base64:()=>Is,_base64url:()=>Ps,_bigint:()=>Sf,_boolean:()=>vf,_catch:()=>JT,_check:()=>fS,_cidrv4:()=>Es,_cidrv6:()=>ws,_coercedBigint:()=>yf,_coercedBoolean:()=>_f,_coercedDate:()=>Pf,_coercedNumber:()=>df,_coercedString:()=>rf,_cuid:()=>bs,_cuid2:()=>$s,_custom:()=>jf,_date:()=>If,_decode:()=>Ja,_decodeAsync:()=>Ba,_default:()=>ZT,_discriminatedUnion:()=>IT,_e164:()=>Os,_email:()=>fs,_emoji:()=>Ss,_encode:()=>Ka,_encodeAsync:()=>Va,_endsWith:()=>On,_enum:()=>AT,_file:()=>Nf,_float32:()=>pf,_float64:()=>ff,_gt:()=>Et,_gte:()=>Le,_guid:()=>di,_includes:()=>In,_int:()=>mf,_int32:()=>hf,_int64:()=>bf,_intersection:()=>PT,_ipv4:()=>xs,_ipv6:()=>ks,_isoDate:()=>sf,_isoDateTime:()=>af,_isoDuration:()=>lf,_isoTime:()=>cf,_jwt:()=>Cs,_ksuid:()=>Ts,_lazy:()=>YT,_length:()=>Vr,_literal:()=>UT,_lowercase:()=>En,_lt:()=>kt,_lte:()=>et,_mac:()=>nf,_map:()=>NT,_max:()=>et,_maxLength:()=>Jr,_maxSize:()=>ar,_mime:()=>Cn,_min:()=>Le,_minLength:()=>Lt,_minSize:()=>wt,_multipleOf:()=>ir,_nan:()=>Of,_nanoid:()=>ys,_nativeEnum:()=>MT,_negative:()=>js,_never:()=>Ef,_nonnegative:()=>Ms,_nonoptional:()=>FT,_nonpositive:()=>As,_normalize:()=>Nn,_null:()=>Tf,_nullable:()=>DT,_number:()=>uf,_optional:()=>LT,_overwrite:()=>mt,_parse:()=>bn,_parseAsync:()=>$n,_pipe:()=>VT,_positive:()=>Ns,_promise:()=>GT,_property:()=>Us,_readonly:()=>BT,_record:()=>CT,_refine:()=>Af,_regex:()=>kn,_safeDecode:()=>Ya,_safeDecodeAsync:()=>Wa,_safeEncode:()=>Ha,_safeEncodeAsync:()=>Ga,_safeParse:()=>Rn,_safeParseAsync:()=>zn,_set:()=>jT,_size:()=>Kr,_slugify:()=>Un,_startsWith:()=>Pn,_string:()=>tf,_stringFormat:()=>qn,_stringbool:()=>Lf,_success:()=>KT,_superRefine:()=>Mf,_symbol:()=>Rf,_templateLiteral:()=>HT,_toLowerCase:()=>An,_toUpperCase:()=>Mn,_transform:()=>qT,_trim:()=>jn,_tuple:()=>OT,_uint32:()=>gf,_uint64:()=>$f,_ulid:()=>Rs,_undefined:()=>zf,_union:()=>ET,_unknown:()=>kf,_uppercase:()=>wn,_url:()=>mi,_uuid:()=>hs,_uuidv4:()=>gs,_uuidv6:()=>vs,_uuidv7:()=>_s,_void:()=>wf,_xid:()=>zs,_xor:()=>wT,clone:()=>Ue,config:()=>ge,createStandardJSONSchemaMethod:()=>Ln,createToJSONSchemaMethod:()=>Df,decode:()=>QR,decodeAsync:()=>tz,describe:()=>Uf,encode:()=>XR,encodeAsync:()=>ez,extractDefs:()=>cr,finalize:()=>lr,flattenError:()=>Qo,formatError:()=>ei,globalConfig:()=>qr,globalRegistry:()=>xe,initializeContext:()=>sr,isValidBase64:()=>fm,isValidBase64URL:()=>oS,isValidJWT:()=>iS,locales:()=>ui,meta:()=>qf,parse:()=>Za,parseAsync:()=>Fa,prettifyError:()=>Wu,process:()=>de,regexes:()=>qt,registry:()=>ps,safeDecode:()=>nz,safeDecodeAsync:()=>iz,safeEncode:()=>rz,safeEncodeAsync:()=>oz,safeParse:()=>Xu,safeParseAsync:()=>Qu,toDotPath:()=>N_,toJSONSchema:()=>Br,treeifyError:()=>Gu,util:()=>V,version:()=>Vd});var b_,Ko=Object.freeze({status:"aborted"});function g(e,t,n){function o(s,c){if(!s._zod)Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1});if(s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);let u=a.prototype,d=Object.keys(u);for(let m=0;m<d.length;m++){let p=d[m];if(!(p in s))s[p]=u[p].bind(s)}}let r=n?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function a(s){var c;let u=n?.Parent?new i:this;o(u,s),(c=u._zod).deferred??(c.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:(s)=>{if(n?.Parent&&s instanceof n.Parent)return!0;return s?._zod?.traits?.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}var Lu=Symbol("zod_brand");class Tt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lr extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(b_=globalThis).__zod_globalConfig??(b_.__zod_globalConfig={});var qr=globalThis.__zod_globalConfig;function ge(e){if(e)Object.assign(qr,e);return qr}var V={};Ut(V,{BIGINT_FORMAT_RANGES:()=>Hu,Class:()=>O_,NUMBER_FORMAT_RANGES:()=>Bu,aborted:()=>nr,allowsEval:()=>Ku,assert:()=>MR,assertEqual:()=>CR,assertIs:()=>jR,assertNever:()=>AR,assertNotEqual:()=>NR,assignProp:()=>tr,base64ToUint8Array:()=>I_,base64urlToUint8Array:()=>BR,cached:()=>yn,captureStackTrace:()=>Da,cleanEnum:()=>VR,cleanRegex:()=>Bo,clone:()=>Ue,cloneDef:()=>qR,createTransparentProxy:()=>JR,defineLazy:()=>le,esc:()=>La,escapeRegex:()=>st,explicitlyAborted:()=>Yu,extend:()=>T_,finalizeIssue:()=>qe,floatSafeRemainder:()=>Zu,getElementAtPath:()=>LR,getEnumValues:()=>Vo,getLengthableOrigin:()=>Wo,getParsedType:()=>KR,getSizableOrigin:()=>Go,hexToUint8Array:()=>YR,isObject:()=>Dr,isPlainObject:()=>rr,issue:()=>or,joinValues:()=>y,jsonStringifyReplacer:()=>Sn,merge:()=>k_,mergeDefs:()=>xt,normalizeParams:()=>T,nullish:()=>er,numKeys:()=>FR,objectClone:()=>UR,omit:()=>z_,optionalKeys:()=>Vu,parsedType:()=>w,partial:()=>E_,pick:()=>R_,prefixIssues:()=>Ve,primitiveTypes:()=>Ju,promiseAllObject:()=>DR,propertyKeyTypes:()=>Yo,randomString:()=>ZR,required:()=>w_,safeExtend:()=>x_,shallowClone:()=>Ho,slugify:()=>Fu,stringifyPrimitive:()=>k,uint8ArrayToBase64:()=>P_,uint8ArrayToBase64url:()=>HR,uint8ArrayToHex:()=>GR,unwrapMessage:()=>Jo});function CR(e){return e}function NR(e){return e}function jR(e){}function AR(e){throw Error("Unexpected value in exhaustive check")}function MR(e){}function Vo(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function y(e,t="|"){return e.map((n)=>k(n)).join(t)}function Sn(e,t){if(typeof t==="bigint")return t.toString();return t}function yn(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function er(e){return e===null||e===void 0}function Bo(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Zu(e,t){let n=e/t,o=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);if(Math.abs(n-o)<r)return 0;return n-o}var $_=Symbol("evaluating");function le(e,t,n){let o=void 0;Object.defineProperty(e,t,{get(){if(o===$_)return;if(o===void 0)o=$_,o=n();return o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function UR(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function tr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function xt(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function qR(e){return xt(e._zod.def)}function LR(e,t){if(!t)return e;return t.reduce((n,o)=>n?.[o],e)}function DR(e){let t=Object.keys(e),n=t.map((o)=>e[o]);return Promise.all(n).then((o)=>{let r={};for(let i=0;i<t.length;i++)r[t[i]]=o[i];return r})}function ZR(e=10){let n="";for(let o=0;o<e;o++)n+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return n}function La(e){return JSON.stringify(e)}function Fu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Da="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Dr(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var Ku=yn(()=>{if(qr.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function rr(e){if(Dr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let n=t.prototype;if(Dr(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function Ho(e){if(rr(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}function FR(e){let t=0;for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n))t++;return t}var KR=(e)=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},Yo=new Set(["string","number","symbol"]),Ju=new Set(["string","number","bigint","boolean","symbol","undefined"]);function st(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ue(e,t,n){let o=new e._zod.constr(t??e._zod.def);if(!t||n?.parent)o._zod.parent=e;return o}function T(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function JR(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,i){return t??(t=e()),Reflect.set(t,o,r,i)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function k(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Vu(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Bu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Hu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function R_(e,t){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=xt(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in n.shape))throw Error(`Unrecognized key: "${s}"`);if(!t[s])continue;a[s]=n.shape[s]}return tr(this,"shape",a),a},checks:[]});return Ue(e,i)}function z_(e,t){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=xt(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in n.shape))throw Error(`Unrecognized key: "${s}"`);if(!t[s])continue;delete a[s]}return tr(this,"shape",a),a},checks:[]});return Ue(e,i)}function T_(e,t){if(!rr(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=xt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return tr(this,"shape",i),i}});return Ue(e,r)}function x_(e,t){if(!rr(t))throw Error("Invalid input to safeExtend: expected a plain object");let n=xt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return tr(this,"shape",o),o}});return Ue(e,n)}function k_(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=xt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return tr(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ue(e,n)}function E_(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let a=xt(t._zod.def,{get shape(){let s=t._zod.def.shape,c={...s};if(n)for(let u in n){if(!(u in s))throw Error(`Unrecognized key: "${u}"`);if(!n[u])continue;c[u]=e?new e({type:"optional",innerType:s[u]}):s[u]}else for(let u in s)c[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return tr(this,"shape",c),c},checks:[]});return Ue(t,a)}function w_(e,t,n){let o=xt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let a in n){if(!(a in i))throw Error(`Unrecognized key: "${a}"`);if(!n[a])continue;i[a]=new e({type:"nonoptional",innerType:r[a]})}else for(let a in r)i[a]=new e({type:"nonoptional",innerType:r[a]});return tr(this,"shape",i),i}});return Ue(t,o)}function nr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Yu(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Ve(e,t){return t.map((n)=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Jo(e){return typeof e==="string"?e:e?.message}function qe(e,t,n){let o=e.message?e.message:Jo(e.inst?._zod.def?.error?.(e))??Jo(t?.error?.(e))??Jo(n.customError?.(e))??Jo(n.localeError?.(e))??"Invalid input",{inst:r,continue:i,input:a,...s}=e;if(s.path??(s.path=[]),s.message=o,t?.reportInput)s.input=a;return s}function Go(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function Wo(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function w(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function or(...e){let[t,n,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:n,inst:o};return{...t}}function VR(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map((t)=>t[1])}function I_(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function P_(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function BR(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return I_(t+n)}function HR(e){return P_(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function YR(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function GR(e){return Array.from(e).map((t)=>t.toString(16).padStart(2,"0")).join("")}class O_{constructor(...e){}}var C_=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Sn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xo=g("$ZodError",C_),Be=g("$ZodError",C_,{Parent:Error});function Qo(e,t=(n)=>n.message){let n={},o=[];for(let r of e.issues)if(r.path.length>0)n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r));else o.push(t(r));return{formErrors:o,fieldErrors:n}}function ei(e,t=(n)=>n.message){let n={_errors:[]},o=(r,i=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map((s)=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)n._errors.push(t(a));else{let c=n,u=0;while(u<s.length){let d=s[u];if(u!==s.length-1)c[d]=c[d]||{_errors:[]};else c[d]=c[d]||{_errors:[]},c[d]._errors.push(t(a));c=c[d],u++}}}};return o(e),n}function Gu(e,t=(n)=>n.message){let n={errors:[]},o=(r,i=[])=>{var a,s;for(let c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map((u)=>o({issues:u},[...i,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...i,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...i,...c.path]);else{let u=[...i,...c.path];if(u.length===0){n.errors.push(t(c));continue}let d=n,m=0;while(m<u.length){let p=u[m],h=m===u.length-1;if(typeof p==="string")d.properties??(d.properties={}),(a=d.properties)[p]??(a[p]={errors:[]}),d=d.properties[p];else d.items??(d.items=[]),(s=d.items)[p]??(s[p]={errors:[]}),d=d.items[p];if(h)d.errors.push(t(c));m++}}};return o(e),n}function N_(e){let t=[],n=e.map((o)=>typeof o==="object"?o.key:o);for(let o of n)if(typeof o==="number")t.push(`[${o}]`);else if(typeof o==="symbol")t.push(`[${JSON.stringify(String(o))}]`);else if(/[^\w$]/.test(o))t.push(`[${JSON.stringify(o)}]`);else{if(t.length)t.push(".");t.push(o)}return t.join("")}function Wu(e){let t=[],n=[...e.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(let o of n)if(t.push(`✖ ${o.message}`),o.path?.length)t.push(` → at ${N_(o.path)}`);return t.join(`
3
+ `)}var bn=(e)=>(t,n,o,r)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Tt;if(a.issues.length){let s=new(r?.Err??e)(a.issues.map((c)=>qe(c,i,ge())));throw Da(s,r?.callee),s}return a.value},Za=bn(Be),$n=(e)=>async(t,n,o,r)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let s=new(r?.Err??e)(a.issues.map((c)=>qe(c,i,ge())));throw Da(s,r?.callee),s}return a.value},Fa=$n(Be),Rn=(e)=>(t,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new Tt;return i.issues.length?{success:!1,error:new(e??Xo)(i.issues.map((a)=>qe(a,r,ge())))}:{success:!0,data:i.value}},Xu=Rn(Be),zn=(e)=>async(t,n,o)=>{let r=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((a)=>qe(a,r,ge())))}:{success:!0,data:i.value}},Qu=zn(Be),Ka=(e)=>(t,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return bn(e)(t,n,r)},XR=Ka(Be),Ja=(e)=>(t,n,o)=>bn(e)(t,n,o),QR=Ja(Be),Va=(e)=>async(t,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return $n(e)(t,n,r)},ez=Va(Be),Ba=(e)=>async(t,n,o)=>$n(e)(t,n,o),tz=Ba(Be),Ha=(e)=>(t,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return Rn(e)(t,n,r)},rz=Ha(Be),Ya=(e)=>(t,n,o)=>Rn(e)(t,n,o),nz=Ya(Be),Ga=(e)=>async(t,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return zn(e)(t,n,r)},oz=Ga(Be),Wa=(e)=>async(t,n,o)=>zn(e)(t,n,o),iz=Wa(Be);var qt={};Ut(qt,{base64:()=>hd,base64url:()=>Xa,bigint:()=>bd,boolean:()=>Rd,browserEmail:()=>pz,cidrv4:()=>pd,cidrv6:()=>fd,cuid:()=>ed,cuid2:()=>td,date:()=>vd,datetime:()=>Sd,domain:()=>M_,duration:()=>ad,e164:()=>gd,email:()=>cd,emoji:()=>ld,extendedDuration:()=>az,guid:()=>sd,hex:()=>L_,hostname:()=>A_,html5Email:()=>uz,httpProtocol:()=>Qa,idnEmail:()=>mz,integer:()=>$d,ipv4:()=>ud,ipv6:()=>dd,ksuid:()=>od,lowercase:()=>xd,mac:()=>md,md5_base64:()=>gz,md5_base64url:()=>vz,md5_hex:()=>hz,nanoid:()=>id,null:()=>zd,number:()=>es,rfc5322Email:()=>dz,sha1_base64:()=>Sz,sha1_base64url:()=>yz,sha1_hex:()=>_z,sha256_base64:()=>$z,sha256_base64url:()=>Rz,sha256_hex:()=>bz,sha384_base64:()=>Tz,sha384_base64url:()=>xz,sha384_hex:()=>zz,sha512_base64:()=>Ez,sha512_base64url:()=>wz,sha512_hex:()=>kz,string:()=>yd,time:()=>_d,ulid:()=>rd,undefined:()=>Td,unicodeEmail:()=>j_,uppercase:()=>kd,uuid:()=>Zr,uuid4:()=>sz,uuid6:()=>cz,uuid7:()=>lz,xid:()=>nd});var ed=/^[cC][0-9a-z]{6,}$/,td=/^[0-9a-z]+$/,rd=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nd=/^[0-9a-vA-V]{20}$/,od=/^[A-Za-z0-9]{27}$/,id=/^[a-zA-Z0-9_-]{21}$/,ad=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,az=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,sd=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Zr=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},sz=Zr(4),cz=Zr(6),lz=Zr(7),cd=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uz=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,dz=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,j_=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,mz=j_,pz=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,fz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ld(){return new RegExp(fz,"u")}var ud=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dd=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,md=(e)=>{let t=st(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},pd=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,fd=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,hd=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xa=/^[A-Za-z0-9_-]*$/,A_=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,M_=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Qa=/^https?$/,gd=/^\+[1-9]\d{6,14}$/,U_="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",vd=new RegExp(`^${U_}$`);function q_(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function _d(e){return new RegExp(`^${q_(e)}$`)}function Sd(e){let t=q_({precision:e.precision}),n=["Z"];if(e.local)n.push("");if(e.offset)n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${U_}T(?:${o})$`)}var yd=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},bd=/^-?\d+n?$/,$d=/^-?\d+$/,es=/^-?\d+(?:\.\d+)?$/,Rd=/^(?:true|false)$/i,zd=/^null$/i;var Td=/^undefined$/i;var xd=/^[^A-Z]*$/,kd=/^[^a-z]*$/,L_=/^[0-9a-fA-F]*$/;function ti(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ri(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var hz=/^[0-9a-fA-F]{32}$/,gz=ti(22,"=="),vz=ri(22),_z=/^[0-9a-fA-F]{40}$/,Sz=ti(27,"="),yz=ri(27),bz=/^[0-9a-fA-F]{64}$/,$z=ti(43,"="),Rz=ri(43),zz=/^[0-9a-fA-F]{96}$/,Tz=ti(64,""),xz=ri(64),kz=/^[0-9a-fA-F]{128}$/,Ez=ti(86,"=="),wz=ri(86);var fe=g("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Z_={number:"number",bigint:"bigint",object:"date"},ts=g("$ZodCheckLessThan",(e,t)=>{fe.init(e,t);let n=Z_[typeof t.value];e._zod.onattach.push((o)=>{let r=o._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<i)if(t.inclusive)r.maximum=t.value;else r.exclusiveMaximum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:n,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rs=g("$ZodCheckGreaterThan",(e,t)=>{fe.init(e,t);let n=Z_[typeof t.value];e._zod.onattach.push((o)=>{let r=o._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>i)if(t.inclusive)r.minimum=t.value;else r.exclusiveMinimum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:n,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ed=g("$ZodCheckMultipleOf",(e,t)=>{fe.init(e,t),e._zod.onattach.push((n)=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=(n)=>{if(typeof n.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof n.value==="bigint"?n.value%t.value===BigInt(0):Zu(n.value,t.value)===0)return;n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),wd=g("$ZodCheckNumberFormat",(e,t)=>{fe.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),o=n?"int":"number",[r,i]=Bu[t.format];e._zod.onattach.push((a)=>{let s=a._zod.bag;if(s.format=t.format,s.minimum=r,s.maximum=i,n)s.pattern=$d}),e._zod.check=(a)=>{let s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){if(s>0)a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(s<r)a.issues.push({origin:"number",input:s,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort});if(s>i)a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Id=g("$ZodCheckBigIntFormat",(e,t)=>{fe.init(e,t);let[n,o]=Hu[t.format];e._zod.onattach.push((r)=>{let i=r._zod.bag;i.format=t.format,i.minimum=n,i.maximum=o}),e._zod.check=(r)=>{let i=r.value;if(i<n)r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(i>o)r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Pd=g("$ZodCheckMaxSize",(e,t)=>{var n;fe.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!er(r)&&r.size!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<r)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let r=o.value;if(r.size<=t.maximum)return;o.issues.push({origin:Go(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Od=g("$ZodCheckMinSize",(e,t)=>{var n;fe.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!er(r)&&r.size!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>r)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let r=o.value;if(r.size>=t.minimum)return;o.issues.push({origin:Go(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Cd=g("$ZodCheckSizeEquals",(e,t)=>{var n;fe.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!er(r)&&r.size!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=(o)=>{let r=o.value,i=r.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:Go(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Nd=g("$ZodCheckMaxLength",(e,t)=>{var n;fe.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!er(r)&&r.length!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<r)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let r=o.value;if(r.length<=t.maximum)return;let a=Wo(r);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jd=g("$ZodCheckMinLength",(e,t)=>{var n;fe.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!er(r)&&r.length!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>r)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let r=o.value;if(r.length>=t.minimum)return;let a=Wo(r);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ad=g("$ZodCheckLengthEquals",(e,t)=>{var n;fe.init(e,t),(n=e._zod.def).when??(n.when=(o)=>{let r=o.value;return!er(r)&&r.length!==void 0}),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=(o)=>{let r=o.value,i=r.length;if(i===t.length)return;let a=Wo(r),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Tn=g("$ZodCheckStringFormat",(e,t)=>{var n,o;if(fe.init(e,t),e._zod.onattach.push((r)=>{let i=r._zod.bag;if(i.format=t.format,t.pattern)i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern)}),t.pattern)(n=e._zod).check??(n.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(o=e._zod).check??(o.check=()=>{})}),Md=g("$ZodCheckRegex",(e,t)=>{Tn.init(e,t),e._zod.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ud=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=xd),Tn.init(e,t)}),qd=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=kd),Tn.init(e,t)}),Ld=g("$ZodCheckIncludes",(e,t)=>{fe.init(e,t);let n=st(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push((r)=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=(r)=>{if(r.value.includes(t.includes,t.position))return;r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Dd=g("$ZodCheckStartsWith",(e,t)=>{fe.init(e,t);let n=new RegExp(`^${st(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Zd=g("$ZodCheckEndsWith",(e,t)=>{fe.init(e,t);let n=new RegExp(`.*${st(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((o)=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function D_(e,t,n){if(e.issues.length)t.issues.push(...Ve(n,e.issues))}var Fd=g("$ZodCheckProperty",(e,t)=>{fe.init(e,t),e._zod.check=(n)=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then((r)=>D_(r,n,t.property));D_(o,n,t.property);return}}),Kd=g("$ZodCheckMimeType",(e,t)=>{fe.init(e,t);let n=new Set(t.mime);e._zod.onattach.push((o)=>{o._zod.bag.mime=t.mime}),e._zod.check=(o)=>{if(n.has(o.value.type))return;o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Jd=g("$ZodCheckOverwrite",(e,t)=>{fe.init(e,t),e._zod.check=(n)=>{n.value=t.tx(n.value)}});class ns{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
4
4
  `).filter((i)=>i),o=Math.min(...n.map((i)=>i.length-i.trimStart().length)),r=n.map((i)=>i.slice(o)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of r)this.content.push(i)}compile(){let e=Function,t=this?.args,o=[...(this?.content??[""]).map((r)=>` ${r}`)];return new e(...t,o.join(`
5
- `))}}var Jd={major:4,minor:4,patch:3};var re=g("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Jd;let o=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))o.unshift(e);for(let r of o)for(let i of r._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(a,s,c)=>{let u=nr(a),d;for(let m of s){if(m._zod.def.when){if(Yu(a))continue;if(!m._zod.def.when(a))continue}else if(u)continue;let p=a.issues.length,h=m._zod.check(a);if(h instanceof Promise&&c?.async===!1)throw new Tt;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await h,a.issues.length===p)return;if(!u)u=nr(a,p)});else{if(a.issues.length===p)continue;if(!u)u=nr(a,p)}}if(d)return d.then(()=>a);return a},i=(a,s,c)=>{if(nr(a))return a.aborted=!0,a;let u=r(s,o,c);if(u instanceof Promise){if(c.async===!1)throw new Tt;return u.then((d)=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});if(u instanceof Promise)return u.then((d)=>i(d,a,s));return i(u,a,s)}let c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new Tt;return c.then((u)=>r(u,o,s))}return r(c,o,s)}}le(e,"~standard",()=>({validate:(r)=>{try{let i=Xu(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return Qu(e,r).then((a)=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Kr=g("$ZodString",(e,t)=>{re.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??yd(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),me=g("$ZodStringFormat",(e,t)=>{Tn.init(e,t),Kr.init(e,t)}),Hd=g("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=sd),me.init(e,t)}),Yd=g("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Zr(o))}else t.pattern??(t.pattern=Zr());me.init(e,t)}),Gd=g("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cd),me.init(e,t)}),Wd=g("$ZodURL",(e,t)=>{me.init(e,t),e._zod.check=(n)=>{try{let o=n.value.trim();if(!t.normalize&&t.protocol?.source===Qa.source){if(!/^https?:\/\//i.test(o)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}}let r=new URL(o);if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(r.hostname))n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol))n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})}if(t.normalize)n.value=r.href;else n.value=o;return}catch(o){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Xd=g("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ld()),me.init(e,t)}),Qd=g("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=id),me.init(e,t)}),em=g("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ed),me.init(e,t)}),tm=g("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=td),me.init(e,t)}),rm=g("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rd),me.init(e,t)}),nm=g("$ZodXID",(e,t)=>{t.pattern??(t.pattern=nd),me.init(e,t)}),om=g("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=od),me.init(e,t)}),im=g("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Sd(t)),me.init(e,t)}),am=g("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=vd),me.init(e,t)}),sm=g("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=_d(t)),me.init(e,t)}),cm=g("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ad),me.init(e,t)}),lm=g("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ud),me.init(e,t),e._zod.bag.format="ipv4"}),um=g("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=dd),me.init(e,t),e._zod.bag.format="ipv6",e._zod.check=(n)=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),dm=g("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=md(t.delimiter)),me.init(e,t),e._zod.bag.format="mac"}),mm=g("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=pd),me.init(e,t)}),pm=g("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=fd),me.init(e,t),e._zod.check=(n)=>{let o=n.value.split("/");try{if(o.length!==2)throw Error();let[r,i]=o;if(!i)throw Error();let a=Number(i);if(`${a}`!==i)throw Error();if(a<0||a>128)throw Error();new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function fm(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var hm=g("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=hd),me.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(n)=>{if(fm(n.value))return;n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function oS(e){if(!Xa.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fm(n)}var gm=g("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Xa),me.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(n)=>{if(oS(n.value))return;n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),vm=g("$ZodE164",(e,t)=>{t.pattern??(t.pattern=gd),me.init(e,t)});function iS(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));if("typ"in r&&r?.typ!=="JWT")return!1;if(!r.alg)return!1;if(t&&(!("alg"in r)||r.alg!==t))return!1;return!0}catch{return!1}}var _m=g("$ZodJWT",(e,t)=>{me.init(e,t),e._zod.check=(n)=>{if(iS(n.value,t.alg))return;n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Sm=g("$ZodCustomStringFormat",(e,t)=>{me.init(e,t),e._zod.check=(n)=>{if(t.fn(n.value))return;n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),cs=g("$ZodNumber",(e,t)=>{re.init(e,t),e._zod.pattern=e._zod.bag.pattern??es,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch(a){}let r=n.value;if(typeof r==="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let i=typeof r==="number"?Number.isNaN(r)?"NaN":!Number.isFinite(r)?"Infinity":void 0:void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}}),ym=g("$ZodNumberFormat",(e,t)=>{wd.init(e,t),cs.init(e,t)}),ni=g("$ZodBoolean",(e,t)=>{re.init(e,t),e._zod.pattern=Rd,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(i){}let r=n.value;if(typeof r==="boolean")return n;return n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),ls=g("$ZodBigInt",(e,t)=>{re.init(e,t),e._zod.pattern=bd,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(r){}if(typeof n.value==="bigint")return n;return n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),bm=g("$ZodBigIntFormat",(e,t)=>{Id.init(e,t),ls.init(e,t)}),$m=g("$ZodSymbol",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(typeof r==="symbol")return n;return n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),Rm=g("$ZodUndefined",(e,t)=>{re.init(e,t),e._zod.pattern=Td,e._zod.values=new Set([void 0]),e._zod.parse=(n,o)=>{let r=n.value;if(typeof r>"u")return n;return n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),zm=g("$ZodNull",(e,t)=>{re.init(e,t),e._zod.pattern=zd,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;if(r===null)return n;return n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),Tm=g("$ZodAny",(e,t)=>{re.init(e,t),e._zod.parse=(n)=>n}),xm=g("$ZodUnknown",(e,t)=>{re.init(e,t),e._zod.parse=(n)=>n}),km=g("$ZodNever",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Em=g("$ZodVoid",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(typeof r>"u")return n;return n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),wm=g("$ZodDate",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(s){}let r=n.value,i=r instanceof Date;if(i&&!Number.isNaN(r.getTime()))return n;return n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),n}});function F_(e,t,n){if(e.issues.length)t.issues.push(...Je(n,e.issues));t.value[n]=e.value}var Im=g("$ZodArray",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let i=[];for(let a=0;a<r.length;a++){let s=r[a],c=t.element._zod.run({value:s,issues:[]},o);if(c instanceof Promise)i.push(c.then((u)=>F_(u,n,a)));else F_(c,n,a)}if(i.length)return Promise.all(i).then(()=>n);return n}});function ss(e,t,n,o,r,i){let a=n in o;if(e.issues.length){if(r&&i&&!a)return;t.issues.push(...Je(n,e.issues))}if(!a&&!r){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}if(e.value===void 0){if(a)t.value[n]=void 0}else t.value[n]=e.value}function aS(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${o}": expected a Zod schema`);let n=Ju(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function sS(e,t,n,o,r,i){let a=[],s=r.keySet,c=r.catchall._zod,u=c.def.type,d=c.optin==="optional",m=c.optout==="optional";for(let p in t){if(p==="__proto__")continue;if(s.has(p))continue;if(u==="never"){a.push(p);continue}let h=c.run({value:t[p],issues:[]},o);if(h instanceof Promise)e.push(h.then((b)=>ss(b,n,p,t,d,m)));else ss(h,n,p,t,d,m)}if(a.length)n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i});if(!e.length)return n;return Promise.all(e).then(()=>n)}var cS=g("$ZodObject",(e,t)=>{if(re.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=yn(()=>aS(t));le(e._zod,"propValues",()=>{let s=t.shape,c={};for(let u in s){let d=s[u]._zod;if(d.values){c[u]??(c[u]=new Set);for(let m of d.values)c[u].add(m)}}return c});let r=Dr,i=t.catchall,a;e._zod.parse=(s,c)=>{a??(a=o.value);let u=s.value;if(!r(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),s;s.value={};let d=[],m=a.shape;for(let p of a.keys){let h=m[p],b=h._zod.optin==="optional",R=h._zod.optout==="optional",z=h._zod.run({value:u[p],issues:[]},c);if(z instanceof Promise)d.push(z.then((A)=>ss(A,s,p,u,b,R)));else ss(z,s,p,u,b,R)}if(!i)return d.length?Promise.all(d).then(()=>s):s;return sS(d,u,s,c,o.value,e)}}),Pm=g("$ZodObjectJIT",(e,t)=>{cS.init(e,t);let n=e._zod.parse,o=yn(()=>aS(t)),r=(p)=>{let h=new ns(["shape","payload","ctx"]),b=o.value,R=(P)=>{let O=La(P);return`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`};h.write("const input = payload.value;");let z=Object.create(null),A=0;for(let P of b.keys)z[P]=`key_${A++}`;h.write("const newResult = {};");for(let P of b.keys){let O=z[P],V=La(P),Y=p[P],ee=Y?._zod?.optin==="optional",ne=Y?._zod?.optout==="optional";if(h.write(`const ${O} = ${R(P)};`),ee&&ne)h.write(`
5
+ `))}}var Vd={major:4,minor:4,patch:3};var re=g("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Vd;let o=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))o.unshift(e);for(let r of o)for(let i of r._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(a,s,c)=>{let u=nr(a),d;for(let m of s){if(m._zod.def.when){if(Yu(a))continue;if(!m._zod.def.when(a))continue}else if(u)continue;let p=a.issues.length,h=m._zod.check(a);if(h instanceof Promise&&c?.async===!1)throw new Tt;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await h,a.issues.length===p)return;if(!u)u=nr(a,p)});else{if(a.issues.length===p)continue;if(!u)u=nr(a,p)}}if(d)return d.then(()=>a);return a},i=(a,s,c)=>{if(nr(a))return a.aborted=!0,a;let u=r(s,o,c);if(u instanceof Promise){if(c.async===!1)throw new Tt;return u.then((d)=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});if(u instanceof Promise)return u.then((d)=>i(d,a,s));return i(u,a,s)}let c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new Tt;return c.then((u)=>r(u,o,s))}return r(c,o,s)}}le(e,"~standard",()=>({validate:(r)=>{try{let i=Xu(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return Qu(e,r).then((a)=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Fr=g("$ZodString",(e,t)=>{re.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??yd(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),me=g("$ZodStringFormat",(e,t)=>{Tn.init(e,t),Fr.init(e,t)}),Hd=g("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=sd),me.init(e,t)}),Yd=g("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Zr(o))}else t.pattern??(t.pattern=Zr());me.init(e,t)}),Gd=g("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cd),me.init(e,t)}),Wd=g("$ZodURL",(e,t)=>{me.init(e,t),e._zod.check=(n)=>{try{let o=n.value.trim();if(!t.normalize&&t.protocol?.source===Qa.source){if(!/^https?:\/\//i.test(o)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}}let r=new URL(o);if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(r.hostname))n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol))n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})}if(t.normalize)n.value=r.href;else n.value=o;return}catch(o){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Xd=g("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ld()),me.init(e,t)}),Qd=g("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=id),me.init(e,t)}),em=g("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ed),me.init(e,t)}),tm=g("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=td),me.init(e,t)}),rm=g("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rd),me.init(e,t)}),nm=g("$ZodXID",(e,t)=>{t.pattern??(t.pattern=nd),me.init(e,t)}),om=g("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=od),me.init(e,t)}),im=g("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Sd(t)),me.init(e,t)}),am=g("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=vd),me.init(e,t)}),sm=g("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=_d(t)),me.init(e,t)}),cm=g("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ad),me.init(e,t)}),lm=g("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ud),me.init(e,t),e._zod.bag.format="ipv4"}),um=g("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=dd),me.init(e,t),e._zod.bag.format="ipv6",e._zod.check=(n)=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),dm=g("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=md(t.delimiter)),me.init(e,t),e._zod.bag.format="mac"}),mm=g("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=pd),me.init(e,t)}),pm=g("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=fd),me.init(e,t),e._zod.check=(n)=>{let o=n.value.split("/");try{if(o.length!==2)throw Error();let[r,i]=o;if(!i)throw Error();let a=Number(i);if(`${a}`!==i)throw Error();if(a<0||a>128)throw Error();new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function fm(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var hm=g("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=hd),me.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(n)=>{if(fm(n.value))return;n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function oS(e){if(!Xa.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fm(n)}var gm=g("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Xa),me.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(n)=>{if(oS(n.value))return;n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),vm=g("$ZodE164",(e,t)=>{t.pattern??(t.pattern=gd),me.init(e,t)});function iS(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));if("typ"in r&&r?.typ!=="JWT")return!1;if(!r.alg)return!1;if(t&&(!("alg"in r)||r.alg!==t))return!1;return!0}catch{return!1}}var _m=g("$ZodJWT",(e,t)=>{me.init(e,t),e._zod.check=(n)=>{if(iS(n.value,t.alg))return;n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Sm=g("$ZodCustomStringFormat",(e,t)=>{me.init(e,t),e._zod.check=(n)=>{if(t.fn(n.value))return;n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),cs=g("$ZodNumber",(e,t)=>{re.init(e,t),e._zod.pattern=e._zod.bag.pattern??es,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch(a){}let r=n.value;if(typeof r==="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let i=typeof r==="number"?Number.isNaN(r)?"NaN":!Number.isFinite(r)?"Infinity":void 0:void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}}),ym=g("$ZodNumberFormat",(e,t)=>{wd.init(e,t),cs.init(e,t)}),ni=g("$ZodBoolean",(e,t)=>{re.init(e,t),e._zod.pattern=Rd,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(i){}let r=n.value;if(typeof r==="boolean")return n;return n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),ls=g("$ZodBigInt",(e,t)=>{re.init(e,t),e._zod.pattern=bd,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(r){}if(typeof n.value==="bigint")return n;return n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),bm=g("$ZodBigIntFormat",(e,t)=>{Id.init(e,t),ls.init(e,t)}),$m=g("$ZodSymbol",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(typeof r==="symbol")return n;return n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),Rm=g("$ZodUndefined",(e,t)=>{re.init(e,t),e._zod.pattern=Td,e._zod.values=new Set([void 0]),e._zod.parse=(n,o)=>{let r=n.value;if(typeof r>"u")return n;return n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),zm=g("$ZodNull",(e,t)=>{re.init(e,t),e._zod.pattern=zd,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;if(r===null)return n;return n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),Tm=g("$ZodAny",(e,t)=>{re.init(e,t),e._zod.parse=(n)=>n}),xm=g("$ZodUnknown",(e,t)=>{re.init(e,t),e._zod.parse=(n)=>n}),km=g("$ZodNever",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Em=g("$ZodVoid",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(typeof r>"u")return n;return n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),wm=g("$ZodDate",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(s){}let r=n.value,i=r instanceof Date;if(i&&!Number.isNaN(r.getTime()))return n;return n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),n}});function K_(e,t,n){if(e.issues.length)t.issues.push(...Ve(n,e.issues));t.value[n]=e.value}var Im=g("$ZodArray",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let i=[];for(let a=0;a<r.length;a++){let s=r[a],c=t.element._zod.run({value:s,issues:[]},o);if(c instanceof Promise)i.push(c.then((u)=>K_(u,n,a)));else K_(c,n,a)}if(i.length)return Promise.all(i).then(()=>n);return n}});function ss(e,t,n,o,r,i){let a=n in o;if(e.issues.length){if(r&&i&&!a)return;t.issues.push(...Ve(n,e.issues))}if(!a&&!r){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}if(e.value===void 0){if(a)t.value[n]=void 0}else t.value[n]=e.value}function aS(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${o}": expected a Zod schema`);let n=Vu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function sS(e,t,n,o,r,i){let a=[],s=r.keySet,c=r.catchall._zod,u=c.def.type,d=c.optin==="optional",m=c.optout==="optional";for(let p in t){if(p==="__proto__")continue;if(s.has(p))continue;if(u==="never"){a.push(p);continue}let h=c.run({value:t[p],issues:[]},o);if(h instanceof Promise)e.push(h.then((b)=>ss(b,n,p,t,d,m)));else ss(h,n,p,t,d,m)}if(a.length)n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i});if(!e.length)return n;return Promise.all(e).then(()=>n)}var cS=g("$ZodObject",(e,t)=>{if(re.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=yn(()=>aS(t));le(e._zod,"propValues",()=>{let s=t.shape,c={};for(let u in s){let d=s[u]._zod;if(d.values){c[u]??(c[u]=new Set);for(let m of d.values)c[u].add(m)}}return c});let r=Dr,i=t.catchall,a;e._zod.parse=(s,c)=>{a??(a=o.value);let u=s.value;if(!r(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),s;s.value={};let d=[],m=a.shape;for(let p of a.keys){let h=m[p],b=h._zod.optin==="optional",R=h._zod.optout==="optional",z=h._zod.run({value:u[p],issues:[]},c);if(z instanceof Promise)d.push(z.then((N)=>ss(N,s,p,u,b,R)));else ss(z,s,p,u,b,R)}if(!i)return d.length?Promise.all(d).then(()=>s):s;return sS(d,u,s,c,o.value,e)}}),Pm=g("$ZodObjectJIT",(e,t)=>{cS.init(e,t);let n=e._zod.parse,o=yn(()=>aS(t)),r=(p)=>{let h=new ns(["shape","payload","ctx"]),b=o.value,R=(P)=>{let O=La(P);return`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`};h.write("const input = payload.value;");let z=Object.create(null),N=0;for(let P of b.keys)z[P]=`key_${N++}`;h.write("const newResult = {};");for(let P of b.keys){let O=z[P],J=La(P),Y=p[P],ee=Y?._zod?.optin==="optional",ne=Y?._zod?.optout==="optional";if(h.write(`const ${O} = ${R(P)};`),ee&&ne)h.write(`
6
6
  if (${O}.issues.length) {
7
- if (${V} in input) {
7
+ if (${J} in input) {
8
8
  payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
9
9
  ...iss,
10
- path: iss.path ? [${V}, ...iss.path] : [${V}]
10
+ path: iss.path ? [${J}, ...iss.path] : [${J}]
11
11
  })));
12
12
  }
13
13
  }
14
14
 
15
15
  if (${O}.value === undefined) {
16
- if (${V} in input) {
17
- newResult[${V}] = undefined;
16
+ if (${J} in input) {
17
+ newResult[${J}] = undefined;
18
18
  }
19
19
  } else {
20
- newResult[${V}] = ${O}.value;
20
+ newResult[${J}] = ${O}.value;
21
21
  }
22
22
 
23
23
  `);else if(!ee)h.write(`
24
- const ${O}_present = ${V} in input;
24
+ const ${O}_present = ${J} in input;
25
25
  if (${O}.issues.length) {
26
26
  payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
27
27
  ...iss,
28
- path: iss.path ? [${V}, ...iss.path] : [${V}]
28
+ path: iss.path ? [${J}, ...iss.path] : [${J}]
29
29
  })));
30
30
  }
31
31
  if (!${O}_present && !${O}.issues.length) {
@@ -33,15 +33,15 @@ var lR=Object.defineProperty;var uR=(e)=>e;function dR(e,t){this[e]=uR.bind(null
33
33
  code: "invalid_type",
34
34
  expected: "nonoptional",
35
35
  input: undefined,
36
- path: [${V}]
36
+ path: [${J}]
37
37
  });
38
38
  }
39
39
 
40
40
  if (${O}_present) {
41
41
  if (${O}.value === undefined) {
42
- newResult[${V}] = undefined;
42
+ newResult[${J}] = undefined;
43
43
  } else {
44
- newResult[${V}] = ${O}.value;
44
+ newResult[${J}] = ${O}.value;
45
45
  }
46
46
  }
47
47
 
@@ -49,43 +49,43 @@ var lR=Object.defineProperty;var uR=(e)=>e;function dR(e,t){this[e]=uR.bind(null
49
49
  if (${O}.issues.length) {
50
50
  payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
51
51
  ...iss,
52
- path: iss.path ? [${V}, ...iss.path] : [${V}]
52
+ path: iss.path ? [${J}, ...iss.path] : [${J}]
53
53
  })));
54
54
  }
55
55
 
56
56
  if (${O}.value === undefined) {
57
- if (${V} in input) {
58
- newResult[${V}] = undefined;
57
+ if (${J} in input) {
58
+ newResult[${J}] = undefined;
59
59
  }
60
60
  } else {
61
- newResult[${V}] = ${O}.value;
61
+ newResult[${J}] = ${O}.value;
62
62
  }
63
63
 
64
- `)}h.write("payload.value = newResult;"),h.write("return payload;");let B=h.compile();return(P,O)=>B(p,P,O)},i,a=Dr,s=!qr.jitless,u=s&&Fu.value,d=t.catchall,m;e._zod.parse=(p,h)=>{m??(m=o.value);let b=p.value;if(!a(b))return p.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),p;if(s&&u&&h?.async===!1&&h.jitless!==!0){if(!i)i=r(t.shape);if(p=i(p,h),!d)return p;return sS([],b,p,h,m,e)}return n(p,h)}});function V_(e,t,n,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let r=e.filter((i)=>!nr(i));if(r.length===1)return t.value=r[0].value,r[0];return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((i)=>i.issues.map((a)=>qe(a,o,ge())))}),t}var oi=g("$ZodUnion",(e,t)=>{re.init(e,t),le(e._zod,"optin",()=>t.options.some((o)=>o._zod.optin==="optional")?"optional":void 0),le(e._zod,"optout",()=>t.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),le(e._zod,"values",()=>{if(t.options.every((o)=>o._zod.values))return new Set(t.options.flatMap((o)=>Array.from(o._zod.values)));return}),le(e._zod,"pattern",()=>{if(t.options.every((o)=>o._zod.pattern)){let o=t.options.map((r)=>r._zod.pattern);return new RegExp(`^(${o.map((r)=>Bo(r.source)).join("|")})$`)}return});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,r)=>{if(n)return n(o,r);let i=!1,a=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},r);if(c instanceof Promise)a.push(c),i=!0;else{if(c.issues.length===0)return c;a.push(c)}}if(!i)return V_(a,o,e,r);return Promise.all(a).then((s)=>V_(s,o,e,r))}});function J_(e,t,n,o){let r=e.filter((i)=>i.issues.length===0);if(r.length===1)return t.value=r[0].value,t;if(r.length===0)t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((i)=>i.issues.map((a)=>qe(a,o,ge())))});else t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1});return t}var Om=g("$ZodXor",(e,t)=>{oi.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,r)=>{if(n)return n(o,r);let i=!1,a=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},r);if(c instanceof Promise)a.push(c),i=!0;else a.push(c)}if(!i)return J_(a,o,e,r);return Promise.all(a).then((s)=>J_(s,o,e,r))}}),Cm=g("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,oi.init(e,t);let n=e._zod.parse;le(e._zod,"propValues",()=>{let r={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,c]of Object.entries(a)){if(!r[s])r[s]=new Set;for(let u of c)r[s].add(u)}}return r});let o=yn(()=>{let r=t.options,i=new Map;for(let a of r){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of s){if(i.has(c))throw Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,a)}}return i});e._zod.parse=(r,i)=>{let a=r.value;if(!Dr(a))return r.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),r;let s=o.value.get(a?.[t.discriminator]);if(s)return s._zod.run(r,i);if(t.unionFallback||i.direction==="backward")return n(r,i);return r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),r}}),Nm=g("$ZodIntersection",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value,i=t.left._zod.run({value:r,issues:[]},o),a=t.right._zod.run({value:r,issues:[]},o);if(i instanceof Promise||a instanceof Promise)return Promise.all([i,a]).then(([c,u])=>B_(n,c,u));return B_(n,i,a)}});function Bd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(rr(e)&&rr(t)){let n=Object.keys(t),o=Object.keys(e).filter((i)=>n.indexOf(i)!==-1),r={...e,...t};for(let i of o){let a=Bd(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r[i]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o],a=Bd(r,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function B_(e,t,n){let o=new Map,r;for(let s of t.issues)if(s.code==="unrecognized_keys"){r??(r=s);for(let c of s.keys){if(!o.has(c))o.set(c,{});o.get(c).l=!0}}else e.issues.push(s);for(let s of n.issues)if(s.code==="unrecognized_keys")for(let c of s.keys){if(!o.has(c))o.set(c,{});o.get(c).r=!0}else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&r)e.issues.push({...r,keys:i});if(nr(e))return e;let a=Bd(t.value,n.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var us=g("$ZodTuple",(e,t)=>{re.init(e,t);let n=t.items;e._zod.parse=(o,r)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=H_(n,"optin"),c=H_(n,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;if(i.length>n.length)o.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:i,inst:e,origin:"array"})}let u=Array(n.length);for(let d=0;d<n.length;d++){let m=n[d]._zod.run({value:i[d],issues:[]},r);if(m instanceof Promise)a.push(m.then((p)=>{u[d]=p}));else u[d]=m}if(t.rest){let d=n.length-1,m=i.slice(n.length);for(let p of m){d++;let h=t.rest._zod.run({value:p,issues:[]},r);if(h instanceof Promise)a.push(h.then((b)=>Y_(b,o,d)));else Y_(h,o,d)}}if(a.length)return Promise.all(a).then(()=>G_(u,o,n,i,c));return G_(u,o,n,i,c)}});function H_(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!=="optional")return n+1;return 0}function Y_(e,t,n){if(e.issues.length)t.issues.push(...Je(n,e.issues));t.value[n]=e.value}function G_(e,t,n,o,r){for(let i=0;i<n.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=r){t.value.length=i;break}t.issues.push(...Je(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length;i--)if(n[i]._zod.optout==="optional"&&t.value[i]===void 0)t.value.length=i;else break;return t}var jm=g("$ZodRecord",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!rr(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let i=[],a=t.keyType._zod.values;if(a){n.value={};let s=new Set;for(let u of a)if(typeof u==="string"||typeof u==="number"||typeof u==="symbol"){s.add(typeof u==="number"?u.toString():u);let d=t.keyType._zod.run({value:u,issues:[]},o);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map((h)=>qe(h,o,ge())),input:u,path:[u],inst:e});continue}let m=d.value,p=t.valueType._zod.run({value:r[u],issues:[]},o);if(p instanceof Promise)i.push(p.then((h)=>{if(h.issues.length)n.issues.push(...Je(u,h.issues));n.value[m]=h.value}));else{if(p.issues.length)n.issues.push(...Je(u,p.issues));n.value[m]=p.value}}let c;for(let u in r)if(!s.has(u))c=c??[],c.push(u);if(c&&c.length>0)n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:c})}else{n.value={};for(let s of Reflect.ownKeys(r)){if(s==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(r,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},o);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof s==="string"&&es.test(s)&&c.issues.length){let m=t.keyType._zod.run({value:Number(s),issues:[]},o);if(m instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(m.issues.length===0)c=m}if(c.issues.length){if(t.mode==="loose")n.value[s]=r[s];else n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map((m)=>qe(m,o,ge())),input:s,path:[s],inst:e});continue}let d=t.valueType._zod.run({value:r[s],issues:[]},o);if(d instanceof Promise)i.push(d.then((m)=>{if(m.issues.length)n.issues.push(...Je(s,m.issues));n.value[c.value]=m.value}));else{if(d.issues.length)n.issues.push(...Je(s,d.issues));n.value[c.value]=d.value}}}if(i.length)return Promise.all(i).then(()=>n);return n}}),Am=g("$ZodMap",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let i=[];n.value=new Map;for(let[a,s]of r){let c=t.keyType._zod.run({value:a,issues:[]},o),u=t.valueType._zod.run({value:s,issues:[]},o);if(c instanceof Promise||u instanceof Promise)i.push(Promise.all([c,u]).then(([d,m])=>{W_(d,m,n,a,r,e,o)}));else W_(c,u,n,a,r,e,o)}if(i.length)return Promise.all(i).then(()=>n);return n}});function W_(e,t,n,o,r,i,a){if(e.issues.length)if(Yo.has(typeof o))n.issues.push(...Je(o,e.issues));else n.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:e.issues.map((s)=>qe(s,a,ge()))});if(t.issues.length)if(Yo.has(typeof o))n.issues.push(...Je(o,t.issues));else n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:t.issues.map((s)=>qe(s,a,ge()))});n.value.set(e.value,t.value)}var Mm=g("$ZodSet",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let a of r){let s=t.valueType._zod.run({value:a,issues:[]},o);if(s instanceof Promise)i.push(s.then((c)=>X_(c,n)));else X_(s,n)}if(i.length)return Promise.all(i).then(()=>n);return n}});function X_(e,t){if(e.issues.length)t.issues.push(...e.issues);t.value.add(e.value)}var Um=g("$ZodEnum",(e,t)=>{re.init(e,t);let n=Jo(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter((r)=>Yo.has(typeof r)).map((r)=>typeof r==="string"?st(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{let a=r.value;if(o.has(a))return r;return r.issues.push({code:"invalid_value",values:n,input:a,inst:e}),r}}),qm=g("$ZodLiteral",(e,t)=>{if(re.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map((o)=>typeof o==="string"?st(o):o?st(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,r)=>{let i=o.value;if(n.has(i))return o;return o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),Lm=g("$ZodFile",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(r instanceof File)return n;return n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),Dm=g("$ZodTransform",(e,t)=>{re.init(e,t),e._zod.optin="optional",e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Lr(e.constructor.name);let r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then((a)=>(n.value=a,n.fallback=!0,n));if(r instanceof Promise)throw new Tt;return n.value=r,n.fallback=!0,n}});function Q_(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var ds=g("$ZodOptional",(e,t)=>{re.init(e,t),e._zod.optin="optional",e._zod.optout="optional",le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),le(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Bo(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){let r=n.value,i=t.innerType._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>Q_(a,r));return Q_(i,r)}if(n.value===void 0)return n;return t.innerType._zod.run(n,o)}}),Zm=g("$ZodExactOptional",(e,t)=>{ds.init(e,t),le(e._zod,"values",()=>t.innerType._zod.values),le(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,o)=>t.innerType._zod.run(n,o)}),Km=g("$ZodNullable",(e,t)=>{re.init(e,t),le(e._zod,"optin",()=>t.innerType._zod.optin),le(e._zod,"optout",()=>t.innerType._zod.optout),le(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Bo(n.source)}|null)$`):void 0}),le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>{if(n.value===null)return n;return t.innerType._zod.run(n,o)}}),Fm=g("$ZodDefault",(e,t)=>{re.init(e,t),e._zod.optin="optional",le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>eS(i,t));return eS(r,t)}});function eS(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Vm=g("$ZodPrefault",(e,t)=>{re.init(e,t),e._zod.optin="optional",le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)n.value=t.defaultValue;return t.innerType._zod.run(n,o)}}),Jm=g("$ZodNonOptional",(e,t)=>{re.init(e,t),le(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>tS(i,e));return tS(r,e)}});function tS(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var Bm=g("$ZodSuccess",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Lr("ZodSuccess");let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>(n.value=i.issues.length===0,n));return n.value=r.issues.length===0,n}}),Hm=g("$ZodCatch",(e,t)=>{re.init(e,t),e._zod.optin="optional",le(e._zod,"optout",()=>t.innerType._zod.optout),le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>{if(n.value=i.value,i.issues.length)n.value=t.catchValue({...n,error:{issues:i.issues.map((a)=>qe(a,o,ge()))},input:n.value}),n.issues=[],n.fallback=!0;return n});if(n.value=r.value,r.issues.length)n.value=t.catchValue({...n,error:{issues:r.issues.map((i)=>qe(i,o,ge()))},input:n.value}),n.issues=[],n.fallback=!0;return n}}),Ym=g("$ZodNaN",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{if(typeof n.value!=="number"||!Number.isNaN(n.value))return n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n;return n}}),ms=g("$ZodPipe",(e,t)=>{re.init(e,t),le(e._zod,"values",()=>t.in._zod.values),le(e._zod,"optin",()=>t.in._zod.optin),le(e._zod,"optout",()=>t.out._zod.optout),le(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>os(a,t.in,o));return os(i,t.in,o)}let r=t.in._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>os(i,t.out,o));return os(r,t.out,o)}});function os(e,t,n){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var ii=g("$ZodCodec",(e,t)=>{re.init(e,t),le(e._zod,"values",()=>t.in._zod.values),le(e._zod,"optin",()=>t.in._zod.optin),le(e._zod,"optout",()=>t.out._zod.optout),le(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>is(a,t,o));return is(i,t,o)}else{let i=t.out._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>is(a,t,o));return is(i,t,o)}}});function is(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);if(r instanceof Promise)return r.then((i)=>as(e,i,t.out,n));return as(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);if(r instanceof Promise)return r.then((i)=>as(e,i,t.in,n));return as(e,r,t.in,n)}}function as(e,t,n,o){if(e.issues.length)return e.aborted=!0,e;return n._zod.run({value:t,issues:e.issues},o)}var Gm=g("$ZodPreprocess",(e,t)=>{ms.init(e,t)}),Wm=g("$ZodReadonly",(e,t)=>{re.init(e,t),le(e._zod,"propValues",()=>t.innerType._zod.propValues),le(e._zod,"values",()=>t.innerType._zod.values),le(e._zod,"optin",()=>t.innerType?._zod?.optin),le(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then(rS);return rS(r)}});function rS(e){return e.value=Object.freeze(e.value),e}var Xm=g("$ZodTemplateLiteral",(e,t)=>{re.init(e,t);let n=[];for(let o of t.parts)if(typeof o==="object"&&o!==null){if(!o._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,a=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,a))}else if(o===null||Vu.has(typeof o))n.push(st(`${o}`));else throw Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>{if(typeof o.value!=="string")return o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(o.value))return o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o;return o}}),Qm=g("$ZodFunction",(e,t)=>(re.init(e,t),e._def=t,e._zod.def=t,e.implement=(n)=>{if(typeof n!=="function")throw Error("implement() must be called with a function");return function(...o){let r=e._def.input?Za(e._def.input,o):o,i=Reflect.apply(n,this,r);if(e._def.output)return Za(e._def.output,i);return i}},e.implementAsync=(n)=>{if(typeof n!=="function")throw Error("implementAsync() must be called with a function");return async function(...o){let r=e._def.input?await Ka(e._def.input,o):o,i=await Reflect.apply(n,this,r);if(e._def.output)return await Ka(e._def.output,i);return i}},e._zod.parse=(n,o)=>{if(typeof n.value!=="function")return n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n;if(e._def.output&&e._def.output._zod.def.type==="promise")n.value=e.implementAsync(n.value);else n.value=e.implement(n.value);return n},e.input=(...n)=>{let o=e.constructor;if(Array.isArray(n[0]))return new o({type:"function",input:new us({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output});return new o({type:"function",input:n[0],output:e._def.output})},e.output=(n)=>new e.constructor({type:"function",input:e._def.input,output:n}),e)),ep=g("$ZodPromise",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then((r)=>t.innerType._zod.run({value:r,issues:[]},o))}),tp=g("$ZodLazy",(e,t)=>{re.init(e,t),le(e._zod,"innerType",()=>{let n=t;if(!n._cachedInner)n._cachedInner=t.getter();return n._cachedInner}),le(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),le(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),le(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),le(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),rp=g("$ZodCustom",(e,t)=>{fe.init(e,t),re.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=(n)=>{let o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then((i)=>nS(i,n,o,e));nS(r,n,o,e);return}});function nS(e,t,n,o){if(!e){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)r.params=o._zod.def.params;t.issues.push(or(r))}}var ui={};Ut(ui,{ar:()=>np,az:()=>op,be:()=>ip,bg:()=>ap,ca:()=>sp,cs:()=>cp,da:()=>lp,de:()=>up,el:()=>dp,en:()=>ai,eo:()=>mp,es:()=>pp,fa:()=>fp,fi:()=>hp,fr:()=>gp,frCA:()=>vp,he:()=>_p,hr:()=>Sp,hu:()=>yp,hy:()=>bp,id:()=>$p,is:()=>Rp,it:()=>zp,ja:()=>Tp,ka:()=>xp,kh:()=>kp,km:()=>si,ko:()=>Ep,lt:()=>wp,mk:()=>Ip,ms:()=>Pp,nl:()=>Op,no:()=>Cp,ota:()=>Np,pl:()=>Ap,ps:()=>jp,pt:()=>Mp,ro:()=>Up,ru:()=>qp,sl:()=>Lp,sv:()=>Dp,ta:()=>Zp,th:()=>Kp,tr:()=>Fp,ua:()=>Vp,uk:()=>li,ur:()=>Jp,uz:()=>Bp,vi:()=>Hp,yo:()=>Wp,zhCN:()=>Yp,zhTW:()=>Gp});var $z=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(r){return e[r]??null}let n={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${r.expected}، ولكن تم إدخال ${s}`;return`مدخلات غير مقبولة: يفترض إدخال ${i}، ولكن تم إدخال ${s}`}case"invalid_value":if(r.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${k(r.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return` أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()} ${a.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()} ${a.unit}`;return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${r.prefix}"`;if(i.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`;if(i.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`;if(i.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`;return`${n[i.format]??r.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${r.divisor}`;case"unrecognized_keys":return`معرف${r.keys.length>1?"ات":""} غريب${r.keys.length>1?"ة":""}: ${y(r.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${r.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${r.origin}`;default:return"مدخل غير مقبول"}}};function np(){return{localeError:$z()}}var Rz=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(r){return e[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Yanlış dəyər: gözlənilən instanceof ${r.expected}, daxil olan ${s}`;return`Yanlış dəyər: gözlənilən ${i}, daxil olan ${s}`}case"invalid_value":if(r.values.length===1)return`Yanlış dəyər: gözlənilən ${k(r.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()} ${a.unit??"element"}`;return`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`;return`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`;if(i.format==="ends_with")return`Yanlış mətn: "${i.suffix}" ilə bitməlidir`;if(i.format==="includes")return`Yanlış mətn: "${i.includes}" daxil olmalıdır`;if(i.format==="regex")return`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${n[i.format]??r.format}`}case"not_multiple_of":return`Yanlış ədəd: ${r.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${r.keys.length>1?"lar":""}: ${y(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${r.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function op(){return{localeError:Rz()}}function lS(e,t,n,o){let r=Math.abs(e),i=r%10,a=r%100;if(a>=11&&a<=19)return o;if(i===1)return t;if(i>=2&&i<=4)return n;return o}var zz=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(r){return e[r]??null}let n={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},o={nan:"NaN",number:"лік",array:"масіў"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Няправільны ўвод: чакаўся instanceof ${r.expected}, атрымана ${s}`;return`Няправільны ўвод: чакаўся ${i}, атрымана ${s}`}case"invalid_value":if(r.values.length===1)return`Няправільны ўвод: чакалася ${k(r.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let s=Number(r.maximum),c=lS(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна ${a.verb} ${i}${r.maximum.toString()} ${c}`}return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна быць ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let s=Number(r.minimum),c=lS(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${r.origin} павінна ${a.verb} ${i}${r.minimum.toString()} ${c}`}return`Занадта малы: чакалася, што ${r.origin} павінна быць ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${i.prefix}"`;if(i.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${i.suffix}"`;if(i.format==="includes")return`Няправільны радок: павінен змяшчаць "${i.includes}"`;if(i.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`;return`Няправільны ${n[i.format]??r.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${r.keys.length>1?"ключы":"ключ"}: ${y(r.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${r.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${r.origin}`;default:return"Няправільны ўвод"}}};function ip(){return{localeError:zz()}}var Tz=()=>{let e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(r){return e[r]??null}let n={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},o={nan:"NaN",number:"число",array:"масив"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Невалиден вход: очакван instanceof ${r.expected}, получен ${s}`;return`Невалиден вход: очакван ${i}, получен ${s}`}case"invalid_value":if(r.values.length===1)return`Невалиден вход: очакван ${k(r.values[0])}`;return`Невалидна опция: очаквано едно от ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Твърде голямо: очаква се ${r.origin??"стойност"} да съдържа ${i}${r.maximum.toString()} ${a.unit??"елемента"}`;return`Твърде голямо: очаква се ${r.origin??"стойност"} да бъде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Твърде малко: очаква се ${r.origin} да съдържа ${i}${r.minimum.toString()} ${a.unit}`;return`Твърде малко: очаква се ${r.origin} да бъде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Невалиден низ: трябва да започва с "${i.prefix}"`;if(i.format==="ends_with")return`Невалиден низ: трябва да завършва с "${i.suffix}"`;if(i.format==="includes")return`Невалиден низ: трябва да включва "${i.includes}"`;if(i.format==="regex")return`Невалиден низ: трябва да съвпада с ${i.pattern}`;let a="Невалиден";if(i.format==="emoji")a="Невалидно";if(i.format==="datetime")a="Невалидно";if(i.format==="date")a="Невалидна";if(i.format==="time")a="Невалидно";if(i.format==="duration")a="Невалидна";return`${a} ${n[i.format]??r.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${r.divisor}`;case"unrecognized_keys":return`Неразпознат${r.keys.length>1?"и":""} ключ${r.keys.length>1?"ове":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${r.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${r.origin}`;default:return"Невалиден вход"}}};function ap(){return{localeError:Tz()}}var xz=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Tipus invàlid: s'esperava instanceof ${r.expected}, s'ha rebut ${s}`;return`Tipus invàlid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":if(r.values.length===1)return`Valor invàlid: s'esperava ${k(r.values[0])}`;return`Opció invàlida: s'esperava una de ${y(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a màxim":"menys de",a=t(r.origin);if(a)return`Massa gran: s'esperava que ${r.origin??"el valor"} contingués ${i} ${r.maximum.toString()} ${a.unit??"elements"}`;return`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a mínim":"més de",a=t(r.origin);if(a)return`Massa petit: s'esperava que ${r.origin} contingués ${i} ${r.minimum.toString()} ${a.unit}`;return`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Format invàlid: ha de començar amb "${i.prefix}"`;if(i.format==="ends_with")return`Format invàlid: ha d'acabar amb "${i.suffix}"`;if(i.format==="includes")return`Format invàlid: ha d'incloure "${i.includes}"`;if(i.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${i.pattern}`;return`Format invàlid per a ${n[i.format]??r.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${r.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${r.origin}`;default:return"Entrada invàlida"}}};function sp(){return{localeError:xz()}}var kz=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(r){return e[r]??null}let n={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Neplatný vstup: očekáváno instanceof ${r.expected}, obdrženo ${s}`;return`Neplatný vstup: očekáváno ${i}, obdrženo ${s}`}case"invalid_value":if(r.values.length===1)return`Neplatný vstup: očekáváno ${k(r.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Hodnota je příliš velká: ${r.origin??"hodnota"} musí mít ${i}${r.maximum.toString()} ${a.unit??"prvků"}`;return`Hodnota je příliš velká: ${r.origin??"hodnota"} musí být ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Hodnota je příliš malá: ${r.origin??"hodnota"} musí mít ${i}${r.minimum.toString()} ${a.unit??"prvků"}`;return`Hodnota je příliš malá: ${r.origin??"hodnota"} musí být ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neplatný řetězec: musí začínat na "${i.prefix}"`;if(i.format==="ends_with")return`Neplatný řetězec: musí končit na "${i.suffix}"`;if(i.format==="includes")return`Neplatný řetězec: musí obsahovat "${i.includes}"`;if(i.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${i.pattern}`;return`Neplatný formát ${n[i.format]??r.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${r.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${y(r.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${r.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${r.origin}`;default:return"Neplatný vstup"}}};function cp(){return{localeError:kz()}}var Ez=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(r){return e[r]??null}let n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Ugyldigt input: forventede instanceof ${r.expected}, fik ${s}`;return`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":if(r.values.length===1)return`Ugyldig værdi: forventede ${k(r.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),s=o[r.origin]??r.origin;if(a)return`For stor: forventede ${s??"value"} ${a.verb} ${i} ${r.maximum.toString()} ${a.unit??"elementer"}`;return`For stor: forventede ${s??"value"} havde ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),s=o[r.origin]??r.origin;if(a)return`For lille: forventede ${s} ${a.verb} ${i} ${r.minimum.toString()} ${a.unit}`;return`For lille: forventede ${s} havde ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ugyldig streng: skal starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: skal ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: skal indeholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: skal matche mønsteret ${i.pattern}`;return`Ugyldig ${n[i.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${y(r.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${r.origin}`;default:return"Ugyldigt input"}}};function lp(){return{localeError:Ez()}}var wz=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Ungültige Eingabe: erwartet instanceof ${r.expected}, erhalten ${s}`;return`Ungültige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":if(r.values.length===1)return`Ungültige Eingabe: erwartet ${k(r.values[0])}`;return`Ungültige Option: erwartet eine von ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${a.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${a.unit} hat`;return`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ungültiger String: muss mit "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ungültiger String: muss mit "${i.suffix}" enden`;if(i.format==="includes")return`Ungültiger String: muss "${i.includes}" enthalten`;if(i.format==="regex")return`Ungültiger String: muss dem Muster ${i.pattern} entsprechen`;return`Ungültig: ${n[i.format]??r.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${y(r.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${r.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${r.origin}`;default:return"Ungültige Eingabe"}}};function up(){return{localeError:wz()}}var Iz=()=>{let e={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}};function t(r){return e[r]??null}let n={regex:"είσοδος",email:"διεύθυνση email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ημερομηνία και ώρα",date:"ISO ημερομηνία",time:"ISO ώρα",duration:"ISO διάρκεια",ipv4:"διεύθυνση IPv4",ipv6:"διεύθυνση IPv6",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",jwt:"JWT",template_literal:"είσοδος"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(typeof r.expected==="string"&&/^[A-Z]/.test(r.expected))return`Μη έγκυρη είσοδος: αναμενόταν instanceof ${r.expected}, λήφθηκε ${s}`;return`Μη έγκυρη είσοδος: αναμενόταν ${i}, λήφθηκε ${s}`}case"invalid_value":if(r.values.length===1)return`Μη έγκυρη είσοδος: αναμενόταν ${k(r.values[0])}`;return`Μη έγκυρη επιλογή: αναμενόταν ένα από ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Πολύ μεγάλο: αναμενόταν ${r.origin??"τιμή"} να έχει ${i}${r.maximum.toString()} ${a.unit??"στοιχεία"}`;return`Πολύ μεγάλο: αναμενόταν ${r.origin??"τιμή"} να είναι ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Πολύ μικρό: αναμενόταν ${r.origin} να έχει ${i}${r.minimum.toString()} ${a.unit}`;return`Πολύ μικρό: αναμενόταν ${r.origin} να είναι ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${i.prefix}"`;if(i.format==="ends_with")return`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${i.suffix}"`;if(i.format==="includes")return`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${i.includes}"`;if(i.format==="regex")return`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${i.pattern}`;return`Μη έγκυρο: ${n[i.format]??r.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${r.divisor}`;case"unrecognized_keys":return`Άγνωστ${r.keys.length>1?"α":"ο"} κλειδ${r.keys.length>1?"ιά":"ί"}: ${y(r.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${r.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${r.origin}`;default:return"Μη έγκυρη είσοδος"}}};function dp(){return{localeError:Iz()}}var Pz=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(r){return e[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":if(r.values.length===1)return`Invalid input: expected ${k(r.values[0])}`;return`Invalid option: expected one of ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Too big: expected ${r.origin??"value"} to have ${i}${r.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Too small: expected ${r.origin} to have ${i}${r.minimum.toString()} ${a.unit}`;return`Too small: expected ${r.origin} to be ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":if(r.options&&Array.isArray(r.options)&&r.options.length>0)return`Invalid discriminator value. Expected ${r.options.map((a)=>`'${a}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function ai(){return{localeError:Pz()}}var Oz=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Nevalida enigo: atendiĝis instanceof ${r.expected}, riceviĝis ${s}`;return`Nevalida enigo: atendiĝis ${i}, riceviĝis ${s}`}case"invalid_value":if(r.values.length===1)return`Nevalida enigo: atendiĝis ${k(r.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()} ${a.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Tro malgranda: atendiĝis ke ${r.origin} havu ${i}${r.minimum.toString()} ${a.unit}`;return`Tro malgranda: atendiĝis ke ${r.origin} estu ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${i.prefix}"`;if(i.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${i.suffix}"`;if(i.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${i.includes}"`;if(i.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`;return`Nevalida ${n[i.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} ŝlosilo${r.keys.length>1?"j":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function mp(){return{localeError:Oz()}}var Cz=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let n={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Entrada inválida: se esperaba instanceof ${r.expected}, recibido ${s}`;return`Entrada inválida: se esperaba ${i}, recibido ${s}`}case"invalid_value":if(r.values.length===1)return`Entrada inválida: se esperaba ${k(r.values[0])}`;return`Opción inválida: se esperaba una de ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),s=o[r.origin]??r.origin;if(a)return`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${r.maximum.toString()} ${a.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),s=o[r.origin]??r.origin;if(a)return`Demasiado pequeño: se esperaba que ${s} tuviera ${i}${r.minimum.toString()} ${a.unit}`;return`Demasiado pequeño: se esperaba que ${s} fuera ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Cadena inválida: debe comenzar con "${i.prefix}"`;if(i.format==="ends_with")return`Cadena inválida: debe terminar en "${i.suffix}"`;if(i.format==="includes")return`Cadena inválida: debe incluir "${i.includes}"`;if(i.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${i.pattern}`;return`Inválido ${n[i.format]??r.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Llave inválida en ${o[r.origin]??r.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${o[r.origin]??r.origin}`;default:return"Entrada inválida"}}};function pp(){return{localeError:Cz()}}var Nz=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(r){return e[r]??null}let n={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},o={nan:"NaN",number:"عدد",array:"آرایه"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`ورودی نامعتبر: می‌بایست instanceof ${r.expected} می‌بود، ${s} دریافت شد`;return`ورودی نامعتبر: می‌بایست ${i} می‌بود، ${s} دریافت شد`}case"invalid_value":if(r.values.length===1)return`ورودی نامعتبر: می‌بایست ${k(r.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${y(r.values,"|")} می‌بود`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} ${a.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} باشد`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} ${a.unit} باشد`;return`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} باشد`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`رشته نامعتبر: باید با "${i.prefix}" شروع شود`;if(i.format==="ends_with")return`رشته نامعتبر: باید با "${i.suffix}" تمام شود`;if(i.format==="includes")return`رشته نامعتبر: باید شامل "${i.includes}" باشد`;if(i.format==="regex")return`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`;return`${n[i.format]??r.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${r.divisor} باشد`;case"unrecognized_keys":return`کلید${r.keys.length>1?"های":""} ناشناس: ${y(r.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${r.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${r.origin}`;default:return"ورودی نامعتبر"}}};function fp(){return{localeError:Nz()}}var jz=()=>{let e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(r){return e[r]??null}let n={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${s}`;return`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":if(r.values.length===1)return`Virheellinen syöte: täytyy olla ${k(r.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Liian suuri: ${a.subject} täytyy olla ${i}${r.maximum.toString()} ${a.unit}`.trim();return`Liian suuri: arvon täytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Liian pieni: ${a.subject} täytyy olla ${i}${r.minimum.toString()} ${a.unit}`.trim();return`Liian pieni: arvon täytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${i.prefix}"`;if(i.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${i.suffix}"`;if(i.format==="includes")return`Virheellinen syöte: täytyy sisältää "${i.includes}"`;if(i.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${i.pattern}`;return`Virheellinen ${n[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${y(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function hp(){return{localeError:jz()}}var Az=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},o={string:"chaîne",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Entrée invalide : instanceof ${r.expected} attendu, ${s} reçu`;return`Entrée invalide : ${i} attendu, ${s} reçu`}case"invalid_value":if(r.values.length===1)return`Entrée invalide : ${k(r.values[0])} attendu`;return`Option invalide : une valeur parmi ${y(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Trop grand : ${o[r.origin]??"valeur"} doit ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"élément(s)"}`;return`Trop grand : ${o[r.origin]??"valeur"} doit être ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Trop petit : ${o[r.origin]??"valeur"} doit ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Trop petit : ${o[r.origin]??"valeur"} doit être ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${i.pattern}`;return`${n[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${y(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};function gp(){return{localeError:Az()}}var Mz=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Entrée invalide : attendu instanceof ${r.expected}, reçu ${s}`;return`Entrée invalide : attendu ${i}, reçu ${s}`}case"invalid_value":if(r.values.length===1)return`Entrée invalide : attendu ${k(r.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"≤":"<",a=t(r.origin);if(a)return`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${a.unit}`;return`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"≥":">",a=t(r.origin);if(a)return`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${a.unit}`;return`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au motif ${i.pattern}`;return`${n[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${y(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};function vp(){return{localeError:Mz()}}var Uz=()=>{let e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},n=(u)=>u?e[u]:void 0,o=(u)=>{let d=n(u);if(d)return d.label;return u??e.unknown.label},r=(u)=>`ה${o(u)}`,i=(u)=>(n(u)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",a=(u)=>{if(!u)return null;return t[u]??null},s={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},c={nan:"NaN"};return(u)=>{switch(u.code){case"invalid_type":{let d=u.expected,m=c[d??""]??o(d),p=w(u.input),h=c[p]??e[p]?.label??p;if(/^[A-Z]/.test(u.expected))return`קלט לא תקין: צריך להיות instanceof ${u.expected}, התקבל ${h}`;return`קלט לא תקין: צריך להיות ${m}, התקבל ${h}`}case"invalid_value":{if(u.values.length===1)return`ערך לא תקין: הערך חייב להיות ${k(u.values[0])}`;let d=u.values.map((h)=>k(h));if(u.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${d[0]} או ${d[1]}`;let m=d[d.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${d.slice(0,-1).join(", ")} או ${m}`}case"too_big":{let d=a(u.origin),m=r(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"ארוך"} מדי: ${m} צריכה להכיל ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"או פחות":"לכל היותר"}`.trim();if(u.origin==="number"){let b=u.inclusive?`קטן או שווה ל-${u.maximum}`:`קטן מ-${u.maximum}`;return`גדול מדי: ${m} צריך להיות ${b}`}if(u.origin==="array"||u.origin==="set"){let b=u.origin==="set"?"צריכה":"צריך",R=u.inclusive?`${u.maximum} ${d?.unit??""} או פחות`:`פחות מ-${u.maximum} ${d?.unit??""}`;return`גדול מדי: ${m} ${b} להכיל ${R}`.trim()}let p=u.inclusive?"<=":"<",h=i(u.origin??"value");if(d?.unit)return`${d.longLabel} מדי: ${m} ${h} ${p}${u.maximum.toString()} ${d.unit}`;return`${d?.longLabel??"גדול"} מדי: ${m} ${h} ${p}${u.maximum.toString()}`}case"too_small":{let d=a(u.origin),m=r(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"קצר"} מדי: ${m} צריכה להכיל ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"או יותר":"לפחות"}`.trim();if(u.origin==="number"){let b=u.inclusive?`גדול או שווה ל-${u.minimum}`:`גדול מ-${u.minimum}`;return`קטן מדי: ${m} צריך להיות ${b}`}if(u.origin==="array"||u.origin==="set"){let b=u.origin==="set"?"צריכה":"צריך";if(u.minimum===1&&u.inclusive){let z=u.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${m} ${b} להכיל ${z}`}let R=u.inclusive?`${u.minimum} ${d?.unit??""} או יותר`:`יותר מ-${u.minimum} ${d?.unit??""}`;return`קטן מדי: ${m} ${b} להכיל ${R}`.trim()}let p=u.inclusive?">=":">",h=i(u.origin??"value");if(d?.unit)return`${d.shortLabel} מדי: ${m} ${h} ${p}${u.minimum.toString()} ${d.unit}`;return`${d?.shortLabel??"קטן"} מדי: ${m} ${h} ${p}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${d.prefix}"`;if(d.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${d.suffix}"`;if(d.format==="includes")return`המחרוזת חייבת לכלול "${d.includes}"`;if(d.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${d.pattern}`;let m=s[d.format],p=m?.label??d.format,b=(m?.gender??"m")==="f"?"תקינה":"תקין";return`${p} לא ${b}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${u.divisor}`;case"unrecognized_keys":return`מפתח${u.keys.length>1?"ות":""} לא מזוה${u.keys.length>1?"ים":"ה"}: ${y(u.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${r(u.origin??"array")}`;default:return"קלט לא תקין"}}};function _p(){return{localeError:Uz()}}var qz=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(r){return e[r]??null}let n={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Neispravan unos: očekuje se instanceof ${r.expected}, a primljeno je ${s}`;return`Neispravan unos: očekuje se ${i}, a primljeno je ${s}`}case"invalid_value":if(r.values.length===1)return`Neispravna vrijednost: očekivano ${k(r.values[0])}`;return`Neispravna opcija: očekivano jedno od ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),s=o[r.origin]??r.origin;if(a)return`Preveliko: očekivano da ${s??"vrijednost"} ima ${i}${r.maximum.toString()} ${a.unit??"elemenata"}`;return`Preveliko: očekivano da ${s??"vrijednost"} bude ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),s=o[r.origin]??r.origin;if(a)return`Premalo: očekivano da ${s} ima ${i}${r.minimum.toString()} ${a.unit}`;return`Premalo: očekivano da ${s} bude ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neispravan tekst: mora započinjati s "${i.prefix}"`;if(i.format==="ends_with")return`Neispravan tekst: mora završavati s "${i.suffix}"`;if(i.format==="includes")return`Neispravan tekst: mora sadržavati "${i.includes}"`;if(i.format==="regex")return`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`;return`Neispravna ${n[i.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i ključevi":" ključ"}: ${y(r.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${o[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[r.origin]??r.origin}`;default:return"Neispravan unos"}}};function Sp(){return{localeError:qz()}}var Lz=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"szám",array:"tömb"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Érvénytelen bemenet: a várt érték instanceof ${r.expected}, a kapott érték ${s}`;return`Érvénytelen bemenet: a várt érték ${i}, a kapott érték ${s}`}case"invalid_value":if(r.values.length===1)return`Érvénytelen bemenet: a várt érték ${k(r.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Túl nagy: ${r.origin??"érték"} mérete túl nagy ${i}${r.maximum.toString()} ${a.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${r.origin??"érték"} túl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Túl kicsi: a bemeneti érték ${r.origin} mérete túl kicsi ${i}${r.minimum.toString()} ${a.unit}`;return`Túl kicsi: a bemeneti érték ${r.origin} túl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Érvénytelen string: "${i.prefix}" értékkel kell kezdődnie`;if(i.format==="ends_with")return`Érvénytelen string: "${i.suffix}" értékkel kell végződnie`;if(i.format==="includes")return`Érvénytelen string: "${i.includes}" értéket kell tartalmaznia`;if(i.format==="regex")return`Érvénytelen string: ${i.pattern} mintának kell megfelelnie`;return`Érvénytelen ${n[i.format]??r.format}`}case"not_multiple_of":return`Érvénytelen szám: ${r.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${r.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${r.origin}`;default:return"Érvénytelen bemenet"}}};function yp(){return{localeError:Lz()}}function uS(e,t,n){return Math.abs(e)===1?t:n}function xn(e){if(!e)return"";let t=["ա","ե","ը","ի","ո","ու","օ"],n=e[e.length-1];return e+(t.includes(n)?"ն":"ը")}var Dz=()=>{let e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(r){return e[r]??null}let n={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},o={nan:"NaN",number:"թիվ",array:"զանգված"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${r.expected}, ստացվել է ${s}`;return`Սխալ մուտքագրում․ սպասվում էր ${i}, ստացվել է ${s}`}case"invalid_value":if(r.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${k(r.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let s=Number(r.maximum),c=uS(s,a.unit.one,a.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${xn(r.origin??"արժեք")} կունենա ${i}${r.maximum.toString()} ${c}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${xn(r.origin??"արժեք")} լինի ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let s=Number(r.minimum),c=uS(s,a.unit.one,a.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${xn(r.origin)} կունենա ${i}${r.minimum.toString()} ${c}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${xn(r.origin)} լինի ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${i.prefix}"-ով`;if(i.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${i.suffix}"-ով`;if(i.format==="includes")return`Սխալ տող․ պետք է պարունակի "${i.includes}"`;if(i.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${i.pattern} ձևաչափին`;return`Սխալ ${n[i.format]??r.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${r.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${r.keys.length>1?"ներ":""}. ${y(r.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${xn(r.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${xn(r.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function bp(){return{localeError:Dz()}}var Zz=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${s}`;return`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":if(r.values.length===1)return`Input tidak valid: diharapkan ${k(r.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${a.unit??"elemen"}`;return`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${a.unit}`;return`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`String tidak valid: harus dimulai dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak valid: harus berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak valid: harus menyertakan "${i.includes}"`;if(i.format==="regex")return`String tidak valid: harus sesuai pola ${i.pattern}`;return`${n[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function $p(){return{localeError:Zz()}}var Kz=()=>{let e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(r){return e[r]??null}let n={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"númer",array:"fylki"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Rangt gildi: Þú slóst inn ${s} þar sem á að vera instanceof ${r.expected}`;return`Rangt gildi: Þú slóst inn ${s} þar sem á að vera ${i}`}case"invalid_value":if(r.values.length===1)return`Rangt gildi: gert ráð fyrir ${k(r.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} hafi ${i}${r.maximum.toString()} ${a.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} sé ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Of lítið: gert er ráð fyrir að ${r.origin} hafi ${i}${r.minimum.toString()} ${a.unit}`;return`Of lítið: gert er ráð fyrir að ${r.origin} sé ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ógildur strengur: verður að byrja á "${i.prefix}"`;if(i.format==="ends_with")return`Ógildur strengur: verður að enda á "${i.suffix}"`;if(i.format==="includes")return`Ógildur strengur: verður að innihalda "${i.includes}"`;if(i.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${i.pattern}`;return`Rangt ${n[i.format]??r.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`Óþekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${y(r.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${r.origin}`;default:return"Rangt gildi"}}};function Rp(){return{localeError:Kz()}}var Fz=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Input non valido: atteso instanceof ${r.expected}, ricevuto ${s}`;return`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":if(r.values.length===1)return`Input non valido: atteso ${k(r.values[0])}`;return`Opzione non valida: atteso uno tra ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${a.unit??"elementi"}`;return`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${a.unit}`;return`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Stringa non valida: deve iniziare con "${i.prefix}"`;if(i.format==="ends_with")return`Stringa non valida: deve terminare con "${i.suffix}"`;if(i.format==="includes")return`Stringa non valida: deve includere "${i.includes}"`;if(i.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${i.pattern}`;return`Input non valido: ${n[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${y(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function zp(){return{localeError:Fz()}}var Vz=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(r){return e[r]??null}let n={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},o={nan:"NaN",number:"数値",array:"配列"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`無効な入力: instanceof ${r.expected}が期待されましたが、${s}が入力されました`;return`無効な入力: ${i}が期待されましたが、${s}が入力されました`}case"invalid_value":if(r.values.length===1)return`無効な入力: ${k(r.values[0])}が期待されました`;return`無効な選択: ${y(r.values,"、")}のいずれかである必要があります`;case"too_big":{let i=r.inclusive?"以下である":"より小さい",a=t(r.origin);if(a)return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${a.unit??"要素"}${i}必要があります`;return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${i}必要があります`}case"too_small":{let i=r.inclusive?"以上である":"より大きい",a=t(r.origin);if(a)return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${a.unit}${i}必要があります`;return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${i}必要があります`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`無効な文字列: "${i.prefix}"で始まる必要があります`;if(i.format==="ends_with")return`無効な文字列: "${i.suffix}"で終わる必要があります`;if(i.format==="includes")return`無効な文字列: "${i.includes}"を含む必要があります`;if(i.format==="regex")return`無効な文字列: パターン${i.pattern}に一致する必要があります`;return`無効な${n[i.format]??r.format}`}case"not_multiple_of":return`無効な数値: ${r.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${r.keys.length>1?"群":""}: ${y(r.keys,"、")}`;case"invalid_key":return`${r.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${r.origin}内の無効な値`;default:return"無効な入力"}}};function Tp(){return{localeError:Vz()}}var Jz=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(r){return e[r]??null}let n={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული ველი",base64url:"base64url-კოდირებული ველი",json_string:"JSON ველი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},o={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${r.expected}, მიღებული ${s}`;return`არასწორი შეყვანა: მოსალოდნელი ${i}, მიღებული ${s}`}case"invalid_value":if(r.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${k(r.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${y(r.values,"|")}-დან`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} იყოს ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`ზედმეტად პატარა: მოსალოდნელი ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${r.origin} იყოს ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`არასწორი ველი: უნდა იწყებოდეს "${i.prefix}"-ით`;if(i.format==="ends_with")return`არასწორი ველი: უნდა მთავრდებოდეს "${i.suffix}"-ით`;if(i.format==="includes")return`არასწორი ველი: უნდა შეიცავდეს "${i.includes}"-ს`;if(i.format==="regex")return`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${i.pattern}`;return`არასწორი ${n[i.format]??r.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${r.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${r.keys.length>1?"ები":"ი"}: ${y(r.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${r.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${r.origin}-ში`;default:return"არასწორი შეყვანა"}}};function xp(){return{localeError:Jz()}}var Bz=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(r){return e[r]??null}let n={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},o={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${r.expected} ប៉ុន្តែទទួលបាន ${s}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${i} ប៉ុន្តែទទួលបាន ${s}`}case"invalid_value":if(r.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${k(r.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()} ${a.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()} ${a.unit}`;return`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`;if(i.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`;if(i.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`;if(i.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`;return`មិនត្រឹមត្រូវ៖ ${n[i.format]??r.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${r.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${y(r.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function si(){return{localeError:Bz()}}function kp(){return si()}var Hz=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(r){return e[r]??null}let n={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`잘못된 입력: 예상 타입은 instanceof ${r.expected}, 받은 타입은 ${s}입니다`;return`잘못된 입력: 예상 타입은 ${i}, 받은 타입은 ${s}입니다`}case"invalid_value":if(r.values.length===1)return`잘못된 입력: 값은 ${k(r.values[0])} 이어야 합니다`;return`잘못된 옵션: ${y(r.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let i=r.inclusive?"이하":"미만",a=i==="미만"?"이어야 합니다":"여야 합니다",s=t(r.origin),c=s?.unit??"요소";if(s)return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()}${c} ${i}${a}`;return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()} ${i}${a}`}case"too_small":{let i=r.inclusive?"이상":"초과",a=i==="이상"?"이어야 합니다":"여야 합니다",s=t(r.origin),c=s?.unit??"요소";if(s)return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()}${c} ${i}${a}`;return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`;if(i.format==="ends_with")return`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`;if(i.format==="includes")return`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`;if(i.format==="regex")return`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${n[i.format]??r.format}`}case"not_multiple_of":return`잘못된 숫자: ${r.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${y(r.keys,", ")}`;case"invalid_key":return`잘못된 키: ${r.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${r.origin}`;default:return"잘못된 입력"}}};function Ep(){return{localeError:Hz()}}var ci=(e)=>e.charAt(0).toUpperCase()+e.slice(1);function dS(e){let t=Math.abs(e),n=t%10,o=t%100;if(o>=11&&o<=19||n===0)return"many";if(n===1)return"one";return"few"}var Yz=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(r,i,a,s){let c=e[r]??null;if(c===null)return c;return{unit:c.unit[i],verb:c.verb[s][a?"inclusive":"notInclusive"]}}let n={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},o={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Gautas tipas ${s}, o tikėtasi - instanceof ${r.expected}`;return`Gautas tipas ${s}, o tikėtasi - ${i}`}case"invalid_value":if(r.values.length===1)return`Privalo būti ${k(r.values[0])}`;return`Privalo būti vienas iš ${y(r.values,"|")} pasirinkimų`;case"too_big":{let i=o[r.origin]??r.origin,a=t(r.origin,dS(Number(r.maximum)),r.inclusive??!1,"smaller");if(a?.verb)return`${ci(i??r.origin??"reikšmė")} ${a.verb} ${r.maximum.toString()} ${a.unit??"elementų"}`;let s=r.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${ci(i??r.origin??"reikšmė")} turi būti ${s} ${r.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[r.origin]??r.origin,a=t(r.origin,dS(Number(r.minimum)),r.inclusive??!1,"bigger");if(a?.verb)return`${ci(i??r.origin??"reikšmė")} ${a.verb} ${r.minimum.toString()} ${a.unit??"elementų"}`;let s=r.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${ci(i??r.origin??"reikšmė")} turi būti ${s} ${r.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Eilutė privalo prasidėti "${i.prefix}"`;if(i.format==="ends_with")return`Eilutė privalo pasibaigti "${i.suffix}"`;if(i.format==="includes")return`Eilutė privalo įtraukti "${i.includes}"`;if(i.format==="regex")return`Eilutė privalo atitikti ${i.pattern}`;return`Neteisingas ${n[i.format]??r.format}`}case"not_multiple_of":return`Skaičius privalo būti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${y(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let i=o[r.origin]??r.origin;return`${ci(i??r.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function wp(){return{localeError:Yz()}}var Gz=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(r){return e[r]??null}let n={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},o={nan:"NaN",number:"број",array:"низа"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Грешен внес: се очекува instanceof ${r.expected}, примено ${s}`;return`Грешен внес: се очекува ${i}, примено ${s}`}case"invalid_value":if(r.values.length===1)return`Invalid input: expected ${k(r.values[0])}`;return`Грешана опција: се очекува една ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Премногу голем: се очекува ${r.origin??"вредноста"} да има ${i}${r.maximum.toString()} ${a.unit??"елементи"}`;return`Премногу голем: се очекува ${r.origin??"вредноста"} да биде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Премногу мал: се очекува ${r.origin} да има ${i}${r.minimum.toString()} ${a.unit}`;return`Премногу мал: се очекува ${r.origin} да биде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неважечка низа: мора да започнува со "${i.prefix}"`;if(i.format==="ends_with")return`Неважечка низа: мора да завршува со "${i.suffix}"`;if(i.format==="includes")return`Неважечка низа: мора да вклучува "${i.includes}"`;if(i.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${i.pattern}`;return`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${y(r.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${r.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${r.origin}`;default:return"Грешен внес"}}};function Ip(){return{localeError:Gz()}}var Wz=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${s}`;return`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":if(r.values.length===1)return`Input tidak sah: dijangka ${k(r.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Terlalu besar: dijangka ${r.origin??"nilai"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"elemen"}`;return`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Terlalu kecil: dijangka ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`String tidak sah: mesti bermula dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak sah: mesti mengandungi "${i.includes}"`;if(i.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${i.pattern}`;return`${n[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${y(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function Pp(){return{localeError:Wz()}}var Xz=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(r){return e[r]??null}let n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${s}`;return`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":if(r.values.length===1)return`Ongeldige invoer: verwacht ${k(r.values[0])}`;return`Ongeldige optie: verwacht één van ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),s=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";if(a)return`Te ${s}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`;return`Te ${s}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),s=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";if(a)return`Te ${s}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ${a.verb}`;return`Te ${s}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ongeldige tekst: moet met "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ongeldige tekst: moet op "${i.suffix}" eindigen`;if(i.format==="includes")return`Ongeldige tekst: moet "${i.includes}" bevatten`;if(i.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`;return`Ongeldig: ${n[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function Op(){return{localeError:Xz()}}var Qz=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(r){return e[r]??null}let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Ugyldig input: forventet instanceof ${r.expected}, fikk ${s}`;return`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":if(r.values.length===1)return`Ugyldig verdi: forventet ${k(r.values[0])}`;return`Ugyldig valg: forventet en av ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()} ${a.unit??"elementer"}`;return`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()} ${a.unit}`;return`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ugyldig streng: må starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: må ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: må inneholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: må matche mønsteret ${i.pattern}`;return`Ugyldig ${n[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${y(r.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function Cp(){return{localeError:Qz()}}var eT=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(r){return e[r]??null}let n={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Fâsit giren: umulan instanceof ${r.expected}, alınan ${s}`;return`Fâsit giren: umulan ${i}, alınan ${s}`}case"invalid_value":if(r.values.length===1)return`Fâsit giren: umulan ${k(r.values[0])}`;return`Fâsit tercih: mûteberler ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmalıydı.`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} ${a.unit} sahip olmalıydı.`;return`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} olmalıydı.`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Fâsit metin: "${i.prefix}" ile başlamalı.`;if(i.format==="ends_with")return`Fâsit metin: "${i.suffix}" ile bitmeli.`;if(i.format==="includes")return`Fâsit metin: "${i.includes}" ihtivâ etmeli.`;if(i.format==="regex")return`Fâsit metin: ${i.pattern} nakşına uymalı.`;return`Fâsit ${n[i.format]??r.format}`}case"not_multiple_of":return`Fâsit sayı: ${r.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`${r.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${r.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function Np(){return{localeError:eT()}}var tT=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(r){return e[r]??null}let n={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},o={nan:"NaN",number:"عدد",array:"ارې"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`ناسم ورودي: باید instanceof ${r.expected} وای, مګر ${s} ترلاسه شو`;return`ناسم ورودي: باید ${i} وای, مګر ${s} ترلاسه شو`}case"invalid_value":if(r.values.length===1)return`ناسم ورودي: باید ${k(r.values[0])} وای`;return`ناسم انتخاب: باید یو له ${y(r.values,"|")} څخه وای`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} ${a.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} وي`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} ${a.unit} ولري`;return`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} وي`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`ناسم متن: باید د "${i.prefix}" سره پیل شي`;if(i.format==="ends_with")return`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`;if(i.format==="includes")return`ناسم متن: باید "${i.includes}" ولري`;if(i.format==="regex")return`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`;return`${n[i.format]??r.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${r.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${r.keys.length>1?"کلیډونه":"کلیډ"}: ${y(r.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${r.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${r.origin} کې`;default:return"ناسمه ورودي"}}};function jp(){return{localeError:tT()}}var rT=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(r){return e[r]??null}let n={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},o={nan:"NaN",number:"liczba",array:"tablica"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${r.expected}, otrzymano ${s}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":if(r.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${k(r.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Za duża wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.maximum.toString()} ${a.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Za mała wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.minimum.toString()} ${a.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${i.prefix}"`;if(i.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${i.suffix}"`;if(i.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${i.includes}"`;if(i.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${i.pattern}`;return`Nieprawidłow(y/a/e) ${n[i.format]??r.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${r.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${r.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Ap(){return{localeError:rT()}}var nT=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let n={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"número",null:"nulo"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Tipo inválido: esperado instanceof ${r.expected}, recebido ${s}`;return`Tipo inválido: esperado ${i}, recebido ${s}`}case"invalid_value":if(r.values.length===1)return`Entrada inválida: esperado ${k(r.values[0])}`;return`Opção inválida: esperada uma das ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${a.unit??"elementos"}`;return`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${a.unit}`;return`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Texto inválido: deve começar com "${i.prefix}"`;if(i.format==="ends_with")return`Texto inválido: deve terminar com "${i.suffix}"`;if(i.format==="includes")return`Texto inválido: deve incluir "${i.includes}"`;if(i.format==="regex")return`Texto inválido: deve corresponder ao padrão ${i.pattern}`;return`${n[i.format]??r.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Chave inválida em ${r.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${r.origin}`;default:return"Campo inválido"}}};function Mp(){return{localeError:nT()}}var oT=()=>{let e={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}};function t(r){return e[r]??null}let n={regex:"intrare",email:"adresă de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;return`Intrare invalidă: așteptat ${i}, primit ${s}`}case"invalid_value":if(r.values.length===1)return`Intrare invalidă: așteptat ${k(r.values[0])}`;return`Opțiune invalidă: așteptat una dintre ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Prea mare: așteptat ca ${r.origin??"valoarea"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"elemente"}`;return`Prea mare: așteptat ca ${r.origin??"valoarea"} să fie ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Prea mic: așteptat ca ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Prea mic: așteptat ca ${r.origin} să fie ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Șir invalid: trebuie să înceapă cu "${i.prefix}"`;if(i.format==="ends_with")return`Șir invalid: trebuie să se termine cu "${i.suffix}"`;if(i.format==="includes")return`Șir invalid: trebuie să includă "${i.includes}"`;if(i.format==="regex")return`Șir invalid: trebuie să se potrivească cu modelul ${i.pattern}`;return`Format invalid: ${n[i.format]??r.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${y(r.keys,", ")}`;case"invalid_key":return`Cheie invalidă în ${r.origin}`;case"invalid_union":return"Intrare invalidă";case"invalid_element":return`Valoare invalidă în ${r.origin}`;default:return"Intrare invalidă"}}};function Up(){return{localeError:oT()}}function mS(e,t,n,o){let r=Math.abs(e),i=r%10,a=r%100;if(a>=11&&a<=19)return o;if(i===1)return t;if(i>=2&&i<=4)return n;return o}var iT=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(r){return e[r]??null}let n={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},o={nan:"NaN",number:"число",array:"массив"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Неверный ввод: ожидалось instanceof ${r.expected}, получено ${s}`;return`Неверный ввод: ожидалось ${i}, получено ${s}`}case"invalid_value":if(r.values.length===1)return`Неверный ввод: ожидалось ${k(r.values[0])}`;return`Неверный вариант: ожидалось одно из ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let s=Number(r.maximum),c=mS(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет иметь ${i}${r.maximum.toString()} ${c}`}return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let s=Number(r.minimum),c=mS(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${r.origin} будет иметь ${i}${r.minimum.toString()} ${c}`}return`Слишком маленькое значение: ожидалось, что ${r.origin} будет ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неверная строка: должна начинаться с "${i.prefix}"`;if(i.format==="ends_with")return`Неверная строка: должна заканчиваться на "${i.suffix}"`;if(i.format==="includes")return`Неверная строка: должна содержать "${i.includes}"`;if(i.format==="regex")return`Неверная строка: должна соответствовать шаблону ${i.pattern}`;return`Неверный ${n[i.format]??r.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспознанн${r.keys.length>1?"ые":"ый"} ключ${r.keys.length>1?"и":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${r.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${r.origin}`;default:return"Неверные входные данные"}}};function qp(){return{localeError:iT()}}var aT=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"število",array:"tabela"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Neveljaven vnos: pričakovano instanceof ${r.expected}, prejeto ${s}`;return`Neveljaven vnos: pričakovano ${i}, prejeto ${s}`}case"invalid_value":if(r.values.length===1)return`Neveljaven vnos: pričakovano ${k(r.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${a.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Premajhno: pričakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${a.unit}`;return`Premajhno: pričakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neveljaven niz: mora se začeti z "${i.prefix}"`;if(i.format==="ends_with")return`Neveljaven niz: mora se končati z "${i.suffix}"`;if(i.format==="includes")return`Neveljaven niz: mora vsebovati "${i.includes}"`;if(i.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`;return`Neveljaven ${n[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i ključi":" ključ"}: ${y(r.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function Lp(){return{localeError:aT()}}var sT=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(r){return e[r]??null}let n={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Ogiltig inmatning: förväntat instanceof ${r.expected}, fick ${s}`;return`Ogiltig inmatning: förväntat ${i}, fick ${s}`}case"invalid_value":if(r.values.length===1)return`Ogiltig inmatning: förväntat ${k(r.values[0])}`;return`Ogiltigt val: förväntade en av ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`För stor(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()} ${a.unit??"element"}`;return`För stor(t): förväntat ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()} ${a.unit}`;return`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ogiltig sträng: måste börja med "${i.prefix}"`;if(i.format==="ends_with")return`Ogiltig sträng: måste sluta med "${i.suffix}"`;if(i.format==="includes")return`Ogiltig sträng: måste innehålla "${i.includes}"`;if(i.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${i.pattern}"`;return`Ogiltig(t) ${n[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${y(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${r.origin??"värdet"}`;default:return"Ogiltig input"}}};function Dp(){return{localeError:sT()}}var cT=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(r){return e[r]??null}let n={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${r.expected}, பெறப்பட்டது ${s}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${i}, பெறப்பட்டது ${s}`}case"invalid_value":if(r.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${k(r.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${y(r.values,"|")} இல் ஒன்று`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`;if(i.format==="ends_with")return`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`;if(i.format==="includes")return`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`;if(i.format==="regex")return`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${n[i.format]??r.format}`}case"not_multiple_of":return`தவறான எண்: ${r.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${r.keys.length>1?"கள்":""}: ${y(r.keys,", ")}`;case"invalid_key":return`${r.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${r.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function Zp(){return{localeError:cT()}}var lT=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(r){return e[r]??null}let n={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},o={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${r.expected} แต่ได้รับ ${s}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${i} แต่ได้รับ ${s}`}case"invalid_value":if(r.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${k(r.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"ไม่เกิน":"น้อยกว่า",a=t(r.origin);if(a)return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()} ${a.unit??"รายการ"}`;return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"อย่างน้อย":"มากกว่า",a=t(r.origin);if(a)return`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()} ${a.unit}`;return`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`;if(i.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`;if(i.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`;if(i.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`;return`รูปแบบไม่ถูกต้อง: ${n[i.format]??r.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${r.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${y(r.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${r.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${r.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function Kp(){return{localeError:lT()}}var uT=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(r){return e[r]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Geçersiz değer: beklenen instanceof ${r.expected}, alınan ${s}`;return`Geçersiz değer: beklenen ${i}, alınan ${s}`}case"invalid_value":if(r.values.length===1)return`Geçersiz değer: beklenen ${k(r.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Çok büyük: beklenen ${r.origin??"değer"} ${i}${r.maximum.toString()} ${a.unit??"öğe"}`;return`Çok büyük: beklenen ${r.origin??"değer"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Çok küçük: beklenen ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`;return`Çok küçük: beklenen ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Geçersiz metin: "${i.prefix}" ile başlamalı`;if(i.format==="ends_with")return`Geçersiz metin: "${i.suffix}" ile bitmeli`;if(i.format==="includes")return`Geçersiz metin: "${i.includes}" içermeli`;if(i.format==="regex")return`Geçersiz metin: ${i.pattern} desenine uymalı`;return`Geçersiz ${n[i.format]??r.format}`}case"not_multiple_of":return`Geçersiz sayı: ${r.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${r.keys.length>1?"lar":""}: ${y(r.keys,", ")}`;case"invalid_key":return`${r.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${r.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function Fp(){return{localeError:uT()}}var dT=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(r){return e[r]??null}let n={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},o={nan:"NaN",number:"число",array:"масив"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Неправильні вхідні дані: очікується instanceof ${r.expected}, отримано ${s}`;return`Неправильні вхідні дані: очікується ${i}, отримано ${s}`}case"invalid_value":if(r.values.length===1)return`Неправильні вхідні дані: очікується ${k(r.values[0])}`;return`Неправильна опція: очікується одне з ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Занадто велике: очікується, що ${r.origin??"значення"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"елементів"}`;return`Занадто велике: очікується, що ${r.origin??"значення"} буде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Занадто мале: очікується, що ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Занадто мале: очікується, що ${r.origin} буде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неправильний рядок: повинен починатися з "${i.prefix}"`;if(i.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`;if(i.format==="includes")return`Неправильний рядок: повинен містити "${i.includes}"`;if(i.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`;return`Неправильний ${n[i.format]??r.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${r.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${r.keys.length>1?"і":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${r.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${r.origin}`;default:return"Неправильні вхідні дані"}}};function li(){return{localeError:dT()}}function Vp(){return li()}var mT=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(r){return e[r]??null}let n={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},o={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`غلط ان پٹ: instanceof ${r.expected} متوقع تھا، ${s} موصول ہوا`;return`غلط ان پٹ: ${i} متوقع تھا، ${s} موصول ہوا`}case"invalid_value":if(r.values.length===1)return`غلط ان پٹ: ${k(r.values[0])} متوقع تھا`;return`غلط آپشن: ${y(r.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`بہت بڑا: ${r.origin??"ویلیو"} کے ${i}${r.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${r.origin??"ویلیو"} کا ${i}${r.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`بہت چھوٹا: ${r.origin} کے ${i}${r.minimum.toString()} ${a.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${r.origin} کا ${i}${r.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`;if(i.format==="ends_with")return`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`;if(i.format==="includes")return`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`;if(i.format==="regex")return`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`;return`غلط ${n[i.format]??r.format}`}case"not_multiple_of":return`غلط نمبر: ${r.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${r.keys.length>1?"ز":""}: ${y(r.keys,"، ")}`;case"invalid_key":return`${r.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${r.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Jp(){return{localeError:mT()}}var pT=()=>{let e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}};function t(r){return e[r]??null}let n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${s}`;return`Noto‘g‘ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":if(r.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${k(r.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()} ${a.unit} ${a.verb}`;return`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ${a.verb}`;return`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Noto‘g‘ri satr: "${i.prefix}" bilan boshlanishi kerak`;if(i.format==="ends_with")return`Noto‘g‘ri satr: "${i.suffix}" bilan tugashi kerak`;if(i.format==="includes")return`Noto‘g‘ri satr: "${i.includes}" ni o‘z ichiga olishi kerak`;if(i.format==="regex")return`Noto‘g‘ri satr: ${i.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${n[i.format]??r.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${r.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${r.keys.length>1?"lar":""}: ${y(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${r.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function Bp(){return{localeError:pT()}}var fT=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(r){return e[r]??null}let n={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},o={nan:"NaN",number:"số",array:"mảng"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${r.expected}, nhận được ${s}`;return`Đầu vào không hợp lệ: mong đợi ${i}, nhận được ${s}`}case"invalid_value":if(r.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${k(r.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Quá lớn: mong đợi ${r.origin??"giá trị"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"phần tử"}`;return`Quá lớn: mong đợi ${r.origin??"giá trị"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Quá nhỏ: mong đợi ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Quá nhỏ: mong đợi ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${i.prefix}"`;if(i.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${i.suffix}"`;if(i.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${i.includes}"`;if(i.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${i.pattern}`;return`${n[i.format]??r.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${r.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${y(r.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${r.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${r.origin}`;default:return"Đầu vào không hợp lệ"}}};function Hp(){return{localeError:fT()}}var hT=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(r){return e[r]??null}let n={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},o={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`无效输入:期望 instanceof ${r.expected},实际接收 ${s}`;return`无效输入:期望 ${i},实际接收 ${s}`}case"invalid_value":if(r.values.length===1)return`无效输入:期望 ${k(r.values[0])}`;return`无效选项:期望以下之一 ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()} ${a.unit??"个元素"}`;return`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`;return`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`无效字符串:必须以 "${i.prefix}" 开头`;if(i.format==="ends_with")return`无效字符串:必须以 "${i.suffix}" 结尾`;if(i.format==="includes")return`无效字符串:必须包含 "${i.includes}"`;if(i.format==="regex")return`无效字符串:必须满足正则表达式 ${i.pattern}`;return`无效${n[i.format]??r.format}`}case"not_multiple_of":return`无效数字:必须是 ${r.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${y(r.keys,", ")}`;case"invalid_key":return`${r.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${r.origin} 中包含无效值(value)`;default:return"无效输入"}}};function Yp(){return{localeError:hT()}}var gT=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(r){return e[r]??null}let n={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`無效的輸入值:預期為 instanceof ${r.expected},但收到 ${s}`;return`無效的輸入值:預期為 ${i},但收到 ${s}`}case"invalid_value":if(r.values.length===1)return`無效的輸入值:預期為 ${k(r.values[0])}`;return`無效的選項:預期為以下其中之一 ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()} ${a.unit??"個元素"}`;return`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()} ${a.unit}`;return`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`無效的字串:必須以 "${i.prefix}" 開頭`;if(i.format==="ends_with")return`無效的字串:必須以 "${i.suffix}" 結尾`;if(i.format==="includes")return`無效的字串:必須包含 "${i.includes}"`;if(i.format==="regex")return`無效的字串:必須符合格式 ${i.pattern}`;return`無效的 ${n[i.format]??r.format}`}case"not_multiple_of":return`無效的數字:必須為 ${r.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${r.keys.length>1?"們":""}:${y(r.keys,"、")}`;case"invalid_key":return`${r.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${r.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Gp(){return{localeError:gT()}}var vT=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(r){return e[r]??null}let n={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},o={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${r.expected}, àmọ̀ a rí ${s}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${i}, àmọ̀ a rí ${s}`}case"invalid_value":if(r.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${k(r.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${r.origin??"iye"} ${a.verb} ${i}${r.maximum} ${a.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${i}${r.maximum}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Kéré ju: a ní láti jẹ́ pé ${r.origin} ${a.verb} ${i}${r.minimum} ${a.unit}`;return`Kéré ju: a ní láti jẹ́ ${i}${r.minimum}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${i.prefix}"`;if(i.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${i.suffix}"`;if(i.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${i.includes}"`;if(i.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${i.pattern}`;return`Aṣìṣe: ${n[i.format]??r.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${r.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${y(r.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${r.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${r.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function Wp(){return{localeError:vT()}}var pS,Xp=Symbol("ZodOutput"),Qp=Symbol("ZodInput");class ef{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==="object"&&"id"in n)this._idmap.set(n.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function ps(){return new ef}(pS=globalThis).__zod_globalRegistry??(pS.__zod_globalRegistry=ps());var xe=globalThis.__zod_globalRegistry;function tf(e,t){return new e({type:"string",...T(t)})}function rf(e,t){return new e({type:"string",coerce:!0,...T(t)})}function fs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...T(t)})}function di(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...T(t)})}function hs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...T(t)})}function gs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(t)})}function vs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(t)})}function _s(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(t)})}function mi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...T(t)})}function Ss(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...T(t)})}function ys(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(t)})}function bs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...T(t)})}function $s(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(t)})}function Rs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...T(t)})}function zs(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...T(t)})}function Ts(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(t)})}function xs(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(t)})}function ks(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(t)})}function nf(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...T(t)})}function Es(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(t)})}function ws(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(t)})}function Is(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...T(t)})}function Ps(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...T(t)})}function Os(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...T(t)})}function Cs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...T(t)})}var of={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function af(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(t)})}function sf(e,t){return new e({type:"string",format:"date",check:"string_format",...T(t)})}function cf(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...T(t)})}function lf(e,t){return new e({type:"string",format:"duration",check:"string_format",...T(t)})}function uf(e,t){return new e({type:"number",checks:[],...T(t)})}function df(e,t){return new e({type:"number",coerce:!0,checks:[],...T(t)})}function mf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...T(t)})}function pf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...T(t)})}function ff(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...T(t)})}function hf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...T(t)})}function gf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...T(t)})}function vf(e,t){return new e({type:"boolean",...T(t)})}function _f(e,t){return new e({type:"boolean",coerce:!0,...T(t)})}function Sf(e,t){return new e({type:"bigint",...T(t)})}function yf(e,t){return new e({type:"bigint",coerce:!0,...T(t)})}function bf(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...T(t)})}function $f(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...T(t)})}function Rf(e,t){return new e({type:"symbol",...T(t)})}function zf(e,t){return new e({type:"undefined",...T(t)})}function Tf(e,t){return new e({type:"null",...T(t)})}function xf(e){return new e({type:"any"})}function kf(e){return new e({type:"unknown"})}function Ef(e,t){return new e({type:"never",...T(t)})}function wf(e,t){return new e({type:"void",...T(t)})}function If(e,t){return new e({type:"date",...T(t)})}function Pf(e,t){return new e({type:"date",coerce:!0,...T(t)})}function Of(e,t){return new e({type:"nan",...T(t)})}function kt(e,t){return new ts({check:"less_than",...T(t),value:e,inclusive:!1})}function et(e,t){return new ts({check:"less_than",...T(t),value:e,inclusive:!0})}function Et(e,t){return new rs({check:"greater_than",...T(t),value:e,inclusive:!1})}function Le(e,t){return new rs({check:"greater_than",...T(t),value:e,inclusive:!0})}function Ns(e){return Et(0,e)}function js(e){return kt(0,e)}function As(e){return et(0,e)}function Ms(e){return Le(0,e)}function ir(e,t){return new Ed({check:"multiple_of",...T(t),value:e})}function ar(e,t){return new Pd({check:"max_size",...T(t),maximum:e})}function wt(e,t){return new Od({check:"min_size",...T(t),minimum:e})}function Fr(e,t){return new Cd({check:"size_equals",...T(t),size:e})}function Vr(e,t){return new Nd({check:"max_length",...T(t),maximum:e})}function Lt(e,t){return new jd({check:"min_length",...T(t),minimum:e})}function Jr(e,t){return new Ad({check:"length_equals",...T(t),length:e})}function kn(e,t){return new Md({check:"string_format",format:"regex",...T(t),pattern:e})}function En(e){return new Ud({check:"string_format",format:"lowercase",...T(e)})}function wn(e){return new qd({check:"string_format",format:"uppercase",...T(e)})}function In(e,t){return new Ld({check:"string_format",format:"includes",...T(t),includes:e})}function Pn(e,t){return new Dd({check:"string_format",format:"starts_with",...T(t),prefix:e})}function On(e,t){return new Zd({check:"string_format",format:"ends_with",...T(t),suffix:e})}function Us(e,t,n){return new Kd({check:"property",property:e,schema:t,...T(n)})}function Cn(e,t){return new Fd({check:"mime_type",mime:e,...T(t)})}function mt(e){return new Vd({check:"overwrite",tx:e})}function Nn(e){return mt((t)=>t.normalize(e))}function jn(){return mt((e)=>e.trim())}function An(){return mt((e)=>e.toLowerCase())}function Mn(){return mt((e)=>e.toUpperCase())}function Un(){return mt((e)=>Ku(e))}function Cf(e,t,n){return new e({type:"array",element:t,...T(n)})}function ST(e,t,n){return new e({type:"union",options:t,...T(n)})}function yT(e,t,n){return new e({type:"union",options:t,inclusive:!1,...T(n)})}function bT(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...T(o)})}function $T(e,t,n){return new e({type:"intersection",left:t,right:n})}function RT(e,t,n,o){let r=n instanceof re;return new e({type:"tuple",items:t,rest:r?n:null,...T(r?o:n)})}function zT(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...T(o)})}function TT(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...T(o)})}function xT(e,t,n){return new e({type:"set",valueType:t,...T(n)})}function kT(e,t,n){let o=Array.isArray(t)?Object.fromEntries(t.map((r)=>[r,r])):t;return new e({type:"enum",entries:o,...T(n)})}function ET(e,t,n){return new e({type:"enum",entries:t,...T(n)})}function wT(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...T(n)})}function Nf(e,t){return new e({type:"file",...T(t)})}function IT(e,t){return new e({type:"transform",transform:t})}function PT(e,t){return new e({type:"optional",innerType:t})}function OT(e,t){return new e({type:"nullable",innerType:t})}function CT(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n==="function"?n():Ho(n)}})}function NT(e,t,n){return new e({type:"nonoptional",innerType:t,...T(n)})}function jT(e,t){return new e({type:"success",innerType:t})}function AT(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n==="function"?n:()=>n})}function MT(e,t,n){return new e({type:"pipe",in:t,out:n})}function UT(e,t){return new e({type:"readonly",innerType:t})}function qT(e,t,n){return new e({type:"template_literal",parts:t,...T(n)})}function LT(e,t){return new e({type:"lazy",getter:t})}function DT(e,t){return new e({type:"promise",innerType:t})}function jf(e,t,n){let o=T(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Af(e,t,n){return new e({type:"custom",check:"custom",fn:t,...T(n)})}function Mf(e,t){let n=fS((o)=>(o.addIssue=(r)=>{if(typeof r==="string")o.issues.push(or(r,o.value,n._zod.def));else{let i=r;if(i.fatal)i.continue=!1;i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),o.issues.push(or(i))}},e(o.value,o)),t);return n}function fS(e,t){let n=new fe({check:"custom",...T(t)});return n._zod.check=e,n}function Uf(e){let t=new fe({check:"describe"});return t._zod.onattach=[(n)=>{let o=xe.get(n)??{};xe.add(n,{...o,description:e})}],t._zod.check=()=>{},t}function qf(e){let t=new fe({check:"meta"});return t._zod.onattach=[(n)=>{let o=xe.get(n)??{};xe.add(n,{...o,...e})}],t._zod.check=()=>{},t}function Lf(e,t){let n=T(t),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];if(n.case!=="sensitive")o=o.map((h)=>typeof h==="string"?h.toLowerCase():h),r=r.map((h)=>typeof h==="string"?h.toLowerCase():h);let i=new Set(o),a=new Set(r),s=e.Codec??ii,c=e.Boolean??ni,d=new(e.String??Kr)({type:"string",error:n.error}),m=new c({type:"boolean",error:n.error}),p=new s({type:"pipe",in:d,out:m,transform:(h,b)=>{let R=h;if(n.case!=="sensitive")R=R.toLowerCase();if(i.has(R))return!0;else if(a.has(R))return!1;else return b.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:b.value,inst:p,continue:!1}),{}},reverseTransform:(h,b)=>{if(h===!0)return o[0]||"true";else return r[0]||"false"},error:n.error});return p}function qn(e,t,n,o={}){let r=T(o),i={...T(o),check:"string_format",type:"string",format:t,fn:typeof n==="function"?n:(s)=>n.test(s),...r};if(n instanceof RegExp)i.pattern=n;return new e(i)}function sr(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??xe,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function de(e,t,n={path:[],schemaPath:[]}){var o;let r=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,n.schemaPath.includes(e))i.cycle=n.path;return i.schema}let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,d);else{let p=a.schema,h=t.processors[r.type];if(!h)throw Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);h(e,t,p,d)}let m=e._zod.parent;if(m){if(!a.ref)a.ref=m;de(m,t,d),t.seen.get(m).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Object.assign(a.schema,c);if(t.io==="input"&&De(e))delete a.schema.examples,delete a.schema.default;if(t.io==="input"&&"_prefault"in a.schema)(o=a.schema).default??(o.default=a.schema._prefault);return delete a.schema._prefault,t.seen.get(e).schema}function cr(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let c=o.get(s);if(c&&c!==a[0])throw Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let r=(a)=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let m=e.external.registry.get(a[0])?.id,p=e.external.uri??((b)=>b);if(m)return{ref:p(m)};let h=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=h,{defId:h,ref:`${p("__shared")}#/${s}/${h}`}}if(a[1]===n)return{ref:"#"};let u=`${"#"}/${s}/`,d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=(a)=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:u}=r(a);if(s.def={...s.schema},u)s.defId=u;let d=s.schema;for(let m in d)delete d[m];d.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
64
+ `)}h.write("payload.value = newResult;"),h.write("return payload;");let B=h.compile();return(P,O)=>B(p,P,O)},i,a=Dr,s=!qr.jitless,u=s&&Ku.value,d=t.catchall,m;e._zod.parse=(p,h)=>{m??(m=o.value);let b=p.value;if(!a(b))return p.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),p;if(s&&u&&h?.async===!1&&h.jitless!==!0){if(!i)i=r(t.shape);if(p=i(p,h),!d)return p;return sS([],b,p,h,m,e)}return n(p,h)}});function J_(e,t,n,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let r=e.filter((i)=>!nr(i));if(r.length===1)return t.value=r[0].value,r[0];return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((i)=>i.issues.map((a)=>qe(a,o,ge())))}),t}var oi=g("$ZodUnion",(e,t)=>{re.init(e,t),le(e._zod,"optin",()=>t.options.some((o)=>o._zod.optin==="optional")?"optional":void 0),le(e._zod,"optout",()=>t.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),le(e._zod,"values",()=>{if(t.options.every((o)=>o._zod.values))return new Set(t.options.flatMap((o)=>Array.from(o._zod.values)));return}),le(e._zod,"pattern",()=>{if(t.options.every((o)=>o._zod.pattern)){let o=t.options.map((r)=>r._zod.pattern);return new RegExp(`^(${o.map((r)=>Bo(r.source)).join("|")})$`)}return});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,r)=>{if(n)return n(o,r);let i=!1,a=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},r);if(c instanceof Promise)a.push(c),i=!0;else{if(c.issues.length===0)return c;a.push(c)}}if(!i)return J_(a,o,e,r);return Promise.all(a).then((s)=>J_(s,o,e,r))}});function V_(e,t,n,o){let r=e.filter((i)=>i.issues.length===0);if(r.length===1)return t.value=r[0].value,t;if(r.length===0)t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((i)=>i.issues.map((a)=>qe(a,o,ge())))});else t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1});return t}var Om=g("$ZodXor",(e,t)=>{oi.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,r)=>{if(n)return n(o,r);let i=!1,a=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},r);if(c instanceof Promise)a.push(c),i=!0;else a.push(c)}if(!i)return V_(a,o,e,r);return Promise.all(a).then((s)=>V_(s,o,e,r))}}),Cm=g("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,oi.init(e,t);let n=e._zod.parse;le(e._zod,"propValues",()=>{let r={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,c]of Object.entries(a)){if(!r[s])r[s]=new Set;for(let u of c)r[s].add(u)}}return r});let o=yn(()=>{let r=t.options,i=new Map;for(let a of r){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of s){if(i.has(c))throw Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,a)}}return i});e._zod.parse=(r,i)=>{let a=r.value;if(!Dr(a))return r.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),r;let s=o.value.get(a?.[t.discriminator]);if(s)return s._zod.run(r,i);if(t.unionFallback||i.direction==="backward")return n(r,i);return r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),r}}),Nm=g("$ZodIntersection",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value,i=t.left._zod.run({value:r,issues:[]},o),a=t.right._zod.run({value:r,issues:[]},o);if(i instanceof Promise||a instanceof Promise)return Promise.all([i,a]).then(([c,u])=>B_(n,c,u));return B_(n,i,a)}});function Bd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(rr(e)&&rr(t)){let n=Object.keys(t),o=Object.keys(e).filter((i)=>n.indexOf(i)!==-1),r={...e,...t};for(let i of o){let a=Bd(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r[i]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o],a=Bd(r,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function B_(e,t,n){let o=new Map,r;for(let s of t.issues)if(s.code==="unrecognized_keys"){r??(r=s);for(let c of s.keys){if(!o.has(c))o.set(c,{});o.get(c).l=!0}}else e.issues.push(s);for(let s of n.issues)if(s.code==="unrecognized_keys")for(let c of s.keys){if(!o.has(c))o.set(c,{});o.get(c).r=!0}else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&r)e.issues.push({...r,keys:i});if(nr(e))return e;let a=Bd(t.value,n.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var us=g("$ZodTuple",(e,t)=>{re.init(e,t);let n=t.items;e._zod.parse=(o,r)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=H_(n,"optin"),c=H_(n,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;if(i.length>n.length)o.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:i,inst:e,origin:"array"})}let u=Array(n.length);for(let d=0;d<n.length;d++){let m=n[d]._zod.run({value:i[d],issues:[]},r);if(m instanceof Promise)a.push(m.then((p)=>{u[d]=p}));else u[d]=m}if(t.rest){let d=n.length-1,m=i.slice(n.length);for(let p of m){d++;let h=t.rest._zod.run({value:p,issues:[]},r);if(h instanceof Promise)a.push(h.then((b)=>Y_(b,o,d)));else Y_(h,o,d)}}if(a.length)return Promise.all(a).then(()=>G_(u,o,n,i,c));return G_(u,o,n,i,c)}});function H_(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!=="optional")return n+1;return 0}function Y_(e,t,n){if(e.issues.length)t.issues.push(...Ve(n,e.issues));t.value[n]=e.value}function G_(e,t,n,o,r){for(let i=0;i<n.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=r){t.value.length=i;break}t.issues.push(...Ve(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length;i--)if(n[i]._zod.optout==="optional"&&t.value[i]===void 0)t.value.length=i;else break;return t}var jm=g("$ZodRecord",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!rr(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let i=[],a=t.keyType._zod.values;if(a){n.value={};let s=new Set;for(let u of a)if(typeof u==="string"||typeof u==="number"||typeof u==="symbol"){s.add(typeof u==="number"?u.toString():u);let d=t.keyType._zod.run({value:u,issues:[]},o);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map((h)=>qe(h,o,ge())),input:u,path:[u],inst:e});continue}let m=d.value,p=t.valueType._zod.run({value:r[u],issues:[]},o);if(p instanceof Promise)i.push(p.then((h)=>{if(h.issues.length)n.issues.push(...Ve(u,h.issues));n.value[m]=h.value}));else{if(p.issues.length)n.issues.push(...Ve(u,p.issues));n.value[m]=p.value}}let c;for(let u in r)if(!s.has(u))c=c??[],c.push(u);if(c&&c.length>0)n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:c})}else{n.value={};for(let s of Reflect.ownKeys(r)){if(s==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(r,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},o);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof s==="string"&&es.test(s)&&c.issues.length){let m=t.keyType._zod.run({value:Number(s),issues:[]},o);if(m instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(m.issues.length===0)c=m}if(c.issues.length){if(t.mode==="loose")n.value[s]=r[s];else n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map((m)=>qe(m,o,ge())),input:s,path:[s],inst:e});continue}let d=t.valueType._zod.run({value:r[s],issues:[]},o);if(d instanceof Promise)i.push(d.then((m)=>{if(m.issues.length)n.issues.push(...Ve(s,m.issues));n.value[c.value]=m.value}));else{if(d.issues.length)n.issues.push(...Ve(s,d.issues));n.value[c.value]=d.value}}}if(i.length)return Promise.all(i).then(()=>n);return n}}),Am=g("$ZodMap",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let i=[];n.value=new Map;for(let[a,s]of r){let c=t.keyType._zod.run({value:a,issues:[]},o),u=t.valueType._zod.run({value:s,issues:[]},o);if(c instanceof Promise||u instanceof Promise)i.push(Promise.all([c,u]).then(([d,m])=>{W_(d,m,n,a,r,e,o)}));else W_(c,u,n,a,r,e,o)}if(i.length)return Promise.all(i).then(()=>n);return n}});function W_(e,t,n,o,r,i,a){if(e.issues.length)if(Yo.has(typeof o))n.issues.push(...Ve(o,e.issues));else n.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:e.issues.map((s)=>qe(s,a,ge()))});if(t.issues.length)if(Yo.has(typeof o))n.issues.push(...Ve(o,t.issues));else n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:t.issues.map((s)=>qe(s,a,ge()))});n.value.set(e.value,t.value)}var Mm=g("$ZodSet",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let a of r){let s=t.valueType._zod.run({value:a,issues:[]},o);if(s instanceof Promise)i.push(s.then((c)=>X_(c,n)));else X_(s,n)}if(i.length)return Promise.all(i).then(()=>n);return n}});function X_(e,t){if(e.issues.length)t.issues.push(...e.issues);t.value.add(e.value)}var Um=g("$ZodEnum",(e,t)=>{re.init(e,t);let n=Vo(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter((r)=>Yo.has(typeof r)).map((r)=>typeof r==="string"?st(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{let a=r.value;if(o.has(a))return r;return r.issues.push({code:"invalid_value",values:n,input:a,inst:e}),r}}),qm=g("$ZodLiteral",(e,t)=>{if(re.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map((o)=>typeof o==="string"?st(o):o?st(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,r)=>{let i=o.value;if(n.has(i))return o;return o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),Lm=g("$ZodFile",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(r instanceof File)return n;return n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),Dm=g("$ZodTransform",(e,t)=>{re.init(e,t),e._zod.optin="optional",e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Lr(e.constructor.name);let r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then((a)=>(n.value=a,n.fallback=!0,n));if(r instanceof Promise)throw new Tt;return n.value=r,n.fallback=!0,n}});function Q_(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var ds=g("$ZodOptional",(e,t)=>{re.init(e,t),e._zod.optin="optional",e._zod.optout="optional",le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),le(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Bo(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){let r=n.value,i=t.innerType._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>Q_(a,r));return Q_(i,r)}if(n.value===void 0)return n;return t.innerType._zod.run(n,o)}}),Zm=g("$ZodExactOptional",(e,t)=>{ds.init(e,t),le(e._zod,"values",()=>t.innerType._zod.values),le(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,o)=>t.innerType._zod.run(n,o)}),Fm=g("$ZodNullable",(e,t)=>{re.init(e,t),le(e._zod,"optin",()=>t.innerType._zod.optin),le(e._zod,"optout",()=>t.innerType._zod.optout),le(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Bo(n.source)}|null)$`):void 0}),le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>{if(n.value===null)return n;return t.innerType._zod.run(n,o)}}),Km=g("$ZodDefault",(e,t)=>{re.init(e,t),e._zod.optin="optional",le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>eS(i,t));return eS(r,t)}});function eS(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Jm=g("$ZodPrefault",(e,t)=>{re.init(e,t),e._zod.optin="optional",le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)n.value=t.defaultValue;return t.innerType._zod.run(n,o)}}),Vm=g("$ZodNonOptional",(e,t)=>{re.init(e,t),le(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>tS(i,e));return tS(r,e)}});function tS(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var Bm=g("$ZodSuccess",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Lr("ZodSuccess");let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>(n.value=i.issues.length===0,n));return n.value=r.issues.length===0,n}}),Hm=g("$ZodCatch",(e,t)=>{re.init(e,t),e._zod.optin="optional",le(e._zod,"optout",()=>t.innerType._zod.optout),le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>{if(n.value=i.value,i.issues.length)n.value=t.catchValue({...n,error:{issues:i.issues.map((a)=>qe(a,o,ge()))},input:n.value}),n.issues=[],n.fallback=!0;return n});if(n.value=r.value,r.issues.length)n.value=t.catchValue({...n,error:{issues:r.issues.map((i)=>qe(i,o,ge()))},input:n.value}),n.issues=[],n.fallback=!0;return n}}),Ym=g("$ZodNaN",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>{if(typeof n.value!=="number"||!Number.isNaN(n.value))return n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n;return n}}),ms=g("$ZodPipe",(e,t)=>{re.init(e,t),le(e._zod,"values",()=>t.in._zod.values),le(e._zod,"optin",()=>t.in._zod.optin),le(e._zod,"optout",()=>t.out._zod.optout),le(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>os(a,t.in,o));return os(i,t.in,o)}let r=t.in._zod.run(n,o);if(r instanceof Promise)return r.then((i)=>os(i,t.out,o));return os(r,t.out,o)}});function os(e,t,n){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var ii=g("$ZodCodec",(e,t)=>{re.init(e,t),le(e._zod,"values",()=>t.in._zod.values),le(e._zod,"optin",()=>t.in._zod.optin),le(e._zod,"optout",()=>t.out._zod.optout),le(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>is(a,t,o));return is(i,t,o)}else{let i=t.out._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>is(a,t,o));return is(i,t,o)}}});function is(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);if(r instanceof Promise)return r.then((i)=>as(e,i,t.out,n));return as(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);if(r instanceof Promise)return r.then((i)=>as(e,i,t.in,n));return as(e,r,t.in,n)}}function as(e,t,n,o){if(e.issues.length)return e.aborted=!0,e;return n._zod.run({value:t,issues:e.issues},o)}var Gm=g("$ZodPreprocess",(e,t)=>{ms.init(e,t)}),Wm=g("$ZodReadonly",(e,t)=>{re.init(e,t),le(e._zod,"propValues",()=>t.innerType._zod.propValues),le(e._zod,"values",()=>t.innerType._zod.values),le(e._zod,"optin",()=>t.innerType?._zod?.optin),le(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);if(r instanceof Promise)return r.then(rS);return rS(r)}});function rS(e){return e.value=Object.freeze(e.value),e}var Xm=g("$ZodTemplateLiteral",(e,t)=>{re.init(e,t);let n=[];for(let o of t.parts)if(typeof o==="object"&&o!==null){if(!o._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,a=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,a))}else if(o===null||Ju.has(typeof o))n.push(st(`${o}`));else throw Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>{if(typeof o.value!=="string")return o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(o.value))return o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o;return o}}),Qm=g("$ZodFunction",(e,t)=>(re.init(e,t),e._def=t,e._zod.def=t,e.implement=(n)=>{if(typeof n!=="function")throw Error("implement() must be called with a function");return function(...o){let r=e._def.input?Za(e._def.input,o):o,i=Reflect.apply(n,this,r);if(e._def.output)return Za(e._def.output,i);return i}},e.implementAsync=(n)=>{if(typeof n!=="function")throw Error("implementAsync() must be called with a function");return async function(...o){let r=e._def.input?await Fa(e._def.input,o):o,i=await Reflect.apply(n,this,r);if(e._def.output)return await Fa(e._def.output,i);return i}},e._zod.parse=(n,o)=>{if(typeof n.value!=="function")return n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n;if(e._def.output&&e._def.output._zod.def.type==="promise")n.value=e.implementAsync(n.value);else n.value=e.implement(n.value);return n},e.input=(...n)=>{let o=e.constructor;if(Array.isArray(n[0]))return new o({type:"function",input:new us({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output});return new o({type:"function",input:n[0],output:e._def.output})},e.output=(n)=>new e.constructor({type:"function",input:e._def.input,output:n}),e)),ep=g("$ZodPromise",(e,t)=>{re.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then((r)=>t.innerType._zod.run({value:r,issues:[]},o))}),tp=g("$ZodLazy",(e,t)=>{re.init(e,t),le(e._zod,"innerType",()=>{let n=t;if(!n._cachedInner)n._cachedInner=t.getter();return n._cachedInner}),le(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),le(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),le(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),le(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),rp=g("$ZodCustom",(e,t)=>{fe.init(e,t),re.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=(n)=>{let o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then((i)=>nS(i,n,o,e));nS(r,n,o,e);return}});function nS(e,t,n,o){if(!e){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)r.params=o._zod.def.params;t.issues.push(or(r))}}var ui={};Ut(ui,{ar:()=>np,az:()=>op,be:()=>ip,bg:()=>ap,ca:()=>sp,cs:()=>cp,da:()=>lp,de:()=>up,el:()=>dp,en:()=>ai,eo:()=>mp,es:()=>pp,fa:()=>fp,fi:()=>hp,fr:()=>gp,frCA:()=>vp,he:()=>_p,hr:()=>Sp,hu:()=>yp,hy:()=>bp,id:()=>$p,is:()=>Rp,it:()=>zp,ja:()=>Tp,ka:()=>xp,kh:()=>kp,km:()=>si,ko:()=>Ep,lt:()=>wp,mk:()=>Ip,ms:()=>Pp,nl:()=>Op,no:()=>Cp,ota:()=>Np,pl:()=>Ap,ps:()=>jp,pt:()=>Mp,ro:()=>Up,ru:()=>qp,sl:()=>Lp,sv:()=>Dp,ta:()=>Zp,th:()=>Fp,tr:()=>Kp,ua:()=>Jp,uk:()=>li,ur:()=>Vp,uz:()=>Bp,vi:()=>Hp,yo:()=>Wp,zhCN:()=>Yp,zhTW:()=>Gp});var Pz=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(r){return e[r]??null}let n={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${r.expected}، ولكن تم إدخال ${s}`;return`مدخلات غير مقبولة: يفترض إدخال ${i}، ولكن تم إدخال ${s}`}case"invalid_value":if(r.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${k(r.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return` أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()} ${a.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()} ${a.unit}`;return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${r.prefix}"`;if(i.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`;if(i.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`;if(i.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`;return`${n[i.format]??r.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${r.divisor}`;case"unrecognized_keys":return`معرف${r.keys.length>1?"ات":""} غريب${r.keys.length>1?"ة":""}: ${y(r.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${r.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${r.origin}`;default:return"مدخل غير مقبول"}}};function np(){return{localeError:Pz()}}var Oz=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(r){return e[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Yanlış dəyər: gözlənilən instanceof ${r.expected}, daxil olan ${s}`;return`Yanlış dəyər: gözlənilən ${i}, daxil olan ${s}`}case"invalid_value":if(r.values.length===1)return`Yanlış dəyər: gözlənilən ${k(r.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()} ${a.unit??"element"}`;return`Çox böyük: gözlənilən ${r.origin??"dəyər"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`;return`Çox kiçik: gözlənilən ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`;if(i.format==="ends_with")return`Yanlış mətn: "${i.suffix}" ilə bitməlidir`;if(i.format==="includes")return`Yanlış mətn: "${i.includes}" daxil olmalıdır`;if(i.format==="regex")return`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${n[i.format]??r.format}`}case"not_multiple_of":return`Yanlış ədəd: ${r.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${r.keys.length>1?"lar":""}: ${y(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${r.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function op(){return{localeError:Oz()}}function lS(e,t,n,o){let r=Math.abs(e),i=r%10,a=r%100;if(a>=11&&a<=19)return o;if(i===1)return t;if(i>=2&&i<=4)return n;return o}var Cz=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(r){return e[r]??null}let n={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},o={nan:"NaN",number:"лік",array:"масіў"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Няправільны ўвод: чакаўся instanceof ${r.expected}, атрымана ${s}`;return`Няправільны ўвод: чакаўся ${i}, атрымана ${s}`}case"invalid_value":if(r.values.length===1)return`Няправільны ўвод: чакалася ${k(r.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let s=Number(r.maximum),c=lS(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна ${a.verb} ${i}${r.maximum.toString()} ${c}`}return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна быць ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let s=Number(r.minimum),c=lS(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${r.origin} павінна ${a.verb} ${i}${r.minimum.toString()} ${c}`}return`Занадта малы: чакалася, што ${r.origin} павінна быць ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${i.prefix}"`;if(i.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${i.suffix}"`;if(i.format==="includes")return`Няправільны радок: павінен змяшчаць "${i.includes}"`;if(i.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`;return`Няправільны ${n[i.format]??r.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${r.keys.length>1?"ключы":"ключ"}: ${y(r.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${r.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${r.origin}`;default:return"Няправільны ўвод"}}};function ip(){return{localeError:Cz()}}var Nz=()=>{let e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(r){return e[r]??null}let n={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},o={nan:"NaN",number:"число",array:"масив"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Невалиден вход: очакван instanceof ${r.expected}, получен ${s}`;return`Невалиден вход: очакван ${i}, получен ${s}`}case"invalid_value":if(r.values.length===1)return`Невалиден вход: очакван ${k(r.values[0])}`;return`Невалидна опция: очаквано едно от ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Твърде голямо: очаква се ${r.origin??"стойност"} да съдържа ${i}${r.maximum.toString()} ${a.unit??"елемента"}`;return`Твърде голямо: очаква се ${r.origin??"стойност"} да бъде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Твърде малко: очаква се ${r.origin} да съдържа ${i}${r.minimum.toString()} ${a.unit}`;return`Твърде малко: очаква се ${r.origin} да бъде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Невалиден низ: трябва да започва с "${i.prefix}"`;if(i.format==="ends_with")return`Невалиден низ: трябва да завършва с "${i.suffix}"`;if(i.format==="includes")return`Невалиден низ: трябва да включва "${i.includes}"`;if(i.format==="regex")return`Невалиден низ: трябва да съвпада с ${i.pattern}`;let a="Невалиден";if(i.format==="emoji")a="Невалидно";if(i.format==="datetime")a="Невалидно";if(i.format==="date")a="Невалидна";if(i.format==="time")a="Невалидно";if(i.format==="duration")a="Невалидна";return`${a} ${n[i.format]??r.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${r.divisor}`;case"unrecognized_keys":return`Неразпознат${r.keys.length>1?"и":""} ключ${r.keys.length>1?"ове":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${r.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${r.origin}`;default:return"Невалиден вход"}}};function ap(){return{localeError:Nz()}}var jz=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Tipus invàlid: s'esperava instanceof ${r.expected}, s'ha rebut ${s}`;return`Tipus invàlid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":if(r.values.length===1)return`Valor invàlid: s'esperava ${k(r.values[0])}`;return`Opció invàlida: s'esperava una de ${y(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a màxim":"menys de",a=t(r.origin);if(a)return`Massa gran: s'esperava que ${r.origin??"el valor"} contingués ${i} ${r.maximum.toString()} ${a.unit??"elements"}`;return`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a mínim":"més de",a=t(r.origin);if(a)return`Massa petit: s'esperava que ${r.origin} contingués ${i} ${r.minimum.toString()} ${a.unit}`;return`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Format invàlid: ha de començar amb "${i.prefix}"`;if(i.format==="ends_with")return`Format invàlid: ha d'acabar amb "${i.suffix}"`;if(i.format==="includes")return`Format invàlid: ha d'incloure "${i.includes}"`;if(i.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${i.pattern}`;return`Format invàlid per a ${n[i.format]??r.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${r.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${r.origin}`;default:return"Entrada invàlida"}}};function sp(){return{localeError:jz()}}var Az=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(r){return e[r]??null}let n={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Neplatný vstup: očekáváno instanceof ${r.expected}, obdrženo ${s}`;return`Neplatný vstup: očekáváno ${i}, obdrženo ${s}`}case"invalid_value":if(r.values.length===1)return`Neplatný vstup: očekáváno ${k(r.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Hodnota je příliš velká: ${r.origin??"hodnota"} musí mít ${i}${r.maximum.toString()} ${a.unit??"prvků"}`;return`Hodnota je příliš velká: ${r.origin??"hodnota"} musí být ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Hodnota je příliš malá: ${r.origin??"hodnota"} musí mít ${i}${r.minimum.toString()} ${a.unit??"prvků"}`;return`Hodnota je příliš malá: ${r.origin??"hodnota"} musí být ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neplatný řetězec: musí začínat na "${i.prefix}"`;if(i.format==="ends_with")return`Neplatný řetězec: musí končit na "${i.suffix}"`;if(i.format==="includes")return`Neplatný řetězec: musí obsahovat "${i.includes}"`;if(i.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${i.pattern}`;return`Neplatný formát ${n[i.format]??r.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${r.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${y(r.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${r.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${r.origin}`;default:return"Neplatný vstup"}}};function cp(){return{localeError:Az()}}var Mz=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(r){return e[r]??null}let n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Ugyldigt input: forventede instanceof ${r.expected}, fik ${s}`;return`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":if(r.values.length===1)return`Ugyldig værdi: forventede ${k(r.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),s=o[r.origin]??r.origin;if(a)return`For stor: forventede ${s??"value"} ${a.verb} ${i} ${r.maximum.toString()} ${a.unit??"elementer"}`;return`For stor: forventede ${s??"value"} havde ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),s=o[r.origin]??r.origin;if(a)return`For lille: forventede ${s} ${a.verb} ${i} ${r.minimum.toString()} ${a.unit}`;return`For lille: forventede ${s} havde ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ugyldig streng: skal starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: skal ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: skal indeholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: skal matche mønsteret ${i.pattern}`;return`Ugyldig ${n[i.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${y(r.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${r.origin}`;default:return"Ugyldigt input"}}};function lp(){return{localeError:Mz()}}var Uz=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Ungültige Eingabe: erwartet instanceof ${r.expected}, erhalten ${s}`;return`Ungültige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":if(r.values.length===1)return`Ungültige Eingabe: erwartet ${k(r.values[0])}`;return`Ungültige Option: erwartet eine von ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${a.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${a.unit} hat`;return`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ungültiger String: muss mit "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ungültiger String: muss mit "${i.suffix}" enden`;if(i.format==="includes")return`Ungültiger String: muss "${i.includes}" enthalten`;if(i.format==="regex")return`Ungültiger String: muss dem Muster ${i.pattern} entsprechen`;return`Ungültig: ${n[i.format]??r.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${y(r.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${r.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${r.origin}`;default:return"Ungültige Eingabe"}}};function up(){return{localeError:Uz()}}var qz=()=>{let e={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}};function t(r){return e[r]??null}let n={regex:"είσοδος",email:"διεύθυνση email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ημερομηνία και ώρα",date:"ISO ημερομηνία",time:"ISO ώρα",duration:"ISO διάρκεια",ipv4:"διεύθυνση IPv4",ipv6:"διεύθυνση IPv6",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",jwt:"JWT",template_literal:"είσοδος"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(typeof r.expected==="string"&&/^[A-Z]/.test(r.expected))return`Μη έγκυρη είσοδος: αναμενόταν instanceof ${r.expected}, λήφθηκε ${s}`;return`Μη έγκυρη είσοδος: αναμενόταν ${i}, λήφθηκε ${s}`}case"invalid_value":if(r.values.length===1)return`Μη έγκυρη είσοδος: αναμενόταν ${k(r.values[0])}`;return`Μη έγκυρη επιλογή: αναμενόταν ένα από ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Πολύ μεγάλο: αναμενόταν ${r.origin??"τιμή"} να έχει ${i}${r.maximum.toString()} ${a.unit??"στοιχεία"}`;return`Πολύ μεγάλο: αναμενόταν ${r.origin??"τιμή"} να είναι ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Πολύ μικρό: αναμενόταν ${r.origin} να έχει ${i}${r.minimum.toString()} ${a.unit}`;return`Πολύ μικρό: αναμενόταν ${r.origin} να είναι ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${i.prefix}"`;if(i.format==="ends_with")return`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${i.suffix}"`;if(i.format==="includes")return`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${i.includes}"`;if(i.format==="regex")return`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${i.pattern}`;return`Μη έγκυρο: ${n[i.format]??r.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${r.divisor}`;case"unrecognized_keys":return`Άγνωστ${r.keys.length>1?"α":"ο"} κλειδ${r.keys.length>1?"ιά":"ί"}: ${y(r.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${r.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${r.origin}`;default:return"Μη έγκυρη είσοδος"}}};function dp(){return{localeError:qz()}}var Lz=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(r){return e[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":if(r.values.length===1)return`Invalid input: expected ${k(r.values[0])}`;return`Invalid option: expected one of ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Too big: expected ${r.origin??"value"} to have ${i}${r.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Too small: expected ${r.origin} to have ${i}${r.minimum.toString()} ${a.unit}`;return`Too small: expected ${r.origin} to be ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":if(r.options&&Array.isArray(r.options)&&r.options.length>0)return`Invalid discriminator value. Expected ${r.options.map((a)=>`'${a}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function ai(){return{localeError:Lz()}}var Dz=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Nevalida enigo: atendiĝis instanceof ${r.expected}, riceviĝis ${s}`;return`Nevalida enigo: atendiĝis ${i}, riceviĝis ${s}`}case"invalid_value":if(r.values.length===1)return`Nevalida enigo: atendiĝis ${k(r.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()} ${a.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Tro malgranda: atendiĝis ke ${r.origin} havu ${i}${r.minimum.toString()} ${a.unit}`;return`Tro malgranda: atendiĝis ke ${r.origin} estu ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${i.prefix}"`;if(i.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${i.suffix}"`;if(i.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${i.includes}"`;if(i.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`;return`Nevalida ${n[i.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} ŝlosilo${r.keys.length>1?"j":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function mp(){return{localeError:Dz()}}var Zz=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let n={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Entrada inválida: se esperaba instanceof ${r.expected}, recibido ${s}`;return`Entrada inválida: se esperaba ${i}, recibido ${s}`}case"invalid_value":if(r.values.length===1)return`Entrada inválida: se esperaba ${k(r.values[0])}`;return`Opción inválida: se esperaba una de ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),s=o[r.origin]??r.origin;if(a)return`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${r.maximum.toString()} ${a.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),s=o[r.origin]??r.origin;if(a)return`Demasiado pequeño: se esperaba que ${s} tuviera ${i}${r.minimum.toString()} ${a.unit}`;return`Demasiado pequeño: se esperaba que ${s} fuera ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Cadena inválida: debe comenzar con "${i.prefix}"`;if(i.format==="ends_with")return`Cadena inválida: debe terminar en "${i.suffix}"`;if(i.format==="includes")return`Cadena inválida: debe incluir "${i.includes}"`;if(i.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${i.pattern}`;return`Inválido ${n[i.format]??r.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Llave inválida en ${o[r.origin]??r.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${o[r.origin]??r.origin}`;default:return"Entrada inválida"}}};function pp(){return{localeError:Zz()}}var Fz=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(r){return e[r]??null}let n={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},o={nan:"NaN",number:"عدد",array:"آرایه"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`ورودی نامعتبر: می‌بایست instanceof ${r.expected} می‌بود، ${s} دریافت شد`;return`ورودی نامعتبر: می‌بایست ${i} می‌بود، ${s} دریافت شد`}case"invalid_value":if(r.values.length===1)return`ورودی نامعتبر: می‌بایست ${k(r.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${y(r.values,"|")} می‌بود`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} ${a.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${i}${r.maximum.toString()} باشد`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} ${a.unit} باشد`;return`خیلی کوچک: ${r.origin} باید ${i}${r.minimum.toString()} باشد`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`رشته نامعتبر: باید با "${i.prefix}" شروع شود`;if(i.format==="ends_with")return`رشته نامعتبر: باید با "${i.suffix}" تمام شود`;if(i.format==="includes")return`رشته نامعتبر: باید شامل "${i.includes}" باشد`;if(i.format==="regex")return`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`;return`${n[i.format]??r.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${r.divisor} باشد`;case"unrecognized_keys":return`کلید${r.keys.length>1?"های":""} ناشناس: ${y(r.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${r.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${r.origin}`;default:return"ورودی نامعتبر"}}};function fp(){return{localeError:Fz()}}var Kz=()=>{let e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(r){return e[r]??null}let n={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${s}`;return`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":if(r.values.length===1)return`Virheellinen syöte: täytyy olla ${k(r.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Liian suuri: ${a.subject} täytyy olla ${i}${r.maximum.toString()} ${a.unit}`.trim();return`Liian suuri: arvon täytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Liian pieni: ${a.subject} täytyy olla ${i}${r.minimum.toString()} ${a.unit}`.trim();return`Liian pieni: arvon täytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${i.prefix}"`;if(i.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${i.suffix}"`;if(i.format==="includes")return`Virheellinen syöte: täytyy sisältää "${i.includes}"`;if(i.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${i.pattern}`;return`Virheellinen ${n[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${y(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function hp(){return{localeError:Kz()}}var Jz=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},o={string:"chaîne",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Entrée invalide : instanceof ${r.expected} attendu, ${s} reçu`;return`Entrée invalide : ${i} attendu, ${s} reçu`}case"invalid_value":if(r.values.length===1)return`Entrée invalide : ${k(r.values[0])} attendu`;return`Option invalide : une valeur parmi ${y(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Trop grand : ${o[r.origin]??"valeur"} doit ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"élément(s)"}`;return`Trop grand : ${o[r.origin]??"valeur"} doit être ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Trop petit : ${o[r.origin]??"valeur"} doit ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Trop petit : ${o[r.origin]??"valeur"} doit être ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${i.pattern}`;return`${n[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${y(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};function gp(){return{localeError:Jz()}}var Vz=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Entrée invalide : attendu instanceof ${r.expected}, reçu ${s}`;return`Entrée invalide : attendu ${i}, reçu ${s}`}case"invalid_value":if(r.values.length===1)return`Entrée invalide : attendu ${k(r.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"≤":"<",a=t(r.origin);if(a)return`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${a.unit}`;return`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"≥":">",a=t(r.origin);if(a)return`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${a.unit}`;return`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au motif ${i.pattern}`;return`${n[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${r.divisor}`;case"unrecognized_keys":return`Clé${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${y(r.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${r.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entrée invalide"}}};function vp(){return{localeError:Vz()}}var Bz=()=>{let e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},n=(u)=>u?e[u]:void 0,o=(u)=>{let d=n(u);if(d)return d.label;return u??e.unknown.label},r=(u)=>`ה${o(u)}`,i=(u)=>(n(u)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",a=(u)=>{if(!u)return null;return t[u]??null},s={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},c={nan:"NaN"};return(u)=>{switch(u.code){case"invalid_type":{let d=u.expected,m=c[d??""]??o(d),p=w(u.input),h=c[p]??e[p]?.label??p;if(/^[A-Z]/.test(u.expected))return`קלט לא תקין: צריך להיות instanceof ${u.expected}, התקבל ${h}`;return`קלט לא תקין: צריך להיות ${m}, התקבל ${h}`}case"invalid_value":{if(u.values.length===1)return`ערך לא תקין: הערך חייב להיות ${k(u.values[0])}`;let d=u.values.map((h)=>k(h));if(u.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${d[0]} או ${d[1]}`;let m=d[d.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${d.slice(0,-1).join(", ")} או ${m}`}case"too_big":{let d=a(u.origin),m=r(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"ארוך"} מדי: ${m} צריכה להכיל ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"או פחות":"לכל היותר"}`.trim();if(u.origin==="number"){let b=u.inclusive?`קטן או שווה ל-${u.maximum}`:`קטן מ-${u.maximum}`;return`גדול מדי: ${m} צריך להיות ${b}`}if(u.origin==="array"||u.origin==="set"){let b=u.origin==="set"?"צריכה":"צריך",R=u.inclusive?`${u.maximum} ${d?.unit??""} או פחות`:`פחות מ-${u.maximum} ${d?.unit??""}`;return`גדול מדי: ${m} ${b} להכיל ${R}`.trim()}let p=u.inclusive?"<=":"<",h=i(u.origin??"value");if(d?.unit)return`${d.longLabel} מדי: ${m} ${h} ${p}${u.maximum.toString()} ${d.unit}`;return`${d?.longLabel??"גדול"} מדי: ${m} ${h} ${p}${u.maximum.toString()}`}case"too_small":{let d=a(u.origin),m=r(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"קצר"} מדי: ${m} צריכה להכיל ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"או יותר":"לפחות"}`.trim();if(u.origin==="number"){let b=u.inclusive?`גדול או שווה ל-${u.minimum}`:`גדול מ-${u.minimum}`;return`קטן מדי: ${m} צריך להיות ${b}`}if(u.origin==="array"||u.origin==="set"){let b=u.origin==="set"?"צריכה":"צריך";if(u.minimum===1&&u.inclusive){let z=u.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${m} ${b} להכיל ${z}`}let R=u.inclusive?`${u.minimum} ${d?.unit??""} או יותר`:`יותר מ-${u.minimum} ${d?.unit??""}`;return`קטן מדי: ${m} ${b} להכיל ${R}`.trim()}let p=u.inclusive?">=":">",h=i(u.origin??"value");if(d?.unit)return`${d.shortLabel} מדי: ${m} ${h} ${p}${u.minimum.toString()} ${d.unit}`;return`${d?.shortLabel??"קטן"} מדי: ${m} ${h} ${p}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${d.prefix}"`;if(d.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${d.suffix}"`;if(d.format==="includes")return`המחרוזת חייבת לכלול "${d.includes}"`;if(d.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${d.pattern}`;let m=s[d.format],p=m?.label??d.format,b=(m?.gender??"m")==="f"?"תקינה":"תקין";return`${p} לא ${b}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${u.divisor}`;case"unrecognized_keys":return`מפתח${u.keys.length>1?"ות":""} לא מזוה${u.keys.length>1?"ים":"ה"}: ${y(u.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${r(u.origin??"array")}`;default:return"קלט לא תקין"}}};function _p(){return{localeError:Bz()}}var Hz=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(r){return e[r]??null}let n={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Neispravan unos: očekuje se instanceof ${r.expected}, a primljeno je ${s}`;return`Neispravan unos: očekuje se ${i}, a primljeno je ${s}`}case"invalid_value":if(r.values.length===1)return`Neispravna vrijednost: očekivano ${k(r.values[0])}`;return`Neispravna opcija: očekivano jedno od ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),s=o[r.origin]??r.origin;if(a)return`Preveliko: očekivano da ${s??"vrijednost"} ima ${i}${r.maximum.toString()} ${a.unit??"elemenata"}`;return`Preveliko: očekivano da ${s??"vrijednost"} bude ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),s=o[r.origin]??r.origin;if(a)return`Premalo: očekivano da ${s} ima ${i}${r.minimum.toString()} ${a.unit}`;return`Premalo: očekivano da ${s} bude ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neispravan tekst: mora započinjati s "${i.prefix}"`;if(i.format==="ends_with")return`Neispravan tekst: mora završavati s "${i.suffix}"`;if(i.format==="includes")return`Neispravan tekst: mora sadržavati "${i.includes}"`;if(i.format==="regex")return`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`;return`Neispravna ${n[i.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i ključevi":" ključ"}: ${y(r.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${o[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[r.origin]??r.origin}`;default:return"Neispravan unos"}}};function Sp(){return{localeError:Hz()}}var Yz=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"szám",array:"tömb"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Érvénytelen bemenet: a várt érték instanceof ${r.expected}, a kapott érték ${s}`;return`Érvénytelen bemenet: a várt érték ${i}, a kapott érték ${s}`}case"invalid_value":if(r.values.length===1)return`Érvénytelen bemenet: a várt érték ${k(r.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Túl nagy: ${r.origin??"érték"} mérete túl nagy ${i}${r.maximum.toString()} ${a.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${r.origin??"érték"} túl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Túl kicsi: a bemeneti érték ${r.origin} mérete túl kicsi ${i}${r.minimum.toString()} ${a.unit}`;return`Túl kicsi: a bemeneti érték ${r.origin} túl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Érvénytelen string: "${i.prefix}" értékkel kell kezdődnie`;if(i.format==="ends_with")return`Érvénytelen string: "${i.suffix}" értékkel kell végződnie`;if(i.format==="includes")return`Érvénytelen string: "${i.includes}" értéket kell tartalmaznia`;if(i.format==="regex")return`Érvénytelen string: ${i.pattern} mintának kell megfelelnie`;return`Érvénytelen ${n[i.format]??r.format}`}case"not_multiple_of":return`Érvénytelen szám: ${r.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${r.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${r.origin}`;default:return"Érvénytelen bemenet"}}};function yp(){return{localeError:Yz()}}function uS(e,t,n){return Math.abs(e)===1?t:n}function xn(e){if(!e)return"";let t=["ա","ե","ը","ի","ո","ու","օ"],n=e[e.length-1];return e+(t.includes(n)?"ն":"ը")}var Gz=()=>{let e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(r){return e[r]??null}let n={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},o={nan:"NaN",number:"թիվ",array:"զանգված"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${r.expected}, ստացվել է ${s}`;return`Սխալ մուտքագրում․ սպասվում էր ${i}, ստացվել է ${s}`}case"invalid_value":if(r.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${k(r.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let s=Number(r.maximum),c=uS(s,a.unit.one,a.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${xn(r.origin??"արժեք")} կունենա ${i}${r.maximum.toString()} ${c}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${xn(r.origin??"արժեք")} լինի ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let s=Number(r.minimum),c=uS(s,a.unit.one,a.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${xn(r.origin)} կունենա ${i}${r.minimum.toString()} ${c}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${xn(r.origin)} լինի ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${i.prefix}"-ով`;if(i.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${i.suffix}"-ով`;if(i.format==="includes")return`Սխալ տող․ պետք է պարունակի "${i.includes}"`;if(i.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${i.pattern} ձևաչափին`;return`Սխալ ${n[i.format]??r.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${r.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${r.keys.length>1?"ներ":""}. ${y(r.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${xn(r.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${xn(r.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function bp(){return{localeError:Gz()}}var Wz=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${s}`;return`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":if(r.values.length===1)return`Input tidak valid: diharapkan ${k(r.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${a.unit??"elemen"}`;return`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${a.unit}`;return`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`String tidak valid: harus dimulai dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak valid: harus berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak valid: harus menyertakan "${i.includes}"`;if(i.format==="regex")return`String tidak valid: harus sesuai pola ${i.pattern}`;return`${n[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function $p(){return{localeError:Wz()}}var Xz=()=>{let e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(r){return e[r]??null}let n={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"númer",array:"fylki"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Rangt gildi: Þú slóst inn ${s} þar sem á að vera instanceof ${r.expected}`;return`Rangt gildi: Þú slóst inn ${s} þar sem á að vera ${i}`}case"invalid_value":if(r.values.length===1)return`Rangt gildi: gert ráð fyrir ${k(r.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} hafi ${i}${r.maximum.toString()} ${a.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${r.origin??"gildi"} sé ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Of lítið: gert er ráð fyrir að ${r.origin} hafi ${i}${r.minimum.toString()} ${a.unit}`;return`Of lítið: gert er ráð fyrir að ${r.origin} sé ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ógildur strengur: verður að byrja á "${i.prefix}"`;if(i.format==="ends_with")return`Ógildur strengur: verður að enda á "${i.suffix}"`;if(i.format==="includes")return`Ógildur strengur: verður að innihalda "${i.includes}"`;if(i.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${i.pattern}`;return`Rangt ${n[i.format]??r.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`Óþekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${y(r.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${r.origin}`;default:return"Rangt gildi"}}};function Rp(){return{localeError:Xz()}}var Qz=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Input non valido: atteso instanceof ${r.expected}, ricevuto ${s}`;return`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":if(r.values.length===1)return`Input non valido: atteso ${k(r.values[0])}`;return`Opzione non valida: atteso uno tra ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${a.unit??"elementi"}`;return`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${a.unit}`;return`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Stringa non valida: deve iniziare con "${i.prefix}"`;if(i.format==="ends_with")return`Stringa non valida: deve terminare con "${i.suffix}"`;if(i.format==="includes")return`Stringa non valida: deve includere "${i.includes}"`;if(i.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${i.pattern}`;return`Input non valido: ${n[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${y(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function zp(){return{localeError:Qz()}}var eT=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(r){return e[r]??null}let n={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},o={nan:"NaN",number:"数値",array:"配列"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`無効な入力: instanceof ${r.expected}が期待されましたが、${s}が入力されました`;return`無効な入力: ${i}が期待されましたが、${s}が入力されました`}case"invalid_value":if(r.values.length===1)return`無効な入力: ${k(r.values[0])}が期待されました`;return`無効な選択: ${y(r.values,"、")}のいずれかである必要があります`;case"too_big":{let i=r.inclusive?"以下である":"より小さい",a=t(r.origin);if(a)return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${a.unit??"要素"}${i}必要があります`;return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${i}必要があります`}case"too_small":{let i=r.inclusive?"以上である":"より大きい",a=t(r.origin);if(a)return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${a.unit}${i}必要があります`;return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${i}必要があります`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`無効な文字列: "${i.prefix}"で始まる必要があります`;if(i.format==="ends_with")return`無効な文字列: "${i.suffix}"で終わる必要があります`;if(i.format==="includes")return`無効な文字列: "${i.includes}"を含む必要があります`;if(i.format==="regex")return`無効な文字列: パターン${i.pattern}に一致する必要があります`;return`無効な${n[i.format]??r.format}`}case"not_multiple_of":return`無効な数値: ${r.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${r.keys.length>1?"群":""}: ${y(r.keys,"、")}`;case"invalid_key":return`${r.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${r.origin}内の無効な値`;default:return"無効な入力"}}};function Tp(){return{localeError:eT()}}var tT=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(r){return e[r]??null}let n={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული ველი",base64url:"base64url-კოდირებული ველი",json_string:"JSON ველი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},o={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${r.expected}, მიღებული ${s}`;return`არასწორი შეყვანა: მოსალოდნელი ${i}, მიღებული ${s}`}case"invalid_value":if(r.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${k(r.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${y(r.values,"|")}-დან`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} იყოს ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`ზედმეტად პატარა: მოსალოდნელი ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${r.origin} იყოს ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`არასწორი ველი: უნდა იწყებოდეს "${i.prefix}"-ით`;if(i.format==="ends_with")return`არასწორი ველი: უნდა მთავრდებოდეს "${i.suffix}"-ით`;if(i.format==="includes")return`არასწორი ველი: უნდა შეიცავდეს "${i.includes}"-ს`;if(i.format==="regex")return`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${i.pattern}`;return`არასწორი ${n[i.format]??r.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${r.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${r.keys.length>1?"ები":"ი"}: ${y(r.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${r.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${r.origin}-ში`;default:return"არასწორი შეყვანა"}}};function xp(){return{localeError:tT()}}var rT=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(r){return e[r]??null}let n={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},o={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${r.expected} ប៉ុន្តែទទួលបាន ${s}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${i} ប៉ុន្តែទទួលបាន ${s}`}case"invalid_value":if(r.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${k(r.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()} ${a.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()} ${a.unit}`;return`តូចពេក៖ ត្រូវការ ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`;if(i.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`;if(i.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`;if(i.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`;return`មិនត្រឹមត្រូវ៖ ${n[i.format]??r.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${r.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${y(r.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function si(){return{localeError:rT()}}function kp(){return si()}var nT=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(r){return e[r]??null}let n={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`잘못된 입력: 예상 타입은 instanceof ${r.expected}, 받은 타입은 ${s}입니다`;return`잘못된 입력: 예상 타입은 ${i}, 받은 타입은 ${s}입니다`}case"invalid_value":if(r.values.length===1)return`잘못된 입력: 값은 ${k(r.values[0])} 이어야 합니다`;return`잘못된 옵션: ${y(r.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let i=r.inclusive?"이하":"미만",a=i==="미만"?"이어야 합니다":"여야 합니다",s=t(r.origin),c=s?.unit??"요소";if(s)return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()}${c} ${i}${a}`;return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()} ${i}${a}`}case"too_small":{let i=r.inclusive?"이상":"초과",a=i==="이상"?"이어야 합니다":"여야 합니다",s=t(r.origin),c=s?.unit??"요소";if(s)return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()}${c} ${i}${a}`;return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`;if(i.format==="ends_with")return`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`;if(i.format==="includes")return`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`;if(i.format==="regex")return`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${n[i.format]??r.format}`}case"not_multiple_of":return`잘못된 숫자: ${r.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${y(r.keys,", ")}`;case"invalid_key":return`잘못된 키: ${r.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${r.origin}`;default:return"잘못된 입력"}}};function Ep(){return{localeError:nT()}}var ci=(e)=>e.charAt(0).toUpperCase()+e.slice(1);function dS(e){let t=Math.abs(e),n=t%10,o=t%100;if(o>=11&&o<=19||n===0)return"many";if(n===1)return"one";return"few"}var oT=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(r,i,a,s){let c=e[r]??null;if(c===null)return c;return{unit:c.unit[i],verb:c.verb[s][a?"inclusive":"notInclusive"]}}let n={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},o={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Gautas tipas ${s}, o tikėtasi - instanceof ${r.expected}`;return`Gautas tipas ${s}, o tikėtasi - ${i}`}case"invalid_value":if(r.values.length===1)return`Privalo būti ${k(r.values[0])}`;return`Privalo būti vienas iš ${y(r.values,"|")} pasirinkimų`;case"too_big":{let i=o[r.origin]??r.origin,a=t(r.origin,dS(Number(r.maximum)),r.inclusive??!1,"smaller");if(a?.verb)return`${ci(i??r.origin??"reikšmė")} ${a.verb} ${r.maximum.toString()} ${a.unit??"elementų"}`;let s=r.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${ci(i??r.origin??"reikšmė")} turi būti ${s} ${r.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[r.origin]??r.origin,a=t(r.origin,dS(Number(r.minimum)),r.inclusive??!1,"bigger");if(a?.verb)return`${ci(i??r.origin??"reikšmė")} ${a.verb} ${r.minimum.toString()} ${a.unit??"elementų"}`;let s=r.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${ci(i??r.origin??"reikšmė")} turi būti ${s} ${r.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Eilutė privalo prasidėti "${i.prefix}"`;if(i.format==="ends_with")return`Eilutė privalo pasibaigti "${i.suffix}"`;if(i.format==="includes")return`Eilutė privalo įtraukti "${i.includes}"`;if(i.format==="regex")return`Eilutė privalo atitikti ${i.pattern}`;return`Neteisingas ${n[i.format]??r.format}`}case"not_multiple_of":return`Skaičius privalo būti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${y(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let i=o[r.origin]??r.origin;return`${ci(i??r.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function wp(){return{localeError:oT()}}var iT=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(r){return e[r]??null}let n={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},o={nan:"NaN",number:"број",array:"низа"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Грешен внес: се очекува instanceof ${r.expected}, примено ${s}`;return`Грешен внес: се очекува ${i}, примено ${s}`}case"invalid_value":if(r.values.length===1)return`Invalid input: expected ${k(r.values[0])}`;return`Грешана опција: се очекува една ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Премногу голем: се очекува ${r.origin??"вредноста"} да има ${i}${r.maximum.toString()} ${a.unit??"елементи"}`;return`Премногу голем: се очекува ${r.origin??"вредноста"} да биде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Премногу мал: се очекува ${r.origin} да има ${i}${r.minimum.toString()} ${a.unit}`;return`Премногу мал: се очекува ${r.origin} да биде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неважечка низа: мора да започнува со "${i.prefix}"`;if(i.format==="ends_with")return`Неважечка низа: мора да завршува со "${i.suffix}"`;if(i.format==="includes")return`Неважечка низа: мора да вклучува "${i.includes}"`;if(i.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${i.pattern}`;return`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${y(r.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${r.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${r.origin}`;default:return"Грешен внес"}}};function Ip(){return{localeError:iT()}}var aT=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${s}`;return`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":if(r.values.length===1)return`Input tidak sah: dijangka ${k(r.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Terlalu besar: dijangka ${r.origin??"nilai"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"elemen"}`;return`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Terlalu kecil: dijangka ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`String tidak sah: mesti bermula dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak sah: mesti mengandungi "${i.includes}"`;if(i.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${i.pattern}`;return`${n[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${y(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function Pp(){return{localeError:aT()}}var sT=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(r){return e[r]??null}let n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${s}`;return`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":if(r.values.length===1)return`Ongeldige invoer: verwacht ${k(r.values[0])}`;return`Ongeldige optie: verwacht één van ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin),s=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";if(a)return`Te ${s}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`;return`Te ${s}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin),s=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";if(a)return`Te ${s}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ${a.verb}`;return`Te ${s}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ongeldige tekst: moet met "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ongeldige tekst: moet op "${i.suffix}" eindigen`;if(i.format==="includes")return`Ongeldige tekst: moet "${i.includes}" bevatten`;if(i.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`;return`Ongeldig: ${n[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function Op(){return{localeError:sT()}}var cT=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(r){return e[r]??null}let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Ugyldig input: forventet instanceof ${r.expected}, fikk ${s}`;return`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":if(r.values.length===1)return`Ugyldig verdi: forventet ${k(r.values[0])}`;return`Ugyldig valg: forventet en av ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()} ${a.unit??"elementer"}`;return`For stor(t): forventet ${r.origin??"value"} til å ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()} ${a.unit}`;return`For lite(n): forventet ${r.origin} til å ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ugyldig streng: må starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: må ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: må inneholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: må matche mønsteret ${i.pattern}`;return`Ugyldig ${n[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${y(r.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function Cp(){return{localeError:cT()}}var lT=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(r){return e[r]??null}let n={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Fâsit giren: umulan instanceof ${r.expected}, alınan ${s}`;return`Fâsit giren: umulan ${i}, alınan ${s}`}case"invalid_value":if(r.values.length===1)return`Fâsit giren: umulan ${k(r.values[0])}`;return`Fâsit tercih: mûteberler ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmalıydı.`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} ${a.unit} sahip olmalıydı.`;return`Fazla küçük: ${r.origin}, ${i}${r.minimum.toString()} olmalıydı.`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Fâsit metin: "${i.prefix}" ile başlamalı.`;if(i.format==="ends_with")return`Fâsit metin: "${i.suffix}" ile bitmeli.`;if(i.format==="includes")return`Fâsit metin: "${i.includes}" ihtivâ etmeli.`;if(i.format==="regex")return`Fâsit metin: ${i.pattern} nakşına uymalı.`;return`Fâsit ${n[i.format]??r.format}`}case"not_multiple_of":return`Fâsit sayı: ${r.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`${r.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${r.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function Np(){return{localeError:lT()}}var uT=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(r){return e[r]??null}let n={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},o={nan:"NaN",number:"عدد",array:"ارې"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`ناسم ورودي: باید instanceof ${r.expected} وای, مګر ${s} ترلاسه شو`;return`ناسم ورودي: باید ${i} وای, مګر ${s} ترلاسه شو`}case"invalid_value":if(r.values.length===1)return`ناسم ورودي: باید ${k(r.values[0])} وای`;return`ناسم انتخاب: باید یو له ${y(r.values,"|")} څخه وای`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} ${a.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${r.origin??"ارزښت"} باید ${i}${r.maximum.toString()} وي`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} ${a.unit} ولري`;return`ډیر کوچنی: ${r.origin} باید ${i}${r.minimum.toString()} وي`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`ناسم متن: باید د "${i.prefix}" سره پیل شي`;if(i.format==="ends_with")return`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`;if(i.format==="includes")return`ناسم متن: باید "${i.includes}" ولري`;if(i.format==="regex")return`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`;return`${n[i.format]??r.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${r.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${r.keys.length>1?"کلیډونه":"کلیډ"}: ${y(r.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${r.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${r.origin} کې`;default:return"ناسمه ورودي"}}};function jp(){return{localeError:uT()}}var dT=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(r){return e[r]??null}let n={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},o={nan:"NaN",number:"liczba",array:"tablica"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${r.expected}, otrzymano ${s}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":if(r.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${k(r.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Za duża wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.maximum.toString()} ${a.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Za mała wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${i}${r.minimum.toString()} ${a.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${i.prefix}"`;if(i.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${i.suffix}"`;if(i.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${i.includes}"`;if(i.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${i.pattern}`;return`Nieprawidłow(y/a/e) ${n[i.format]??r.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${r.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${r.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Ap(){return{localeError:dT()}}var mT=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let n={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"número",null:"nulo"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Tipo inválido: esperado instanceof ${r.expected}, recebido ${s}`;return`Tipo inválido: esperado ${i}, recebido ${s}`}case"invalid_value":if(r.values.length===1)return`Entrada inválida: esperado ${k(r.values[0])}`;return`Opção inválida: esperada uma das ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${a.unit??"elementos"}`;return`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${a.unit}`;return`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Texto inválido: deve começar com "${i.prefix}"`;if(i.format==="ends_with")return`Texto inválido: deve terminar com "${i.suffix}"`;if(i.format==="includes")return`Texto inválido: deve incluir "${i.includes}"`;if(i.format==="regex")return`Texto inválido: deve corresponder ao padrão ${i.pattern}`;return`${n[i.format]??r.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Chave inválida em ${r.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${r.origin}`;default:return"Campo inválido"}}};function Mp(){return{localeError:mT()}}var pT=()=>{let e={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}};function t(r){return e[r]??null}let n={regex:"intrare",email:"adresă de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;return`Intrare invalidă: așteptat ${i}, primit ${s}`}case"invalid_value":if(r.values.length===1)return`Intrare invalidă: așteptat ${k(r.values[0])}`;return`Opțiune invalidă: așteptat una dintre ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Prea mare: așteptat ca ${r.origin??"valoarea"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"elemente"}`;return`Prea mare: așteptat ca ${r.origin??"valoarea"} să fie ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Prea mic: așteptat ca ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Prea mic: așteptat ca ${r.origin} să fie ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Șir invalid: trebuie să înceapă cu "${i.prefix}"`;if(i.format==="ends_with")return`Șir invalid: trebuie să se termine cu "${i.suffix}"`;if(i.format==="includes")return`Șir invalid: trebuie să includă "${i.includes}"`;if(i.format==="regex")return`Șir invalid: trebuie să se potrivească cu modelul ${i.pattern}`;return`Format invalid: ${n[i.format]??r.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${y(r.keys,", ")}`;case"invalid_key":return`Cheie invalidă în ${r.origin}`;case"invalid_union":return"Intrare invalidă";case"invalid_element":return`Valoare invalidă în ${r.origin}`;default:return"Intrare invalidă"}}};function Up(){return{localeError:pT()}}function mS(e,t,n,o){let r=Math.abs(e),i=r%10,a=r%100;if(a>=11&&a<=19)return o;if(i===1)return t;if(i>=2&&i<=4)return n;return o}var fT=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(r){return e[r]??null}let n={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},o={nan:"NaN",number:"число",array:"массив"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Неверный ввод: ожидалось instanceof ${r.expected}, получено ${s}`;return`Неверный ввод: ожидалось ${i}, получено ${s}`}case"invalid_value":if(r.values.length===1)return`Неверный ввод: ожидалось ${k(r.values[0])}`;return`Неверный вариант: ожидалось одно из ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let s=Number(r.maximum),c=mS(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет иметь ${i}${r.maximum.toString()} ${c}`}return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let s=Number(r.minimum),c=mS(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${r.origin} будет иметь ${i}${r.minimum.toString()} ${c}`}return`Слишком маленькое значение: ожидалось, что ${r.origin} будет ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неверная строка: должна начинаться с "${i.prefix}"`;if(i.format==="ends_with")return`Неверная строка: должна заканчиваться на "${i.suffix}"`;if(i.format==="includes")return`Неверная строка: должна содержать "${i.includes}"`;if(i.format==="regex")return`Неверная строка: должна соответствовать шаблону ${i.pattern}`;return`Неверный ${n[i.format]??r.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспознанн${r.keys.length>1?"ые":"ый"} ключ${r.keys.length>1?"и":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${r.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${r.origin}`;default:return"Неверные входные данные"}}};function qp(){return{localeError:fT()}}var hT=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"število",array:"tabela"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Neveljaven vnos: pričakovano instanceof ${r.expected}, prejeto ${s}`;return`Neveljaven vnos: pričakovano ${i}, prejeto ${s}`}case"invalid_value":if(r.values.length===1)return`Neveljaven vnos: pričakovano ${k(r.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${a.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Premajhno: pričakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${a.unit}`;return`Premajhno: pričakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Neveljaven niz: mora se začeti z "${i.prefix}"`;if(i.format==="ends_with")return`Neveljaven niz: mora se končati z "${i.suffix}"`;if(i.format==="includes")return`Neveljaven niz: mora vsebovati "${i.includes}"`;if(i.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`;return`Neveljaven ${n[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i ključi":" ključ"}: ${y(r.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function Lp(){return{localeError:hT()}}var gT=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(r){return e[r]??null}let n={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Ogiltig inmatning: förväntat instanceof ${r.expected}, fick ${s}`;return`Ogiltig inmatning: förväntat ${i}, fick ${s}`}case"invalid_value":if(r.values.length===1)return`Ogiltig inmatning: förväntat ${k(r.values[0])}`;return`Ogiltigt val: förväntade en av ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`För stor(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()} ${a.unit??"element"}`;return`För stor(t): förväntat ${r.origin??"värdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()} ${a.unit}`;return`För lite(t): förväntade ${r.origin??"värdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ogiltig sträng: måste börja med "${i.prefix}"`;if(i.format==="ends_with")return`Ogiltig sträng: måste sluta med "${i.suffix}"`;if(i.format==="includes")return`Ogiltig sträng: måste innehålla "${i.includes}"`;if(i.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${i.pattern}"`;return`Ogiltig(t) ${n[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${y(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${r.origin??"värdet"}`;default:return"Ogiltig input"}}};function Dp(){return{localeError:gT()}}var vT=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(r){return e[r]??null}let n={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${r.expected}, பெறப்பட்டது ${s}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${i}, பெறப்பட்டது ${s}`}case"invalid_value":if(r.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${k(r.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${y(r.values,"|")} இல் ஒன்று`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${i}${r.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${i}${r.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`;if(i.format==="ends_with")return`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`;if(i.format==="includes")return`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`;if(i.format==="regex")return`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${n[i.format]??r.format}`}case"not_multiple_of":return`தவறான எண்: ${r.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${r.keys.length>1?"கள்":""}: ${y(r.keys,", ")}`;case"invalid_key":return`${r.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${r.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function Zp(){return{localeError:vT()}}var _T=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(r){return e[r]??null}let n={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},o={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${r.expected} แต่ได้รับ ${s}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${i} แต่ได้รับ ${s}`}case"invalid_value":if(r.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${k(r.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"ไม่เกิน":"น้อยกว่า",a=t(r.origin);if(a)return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()} ${a.unit??"รายการ"}`;return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"อย่างน้อย":"มากกว่า",a=t(r.origin);if(a)return`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()} ${a.unit}`;return`น้อยกว่ากำหนด: ${r.origin} ควรมี${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`;if(i.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`;if(i.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`;if(i.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`;return`รูปแบบไม่ถูกต้อง: ${n[i.format]??r.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${r.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${y(r.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${r.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${r.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function Fp(){return{localeError:_T()}}var ST=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(r){return e[r]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Geçersiz değer: beklenen instanceof ${r.expected}, alınan ${s}`;return`Geçersiz değer: beklenen ${i}, alınan ${s}`}case"invalid_value":if(r.values.length===1)return`Geçersiz değer: beklenen ${k(r.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Çok büyük: beklenen ${r.origin??"değer"} ${i}${r.maximum.toString()} ${a.unit??"öğe"}`;return`Çok büyük: beklenen ${r.origin??"değer"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Çok küçük: beklenen ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`;return`Çok küçük: beklenen ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Geçersiz metin: "${i.prefix}" ile başlamalı`;if(i.format==="ends_with")return`Geçersiz metin: "${i.suffix}" ile bitmeli`;if(i.format==="includes")return`Geçersiz metin: "${i.includes}" içermeli`;if(i.format==="regex")return`Geçersiz metin: ${i.pattern} desenine uymalı`;return`Geçersiz ${n[i.format]??r.format}`}case"not_multiple_of":return`Geçersiz sayı: ${r.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${r.keys.length>1?"lar":""}: ${y(r.keys,", ")}`;case"invalid_key":return`${r.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${r.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function Kp(){return{localeError:ST()}}var yT=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(r){return e[r]??null}let n={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},o={nan:"NaN",number:"число",array:"масив"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Неправильні вхідні дані: очікується instanceof ${r.expected}, отримано ${s}`;return`Неправильні вхідні дані: очікується ${i}, отримано ${s}`}case"invalid_value":if(r.values.length===1)return`Неправильні вхідні дані: очікується ${k(r.values[0])}`;return`Неправильна опція: очікується одне з ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Занадто велике: очікується, що ${r.origin??"значення"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"елементів"}`;return`Занадто велике: очікується, що ${r.origin??"значення"} буде ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Занадто мале: очікується, що ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Занадто мале: очікується, що ${r.origin} буде ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Неправильний рядок: повинен починатися з "${i.prefix}"`;if(i.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`;if(i.format==="includes")return`Неправильний рядок: повинен містити "${i.includes}"`;if(i.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`;return`Неправильний ${n[i.format]??r.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${r.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${r.keys.length>1?"і":""}: ${y(r.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${r.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${r.origin}`;default:return"Неправильні вхідні дані"}}};function li(){return{localeError:yT()}}function Jp(){return li()}var bT=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(r){return e[r]??null}let n={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},o={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`غلط ان پٹ: instanceof ${r.expected} متوقع تھا، ${s} موصول ہوا`;return`غلط ان پٹ: ${i} متوقع تھا، ${s} موصول ہوا`}case"invalid_value":if(r.values.length===1)return`غلط ان پٹ: ${k(r.values[0])} متوقع تھا`;return`غلط آپشن: ${y(r.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`بہت بڑا: ${r.origin??"ویلیو"} کے ${i}${r.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${r.origin??"ویلیو"} کا ${i}${r.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`بہت چھوٹا: ${r.origin} کے ${i}${r.minimum.toString()} ${a.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${r.origin} کا ${i}${r.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`;if(i.format==="ends_with")return`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`;if(i.format==="includes")return`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`;if(i.format==="regex")return`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`;return`غلط ${n[i.format]??r.format}`}case"not_multiple_of":return`غلط نمبر: ${r.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${r.keys.length>1?"ز":""}: ${y(r.keys,"، ")}`;case"invalid_key":return`${r.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${r.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Vp(){return{localeError:bT()}}var $T=()=>{let e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}};function t(r){return e[r]??null}let n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${s}`;return`Noto‘g‘ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":if(r.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${k(r.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()} ${a.unit} ${a.verb}`;return`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ${a.verb}`;return`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Noto‘g‘ri satr: "${i.prefix}" bilan boshlanishi kerak`;if(i.format==="ends_with")return`Noto‘g‘ri satr: "${i.suffix}" bilan tugashi kerak`;if(i.format==="includes")return`Noto‘g‘ri satr: "${i.includes}" ni o‘z ichiga olishi kerak`;if(i.format==="regex")return`Noto‘g‘ri satr: ${i.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${n[i.format]??r.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${r.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${r.keys.length>1?"lar":""}: ${y(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${r.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function Bp(){return{localeError:$T()}}var RT=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(r){return e[r]??null}let n={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},o={nan:"NaN",number:"số",array:"mảng"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${r.expected}, nhận được ${s}`;return`Đầu vào không hợp lệ: mong đợi ${i}, nhận được ${s}`}case"invalid_value":if(r.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${k(r.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Quá lớn: mong đợi ${r.origin??"giá trị"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"phần tử"}`;return`Quá lớn: mong đợi ${r.origin??"giá trị"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Quá nhỏ: mong đợi ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`;return`Quá nhỏ: mong đợi ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${i.prefix}"`;if(i.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${i.suffix}"`;if(i.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${i.includes}"`;if(i.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${i.pattern}`;return`${n[i.format]??r.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${r.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${y(r.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${r.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${r.origin}`;default:return"Đầu vào không hợp lệ"}}};function Hp(){return{localeError:RT()}}var zT=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(r){return e[r]??null}let n={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},o={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`无效输入:期望 instanceof ${r.expected},实际接收 ${s}`;return`无效输入:期望 ${i},实际接收 ${s}`}case"invalid_value":if(r.values.length===1)return`无效输入:期望 ${k(r.values[0])}`;return`无效选项:期望以下之一 ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()} ${a.unit??"个元素"}`;return`数值过大:期望 ${r.origin??"值"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`;return`数值过小:期望 ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`无效字符串:必须以 "${i.prefix}" 开头`;if(i.format==="ends_with")return`无效字符串:必须以 "${i.suffix}" 结尾`;if(i.format==="includes")return`无效字符串:必须包含 "${i.includes}"`;if(i.format==="regex")return`无效字符串:必须满足正则表达式 ${i.pattern}`;return`无效${n[i.format]??r.format}`}case"not_multiple_of":return`无效数字:必须是 ${r.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${y(r.keys,", ")}`;case"invalid_key":return`${r.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${r.origin} 中包含无效值(value)`;default:return"无效输入"}}};function Yp(){return{localeError:zT()}}var TT=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(r){return e[r]??null}let n={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},o={nan:"NaN"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`無效的輸入值:預期為 instanceof ${r.expected},但收到 ${s}`;return`無效的輸入值:預期為 ${i},但收到 ${s}`}case"invalid_value":if(r.values.length===1)return`無效的輸入值:預期為 ${k(r.values[0])}`;return`無效的選項:預期為以下其中之一 ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()} ${a.unit??"個元素"}`;return`數值過大:預期 ${r.origin??"值"} 應為 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()} ${a.unit}`;return`數值過小:預期 ${r.origin} 應為 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`無效的字串:必須以 "${i.prefix}" 開頭`;if(i.format==="ends_with")return`無效的字串:必須以 "${i.suffix}" 結尾`;if(i.format==="includes")return`無效的字串:必須包含 "${i.includes}"`;if(i.format==="regex")return`無效的字串:必須符合格式 ${i.pattern}`;return`無效的 ${n[i.format]??r.format}`}case"not_multiple_of":return`無效的數字:必須為 ${r.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${r.keys.length>1?"們":""}:${y(r.keys,"、")}`;case"invalid_key":return`${r.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${r.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Gp(){return{localeError:TT()}}var xT=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(r){return e[r]??null}let n={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},o={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(r)=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=w(r.input),s=o[a]??a;if(/^[A-Z]/.test(r.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${r.expected}, àmọ̀ a rí ${s}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${i}, àmọ̀ a rí ${s}`}case"invalid_value":if(r.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${k(r.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${y(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${r.origin??"iye"} ${a.verb} ${i}${r.maximum} ${a.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${i}${r.maximum}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a)return`Kéré ju: a ní láti jẹ́ pé ${r.origin} ${a.verb} ${i}${r.minimum} ${a.unit}`;return`Kéré ju: a ní láti jẹ́ ${i}${r.minimum}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${i.prefix}"`;if(i.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${i.suffix}"`;if(i.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${i.includes}"`;if(i.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${i.pattern}`;return`Aṣìṣe: ${n[i.format]??r.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${r.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${y(r.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${r.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${r.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function Wp(){return{localeError:xT()}}var pS,Xp=Symbol("ZodOutput"),Qp=Symbol("ZodInput");class ef{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==="object"&&"id"in n)this._idmap.set(n.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function ps(){return new ef}(pS=globalThis).__zod_globalRegistry??(pS.__zod_globalRegistry=ps());var xe=globalThis.__zod_globalRegistry;function tf(e,t){return new e({type:"string",...T(t)})}function rf(e,t){return new e({type:"string",coerce:!0,...T(t)})}function fs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...T(t)})}function di(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...T(t)})}function hs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...T(t)})}function gs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(t)})}function vs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(t)})}function _s(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(t)})}function mi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...T(t)})}function Ss(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...T(t)})}function ys(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(t)})}function bs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...T(t)})}function $s(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(t)})}function Rs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...T(t)})}function zs(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...T(t)})}function Ts(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(t)})}function xs(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(t)})}function ks(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(t)})}function nf(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...T(t)})}function Es(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(t)})}function ws(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(t)})}function Is(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...T(t)})}function Ps(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...T(t)})}function Os(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...T(t)})}function Cs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...T(t)})}var of={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function af(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(t)})}function sf(e,t){return new e({type:"string",format:"date",check:"string_format",...T(t)})}function cf(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...T(t)})}function lf(e,t){return new e({type:"string",format:"duration",check:"string_format",...T(t)})}function uf(e,t){return new e({type:"number",checks:[],...T(t)})}function df(e,t){return new e({type:"number",coerce:!0,checks:[],...T(t)})}function mf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...T(t)})}function pf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...T(t)})}function ff(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...T(t)})}function hf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...T(t)})}function gf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...T(t)})}function vf(e,t){return new e({type:"boolean",...T(t)})}function _f(e,t){return new e({type:"boolean",coerce:!0,...T(t)})}function Sf(e,t){return new e({type:"bigint",...T(t)})}function yf(e,t){return new e({type:"bigint",coerce:!0,...T(t)})}function bf(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...T(t)})}function $f(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...T(t)})}function Rf(e,t){return new e({type:"symbol",...T(t)})}function zf(e,t){return new e({type:"undefined",...T(t)})}function Tf(e,t){return new e({type:"null",...T(t)})}function xf(e){return new e({type:"any"})}function kf(e){return new e({type:"unknown"})}function Ef(e,t){return new e({type:"never",...T(t)})}function wf(e,t){return new e({type:"void",...T(t)})}function If(e,t){return new e({type:"date",...T(t)})}function Pf(e,t){return new e({type:"date",coerce:!0,...T(t)})}function Of(e,t){return new e({type:"nan",...T(t)})}function kt(e,t){return new ts({check:"less_than",...T(t),value:e,inclusive:!1})}function et(e,t){return new ts({check:"less_than",...T(t),value:e,inclusive:!0})}function Et(e,t){return new rs({check:"greater_than",...T(t),value:e,inclusive:!1})}function Le(e,t){return new rs({check:"greater_than",...T(t),value:e,inclusive:!0})}function Ns(e){return Et(0,e)}function js(e){return kt(0,e)}function As(e){return et(0,e)}function Ms(e){return Le(0,e)}function ir(e,t){return new Ed({check:"multiple_of",...T(t),value:e})}function ar(e,t){return new Pd({check:"max_size",...T(t),maximum:e})}function wt(e,t){return new Od({check:"min_size",...T(t),minimum:e})}function Kr(e,t){return new Cd({check:"size_equals",...T(t),size:e})}function Jr(e,t){return new Nd({check:"max_length",...T(t),maximum:e})}function Lt(e,t){return new jd({check:"min_length",...T(t),minimum:e})}function Vr(e,t){return new Ad({check:"length_equals",...T(t),length:e})}function kn(e,t){return new Md({check:"string_format",format:"regex",...T(t),pattern:e})}function En(e){return new Ud({check:"string_format",format:"lowercase",...T(e)})}function wn(e){return new qd({check:"string_format",format:"uppercase",...T(e)})}function In(e,t){return new Ld({check:"string_format",format:"includes",...T(t),includes:e})}function Pn(e,t){return new Dd({check:"string_format",format:"starts_with",...T(t),prefix:e})}function On(e,t){return new Zd({check:"string_format",format:"ends_with",...T(t),suffix:e})}function Us(e,t,n){return new Fd({check:"property",property:e,schema:t,...T(n)})}function Cn(e,t){return new Kd({check:"mime_type",mime:e,...T(t)})}function mt(e){return new Jd({check:"overwrite",tx:e})}function Nn(e){return mt((t)=>t.normalize(e))}function jn(){return mt((e)=>e.trim())}function An(){return mt((e)=>e.toLowerCase())}function Mn(){return mt((e)=>e.toUpperCase())}function Un(){return mt((e)=>Fu(e))}function Cf(e,t,n){return new e({type:"array",element:t,...T(n)})}function ET(e,t,n){return new e({type:"union",options:t,...T(n)})}function wT(e,t,n){return new e({type:"union",options:t,inclusive:!1,...T(n)})}function IT(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...T(o)})}function PT(e,t,n){return new e({type:"intersection",left:t,right:n})}function OT(e,t,n,o){let r=n instanceof re;return new e({type:"tuple",items:t,rest:r?n:null,...T(r?o:n)})}function CT(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...T(o)})}function NT(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...T(o)})}function jT(e,t,n){return new e({type:"set",valueType:t,...T(n)})}function AT(e,t,n){let o=Array.isArray(t)?Object.fromEntries(t.map((r)=>[r,r])):t;return new e({type:"enum",entries:o,...T(n)})}function MT(e,t,n){return new e({type:"enum",entries:t,...T(n)})}function UT(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...T(n)})}function Nf(e,t){return new e({type:"file",...T(t)})}function qT(e,t){return new e({type:"transform",transform:t})}function LT(e,t){return new e({type:"optional",innerType:t})}function DT(e,t){return new e({type:"nullable",innerType:t})}function ZT(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n==="function"?n():Ho(n)}})}function FT(e,t,n){return new e({type:"nonoptional",innerType:t,...T(n)})}function KT(e,t){return new e({type:"success",innerType:t})}function JT(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n==="function"?n:()=>n})}function VT(e,t,n){return new e({type:"pipe",in:t,out:n})}function BT(e,t){return new e({type:"readonly",innerType:t})}function HT(e,t,n){return new e({type:"template_literal",parts:t,...T(n)})}function YT(e,t){return new e({type:"lazy",getter:t})}function GT(e,t){return new e({type:"promise",innerType:t})}function jf(e,t,n){let o=T(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Af(e,t,n){return new e({type:"custom",check:"custom",fn:t,...T(n)})}function Mf(e,t){let n=fS((o)=>(o.addIssue=(r)=>{if(typeof r==="string")o.issues.push(or(r,o.value,n._zod.def));else{let i=r;if(i.fatal)i.continue=!1;i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),o.issues.push(or(i))}},e(o.value,o)),t);return n}function fS(e,t){let n=new fe({check:"custom",...T(t)});return n._zod.check=e,n}function Uf(e){let t=new fe({check:"describe"});return t._zod.onattach=[(n)=>{let o=xe.get(n)??{};xe.add(n,{...o,description:e})}],t._zod.check=()=>{},t}function qf(e){let t=new fe({check:"meta"});return t._zod.onattach=[(n)=>{let o=xe.get(n)??{};xe.add(n,{...o,...e})}],t._zod.check=()=>{},t}function Lf(e,t){let n=T(t),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];if(n.case!=="sensitive")o=o.map((h)=>typeof h==="string"?h.toLowerCase():h),r=r.map((h)=>typeof h==="string"?h.toLowerCase():h);let i=new Set(o),a=new Set(r),s=e.Codec??ii,c=e.Boolean??ni,d=new(e.String??Fr)({type:"string",error:n.error}),m=new c({type:"boolean",error:n.error}),p=new s({type:"pipe",in:d,out:m,transform:(h,b)=>{let R=h;if(n.case!=="sensitive")R=R.toLowerCase();if(i.has(R))return!0;else if(a.has(R))return!1;else return b.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:b.value,inst:p,continue:!1}),{}},reverseTransform:(h,b)=>{if(h===!0)return o[0]||"true";else return r[0]||"false"},error:n.error});return p}function qn(e,t,n,o={}){let r=T(o),i={...T(o),check:"string_format",type:"string",format:t,fn:typeof n==="function"?n:(s)=>n.test(s),...r};if(n instanceof RegExp)i.pattern=n;return new e(i)}function sr(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??xe,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function de(e,t,n={path:[],schemaPath:[]}){var o;let r=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,n.schemaPath.includes(e))i.cycle=n.path;return i.schema}let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,d);else{let p=a.schema,h=t.processors[r.type];if(!h)throw Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);h(e,t,p,d)}let m=e._zod.parent;if(m){if(!a.ref)a.ref=m;de(m,t,d),t.seen.get(m).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Object.assign(a.schema,c);if(t.io==="input"&&De(e))delete a.schema.examples,delete a.schema.default;if(t.io==="input"&&"_prefault"in a.schema)(o=a.schema).default??(o.default=a.schema._prefault);return delete a.schema._prefault,t.seen.get(e).schema}function cr(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let c=o.get(s);if(c&&c!==a[0])throw Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let r=(a)=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let m=e.external.registry.get(a[0])?.id,p=e.external.uri??((b)=>b);if(m)return{ref:p(m)};let h=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=h,{defId:h,ref:`${p("__shared")}#/${s}/${h}`}}if(a[1]===n)return{ref:"#"};let u=`${"#"}/${s}/`,d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=(a)=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:u}=r(a);if(s.def={...s.schema},u)s.defId=u;let d=s.schema;for(let m in d)delete d[m];d.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
65
65
 
66
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1){if(e.reused==="ref"){i(a);continue}}}}function lr(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(s)=>{let c=e.seen.get(s);if(c.ref===null)return;let u=c.def??c.schema,d={...u},m=c.ref;if(c.ref=null,m){o(m);let h=e.seen.get(m),b=h.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(b);else Object.assign(u,b);if(Object.assign(u,d),s._zod.parent===m)for(let z in u){if(z==="$ref"||z==="allOf")continue;if(!(z in d))delete u[z]}if(b.$ref&&h.def)for(let z in u){if(z==="$ref"||z==="allOf")continue;if(z in h.def&&JSON.stringify(u[z])===JSON.stringify(h.def[z]))delete u[z]}}let p=s._zod.parent;if(p&&p!==m){o(p);let h=e.seen.get(p);if(h?.schema.$ref){if(u.$ref=h.schema.$ref,h.def)for(let b in u){if(b==="$ref"||b==="allOf")continue;if(b in h.def&&JSON.stringify(u[b])===JSON.stringify(h.def[b]))delete u[b]}}}e.override({zodSchema:s,jsonSchema:u,path:c.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let r={};if(e.target==="draft-2020-12")r.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")r.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")r.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw Error("Schema is missing an `id` property");r.$id=e.external.uri(s)}Object.assign(r,n.def??n.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&r.id===i)delete r.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let c=s[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;a[c.defId]=c.def}}if(e.external);else if(Object.keys(a).length>0)if(e.target==="draft-2020-12")r.$defs=a;else r.definitions=a;try{let s=JSON.parse(JSON.stringify(r));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ln(t,"input",e.processors),output:Ln(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch(s){throw Error("Error converting schema to JSON.")}}function De(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return De(o.element,n);if(o.type==="set")return De(o.valueType,n);if(o.type==="lazy")return De(o.getter(),n);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return De(o.innerType,n);if(o.type==="intersection")return De(o.left,n)||De(o.right,n);if(o.type==="record"||o.type==="map")return De(o.keyType,n)||De(o.valueType,n);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return De(o.in,n)||De(o.out,n)}if(o.type==="object"){for(let r in o.shape)if(De(o.shape[r],n))return!0;return!1}if(o.type==="union"){for(let r of o.options)if(De(r,n))return!0;return!1}if(o.type==="tuple"){for(let r of o.items)if(De(r,n))return!0;if(o.rest&&De(o.rest,n))return!0;return!1}return!1}var Df=(e,t={})=>(n)=>{let o=sr({...n,processors:t});return de(e,o),cr(o,e),lr(o,e)},Ln=(e,t,n={})=>(o)=>{let{libraryOptions:r,target:i}=o??{},a=sr({...r??{},target:i,io:t,processors:n});return de(e,a),cr(a,e),lr(a,e)};var ZT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zf=(e,t,n,o)=>{let r=n;r.type="string";let{minimum:i,maximum:a,format:s,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i==="number")r.minLength=i;if(typeof a==="number")r.maxLength=a;if(s){if(r.format=ZT[s]??s,r.format==="")delete r.format;if(s==="time")delete r.format}if(u)r.contentEncoding=u;if(c&&c.size>0){let d=[...c];if(d.length===1)r.pattern=d[0].source;else if(d.length>1)r.allOf=[...d.map((m)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]}},Kf=(e,t,n,o)=>{let r=n,{minimum:i,maximum:a,format:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;if(typeof s==="string"&&s.includes("int"))r.type="integer";else r.type="number";let m=typeof d==="number"&&d>=(i??Number.NEGATIVE_INFINITY),p=typeof u==="number"&&u<=(a??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(m)if(h)r.minimum=d,r.exclusiveMinimum=!0;else r.exclusiveMinimum=d;else if(typeof i==="number")r.minimum=i;if(p)if(h)r.maximum=u,r.exclusiveMaximum=!0;else r.exclusiveMaximum=u;else if(typeof a==="number")r.maximum=a;if(typeof c==="number")r.multipleOf=c},Ff=(e,t,n,o)=>{n.type="boolean"},Vf=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},Jf=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},Bf=(e,t,n,o)=>{if(t.target==="openapi-3.0")n.type="string",n.nullable=!0,n.enum=[null];else n.type="null"},Hf=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},Yf=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Gf=(e,t,n,o)=>{n.not={}},Wf=(e,t,n,o)=>{},Xf=(e,t,n,o)=>{},Qf=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},eh=(e,t,n,o)=>{let r=e._zod.def,i=Jo(r.entries);if(i.every((a)=>typeof a==="number"))n.type="number";if(i.every((a)=>typeof a==="string"))n.type="string";n.enum=i},th=(e,t,n,o)=>{let r=e._zod.def,i=[];for(let a of r.values)if(a===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(a));else i.push(a);if(i.length===0);else if(i.length===1){let a=i[0];if(n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0")n.enum=[a];else n.const=a}else{if(i.every((a)=>typeof a==="number"))n.type="number";if(i.every((a)=>typeof a==="string"))n.type="string";if(i.every((a)=>typeof a==="boolean"))n.type="boolean";if(i.every((a)=>a===null))n.type="null";n.enum=i}},rh=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},nh=(e,t,n,o)=>{let r=n,i=e._zod.pattern;if(!i)throw Error("Pattern not found in template literal");r.type="string",r.pattern=i.source},oh=(e,t,n,o)=>{let r=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=e._zod.bag;if(a!==void 0)i.minLength=a;if(s!==void 0)i.maxLength=s;if(c)if(c.length===1)i.contentMediaType=c[0],Object.assign(r,i);else Object.assign(r,i),r.anyOf=c.map((u)=>({contentMediaType:u}));else Object.assign(r,i)},ih=(e,t,n,o)=>{n.type="boolean"},ah=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},sh=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},ch=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},lh=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},uh=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},dh=(e,t,n,o)=>{let r=n,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;if(typeof a==="number")r.minItems=a;if(typeof s==="number")r.maxItems=s;r.type="array",r.items=de(i.element,t,{...o,path:[...o.path,"items"]})},mh=(e,t,n,o)=>{let r=n,i=e._zod.def;r.type="object",r.properties={};let a=i.shape;for(let u in a)r.properties[u]=de(a[u],t,{...o,path:[...o.path,"properties",u]});let s=new Set(Object.keys(a)),c=new Set([...s].filter((u)=>{let d=i.shape[u]._zod;if(t.io==="input")return d.optin===void 0;else return d.optout===void 0}));if(c.size>0)r.required=Array.from(c);if(i.catchall?._zod.def.type==="never")r.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")r.additionalProperties=!1}else if(i.catchall)r.additionalProperties=de(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},Ls=(e,t,n,o)=>{let r=e._zod.def,i=r.inclusive===!1,a=r.options.map((s,c)=>de(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));if(i)n.oneOf=a;else n.anyOf=a},ph=(e,t,n,o)=>{let r=e._zod.def,i=de(r.left,t,{...o,path:[...o.path,"allOf",0]}),a=de(r.right,t,{...o,path:[...o.path,"allOf",1]}),s=(u)=>("allOf"in u)&&Object.keys(u).length===1,c=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];n.allOf=c},fh=(e,t,n,o)=>{let r=n,i=e._zod.def;r.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((p,h)=>de(p,t,{...o,path:[...o.path,a,h]})),u=i.rest?de(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(r.prefixItems=c,u)r.items=u}else if(t.target==="openapi-3.0"){if(r.items={anyOf:c},u)r.items.anyOf.push(u);if(r.minItems=c.length,!u)r.maxItems=c.length}else if(r.items=c,u)r.additionalItems=u;let{minimum:d,maximum:m}=e._zod.bag;if(typeof d==="number")r.minItems=d;if(typeof m==="number")r.maxItems=m},hh=(e,t,n,o)=>{let r=n,i=e._zod.def;r.type="object";let a=i.keyType,c=a._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){let d=de(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});r.patternProperties={};for(let m of c)r.patternProperties[m.source]=d}else{if(t.target==="draft-07"||t.target==="draft-2020-12")r.propertyNames=de(i.keyType,t,{...o,path:[...o.path,"propertyNames"]});r.additionalProperties=de(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let u=a._zod.values;if(u){let d=[...u].filter((m)=>typeof m==="string"||typeof m==="number");if(d.length>0)r.required=d}},gh=(e,t,n,o)=>{let r=e._zod.def,i=de(r.innerType,t,o),a=t.seen.get(e);if(t.target==="openapi-3.0")a.ref=r.innerType,n.nullable=!0;else n.anyOf=[i,{type:"null"}]},vh=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType},_h=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},Sh=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);if(i.ref=r.innerType,t.io==="input")n._prefault=JSON.parse(JSON.stringify(r.defaultValue))},yh=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType;let a;try{a=r.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=a},bh=(e,t,n,o)=>{let r=e._zod.def,i=r.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?r.out:r.in:r.out;de(a,t,o);let s=t.seen.get(e);s.ref=a},$h=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType,n.readOnly=!0},Rh=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType},Ds=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType},zh=(e,t,n,o)=>{let r=e._zod.innerType;de(r,t,o);let i=t.seen.get(e);i.ref=r},qs={string:Zf,number:Kf,boolean:Ff,bigint:Vf,symbol:Jf,null:Bf,undefined:Hf,void:Yf,never:Gf,any:Wf,unknown:Xf,date:Qf,enum:eh,literal:th,nan:rh,template_literal:nh,file:oh,success:ih,custom:ah,function:sh,transform:ch,map:lh,set:uh,array:dh,object:mh,union:Ls,intersection:ph,tuple:fh,record:hh,nullable:gh,nonoptional:vh,default:_h,prefault:Sh,catch:yh,pipe:bh,readonly:$h,promise:Rh,optional:Ds,lazy:zh};function Br(e,t){if("_idmap"in e){let o=e,r=sr({...t,processors:qs}),i={};for(let c of o._idmap.entries()){let[u,d]=c;de(d,r)}let a={},s={registry:o,uri:t?.uri,defs:i};r.external=s;for(let c of o._idmap.entries()){let[u,d]=c;cr(r,d),a[u]=lr(r,d)}if(Object.keys(i).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:i}}return{schemas:a}}let n=sr({...t,processors:qs});return de(e,n),cr(n,e),lr(n,e)}class Th{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=sr({processors:qs,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return de(e,this.ctx,t)}emit(e,t){if(t){if(t.cycles)this.ctx.cycles=t.cycles;if(t.reused)this.ctx.reused=t.reused;if(t.external)this.ctx.external=t.external}cr(this.ctx,e);let n=lr(this.ctx,e),{"~standard":o,...r}=n;return r}}var hS={};var pi={};Ut(pi,{ZodAny:()=>Kh,ZodArray:()=>Bh,ZodBase64:()=>uc,ZodBase64URL:()=>dc,ZodBigInt:()=>Hn,ZodBigIntFormat:()=>fc,ZodBoolean:()=>Bn,ZodCIDRv4:()=>cc,ZodCIDRv6:()=>lc,ZodCUID:()=>tc,ZodCUID2:()=>rc,ZodCatch:()=>pg,ZodCodec:()=>Ri,ZodCustom:()=>zi,ZodCustomStringFormat:()=>Vn,ZodDate:()=>Si,ZodDefault:()=>sg,ZodDiscriminatedUnion:()=>Yh,ZodE164:()=>mc,ZodEmail:()=>Ws,ZodEmoji:()=>Qs,ZodEnum:()=>Zn,ZodExactOptional:()=>og,ZodFile:()=>rg,ZodFunction:()=>$g,ZodGUID:()=>hi,ZodIPv4:()=>ac,ZodIPv6:()=>sc,ZodIntersection:()=>Gh,ZodJWT:()=>pc,ZodKSUID:()=>ic,ZodLazy:()=>yg,ZodLiteral:()=>tg,ZodMAC:()=>qh,ZodMap:()=>Qh,ZodNaN:()=>hg,ZodNanoID:()=>ec,ZodNever:()=>Vh,ZodNonOptional:()=>Sc,ZodNull:()=>Zh,ZodNullable:()=>ag,ZodNumber:()=>Jn,ZodNumberFormat:()=>Yr,ZodObject:()=>yi,ZodOptional:()=>_c,ZodPipe:()=>$i,ZodPrefault:()=>lg,ZodPreprocess:()=>gg,ZodPromise:()=>bg,ZodReadonly:()=>vg,ZodRecord:()=>Dn,ZodSet:()=>eg,ZodString:()=>Kn,ZodStringFormat:()=>pe,ZodSuccess:()=>mg,ZodSymbol:()=>Lh,ZodTemplateLiteral:()=>Sg,ZodTransform:()=>ng,ZodTuple:()=>Wh,ZodType:()=>se,ZodULID:()=>nc,ZodURL:()=>_i,ZodUUID:()=>It,ZodUndefined:()=>Dh,ZodUnion:()=>bi,ZodUnknown:()=>Fh,ZodVoid:()=>Jh,ZodXID:()=>oc,ZodXor:()=>Hh,_ZodString:()=>Gs,_default:()=>cg,_function:()=>vy,any:()=>hc,array:()=>v,base64:()=>AS,base64url:()=>MS,bigint:()=>HS,boolean:()=>N,catch:()=>fg,check:()=>_y,cidrv4:()=>NS,cidrv6:()=>jS,codec:()=>py,cuid:()=>xS,cuid2:()=>kS,custom:()=>Sy,date:()=>ey,describe:()=>yy,discriminatedUnion:()=>dr,e164:()=>US,email:()=>Xs,emoji:()=>zS,enum:()=>Q,exactOptional:()=>ig,file:()=>ly,float32:()=>FS,float64:()=>VS,function:()=>vy,guid:()=>_S,hash:()=>KS,hex:()=>ZS,hostname:()=>DS,httpUrl:()=>RS,instanceof:()=>$y,int:()=>Hs,int32:()=>JS,int64:()=>YS,intersection:()=>ft,invertCodec:()=>fy,ipv4:()=>PS,ipv6:()=>CS,json:()=>zy,jwt:()=>qS,keyof:()=>ty,ksuid:()=>IS,lazy:()=>mr,literal:()=>S,looseObject:()=>H,looseRecord:()=>iy,mac:()=>OS,map:()=>ay,meta:()=>by,nan:()=>my,nanoid:()=>TS,nativeEnum:()=>cy,never:()=>gc,nonoptional:()=>dg,null:()=>pt,nullable:()=>gi,nullish:()=>uy,number:()=>x,object:()=>f,optional:()=>F,partialRecord:()=>oy,pipe:()=>Ys,prefault:()=>ug,preprocess:()=>Zt,promise:()=>gy,readonly:()=>_g,record:()=>C,refine:()=>Rg,set:()=>sy,strictObject:()=>ry,string:()=>l,stringFormat:()=>LS,stringbool:()=>Ry,success:()=>dy,superRefine:()=>zg,symbol:()=>WS,templateLiteral:()=>hy,transform:()=>vc,tuple:()=>Xh,uint32:()=>BS,uint64:()=>GS,ulid:()=>ES,undefined:()=>XS,union:()=>j,unknown:()=>Z,url:()=>Fn,uuid:()=>SS,uuidv4:()=>yS,uuidv6:()=>bS,uuidv7:()=>$S,void:()=>QS,xid:()=>wS,xor:()=>ny});var Zs={};Ut(Zs,{endsWith:()=>On,gt:()=>Et,gte:()=>Le,includes:()=>In,length:()=>Jr,lowercase:()=>En,lt:()=>kt,lte:()=>et,maxLength:()=>Vr,maxSize:()=>ar,mime:()=>Cn,minLength:()=>Lt,minSize:()=>wt,multipleOf:()=>ir,negative:()=>js,nonnegative:()=>Ms,nonpositive:()=>As,normalize:()=>Nn,overwrite:()=>mt,positive:()=>Ns,property:()=>Us,regex:()=>kn,size:()=>Fr,slugify:()=>Un,startsWith:()=>Pn,toLowerCase:()=>An,toUpperCase:()=>Mn,trim:()=>jn,uppercase:()=>wn});var ur={};Ut(ur,{ZodISODate:()=>Fs,ZodISODateTime:()=>Ks,ZodISODuration:()=>Bs,ZodISOTime:()=>Js,date:()=>Vs,datetime:()=>Hr,duration:()=>kh,time:()=>xh});var Ks=g("ZodISODateTime",(e,t)=>{im.init(e,t),pe.init(e,t)});function Hr(e){return af(Ks,e)}var Fs=g("ZodISODate",(e,t)=>{am.init(e,t),pe.init(e,t)});function Vs(e){return sf(Fs,e)}var Js=g("ZodISOTime",(e,t)=>{sm.init(e,t),pe.init(e,t)});function xh(e){return cf(Js,e)}var Bs=g("ZodISODuration",(e,t)=>{cm.init(e,t),pe.init(e,t)});function kh(e){return lf(Bs,e)}var gS=(e,t)=>{Xo.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(n)=>ei(e,n)},flatten:{value:(n)=>Qo(e,n)},addIssue:{value:(n)=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Sn,2)}},addIssues:{value:(n)=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Sn,2)}},isEmpty:{get(){return e.issues.length===0}}})},FT=g("ZodError",gS),He=g("ZodError",gS,{Parent:Error});var Eh=bn(He),wh=$n(He),fi=Rn(He),Ih=zn(He),Ph=Fa(He),Oh=Va(He),Ch=Ja(He),Nh=Ba(He),jh=Ha(He),Ah=Ya(He),Mh=Ga(He),Uh=Wa(He);var vS=new WeakMap;function vi(e,t,n){let o=Object.getPrototypeOf(e),r=vS.get(o);if(!r)r=new Set,vS.set(o,r);if(r.has(t))return;r.add(t);for(let i in n){let a=n[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}var se=g("ZodType",(e,t)=>(re.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ln(e,"input"),output:Ln(e,"output")}}),e.toJSONSchema=Df(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,o)=>Eh(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>fi(e,n,o),e.parseAsync=async(n,o)=>wh(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>Ih(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>Ph(e,n,o),e.decode=(n,o)=>Oh(e,n,o),e.encodeAsync=async(n,o)=>Ch(e,n,o),e.decodeAsync=async(n,o)=>Nh(e,n,o),e.safeEncode=(n,o)=>jh(e,n,o),e.safeDecode=(n,o)=>Ah(e,n,o),e.safeEncodeAsync=async(n,o)=>Mh(e,n,o),e.safeDecodeAsync=async(n,o)=>Uh(e,n,o),vi(e,"ZodType",{check(...n){let o=this.def;return this.clone(xt(o,{checks:[...o.checks??[],...n.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,o){return Ue(this,n,o)},brand(){return this},register(n,o){return n.add(this,o),this},refine(n,o){return this.check(Rg(n,o))},superRefine(n,o){return this.check(zg(n,o))},overwrite(n){return this.check(mt(n))},optional(){return F(this)},exactOptional(){return ig(this)},nullable(){return gi(this)},nullish(){return F(gi(this))},nonoptional(n){return dg(this,n)},array(){return v(this)},or(n){return j([this,n])},and(n){return ft(this,n)},transform(n){return Ys(this,vc(n))},default(n){return cg(this,n)},prefault(n){return ug(this,n)},catch(n){return fg(this,n)},pipe(n){return Ys(this,n)},readonly(){return _g(this)},describe(n){let o=this.clone();return xe.add(o,{description:n}),o},meta(...n){if(n.length===0)return xe.get(this);let o=this.clone();return xe.add(o,n[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return xe.get(e)?.description},configurable:!0}),e)),Gs=g("_ZodString",(e,t)=>{Kr.init(e,t),se.init(e,t),e._zod.processJSONSchema=(o,r,i)=>Zf(e,o,r,i);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,vi(e,"_ZodString",{regex(...o){return this.check(kn(...o))},includes(...o){return this.check(In(...o))},startsWith(...o){return this.check(Pn(...o))},endsWith(...o){return this.check(On(...o))},min(...o){return this.check(Lt(...o))},max(...o){return this.check(Vr(...o))},length(...o){return this.check(Jr(...o))},nonempty(...o){return this.check(Lt(1,...o))},lowercase(o){return this.check(En(o))},uppercase(o){return this.check(wn(o))},trim(){return this.check(jn())},normalize(...o){return this.check(Nn(...o))},toLowerCase(){return this.check(An())},toUpperCase(){return this.check(Mn())},slugify(){return this.check(Un())}})}),Kn=g("ZodString",(e,t)=>{Kr.init(e,t),Gs.init(e,t),e.email=(n)=>e.check(fs(Ws,n)),e.url=(n)=>e.check(mi(_i,n)),e.jwt=(n)=>e.check(Cs(pc,n)),e.emoji=(n)=>e.check(Ss(Qs,n)),e.guid=(n)=>e.check(di(hi,n)),e.uuid=(n)=>e.check(hs(It,n)),e.uuidv4=(n)=>e.check(gs(It,n)),e.uuidv6=(n)=>e.check(vs(It,n)),e.uuidv7=(n)=>e.check(_s(It,n)),e.nanoid=(n)=>e.check(ys(ec,n)),e.guid=(n)=>e.check(di(hi,n)),e.cuid=(n)=>e.check(bs(tc,n)),e.cuid2=(n)=>e.check($s(rc,n)),e.ulid=(n)=>e.check(Rs(nc,n)),e.base64=(n)=>e.check(Is(uc,n)),e.base64url=(n)=>e.check(Ps(dc,n)),e.xid=(n)=>e.check(zs(oc,n)),e.ksuid=(n)=>e.check(Ts(ic,n)),e.ipv4=(n)=>e.check(xs(ac,n)),e.ipv6=(n)=>e.check(ks(sc,n)),e.cidrv4=(n)=>e.check(Es(cc,n)),e.cidrv6=(n)=>e.check(ws(lc,n)),e.e164=(n)=>e.check(Os(mc,n)),e.datetime=(n)=>e.check(Hr(n)),e.date=(n)=>e.check(Vs(n)),e.time=(n)=>e.check(xh(n)),e.duration=(n)=>e.check(kh(n))});function l(e){return tf(Kn,e)}var pe=g("ZodStringFormat",(e,t)=>{me.init(e,t),Gs.init(e,t)}),Ws=g("ZodEmail",(e,t)=>{Gd.init(e,t),pe.init(e,t)});function Xs(e){return fs(Ws,e)}var hi=g("ZodGUID",(e,t)=>{Hd.init(e,t),pe.init(e,t)});function _S(e){return di(hi,e)}var It=g("ZodUUID",(e,t)=>{Yd.init(e,t),pe.init(e,t)});function SS(e){return hs(It,e)}function yS(e){return gs(It,e)}function bS(e){return vs(It,e)}function $S(e){return _s(It,e)}var _i=g("ZodURL",(e,t)=>{Wd.init(e,t),pe.init(e,t)});function Fn(e){return mi(_i,e)}function RS(e){return mi(_i,{protocol:Qa,hostname:M_,...T(e)})}var Qs=g("ZodEmoji",(e,t)=>{Xd.init(e,t),pe.init(e,t)});function zS(e){return Ss(Qs,e)}var ec=g("ZodNanoID",(e,t)=>{Qd.init(e,t),pe.init(e,t)});function TS(e){return ys(ec,e)}var tc=g("ZodCUID",(e,t)=>{em.init(e,t),pe.init(e,t)});function xS(e){return bs(tc,e)}var rc=g("ZodCUID2",(e,t)=>{tm.init(e,t),pe.init(e,t)});function kS(e){return $s(rc,e)}var nc=g("ZodULID",(e,t)=>{rm.init(e,t),pe.init(e,t)});function ES(e){return Rs(nc,e)}var oc=g("ZodXID",(e,t)=>{nm.init(e,t),pe.init(e,t)});function wS(e){return zs(oc,e)}var ic=g("ZodKSUID",(e,t)=>{om.init(e,t),pe.init(e,t)});function IS(e){return Ts(ic,e)}var ac=g("ZodIPv4",(e,t)=>{lm.init(e,t),pe.init(e,t)});function PS(e){return xs(ac,e)}var qh=g("ZodMAC",(e,t)=>{dm.init(e,t),pe.init(e,t)});function OS(e){return nf(qh,e)}var sc=g("ZodIPv6",(e,t)=>{um.init(e,t),pe.init(e,t)});function CS(e){return ks(sc,e)}var cc=g("ZodCIDRv4",(e,t)=>{mm.init(e,t),pe.init(e,t)});function NS(e){return Es(cc,e)}var lc=g("ZodCIDRv6",(e,t)=>{pm.init(e,t),pe.init(e,t)});function jS(e){return ws(lc,e)}var uc=g("ZodBase64",(e,t)=>{hm.init(e,t),pe.init(e,t)});function AS(e){return Is(uc,e)}var dc=g("ZodBase64URL",(e,t)=>{gm.init(e,t),pe.init(e,t)});function MS(e){return Ps(dc,e)}var mc=g("ZodE164",(e,t)=>{vm.init(e,t),pe.init(e,t)});function US(e){return Os(mc,e)}var pc=g("ZodJWT",(e,t)=>{_m.init(e,t),pe.init(e,t)});function qS(e){return Cs(pc,e)}var Vn=g("ZodCustomStringFormat",(e,t)=>{Sm.init(e,t),pe.init(e,t)});function LS(e,t,n={}){return qn(Vn,e,t,n)}function DS(e){return qn(Vn,"hostname",A_,e)}function ZS(e){return qn(Vn,"hex",L_,e)}function KS(e,t){let n=t?.enc??"hex",o=`${e}_${n}`,r=qt[o];if(!r)throw Error(`Unrecognized hash format: ${o}`);return qn(Vn,o,r,t)}var Jn=g("ZodNumber",(e,t)=>{cs.init(e,t),se.init(e,t),e._zod.processJSONSchema=(o,r,i)=>Kf(e,o,r,i),vi(e,"ZodNumber",{gt(o,r){return this.check(Et(o,r))},gte(o,r){return this.check(Le(o,r))},min(o,r){return this.check(Le(o,r))},lt(o,r){return this.check(kt(o,r))},lte(o,r){return this.check(et(o,r))},max(o,r){return this.check(et(o,r))},int(o){return this.check(Hs(o))},safe(o){return this.check(Hs(o))},positive(o){return this.check(Et(0,o))},nonnegative(o){return this.check(Le(0,o))},negative(o){return this.check(kt(0,o))},nonpositive(o){return this.check(et(0,o))},multipleOf(o,r){return this.check(ir(o,r))},step(o,r){return this.check(ir(o,r))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??0.5),e.isFinite=!0,e.format=n.format??null});function x(e){return uf(Jn,e)}var Yr=g("ZodNumberFormat",(e,t)=>{ym.init(e,t),Jn.init(e,t)});function Hs(e){return mf(Yr,e)}function FS(e){return pf(Yr,e)}function VS(e){return ff(Yr,e)}function JS(e){return hf(Yr,e)}function BS(e){return gf(Yr,e)}var Bn=g("ZodBoolean",(e,t)=>{ni.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ff(e,n,o,r)});function N(e){return vf(Bn,e)}var Hn=g("ZodBigInt",(e,t)=>{ls.init(e,t),se.init(e,t),e._zod.processJSONSchema=(o,r,i)=>Vf(e,o,r,i),e.gte=(o,r)=>e.check(Le(o,r)),e.min=(o,r)=>e.check(Le(o,r)),e.gt=(o,r)=>e.check(Et(o,r)),e.gte=(o,r)=>e.check(Le(o,r)),e.min=(o,r)=>e.check(Le(o,r)),e.lt=(o,r)=>e.check(kt(o,r)),e.lte=(o,r)=>e.check(et(o,r)),e.max=(o,r)=>e.check(et(o,r)),e.positive=(o)=>e.check(Et(BigInt(0),o)),e.negative=(o)=>e.check(kt(BigInt(0),o)),e.nonpositive=(o)=>e.check(et(BigInt(0),o)),e.nonnegative=(o)=>e.check(Le(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(ir(o,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function HS(e){return Sf(Hn,e)}var fc=g("ZodBigIntFormat",(e,t)=>{bm.init(e,t),Hn.init(e,t)});function YS(e){return bf(fc,e)}function GS(e){return $f(fc,e)}var Lh=g("ZodSymbol",(e,t)=>{$m.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Jf(e,n,o,r)});function WS(e){return Rf(Lh,e)}var Dh=g("ZodUndefined",(e,t)=>{Rm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Hf(e,n,o,r)});function XS(e){return zf(Dh,e)}var Zh=g("ZodNull",(e,t)=>{zm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Bf(e,n,o,r)});function pt(e){return Tf(Zh,e)}var Kh=g("ZodAny",(e,t)=>{Tm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Wf(e,n,o,r)});function hc(){return xf(Kh)}var Fh=g("ZodUnknown",(e,t)=>{xm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Xf(e,n,o,r)});function Z(){return kf(Fh)}var Vh=g("ZodNever",(e,t)=>{km.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Gf(e,n,o,r)});function gc(e){return Ef(Vh,e)}var Jh=g("ZodVoid",(e,t)=>{Em.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Yf(e,n,o,r)});function QS(e){return wf(Jh,e)}var Si=g("ZodDate",(e,t)=>{wm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(o,r,i)=>Qf(e,o,r,i),e.min=(o,r)=>e.check(Le(o,r)),e.max=(o,r)=>e.check(et(o,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function ey(e){return If(Si,e)}var Bh=g("ZodArray",(e,t)=>{Im.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>dh(e,n,o,r),e.element=t.element,vi(e,"ZodArray",{min(n,o){return this.check(Lt(n,o))},nonempty(n){return this.check(Lt(1,n))},max(n,o){return this.check(Vr(n,o))},length(n,o){return this.check(Jr(n,o))},unwrap(){return this.element}})});function v(e,t){return Cf(Bh,e,t)}function ty(e){let t=e._zod.def.shape;return Q(Object.keys(t))}var yi=g("ZodObject",(e,t)=>{Pm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>mh(e,n,o,r),le(e,"shape",()=>t.shape),vi(e,"ZodObject",{keyof(){return Q(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Z()})},loose(){return this.clone({...this._zod.def,catchall:Z()})},strict(){return this.clone({...this._zod.def,catchall:gc()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return T_(this,n)},safeExtend(n){return x_(this,n)},merge(n){return k_(this,n)},pick(n){return R_(this,n)},omit(n){return z_(this,n)},partial(...n){return E_(_c,this,n[0])},required(...n){return w_(Sc,this,n[0])}})});function f(e,t){let n={type:"object",shape:e??{},...T(t)};return new yi(n)}function ry(e,t){return new yi({type:"object",shape:e,catchall:gc(),...T(t)})}function H(e,t){return new yi({type:"object",shape:e,catchall:Z(),...T(t)})}var bi=g("ZodUnion",(e,t)=>{oi.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ls(e,n,o,r),e.options=t.options});function j(e,t){return new bi({type:"union",options:e,...T(t)})}var Hh=g("ZodXor",(e,t)=>{bi.init(e,t),Om.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ls(e,n,o,r),e.options=t.options});function ny(e,t){return new Hh({type:"union",options:e,inclusive:!1,...T(t)})}var Yh=g("ZodDiscriminatedUnion",(e,t)=>{bi.init(e,t),Cm.init(e,t)});function dr(e,t,n){return new Yh({type:"union",options:t,discriminator:e,...T(n)})}var Gh=g("ZodIntersection",(e,t)=>{Nm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ph(e,n,o,r)});function ft(e,t){return new Gh({type:"intersection",left:e,right:t})}var Wh=g("ZodTuple",(e,t)=>{us.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>fh(e,n,o,r),e.rest=(n)=>e.clone({...e._zod.def,rest:n})});function Xh(e,t,n){let o=t instanceof re,r=o?n:t;return new Wh({type:"tuple",items:e,rest:o?t:null,...T(r)})}var Dn=g("ZodRecord",(e,t)=>{jm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>hh(e,n,o,r),e.keyType=t.keyType,e.valueType=t.valueType});function C(e,t,n){if(!t||!t._zod)return new Dn({type:"record",keyType:l(),valueType:e,...T(t)});return new Dn({type:"record",keyType:e,valueType:t,...T(n)})}function oy(e,t,n){let o=Ue(e);return o._zod.values=void 0,new Dn({type:"record",keyType:o,valueType:t,...T(n)})}function iy(e,t,n){return new Dn({type:"record",keyType:e,valueType:t,mode:"loose",...T(n)})}var Qh=g("ZodMap",(e,t)=>{Am.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>lh(e,n,o,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(wt(...n)),e.nonempty=(n)=>e.check(wt(1,n)),e.max=(...n)=>e.check(ar(...n)),e.size=(...n)=>e.check(Fr(...n))});function ay(e,t,n){return new Qh({type:"map",keyType:e,valueType:t,...T(n)})}var eg=g("ZodSet",(e,t)=>{Mm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>uh(e,n,o,r),e.min=(...n)=>e.check(wt(...n)),e.nonempty=(n)=>e.check(wt(1,n)),e.max=(...n)=>e.check(ar(...n)),e.size=(...n)=>e.check(Fr(...n))});function sy(e,t){return new eg({type:"set",valueType:e,...T(t)})}var Zn=g("ZodEnum",(e,t)=>{Um.init(e,t),se.init(e,t),e._zod.processJSONSchema=(o,r,i)=>eh(e,o,r,i),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{let i={};for(let a of o)if(n.has(a))i[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new Zn({...t,checks:[],...T(r),entries:i})},e.exclude=(o,r)=>{let i={...t.entries};for(let a of o)if(n.has(a))delete i[a];else throw Error(`Key ${a} not found in enum`);return new Zn({...t,checks:[],...T(r),entries:i})}});function Q(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new Zn({type:"enum",entries:n,...T(t)})}function cy(e,t){return new Zn({type:"enum",entries:e,...T(t)})}var tg=g("ZodLiteral",(e,t)=>{qm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>th(e,n,o,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function S(e,t){return new tg({type:"literal",values:Array.isArray(e)?e:[e],...T(t)})}var rg=g("ZodFile",(e,t)=>{Lm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>oh(e,n,o,r),e.min=(n,o)=>e.check(wt(n,o)),e.max=(n,o)=>e.check(ar(n,o)),e.mime=(n,o)=>e.check(Cn(Array.isArray(n)?n:[n],o))});function ly(e){return Nf(rg,e)}var ng=g("ZodTransform",(e,t)=>{Dm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ch(e,n,o,r),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Lr(e.constructor.name);n.addIssue=(i)=>{if(typeof i==="string")n.issues.push(or(i,n.value,t));else{let a=i;if(a.fatal)a.continue=!1;a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(or(a))}};let r=t.transform(n.value,n);if(r instanceof Promise)return r.then((i)=>(n.value=i,n.fallback=!0,n));return n.value=r,n.fallback=!0,n}});function vc(e){return new ng({type:"transform",transform:e})}var _c=g("ZodOptional",(e,t)=>{ds.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ds(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function F(e){return new _c({type:"optional",innerType:e})}var og=g("ZodExactOptional",(e,t)=>{Zm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ds(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function ig(e){return new og({type:"optional",innerType:e})}var ag=g("ZodNullable",(e,t)=>{Km.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>gh(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function gi(e){return new ag({type:"nullable",innerType:e})}function uy(e){return F(gi(e))}var sg=g("ZodDefault",(e,t)=>{Fm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>_h(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function cg(e,t){return new sg({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Ho(t)}})}var lg=g("ZodPrefault",(e,t)=>{Vm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Sh(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function ug(e,t){return new lg({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Ho(t)}})}var Sc=g("ZodNonOptional",(e,t)=>{Jm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>vh(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function dg(e,t){return new Sc({type:"nonoptional",innerType:e,...T(t)})}var mg=g("ZodSuccess",(e,t)=>{Bm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ih(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function dy(e){return new mg({type:"success",innerType:e})}var pg=g("ZodCatch",(e,t)=>{Hm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>yh(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function fg(e,t){return new pg({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var hg=g("ZodNaN",(e,t)=>{Ym.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>rh(e,n,o,r)});function my(e){return Of(hg,e)}var $i=g("ZodPipe",(e,t)=>{ms.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>bh(e,n,o,r),e.in=t.in,e.out=t.out});function Ys(e,t){return new $i({type:"pipe",in:e,out:t})}var Ri=g("ZodCodec",(e,t)=>{$i.init(e,t),ii.init(e,t)});function py(e,t,n){return new Ri({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function fy(e){let t=e._zod.def;return new Ri({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var gg=g("ZodPreprocess",(e,t)=>{$i.init(e,t),Gm.init(e,t)}),vg=g("ZodReadonly",(e,t)=>{Wm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>$h(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function _g(e){return new vg({type:"readonly",innerType:e})}var Sg=g("ZodTemplateLiteral",(e,t)=>{Xm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>nh(e,n,o,r)});function hy(e,t){return new Sg({type:"template_literal",parts:e,...T(t)})}var yg=g("ZodLazy",(e,t)=>{tp.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>zh(e,n,o,r),e.unwrap=()=>e._zod.def.getter()});function mr(e){return new yg({type:"lazy",getter:e})}var bg=g("ZodPromise",(e,t)=>{ep.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Rh(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function gy(e){return new bg({type:"promise",innerType:e})}var $g=g("ZodFunction",(e,t)=>{Qm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>sh(e,n,o,r)});function vy(e){return new $g({type:"function",input:Array.isArray(e?.input)?Xh(e?.input):e?.input??v(Z()),output:e?.output??Z()})}var zi=g("ZodCustom",(e,t)=>{rp.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ah(e,n,o,r)});function _y(e){let t=new fe({check:"custom"});return t._zod.check=e,t}function Sy(e,t){return jf(zi,e??(()=>!0),t)}function Rg(e,t={}){return Af(zi,e,t)}function zg(e,t){return Mf(e,t)}var yy=Uf,by=qf;function $y(e,t={}){let n=new zi({type:"custom",check:"custom",fn:(o)=>o instanceof e,abort:!0,...T(t)});return n._zod.bag.Class=e,n._zod.check=(o)=>{if(!(o.value instanceof e))o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:n,path:[...n._zod.def.path??[]]})},n}var Ry=(...e)=>Lf({Codec:Ri,Boolean:Bn,String:Kn},...e);function zy(e){let t=mr(()=>j([l(e),x(),N(),pt(),v(t),C(l(),t)]));return t}function Zt(e,t){return new gg({type:"pipe",in:vc(e),out:t})}var xg={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"};function JT(e){ge({customError:e})}function BT(){return ge().customError}var Tg;(function(e){})(Tg||(Tg={}));var U={...pi,...Zs,iso:ur},HT=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function YT(e,t){let n=e.$schema;if(n==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(n==="http://json-schema.org/draft-07/schema#")return"draft-7";if(n==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function GT(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===o){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function Ty(e,t){if(e.not!==void 0){if(typeof e.not==="object"&&Object.keys(e.not).length===0)return U.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return U.lazy(()=>{if(!t.refs.has(r))throw Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let i=GT(r,t),a=Ie(i,t);return t.refs.set(r,a),t.processing.delete(r),a}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return U.null();if(r.length===0)return U.never();if(r.length===1)return U.literal(r[0]);if(r.every((a)=>typeof a==="string"))return U.enum(r);let i=r.map((a)=>U.literal(a));if(i.length<2)return i[0];return U.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return U.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map((i)=>{let a={...e,type:i};return Ty(a,t)});if(r.length===0)return U.never();if(r.length===1)return r[0];return U.union(r)}if(!n)return U.any();let o;switch(n){case"string":{let r=U.string();if(e.format){let i=e.format;if(i==="email")r=r.check(U.email());else if(i==="uri"||i==="uri-reference")r=r.check(U.url());else if(i==="uuid"||i==="guid")r=r.check(U.uuid());else if(i==="date-time")r=r.check(U.iso.datetime());else if(i==="date")r=r.check(U.iso.date());else if(i==="time")r=r.check(U.iso.time());else if(i==="duration")r=r.check(U.iso.duration());else if(i==="ipv4")r=r.check(U.ipv4());else if(i==="ipv6")r=r.check(U.ipv6());else if(i==="mac")r=r.check(U.mac());else if(i==="cidr")r=r.check(U.cidrv4());else if(i==="cidr-v6")r=r.check(U.cidrv6());else if(i==="base64")r=r.check(U.base64());else if(i==="base64url")r=r.check(U.base64url());else if(i==="e164")r=r.check(U.e164());else if(i==="jwt")r=r.check(U.jwt());else if(i==="emoji")r=r.check(U.emoji());else if(i==="nanoid")r=r.check(U.nanoid());else if(i==="cuid")r=r.check(U.cuid());else if(i==="cuid2")r=r.check(U.cuid2());else if(i==="ulid")r=r.check(U.ulid());else if(i==="xid")r=r.check(U.xid());else if(i==="ksuid")r=r.check(U.ksuid())}if(typeof e.minLength==="number")r=r.min(e.minLength);if(typeof e.maxLength==="number")r=r.max(e.maxLength);if(e.pattern)r=r.regex(new RegExp(e.pattern));o=r;break}case"number":case"integer":{let r=n==="integer"?U.number().int():U.number();if(typeof e.minimum==="number")r=r.min(e.minimum);if(typeof e.maximum==="number")r=r.max(e.maximum);if(typeof e.exclusiveMinimum==="number")r=r.gt(e.exclusiveMinimum);else if(e.exclusiveMinimum===!0&&typeof e.minimum==="number")r=r.gt(e.minimum);if(typeof e.exclusiveMaximum==="number")r=r.lt(e.exclusiveMaximum);else if(e.exclusiveMaximum===!0&&typeof e.maximum==="number")r=r.lt(e.maximum);if(typeof e.multipleOf==="number")r=r.multipleOf(e.multipleOf);o=r;break}case"boolean":{o=U.boolean();break}case"null":{o=U.null();break}case"object":{let r={},i=e.properties||{},a=new Set(e.required||[]);for(let[c,u]of Object.entries(i)){let d=Ie(u,t);r[c]=a.has(c)?d:d.optional()}if(e.propertyNames){let c=Ie(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties==="object"?Ie(e.additionalProperties,t):U.any();if(Object.keys(r).length===0){o=U.record(c,u);break}let d=U.object(r).passthrough(),m=U.looseRecord(c,u);o=U.intersection(d,m);break}if(e.patternProperties){let c=e.patternProperties,u=Object.keys(c),d=[];for(let p of u){let h=Ie(c[p],t),b=U.string().regex(new RegExp(p));d.push(U.looseRecord(b,h))}let m=[];if(Object.keys(r).length>0)m.push(U.object(r).passthrough());if(m.push(...d),m.length===0)o=U.object({}).passthrough();else if(m.length===1)o=m[0];else{let p=U.intersection(m[0],m[1]);for(let h=2;h<m.length;h++)p=U.intersection(p,m[h]);o=p}break}let s=U.object(r);if(e.additionalProperties===!1)o=s.strict();else if(typeof e.additionalProperties==="object")o=s.catchall(Ie(e.additionalProperties,t));else o=s.passthrough();break}case"array":{let{prefixItems:r,items:i}=e;if(r&&Array.isArray(r)){let a=r.map((c)=>Ie(c,t)),s=i&&typeof i==="object"&&!Array.isArray(i)?Ie(i,t):void 0;if(s)o=U.tuple(a).rest(s);else o=U.tuple(a);if(typeof e.minItems==="number")o=o.check(U.minLength(e.minItems));if(typeof e.maxItems==="number")o=o.check(U.maxLength(e.maxItems))}else if(Array.isArray(i)){let a=i.map((c)=>Ie(c,t)),s=e.additionalItems&&typeof e.additionalItems==="object"?Ie(e.additionalItems,t):void 0;if(s)o=U.tuple(a).rest(s);else o=U.tuple(a);if(typeof e.minItems==="number")o=o.check(U.minLength(e.minItems));if(typeof e.maxItems==="number")o=o.check(U.maxLength(e.maxItems))}else if(i!==void 0){let a=Ie(i,t),s=U.array(a);if(typeof e.minItems==="number")s=s.min(e.minItems);if(typeof e.maxItems==="number")s=s.max(e.maxItems);o=s}else o=U.array(U.any());break}default:throw Error(`Unsupported type: ${n}`)}return o}function Ie(e,t){if(typeof e==="boolean")return e?U.any():U.never();let n=Ty(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map((u)=>Ie(u,t)),c=U.union(s);n=o?U.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map((u)=>Ie(u,t)),c=U.xor(s);n=o?U.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=o?n:U.any();else{let s=o?n:Ie(e.allOf[0],t),c=o?0:1;for(let u=c;u<e.allOf.length;u++)s=U.intersection(s,Ie(e.allOf[u],t));n=s}if(e.nullable===!0&&t.version==="openapi-3.0")n=U.nullable(n);if(e.readOnly===!0)n=U.readonly(n);if(e.default!==void 0)n=n.default(e.default);let r={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)if(s in e)r[s]=e[s];let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)if(s in e)r[s]=e[s];for(let s of Object.keys(e))if(!HT.has(s))r[s]=e[s];if(Object.keys(r).length>0)t.registry.add(n,r);if(e.description)n=n.describe(e.description);return n}function xy(e,t){if(typeof e==="boolean")return e?U.any():U.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=YT(n,t?.defaultTarget),r=n.$defs||n.definitions||{},i={version:o,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??xe};return Ie(n,i)}var yc={};Ut(yc,{bigint:()=>QT,boolean:()=>XT,date:()=>ex,number:()=>ky,string:()=>WT});function WT(e){return rf(Kn,e)}function ky(e){return df(Jn,e)}function XT(e){return _f(Bn,e)}function QT(e){return yf(Hn,e)}function ex(e){return Pf(Si,e)}ge(ai());var Wr="2025-11-25",bc="2025-03-26",xi=[Wr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],$c="io.modelcontextprotocol/related-task",ct="io.modelcontextprotocol/protocolVersion",Xr="io.modelcontextprotocol/clientInfo",Pt="io.modelcontextprotocol/serverInfo",Ot="io.modelcontextprotocol/clientCapabilities",Qr="io.modelcontextprotocol/subscriptionId",fr="io.modelcontextprotocol/logLevel";var en="2.0";var pr=mr(()=>j([l(),x(),N(),pt(),C(l(),pr),v(pr)])),ve=C(l(),pr),Eg=v(pr),ki=j([l(),x().int()]),Ei=l(),Rc=f({ttl:x().optional()}),zc=f({taskId:l()}),wi=H({progressToken:ki.optional(),[$c]:zc.optional()}),ze=f({_meta:wi.optional()}),tn=ze.extend({task:Rc.optional()}),_e=f({method:l(),params:ze.loose().optional()}),Pe=f({_meta:wi.optional()}),Oe=f({method:l(),params:Pe.loose().optional()}),Ii=H({get[Pt](){return Xn.optional().catch(void 0)}}),Se=H({_meta:Ii.optional()}),hr=j([l(),x().int()]),Pi=f({jsonrpc:S(en),id:hr,..._e.shape}).strict(),Oi=f({jsonrpc:S(en),...Oe.shape}).strict(),Yn=f({jsonrpc:S(en),id:hr,result:Se}).strict(),Gn=f({jsonrpc:S(en),id:hr.optional(),error:f({code:x().int(),message:l(),data:Z().optional()})}).strict(),Wn=j([Pi,Oi,Yn,Gn]),wg=j([Yn,Gn]),Ci=Se.strict(),Tc=Pe.extend({requestId:hr.optional(),reason:l().optional()}),Ni=Oe.extend({method:S("notifications/cancelled"),params:Tc}),xc=f({src:l(),mimeType:l().optional(),sizes:v(l()).optional(),theme:Q(["light","dark"]).optional()}),gr=f({icons:v(xc).optional()}),Kt=f({name:l(),title:l().optional()}),Xn=Kt.extend({...Kt.shape,...gr.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),rx=ft(f({applyDefaults:N().optional()}),ve),nx=Zt((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)&&Object.keys(e).length===0)return{form:{}};return e},ft(f({form:rx.optional(),url:ve.optional()}),ve.optional())),kc=H({list:ve.optional(),cancel:ve.optional(),requests:H({sampling:H({createMessage:ve.optional()}).optional(),elicitation:H({create:ve.optional()}).optional()}).optional()}),Ec=H({list:ve.optional(),cancel:ve.optional(),requests:H({tools:H({call:ve.optional()}).optional()}).optional()}),wc=f({experimental:C(l(),ve).optional(),sampling:f({context:ve.optional(),tools:ve.optional()}).optional(),elicitation:nx.optional(),roots:f({listChanged:N().optional()}).optional(),tasks:kc.optional(),extensions:C(l(),ve).optional()}),Ic=ze.extend({protocolVersion:l(),capabilities:wc,clientInfo:Xn}),ji=_e.extend({method:S("initialize"),params:Ic}),Ai=f({experimental:C(l(),ve).optional(),logging:ve.optional(),completions:ve.optional(),prompts:f({listChanged:N().optional()}).optional(),resources:f({subscribe:N().optional(),listChanged:N().optional()}).optional(),tools:f({listChanged:N().optional()}).optional(),tasks:Ec.optional(),extensions:C(l(),ve).optional()}),Pc=Se.extend({protocolVersion:l(),capabilities:Ai,serverInfo:Xn,instructions:l().optional()}),Oc=Oe.extend({method:S("notifications/initialized"),params:Pe.optional()}),Cc=_e.extend({method:S("server/discover"),params:ze.optional()}),Nc=Se.extend({supportedVersions:v(l()),capabilities:Ai,instructions:l().optional()}),Mi=_e.extend({method:S("ping"),params:ze.optional()}),jc=f({progress:x(),total:F(x()),message:F(l())}),Ac=f({...Pe.shape,...jc.shape,progressToken:ki}),Ui=Oe.extend({method:S("notifications/progress"),params:Ac}),Mc=ze.extend({cursor:Ei.optional()}),vr=_e.extend({params:Mc.optional()}),_r=Se.extend({nextCursor:Ei.optional()}),qi=f({uri:l(),mimeType:F(l()),_meta:C(l(),Z()).optional()}),Li=qi.extend({text:l()}),Ig=l().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Di=qi.extend({blob:Ig}),Sr=Q(["user","assistant"]),Ft=f({audience:v(Sr).optional(),priority:x().min(0).max(1).optional(),lastModified:Hr({offset:!0}).optional()}),Zi=f({...Kt.shape,...gr.shape,uri:l(),description:F(l()),mimeType:F(l()),size:F(x()),annotations:Ft.optional(),_meta:F(H({}))}),Uc=f({...Kt.shape,...gr.shape,uriTemplate:l(),description:F(l()),mimeType:F(l()),annotations:Ft.optional(),_meta:F(H({}))}),qc=vr.extend({method:S("resources/list")}),Lc=_r.extend({resources:v(Zi)}),Dc=vr.extend({method:S("resources/templates/list")}),Zc=_r.extend({resourceTemplates:v(Uc)}),Qn=ze.extend({uri:l()}),Kc=Qn,Fc=_e.extend({method:S("resources/read"),params:Kc}),Vc=Se.extend({contents:v(j([Li,Di]))}),Jc=Oe.extend({method:S("notifications/resources/list_changed"),params:Pe.optional()}),Bc=Qn,Hc=_e.extend({method:S("resources/subscribe"),params:Bc}),Yc=Qn,Gc=_e.extend({method:S("resources/unsubscribe"),params:Yc}),Ki=f({toolsListChanged:N().optional(),promptsListChanged:N().optional(),resourcesListChanged:N().optional(),resourceSubscriptions:v(l()).optional()}),Wc=ze.extend({notifications:Ki}),Xc=_e.extend({method:S("subscriptions/listen"),params:Wc}),Qc=Pe.extend({notifications:Ki}),el=Oe.extend({method:S("notifications/subscriptions/acknowledged"),params:Qc}),tl=Ii.extend({[Qr]:hr}),rl=Se.extend({_meta:tl}),nl=Pe.extend({uri:l()}),ol=Oe.extend({method:S("notifications/resources/updated"),params:nl}),il=f({name:l(),description:F(l()),required:F(N())}),al=f({...Kt.shape,...gr.shape,description:F(l()),arguments:F(v(il)),_meta:F(H({}))}),sl=vr.extend({method:S("prompts/list")}),cl=_r.extend({prompts:v(al)}),ll=ze.extend({name:l(),arguments:C(l(),l()).optional()}),ul=_e.extend({method:S("prompts/get"),params:ll}),eo=f({type:S("text"),text:l(),annotations:Ft.optional(),_meta:C(l(),Z()).optional()}),to=f({type:S("image"),data:Ig,mimeType:l(),annotations:Ft.optional(),_meta:C(l(),Z()).optional()}),ro=f({type:S("audio"),data:Ig,mimeType:l(),annotations:Ft.optional(),_meta:C(l(),Z()).optional()}),dl=f({type:S("tool_use"),name:l(),id:l(),input:C(l(),Z()),_meta:C(l(),Z()).optional()}),ml=f({type:S("resource"),resource:j([Li,Di]),annotations:Ft.optional(),_meta:C(l(),Z()).optional()}),pl=Zi.extend({type:S("resource_link")}),no=j([eo,to,ro,pl,ml]),fl=f({role:Sr,content:no}),hl=Se.extend({description:l().optional(),messages:v(fl)}),gl=Oe.extend({method:S("notifications/prompts/list_changed"),params:Pe.optional()}),vl=f({title:l().optional(),readOnlyHint:N().optional(),destructiveHint:N().optional(),idempotentHint:N().optional(),openWorldHint:N().optional()}),_l=f({taskSupport:Q(["required","optional","forbidden"]).optional()}),Fi=f({...Kt.shape,...gr.shape,description:l().optional(),inputSchema:f({type:S("object"),properties:C(l(),pr).optional(),required:v(l()).optional()}).catchall(Z()),outputSchema:H({$schema:l().optional()}).optional(),annotations:vl.optional(),execution:_l.optional(),_meta:C(l(),Z()).optional()}),Sl=vr.extend({method:S("tools/list")}),yl=_r.extend({tools:v(Fi)}),Vi=Se.extend({content:v(no).default([]),structuredContent:Z().optional(),isError:N().optional()}),Pg=Vi.or(Se.extend({toolResult:Z()})),bl=tn.extend({name:l(),arguments:C(l(),Z()).optional()}),$l=_e.extend({method:S("tools/call"),params:bl}),Rl=Oe.extend({method:S("notifications/tools/list_changed"),params:Pe.optional()}),Og=f({autoRefresh:N().default(!0),debounceMs:x().int().nonnegative().default(300)}),yr=Q(["debug","info","notice","warning","error","critical","alert","emergency"]),zl=ze.extend({level:yr}),Tl=_e.extend({method:S("logging/setLevel"),params:zl}),xl=Pe.extend({level:yr,logger:l().optional(),data:Z()}),kl=Oe.extend({method:S("notifications/message"),params:xl}),El=f({name:l().optional()}),wl=f({hints:v(El).optional(),costPriority:x().min(0).max(1).optional(),speedPriority:x().min(0).max(1).optional(),intelligencePriority:x().min(0).max(1).optional()}),Il=f({mode:Q(["auto","required","none"]).optional()}),Pl=f({type:S("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:v(no),structuredContent:Z().optional(),isError:N().optional(),_meta:C(l(),Z()).optional()}),Ol=dr("type",[eo,to,ro]),Gr=dr("type",[eo,to,ro,dl,Pl]),Cl=f({role:Sr,content:j([Gr,v(Gr)]),_meta:C(l(),Z()).optional()}),Nl=tn.extend({messages:v(Cl),modelPreferences:wl.optional(),systemPrompt:l().optional(),includeContext:Q(["none","thisServer","allServers"]).optional(),temperature:x().optional(),maxTokens:x().int(),stopSequences:v(l()).optional(),metadata:ve.optional(),tools:v(Fi).optional(),toolChoice:Il.optional()}),jl=_e.extend({method:S("sampling/createMessage"),params:Nl}),Al=Se.extend({model:l(),stopReason:F(Q(["endTurn","stopSequence","maxTokens"]).or(l())),role:Sr,content:Ol}),Ml=Se.extend({model:l(),stopReason:F(Q(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:Sr,content:j([Gr,v(Gr)])}),Ji=f({type:S("boolean"),title:l().optional(),description:l().optional(),default:N().optional()}),oo=f({type:S("string"),title:l().optional(),description:l().optional(),minLength:x().optional(),maxLength:x().optional(),format:Q(["email","uri","date","date-time"]).optional(),default:l().optional()}),io=f({type:Q(["number","integer"]),title:l().optional(),description:l().optional(),minimum:x().optional(),maximum:x().optional(),default:x().optional()}),Bi=f({type:S("string"),title:l().optional(),description:l().optional(),enum:v(l()),default:l().optional()}),Hi=f({type:S("string"),title:l().optional(),description:l().optional(),oneOf:v(f({const:l(),title:l()})),default:l().optional()}),Yi=f({type:S("string"),title:l().optional(),description:l().optional(),enum:v(l()),enumNames:v(l()).optional(),default:l().optional()}),Ul=j([Bi,Hi]),Gi=f({type:S("array"),title:l().optional(),description:l().optional(),minItems:x().optional(),maxItems:x().optional(),items:f({type:S("string"),enum:v(l())}),default:v(l()).optional()}),Wi=f({type:S("array"),title:l().optional(),description:l().optional(),minItems:x().optional(),maxItems:x().optional(),items:f({anyOf:v(f({const:l(),title:l()}))}),default:v(l()).optional()}),ql=j([Gi,Wi]),Ll=j([Yi,Ul,ql]),Xi=j([Ll,Ji,oo,io]),ao=tn.extend({mode:S("form").optional(),message:l(),requestedSchema:f({type:S("object"),properties:C(l(),Xi),required:v(l()).optional()}).catchall(Z())}),Dl=tn.extend({mode:S("url"),message:l(),elicitationId:l(),url:l().url()}),Zl=j([ao,Dl]),Kl=_e.extend({method:S("elicitation/create"),params:Zl}),Fl=Pe.extend({elicitationId:l()}),Vl=Oe.extend({method:S("notifications/elicitation/complete"),params:Fl}),Jl=Se.extend({action:Q(["accept","decline","cancel"]),content:Zt((e)=>e===null?void 0:e,C(l(),j([l(),x(),N(),v(l())])).optional())}),Bl=f({type:S("ref/resource"),uri:l()}),Hl=f({type:S("ref/prompt"),name:l()}),Yl=ze.extend({ref:j([Hl,Bl]),argument:f({name:l(),value:l()}),context:f({arguments:C(l(),l()).optional()}).optional()}),Gl=_e.extend({method:S("completion/complete"),params:Yl}),Wl=Se.extend({completion:H({values:v(l()).max(100),total:F(x().int()),hasMore:F(N())})}),Xl=f({uri:l().startsWith("file://"),name:l().optional(),_meta:C(l(),Z()).optional()}),Ql=_e.extend({method:S("roots/list"),params:ze.optional()}),eu=Se.extend({roots:v(Xl)}),tu=Oe.extend({method:S("notifications/roots/list_changed"),params:Pe.optional()}),Cg=H({ttl:x().optional(),pollInterval:x().optional()}),ru=Q(["working","input_required","completed","failed","cancelled"]),br=f({taskId:l(),status:ru,ttl:j([x(),pt()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:F(x()),statusMessage:F(l())}),Ng=Se.extend({task:br}),nu=Pe.merge(br),jg=Oe.extend({method:S("notifications/tasks/status"),params:nu}),Ag=_e.extend({method:S("tasks/get"),params:ze.extend({taskId:l()})}),Mg=Se.merge(br),Ug=_e.extend({method:S("tasks/result"),params:ze.extend({taskId:l()})}),qg=Se.loose(),Lg=vr.extend({method:S("tasks/list")}),Dg=_r.extend({tasks:v(br)}),Zg=_e.extend({method:S("tasks/cancel"),params:ze.extend({taskId:l()})}),Kg=Se.merge(br),Fg=j([Mi,ji,Cc,Gl,Tl,ul,sl,qc,Dc,Fc,Hc,Gc,Xc,$l,Sl]),Vg=j([Ni,Ui,Oc,tu]),Jg=j([Ci,Al,Ml,Jl,eu]),Bg=j([Mi,jl,Kl,Ql]),Hg=j([Ni,Ui,kl,ol,Jc,Rl,gl,el,Vl]),Yg=j([Ci,Pc,Nc,Wl,hl,cl,Lc,Zc,Vc,Vi,yl,rl]),Re=Fn().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:xg.custom,message:"URL must be parseable",fatal:!0}),Fo}).refine((e)=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Gg=H({resource:l().url(),authorization_servers:v(Re).optional(),jwks_uri:l().url().optional(),scopes_supported:v(l()).optional(),bearer_methods_supported:v(l()).optional(),resource_signing_alg_values_supported:v(l()).optional(),resource_name:l().optional(),resource_documentation:l().optional(),resource_policy_uri:l().url().optional(),resource_tos_uri:l().url().optional(),tls_client_certificate_bound_access_tokens:N().optional(),authorization_details_types_supported:v(l()).optional(),dpop_signing_alg_values_supported:v(l()).optional(),dpop_bound_access_tokens_required:N().optional()}),ou=H({issuer:l(),authorization_endpoint:Re,token_endpoint:Re,registration_endpoint:Re.optional(),scopes_supported:v(l()).optional(),response_types_supported:v(l()),response_modes_supported:v(l()).optional(),grant_types_supported:v(l()).optional(),token_endpoint_auth_methods_supported:v(l()).optional(),token_endpoint_auth_signing_alg_values_supported:v(l()).optional(),service_documentation:Re.optional(),revocation_endpoint:Re.optional(),revocation_endpoint_auth_methods_supported:v(l()).optional(),revocation_endpoint_auth_signing_alg_values_supported:v(l()).optional(),introspection_endpoint:l().optional(),introspection_endpoint_auth_methods_supported:v(l()).optional(),introspection_endpoint_auth_signing_alg_values_supported:v(l()).optional(),code_challenge_methods_supported:v(l()).optional(),client_id_metadata_document_supported:N().optional(),authorization_response_iss_parameter_supported:N().optional().catch(void 0)}),iu=H({issuer:l(),authorization_endpoint:Re,token_endpoint:Re,userinfo_endpoint:Re.optional(),jwks_uri:Re,registration_endpoint:Re.optional(),scopes_supported:v(l()).optional(),response_types_supported:v(l()),response_modes_supported:v(l()).optional(),grant_types_supported:v(l()).optional(),acr_values_supported:v(l()).optional(),subject_types_supported:v(l()),id_token_signing_alg_values_supported:v(l()),id_token_encryption_alg_values_supported:v(l()).optional(),id_token_encryption_enc_values_supported:v(l()).optional(),userinfo_signing_alg_values_supported:v(l()).optional(),userinfo_encryption_alg_values_supported:v(l()).optional(),userinfo_encryption_enc_values_supported:v(l()).optional(),request_object_signing_alg_values_supported:v(l()).optional(),request_object_encryption_alg_values_supported:v(l()).optional(),request_object_encryption_enc_values_supported:v(l()).optional(),token_endpoint_auth_methods_supported:v(l()).optional(),token_endpoint_auth_signing_alg_values_supported:v(l()).optional(),display_values_supported:v(l()).optional(),claim_types_supported:v(l()).optional(),claims_supported:v(l()).optional(),service_documentation:l().optional(),claims_locales_supported:v(l()).optional(),ui_locales_supported:v(l()).optional(),claims_parameter_supported:N().optional(),request_parameter_supported:N().optional(),request_uri_parameter_supported:N().optional(),require_request_uri_registration:N().optional(),op_policy_uri:Re.optional(),op_tos_uri:Re.optional(),client_id_metadata_document_supported:N().optional(),authorization_response_iss_parameter_supported:N().optional().catch(void 0)}),Wg=f({...iu.shape,...ou.pick({code_challenge_methods_supported:!0}).shape}),Xg=f({access_token:l(),id_token:l().optional(),token_type:l(),expires_in:ky().optional(),scope:l().optional(),refresh_token:l().optional()}).strip(),Qg=f({issued_token_type:S("urn:ietf:params:oauth:token-type:id-jag"),access_token:l(),token_type:l().optional(),expires_in:x().optional(),scope:l().optional()}).strip(),ev=f({error:l(),error_description:l().optional(),error_uri:l().optional()}),kg=Re.optional().or(S("").transform(()=>{return})),au=f({redirect_uris:v(Re),token_endpoint_auth_method:l().optional(),grant_types:v(l()).optional(),response_types:v(l()).optional(),application_type:l().optional(),client_name:l().optional(),client_uri:Re.optional(),logo_uri:kg,scope:l().optional(),contacts:v(l()).optional(),tos_uri:kg,policy_uri:l().optional(),jwks_uri:Re.optional(),jwks:hc().optional(),software_id:l().optional(),software_version:l().optional(),software_statement:l().optional()}).strip(),su=f({client_id:l(),client_secret:l().optional(),client_id_issued_at:x().optional(),client_secret_expires_at:x().optional()}).strip(),tv=au.merge(su),rv=f({error:l(),error_description:l().optional()}).strip(),nv=f({token:l(),token_type_hint:l().optional()}).strip();var cv=Symbol.for("mcp.sdk.errorBrands");function mv(e,t){let n=new Set,o=t;while(typeof o==="function"){let r=o.mcpBrand;if(Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof r==="string")n.add(r);o=Object.getPrototypeOf(o)}if(n.size===0)return;Object.defineProperty(e,cv,{value:n,enumerable:!1,configurable:!0})}function uo(e,t){try{if(typeof t==="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(t,cv)){let n=t[cv];if(n&&typeof n.has==="function"&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var ox=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return uo(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return uo(this,t)}constructor(t,n,o){super(n);this.code=t,this.errorUri=o,this.name="OAuthError",mv(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};if(this.errorUri)t.error_uri=this.errorUri;return t}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},ie=function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e}({}),te=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return uo(this,e)}static isInstance(e){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return uo(this,e)}constructor(e,t,n){super(t);this.code=e,this.data=n,this.name="SdkError",mv(this,new.target)}},ix=class extends te{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,n){super(e,t,n);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};var Ay={};function Wy(e){return Object.hasOwn(Ay,e)?Ay[e]:void 0}function My(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function ax(e,t,n){return e==="elicitation"&&t==="form"&&n.form===void 0&&n.url===void 0}function Xy(e){switch(e.method){case"elicitation/create":if(e.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;if(t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function oa(e,t){let n={};for(let[o,r]of Object.entries(e)){if(r===void 0)continue;let i=t===void 0?void 0:t[o];if(i===void 0){n[o]=r;continue}if(My(r)&&My(i)){let a={};for(let[s,c]of Object.entries(r))if(c!==void 0&&i[s]===void 0&&!ax(o,s,i))a[s]=c;if(Object.keys(a).length>0)n[o]=a}}return Object.keys(n).length>0?n:void 0}var Qy="2026-07-28",ia=[Qy];function Jt(e){return e>=Qy}function eb(e){return e.filter((t)=>!Jt(t))}function pv(e){return e.filter((t)=>Jt(t))}function tb(e){let t=e.structuredContent;if(t===void 0)return e;if(!(typeof t!=="object"||t===null||Array.isArray(t)))return e;if(e.content?.some((n)=>n.type==="text")??!1)return e;return{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var rb=["task","inputRequests","requestState"];function fv(e){if(e===null||typeof e!=="object"||Array.isArray(e)||e.content!==void 0||rb.some((t)=>(t in e)))return e;return{...e,content:[]}}function sx(){let e=mr(()=>j([l(),x(),N(),pt(),C(l(),e),v(e)])),t=C(l(),e),n=j([l(),x().int()]),o=l(),r=f({ttl:x().optional()}),i=f({taskId:l()}),a=H({progressToken:n.optional(),"io.modelcontextprotocol/related-task":i.optional()}),s=f({_meta:a.optional()}),c=s.extend({task:r.optional()}),u=f({method:l(),params:s.loose().optional()}),d=f({_meta:a.optional()}),m=f({method:l(),params:d.loose().optional()}),p=H({_meta:a.optional()}),h=j([l(),x().int()]),b=p.strict(),R=d.extend({requestId:h.optional(),reason:l().optional()}),z=m.extend({method:S("notifications/cancelled"),params:R}),A=f({src:l(),mimeType:l().optional(),sizes:v(l()).optional(),theme:Q(["light","dark"]).optional()}),B=f({icons:v(A).optional()}),P=f({name:l(),title:l().optional()}),O=P.extend({...P.shape,...B.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),V=ft(f({applyDefaults:N().optional()}),t),Y=Zt((we)=>{if(we&&typeof we==="object"&&!Array.isArray(we)&&Object.keys(we).length===0)return{form:{}};return we},ft(f({form:V.optional(),url:t.optional()}),t.optional())),ee=H({list:t.optional(),cancel:t.optional(),requests:H({sampling:H({createMessage:t.optional()}).optional(),elicitation:H({create:t.optional()}).optional()}).optional()}),ne=H({list:t.optional(),cancel:t.optional(),requests:H({tools:H({call:t.optional()}).optional()}).optional()}),ae=f({experimental:C(l(),t).optional(),sampling:f({context:t.optional(),tools:t.optional()}).optional(),elicitation:Y.optional(),roots:f({listChanged:N().optional()}).optional(),tasks:ee.optional(),extensions:C(l(),t).optional()}),ce=s.extend({protocolVersion:l(),capabilities:ae,clientInfo:O}),ue=u.extend({method:S("initialize"),params:ce}),Te=f({experimental:C(l(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:f({listChanged:N().optional()}).optional(),resources:f({subscribe:N().optional(),listChanged:N().optional()}).optional(),tools:f({listChanged:N().optional()}).optional(),tasks:ne.optional(),extensions:C(l(),t).optional()}),tt=p.extend({protocolVersion:l(),capabilities:Te,serverInfo:O,instructions:l().optional()}),Ne=m.extend({method:S("notifications/initialized"),params:d.optional()}),rt=u.extend({method:S("ping"),params:s.optional()}),vt=f({progress:x(),total:F(x()),message:F(l())}),Ze=f({...d.shape,...vt.shape,progressToken:n}),nt=m.extend({method:S("notifications/progress"),params:Ze}),_t=s.extend({cursor:o.optional()}),Ye=u.extend({params:_t.optional()}),je=p.extend({nextCursor:o.optional()}),At=f({uri:l(),mimeType:F(l()),_meta:C(l(),Z()).optional()}),Mt=At.extend({text:l()}),St=l().refine((we)=>{try{return atob(we),!0}catch{return!1}},{message:"Invalid Base64 string"}),ke=At.extend({blob:St}),Ae=Q(["user","assistant"]),Me=f({audience:v(Ae).optional(),priority:x().min(0).max(1).optional(),lastModified:Hr({offset:!0}).optional()}),ut=f({...P.shape,...B.shape,uri:l(),description:F(l()),mimeType:F(l()),size:F(x()),annotations:Me.optional(),_meta:F(H({}))}),kr=f({...P.shape,...B.shape,uriTemplate:l(),description:F(l()),mimeType:F(l()),annotations:Me.optional(),_meta:F(H({}))}),Ge=Ye.extend({method:S("resources/list")}),We=je.extend({resources:v(ut)}),Ke=Ye.extend({method:S("resources/templates/list")}),ot=je.extend({resourceTemplates:v(kr)}),it=s.extend({uri:l()}),yt=it,bt=u.extend({method:S("resources/read"),params:yt}),Gt=p.extend({contents:v(j([Mt,ke]))}),$t=m.extend({method:S("notifications/resources/list_changed"),params:d.optional()}),Er=it,q=u.extend({method:S("resources/subscribe"),params:Er}),Rt=it,G=u.extend({method:S("resources/unsubscribe"),params:Rt}),K=d.extend({uri:l()}),oe=m.extend({method:S("notifications/resources/updated"),params:K}),L=f({name:l(),description:F(l()),required:F(N())}),M=f({...P.shape,...B.shape,description:F(l()),arguments:F(v(L)),_meta:F(H({}))}),X=Ye.extend({method:S("prompts/list")}),W=je.extend({prompts:v(M)}),be=s.extend({name:l(),arguments:C(l(),l()).optional()}),wr=u.extend({method:S("prompts/get"),params:be}),zt=f({type:S("text"),text:l(),annotations:Me.optional(),_meta:C(l(),Z()).optional()}),Ir=f({type:S("image"),data:St,mimeType:l(),annotations:Me.optional(),_meta:C(l(),Z()).optional()}),Pr=f({type:S("audio"),data:St,mimeType:l(),annotations:Me.optional(),_meta:C(l(),Z()).optional()}),vo=f({type:S("tool_use"),name:l(),id:l(),input:C(l(),Z()),_meta:C(l(),Z()).optional()}),Wt=f({type:S("resource"),resource:j([Mt,ke]),annotations:Me.optional(),_meta:C(l(),Z()).optional()}),_o=ut.extend({type:S("resource_link")}),at=j([zt,Ir,Pr,_o,Wt]),cn=f({role:Ae,content:at}),ln=p.extend({description:l().optional(),messages:v(cn)}),Or=m.extend({method:S("notifications/prompts/list_changed"),params:d.optional()}),So=f({title:l().optional(),readOnlyHint:N().optional(),destructiveHint:N().optional(),idempotentHint:N().optional(),openWorldHint:N().optional()}),un=f({taskSupport:Q(["required","optional","forbidden"]).optional()}),Cr=f({...P.shape,...B.shape,description:l().optional(),inputSchema:f({type:S("object"),properties:C(l(),e).optional(),required:v(l()).optional()}).catchall(Z()),outputSchema:f({type:S("object"),properties:C(l(),e).optional(),required:v(l()).optional()}).catchall(Z()).optional(),annotations:So.optional(),execution:un.optional(),_meta:C(l(),Z()).optional()}),dn=Ye.extend({method:S("tools/list")}),mn=je.extend({tools:v(Cr)}),pn=p.extend({content:v(at),structuredContent:C(l(),Z()).optional(),isError:N().optional()}),Ee=c.extend({name:l(),arguments:C(l(),Z()).optional()}),yo=u.extend({method:S("tools/call"),params:Ee}),Sa=m.extend({method:S("notifications/tools/list_changed"),params:d.optional()}),fn=Q(["debug","info","notice","warning","error","critical","alert","emergency"]),bo=s.extend({level:fn}),$o=u.extend({method:S("logging/setLevel"),params:bo}),Ro=d.extend({level:fn,logger:l().optional(),data:Z()}),zo=m.extend({method:S("notifications/message"),params:Ro}),To=f({name:l().optional()}),xo=f({hints:v(To).optional(),costPriority:x().min(0).max(1).optional(),speedPriority:x().min(0).max(1).optional(),intelligencePriority:x().min(0).max(1).optional()}),ko=f({mode:Q(["auto","required","none"]).optional()}),ya=f({type:S("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:v(at),structuredContent:f({}).loose().optional(),isError:N().optional(),_meta:C(l(),Z()).optional()}),Eo=dr("type",[zt,Ir,Pr]),Xt=dr("type",[zt,Ir,Pr,vo,ya]),wo=f({role:Ae,content:j([Xt,v(Xt)]),_meta:C(l(),Z()).optional()}),Io=c.extend({messages:v(wo),modelPreferences:xo.optional(),systemPrompt:l().optional(),includeContext:Q(["none","thisServer","allServers"]).optional(),temperature:x().optional(),maxTokens:x().int(),stopSequences:v(l()).optional(),metadata:t.optional(),tools:v(Cr).optional(),toolChoice:ko.optional()}),Po=u.extend({method:S("sampling/createMessage"),params:Io}),Oo=p.extend({model:l(),stopReason:F(Q(["endTurn","stopSequence","maxTokens"]).or(l())),role:Ae,content:Eo}),Co=p.extend({model:l(),stopReason:F(Q(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:Ae,content:j([Xt,v(Xt)])}),No=f({type:S("boolean"),title:l().optional(),description:l().optional(),default:N().optional()}),jo=f({type:S("string"),title:l().optional(),description:l().optional(),minLength:x().optional(),maxLength:x().optional(),format:Q(["email","uri","date","date-time"]).optional(),default:l().optional()}),Ao=f({type:Q(["number","integer"]),title:l().optional(),description:l().optional(),minimum:x().optional(),maximum:x().optional(),default:x().optional()}),Mo=f({type:S("string"),title:l().optional(),description:l().optional(),enum:v(l()),default:l().optional()}),Uo=f({type:S("string"),title:l().optional(),description:l().optional(),oneOf:v(f({const:l(),title:l()})),default:l().optional()}),qo=f({type:S("string"),title:l().optional(),description:l().optional(),enum:v(l()),enumNames:v(l()).optional(),default:l().optional()}),Lo=j([Mo,Uo]),Nr=f({type:S("array"),title:l().optional(),description:l().optional(),minItems:x().optional(),maxItems:x().optional(),items:f({type:S("string"),enum:v(l())}),default:v(l()).optional()}),jr=f({type:S("array"),title:l().optional(),description:l().optional(),minItems:x().optional(),maxItems:x().optional(),items:f({anyOf:v(f({const:l(),title:l()}))}),default:v(l()).optional()}),ba=j([Nr,jr]),$a=j([qo,Lo,ba]),Xe=j([$a,No,jo,Ao]),Qe=c.extend({mode:S("form").optional(),message:l(),requestedSchema:f({type:S("object"),properties:C(l(),Xe),required:v(l()).optional()}).catchall(Z())}),Do=c.extend({mode:S("url"),message:l(),elicitationId:l(),url:l().url()}),dt=j([Qe,Do]),Ra=u.extend({method:S("elicitation/create"),params:dt}),za=d.extend({elicitationId:l()}),Ta=m.extend({method:S("notifications/elicitation/complete"),params:za}),xa=p.extend({action:Q(["accept","decline","cancel"]),content:Zt((we)=>we===null?void 0:we,C(l(),j([l(),x(),N(),v(l())])).optional())}),ka=f({type:S("ref/resource"),uri:l()}),Ea=f({type:S("ref/prompt"),name:l()}),wa=s.extend({ref:j([Ea,ka]),argument:f({name:l(),value:l()}),context:f({arguments:C(l(),l()).optional()}).optional()}),Zo=u.extend({method:S("completion/complete"),params:wa}),Ia=p.extend({completion:H({values:v(l()).max(100),total:F(x().int()),hasMore:F(N())})}),Pa=f({uri:l().startsWith("file://"),name:l().optional(),_meta:C(l(),Z()).optional()}),hn=u.extend({method:S("roots/list"),params:s.optional()}),Ko=p.extend({roots:v(Pa)}),Oa=m.extend({method:S("notifications/roots/list_changed"),params:d.optional()}),Ca=H({ttl:x().optional(),pollInterval:x().optional()}),Na=Q(["working","input_required","completed","failed","cancelled"]),Qt=f({taskId:l(),status:Na,ttl:j([x(),pt()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:F(x()),statusMessage:F(l())}),Fe=p.extend({task:Qt}),ja=d.merge(Qt),Ar=m.extend({method:S("notifications/tasks/status"),params:ja}),gn=u.extend({method:S("tasks/get"),params:s.extend({taskId:l()})}),vn=p.merge(Qt),_n=u.extend({method:S("tasks/result"),params:s.extend({taskId:l()})}),Au=p.loose(),Ve=Ye.extend({method:S("tasks/list")}),ye=je.extend({tasks:v(Qt)}),Mr=u.extend({method:S("tasks/cancel"),params:s.extend({taskId:l()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:o,TaskMetadataSchema:r,RelatedTaskMetadataSchema:i,RequestMetaSchema:a,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:d,NotificationSchema:m,ResultSchema:p,RequestIdSchema:h,EmptyResultSchema:b,CancelledNotificationParamsSchema:R,CancelledNotificationSchema:z,IconSchema:A,IconsSchema:B,BaseMetadataSchema:P,ImplementationSchema:O,ClientTasksCapabilitySchema:ee,ServerTasksCapabilitySchema:ne,ClientCapabilitiesSchema:ae,InitializeRequestParamsSchema:ce,InitializeRequestSchema:ue,ServerCapabilitiesSchema:Te,InitializeResultSchema:tt,InitializedNotificationSchema:Ne,PingRequestSchema:rt,ProgressSchema:vt,ProgressNotificationParamsSchema:Ze,ProgressNotificationSchema:nt,PaginatedRequestParamsSchema:_t,PaginatedRequestSchema:Ye,PaginatedResultSchema:je,ResourceContentsSchema:At,TextResourceContentsSchema:Mt,BlobResourceContentsSchema:ke,RoleSchema:Ae,AnnotationsSchema:Me,ResourceSchema:ut,ResourceTemplateSchema:kr,ListResourcesRequestSchema:Ge,ListResourcesResultSchema:We,ListResourceTemplatesRequestSchema:Ke,ListResourceTemplatesResultSchema:ot,ResourceRequestParamsSchema:it,ReadResourceRequestParamsSchema:yt,ReadResourceRequestSchema:bt,ReadResourceResultSchema:Gt,ResourceListChangedNotificationSchema:$t,SubscribeRequestParamsSchema:Er,SubscribeRequestSchema:q,UnsubscribeRequestParamsSchema:Rt,UnsubscribeRequestSchema:G,ResourceUpdatedNotificationParamsSchema:K,ResourceUpdatedNotificationSchema:oe,PromptArgumentSchema:L,PromptSchema:M,ListPromptsRequestSchema:X,ListPromptsResultSchema:W,GetPromptRequestParamsSchema:be,GetPromptRequestSchema:wr,TextContentSchema:zt,ImageContentSchema:Ir,AudioContentSchema:Pr,ToolUseContentSchema:vo,EmbeddedResourceSchema:Wt,ResourceLinkSchema:_o,ContentBlockSchema:at,PromptMessageSchema:cn,GetPromptResultSchema:ln,PromptListChangedNotificationSchema:Or,ToolAnnotationsSchema:So,ToolExecutionSchema:un,ToolSchema:Cr,ListToolsRequestSchema:dn,ListToolsResultSchema:mn,CallToolResultSchema:pn,CallToolRequestParamsSchema:Ee,CallToolRequestSchema:yo,ToolListChangedNotificationSchema:Sa,LoggingLevelSchema:fn,SetLevelRequestParamsSchema:bo,SetLevelRequestSchema:$o,LoggingMessageNotificationParamsSchema:Ro,LoggingMessageNotificationSchema:zo,ModelHintSchema:To,ModelPreferencesSchema:xo,ToolChoiceSchema:ko,ToolResultContentSchema:ya,SamplingContentSchema:Eo,SamplingMessageContentBlockSchema:Xt,SamplingMessageSchema:wo,CreateMessageRequestParamsSchema:Io,CreateMessageRequestSchema:Po,CreateMessageResultSchema:Oo,CreateMessageResultWithToolsSchema:Co,BooleanSchemaSchema:No,StringSchemaSchema:jo,NumberSchemaSchema:Ao,UntitledSingleSelectEnumSchemaSchema:Mo,TitledSingleSelectEnumSchemaSchema:Uo,LegacyTitledEnumSchemaSchema:qo,SingleSelectEnumSchemaSchema:Lo,UntitledMultiSelectEnumSchemaSchema:Nr,TitledMultiSelectEnumSchemaSchema:jr,MultiSelectEnumSchemaSchema:ba,EnumSchemaSchema:$a,PrimitiveSchemaDefinitionSchema:Xe,ElicitRequestFormParamsSchema:Qe,ElicitRequestURLParamsSchema:Do,ElicitRequestParamsSchema:dt,ElicitRequestSchema:Ra,ElicitationCompleteNotificationParamsSchema:za,ElicitationCompleteNotificationSchema:Ta,ElicitResultSchema:xa,ResourceTemplateReferenceSchema:ka,PromptReferenceSchema:Ea,CompleteRequestParamsSchema:wa,CompleteRequestSchema:Zo,CompleteResultSchema:Ia,RootSchema:Pa,ListRootsRequestSchema:hn,ListRootsResultSchema:Ko,RootsListChangedNotificationSchema:Oa,TaskCreationParamsSchema:Ca,TaskStatusSchema:Na,TaskSchema:Qt,CreateTaskResultSchema:Fe,TaskStatusNotificationParamsSchema:ja,TaskStatusNotificationSchema:Ar,GetTaskRequestSchema:gn,GetTaskResultSchema:vn,GetTaskPayloadRequestSchema:_n,GetTaskPayloadResultSchema:Au,ListTasksRequestSchema:Ve,ListTasksResultSchema:ye,CancelTaskRequestSchema:Mr,CancelTaskResultSchema:p.merge(Qt),ClientRequestSchema:j([rt,ue,Zo,$o,wr,X,Ge,Ke,bt,q,G,yo,dn,gn,_n,Ve,Mr]),ClientNotificationSchema:j([z,nt,Ne,Oa,Ar]),ClientResultSchema:j([b,Oo,Co,xa,Ko,vn,ye,Fe]),ServerRequestSchema:j([rt,Po,Ra,hn,gn,_n,Ve,Mr]),ServerNotificationSchema:j([z,nt,zo,oe,$t,Sa,Or,Ar,Ta]),ServerResultSchema:j([b,tt,Ia,ln,W,We,ot,Gt,pn,mn,vn,ye,Fe]),CallToolResultWireSchema:Z().superRefine((we,cR)=>{if(typeof we!=="object"||we===null||Array.isArray(we)||we.content!==void 0)return;for(let p_ of rb)if(p_ in we){cR.addIssue({code:"custom",message:`content is required when the body carries '${p_}' — another result family cannot default into an empty tools/call success`});return}}).transform(fv).pipe(pn)}}var cx;function nb(){return cx??=sx()}function ob(e){return e.type!=="object"}var lx=new Set(["const","enum","default","examples"]),ux=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Uy(e){return e!==void 0&&!(typeof e==="string"&&e.startsWith("#"))}function dx(e){let t=typeof e.$schema==="string"?e.$schema:void 0;if(Uy(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let n=S_(e.$schema)&&e.$recursiveAnchor!==!0,o=(r,i)=>{if(Array.isArray(r))return r.map((c)=>o(c,!1));if(r===null||typeof r!=="object")return r;if(!i&&Uy(r.$id))return r;let a={},s=!1;for(let[c,u]of Object.entries(r))if(i)a[c]=o(u,!1);else if((c==="$ref"||c==="$dynamicRef")&&typeof u==="string")a[c]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u;else if(c==="$recursiveRef"&&u==="#"&&n)s=!0;else if(lx.has(c))a[c]=u;else if(ux.has(c))a[c]=o(u,!0);else a[c]=o(u,!1);if(s)if("$ref"in a)a.allOf=[...Array.isArray(a.allOf)?a.allOf:[],{$ref:"#/properties/result"}];else a.$ref="#/properties/result";return a};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var ib={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},ab={"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},mx={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},cu;function hv(){if(cu)return cu;let e=nb();return cu={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},cu}function sb(e){return Object.prototype.hasOwnProperty.call(ib,e)}function cb(e){return Object.prototype.hasOwnProperty.call(ab,e)}function px(e){return Object.prototype.hasOwnProperty.call(mx,e)}function fx(e){return px(e)?hv().resultSchemas[e]:void 0}function hx(e){return sb(e)?hv().requestSchemas[e]:void 0}function gx(e){return cb(e)?hv().notificationSchemas[e]:void 0}var iO=Object.keys(ib),aO=Object.keys(ab);function lv(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function lu(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:"invalid",message:String(n.error)}}var qy={ok:!1,reason:"not-in-era"};function Ly(e){return lv(e)&&lv(e.outputSchema)&&ob(e.outputSchema)}function Dy(e){return e}var gv={era:"2025-11-25",hasRequestMethod:sb,hasNotificationMethod:cb,validateRequest:(e,t)=>lu(hx(e),t),validateResult:(e,t)=>lu(fx(e),t),validateNotification:(e,t)=>lu(gx(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>qy,validateInputResponse:()=>qy,samplingResultVariant:(e,t)=>{let n=nb();return lu(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let n=tb(e),o=n.structuredContent;if(o===void 0)return n;let r=typeof o!=="object"||o===null||Array.isArray(o),i=t!==void 0&&ob(t);if(!r&&!i)return n;return{...n,structuredContent:{result:o}}},decodeResult(e,t){if(lv(t)&&"resultType"in t){let n={...t};return delete n.resultType,{kind:"complete",result:Dy(n)}}return{kind:"complete",result:Dy(t)}},encodeResult(e,t){if(e!=="tools/list")return t;let n=t.tools;if(!Array.isArray(n)||!n.some((o)=>Ly(o)))return t;return{...t,tools:n.map((o)=>Ly(o)?{...o,outputSchema:dx(o.outputSchema)}:o)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function vx(){let e=mr(()=>j([l(),x(),N(),pt(),C(l(),e),v(e)])),t=C(l(),e),n=j([l(),x().int()]),o=l(),r=j([l(),x().int()]),i=Q(["user","assistant"]),a=Q(["debug","info","notice","warning","error","critical","alert","emergency"]),s=l().refine((ye)=>{try{return atob(ye),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=f({ttl:x().optional()}),u=f({taskId:l()}),d=H({progressToken:n.optional(),"io.modelcontextprotocol/related-task":u.optional()}),m=f({_meta:d.optional()}),p=m.extend({task:c.optional()}),h=f({_meta:d.optional()}),b=f({method:l(),params:h.loose().optional()}),R=f({src:l(),mimeType:l().optional(),sizes:v(l()).optional(),theme:Q(["light","dark"]).optional()}),z=f({icons:v(R).optional()}),A=f({name:l(),title:l().optional()}),B=A.extend({...A.shape,...z.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),P=ft(f({applyDefaults:N().optional()}),t),O=Zt((ye)=>{if(ye&&typeof ye==="object"&&!Array.isArray(ye)&&Object.keys(ye).length===0)return{form:{}};return ye},ft(f({form:P.optional(),url:t.optional()}),t.optional())),V=H({list:t.optional(),cancel:t.optional(),requests:H({sampling:H({createMessage:t.optional()}).optional(),elicitation:H({create:t.optional()}).optional()}).optional()}),Y=H({list:t.optional(),cancel:t.optional(),requests:H({tools:H({call:t.optional()}).optional()}).optional()}),ee=f({experimental:C(l(),t).optional(),sampling:f({context:t.optional(),tools:t.optional()}).optional(),elicitation:O.optional(),roots:f({listChanged:N().optional()}).optional(),tasks:V.optional(),extensions:C(l(),t).optional()}),ne=f({experimental:C(l(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:f({listChanged:N().optional()}).optional(),resources:f({subscribe:N().optional(),listChanged:N().optional()}).optional(),tools:f({listChanged:N().optional()}).optional(),tasks:Y.optional(),extensions:C(l(),t).optional()}),ae=f({progress:x(),total:F(x()),message:F(l())}),ce=f({...h.shape,...ae.shape,progressToken:n}),ue=b.extend({method:S("notifications/progress"),params:ce}),Te=h.extend({level:a,logger:l().optional(),data:Z()}),tt=b.extend({method:S("notifications/message"),params:Te}),Ne=f({uri:l(),mimeType:F(l()),_meta:C(l(),Z()).optional()}),rt=Ne.extend({text:l()}),vt=Ne.extend({blob:s}),Ze=f({audience:v(i).optional(),priority:x().min(0).max(1).optional(),lastModified:Hr({offset:!0}).optional()}),nt=f({...A.shape,...z.shape,uri:l(),description:F(l()),mimeType:F(l()),size:F(x()),annotations:Ze.optional(),_meta:F(H({}))}),_t=f({...A.shape,...z.shape,uriTemplate:l(),description:F(l()),mimeType:F(l()),annotations:Ze.optional(),_meta:F(H({}))}),Ye=b.extend({method:S("notifications/resources/list_changed"),params:h.optional()}),je=h.extend({uri:l()}),At=b.extend({method:S("notifications/resources/updated"),params:je}),Mt=f({name:l(),description:F(l()),required:F(N())}),St=f({...A.shape,...z.shape,description:F(l()),arguments:F(v(Mt)),_meta:F(H({}))}),ke=b.extend({method:S("notifications/prompts/list_changed"),params:h.optional()}),Ae=f({type:S("text"),text:l(),annotations:Ze.optional(),_meta:C(l(),Z()).optional()}),Me=f({type:S("image"),data:s,mimeType:l(),annotations:Ze.optional(),_meta:C(l(),Z()).optional()}),ut=f({type:S("audio"),data:s,mimeType:l(),annotations:Ze.optional(),_meta:C(l(),Z()).optional()}),kr=f({type:S("tool_use"),name:l(),id:l(),input:C(l(),Z()),_meta:C(l(),Z()).optional()}),Ge=f({type:S("resource"),resource:j([rt,vt]),annotations:Ze.optional(),_meta:C(l(),Z()).optional()}),We=nt.extend({type:S("resource_link")}),Ke=j([Ae,Me,ut,We,Ge]),ot=f({role:i,content:Ke}),it=f({title:l().optional(),readOnlyHint:N().optional(),destructiveHint:N().optional(),idempotentHint:N().optional(),openWorldHint:N().optional()}),yt=b.extend({method:S("notifications/tools/list_changed"),params:h.optional()}),bt=f({name:l().optional()}),Gt=f({hints:v(bt).optional(),costPriority:x().min(0).max(1).optional(),speedPriority:x().min(0).max(1).optional(),intelligencePriority:x().min(0).max(1).optional()}),$t=f({mode:Q(["auto","required","none"]).optional()}),Er=f({type:S("boolean"),title:l().optional(),description:l().optional(),default:N().optional()}),q=f({type:S("string"),title:l().optional(),description:l().optional(),minLength:x().optional(),maxLength:x().optional(),format:Q(["email","uri","date","date-time"]).optional(),default:l().optional()}),Rt=f({type:Q(["number","integer"]),title:l().optional(),description:l().optional(),minimum:x().optional(),maximum:x().optional(),default:x().optional()}),G=f({type:S("string"),title:l().optional(),description:l().optional(),enum:v(l()),default:l().optional()}),K=f({type:S("string"),title:l().optional(),description:l().optional(),oneOf:v(f({const:l(),title:l()})),default:l().optional()}),oe=f({type:S("string"),title:l().optional(),description:l().optional(),enum:v(l()),enumNames:v(l()).optional(),default:l().optional()}),L=j([G,K]),M=f({type:S("array"),title:l().optional(),description:l().optional(),minItems:x().optional(),maxItems:x().optional(),items:f({type:S("string"),enum:v(l())}),default:v(l()).optional()}),X=f({type:S("array"),title:l().optional(),description:l().optional(),minItems:x().optional(),maxItems:x().optional(),items:f({anyOf:v(f({const:l(),title:l()}))}),default:v(l()).optional()}),W=j([M,X]),be=j([oe,L,W]),wr=j([be,Er,q,Rt]),zt=p.extend({mode:S("form").optional(),message:l(),requestedSchema:f({type:S("object"),properties:C(l(),wr),required:v(l()).optional()}).catchall(Z())}),Ir=f({type:S("ref/resource"),uri:l()}),Pr=f({type:S("ref/prompt"),name:l()}),vo=f({uri:l().startsWith("file://"),name:l().optional(),_meta:C(l(),Z()).optional()}),Wt=ee.shape,_o=f({experimental:Wt.experimental,sampling:Wt.sampling,elicitation:Wt.elicitation,roots:Wt.roots,extensions:Wt.extensions}),at=ne.shape,cn=f({experimental:at.experimental,logging:at.logging,completions:at.completions,prompts:at.prompts,resources:at.resources,tools:at.tools,extensions:at.extensions}),ln=H({progressToken:n.optional(),[ct]:l(),[Xr]:B.optional(),[Ot]:_o,[fr]:a.optional()}),Or=f({...A.shape,...z.shape,description:l().optional(),inputSchema:H({$schema:l().optional(),type:S("object")}),outputSchema:H({$schema:l().optional()}).optional(),annotations:it.optional(),_meta:C(l(),Z()).optional()}),So=f({type:S("tool_result"),toolUseId:l(),content:v(Ke),structuredContent:Z().optional(),isError:N().optional(),_meta:C(l(),Z()).optional()}),un=j([Ae,Me,ut,kr,So]),Cr=f({role:i,content:j([un,v(un)]),_meta:C(l(),Z()).optional()}),dn=l(),mn=H({[Pt]:B.optional().catch(void 0)}),pn=mn.optional();function Ee(ye){return H({_meta:pn,resultType:dn.default("complete"),...ye})}let yo=Ee({}),Sa=Ee({nextCursor:o.optional()}),fn=Ee({content:v(Ke),structuredContent:Z().optional(),isError:N().optional()}),bo=Ee({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),tools:v(Or),nextCursor:o.optional()}),$o=Ee({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),prompts:v(St),nextCursor:o.optional()}),Ro=Ee({description:l().optional(),messages:v(ot)}),zo=Ee({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),resources:v(nt),nextCursor:o.optional()}),To=Ee({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),resourceTemplates:v(_t),nextCursor:o.optional()}),xo=Ee({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),contents:v(j([rt,vt]))}),ko=Ee({completion:f({values:v(l()).max(100),total:x().int().optional(),hasMore:N().optional()}).loose()}),ya=Ee({ttlMs:x().int().min(0),cacheScope:Q(["public","private"])}),Eo=Ee({ttlMs:x().int().min(0).catch(0),cacheScope:Q(["public","private"]).catch("private"),supportedVersions:v(l()),capabilities:cn,instructions:l().optional()}),Xt=f({messages:v(Cr),modelPreferences:Gt.optional(),systemPrompt:l().optional(),includeContext:Q(["none","thisServer","allServers"]).optional(),temperature:x().optional(),maxTokens:x().int(),stopSequences:v(l()).optional(),metadata:t.optional(),tools:v(Or).optional(),toolChoice:$t.optional()}),wo=f({method:S("sampling/createMessage"),params:Xt}),Io=f({method:S("roots/list"),params:f({_meta:C(l(),Z()).optional()}).optional()}),Po=f({...Cr.shape,model:l(),stopReason:l().optional()}),Oo=f({roots:v(vo)}),Co=f({action:Q(["accept","decline","cancel"]),content:C(l(),j([l(),x(),N(),v(l())])).optional()}),No=f({mode:S("url"),message:l(),url:l().url()}),jo=j([zt,No]),Ao=f({method:S("elicitation/create"),params:jo}),Mo=j([wo,Io,Ao]),Uo=j([Po,Oo,Co]),qo=C(l(),Mo),Lo=C(l(),Uo),Nr=Ee({inputRequests:qo.optional(),requestState:l().optional()}),jr={inputResponses:Lo.optional(),requestState:l().optional()},ba=f({_meta:ln,...jr}),$a=H({progressToken:n.optional()});function Xe(ye,Mr){return f({method:S(ye),params:f({_meta:ln,...Mr})})}function Qe(ye,Mr){return f({method:S(ye),params:f({_meta:$a.optional(),...Mr}).optional()})}let Do={name:l(),arguments:C(l(),Z()).optional(),...jr},dt={cursor:o.optional()},Ra=Xe("tools/call",Do),za=Xe("tools/list",dt),Ta=Xe("prompts/list",dt),xa=Xe("prompts/get",{name:l(),arguments:C(l(),l()).optional(),...jr}),ka=Xe("resources/list",dt),Ea=Xe("resources/templates/list",dt),wa=Xe("resources/read",{uri:l(),...jr}),Zo={ref:j([Pr,Ir]),argument:f({name:l(),value:l()}),context:f({arguments:C(l(),l()).optional()}).optional()},Ia=Xe("completion/complete",Zo),Pa=Xe("server/discover",{}),hn=f({toolsListChanged:N().optional(),promptsListChanged:N().optional(),resourcesListChanged:N().optional(),resourceSubscriptions:v(l()).optional()}),Ko={notifications:hn},Oa=Xe("subscriptions/listen",Ko),Ca=mn.extend({"io.modelcontextprotocol/subscriptionId":r}),Na=H({_meta:Ca,resultType:dn.default("complete")}),Qt={"tools/call":Qe("tools/call",Do),"tools/list":Qe("tools/list",dt),"prompts/get":Qe("prompts/get",{name:l(),arguments:C(l(),l()).optional()}),"prompts/list":Qe("prompts/list",dt),"resources/list":Qe("resources/list",dt),"resources/templates/list":Qe("resources/templates/list",dt),"resources/read":Qe("resources/read",{uri:l()}),"completion/complete":Qe("completion/complete",Zo),"server/discover":Qe("server/discover",{}),"subscriptions/listen":Qe("subscriptions/listen",Ko)};function Fe(ye){return H({_meta:pn,...ye})}let ja={"tools/call":Fe({content:v(Ke),structuredContent:Z().optional(),isError:N().optional()}),"tools/list":Fe({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),tools:v(Or),nextCursor:o.optional()}),"prompts/get":Fe({description:l().optional(),messages:v(ot)}),"prompts/list":Fe({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),prompts:v(St),nextCursor:o.optional()}),"resources/list":Fe({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),resources:v(nt),nextCursor:o.optional()}),"resources/templates/list":Fe({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),resourceTemplates:v(_t),nextCursor:o.optional()}),"resources/read":Fe({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),contents:v(j([rt,vt]))}),"completion/complete":Fe({completion:f({values:v(l()).max(100),total:x().int().optional(),hasMore:N().optional()}).loose()}),"server/discover":Fe({ttlMs:x().int().min(0).catch(0),cacheScope:Q(["public","private"]).catch("private"),supportedVersions:v(l()),capabilities:cn,instructions:l().optional()}),"subscriptions/listen":Fe({})},Ar=H({"io.modelcontextprotocol/subscriptionId":r.optional()}),gn=f({method:S("notifications/subscriptions/acknowledged"),params:f({_meta:Ar.optional(),notifications:hn})}),vn=f({_meta:Ar.optional(),requestId:r,reason:l().optional()}),_n=f({method:S("notifications/cancelled"),params:vn}),Au={"notifications/cancelled":_n,"notifications/progress":ue,"notifications/message":tt,"notifications/resources/updated":At,"notifications/resources/list_changed":Ye,"notifications/tools/list_changed":yt,"notifications/prompts/list_changed":ke,"notifications/subscriptions/acknowledged":gn},Ve=(ye)=>f({jsonrpc:S("2.0"),id:j([l(),x().int()]),result:ye}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:o,RequestIdSchema:r,RoleSchema:i,LoggingLevelSchema:a,TaskMetadataSchema:c,RelatedTaskMetadataSchema:u,RequestMetaSchema:d,BaseRequestParamsSchema:m,TaskAugmentedRequestParamsSchema:p,NotificationsParamsSchema:h,NotificationSchema:b,IconSchema:R,IconsSchema:z,BaseMetadataSchema:A,ImplementationSchema:B,ClientTasksCapabilitySchema:V,ServerTasksCapabilitySchema:Y,ClientCapabilitiesSchema:ee,ServerCapabilitiesSchema:ne,ProgressSchema:ae,ProgressNotificationParamsSchema:ce,ProgressNotificationSchema:ue,LoggingMessageNotificationParamsSchema:Te,LoggingMessageNotificationSchema:tt,ResourceContentsSchema:Ne,TextResourceContentsSchema:rt,BlobResourceContentsSchema:vt,AnnotationsSchema:Ze,ResourceSchema:nt,ResourceTemplateSchema:_t,ResourceListChangedNotificationSchema:Ye,ResourceUpdatedNotificationParamsSchema:je,ResourceUpdatedNotificationSchema:At,PromptArgumentSchema:Mt,PromptSchema:St,PromptListChangedNotificationSchema:ke,TextContentSchema:Ae,ImageContentSchema:Me,AudioContentSchema:ut,ToolUseContentSchema:kr,EmbeddedResourceSchema:Ge,ResourceLinkSchema:We,ContentBlockSchema:Ke,PromptMessageSchema:ot,ToolAnnotationsSchema:it,ToolListChangedNotificationSchema:yt,ModelHintSchema:bt,ModelPreferencesSchema:Gt,ToolChoiceSchema:$t,BooleanSchemaSchema:Er,StringSchemaSchema:q,NumberSchemaSchema:Rt,UntitledSingleSelectEnumSchemaSchema:G,TitledSingleSelectEnumSchemaSchema:K,LegacyTitledEnumSchemaSchema:oe,SingleSelectEnumSchemaSchema:L,UntitledMultiSelectEnumSchemaSchema:M,TitledMultiSelectEnumSchemaSchema:X,MultiSelectEnumSchemaSchema:W,EnumSchemaSchema:be,PrimitiveSchemaDefinitionSchema:wr,ElicitRequestFormParamsSchema:zt,ResourceTemplateReferenceSchema:Ir,PromptReferenceSchema:Pr,RootSchema:vo,ClientCapabilities2026Schema:_o,ServerCapabilities2026Schema:cn,RequestMetaEnvelopeSchema:ln,ToolSchema:Or,ToolResultContentSchema:So,SamplingMessageContentBlockSchema:un,SamplingMessageSchema:Cr,ResultTypeSchema:dn,ResultMetaSchema:mn,ResultSchema:yo,PaginatedResultSchema:Sa,CallToolResultSchema:fn,ListToolsResultSchema:bo,ListPromptsResultSchema:$o,GetPromptResultSchema:Ro,ListResourcesResultSchema:zo,ListResourceTemplatesResultSchema:To,ReadResourceResultSchema:xo,CompleteResultSchema:ko,CacheableResultSchema:ya,DiscoverResultSchema:Eo,CreateMessageRequestParamsSchema:Xt,CreateMessageRequestSchema:wo,ListRootsRequestSchema:Io,CreateMessageResultSchema:Po,ListRootsResultSchema:Oo,ElicitResultSchema:Co,ElicitRequestURLParamsSchema:No,ElicitRequestParamsSchema:jo,ElicitRequestSchema:Ao,InputRequestSchema:Mo,InputResponseSchema:Uo,InputRequestsSchema:qo,InputResponsesSchema:Lo,InputRequiredResultSchema:Nr,InputResponseRequestParamsSchema:ba,CallToolRequestSchema:Ra,ListToolsRequestSchema:za,ListPromptsRequestSchema:Ta,GetPromptRequestSchema:xa,ListResourcesRequestSchema:ka,ListResourceTemplatesRequestSchema:Ea,ReadResourceRequestSchema:wa,CompleteRequestSchema:Ia,DiscoverRequestSchema:Pa,SubscriptionFilterSchema:hn,SubscriptionsListenRequestSchema:Oa,SubscriptionsListenResultMetaSchema:Ca,SubscriptionsListenResultSchema:Na,dispatchRequestSchemas:Qt,dispatchResultSchemas:ja,NotificationMetaSchema:Ar,SubscriptionsAcknowledgedNotificationSchema:gn,CancelledNotificationParamsSchema:vn,CancelledNotificationSchema:_n,notificationSchemas2026:Au,JSONRPCResultResponseSchema:Ve(yo),CallToolResultResponseSchema:Ve(j([fn,Nr])),ListToolsResultResponseSchema:Ve(bo),ListPromptsResultResponseSchema:Ve($o),GetPromptResultResponseSchema:Ve(j([Ro,Nr])),ListResourcesResultResponseSchema:Ve(zo),ListResourceTemplatesResultResponseSchema:Ve(To),ReadResourceResultResponseSchema:Ve(j([xo,Nr])),CompleteResultResponseSchema:Ve(ko),DiscoverResultResponseSchema:Ve(Eo)}}var _x;function nn(){return _x??=vx()}var Sx=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function yx(e){return Sx.includes(e)}var co=Symbol("modelcontextprotocol.resultCacheHintFallback");function hu(e,t){if(t===void 0)return e;let n=e[co];if(n===void 0)return{...e,[co]:t};let o={},r=n.ttlMs??t.ttlMs;if(r!==void 0)o.ttlMs=r;let i=n.cacheScope??t.cacheScope;if(i!==void 0)o.cacheScope=i;return{...e,[co]:o}}function bx(e){return e[co]}function vv(e){return typeof e==="number"&&Number.isSafeInteger(e)&&e>=0}function _v(e){return e==="public"||e==="private"}function Sv(e,t){if(e.ttlMs!==void 0&&!vv(e.ttlMs))throw RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!_v(e.cacheScope))throw RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var I=function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e}({}),D=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return uo(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return uo(this,t)}constructor(t,n,o){super(n);this.code=t,this.data=o,this.name="ProtocolError",mv(this,new.target)}static fromError(t,n,o){if(t===I.UrlElicitationRequired&&o){let r=o;if(r.elicitations)return new lb(r.elicitations,n)}if(t===I.UnsupportedProtocolVersion&&o){let r=o;if(Array.isArray(r.supported)&&typeof r.requested==="string")return new vu({supported:r.supported,requested:r.requested},n)}if(t===I.InvalidParams||t===I.ResourceNotFound){let r=o;if(typeof r?.uri==="string"&&(t===I.ResourceNotFound||Object.keys(r).length===1))return new gu(r.uri,n)}if(t===I.MissingRequiredClientCapability&&o){let r=o;if(r.requiredCapabilities!==null&&typeof r.requiredCapabilities==="object"&&!Array.isArray(r.requiredCapabilities))return new aa({requiredCapabilities:r.requiredCapabilities},n)}return new e(t,n,o)}},gu=class extends D{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(I.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},lb=class extends D{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(I.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},vu=class extends D{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(I.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},aa=class extends D{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(I.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},$x=0,Rx="private",zx=["tools/call","prompts/get","resources/read"];function Tx(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:"complete"};if(n==="complete")return t;if(zx.includes(e))return t;throw new D(I.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function xx(e,t){let n=bx(t);if(t.resultType!=="complete"||!yx(e))return n===void 0?t:Px(t);let o=t,r=vv(o.ttlMs)?o.ttlMs:wx(n),i=_v(o.cacheScope)?o.cacheScope:Ix(n),a={...o,ttlMs:r,cacheScope:i};return delete a[co],a}function kx(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Ex(e,t){if(t===void 0)return e;let n=e._meta;if(n===void 0)return{...e,_meta:{[Pt]:t}};if(!kx(n))return e;if(n[Pt]!==void 0)return e;return{...e,_meta:{...n,[Pt]:t}}}function wx(e){return e!==void 0&&vv(e.ttlMs)?e.ttlMs:$x}function Ix(e){return e!==void 0&&_v(e.cacheScope)?e.cacheScope:Rx}function Px(e){let t={...e};return delete t[co],t}var Ox=["elicitation/create","sampling/createMessage","roots/list"],uu;function ub(){if(uu)return uu;let e=nn();return uu={request:{"elicitation/create":f({method:S("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":f({method:S("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":f({method:S("roots/list"),params:H({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},uu}function db(e){return Ox.includes(e)}function ov(e){return db(e)?ub().request[e]:void 0}function Cx(e){return db(e)?ub().response[e]:void 0}var yv={"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},mb={"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 pb(e){return Object.prototype.hasOwnProperty.call(yv,e)}function fb(e){return Object.prototype.hasOwnProperty.call(mb,e)}function Nx(e){return Object.prototype.hasOwnProperty.call(yv,e)}function jx(e){return pb(e)?nn().dispatchRequestSchemas[e]:void 0}function Ax(e){return Nx(e)?nn().dispatchResultSchemas[e]:void 0}function Mx(e){return fb(e)?nn().notificationSchemas2026[e]:void 0}var sO=Object.keys(yv),cO=Object.keys(mb);function ta(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Qi(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:"invalid",message:String(n.error)}}var Ux={ok:!1,reason:"not-in-era"},qx=[ct,Ot];function Lx(e,t){let n=t,o=!1,r=()=>{if(!o)n={...n},o=!0;return n},i=t.tools;if(e==="tools/list"&&Array.isArray(i)&&i.some((s)=>ta(s)&&("execution"in s)))r().tools=i.map((s)=>{if(!ta(s)||!("execution"in s))return s;let c={...s};return delete c.execution,c});let a=t.capabilities;if(ta(a)&&"tasks"in a){let s={...a};delete s.tasks,r().capabilities=s}return n}var bv={era:"2026-07-28",hasRequestMethod:pb,hasNotificationMethod:fb,hasInputRequestMethod:(e)=>ov(e)!==void 0,validateRequest:(e,t)=>Qi(jx(e),t),validateResult:(e,t)=>Qi(Ax(e),t),validateNotification:(e,t)=>Qi(Mx(e),t),validateInputRequest:(e,t)=>Qi(ov(e),t),validateInputResponse:(e,t)=>Qi(Cx(e),t),samplingResultVariant:()=>Ux,outboundEnvelope(e){return{[ct]:e.protocolVersion,[Xr]:e.clientInfo,[Ot]:e.clientCapabilities,...e.logLevel!==void 0&&{[fr]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of qx)if(!(o in e))t.push({key:o,problem:"missing"});let n=nn().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let o of n.error.issues){let r=o.path.map(String),i=r.length>0?r.join("."):"_meta";if(r.length===1&&t.some((a)=>a.key===i&&a.problem==="missing"))continue;t.push({key:i,problem:o.message})}return t},projectCallToolResult:(e)=>tb(e),inputRequestSchema:ov,decodeResult(e,t){if(!ta(t))return{kind:"invalid",error:new te(ie.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:"invalid",error:new te(ie.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof n!=="string")return{kind:"invalid",error:new te(ie.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n==="input_required"){let a=t.inputRequests,s=ta(a)?a:{},c=t.requestState;if(Object.keys(s).length===0&&typeof c!=="string")return{kind:"invalid",error:new te(ie.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})};return{kind:"input_required",inputRequests:s,...typeof c==="string"&&{requestState:c}}}if(n!=="complete")return{kind:"invalid",error:new te(ie.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let o=Dx(),r=Object.hasOwn(o,e)?o[e]:void 0;if(r!==void 0){let a=r.safeParse(t);if(!a.success)return{kind:"invalid",error:new te(ie.InvalidResult,`Invalid result for ${e}: ${a.error}`,{method:e})}}let i={...t};return delete i.resultType,{kind:"complete",result:i}},encodeResult(e,t,n){return Ex(xx(e,Tx(e,Lx(e,t))),n)},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=nn().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map((n)=>n.message).join("; ")}`}},du;function Dx(){if(du)return du;let e=nn();return du={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},du}var sa="2026-07-28";function $r(e){return e!==void 0&&Jt(e)?bv:gv}function Zy(e){if(e.revision!==void 0)return $r(e.revision).era;return e.era==="modern"?bv.era:gv.era}function iv(e){return hb.some((t)=>t.hasRequestMethod(e))}function av(e){return hb.some((t)=>t.hasNotificationMethod(e))}var hb=[gv,bv];function Ky(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Rr(e){if(!Ky(e))return;let t=e._meta;return Ky(t)?t:void 0}function _u(e){let t=Rr(e);return t!==void 0&&ct in t}function $v(e){let t=Rr(e)?.[ct];return typeof t==="string"?t:void 0}function pu(e){return $r(sa).validateEnvelopeMeta(e)}var Zx=g_({AnnotationsSchema:()=>Ft,AudioContentSchema:()=>ro,BaseMetadataSchema:()=>Kt,BaseRequestParamsSchema:()=>ze,BlobResourceContentsSchema:()=>Di,BooleanSchemaSchema:()=>Ji,CallToolRequestParamsSchema:()=>bl,CallToolRequestSchema:()=>$l,CallToolResultSchema:()=>Vi,CancelTaskRequestSchema:()=>Zg,CancelTaskResultSchema:()=>Kg,CancelledNotificationParamsSchema:()=>Tc,CancelledNotificationSchema:()=>Ni,ClientCapabilitiesSchema:()=>wc,ClientNotificationSchema:()=>Vg,ClientRequestSchema:()=>Fg,ClientResultSchema:()=>Jg,ClientTasksCapabilitySchema:()=>kc,CompatibilityCallToolResultSchema:()=>Pg,CompleteRequestParamsSchema:()=>Yl,CompleteRequestSchema:()=>Gl,CompleteResultSchema:()=>Wl,ContentBlockSchema:()=>no,CreateMessageRequestParamsSchema:()=>Nl,CreateMessageRequestSchema:()=>jl,CreateMessageResultSchema:()=>Al,CreateMessageResultWithToolsSchema:()=>Ml,CreateTaskResultSchema:()=>Ng,CursorSchema:()=>Ei,DiscoverRequestSchema:()=>Cc,DiscoverResultSchema:()=>Nc,ElicitRequestFormParamsSchema:()=>ao,ElicitRequestParamsSchema:()=>Zl,ElicitRequestSchema:()=>Kl,ElicitRequestURLParamsSchema:()=>Dl,ElicitResultSchema:()=>Jl,ElicitationCompleteNotificationParamsSchema:()=>Fl,ElicitationCompleteNotificationSchema:()=>Vl,EmbeddedResourceSchema:()=>ml,EmptyResultSchema:()=>Ci,EnumSchemaSchema:()=>Ll,GetPromptRequestParamsSchema:()=>ll,GetPromptRequestSchema:()=>ul,GetPromptResultSchema:()=>hl,GetTaskPayloadRequestSchema:()=>Ug,GetTaskPayloadResultSchema:()=>qg,GetTaskRequestSchema:()=>Ag,GetTaskResultSchema:()=>Mg,IconSchema:()=>xc,IconsSchema:()=>gr,ImageContentSchema:()=>to,ImplementationSchema:()=>Xn,InitializeRequestParamsSchema:()=>Ic,InitializeRequestSchema:()=>ji,InitializeResultSchema:()=>Pc,InitializedNotificationSchema:()=>Oc,JSONArraySchema:()=>Eg,JSONObjectSchema:()=>ve,JSONRPCErrorResponseSchema:()=>Gn,JSONRPCMessageSchema:()=>Wn,JSONRPCNotificationSchema:()=>Oi,JSONRPCRequestSchema:()=>Pi,JSONRPCResponseSchema:()=>wg,JSONRPCResultResponseSchema:()=>Yn,JSONValueSchema:()=>pr,LegacyTitledEnumSchemaSchema:()=>Yi,ListChangedOptionsBaseSchema:()=>Og,ListPromptsRequestSchema:()=>sl,ListPromptsResultSchema:()=>cl,ListResourceTemplatesRequestSchema:()=>Dc,ListResourceTemplatesResultSchema:()=>Zc,ListResourcesRequestSchema:()=>qc,ListResourcesResultSchema:()=>Lc,ListRootsRequestSchema:()=>Ql,ListRootsResultSchema:()=>eu,ListTasksRequestSchema:()=>Lg,ListTasksResultSchema:()=>Dg,ListToolsRequestSchema:()=>Sl,ListToolsResultSchema:()=>yl,LoggingLevelSchema:()=>yr,LoggingMessageNotificationParamsSchema:()=>xl,LoggingMessageNotificationSchema:()=>kl,ModelHintSchema:()=>El,ModelPreferencesSchema:()=>wl,MultiSelectEnumSchemaSchema:()=>ql,NotificationSchema:()=>Oe,NotificationsParamsSchema:()=>Pe,NumberSchemaSchema:()=>io,PaginatedRequestParamsSchema:()=>Mc,PaginatedRequestSchema:()=>vr,PaginatedResultSchema:()=>_r,PingRequestSchema:()=>Mi,PrimitiveSchemaDefinitionSchema:()=>Xi,ProgressNotificationParamsSchema:()=>Ac,ProgressNotificationSchema:()=>Ui,ProgressSchema:()=>jc,ProgressTokenSchema:()=>ki,PromptArgumentSchema:()=>il,PromptListChangedNotificationSchema:()=>gl,PromptMessageSchema:()=>fl,PromptReferenceSchema:()=>Hl,PromptSchema:()=>al,ReadResourceRequestParamsSchema:()=>Kc,ReadResourceRequestSchema:()=>Fc,ReadResourceResultSchema:()=>Vc,RelatedTaskMetadataSchema:()=>zc,RequestIdSchema:()=>hr,RequestMetaSchema:()=>wi,RequestSchema:()=>_e,ResourceContentsSchema:()=>qi,ResourceLinkSchema:()=>pl,ResourceListChangedNotificationSchema:()=>Jc,ResourceRequestParamsSchema:()=>Qn,ResourceSchema:()=>Zi,ResourceTemplateReferenceSchema:()=>Bl,ResourceTemplateSchema:()=>Uc,ResourceUpdatedNotificationParamsSchema:()=>nl,ResourceUpdatedNotificationSchema:()=>ol,ResultMetaObjectSchema:()=>Ii,ResultSchema:()=>Se,RoleSchema:()=>Sr,RootSchema:()=>Xl,RootsListChangedNotificationSchema:()=>tu,SamplingContentSchema:()=>Ol,SamplingMessageContentBlockSchema:()=>Gr,SamplingMessageSchema:()=>Cl,ServerCapabilitiesSchema:()=>Ai,ServerNotificationSchema:()=>Hg,ServerRequestSchema:()=>Bg,ServerResultSchema:()=>Yg,ServerTasksCapabilitySchema:()=>Ec,SetLevelRequestParamsSchema:()=>zl,SetLevelRequestSchema:()=>Tl,SingleSelectEnumSchemaSchema:()=>Ul,StringSchemaSchema:()=>oo,SubscribeRequestParamsSchema:()=>Bc,SubscribeRequestSchema:()=>Hc,SubscriptionFilterSchema:()=>Ki,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Qc,SubscriptionsAcknowledgedNotificationSchema:()=>el,SubscriptionsListenRequestParamsSchema:()=>Wc,SubscriptionsListenRequestSchema:()=>Xc,SubscriptionsListenResultMetaSchema:()=>tl,SubscriptionsListenResultSchema:()=>rl,TaskAugmentedRequestParamsSchema:()=>tn,TaskCreationParamsSchema:()=>Cg,TaskMetadataSchema:()=>Rc,TaskSchema:()=>br,TaskStatusNotificationParamsSchema:()=>nu,TaskStatusNotificationSchema:()=>jg,TaskStatusSchema:()=>ru,TextContentSchema:()=>eo,TextResourceContentsSchema:()=>Li,TitledMultiSelectEnumSchemaSchema:()=>Wi,TitledSingleSelectEnumSchemaSchema:()=>Hi,ToolAnnotationsSchema:()=>vl,ToolChoiceSchema:()=>Il,ToolExecutionSchema:()=>_l,ToolListChangedNotificationSchema:()=>Rl,ToolResultContentSchema:()=>Pl,ToolSchema:()=>Fi,ToolUseContentSchema:()=>dl,UnsubscribeRequestParamsSchema:()=>Yc,UnsubscribeRequestSchema:()=>Gc,UntitledMultiSelectEnumSchemaSchema:()=>Gi,UntitledSingleSelectEnumSchemaSchema:()=>Bi});var Bt=(e)=>Pi.safeParse(e).success,Su=(e)=>Oi.safeParse(e).success,Vt=(e)=>Yn.safeParse(e).success,Ht=(e)=>Gn.safeParse(e).success;var Yt=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";var Rv=(e)=>ji.safeParse(e).success;function zv(e){if(e.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Tv(e){if(e.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var Kx="Mcp-Param-",Fy="x-mcp-header",Fx=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Vx=new Set(["string","integer","boolean","number"]);function yu(e){let t=[],n=new Map,o=(i,a,s)=>{if(i===null||typeof i!=="object")return;let c=i;if(Fy in c){if(!s||a.length===0)return`${so(a)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let d=c[Fy];if(typeof d!=="string"||d.length===0)return`${so(a)}: x-mcp-header MUST be a non-empty string`;if(!Fx.test(d))return`${so(a)}: x-mcp-header '${d}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let m=typeof c.type==="string"?c.type:void 0;if(m===void 0||!Vx.has(m))return`${so(a)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${m??"<none>"}`;let p=d.toLowerCase(),h=n.get(p);if(h!==void 0)return`x-mcp-header '${d}' is not case-insensitively unique (also declared as '${h}')`;n.set(p,d),t.push({path:a,headerName:d,type:m})}let u=c.properties;if(u!==null&&typeof u==="object")for(let[d,m]of Object.entries(u)){let p=o(m,[...a,d],s);if(p!==void 0)return p}for(let d of Jx){let m=c[d];if(m===void 0)continue;let p=Array.isArray(m)?m:m!==null&&typeof m==="object"&&Bx.has(d)?Object.values(m):[m];for(let h of p){let b=o(h,[...a,`<${d}>`],!1);if(b!==void 0)return b}}},r=o(e,[],!0);return r===void 0?{valid:!0,declarations:t}:{valid:!1,reason:r}}var Jx=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],Bx=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function so(e){return e.length===0?"<root>":e.join(".")}var Hx="=?base64?",Yx="?=",Gx=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Wx=/^-?\d+(\.\d+)?$/;function Xx(e){if(typeof e==="string")return e;if(typeof e==="boolean")return e?"true":"false";if(typeof e==="number"){if(!Number.isFinite(e))return;if(Number.isInteger(e)&&!Number.isSafeInteger(e))return;return String(e)}}function Qx(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.codePointAt(o);return new TextDecoder("utf-8",{fatal:!0}).decode(n)}function gb(e){if(!(e.startsWith(Hx)&&e.endsWith(Yx)))return e;let t=e.slice(9,e.length-2);if(!Gx.test(t))return;try{return Qx(t)}catch{return}}function ek(e,t){let n=e;for(let o of t){if(n===null||typeof n!=="object")return;n=n[o]}return n}function vb(e,t,n){for(let o of e){let r=`${Kx}${o.headerName}`,i=n.get(r),a=ek(t,o.path);if(a===void 0||a===null)continue;let s=Xx(a);if(s===void 0)continue;if(i===null)return sv("param-header-missing",r,`the body carries ${so(o.path)}=${JSON.stringify(a)} but the ${r} header is absent`);let c=gb(i);if(c===void 0)return sv("param-header-invalid-encoding",r,`the ${r} header carries an invalid Base64 sentinel value`);if(!((o.type==="integer"||o.type==="number")&&Wx.test(c)&&typeof a==="number"?Number(c)===a:c===s))return sv("param-header-mismatch",r,`the ${r} header decodes to ${JSON.stringify(c)} but the body carries ${so(o.path)}=${JSON.stringify(a)}`)}}function sv(e,t,n){return{kind:"reject",rung:"param-header-validation",cell:e,httpStatus:400,code:lo,message:`Bad Request: the request headers and body disagree: ${n}`,data:{mismatch:{header:t,body:n}},settled:!0}}var lo=-32020,lO=[{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:[lo,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:[lo],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[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:[lo],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."}],xv={[I.ParseError]:400,[I.InvalidRequest]:400,[I.MethodNotFound]:404,[I.UnsupportedProtocolVersion]:400,[I.MissingRequiredClientCapability]:400,[lo]:400};function _b(e,t){if(t==="in-band")return e===I.MissingRequiredClientCapability?400:200;return xv[e]??400}function lt(e,t,n,o,r){return{kind:"reject",rung:e,cell:t,httpStatus:n,code:o.code,message:o.message,...o.data!==void 0&&{data:o.data},settled:r}}function Ct(e,t,n,o="era-classification"){return lt(o,e,400,new D(lo,`Bad Request: the request headers and body disagree: ${n}`,{mismatch:{header:t,body:n}}),!0)}var Vy={"tools/call":"name","prompts/get":"name","resources/read":"uri"};function mu(e){let t=0;while(t<e.length){let o=e.codePointAt(t);if(o!==9&&o!==32)break;t+=1}let n=e.length;while(n>t){let o=e.codePointAt(n-1);if(o!==9&&o!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}function Sb(e,t){if(t.messageKind!=="request")return;let n=t.message.method;if(e.mcpMethodHeader===void 0)return Ct("method-header-missing","(missing)",`the body names method ${n} but the required Mcp-Method header is absent`,"standard-header-validation");let o=Object.hasOwn(Vy,n)?Vy[n]:void 0;if(o===void 0)return;let r=t.message.params?.[o],i=typeof r==="string"?r:void 0;if(e.mcpNameHeader===void 0){if(i===void 0)return;return Ct("name-header-missing","(missing)",`the body carries params.${o}="${i}" but the required Mcp-Name header is absent`,"standard-header-validation")}let a=mu(e.mcpNameHeader),s=gb(a);if(s===void 0)return Ct("name-header-invalid-encoding",a,"the Mcp-Name header carries an invalid Base64 sentinel value","standard-header-validation");if(i!==void 0&&s!==i)return Ct("name-header-mismatch",a,`the body carries params.${o}="${i}" but the Mcp-Name header names "${s}"`,"standard-header-validation")}function fu(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function yb(e){if(e===void 0)return{era:"modern"};return{era:Jt(e)?"modern":"legacy",revision:e}}function tk(e){if(!_u(e))return!1;let t=$v(e);if(t===void 0||!Jt(t))return!1;let n=Rr(e);return n!==void 0&&pu(n).length===0}function rk(e){if(e.length===0)return lt("jsonrpc-shape","empty-batch",400,new D(I.InvalidRequest,"Bad Request: empty JSON-RPC batch"),!0);for(let t of e){if(_u(fu(t)?t.params:void 0))return lt("jsonrpc-shape","batch-with-modern-element",400,new D(I.InvalidRequest,"Bad Request: JSON-RPC batches may not contain requests for protocol revision 2026-07-28 or later"),!0);if(!(Bt(t)||Su(t)||Vt(t)||Ht(t)))return lt("jsonrpc-shape","batch-with-invalid-element",400,new D(I.InvalidRequest,"Bad Request: JSON-RPC batch contains an invalid message"),!0)}return{kind:"legacy",reason:"batch"}}function nk(e,t){let{params:n,method:o}=t,r=e.protocolVersionHeader,i=r!==void 0&&Jt(r);if(o==="initialize"&&!tk(n)){if(i)return Ct("initialize-with-modern-header",r,"an initialize request (legacy handshake) was sent with a modern MCP-Protocol-Version header");let a=fu(n)&&typeof n.protocolVersion==="string"?n.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...a!==void 0&&{requestedVersion:a}}}if(_u(n)){let a=Rr(n),s=(a===void 0?[]:pu(a))[0];if(s!==void 0)return lt("envelope","envelope-invalid",400,new D(I.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${s.key}: ${s.problem}`,{envelope:s}),!0);let c=$v(n);if(r!==void 0&&c!==void 0&&r!==c)return Ct("header-body-version-mismatch",r,`the body envelope names protocol version ${c} but the MCP-Protocol-Version header names ${r}`);if(e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Ct("method-header-mismatch",e.mcpMethodHeader,`the body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"request",message:t,classification:yb(c)}}if(i){let a=Rr(n),s=pu(a??{}).filter((u)=>u.problem==="missing").map((u)=>u.key),c=a===void 0?["_meta"]:s.length>0?s:[ct];return lt("envelope","modern-header-without-claim",400,new D(I.InvalidParams,`Invalid params: the MCP-Protocol-Version header names protocol revision ${r}, but the request is missing the required per-request envelope key(s): ${c.join(", ")}`,{envelope:{missing:c}}),!0)}return{kind:"legacy",reason:"no-claim",...r!==void 0&&{requestedVersion:r}}}function ok(e,t){let{params:n,method:o}=t,r=e.protocolVersionHeader,i=r!==void 0&&Jt(r);if(_u(n)){let a=$v(n);if(a===void 0){let c=Rr(n),u=(c===void 0?[]:pu(c)).find((d)=>d.key===ct)??{key:ct,problem:"expected a protocol version string"};return lt("envelope","notification-envelope-invalid",400,new D(I.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${u.key}: ${u.problem}`,{envelope:u}),!0)}if(r!==void 0&&r!==a)return Ct("notification-header-body-version-mismatch",r,`the notification envelope names protocol version ${a} but the MCP-Protocol-Version header names ${r}`);let s=yb(a);if(s.era==="modern"&&e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Ct("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"notification",message:t,classification:s}}if(i){if(e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Ct("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"notification",message:t,classification:{era:"modern",revision:r}}}return{kind:"legacy",reason:"notification",...r!==void 0&&{requestedVersion:r}}}function bb(e){if(e={...e,...e.protocolVersionHeader!==void 0&&{protocolVersionHeader:mu(e.protocolVersionHeader)},...e.mcpMethodHeader!==void 0&&{mcpMethodHeader:mu(e.mcpMethodHeader)},...e.mcpNameHeader!==void 0&&{mcpNameHeader:mu(e.mcpNameHeader)}},e.httpMethod.toUpperCase()!=="POST")return{kind:"legacy",reason:"http-method"};let t=e.body;if(Array.isArray(t))return rk(t);if(Vt(t)||Ht(t))return{kind:"legacy",reason:"response"};if(fu(t)&&Bt(t))return nk(e,t);if(fu(t)&&Su(t))return ok(e,t);return lt("jsonrpc-shape","invalid-json-rpc-body",400,new D(I.InvalidRequest,"Bad Request: the request body is not a valid JSON-RPC message"),!0)}function $b(e,t){switch(e.reason){case"http-method":return lt("http-method","modern-only-method-not-allowed",405,new D(-32000,"Method not allowed."),!0);case"batch":return lt("jsonrpc-shape","modern-only-batch-not-supported",400,new D(I.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return lt("jsonrpc-shape","modern-only-response-post",400,new D(I.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let n=e.requestedVersion;return lt("era-classification","modern-only-missing-envelope",400,n===void 0?new D(I.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...t]}):new vu({supported:[...t],requested:n}),!0)}}}function bu(e,t){return fi(e,t)}function ea(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function mo(e){if(e==null)return!1;let t=typeof e;if(t!=="object"&&t!=="function")return!1;if(!("~standard"in e))return!1;return typeof e["~standard"]?.validate==="function"}var Jy=!1,uv="draft-2020-12";function zr(e,t="input"){let n=e["~standard"],o;if(n.jsonSchema)o=n.jsonSchema[t]({target:uv});else if(n.vendor==="zod"){if(!("_zod"in e))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");if(!Jy)Jy=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.");o=Br(e,{target:uv,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output"){if(o.type!==void 0)return o;return Rb(o)?{type:"object",...o}:o}if(o.type!==void 0&&o.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}function Rb(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every((o)=>o!==null&&typeof o==="object"&&(o.type==="object"||Rb(o)))}return!1}function ik(e){if(!e.path?.length)return e.message;return`${e.path.map((t)=>String(typeof t==="object"?t.key:t)).join(".")}: ${e.message}`}async function rn(e,t){let n=await e["~standard"].validate(t);if(n.issues&&n.issues.length>0)return{success:!1,error:n.issues.map((o)=>ik(o)).join(", ")};return{success:!0,data:n.value}}function ak(e){let t=Br(e,{target:uv,io:"input"});return typeof t.pattern==="string"?t.pattern:void 0}var sk=/\\\.\\d\{(\d+)\}/;function ck(e){let t=sk.exec(e),n=[void 0,-1,0];if(t)n.push(Number(t[1]));return[!1,!0].flatMap((o)=>[!1,!0].flatMap((r)=>n.map((i)=>Hr({local:o,offset:r,precision:i}))))}function lk(e,t){let n;switch(e){case"email":n=[Xs()];break;case"uri":n=[Fn()];break;case"date":n=[Vs()];break;case"date-time":n=ck(t);break}return new Set(n.map((o)=>ak(o)).filter((o)=>o!==void 0))}function uk(e,t,n){if(n!=="zod")return!0;return lk(e,t).has(t)}function zb(e){let t=zr(e,"input"),n=t.properties||{},o=t.required||[];return Object.entries(n).map(([r,i])=>({name:r,description:i?.description,required:o.includes(r)}))}function na(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function dk(e){try{return zr(e,"input")}catch(t){let n=t instanceof Error?t.message:String(t);throw new D(I.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${n}`)}}var mk=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function kv(e){return mk.has(e)||e.startsWith("x-")}var pk=new Set(["$schema",...Object.keys(ao.shape.requestedSchema.shape)]),By={string:ea([oo,Bi,Hi,Yi]),number:ea([io]),integer:ea([io]),boolean:ea([Ji]),array:ea([Gi,Wi])},fk=new Set(oo.shape.format.unwrap().options);function hk(e,t,n,o){if(!na(e))return e;let r=typeof e.type==="string"&&Object.hasOwn(By,e.type)?By[e.type]:void 0;if(r===void 0)return e;let i={};for(let[a,s]of Object.entries(e))if(r.has(a)||kv(a))i[a]=s;else if(a==="pattern"&&e.type==="string"&&typeof e.format==="string"){if(!fk.has(e.format))i[a]=s;else if(typeof s!=="string"||!uk(e.format,s,n))o.push(`${t}.${a}`)}else o.push(`${t}.${a}`);return i}function gk(e,t){let n={},o=[];for(let[r,i]of Object.entries(e))if(r==="properties"&&na(i))n[r]=Object.fromEntries(Object.entries(i).map(([a,s])=>[a,hk(s,`properties.${a}`,t,o)]));else if(pk.has(r))n[r]=i;else if(!kv(r))o.push(r);if(o.length>0)throw new D(I.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return n}function vk(e,t){if(!na(e.properties))return t;let n=Object.entries(e.properties).filter(([,o])=>!bu(Xi,o).success).map(([o])=>`properties.${o}`);return n.length>0?n.join(", "):t}function dv(e,t,n=""){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((o,r)=>dv(o,t[r],`${n}[${r}]`));if(!na(e)||!na(t))return[];return Object.entries(e).flatMap(([o,r])=>{let i=n?`${n}.${o}`:o;if(!Object.prototype.hasOwnProperty.call(t,o))return kv(o)?[]:[i];return dv(r,t[o],i)})}function _k(e){if(!mo(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,n=gk(dk(e.requestedSchema),t),o=bu(ao.shape.requestedSchema,n);if(!o.success)throw new D(I.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${vk(n,o.error.message)}`);let r=dv(n,o.data);if(r.length>0)throw new D(I.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(", ")}`);let i=(o.data.required??[]).filter((a)=>!Object.prototype.hasOwnProperty.call(o.data.properties,a));if(i.length>0)throw new D(I.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${i.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function Sk(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==="string";if(!t&&!n)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}var Ev=Object.assign(Sk,{elicit(e){try{return{method:"elicitation/create",params:_k(e)}}catch(t){throw t instanceof D?TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var Tb=250;function xb(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function kb(e,t){return new Promise((n,o)=>{if(t?.aborted){o(t.reason instanceof te?t.reason:new te(ie.RequestTimeout,String(t.reason)));return}let r=setTimeout(()=>{t?.removeEventListener("abort",i),n()},e),i=()=>{clearTimeout(r),o(t?.reason instanceof te?t.reason:new te(ie.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",i,{once:!0})})}function Eb(e){let t=new AbortController,n=()=>t.abort(e?.reason);if(e?.addEventListener("abort",n,{once:!0}),e?.aborted)t.abort(e.reason);return{signal:t.signal,abort:(o)=>t.abort(o),dispose:()=>e?.removeEventListener("abort",n)}}var yk=["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"],bk={IdJagTokenExchangeResponseSchema:Qg,OAuthClientInformationFullSchema:tv,OAuthClientInformationSchema:su,OAuthClientMetadataSchema:au,OAuthClientRegistrationErrorSchema:rv,OAuthErrorResponseSchema:ev,OAuthMetadataSchema:ou,OAuthProtectedResourceMetadataSchema:Gg,OAuthTokenRevocationRequestSchema:nv,OAuthTokensSchema:Xg,OpenIdProviderDiscoveryMetadataSchema:Wg,OpenIdProviderMetadataSchema:iu},wb={},Ib={};function Pb(e,t){let n=e.slice(0,-6);wb[n]=t,Ib[n]=(o)=>t.safeParse(o).success}for(let e of yk)Pb(e,Zx[e]);for(let[e,t]of Object.entries(bk))Pb(e,t);var $k=Object.freeze(wb),Rk=Object.freeze(Ib);function zk(e){switch(e){case"initialize":case"notifications/initialized":return $r(void 0);case"server/discover":return $r(sa);default:return}}var Ob=60000,Tk=[ct,Xr,Ot,fr],xk=["inputResponses","requestState"];function Hy(e,t){let n=e.params;if(!ra(n))return{message:e,lifted:{}};let o=n._meta,r=ra(o)?Tk.filter((c)=>(c in o)):[],i=t==="request"?xk.filter((c)=>(c in n)):[];if(r.length===0&&i.length===0)return{message:e,lifted:{}};let a={},s={...n};if(r.length>0&&ra(o)){let c={},u={...o};for(let d of r)c[d]=o[d],delete u[d];if(a.envelope=c,Object.keys(u).length>0)s._meta=u;else delete s._meta}for(let c of i){if(c==="inputResponses")a.inputResponses=s[c];if(c==="requestState")a.requestState=s[c];delete s[c]}return{message:{...e,params:s},lifted:a}}function Yy(e,t){let n=e.validateResult(t,void 0);if(!n.ok&&n.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let r=e.validateResult(t,o);if(r.ok)return{value:r.value};return{issues:[{message:r.reason==="invalid"?r.message:`not-in-era: ${t}`}]}}}}}function ca(e){return()=>e}var kk=ca(void 0);function wv(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:ca(t)}}}var Cb;function Nb(e,t){Cb(e,t)}var Iv=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{Cb=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??xi,this.setNotificationHandler("notifications/cancelled",(t)=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",(t)=>{this._onprogress(t)}),this.setRequestHandler("ping",(t)=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new te(ie.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,o,r=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:r,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new te(ie.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);if(t)clearTimeout(t.timeoutId),this._timeoutInfo.delete(e)}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=(r)=>{n?.(r),this._onerror(r)};let o=this._transport?.onmessage;this._transport.onmessage=(r,i)=>{if(o?.(r,i),Vt(r)||Ht(r))this._onresponse(r);else if(Bt(r))this._onrequest(r,i);else if(Su(r))this._onnotification(r,i);else this._onerror(Error(`Unknown message type: ${JSON.stringify(r)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new te(ie.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let o of e.values())o(n);for(let o of t.values())o.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=Hy(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let a=Zy(t.classification);if(a!==o.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${a} but this instance serves ${o.era}`));return}}if(av(n.method)&&!o.hasNotificationMethod(n.method))return;let r=this._notificationHandlers.get(n.method),i=this.fallbackNotificationHandler;if(r===void 0&&i===void 0)return;Promise.resolve().then(()=>r===void 0?i(n):r(n,o)).catch((a)=>this._onerror(Error(`Uncaught error in notification handler: ${a}`)))}_onrequest(e,t){let{message:n,lifted:o}=Hy(e,"request"),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let i=this._transport,a=(R,z,A)=>{let B={jsonrpc:"2.0",id:n.id,error:{code:R,message:z,...A!==void 0&&{data:A}}};i?.send(B).catch((P)=>this._onerror(Error(`Failed to send an error response: ${P}`)))};if(t?.classification!==void 0){let R=Zy(t.classification);if(R!==r.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${R} but this instance serves ${r.era}`));let z=t.classification.revision??R;a(I.UnsupportedProtocolVersion,`Unsupported protocol version: ${z}`,{supported:this._supportedProtocolVersions,requested:z});return}}if(iv(n.method)&&!r.hasRequestMethod(n.method)){a(I.MethodNotFound,"Method not found");return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){a(I.MethodNotFound,"Method not found");return}let c=r.checkInboundEnvelope(o);if(c!==void 0){a(I.InvalidParams,c);return}let u=(R,z)=>this._notificationViaCodec(this._resolveOutboundCodec(R.method),R,{...z,relatedRequestId:n.id}),d=(R,z,A)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(R.method),R,z,{...A,relatedRequestId:n.id}),m=new AbortController;this._requestHandlerAbortControllers.set(n.id,m);let p=o.inputResponses===void 0?void 0:Ek(o.inputResponses),h={sessionId:i?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...p!==void 0&&{inputResponses:p.accepted},...p!==void 0&&p.droppedKeys.length>0&&{droppedInputResponseKeys:p.droppedKeys},requestState:o.requestState===void 0?kk:ca(o.requestState),signal:m.signal,send:(R,z,A)=>{let B=this._resolveOutboundCodec(R.method);if(this._assertOutboundRequestInEra(B,R.method),mo(z))return d(R,z,A);let P=Yy(B,R.method);if(P===void 0)throw TypeError(`'${R.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return d(R,P,z)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},b=this.buildContext(h,t);Promise.resolve().then(()=>s(n,b)).then(async(R)=>{if(m.signal.aborted)return;let z;try{z=r.encodeResult(n.method,R,this._outboundServerInfo())}catch(B){this._onerror(Error(`Failed to encode result for ${n.method}: ${B}`)),a(I.InternalError,"Internal error");return}let A={result:z,jsonrpc:"2.0",id:n.id};await i?.send(A)},async(R)=>{if(m.signal.aborted)return;let z=Number.isSafeInteger(R.code)?R.code:I.InternalError,A={jsonrpc:"2.0",id:n.id,error:{code:r.encodeErrorCode(z),message:R.message??"Internal error",...R.data!==void 0&&{data:R.data}}};await i?.send(A)}).catch((R)=>this._onerror(Error(`Failed to send response: ${R}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(n.id)===m)this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,o=Number(t),r=this._progressHandlers.get(o);if(!r){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(s){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(s);return}r(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Vt(e))n(e);else n(D.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let o=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(o,e.method),mo(t))return this._requestWithSchemaViaCodec(o,e,t,n);let r=Yy(o,e.method);if(r===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(o,e,r,t)}_negotiatedWireCodec(){return $r(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=zk(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(iv(t)&&!e.hasRequestMethod(t))throw new te(ie.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,n)}_requestWithSchemaViaCodec(e,t,n,o){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,headers:s}=o??{},c=Date.now(),u,d;return new Promise((m,p)=>{let h=(Y)=>{p(Y)};if(!this._transport){h(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(Y){h(Y);return}if(o?.signal?.aborted){let Y=o.signal.reason;throw Y instanceof te?Y:new te(ie.RequestTimeout,String(Y))}let b=e.era===sa&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,R=this._requestMessageId++;d=R;let z={...t,jsonrpc:"2.0",id:R};if(o?.onprogress)this._progressHandlers.set(R,o.onprogress),z.params={...t.params,_meta:{...t.params?._meta,progressToken:R}};let A=this._envelopeOutbound(z),B=!1,P=(Y)=>{if(B)return;if(this._progressHandlers.delete(R),b===void 0)this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:R,reason:String(Y)}}),{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch((ee)=>this._onerror(Error(`Failed to send cancellation: ${ee}`)));else b.abort();p(Y instanceof te?Y:new te(ie.RequestTimeout,String(Y)))};this._responseHandlers.set(R,(Y)=>{if(o?.signal?.aborted)return;if(B=!0,Y instanceof Error)return p(Y);let ee;try{ee=e.decodeResult(t.method,Y.result)}catch(ae){return p(ae instanceof Error?ae:Error(String(ae)))}if(ee.kind==="invalid")return p(ee.error);if(ee.kind==="input_required"){if(o?.allowInputRequired===!0)return m(wk(ee));let ae={codec:e,request:t,resultSchema:n,options:o,flowStartedAt:c,retry:(ce,ue)=>this._requestWithSchemaViaCodec(e,ce===void 0?{method:t.method}:{method:t.method,params:ce},n,ue)};return m(this._resolveNonCompleteResult(ee,ae))}let ne=ee.result;rn(n,ne).then((ae)=>{if(ae.success)m(ae.data);else p(new te(ie.InvalidResult,`Invalid result for ${t.method}: ${ae.error}`))},p)}),u=()=>P(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let O=o?.timeout??Ob,V=()=>P(new te(ie.RequestTimeout,"Request timed out",{timeout:O}));this._setupTimeout(R,O,o?.maxTotalTimeout,V,o?.resetTimeoutOnProgress??!1),this._transport.send(A,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,headers:s,requestSignal:b?.signal}).catch((Y)=>{this._progressHandlers.delete(R),p(Y)})}).finally(()=>{if(u)o?.signal?.removeEventListener("abort",u);if(d!==void 0)this._responseHandlers.delete(d),this._cleanupTimeout(d)})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new te(ie.NotConnected,"Not connected");if(av(t.method)&&!e.hasNotificationMethod(t.method))throw new te(ie.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;this._transport?.send(o,n).catch((r)=>this._onerror(r))});return}await this._transport.send(o,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let o;if(typeof t==="function"){if(!iv(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(r,i)=>{let a=this._negotiatedWireCodec(),s=a.validateRequest(e,r);if(!s.ok&&s.reason==="not-in-era")s=a.validateInputRequest(e,r);if(!s.ok){if(s.reason==="not-in-era")throw new D(I.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(s.message)}return Promise.resolve(t(s.value,i))}}else if(n)o=async(r,i)=>{let a=await rn(t.params,{...r.params});if(!a.success)throw new D(I.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError("setRequestHandler: handler is required");this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==="function"){if(!av(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(o,r)=>{let i=r.validateNotification(e,o);if(!i.ok){if(i.reason==="not-in-era")throw new D(I.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(i.message)}return Promise.resolve(t(i.value))});return}if(!n)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async(o)=>{let r=await rn(t.params,{...o.params});if(!r.success)throw new D(I.InvalidParams,`Invalid params for notification ${e}: ${r.error}`);await n(r.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function ra(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Pv(e,t){let n={...e};for(let o in t){let r=o,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=ra(a)&&ra(i)?{...a,...i}:i}return n}function Gy(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ek(e){let t={},n=[];if(!Gy(e))return{accepted:t,droppedKeys:n};for(let[o,r]of Object.entries(e)){if(!Gy(r)||"method"in r||"result"in r){n.push(o);continue}t[o]=r}return{accepted:t,droppedKeys:n}}function wk(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}/*!
66
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1){if(e.reused==="ref"){i(a);continue}}}}function lr(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(s)=>{let c=e.seen.get(s);if(c.ref===null)return;let u=c.def??c.schema,d={...u},m=c.ref;if(c.ref=null,m){o(m);let h=e.seen.get(m),b=h.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(b);else Object.assign(u,b);if(Object.assign(u,d),s._zod.parent===m)for(let z in u){if(z==="$ref"||z==="allOf")continue;if(!(z in d))delete u[z]}if(b.$ref&&h.def)for(let z in u){if(z==="$ref"||z==="allOf")continue;if(z in h.def&&JSON.stringify(u[z])===JSON.stringify(h.def[z]))delete u[z]}}let p=s._zod.parent;if(p&&p!==m){o(p);let h=e.seen.get(p);if(h?.schema.$ref){if(u.$ref=h.schema.$ref,h.def)for(let b in u){if(b==="$ref"||b==="allOf")continue;if(b in h.def&&JSON.stringify(u[b])===JSON.stringify(h.def[b]))delete u[b]}}}e.override({zodSchema:s,jsonSchema:u,path:c.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let r={};if(e.target==="draft-2020-12")r.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")r.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")r.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw Error("Schema is missing an `id` property");r.$id=e.external.uri(s)}Object.assign(r,n.def??n.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&r.id===i)delete r.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let c=s[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;a[c.defId]=c.def}}if(e.external);else if(Object.keys(a).length>0)if(e.target==="draft-2020-12")r.$defs=a;else r.definitions=a;try{let s=JSON.parse(JSON.stringify(r));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ln(t,"input",e.processors),output:Ln(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch(s){throw Error("Error converting schema to JSON.")}}function De(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return De(o.element,n);if(o.type==="set")return De(o.valueType,n);if(o.type==="lazy")return De(o.getter(),n);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return De(o.innerType,n);if(o.type==="intersection")return De(o.left,n)||De(o.right,n);if(o.type==="record"||o.type==="map")return De(o.keyType,n)||De(o.valueType,n);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return De(o.in,n)||De(o.out,n)}if(o.type==="object"){for(let r in o.shape)if(De(o.shape[r],n))return!0;return!1}if(o.type==="union"){for(let r of o.options)if(De(r,n))return!0;return!1}if(o.type==="tuple"){for(let r of o.items)if(De(r,n))return!0;if(o.rest&&De(o.rest,n))return!0;return!1}return!1}var Df=(e,t={})=>(n)=>{let o=sr({...n,processors:t});return de(e,o),cr(o,e),lr(o,e)},Ln=(e,t,n={})=>(o)=>{let{libraryOptions:r,target:i}=o??{},a=sr({...r??{},target:i,io:t,processors:n});return de(e,a),cr(a,e),lr(a,e)};var WT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zf=(e,t,n,o)=>{let r=n;r.type="string";let{minimum:i,maximum:a,format:s,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i==="number")r.minLength=i;if(typeof a==="number")r.maxLength=a;if(s){if(r.format=WT[s]??s,r.format==="")delete r.format;if(s==="time")delete r.format}if(u)r.contentEncoding=u;if(c&&c.size>0){let d=[...c];if(d.length===1)r.pattern=d[0].source;else if(d.length>1)r.allOf=[...d.map((m)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]}},Ff=(e,t,n,o)=>{let r=n,{minimum:i,maximum:a,format:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;if(typeof s==="string"&&s.includes("int"))r.type="integer";else r.type="number";let m=typeof d==="number"&&d>=(i??Number.NEGATIVE_INFINITY),p=typeof u==="number"&&u<=(a??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(m)if(h)r.minimum=d,r.exclusiveMinimum=!0;else r.exclusiveMinimum=d;else if(typeof i==="number")r.minimum=i;if(p)if(h)r.maximum=u,r.exclusiveMaximum=!0;else r.exclusiveMaximum=u;else if(typeof a==="number")r.maximum=a;if(typeof c==="number")r.multipleOf=c},Kf=(e,t,n,o)=>{n.type="boolean"},Jf=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},Vf=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},Bf=(e,t,n,o)=>{if(t.target==="openapi-3.0")n.type="string",n.nullable=!0,n.enum=[null];else n.type="null"},Hf=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},Yf=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Gf=(e,t,n,o)=>{n.not={}},Wf=(e,t,n,o)=>{},Xf=(e,t,n,o)=>{},Qf=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},eh=(e,t,n,o)=>{let r=e._zod.def,i=Vo(r.entries);if(i.every((a)=>typeof a==="number"))n.type="number";if(i.every((a)=>typeof a==="string"))n.type="string";n.enum=i},th=(e,t,n,o)=>{let r=e._zod.def,i=[];for(let a of r.values)if(a===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(a));else i.push(a);if(i.length===0);else if(i.length===1){let a=i[0];if(n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0")n.enum=[a];else n.const=a}else{if(i.every((a)=>typeof a==="number"))n.type="number";if(i.every((a)=>typeof a==="string"))n.type="string";if(i.every((a)=>typeof a==="boolean"))n.type="boolean";if(i.every((a)=>a===null))n.type="null";n.enum=i}},rh=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},nh=(e,t,n,o)=>{let r=n,i=e._zod.pattern;if(!i)throw Error("Pattern not found in template literal");r.type="string",r.pattern=i.source},oh=(e,t,n,o)=>{let r=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=e._zod.bag;if(a!==void 0)i.minLength=a;if(s!==void 0)i.maxLength=s;if(c)if(c.length===1)i.contentMediaType=c[0],Object.assign(r,i);else Object.assign(r,i),r.anyOf=c.map((u)=>({contentMediaType:u}));else Object.assign(r,i)},ih=(e,t,n,o)=>{n.type="boolean"},ah=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},sh=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},ch=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},lh=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},uh=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},dh=(e,t,n,o)=>{let r=n,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;if(typeof a==="number")r.minItems=a;if(typeof s==="number")r.maxItems=s;r.type="array",r.items=de(i.element,t,{...o,path:[...o.path,"items"]})},mh=(e,t,n,o)=>{let r=n,i=e._zod.def;r.type="object",r.properties={};let a=i.shape;for(let u in a)r.properties[u]=de(a[u],t,{...o,path:[...o.path,"properties",u]});let s=new Set(Object.keys(a)),c=new Set([...s].filter((u)=>{let d=i.shape[u]._zod;if(t.io==="input")return d.optin===void 0;else return d.optout===void 0}));if(c.size>0)r.required=Array.from(c);if(i.catchall?._zod.def.type==="never")r.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")r.additionalProperties=!1}else if(i.catchall)r.additionalProperties=de(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},Ls=(e,t,n,o)=>{let r=e._zod.def,i=r.inclusive===!1,a=r.options.map((s,c)=>de(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));if(i)n.oneOf=a;else n.anyOf=a},ph=(e,t,n,o)=>{let r=e._zod.def,i=de(r.left,t,{...o,path:[...o.path,"allOf",0]}),a=de(r.right,t,{...o,path:[...o.path,"allOf",1]}),s=(u)=>("allOf"in u)&&Object.keys(u).length===1,c=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];n.allOf=c},fh=(e,t,n,o)=>{let r=n,i=e._zod.def;r.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((p,h)=>de(p,t,{...o,path:[...o.path,a,h]})),u=i.rest?de(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(r.prefixItems=c,u)r.items=u}else if(t.target==="openapi-3.0"){if(r.items={anyOf:c},u)r.items.anyOf.push(u);if(r.minItems=c.length,!u)r.maxItems=c.length}else if(r.items=c,u)r.additionalItems=u;let{minimum:d,maximum:m}=e._zod.bag;if(typeof d==="number")r.minItems=d;if(typeof m==="number")r.maxItems=m},hh=(e,t,n,o)=>{let r=n,i=e._zod.def;r.type="object";let a=i.keyType,c=a._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){let d=de(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});r.patternProperties={};for(let m of c)r.patternProperties[m.source]=d}else{if(t.target==="draft-07"||t.target==="draft-2020-12")r.propertyNames=de(i.keyType,t,{...o,path:[...o.path,"propertyNames"]});r.additionalProperties=de(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let u=a._zod.values;if(u){let d=[...u].filter((m)=>typeof m==="string"||typeof m==="number");if(d.length>0)r.required=d}},gh=(e,t,n,o)=>{let r=e._zod.def,i=de(r.innerType,t,o),a=t.seen.get(e);if(t.target==="openapi-3.0")a.ref=r.innerType,n.nullable=!0;else n.anyOf=[i,{type:"null"}]},vh=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType},_h=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},Sh=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);if(i.ref=r.innerType,t.io==="input")n._prefault=JSON.parse(JSON.stringify(r.defaultValue))},yh=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType;let a;try{a=r.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=a},bh=(e,t,n,o)=>{let r=e._zod.def,i=r.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?r.out:r.in:r.out;de(a,t,o);let s=t.seen.get(e);s.ref=a},$h=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType,n.readOnly=!0},Rh=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType},Ds=(e,t,n,o)=>{let r=e._zod.def;de(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType},zh=(e,t,n,o)=>{let r=e._zod.innerType;de(r,t,o);let i=t.seen.get(e);i.ref=r},qs={string:Zf,number:Ff,boolean:Kf,bigint:Jf,symbol:Vf,null:Bf,undefined:Hf,void:Yf,never:Gf,any:Wf,unknown:Xf,date:Qf,enum:eh,literal:th,nan:rh,template_literal:nh,file:oh,success:ih,custom:ah,function:sh,transform:ch,map:lh,set:uh,array:dh,object:mh,union:Ls,intersection:ph,tuple:fh,record:hh,nullable:gh,nonoptional:vh,default:_h,prefault:Sh,catch:yh,pipe:bh,readonly:$h,promise:Rh,optional:Ds,lazy:zh};function Br(e,t){if("_idmap"in e){let o=e,r=sr({...t,processors:qs}),i={};for(let c of o._idmap.entries()){let[u,d]=c;de(d,r)}let a={},s={registry:o,uri:t?.uri,defs:i};r.external=s;for(let c of o._idmap.entries()){let[u,d]=c;cr(r,d),a[u]=lr(r,d)}if(Object.keys(i).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:i}}return{schemas:a}}let n=sr({...t,processors:qs});return de(e,n),cr(n,e),lr(n,e)}class Th{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=sr({processors:qs,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return de(e,this.ctx,t)}emit(e,t){if(t){if(t.cycles)this.ctx.cycles=t.cycles;if(t.reused)this.ctx.reused=t.reused;if(t.external)this.ctx.external=t.external}cr(this.ctx,e);let n=lr(this.ctx,e),{"~standard":o,...r}=n;return r}}var hS={};var pi={};Ut(pi,{ZodAny:()=>Fh,ZodArray:()=>Bh,ZodBase64:()=>uc,ZodBase64URL:()=>dc,ZodBigInt:()=>Hn,ZodBigIntFormat:()=>fc,ZodBoolean:()=>Bn,ZodCIDRv4:()=>cc,ZodCIDRv6:()=>lc,ZodCUID:()=>tc,ZodCUID2:()=>rc,ZodCatch:()=>pg,ZodCodec:()=>Ri,ZodCustom:()=>zi,ZodCustomStringFormat:()=>Jn,ZodDate:()=>Si,ZodDefault:()=>sg,ZodDiscriminatedUnion:()=>Yh,ZodE164:()=>mc,ZodEmail:()=>Ws,ZodEmoji:()=>Qs,ZodEnum:()=>Zn,ZodExactOptional:()=>og,ZodFile:()=>rg,ZodFunction:()=>$g,ZodGUID:()=>hi,ZodIPv4:()=>ac,ZodIPv6:()=>sc,ZodIntersection:()=>Gh,ZodJWT:()=>pc,ZodKSUID:()=>ic,ZodLazy:()=>yg,ZodLiteral:()=>tg,ZodMAC:()=>qh,ZodMap:()=>Qh,ZodNaN:()=>hg,ZodNanoID:()=>ec,ZodNever:()=>Jh,ZodNonOptional:()=>Sc,ZodNull:()=>Zh,ZodNullable:()=>ag,ZodNumber:()=>Vn,ZodNumberFormat:()=>Yr,ZodObject:()=>yi,ZodOptional:()=>_c,ZodPipe:()=>$i,ZodPrefault:()=>lg,ZodPreprocess:()=>gg,ZodPromise:()=>bg,ZodReadonly:()=>vg,ZodRecord:()=>Dn,ZodSet:()=>eg,ZodString:()=>Fn,ZodStringFormat:()=>pe,ZodSuccess:()=>mg,ZodSymbol:()=>Lh,ZodTemplateLiteral:()=>Sg,ZodTransform:()=>ng,ZodTuple:()=>Wh,ZodType:()=>se,ZodULID:()=>nc,ZodURL:()=>_i,ZodUUID:()=>It,ZodUndefined:()=>Dh,ZodUnion:()=>bi,ZodUnknown:()=>Kh,ZodVoid:()=>Vh,ZodXID:()=>oc,ZodXor:()=>Hh,_ZodString:()=>Gs,_default:()=>cg,_function:()=>vy,any:()=>hc,array:()=>v,base64:()=>AS,base64url:()=>MS,bigint:()=>HS,boolean:()=>j,catch:()=>fg,check:()=>_y,cidrv4:()=>NS,cidrv6:()=>jS,codec:()=>py,cuid:()=>xS,cuid2:()=>kS,custom:()=>Sy,date:()=>ey,describe:()=>yy,discriminatedUnion:()=>dr,e164:()=>US,email:()=>Xs,emoji:()=>zS,enum:()=>Q,exactOptional:()=>ig,file:()=>ly,float32:()=>KS,float64:()=>JS,function:()=>vy,guid:()=>_S,hash:()=>FS,hex:()=>ZS,hostname:()=>DS,httpUrl:()=>RS,instanceof:()=>$y,int:()=>Hs,int32:()=>VS,int64:()=>YS,intersection:()=>ft,invertCodec:()=>fy,ipv4:()=>PS,ipv6:()=>CS,json:()=>zy,jwt:()=>qS,keyof:()=>ty,ksuid:()=>IS,lazy:()=>mr,literal:()=>S,looseObject:()=>H,looseRecord:()=>iy,mac:()=>OS,map:()=>ay,meta:()=>by,nan:()=>my,nanoid:()=>TS,nativeEnum:()=>cy,never:()=>gc,nonoptional:()=>dg,null:()=>pt,nullable:()=>gi,nullish:()=>uy,number:()=>x,object:()=>f,optional:()=>K,partialRecord:()=>oy,pipe:()=>Ys,prefault:()=>ug,preprocess:()=>Zt,promise:()=>gy,readonly:()=>_g,record:()=>C,refine:()=>Rg,set:()=>sy,strictObject:()=>ry,string:()=>l,stringFormat:()=>LS,stringbool:()=>Ry,success:()=>dy,superRefine:()=>zg,symbol:()=>WS,templateLiteral:()=>hy,transform:()=>vc,tuple:()=>Xh,uint32:()=>BS,uint64:()=>GS,ulid:()=>ES,undefined:()=>XS,union:()=>A,unknown:()=>Z,url:()=>Kn,uuid:()=>SS,uuidv4:()=>yS,uuidv6:()=>bS,uuidv7:()=>$S,void:()=>QS,xid:()=>wS,xor:()=>ny});var Zs={};Ut(Zs,{endsWith:()=>On,gt:()=>Et,gte:()=>Le,includes:()=>In,length:()=>Vr,lowercase:()=>En,lt:()=>kt,lte:()=>et,maxLength:()=>Jr,maxSize:()=>ar,mime:()=>Cn,minLength:()=>Lt,minSize:()=>wt,multipleOf:()=>ir,negative:()=>js,nonnegative:()=>Ms,nonpositive:()=>As,normalize:()=>Nn,overwrite:()=>mt,positive:()=>Ns,property:()=>Us,regex:()=>kn,size:()=>Kr,slugify:()=>Un,startsWith:()=>Pn,toLowerCase:()=>An,toUpperCase:()=>Mn,trim:()=>jn,uppercase:()=>wn});var ur={};Ut(ur,{ZodISODate:()=>Ks,ZodISODateTime:()=>Fs,ZodISODuration:()=>Bs,ZodISOTime:()=>Vs,date:()=>Js,datetime:()=>Hr,duration:()=>kh,time:()=>xh});var Fs=g("ZodISODateTime",(e,t)=>{im.init(e,t),pe.init(e,t)});function Hr(e){return af(Fs,e)}var Ks=g("ZodISODate",(e,t)=>{am.init(e,t),pe.init(e,t)});function Js(e){return sf(Ks,e)}var Vs=g("ZodISOTime",(e,t)=>{sm.init(e,t),pe.init(e,t)});function xh(e){return cf(Vs,e)}var Bs=g("ZodISODuration",(e,t)=>{cm.init(e,t),pe.init(e,t)});function kh(e){return lf(Bs,e)}var gS=(e,t)=>{Xo.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(n)=>ei(e,n)},flatten:{value:(n)=>Qo(e,n)},addIssue:{value:(n)=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Sn,2)}},addIssues:{value:(n)=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Sn,2)}},isEmpty:{get(){return e.issues.length===0}}})},QT=g("ZodError",gS),He=g("ZodError",gS,{Parent:Error});var Eh=bn(He),wh=$n(He),fi=Rn(He),Ih=zn(He),Ph=Ka(He),Oh=Ja(He),Ch=Va(He),Nh=Ba(He),jh=Ha(He),Ah=Ya(He),Mh=Ga(He),Uh=Wa(He);var vS=new WeakMap;function vi(e,t,n){let o=Object.getPrototypeOf(e),r=vS.get(o);if(!r)r=new Set,vS.set(o,r);if(r.has(t))return;r.add(t);for(let i in n){let a=n[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}var se=g("ZodType",(e,t)=>(re.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ln(e,"input"),output:Ln(e,"output")}}),e.toJSONSchema=Df(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,o)=>Eh(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>fi(e,n,o),e.parseAsync=async(n,o)=>wh(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>Ih(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>Ph(e,n,o),e.decode=(n,o)=>Oh(e,n,o),e.encodeAsync=async(n,o)=>Ch(e,n,o),e.decodeAsync=async(n,o)=>Nh(e,n,o),e.safeEncode=(n,o)=>jh(e,n,o),e.safeDecode=(n,o)=>Ah(e,n,o),e.safeEncodeAsync=async(n,o)=>Mh(e,n,o),e.safeDecodeAsync=async(n,o)=>Uh(e,n,o),vi(e,"ZodType",{check(...n){let o=this.def;return this.clone(xt(o,{checks:[...o.checks??[],...n.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,o){return Ue(this,n,o)},brand(){return this},register(n,o){return n.add(this,o),this},refine(n,o){return this.check(Rg(n,o))},superRefine(n,o){return this.check(zg(n,o))},overwrite(n){return this.check(mt(n))},optional(){return K(this)},exactOptional(){return ig(this)},nullable(){return gi(this)},nullish(){return K(gi(this))},nonoptional(n){return dg(this,n)},array(){return v(this)},or(n){return A([this,n])},and(n){return ft(this,n)},transform(n){return Ys(this,vc(n))},default(n){return cg(this,n)},prefault(n){return ug(this,n)},catch(n){return fg(this,n)},pipe(n){return Ys(this,n)},readonly(){return _g(this)},describe(n){let o=this.clone();return xe.add(o,{description:n}),o},meta(...n){if(n.length===0)return xe.get(this);let o=this.clone();return xe.add(o,n[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return xe.get(e)?.description},configurable:!0}),e)),Gs=g("_ZodString",(e,t)=>{Fr.init(e,t),se.init(e,t),e._zod.processJSONSchema=(o,r,i)=>Zf(e,o,r,i);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,vi(e,"_ZodString",{regex(...o){return this.check(kn(...o))},includes(...o){return this.check(In(...o))},startsWith(...o){return this.check(Pn(...o))},endsWith(...o){return this.check(On(...o))},min(...o){return this.check(Lt(...o))},max(...o){return this.check(Jr(...o))},length(...o){return this.check(Vr(...o))},nonempty(...o){return this.check(Lt(1,...o))},lowercase(o){return this.check(En(o))},uppercase(o){return this.check(wn(o))},trim(){return this.check(jn())},normalize(...o){return this.check(Nn(...o))},toLowerCase(){return this.check(An())},toUpperCase(){return this.check(Mn())},slugify(){return this.check(Un())}})}),Fn=g("ZodString",(e,t)=>{Fr.init(e,t),Gs.init(e,t),e.email=(n)=>e.check(fs(Ws,n)),e.url=(n)=>e.check(mi(_i,n)),e.jwt=(n)=>e.check(Cs(pc,n)),e.emoji=(n)=>e.check(Ss(Qs,n)),e.guid=(n)=>e.check(di(hi,n)),e.uuid=(n)=>e.check(hs(It,n)),e.uuidv4=(n)=>e.check(gs(It,n)),e.uuidv6=(n)=>e.check(vs(It,n)),e.uuidv7=(n)=>e.check(_s(It,n)),e.nanoid=(n)=>e.check(ys(ec,n)),e.guid=(n)=>e.check(di(hi,n)),e.cuid=(n)=>e.check(bs(tc,n)),e.cuid2=(n)=>e.check($s(rc,n)),e.ulid=(n)=>e.check(Rs(nc,n)),e.base64=(n)=>e.check(Is(uc,n)),e.base64url=(n)=>e.check(Ps(dc,n)),e.xid=(n)=>e.check(zs(oc,n)),e.ksuid=(n)=>e.check(Ts(ic,n)),e.ipv4=(n)=>e.check(xs(ac,n)),e.ipv6=(n)=>e.check(ks(sc,n)),e.cidrv4=(n)=>e.check(Es(cc,n)),e.cidrv6=(n)=>e.check(ws(lc,n)),e.e164=(n)=>e.check(Os(mc,n)),e.datetime=(n)=>e.check(Hr(n)),e.date=(n)=>e.check(Js(n)),e.time=(n)=>e.check(xh(n)),e.duration=(n)=>e.check(kh(n))});function l(e){return tf(Fn,e)}var pe=g("ZodStringFormat",(e,t)=>{me.init(e,t),Gs.init(e,t)}),Ws=g("ZodEmail",(e,t)=>{Gd.init(e,t),pe.init(e,t)});function Xs(e){return fs(Ws,e)}var hi=g("ZodGUID",(e,t)=>{Hd.init(e,t),pe.init(e,t)});function _S(e){return di(hi,e)}var It=g("ZodUUID",(e,t)=>{Yd.init(e,t),pe.init(e,t)});function SS(e){return hs(It,e)}function yS(e){return gs(It,e)}function bS(e){return vs(It,e)}function $S(e){return _s(It,e)}var _i=g("ZodURL",(e,t)=>{Wd.init(e,t),pe.init(e,t)});function Kn(e){return mi(_i,e)}function RS(e){return mi(_i,{protocol:Qa,hostname:M_,...T(e)})}var Qs=g("ZodEmoji",(e,t)=>{Xd.init(e,t),pe.init(e,t)});function zS(e){return Ss(Qs,e)}var ec=g("ZodNanoID",(e,t)=>{Qd.init(e,t),pe.init(e,t)});function TS(e){return ys(ec,e)}var tc=g("ZodCUID",(e,t)=>{em.init(e,t),pe.init(e,t)});function xS(e){return bs(tc,e)}var rc=g("ZodCUID2",(e,t)=>{tm.init(e,t),pe.init(e,t)});function kS(e){return $s(rc,e)}var nc=g("ZodULID",(e,t)=>{rm.init(e,t),pe.init(e,t)});function ES(e){return Rs(nc,e)}var oc=g("ZodXID",(e,t)=>{nm.init(e,t),pe.init(e,t)});function wS(e){return zs(oc,e)}var ic=g("ZodKSUID",(e,t)=>{om.init(e,t),pe.init(e,t)});function IS(e){return Ts(ic,e)}var ac=g("ZodIPv4",(e,t)=>{lm.init(e,t),pe.init(e,t)});function PS(e){return xs(ac,e)}var qh=g("ZodMAC",(e,t)=>{dm.init(e,t),pe.init(e,t)});function OS(e){return nf(qh,e)}var sc=g("ZodIPv6",(e,t)=>{um.init(e,t),pe.init(e,t)});function CS(e){return ks(sc,e)}var cc=g("ZodCIDRv4",(e,t)=>{mm.init(e,t),pe.init(e,t)});function NS(e){return Es(cc,e)}var lc=g("ZodCIDRv6",(e,t)=>{pm.init(e,t),pe.init(e,t)});function jS(e){return ws(lc,e)}var uc=g("ZodBase64",(e,t)=>{hm.init(e,t),pe.init(e,t)});function AS(e){return Is(uc,e)}var dc=g("ZodBase64URL",(e,t)=>{gm.init(e,t),pe.init(e,t)});function MS(e){return Ps(dc,e)}var mc=g("ZodE164",(e,t)=>{vm.init(e,t),pe.init(e,t)});function US(e){return Os(mc,e)}var pc=g("ZodJWT",(e,t)=>{_m.init(e,t),pe.init(e,t)});function qS(e){return Cs(pc,e)}var Jn=g("ZodCustomStringFormat",(e,t)=>{Sm.init(e,t),pe.init(e,t)});function LS(e,t,n={}){return qn(Jn,e,t,n)}function DS(e){return qn(Jn,"hostname",A_,e)}function ZS(e){return qn(Jn,"hex",L_,e)}function FS(e,t){let n=t?.enc??"hex",o=`${e}_${n}`,r=qt[o];if(!r)throw Error(`Unrecognized hash format: ${o}`);return qn(Jn,o,r,t)}var Vn=g("ZodNumber",(e,t)=>{cs.init(e,t),se.init(e,t),e._zod.processJSONSchema=(o,r,i)=>Ff(e,o,r,i),vi(e,"ZodNumber",{gt(o,r){return this.check(Et(o,r))},gte(o,r){return this.check(Le(o,r))},min(o,r){return this.check(Le(o,r))},lt(o,r){return this.check(kt(o,r))},lte(o,r){return this.check(et(o,r))},max(o,r){return this.check(et(o,r))},int(o){return this.check(Hs(o))},safe(o){return this.check(Hs(o))},positive(o){return this.check(Et(0,o))},nonnegative(o){return this.check(Le(0,o))},negative(o){return this.check(kt(0,o))},nonpositive(o){return this.check(et(0,o))},multipleOf(o,r){return this.check(ir(o,r))},step(o,r){return this.check(ir(o,r))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??0.5),e.isFinite=!0,e.format=n.format??null});function x(e){return uf(Vn,e)}var Yr=g("ZodNumberFormat",(e,t)=>{ym.init(e,t),Vn.init(e,t)});function Hs(e){return mf(Yr,e)}function KS(e){return pf(Yr,e)}function JS(e){return ff(Yr,e)}function VS(e){return hf(Yr,e)}function BS(e){return gf(Yr,e)}var Bn=g("ZodBoolean",(e,t)=>{ni.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Kf(e,n,o,r)});function j(e){return vf(Bn,e)}var Hn=g("ZodBigInt",(e,t)=>{ls.init(e,t),se.init(e,t),e._zod.processJSONSchema=(o,r,i)=>Jf(e,o,r,i),e.gte=(o,r)=>e.check(Le(o,r)),e.min=(o,r)=>e.check(Le(o,r)),e.gt=(o,r)=>e.check(Et(o,r)),e.gte=(o,r)=>e.check(Le(o,r)),e.min=(o,r)=>e.check(Le(o,r)),e.lt=(o,r)=>e.check(kt(o,r)),e.lte=(o,r)=>e.check(et(o,r)),e.max=(o,r)=>e.check(et(o,r)),e.positive=(o)=>e.check(Et(BigInt(0),o)),e.negative=(o)=>e.check(kt(BigInt(0),o)),e.nonpositive=(o)=>e.check(et(BigInt(0),o)),e.nonnegative=(o)=>e.check(Le(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(ir(o,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function HS(e){return Sf(Hn,e)}var fc=g("ZodBigIntFormat",(e,t)=>{bm.init(e,t),Hn.init(e,t)});function YS(e){return bf(fc,e)}function GS(e){return $f(fc,e)}var Lh=g("ZodSymbol",(e,t)=>{$m.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Vf(e,n,o,r)});function WS(e){return Rf(Lh,e)}var Dh=g("ZodUndefined",(e,t)=>{Rm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Hf(e,n,o,r)});function XS(e){return zf(Dh,e)}var Zh=g("ZodNull",(e,t)=>{zm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Bf(e,n,o,r)});function pt(e){return Tf(Zh,e)}var Fh=g("ZodAny",(e,t)=>{Tm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Wf(e,n,o,r)});function hc(){return xf(Fh)}var Kh=g("ZodUnknown",(e,t)=>{xm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Xf(e,n,o,r)});function Z(){return kf(Kh)}var Jh=g("ZodNever",(e,t)=>{km.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Gf(e,n,o,r)});function gc(e){return Ef(Jh,e)}var Vh=g("ZodVoid",(e,t)=>{Em.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Yf(e,n,o,r)});function QS(e){return wf(Vh,e)}var Si=g("ZodDate",(e,t)=>{wm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(o,r,i)=>Qf(e,o,r,i),e.min=(o,r)=>e.check(Le(o,r)),e.max=(o,r)=>e.check(et(o,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function ey(e){return If(Si,e)}var Bh=g("ZodArray",(e,t)=>{Im.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>dh(e,n,o,r),e.element=t.element,vi(e,"ZodArray",{min(n,o){return this.check(Lt(n,o))},nonempty(n){return this.check(Lt(1,n))},max(n,o){return this.check(Jr(n,o))},length(n,o){return this.check(Vr(n,o))},unwrap(){return this.element}})});function v(e,t){return Cf(Bh,e,t)}function ty(e){let t=e._zod.def.shape;return Q(Object.keys(t))}var yi=g("ZodObject",(e,t)=>{Pm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>mh(e,n,o,r),le(e,"shape",()=>t.shape),vi(e,"ZodObject",{keyof(){return Q(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Z()})},loose(){return this.clone({...this._zod.def,catchall:Z()})},strict(){return this.clone({...this._zod.def,catchall:gc()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return T_(this,n)},safeExtend(n){return x_(this,n)},merge(n){return k_(this,n)},pick(n){return R_(this,n)},omit(n){return z_(this,n)},partial(...n){return E_(_c,this,n[0])},required(...n){return w_(Sc,this,n[0])}})});function f(e,t){let n={type:"object",shape:e??{},...T(t)};return new yi(n)}function ry(e,t){return new yi({type:"object",shape:e,catchall:gc(),...T(t)})}function H(e,t){return new yi({type:"object",shape:e,catchall:Z(),...T(t)})}var bi=g("ZodUnion",(e,t)=>{oi.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ls(e,n,o,r),e.options=t.options});function A(e,t){return new bi({type:"union",options:e,...T(t)})}var Hh=g("ZodXor",(e,t)=>{bi.init(e,t),Om.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ls(e,n,o,r),e.options=t.options});function ny(e,t){return new Hh({type:"union",options:e,inclusive:!1,...T(t)})}var Yh=g("ZodDiscriminatedUnion",(e,t)=>{bi.init(e,t),Cm.init(e,t)});function dr(e,t,n){return new Yh({type:"union",options:t,discriminator:e,...T(n)})}var Gh=g("ZodIntersection",(e,t)=>{Nm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ph(e,n,o,r)});function ft(e,t){return new Gh({type:"intersection",left:e,right:t})}var Wh=g("ZodTuple",(e,t)=>{us.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>fh(e,n,o,r),e.rest=(n)=>e.clone({...e._zod.def,rest:n})});function Xh(e,t,n){let o=t instanceof re,r=o?n:t;return new Wh({type:"tuple",items:e,rest:o?t:null,...T(r)})}var Dn=g("ZodRecord",(e,t)=>{jm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>hh(e,n,o,r),e.keyType=t.keyType,e.valueType=t.valueType});function C(e,t,n){if(!t||!t._zod)return new Dn({type:"record",keyType:l(),valueType:e,...T(t)});return new Dn({type:"record",keyType:e,valueType:t,...T(n)})}function oy(e,t,n){let o=Ue(e);return o._zod.values=void 0,new Dn({type:"record",keyType:o,valueType:t,...T(n)})}function iy(e,t,n){return new Dn({type:"record",keyType:e,valueType:t,mode:"loose",...T(n)})}var Qh=g("ZodMap",(e,t)=>{Am.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>lh(e,n,o,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(wt(...n)),e.nonempty=(n)=>e.check(wt(1,n)),e.max=(...n)=>e.check(ar(...n)),e.size=(...n)=>e.check(Kr(...n))});function ay(e,t,n){return new Qh({type:"map",keyType:e,valueType:t,...T(n)})}var eg=g("ZodSet",(e,t)=>{Mm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>uh(e,n,o,r),e.min=(...n)=>e.check(wt(...n)),e.nonempty=(n)=>e.check(wt(1,n)),e.max=(...n)=>e.check(ar(...n)),e.size=(...n)=>e.check(Kr(...n))});function sy(e,t){return new eg({type:"set",valueType:e,...T(t)})}var Zn=g("ZodEnum",(e,t)=>{Um.init(e,t),se.init(e,t),e._zod.processJSONSchema=(o,r,i)=>eh(e,o,r,i),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{let i={};for(let a of o)if(n.has(a))i[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new Zn({...t,checks:[],...T(r),entries:i})},e.exclude=(o,r)=>{let i={...t.entries};for(let a of o)if(n.has(a))delete i[a];else throw Error(`Key ${a} not found in enum`);return new Zn({...t,checks:[],...T(r),entries:i})}});function Q(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new Zn({type:"enum",entries:n,...T(t)})}function cy(e,t){return new Zn({type:"enum",entries:e,...T(t)})}var tg=g("ZodLiteral",(e,t)=>{qm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>th(e,n,o,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function S(e,t){return new tg({type:"literal",values:Array.isArray(e)?e:[e],...T(t)})}var rg=g("ZodFile",(e,t)=>{Lm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>oh(e,n,o,r),e.min=(n,o)=>e.check(wt(n,o)),e.max=(n,o)=>e.check(ar(n,o)),e.mime=(n,o)=>e.check(Cn(Array.isArray(n)?n:[n],o))});function ly(e){return Nf(rg,e)}var ng=g("ZodTransform",(e,t)=>{Dm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ch(e,n,o,r),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Lr(e.constructor.name);n.addIssue=(i)=>{if(typeof i==="string")n.issues.push(or(i,n.value,t));else{let a=i;if(a.fatal)a.continue=!1;a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(or(a))}};let r=t.transform(n.value,n);if(r instanceof Promise)return r.then((i)=>(n.value=i,n.fallback=!0,n));return n.value=r,n.fallback=!0,n}});function vc(e){return new ng({type:"transform",transform:e})}var _c=g("ZodOptional",(e,t)=>{ds.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ds(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function K(e){return new _c({type:"optional",innerType:e})}var og=g("ZodExactOptional",(e,t)=>{Zm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ds(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function ig(e){return new og({type:"optional",innerType:e})}var ag=g("ZodNullable",(e,t)=>{Fm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>gh(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function gi(e){return new ag({type:"nullable",innerType:e})}function uy(e){return K(gi(e))}var sg=g("ZodDefault",(e,t)=>{Km.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>_h(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function cg(e,t){return new sg({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Ho(t)}})}var lg=g("ZodPrefault",(e,t)=>{Jm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Sh(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function ug(e,t){return new lg({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Ho(t)}})}var Sc=g("ZodNonOptional",(e,t)=>{Vm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>vh(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function dg(e,t){return new Sc({type:"nonoptional",innerType:e,...T(t)})}var mg=g("ZodSuccess",(e,t)=>{Bm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ih(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function dy(e){return new mg({type:"success",innerType:e})}var pg=g("ZodCatch",(e,t)=>{Hm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>yh(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function fg(e,t){return new pg({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var hg=g("ZodNaN",(e,t)=>{Ym.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>rh(e,n,o,r)});function my(e){return Of(hg,e)}var $i=g("ZodPipe",(e,t)=>{ms.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>bh(e,n,o,r),e.in=t.in,e.out=t.out});function Ys(e,t){return new $i({type:"pipe",in:e,out:t})}var Ri=g("ZodCodec",(e,t)=>{$i.init(e,t),ii.init(e,t)});function py(e,t,n){return new Ri({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function fy(e){let t=e._zod.def;return new Ri({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var gg=g("ZodPreprocess",(e,t)=>{$i.init(e,t),Gm.init(e,t)}),vg=g("ZodReadonly",(e,t)=>{Wm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>$h(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function _g(e){return new vg({type:"readonly",innerType:e})}var Sg=g("ZodTemplateLiteral",(e,t)=>{Xm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>nh(e,n,o,r)});function hy(e,t){return new Sg({type:"template_literal",parts:e,...T(t)})}var yg=g("ZodLazy",(e,t)=>{tp.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>zh(e,n,o,r),e.unwrap=()=>e._zod.def.getter()});function mr(e){return new yg({type:"lazy",getter:e})}var bg=g("ZodPromise",(e,t)=>{ep.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Rh(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function gy(e){return new bg({type:"promise",innerType:e})}var $g=g("ZodFunction",(e,t)=>{Qm.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>sh(e,n,o,r)});function vy(e){return new $g({type:"function",input:Array.isArray(e?.input)?Xh(e?.input):e?.input??v(Z()),output:e?.output??Z()})}var zi=g("ZodCustom",(e,t)=>{rp.init(e,t),se.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ah(e,n,o,r)});function _y(e){let t=new fe({check:"custom"});return t._zod.check=e,t}function Sy(e,t){return jf(zi,e??(()=>!0),t)}function Rg(e,t={}){return Af(zi,e,t)}function zg(e,t){return Mf(e,t)}var yy=Uf,by=qf;function $y(e,t={}){let n=new zi({type:"custom",check:"custom",fn:(o)=>o instanceof e,abort:!0,...T(t)});return n._zod.bag.Class=e,n._zod.check=(o)=>{if(!(o.value instanceof e))o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:n,path:[...n._zod.def.path??[]]})},n}var Ry=(...e)=>Lf({Codec:Ri,Boolean:Bn,String:Fn},...e);function zy(e){let t=mr(()=>A([l(e),x(),j(),pt(),v(t),C(l(),t)]));return t}function Zt(e,t){return new gg({type:"pipe",in:vc(e),out:t})}var xg={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"};function tx(e){ge({customError:e})}function rx(){return ge().customError}var Tg;(function(e){})(Tg||(Tg={}));var U={...pi,...Zs,iso:ur},nx=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function ox(e,t){let n=e.$schema;if(n==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(n==="http://json-schema.org/draft-07/schema#")return"draft-7";if(n==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function ix(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===o){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function Ty(e,t){if(e.not!==void 0){if(typeof e.not==="object"&&Object.keys(e.not).length===0)return U.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return U.lazy(()=>{if(!t.refs.has(r))throw Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let i=ix(r,t),a=Ie(i,t);return t.refs.set(r,a),t.processing.delete(r),a}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return U.null();if(r.length===0)return U.never();if(r.length===1)return U.literal(r[0]);if(r.every((a)=>typeof a==="string"))return U.enum(r);let i=r.map((a)=>U.literal(a));if(i.length<2)return i[0];return U.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return U.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map((i)=>{let a={...e,type:i};return Ty(a,t)});if(r.length===0)return U.never();if(r.length===1)return r[0];return U.union(r)}if(!n)return U.any();let o;switch(n){case"string":{let r=U.string();if(e.format){let i=e.format;if(i==="email")r=r.check(U.email());else if(i==="uri"||i==="uri-reference")r=r.check(U.url());else if(i==="uuid"||i==="guid")r=r.check(U.uuid());else if(i==="date-time")r=r.check(U.iso.datetime());else if(i==="date")r=r.check(U.iso.date());else if(i==="time")r=r.check(U.iso.time());else if(i==="duration")r=r.check(U.iso.duration());else if(i==="ipv4")r=r.check(U.ipv4());else if(i==="ipv6")r=r.check(U.ipv6());else if(i==="mac")r=r.check(U.mac());else if(i==="cidr")r=r.check(U.cidrv4());else if(i==="cidr-v6")r=r.check(U.cidrv6());else if(i==="base64")r=r.check(U.base64());else if(i==="base64url")r=r.check(U.base64url());else if(i==="e164")r=r.check(U.e164());else if(i==="jwt")r=r.check(U.jwt());else if(i==="emoji")r=r.check(U.emoji());else if(i==="nanoid")r=r.check(U.nanoid());else if(i==="cuid")r=r.check(U.cuid());else if(i==="cuid2")r=r.check(U.cuid2());else if(i==="ulid")r=r.check(U.ulid());else if(i==="xid")r=r.check(U.xid());else if(i==="ksuid")r=r.check(U.ksuid())}if(typeof e.minLength==="number")r=r.min(e.minLength);if(typeof e.maxLength==="number")r=r.max(e.maxLength);if(e.pattern)r=r.regex(new RegExp(e.pattern));o=r;break}case"number":case"integer":{let r=n==="integer"?U.number().int():U.number();if(typeof e.minimum==="number")r=r.min(e.minimum);if(typeof e.maximum==="number")r=r.max(e.maximum);if(typeof e.exclusiveMinimum==="number")r=r.gt(e.exclusiveMinimum);else if(e.exclusiveMinimum===!0&&typeof e.minimum==="number")r=r.gt(e.minimum);if(typeof e.exclusiveMaximum==="number")r=r.lt(e.exclusiveMaximum);else if(e.exclusiveMaximum===!0&&typeof e.maximum==="number")r=r.lt(e.maximum);if(typeof e.multipleOf==="number")r=r.multipleOf(e.multipleOf);o=r;break}case"boolean":{o=U.boolean();break}case"null":{o=U.null();break}case"object":{let r={},i=e.properties||{},a=new Set(e.required||[]);for(let[c,u]of Object.entries(i)){let d=Ie(u,t);r[c]=a.has(c)?d:d.optional()}if(e.propertyNames){let c=Ie(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties==="object"?Ie(e.additionalProperties,t):U.any();if(Object.keys(r).length===0){o=U.record(c,u);break}let d=U.object(r).passthrough(),m=U.looseRecord(c,u);o=U.intersection(d,m);break}if(e.patternProperties){let c=e.patternProperties,u=Object.keys(c),d=[];for(let p of u){let h=Ie(c[p],t),b=U.string().regex(new RegExp(p));d.push(U.looseRecord(b,h))}let m=[];if(Object.keys(r).length>0)m.push(U.object(r).passthrough());if(m.push(...d),m.length===0)o=U.object({}).passthrough();else if(m.length===1)o=m[0];else{let p=U.intersection(m[0],m[1]);for(let h=2;h<m.length;h++)p=U.intersection(p,m[h]);o=p}break}let s=U.object(r);if(e.additionalProperties===!1)o=s.strict();else if(typeof e.additionalProperties==="object")o=s.catchall(Ie(e.additionalProperties,t));else o=s.passthrough();break}case"array":{let{prefixItems:r,items:i}=e;if(r&&Array.isArray(r)){let a=r.map((c)=>Ie(c,t)),s=i&&typeof i==="object"&&!Array.isArray(i)?Ie(i,t):void 0;if(s)o=U.tuple(a).rest(s);else o=U.tuple(a);if(typeof e.minItems==="number")o=o.check(U.minLength(e.minItems));if(typeof e.maxItems==="number")o=o.check(U.maxLength(e.maxItems))}else if(Array.isArray(i)){let a=i.map((c)=>Ie(c,t)),s=e.additionalItems&&typeof e.additionalItems==="object"?Ie(e.additionalItems,t):void 0;if(s)o=U.tuple(a).rest(s);else o=U.tuple(a);if(typeof e.minItems==="number")o=o.check(U.minLength(e.minItems));if(typeof e.maxItems==="number")o=o.check(U.maxLength(e.maxItems))}else if(i!==void 0){let a=Ie(i,t),s=U.array(a);if(typeof e.minItems==="number")s=s.min(e.minItems);if(typeof e.maxItems==="number")s=s.max(e.maxItems);o=s}else o=U.array(U.any());break}default:throw Error(`Unsupported type: ${n}`)}return o}function Ie(e,t){if(typeof e==="boolean")return e?U.any():U.never();let n=Ty(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map((u)=>Ie(u,t)),c=U.union(s);n=o?U.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map((u)=>Ie(u,t)),c=U.xor(s);n=o?U.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=o?n:U.any();else{let s=o?n:Ie(e.allOf[0],t),c=o?0:1;for(let u=c;u<e.allOf.length;u++)s=U.intersection(s,Ie(e.allOf[u],t));n=s}if(e.nullable===!0&&t.version==="openapi-3.0")n=U.nullable(n);if(e.readOnly===!0)n=U.readonly(n);if(e.default!==void 0)n=n.default(e.default);let r={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)if(s in e)r[s]=e[s];let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)if(s in e)r[s]=e[s];for(let s of Object.keys(e))if(!nx.has(s))r[s]=e[s];if(Object.keys(r).length>0)t.registry.add(n,r);if(e.description)n=n.describe(e.description);return n}function xy(e,t){if(typeof e==="boolean")return e?U.any():U.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=ox(n,t?.defaultTarget),r=n.$defs||n.definitions||{},i={version:o,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??xe};return Ie(n,i)}var yc={};Ut(yc,{bigint:()=>cx,boolean:()=>sx,date:()=>lx,number:()=>ky,string:()=>ax});function ax(e){return rf(Fn,e)}function ky(e){return df(Vn,e)}function sx(e){return _f(Bn,e)}function cx(e){return yf(Hn,e)}function lx(e){return Pf(Si,e)}ge(ai());var Wr="2025-11-25",bc="2025-03-26",xi=[Wr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],$c="io.modelcontextprotocol/related-task",ct="io.modelcontextprotocol/protocolVersion",Xr="io.modelcontextprotocol/clientInfo",Pt="io.modelcontextprotocol/serverInfo",Ot="io.modelcontextprotocol/clientCapabilities",Qr="io.modelcontextprotocol/subscriptionId",fr="io.modelcontextprotocol/logLevel";var en="2.0";var pr=mr(()=>A([l(),x(),j(),pt(),C(l(),pr),v(pr)])),ve=C(l(),pr),Eg=v(pr),ki=A([l(),x().int()]),Ei=l(),Rc=f({ttl:x().optional()}),zc=f({taskId:l()}),wi=H({progressToken:ki.optional(),[$c]:zc.optional()}),ze=f({_meta:wi.optional()}),tn=ze.extend({task:Rc.optional()}),_e=f({method:l(),params:ze.loose().optional()}),Pe=f({_meta:wi.optional()}),Oe=f({method:l(),params:Pe.loose().optional()}),Ii=H({get[Pt](){return Xn.optional().catch(void 0)}}),Se=H({_meta:Ii.optional()}),hr=A([l(),x().int()]),Pi=f({jsonrpc:S(en),id:hr,..._e.shape}).strict(),Oi=f({jsonrpc:S(en),...Oe.shape}).strict(),Yn=f({jsonrpc:S(en),id:hr,result:Se}).strict(),Gn=f({jsonrpc:S(en),id:hr.optional(),error:f({code:x().int(),message:l(),data:Z().optional()})}).strict(),Wn=A([Pi,Oi,Yn,Gn]),wg=A([Yn,Gn]),Ci=Se.strict(),Tc=Pe.extend({requestId:hr.optional(),reason:l().optional()}),Ni=Oe.extend({method:S("notifications/cancelled"),params:Tc}),xc=f({src:l(),mimeType:l().optional(),sizes:v(l()).optional(),theme:Q(["light","dark"]).optional()}),gr=f({icons:v(xc).optional()}),Ft=f({name:l(),title:l().optional()}),Xn=Ft.extend({...Ft.shape,...gr.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),dx=ft(f({applyDefaults:j().optional()}),ve),mx=Zt((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)&&Object.keys(e).length===0)return{form:{}};return e},ft(f({form:dx.optional(),url:ve.optional()}),ve.optional())),kc=H({list:ve.optional(),cancel:ve.optional(),requests:H({sampling:H({createMessage:ve.optional()}).optional(),elicitation:H({create:ve.optional()}).optional()}).optional()}),Ec=H({list:ve.optional(),cancel:ve.optional(),requests:H({tools:H({call:ve.optional()}).optional()}).optional()}),wc=f({experimental:C(l(),ve).optional(),sampling:f({context:ve.optional(),tools:ve.optional()}).optional(),elicitation:mx.optional(),roots:f({listChanged:j().optional()}).optional(),tasks:kc.optional(),extensions:C(l(),ve).optional()}),Ic=ze.extend({protocolVersion:l(),capabilities:wc,clientInfo:Xn}),ji=_e.extend({method:S("initialize"),params:Ic}),Ai=f({experimental:C(l(),ve).optional(),logging:ve.optional(),completions:ve.optional(),prompts:f({listChanged:j().optional()}).optional(),resources:f({subscribe:j().optional(),listChanged:j().optional()}).optional(),tools:f({listChanged:j().optional()}).optional(),tasks:Ec.optional(),extensions:C(l(),ve).optional()}),Pc=Se.extend({protocolVersion:l(),capabilities:Ai,serverInfo:Xn,instructions:l().optional()}),Oc=Oe.extend({method:S("notifications/initialized"),params:Pe.optional()}),Cc=_e.extend({method:S("server/discover"),params:ze.optional()}),Nc=Se.extend({supportedVersions:v(l()),capabilities:Ai,instructions:l().optional()}),Mi=_e.extend({method:S("ping"),params:ze.optional()}),jc=f({progress:x(),total:K(x()),message:K(l())}),Ac=f({...Pe.shape,...jc.shape,progressToken:ki}),Ui=Oe.extend({method:S("notifications/progress"),params:Ac}),Mc=ze.extend({cursor:Ei.optional()}),vr=_e.extend({params:Mc.optional()}),_r=Se.extend({nextCursor:Ei.optional()}),qi=f({uri:l(),mimeType:K(l()),_meta:C(l(),Z()).optional()}),Li=qi.extend({text:l()}),Ig=l().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Di=qi.extend({blob:Ig}),Sr=Q(["user","assistant"]),Kt=f({audience:v(Sr).optional(),priority:x().min(0).max(1).optional(),lastModified:Hr({offset:!0}).optional()}),Zi=f({...Ft.shape,...gr.shape,uri:l(),description:K(l()),mimeType:K(l()),size:K(x()),annotations:Kt.optional(),_meta:K(H({}))}),Uc=f({...Ft.shape,...gr.shape,uriTemplate:l(),description:K(l()),mimeType:K(l()),annotations:Kt.optional(),_meta:K(H({}))}),qc=vr.extend({method:S("resources/list")}),Lc=_r.extend({resources:v(Zi)}),Dc=vr.extend({method:S("resources/templates/list")}),Zc=_r.extend({resourceTemplates:v(Uc)}),Qn=ze.extend({uri:l()}),Fc=Qn,Kc=_e.extend({method:S("resources/read"),params:Fc}),Jc=Se.extend({contents:v(A([Li,Di]))}),Vc=Oe.extend({method:S("notifications/resources/list_changed"),params:Pe.optional()}),Bc=Qn,Hc=_e.extend({method:S("resources/subscribe"),params:Bc}),Yc=Qn,Gc=_e.extend({method:S("resources/unsubscribe"),params:Yc}),Fi=f({toolsListChanged:j().optional(),promptsListChanged:j().optional(),resourcesListChanged:j().optional(),resourceSubscriptions:v(l()).optional()}),Wc=ze.extend({notifications:Fi}),Xc=_e.extend({method:S("subscriptions/listen"),params:Wc}),Qc=Pe.extend({notifications:Fi}),el=Oe.extend({method:S("notifications/subscriptions/acknowledged"),params:Qc}),tl=Ii.extend({[Qr]:hr}),rl=Se.extend({_meta:tl}),nl=Pe.extend({uri:l()}),ol=Oe.extend({method:S("notifications/resources/updated"),params:nl}),il=f({name:l(),description:K(l()),required:K(j())}),al=f({...Ft.shape,...gr.shape,description:K(l()),arguments:K(v(il)),_meta:K(H({}))}),sl=vr.extend({method:S("prompts/list")}),cl=_r.extend({prompts:v(al)}),ll=ze.extend({name:l(),arguments:C(l(),l()).optional()}),ul=_e.extend({method:S("prompts/get"),params:ll}),eo=f({type:S("text"),text:l(),annotations:Kt.optional(),_meta:C(l(),Z()).optional()}),to=f({type:S("image"),data:Ig,mimeType:l(),annotations:Kt.optional(),_meta:C(l(),Z()).optional()}),ro=f({type:S("audio"),data:Ig,mimeType:l(),annotations:Kt.optional(),_meta:C(l(),Z()).optional()}),dl=f({type:S("tool_use"),name:l(),id:l(),input:C(l(),Z()),_meta:C(l(),Z()).optional()}),ml=f({type:S("resource"),resource:A([Li,Di]),annotations:Kt.optional(),_meta:C(l(),Z()).optional()}),pl=Zi.extend({type:S("resource_link")}),no=A([eo,to,ro,pl,ml]),fl=f({role:Sr,content:no}),hl=Se.extend({description:l().optional(),messages:v(fl)}),gl=Oe.extend({method:S("notifications/prompts/list_changed"),params:Pe.optional()}),vl=f({title:l().optional(),readOnlyHint:j().optional(),destructiveHint:j().optional(),idempotentHint:j().optional(),openWorldHint:j().optional()}),_l=f({taskSupport:Q(["required","optional","forbidden"]).optional()}),Ki=f({...Ft.shape,...gr.shape,description:l().optional(),inputSchema:f({type:S("object"),properties:C(l(),pr).optional(),required:v(l()).optional()}).catchall(Z()),outputSchema:H({$schema:l().optional()}).optional(),annotations:vl.optional(),execution:_l.optional(),_meta:C(l(),Z()).optional()}),Sl=vr.extend({method:S("tools/list")}),yl=_r.extend({tools:v(Ki)}),Ji=Se.extend({content:v(no).default([]),structuredContent:Z().optional(),isError:j().optional()}),Pg=Ji.or(Se.extend({toolResult:Z()})),bl=tn.extend({name:l(),arguments:C(l(),Z()).optional()}),$l=_e.extend({method:S("tools/call"),params:bl}),Rl=Oe.extend({method:S("notifications/tools/list_changed"),params:Pe.optional()}),Og=f({autoRefresh:j().default(!0),debounceMs:x().int().nonnegative().default(300)}),yr=Q(["debug","info","notice","warning","error","critical","alert","emergency"]),zl=ze.extend({level:yr}),Tl=_e.extend({method:S("logging/setLevel"),params:zl}),xl=Pe.extend({level:yr,logger:l().optional(),data:Z()}),kl=Oe.extend({method:S("notifications/message"),params:xl}),El=f({name:l().optional()}),wl=f({hints:v(El).optional(),costPriority:x().min(0).max(1).optional(),speedPriority:x().min(0).max(1).optional(),intelligencePriority:x().min(0).max(1).optional()}),Il=f({mode:Q(["auto","required","none"]).optional()}),Pl=f({type:S("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:v(no),structuredContent:Z().optional(),isError:j().optional(),_meta:C(l(),Z()).optional()}),Ol=dr("type",[eo,to,ro]),Gr=dr("type",[eo,to,ro,dl,Pl]),Cl=f({role:Sr,content:A([Gr,v(Gr)]),_meta:C(l(),Z()).optional()}),Nl=tn.extend({messages:v(Cl),modelPreferences:wl.optional(),systemPrompt:l().optional(),includeContext:Q(["none","thisServer","allServers"]).optional(),temperature:x().optional(),maxTokens:x().int(),stopSequences:v(l()).optional(),metadata:ve.optional(),tools:v(Ki).optional(),toolChoice:Il.optional()}),jl=_e.extend({method:S("sampling/createMessage"),params:Nl}),Al=Se.extend({model:l(),stopReason:K(Q(["endTurn","stopSequence","maxTokens"]).or(l())),role:Sr,content:Ol}),Ml=Se.extend({model:l(),stopReason:K(Q(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:Sr,content:A([Gr,v(Gr)])}),Vi=f({type:S("boolean"),title:l().optional(),description:l().optional(),default:j().optional()}),oo=f({type:S("string"),title:l().optional(),description:l().optional(),minLength:x().optional(),maxLength:x().optional(),format:Q(["email","uri","date","date-time"]).optional(),default:l().optional()}),io=f({type:Q(["number","integer"]),title:l().optional(),description:l().optional(),minimum:x().optional(),maximum:x().optional(),default:x().optional()}),Bi=f({type:S("string"),title:l().optional(),description:l().optional(),enum:v(l()),default:l().optional()}),Hi=f({type:S("string"),title:l().optional(),description:l().optional(),oneOf:v(f({const:l(),title:l()})),default:l().optional()}),Yi=f({type:S("string"),title:l().optional(),description:l().optional(),enum:v(l()),enumNames:v(l()).optional(),default:l().optional()}),Ul=A([Bi,Hi]),Gi=f({type:S("array"),title:l().optional(),description:l().optional(),minItems:x().optional(),maxItems:x().optional(),items:f({type:S("string"),enum:v(l())}),default:v(l()).optional()}),Wi=f({type:S("array"),title:l().optional(),description:l().optional(),minItems:x().optional(),maxItems:x().optional(),items:f({anyOf:v(f({const:l(),title:l()}))}),default:v(l()).optional()}),ql=A([Gi,Wi]),Ll=A([Yi,Ul,ql]),Xi=A([Ll,Vi,oo,io]),ao=tn.extend({mode:S("form").optional(),message:l(),requestedSchema:f({type:S("object"),properties:C(l(),Xi),required:v(l()).optional()}).catchall(Z())}),Dl=tn.extend({mode:S("url"),message:l(),elicitationId:l(),url:l().url()}),Zl=A([ao,Dl]),Fl=_e.extend({method:S("elicitation/create"),params:Zl}),Kl=Pe.extend({elicitationId:l()}),Jl=Oe.extend({method:S("notifications/elicitation/complete"),params:Kl}),Vl=Se.extend({action:Q(["accept","decline","cancel"]),content:Zt((e)=>e===null?void 0:e,C(l(),A([l(),x(),j(),v(l())])).optional())}),Bl=f({type:S("ref/resource"),uri:l()}),Hl=f({type:S("ref/prompt"),name:l()}),Yl=ze.extend({ref:A([Hl,Bl]),argument:f({name:l(),value:l()}),context:f({arguments:C(l(),l()).optional()}).optional()}),Gl=_e.extend({method:S("completion/complete"),params:Yl}),Wl=Se.extend({completion:H({values:v(l()).max(100),total:K(x().int()),hasMore:K(j())})}),Xl=f({uri:l().startsWith("file://"),name:l().optional(),_meta:C(l(),Z()).optional()}),Ql=_e.extend({method:S("roots/list"),params:ze.optional()}),eu=Se.extend({roots:v(Xl)}),tu=Oe.extend({method:S("notifications/roots/list_changed"),params:Pe.optional()}),Cg=H({ttl:x().optional(),pollInterval:x().optional()}),ru=Q(["working","input_required","completed","failed","cancelled"]),br=f({taskId:l(),status:ru,ttl:A([x(),pt()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:K(x()),statusMessage:K(l())}),Ng=Se.extend({task:br}),nu=Pe.merge(br),jg=Oe.extend({method:S("notifications/tasks/status"),params:nu}),Ag=_e.extend({method:S("tasks/get"),params:ze.extend({taskId:l()})}),Mg=Se.merge(br),Ug=_e.extend({method:S("tasks/result"),params:ze.extend({taskId:l()})}),qg=Se.loose(),Lg=vr.extend({method:S("tasks/list")}),Dg=_r.extend({tasks:v(br)}),Zg=_e.extend({method:S("tasks/cancel"),params:ze.extend({taskId:l()})}),Fg=Se.merge(br),Kg=A([Mi,ji,Cc,Gl,Tl,ul,sl,qc,Dc,Kc,Hc,Gc,Xc,$l,Sl]),Jg=A([Ni,Ui,Oc,tu]),Vg=A([Ci,Al,Ml,Vl,eu]),Bg=A([Mi,jl,Fl,Ql]),Hg=A([Ni,Ui,kl,ol,Vc,Rl,gl,el,Jl]),Yg=A([Ci,Pc,Nc,Wl,hl,cl,Lc,Zc,Jc,Ji,yl,rl]),Re=Kn().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:xg.custom,message:"URL must be parseable",fatal:!0}),Ko}).refine((e)=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Gg=H({resource:l().url(),authorization_servers:v(Re).optional(),jwks_uri:l().url().optional(),scopes_supported:v(l()).optional(),bearer_methods_supported:v(l()).optional(),resource_signing_alg_values_supported:v(l()).optional(),resource_name:l().optional(),resource_documentation:l().optional(),resource_policy_uri:l().url().optional(),resource_tos_uri:l().url().optional(),tls_client_certificate_bound_access_tokens:j().optional(),authorization_details_types_supported:v(l()).optional(),dpop_signing_alg_values_supported:v(l()).optional(),dpop_bound_access_tokens_required:j().optional()}),ou=H({issuer:l(),authorization_endpoint:Re,token_endpoint:Re,registration_endpoint:Re.optional(),scopes_supported:v(l()).optional(),response_types_supported:v(l()),response_modes_supported:v(l()).optional(),grant_types_supported:v(l()).optional(),token_endpoint_auth_methods_supported:v(l()).optional(),token_endpoint_auth_signing_alg_values_supported:v(l()).optional(),service_documentation:Re.optional(),revocation_endpoint:Re.optional(),revocation_endpoint_auth_methods_supported:v(l()).optional(),revocation_endpoint_auth_signing_alg_values_supported:v(l()).optional(),introspection_endpoint:l().optional(),introspection_endpoint_auth_methods_supported:v(l()).optional(),introspection_endpoint_auth_signing_alg_values_supported:v(l()).optional(),code_challenge_methods_supported:v(l()).optional(),client_id_metadata_document_supported:j().optional(),authorization_response_iss_parameter_supported:j().optional().catch(void 0)}),iu=H({issuer:l(),authorization_endpoint:Re,token_endpoint:Re,userinfo_endpoint:Re.optional(),jwks_uri:Re,registration_endpoint:Re.optional(),scopes_supported:v(l()).optional(),response_types_supported:v(l()),response_modes_supported:v(l()).optional(),grant_types_supported:v(l()).optional(),acr_values_supported:v(l()).optional(),subject_types_supported:v(l()),id_token_signing_alg_values_supported:v(l()),id_token_encryption_alg_values_supported:v(l()).optional(),id_token_encryption_enc_values_supported:v(l()).optional(),userinfo_signing_alg_values_supported:v(l()).optional(),userinfo_encryption_alg_values_supported:v(l()).optional(),userinfo_encryption_enc_values_supported:v(l()).optional(),request_object_signing_alg_values_supported:v(l()).optional(),request_object_encryption_alg_values_supported:v(l()).optional(),request_object_encryption_enc_values_supported:v(l()).optional(),token_endpoint_auth_methods_supported:v(l()).optional(),token_endpoint_auth_signing_alg_values_supported:v(l()).optional(),display_values_supported:v(l()).optional(),claim_types_supported:v(l()).optional(),claims_supported:v(l()).optional(),service_documentation:l().optional(),claims_locales_supported:v(l()).optional(),ui_locales_supported:v(l()).optional(),claims_parameter_supported:j().optional(),request_parameter_supported:j().optional(),request_uri_parameter_supported:j().optional(),require_request_uri_registration:j().optional(),op_policy_uri:Re.optional(),op_tos_uri:Re.optional(),client_id_metadata_document_supported:j().optional(),authorization_response_iss_parameter_supported:j().optional().catch(void 0)}),Wg=f({...iu.shape,...ou.pick({code_challenge_methods_supported:!0}).shape}),Xg=f({access_token:l(),id_token:l().optional(),token_type:l(),expires_in:ky().optional(),scope:l().optional(),refresh_token:l().optional()}).strip(),Qg=f({issued_token_type:S("urn:ietf:params:oauth:token-type:id-jag"),access_token:l(),token_type:l().optional(),expires_in:x().optional(),scope:l().optional()}).strip(),ev=f({error:l(),error_description:l().optional(),error_uri:l().optional()}),kg=Re.optional().or(S("").transform(()=>{return})),au=f({redirect_uris:v(Re),token_endpoint_auth_method:l().optional(),grant_types:v(l()).optional(),response_types:v(l()).optional(),application_type:l().optional(),client_name:l().optional(),client_uri:Re.optional(),logo_uri:kg,scope:l().optional(),contacts:v(l()).optional(),tos_uri:kg,policy_uri:l().optional(),jwks_uri:Re.optional(),jwks:hc().optional(),software_id:l().optional(),software_version:l().optional(),software_statement:l().optional()}).strip(),su=f({client_id:l(),client_secret:l().optional(),client_id_issued_at:x().optional(),client_secret_expires_at:x().optional()}).strip(),tv=au.merge(su),rv=f({error:l(),error_description:l().optional()}).strip(),nv=f({token:l(),token_type_hint:l().optional()}).strip();var cv=Symbol.for("mcp.sdk.errorBrands");function mv(e,t){let n=new Set,o=t;while(typeof o==="function"){let r=o.mcpBrand;if(Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof r==="string")n.add(r);o=Object.getPrototypeOf(o)}if(n.size===0)return;Object.defineProperty(e,cv,{value:n,enumerable:!1,configurable:!0})}function uo(e,t){try{if(typeof t==="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(t,cv)){let n=t[cv];if(n&&typeof n.has==="function"&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var px=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return uo(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return uo(this,t)}constructor(t,n,o){super(n);this.code=t,this.errorUri=o,this.name="OAuthError",mv(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};if(this.errorUri)t.error_uri=this.errorUri;return t}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},ie=function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e}({}),te=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return uo(this,e)}static isInstance(e){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return uo(this,e)}constructor(e,t,n){super(t);this.code=e,this.data=n,this.name="SdkError",mv(this,new.target)}},fx=class extends te{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,n){super(e,t,n);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};var Ay={};function Wy(e){return Object.hasOwn(Ay,e)?Ay[e]:void 0}function My(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function hx(e,t,n){return e==="elicitation"&&t==="form"&&n.form===void 0&&n.url===void 0}function Xy(e){switch(e.method){case"elicitation/create":if(e.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;if(t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function oa(e,t){let n={};for(let[o,r]of Object.entries(e)){if(r===void 0)continue;let i=t===void 0?void 0:t[o];if(i===void 0){n[o]=r;continue}if(My(r)&&My(i)){let a={};for(let[s,c]of Object.entries(r))if(c!==void 0&&i[s]===void 0&&!hx(o,s,i))a[s]=c;if(Object.keys(a).length>0)n[o]=a}}return Object.keys(n).length>0?n:void 0}var Qy="2026-07-28",ia=[Qy];function Vt(e){return e>=Qy}function eb(e){return e.filter((t)=>!Vt(t))}function pv(e){return e.filter((t)=>Vt(t))}function tb(e){let t=e.structuredContent;if(t===void 0)return e;if(!(typeof t!=="object"||t===null||Array.isArray(t)))return e;if(e.content?.some((n)=>n.type==="text")??!1)return e;return{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var rb=["task","inputRequests","requestState"];function fv(e){if(e===null||typeof e!=="object"||Array.isArray(e)||e.content!==void 0||rb.some((t)=>(t in e)))return e;return{...e,content:[]}}function gx(){let e=mr(()=>A([l(),x(),j(),pt(),C(l(),e),v(e)])),t=C(l(),e),n=A([l(),x().int()]),o=l(),r=f({ttl:x().optional()}),i=f({taskId:l()}),a=H({progressToken:n.optional(),"io.modelcontextprotocol/related-task":i.optional()}),s=f({_meta:a.optional()}),c=s.extend({task:r.optional()}),u=f({method:l(),params:s.loose().optional()}),d=f({_meta:a.optional()}),m=f({method:l(),params:d.loose().optional()}),p=H({_meta:a.optional()}),h=A([l(),x().int()]),b=p.strict(),R=d.extend({requestId:h.optional(),reason:l().optional()}),z=m.extend({method:S("notifications/cancelled"),params:R}),N=f({src:l(),mimeType:l().optional(),sizes:v(l()).optional(),theme:Q(["light","dark"]).optional()}),B=f({icons:v(N).optional()}),P=f({name:l(),title:l().optional()}),O=P.extend({...P.shape,...B.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),J=ft(f({applyDefaults:j().optional()}),t),Y=Zt((we)=>{if(we&&typeof we==="object"&&!Array.isArray(we)&&Object.keys(we).length===0)return{form:{}};return we},ft(f({form:J.optional(),url:t.optional()}),t.optional())),ee=H({list:t.optional(),cancel:t.optional(),requests:H({sampling:H({createMessage:t.optional()}).optional(),elicitation:H({create:t.optional()}).optional()}).optional()}),ne=H({list:t.optional(),cancel:t.optional(),requests:H({tools:H({call:t.optional()}).optional()}).optional()}),ae=f({experimental:C(l(),t).optional(),sampling:f({context:t.optional(),tools:t.optional()}).optional(),elicitation:Y.optional(),roots:f({listChanged:j().optional()}).optional(),tasks:ee.optional(),extensions:C(l(),t).optional()}),ce=s.extend({protocolVersion:l(),capabilities:ae,clientInfo:O}),ue=u.extend({method:S("initialize"),params:ce}),Te=f({experimental:C(l(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:f({listChanged:j().optional()}).optional(),resources:f({subscribe:j().optional(),listChanged:j().optional()}).optional(),tools:f({listChanged:j().optional()}).optional(),tasks:ne.optional(),extensions:C(l(),t).optional()}),tt=p.extend({protocolVersion:l(),capabilities:Te,serverInfo:O,instructions:l().optional()}),Ne=m.extend({method:S("notifications/initialized"),params:d.optional()}),rt=u.extend({method:S("ping"),params:s.optional()}),vt=f({progress:x(),total:K(x()),message:K(l())}),Ze=f({...d.shape,...vt.shape,progressToken:n}),nt=m.extend({method:S("notifications/progress"),params:Ze}),_t=s.extend({cursor:o.optional()}),Ye=u.extend({params:_t.optional()}),je=p.extend({nextCursor:o.optional()}),At=f({uri:l(),mimeType:K(l()),_meta:C(l(),Z()).optional()}),Mt=At.extend({text:l()}),St=l().refine((we)=>{try{return atob(we),!0}catch{return!1}},{message:"Invalid Base64 string"}),ke=At.extend({blob:St}),Ae=Q(["user","assistant"]),Me=f({audience:v(Ae).optional(),priority:x().min(0).max(1).optional(),lastModified:Hr({offset:!0}).optional()}),ut=f({...P.shape,...B.shape,uri:l(),description:K(l()),mimeType:K(l()),size:K(x()),annotations:Me.optional(),_meta:K(H({}))}),kr=f({...P.shape,...B.shape,uriTemplate:l(),description:K(l()),mimeType:K(l()),annotations:Me.optional(),_meta:K(H({}))}),Ge=Ye.extend({method:S("resources/list")}),We=je.extend({resources:v(ut)}),Fe=Ye.extend({method:S("resources/templates/list")}),ot=je.extend({resourceTemplates:v(kr)}),it=s.extend({uri:l()}),yt=it,bt=u.extend({method:S("resources/read"),params:yt}),Gt=p.extend({contents:v(A([Mt,ke]))}),$t=m.extend({method:S("notifications/resources/list_changed"),params:d.optional()}),Er=it,q=u.extend({method:S("resources/subscribe"),params:Er}),Rt=it,G=u.extend({method:S("resources/unsubscribe"),params:Rt}),F=d.extend({uri:l()}),oe=m.extend({method:S("notifications/resources/updated"),params:F}),L=f({name:l(),description:K(l()),required:K(j())}),M=f({...P.shape,...B.shape,description:K(l()),arguments:K(v(L)),_meta:K(H({}))}),X=Ye.extend({method:S("prompts/list")}),W=je.extend({prompts:v(M)}),be=s.extend({name:l(),arguments:C(l(),l()).optional()}),wr=u.extend({method:S("prompts/get"),params:be}),zt=f({type:S("text"),text:l(),annotations:Me.optional(),_meta:C(l(),Z()).optional()}),Ir=f({type:S("image"),data:St,mimeType:l(),annotations:Me.optional(),_meta:C(l(),Z()).optional()}),Pr=f({type:S("audio"),data:St,mimeType:l(),annotations:Me.optional(),_meta:C(l(),Z()).optional()}),vo=f({type:S("tool_use"),name:l(),id:l(),input:C(l(),Z()),_meta:C(l(),Z()).optional()}),Wt=f({type:S("resource"),resource:A([Mt,ke]),annotations:Me.optional(),_meta:C(l(),Z()).optional()}),_o=ut.extend({type:S("resource_link")}),at=A([zt,Ir,Pr,_o,Wt]),cn=f({role:Ae,content:at}),ln=p.extend({description:l().optional(),messages:v(cn)}),Or=m.extend({method:S("notifications/prompts/list_changed"),params:d.optional()}),So=f({title:l().optional(),readOnlyHint:j().optional(),destructiveHint:j().optional(),idempotentHint:j().optional(),openWorldHint:j().optional()}),un=f({taskSupport:Q(["required","optional","forbidden"]).optional()}),Cr=f({...P.shape,...B.shape,description:l().optional(),inputSchema:f({type:S("object"),properties:C(l(),e).optional(),required:v(l()).optional()}).catchall(Z()),outputSchema:f({type:S("object"),properties:C(l(),e).optional(),required:v(l()).optional()}).catchall(Z()).optional(),annotations:So.optional(),execution:un.optional(),_meta:C(l(),Z()).optional()}),dn=Ye.extend({method:S("tools/list")}),mn=je.extend({tools:v(Cr)}),pn=p.extend({content:v(at),structuredContent:C(l(),Z()).optional(),isError:j().optional()}),Ee=c.extend({name:l(),arguments:C(l(),Z()).optional()}),yo=u.extend({method:S("tools/call"),params:Ee}),Sa=m.extend({method:S("notifications/tools/list_changed"),params:d.optional()}),fn=Q(["debug","info","notice","warning","error","critical","alert","emergency"]),bo=s.extend({level:fn}),$o=u.extend({method:S("logging/setLevel"),params:bo}),Ro=d.extend({level:fn,logger:l().optional(),data:Z()}),zo=m.extend({method:S("notifications/message"),params:Ro}),To=f({name:l().optional()}),xo=f({hints:v(To).optional(),costPriority:x().min(0).max(1).optional(),speedPriority:x().min(0).max(1).optional(),intelligencePriority:x().min(0).max(1).optional()}),ko=f({mode:Q(["auto","required","none"]).optional()}),ya=f({type:S("tool_result"),toolUseId:l().describe("The unique identifier for the corresponding tool call."),content:v(at),structuredContent:f({}).loose().optional(),isError:j().optional(),_meta:C(l(),Z()).optional()}),Eo=dr("type",[zt,Ir,Pr]),Xt=dr("type",[zt,Ir,Pr,vo,ya]),wo=f({role:Ae,content:A([Xt,v(Xt)]),_meta:C(l(),Z()).optional()}),Io=c.extend({messages:v(wo),modelPreferences:xo.optional(),systemPrompt:l().optional(),includeContext:Q(["none","thisServer","allServers"]).optional(),temperature:x().optional(),maxTokens:x().int(),stopSequences:v(l()).optional(),metadata:t.optional(),tools:v(Cr).optional(),toolChoice:ko.optional()}),Po=u.extend({method:S("sampling/createMessage"),params:Io}),Oo=p.extend({model:l(),stopReason:K(Q(["endTurn","stopSequence","maxTokens"]).or(l())),role:Ae,content:Eo}),Co=p.extend({model:l(),stopReason:K(Q(["endTurn","stopSequence","maxTokens","toolUse"]).or(l())),role:Ae,content:A([Xt,v(Xt)])}),No=f({type:S("boolean"),title:l().optional(),description:l().optional(),default:j().optional()}),jo=f({type:S("string"),title:l().optional(),description:l().optional(),minLength:x().optional(),maxLength:x().optional(),format:Q(["email","uri","date","date-time"]).optional(),default:l().optional()}),Ao=f({type:Q(["number","integer"]),title:l().optional(),description:l().optional(),minimum:x().optional(),maximum:x().optional(),default:x().optional()}),Mo=f({type:S("string"),title:l().optional(),description:l().optional(),enum:v(l()),default:l().optional()}),Uo=f({type:S("string"),title:l().optional(),description:l().optional(),oneOf:v(f({const:l(),title:l()})),default:l().optional()}),qo=f({type:S("string"),title:l().optional(),description:l().optional(),enum:v(l()),enumNames:v(l()).optional(),default:l().optional()}),Lo=A([Mo,Uo]),Nr=f({type:S("array"),title:l().optional(),description:l().optional(),minItems:x().optional(),maxItems:x().optional(),items:f({type:S("string"),enum:v(l())}),default:v(l()).optional()}),jr=f({type:S("array"),title:l().optional(),description:l().optional(),minItems:x().optional(),maxItems:x().optional(),items:f({anyOf:v(f({const:l(),title:l()}))}),default:v(l()).optional()}),ba=A([Nr,jr]),$a=A([qo,Lo,ba]),Xe=A([$a,No,jo,Ao]),Qe=c.extend({mode:S("form").optional(),message:l(),requestedSchema:f({type:S("object"),properties:C(l(),Xe),required:v(l()).optional()}).catchall(Z())}),Do=c.extend({mode:S("url"),message:l(),elicitationId:l(),url:l().url()}),dt=A([Qe,Do]),Ra=u.extend({method:S("elicitation/create"),params:dt}),za=d.extend({elicitationId:l()}),Ta=m.extend({method:S("notifications/elicitation/complete"),params:za}),xa=p.extend({action:Q(["accept","decline","cancel"]),content:Zt((we)=>we===null?void 0:we,C(l(),A([l(),x(),j(),v(l())])).optional())}),ka=f({type:S("ref/resource"),uri:l()}),Ea=f({type:S("ref/prompt"),name:l()}),wa=s.extend({ref:A([Ea,ka]),argument:f({name:l(),value:l()}),context:f({arguments:C(l(),l()).optional()}).optional()}),Zo=u.extend({method:S("completion/complete"),params:wa}),Ia=p.extend({completion:H({values:v(l()).max(100),total:K(x().int()),hasMore:K(j())})}),Pa=f({uri:l().startsWith("file://"),name:l().optional(),_meta:C(l(),Z()).optional()}),hn=u.extend({method:S("roots/list"),params:s.optional()}),Fo=p.extend({roots:v(Pa)}),Oa=m.extend({method:S("notifications/roots/list_changed"),params:d.optional()}),Ca=H({ttl:x().optional(),pollInterval:x().optional()}),Na=Q(["working","input_required","completed","failed","cancelled"]),Qt=f({taskId:l(),status:Na,ttl:A([x(),pt()]),createdAt:l(),lastUpdatedAt:l(),pollInterval:K(x()),statusMessage:K(l())}),Ke=p.extend({task:Qt}),ja=d.merge(Qt),Ar=m.extend({method:S("notifications/tasks/status"),params:ja}),gn=u.extend({method:S("tasks/get"),params:s.extend({taskId:l()})}),vn=p.merge(Qt),_n=u.extend({method:S("tasks/result"),params:s.extend({taskId:l()})}),Au=p.loose(),Je=Ye.extend({method:S("tasks/list")}),ye=je.extend({tasks:v(Qt)}),Mr=u.extend({method:S("tasks/cancel"),params:s.extend({taskId:l()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:o,TaskMetadataSchema:r,RelatedTaskMetadataSchema:i,RequestMetaSchema:a,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:d,NotificationSchema:m,ResultSchema:p,RequestIdSchema:h,EmptyResultSchema:b,CancelledNotificationParamsSchema:R,CancelledNotificationSchema:z,IconSchema:N,IconsSchema:B,BaseMetadataSchema:P,ImplementationSchema:O,ClientTasksCapabilitySchema:ee,ServerTasksCapabilitySchema:ne,ClientCapabilitiesSchema:ae,InitializeRequestParamsSchema:ce,InitializeRequestSchema:ue,ServerCapabilitiesSchema:Te,InitializeResultSchema:tt,InitializedNotificationSchema:Ne,PingRequestSchema:rt,ProgressSchema:vt,ProgressNotificationParamsSchema:Ze,ProgressNotificationSchema:nt,PaginatedRequestParamsSchema:_t,PaginatedRequestSchema:Ye,PaginatedResultSchema:je,ResourceContentsSchema:At,TextResourceContentsSchema:Mt,BlobResourceContentsSchema:ke,RoleSchema:Ae,AnnotationsSchema:Me,ResourceSchema:ut,ResourceTemplateSchema:kr,ListResourcesRequestSchema:Ge,ListResourcesResultSchema:We,ListResourceTemplatesRequestSchema:Fe,ListResourceTemplatesResultSchema:ot,ResourceRequestParamsSchema:it,ReadResourceRequestParamsSchema:yt,ReadResourceRequestSchema:bt,ReadResourceResultSchema:Gt,ResourceListChangedNotificationSchema:$t,SubscribeRequestParamsSchema:Er,SubscribeRequestSchema:q,UnsubscribeRequestParamsSchema:Rt,UnsubscribeRequestSchema:G,ResourceUpdatedNotificationParamsSchema:F,ResourceUpdatedNotificationSchema:oe,PromptArgumentSchema:L,PromptSchema:M,ListPromptsRequestSchema:X,ListPromptsResultSchema:W,GetPromptRequestParamsSchema:be,GetPromptRequestSchema:wr,TextContentSchema:zt,ImageContentSchema:Ir,AudioContentSchema:Pr,ToolUseContentSchema:vo,EmbeddedResourceSchema:Wt,ResourceLinkSchema:_o,ContentBlockSchema:at,PromptMessageSchema:cn,GetPromptResultSchema:ln,PromptListChangedNotificationSchema:Or,ToolAnnotationsSchema:So,ToolExecutionSchema:un,ToolSchema:Cr,ListToolsRequestSchema:dn,ListToolsResultSchema:mn,CallToolResultSchema:pn,CallToolRequestParamsSchema:Ee,CallToolRequestSchema:yo,ToolListChangedNotificationSchema:Sa,LoggingLevelSchema:fn,SetLevelRequestParamsSchema:bo,SetLevelRequestSchema:$o,LoggingMessageNotificationParamsSchema:Ro,LoggingMessageNotificationSchema:zo,ModelHintSchema:To,ModelPreferencesSchema:xo,ToolChoiceSchema:ko,ToolResultContentSchema:ya,SamplingContentSchema:Eo,SamplingMessageContentBlockSchema:Xt,SamplingMessageSchema:wo,CreateMessageRequestParamsSchema:Io,CreateMessageRequestSchema:Po,CreateMessageResultSchema:Oo,CreateMessageResultWithToolsSchema:Co,BooleanSchemaSchema:No,StringSchemaSchema:jo,NumberSchemaSchema:Ao,UntitledSingleSelectEnumSchemaSchema:Mo,TitledSingleSelectEnumSchemaSchema:Uo,LegacyTitledEnumSchemaSchema:qo,SingleSelectEnumSchemaSchema:Lo,UntitledMultiSelectEnumSchemaSchema:Nr,TitledMultiSelectEnumSchemaSchema:jr,MultiSelectEnumSchemaSchema:ba,EnumSchemaSchema:$a,PrimitiveSchemaDefinitionSchema:Xe,ElicitRequestFormParamsSchema:Qe,ElicitRequestURLParamsSchema:Do,ElicitRequestParamsSchema:dt,ElicitRequestSchema:Ra,ElicitationCompleteNotificationParamsSchema:za,ElicitationCompleteNotificationSchema:Ta,ElicitResultSchema:xa,ResourceTemplateReferenceSchema:ka,PromptReferenceSchema:Ea,CompleteRequestParamsSchema:wa,CompleteRequestSchema:Zo,CompleteResultSchema:Ia,RootSchema:Pa,ListRootsRequestSchema:hn,ListRootsResultSchema:Fo,RootsListChangedNotificationSchema:Oa,TaskCreationParamsSchema:Ca,TaskStatusSchema:Na,TaskSchema:Qt,CreateTaskResultSchema:Ke,TaskStatusNotificationParamsSchema:ja,TaskStatusNotificationSchema:Ar,GetTaskRequestSchema:gn,GetTaskResultSchema:vn,GetTaskPayloadRequestSchema:_n,GetTaskPayloadResultSchema:Au,ListTasksRequestSchema:Je,ListTasksResultSchema:ye,CancelTaskRequestSchema:Mr,CancelTaskResultSchema:p.merge(Qt),ClientRequestSchema:A([rt,ue,Zo,$o,wr,X,Ge,Fe,bt,q,G,yo,dn,gn,_n,Je,Mr]),ClientNotificationSchema:A([z,nt,Ne,Oa,Ar]),ClientResultSchema:A([b,Oo,Co,xa,Fo,vn,ye,Ke]),ServerRequestSchema:A([rt,Po,Ra,hn,gn,_n,Je,Mr]),ServerNotificationSchema:A([z,nt,zo,oe,$t,Sa,Or,Ar,Ta]),ServerResultSchema:A([b,tt,Ia,ln,W,We,ot,Gt,pn,mn,vn,ye,Ke]),CallToolResultWireSchema:Z().superRefine((we,vR)=>{if(typeof we!=="object"||we===null||Array.isArray(we)||we.content!==void 0)return;for(let p_ of rb)if(p_ in we){vR.addIssue({code:"custom",message:`content is required when the body carries '${p_}' — another result family cannot default into an empty tools/call success`});return}}).transform(fv).pipe(pn)}}var vx;function nb(){return vx??=gx()}function ob(e){return e.type!=="object"}var _x=new Set(["const","enum","default","examples"]),Sx=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Uy(e){return e!==void 0&&!(typeof e==="string"&&e.startsWith("#"))}function yx(e){let t=typeof e.$schema==="string"?e.$schema:void 0;if(Uy(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let n=S_(e.$schema)&&e.$recursiveAnchor!==!0,o=(r,i)=>{if(Array.isArray(r))return r.map((c)=>o(c,!1));if(r===null||typeof r!=="object")return r;if(!i&&Uy(r.$id))return r;let a={},s=!1;for(let[c,u]of Object.entries(r))if(i)a[c]=o(u,!1);else if((c==="$ref"||c==="$dynamicRef")&&typeof u==="string")a[c]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u;else if(c==="$recursiveRef"&&u==="#"&&n)s=!0;else if(_x.has(c))a[c]=u;else if(Sx.has(c))a[c]=o(u,!0);else a[c]=o(u,!1);if(s)if("$ref"in a)a.allOf=[...Array.isArray(a.allOf)?a.allOf:[],{$ref:"#/properties/result"}];else a.$ref="#/properties/result";return a};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var ib={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},ab={"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},bx={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},cu;function hv(){if(cu)return cu;let e=nb();return cu={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},cu}function sb(e){return Object.prototype.hasOwnProperty.call(ib,e)}function cb(e){return Object.prototype.hasOwnProperty.call(ab,e)}function $x(e){return Object.prototype.hasOwnProperty.call(bx,e)}function Rx(e){return $x(e)?hv().resultSchemas[e]:void 0}function zx(e){return sb(e)?hv().requestSchemas[e]:void 0}function Tx(e){return cb(e)?hv().notificationSchemas[e]:void 0}var gO=Object.keys(ib),vO=Object.keys(ab);function lv(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function lu(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:"invalid",message:String(n.error)}}var qy={ok:!1,reason:"not-in-era"};function Ly(e){return lv(e)&&lv(e.outputSchema)&&ob(e.outputSchema)}function Dy(e){return e}var gv={era:"2025-11-25",hasRequestMethod:sb,hasNotificationMethod:cb,validateRequest:(e,t)=>lu(zx(e),t),validateResult:(e,t)=>lu(Rx(e),t),validateNotification:(e,t)=>lu(Tx(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>qy,validateInputResponse:()=>qy,samplingResultVariant:(e,t)=>{let n=nb();return lu(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let n=tb(e),o=n.structuredContent;if(o===void 0)return n;let r=typeof o!=="object"||o===null||Array.isArray(o),i=t!==void 0&&ob(t);if(!r&&!i)return n;return{...n,structuredContent:{result:o}}},decodeResult(e,t){if(lv(t)&&"resultType"in t){let n={...t};return delete n.resultType,{kind:"complete",result:Dy(n)}}return{kind:"complete",result:Dy(t)}},encodeResult(e,t){if(e!=="tools/list")return t;let n=t.tools;if(!Array.isArray(n)||!n.some((o)=>Ly(o)))return t;return{...t,tools:n.map((o)=>Ly(o)?{...o,outputSchema:yx(o.outputSchema)}:o)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function xx(){let e=mr(()=>A([l(),x(),j(),pt(),C(l(),e),v(e)])),t=C(l(),e),n=A([l(),x().int()]),o=l(),r=A([l(),x().int()]),i=Q(["user","assistant"]),a=Q(["debug","info","notice","warning","error","critical","alert","emergency"]),s=l().refine((ye)=>{try{return atob(ye),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=f({ttl:x().optional()}),u=f({taskId:l()}),d=H({progressToken:n.optional(),"io.modelcontextprotocol/related-task":u.optional()}),m=f({_meta:d.optional()}),p=m.extend({task:c.optional()}),h=f({_meta:d.optional()}),b=f({method:l(),params:h.loose().optional()}),R=f({src:l(),mimeType:l().optional(),sizes:v(l()).optional(),theme:Q(["light","dark"]).optional()}),z=f({icons:v(R).optional()}),N=f({name:l(),title:l().optional()}),B=N.extend({...N.shape,...z.shape,version:l(),websiteUrl:l().optional(),description:l().optional()}),P=ft(f({applyDefaults:j().optional()}),t),O=Zt((ye)=>{if(ye&&typeof ye==="object"&&!Array.isArray(ye)&&Object.keys(ye).length===0)return{form:{}};return ye},ft(f({form:P.optional(),url:t.optional()}),t.optional())),J=H({list:t.optional(),cancel:t.optional(),requests:H({sampling:H({createMessage:t.optional()}).optional(),elicitation:H({create:t.optional()}).optional()}).optional()}),Y=H({list:t.optional(),cancel:t.optional(),requests:H({tools:H({call:t.optional()}).optional()}).optional()}),ee=f({experimental:C(l(),t).optional(),sampling:f({context:t.optional(),tools:t.optional()}).optional(),elicitation:O.optional(),roots:f({listChanged:j().optional()}).optional(),tasks:J.optional(),extensions:C(l(),t).optional()}),ne=f({experimental:C(l(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:f({listChanged:j().optional()}).optional(),resources:f({subscribe:j().optional(),listChanged:j().optional()}).optional(),tools:f({listChanged:j().optional()}).optional(),tasks:Y.optional(),extensions:C(l(),t).optional()}),ae=f({progress:x(),total:K(x()),message:K(l())}),ce=f({...h.shape,...ae.shape,progressToken:n}),ue=b.extend({method:S("notifications/progress"),params:ce}),Te=h.extend({level:a,logger:l().optional(),data:Z()}),tt=b.extend({method:S("notifications/message"),params:Te}),Ne=f({uri:l(),mimeType:K(l()),_meta:C(l(),Z()).optional()}),rt=Ne.extend({text:l()}),vt=Ne.extend({blob:s}),Ze=f({audience:v(i).optional(),priority:x().min(0).max(1).optional(),lastModified:Hr({offset:!0}).optional()}),nt=f({...N.shape,...z.shape,uri:l(),description:K(l()),mimeType:K(l()),size:K(x()),annotations:Ze.optional(),_meta:K(H({}))}),_t=f({...N.shape,...z.shape,uriTemplate:l(),description:K(l()),mimeType:K(l()),annotations:Ze.optional(),_meta:K(H({}))}),Ye=b.extend({method:S("notifications/resources/list_changed"),params:h.optional()}),je=h.extend({uri:l()}),At=b.extend({method:S("notifications/resources/updated"),params:je}),Mt=f({name:l(),description:K(l()),required:K(j())}),St=f({...N.shape,...z.shape,description:K(l()),arguments:K(v(Mt)),_meta:K(H({}))}),ke=b.extend({method:S("notifications/prompts/list_changed"),params:h.optional()}),Ae=f({type:S("text"),text:l(),annotations:Ze.optional(),_meta:C(l(),Z()).optional()}),Me=f({type:S("image"),data:s,mimeType:l(),annotations:Ze.optional(),_meta:C(l(),Z()).optional()}),ut=f({type:S("audio"),data:s,mimeType:l(),annotations:Ze.optional(),_meta:C(l(),Z()).optional()}),kr=f({type:S("tool_use"),name:l(),id:l(),input:C(l(),Z()),_meta:C(l(),Z()).optional()}),Ge=f({type:S("resource"),resource:A([rt,vt]),annotations:Ze.optional(),_meta:C(l(),Z()).optional()}),We=nt.extend({type:S("resource_link")}),Fe=A([Ae,Me,ut,We,Ge]),ot=f({role:i,content:Fe}),it=f({title:l().optional(),readOnlyHint:j().optional(),destructiveHint:j().optional(),idempotentHint:j().optional(),openWorldHint:j().optional()}),yt=b.extend({method:S("notifications/tools/list_changed"),params:h.optional()}),bt=f({name:l().optional()}),Gt=f({hints:v(bt).optional(),costPriority:x().min(0).max(1).optional(),speedPriority:x().min(0).max(1).optional(),intelligencePriority:x().min(0).max(1).optional()}),$t=f({mode:Q(["auto","required","none"]).optional()}),Er=f({type:S("boolean"),title:l().optional(),description:l().optional(),default:j().optional()}),q=f({type:S("string"),title:l().optional(),description:l().optional(),minLength:x().optional(),maxLength:x().optional(),format:Q(["email","uri","date","date-time"]).optional(),default:l().optional()}),Rt=f({type:Q(["number","integer"]),title:l().optional(),description:l().optional(),minimum:x().optional(),maximum:x().optional(),default:x().optional()}),G=f({type:S("string"),title:l().optional(),description:l().optional(),enum:v(l()),default:l().optional()}),F=f({type:S("string"),title:l().optional(),description:l().optional(),oneOf:v(f({const:l(),title:l()})),default:l().optional()}),oe=f({type:S("string"),title:l().optional(),description:l().optional(),enum:v(l()),enumNames:v(l()).optional(),default:l().optional()}),L=A([G,F]),M=f({type:S("array"),title:l().optional(),description:l().optional(),minItems:x().optional(),maxItems:x().optional(),items:f({type:S("string"),enum:v(l())}),default:v(l()).optional()}),X=f({type:S("array"),title:l().optional(),description:l().optional(),minItems:x().optional(),maxItems:x().optional(),items:f({anyOf:v(f({const:l(),title:l()}))}),default:v(l()).optional()}),W=A([M,X]),be=A([oe,L,W]),wr=A([be,Er,q,Rt]),zt=p.extend({mode:S("form").optional(),message:l(),requestedSchema:f({type:S("object"),properties:C(l(),wr),required:v(l()).optional()}).catchall(Z())}),Ir=f({type:S("ref/resource"),uri:l()}),Pr=f({type:S("ref/prompt"),name:l()}),vo=f({uri:l().startsWith("file://"),name:l().optional(),_meta:C(l(),Z()).optional()}),Wt=ee.shape,_o=f({experimental:Wt.experimental,sampling:Wt.sampling,elicitation:Wt.elicitation,roots:Wt.roots,extensions:Wt.extensions}),at=ne.shape,cn=f({experimental:at.experimental,logging:at.logging,completions:at.completions,prompts:at.prompts,resources:at.resources,tools:at.tools,extensions:at.extensions}),ln=H({progressToken:n.optional(),[ct]:l(),[Xr]:B.optional(),[Ot]:_o,[fr]:a.optional()}),Or=f({...N.shape,...z.shape,description:l().optional(),inputSchema:H({$schema:l().optional(),type:S("object")}),outputSchema:H({$schema:l().optional()}).optional(),annotations:it.optional(),_meta:C(l(),Z()).optional()}),So=f({type:S("tool_result"),toolUseId:l(),content:v(Fe),structuredContent:Z().optional(),isError:j().optional(),_meta:C(l(),Z()).optional()}),un=A([Ae,Me,ut,kr,So]),Cr=f({role:i,content:A([un,v(un)]),_meta:C(l(),Z()).optional()}),dn=l(),mn=H({[Pt]:B.optional().catch(void 0)}),pn=mn.optional();function Ee(ye){return H({_meta:pn,resultType:dn.default("complete"),...ye})}let yo=Ee({}),Sa=Ee({nextCursor:o.optional()}),fn=Ee({content:v(Fe),structuredContent:Z().optional(),isError:j().optional()}),bo=Ee({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),tools:v(Or),nextCursor:o.optional()}),$o=Ee({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),prompts:v(St),nextCursor:o.optional()}),Ro=Ee({description:l().optional(),messages:v(ot)}),zo=Ee({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),resources:v(nt),nextCursor:o.optional()}),To=Ee({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),resourceTemplates:v(_t),nextCursor:o.optional()}),xo=Ee({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),contents:v(A([rt,vt]))}),ko=Ee({completion:f({values:v(l()).max(100),total:x().int().optional(),hasMore:j().optional()}).loose()}),ya=Ee({ttlMs:x().int().min(0),cacheScope:Q(["public","private"])}),Eo=Ee({ttlMs:x().int().min(0).catch(0),cacheScope:Q(["public","private"]).catch("private"),supportedVersions:v(l()),capabilities:cn,instructions:l().optional()}),Xt=f({messages:v(Cr),modelPreferences:Gt.optional(),systemPrompt:l().optional(),includeContext:Q(["none","thisServer","allServers"]).optional(),temperature:x().optional(),maxTokens:x().int(),stopSequences:v(l()).optional(),metadata:t.optional(),tools:v(Or).optional(),toolChoice:$t.optional()}),wo=f({method:S("sampling/createMessage"),params:Xt}),Io=f({method:S("roots/list"),params:f({_meta:C(l(),Z()).optional()}).optional()}),Po=f({...Cr.shape,model:l(),stopReason:l().optional()}),Oo=f({roots:v(vo)}),Co=f({action:Q(["accept","decline","cancel"]),content:C(l(),A([l(),x(),j(),v(l())])).optional()}),No=f({mode:S("url"),message:l(),url:l().url()}),jo=A([zt,No]),Ao=f({method:S("elicitation/create"),params:jo}),Mo=A([wo,Io,Ao]),Uo=A([Po,Oo,Co]),qo=C(l(),Mo),Lo=C(l(),Uo),Nr=Ee({inputRequests:qo.optional(),requestState:l().optional()}),jr={inputResponses:Lo.optional(),requestState:l().optional()},ba=f({_meta:ln,...jr}),$a=H({progressToken:n.optional()});function Xe(ye,Mr){return f({method:S(ye),params:f({_meta:ln,...Mr})})}function Qe(ye,Mr){return f({method:S(ye),params:f({_meta:$a.optional(),...Mr}).optional()})}let Do={name:l(),arguments:C(l(),Z()).optional(),...jr},dt={cursor:o.optional()},Ra=Xe("tools/call",Do),za=Xe("tools/list",dt),Ta=Xe("prompts/list",dt),xa=Xe("prompts/get",{name:l(),arguments:C(l(),l()).optional(),...jr}),ka=Xe("resources/list",dt),Ea=Xe("resources/templates/list",dt),wa=Xe("resources/read",{uri:l(),...jr}),Zo={ref:A([Pr,Ir]),argument:f({name:l(),value:l()}),context:f({arguments:C(l(),l()).optional()}).optional()},Ia=Xe("completion/complete",Zo),Pa=Xe("server/discover",{}),hn=f({toolsListChanged:j().optional(),promptsListChanged:j().optional(),resourcesListChanged:j().optional(),resourceSubscriptions:v(l()).optional()}),Fo={notifications:hn},Oa=Xe("subscriptions/listen",Fo),Ca=mn.extend({"io.modelcontextprotocol/subscriptionId":r}),Na=H({_meta:Ca,resultType:dn.default("complete")}),Qt={"tools/call":Qe("tools/call",Do),"tools/list":Qe("tools/list",dt),"prompts/get":Qe("prompts/get",{name:l(),arguments:C(l(),l()).optional()}),"prompts/list":Qe("prompts/list",dt),"resources/list":Qe("resources/list",dt),"resources/templates/list":Qe("resources/templates/list",dt),"resources/read":Qe("resources/read",{uri:l()}),"completion/complete":Qe("completion/complete",Zo),"server/discover":Qe("server/discover",{}),"subscriptions/listen":Qe("subscriptions/listen",Fo)};function Ke(ye){return H({_meta:pn,...ye})}let ja={"tools/call":Ke({content:v(Fe),structuredContent:Z().optional(),isError:j().optional()}),"tools/list":Ke({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),tools:v(Or),nextCursor:o.optional()}),"prompts/get":Ke({description:l().optional(),messages:v(ot)}),"prompts/list":Ke({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),prompts:v(St),nextCursor:o.optional()}),"resources/list":Ke({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),resources:v(nt),nextCursor:o.optional()}),"resources/templates/list":Ke({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),resourceTemplates:v(_t),nextCursor:o.optional()}),"resources/read":Ke({ttlMs:x().int().min(0),cacheScope:Q(["public","private"]),contents:v(A([rt,vt]))}),"completion/complete":Ke({completion:f({values:v(l()).max(100),total:x().int().optional(),hasMore:j().optional()}).loose()}),"server/discover":Ke({ttlMs:x().int().min(0).catch(0),cacheScope:Q(["public","private"]).catch("private"),supportedVersions:v(l()),capabilities:cn,instructions:l().optional()}),"subscriptions/listen":Ke({})},Ar=H({"io.modelcontextprotocol/subscriptionId":r.optional()}),gn=f({method:S("notifications/subscriptions/acknowledged"),params:f({_meta:Ar.optional(),notifications:hn})}),vn=f({_meta:Ar.optional(),requestId:r,reason:l().optional()}),_n=f({method:S("notifications/cancelled"),params:vn}),Au={"notifications/cancelled":_n,"notifications/progress":ue,"notifications/message":tt,"notifications/resources/updated":At,"notifications/resources/list_changed":Ye,"notifications/tools/list_changed":yt,"notifications/prompts/list_changed":ke,"notifications/subscriptions/acknowledged":gn},Je=(ye)=>f({jsonrpc:S("2.0"),id:A([l(),x().int()]),result:ye}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:o,RequestIdSchema:r,RoleSchema:i,LoggingLevelSchema:a,TaskMetadataSchema:c,RelatedTaskMetadataSchema:u,RequestMetaSchema:d,BaseRequestParamsSchema:m,TaskAugmentedRequestParamsSchema:p,NotificationsParamsSchema:h,NotificationSchema:b,IconSchema:R,IconsSchema:z,BaseMetadataSchema:N,ImplementationSchema:B,ClientTasksCapabilitySchema:J,ServerTasksCapabilitySchema:Y,ClientCapabilitiesSchema:ee,ServerCapabilitiesSchema:ne,ProgressSchema:ae,ProgressNotificationParamsSchema:ce,ProgressNotificationSchema:ue,LoggingMessageNotificationParamsSchema:Te,LoggingMessageNotificationSchema:tt,ResourceContentsSchema:Ne,TextResourceContentsSchema:rt,BlobResourceContentsSchema:vt,AnnotationsSchema:Ze,ResourceSchema:nt,ResourceTemplateSchema:_t,ResourceListChangedNotificationSchema:Ye,ResourceUpdatedNotificationParamsSchema:je,ResourceUpdatedNotificationSchema:At,PromptArgumentSchema:Mt,PromptSchema:St,PromptListChangedNotificationSchema:ke,TextContentSchema:Ae,ImageContentSchema:Me,AudioContentSchema:ut,ToolUseContentSchema:kr,EmbeddedResourceSchema:Ge,ResourceLinkSchema:We,ContentBlockSchema:Fe,PromptMessageSchema:ot,ToolAnnotationsSchema:it,ToolListChangedNotificationSchema:yt,ModelHintSchema:bt,ModelPreferencesSchema:Gt,ToolChoiceSchema:$t,BooleanSchemaSchema:Er,StringSchemaSchema:q,NumberSchemaSchema:Rt,UntitledSingleSelectEnumSchemaSchema:G,TitledSingleSelectEnumSchemaSchema:F,LegacyTitledEnumSchemaSchema:oe,SingleSelectEnumSchemaSchema:L,UntitledMultiSelectEnumSchemaSchema:M,TitledMultiSelectEnumSchemaSchema:X,MultiSelectEnumSchemaSchema:W,EnumSchemaSchema:be,PrimitiveSchemaDefinitionSchema:wr,ElicitRequestFormParamsSchema:zt,ResourceTemplateReferenceSchema:Ir,PromptReferenceSchema:Pr,RootSchema:vo,ClientCapabilities2026Schema:_o,ServerCapabilities2026Schema:cn,RequestMetaEnvelopeSchema:ln,ToolSchema:Or,ToolResultContentSchema:So,SamplingMessageContentBlockSchema:un,SamplingMessageSchema:Cr,ResultTypeSchema:dn,ResultMetaSchema:mn,ResultSchema:yo,PaginatedResultSchema:Sa,CallToolResultSchema:fn,ListToolsResultSchema:bo,ListPromptsResultSchema:$o,GetPromptResultSchema:Ro,ListResourcesResultSchema:zo,ListResourceTemplatesResultSchema:To,ReadResourceResultSchema:xo,CompleteResultSchema:ko,CacheableResultSchema:ya,DiscoverResultSchema:Eo,CreateMessageRequestParamsSchema:Xt,CreateMessageRequestSchema:wo,ListRootsRequestSchema:Io,CreateMessageResultSchema:Po,ListRootsResultSchema:Oo,ElicitResultSchema:Co,ElicitRequestURLParamsSchema:No,ElicitRequestParamsSchema:jo,ElicitRequestSchema:Ao,InputRequestSchema:Mo,InputResponseSchema:Uo,InputRequestsSchema:qo,InputResponsesSchema:Lo,InputRequiredResultSchema:Nr,InputResponseRequestParamsSchema:ba,CallToolRequestSchema:Ra,ListToolsRequestSchema:za,ListPromptsRequestSchema:Ta,GetPromptRequestSchema:xa,ListResourcesRequestSchema:ka,ListResourceTemplatesRequestSchema:Ea,ReadResourceRequestSchema:wa,CompleteRequestSchema:Ia,DiscoverRequestSchema:Pa,SubscriptionFilterSchema:hn,SubscriptionsListenRequestSchema:Oa,SubscriptionsListenResultMetaSchema:Ca,SubscriptionsListenResultSchema:Na,dispatchRequestSchemas:Qt,dispatchResultSchemas:ja,NotificationMetaSchema:Ar,SubscriptionsAcknowledgedNotificationSchema:gn,CancelledNotificationParamsSchema:vn,CancelledNotificationSchema:_n,notificationSchemas2026:Au,JSONRPCResultResponseSchema:Je(yo),CallToolResultResponseSchema:Je(A([fn,Nr])),ListToolsResultResponseSchema:Je(bo),ListPromptsResultResponseSchema:Je($o),GetPromptResultResponseSchema:Je(A([Ro,Nr])),ListResourcesResultResponseSchema:Je(zo),ListResourceTemplatesResultResponseSchema:Je(To),ReadResourceResultResponseSchema:Je(A([xo,Nr])),CompleteResultResponseSchema:Je(ko),DiscoverResultResponseSchema:Je(Eo)}}var kx;function nn(){return kx??=xx()}var Ex=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function wx(e){return Ex.includes(e)}var co=Symbol("modelcontextprotocol.resultCacheHintFallback");function hu(e,t){if(t===void 0)return e;let n=e[co];if(n===void 0)return{...e,[co]:t};let o={},r=n.ttlMs??t.ttlMs;if(r!==void 0)o.ttlMs=r;let i=n.cacheScope??t.cacheScope;if(i!==void 0)o.cacheScope=i;return{...e,[co]:o}}function Ix(e){return e[co]}function vv(e){return typeof e==="number"&&Number.isSafeInteger(e)&&e>=0}function _v(e){return e==="public"||e==="private"}function Sv(e,t){if(e.ttlMs!==void 0&&!vv(e.ttlMs))throw RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!_v(e.cacheScope))throw RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var I=function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e}({}),D=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return uo(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return uo(this,t)}constructor(t,n,o){super(n);this.code=t,this.data=o,this.name="ProtocolError",mv(this,new.target)}static fromError(t,n,o){if(t===I.UrlElicitationRequired&&o){let r=o;if(r.elicitations)return new lb(r.elicitations,n)}if(t===I.UnsupportedProtocolVersion&&o){let r=o;if(Array.isArray(r.supported)&&typeof r.requested==="string")return new vu({supported:r.supported,requested:r.requested},n)}if(t===I.InvalidParams||t===I.ResourceNotFound){let r=o;if(typeof r?.uri==="string"&&(t===I.ResourceNotFound||Object.keys(r).length===1))return new gu(r.uri,n)}if(t===I.MissingRequiredClientCapability&&o){let r=o;if(r.requiredCapabilities!==null&&typeof r.requiredCapabilities==="object"&&!Array.isArray(r.requiredCapabilities))return new aa({requiredCapabilities:r.requiredCapabilities},n)}return new e(t,n,o)}},gu=class extends D{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(I.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},lb=class extends D{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(I.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},vu=class extends D{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(I.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},aa=class extends D{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(I.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Px=0,Ox="private",Cx=["tools/call","prompts/get","resources/read"];function Nx(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:"complete"};if(n==="complete")return t;if(Cx.includes(e))return t;throw new D(I.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function jx(e,t){let n=Ix(t);if(t.resultType!=="complete"||!wx(e))return n===void 0?t:Lx(t);let o=t,r=vv(o.ttlMs)?o.ttlMs:Ux(n),i=_v(o.cacheScope)?o.cacheScope:qx(n),a={...o,ttlMs:r,cacheScope:i};return delete a[co],a}function Ax(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Mx(e,t){if(t===void 0)return e;let n=e._meta;if(n===void 0)return{...e,_meta:{[Pt]:t}};if(!Ax(n))return e;if(n[Pt]!==void 0)return e;return{...e,_meta:{...n,[Pt]:t}}}function Ux(e){return e!==void 0&&vv(e.ttlMs)?e.ttlMs:Px}function qx(e){return e!==void 0&&_v(e.cacheScope)?e.cacheScope:Ox}function Lx(e){let t={...e};return delete t[co],t}var Dx=["elicitation/create","sampling/createMessage","roots/list"],uu;function ub(){if(uu)return uu;let e=nn();return uu={request:{"elicitation/create":f({method:S("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":f({method:S("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":f({method:S("roots/list"),params:H({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},uu}function db(e){return Dx.includes(e)}function ov(e){return db(e)?ub().request[e]:void 0}function Zx(e){return db(e)?ub().response[e]:void 0}var yv={"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},mb={"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 pb(e){return Object.prototype.hasOwnProperty.call(yv,e)}function fb(e){return Object.prototype.hasOwnProperty.call(mb,e)}function Fx(e){return Object.prototype.hasOwnProperty.call(yv,e)}function Kx(e){return pb(e)?nn().dispatchRequestSchemas[e]:void 0}function Jx(e){return Fx(e)?nn().dispatchResultSchemas[e]:void 0}function Vx(e){return fb(e)?nn().notificationSchemas2026[e]:void 0}var _O=Object.keys(yv),SO=Object.keys(mb);function ta(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Qi(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:"invalid",message:String(n.error)}}var Bx={ok:!1,reason:"not-in-era"},Hx=[ct,Ot];function Yx(e,t){let n=t,o=!1,r=()=>{if(!o)n={...n},o=!0;return n},i=t.tools;if(e==="tools/list"&&Array.isArray(i)&&i.some((s)=>ta(s)&&("execution"in s)))r().tools=i.map((s)=>{if(!ta(s)||!("execution"in s))return s;let c={...s};return delete c.execution,c});let a=t.capabilities;if(ta(a)&&"tasks"in a){let s={...a};delete s.tasks,r().capabilities=s}return n}var bv={era:"2026-07-28",hasRequestMethod:pb,hasNotificationMethod:fb,hasInputRequestMethod:(e)=>ov(e)!==void 0,validateRequest:(e,t)=>Qi(Kx(e),t),validateResult:(e,t)=>Qi(Jx(e),t),validateNotification:(e,t)=>Qi(Vx(e),t),validateInputRequest:(e,t)=>Qi(ov(e),t),validateInputResponse:(e,t)=>Qi(Zx(e),t),samplingResultVariant:()=>Bx,outboundEnvelope(e){return{[ct]:e.protocolVersion,[Xr]:e.clientInfo,[Ot]:e.clientCapabilities,...e.logLevel!==void 0&&{[fr]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of Hx)if(!(o in e))t.push({key:o,problem:"missing"});let n=nn().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let o of n.error.issues){let r=o.path.map(String),i=r.length>0?r.join("."):"_meta";if(r.length===1&&t.some((a)=>a.key===i&&a.problem==="missing"))continue;t.push({key:i,problem:o.message})}return t},projectCallToolResult:(e)=>tb(e),inputRequestSchema:ov,decodeResult(e,t){if(!ta(t))return{kind:"invalid",error:new te(ie.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:"invalid",error:new te(ie.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof n!=="string")return{kind:"invalid",error:new te(ie.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n==="input_required"){let a=t.inputRequests,s=ta(a)?a:{},c=t.requestState;if(Object.keys(s).length===0&&typeof c!=="string")return{kind:"invalid",error:new te(ie.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})};return{kind:"input_required",inputRequests:s,...typeof c==="string"&&{requestState:c}}}if(n!=="complete")return{kind:"invalid",error:new te(ie.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let o=Gx(),r=Object.hasOwn(o,e)?o[e]:void 0;if(r!==void 0){let a=r.safeParse(t);if(!a.success)return{kind:"invalid",error:new te(ie.InvalidResult,`Invalid result for ${e}: ${a.error}`,{method:e})}}let i={...t};return delete i.resultType,{kind:"complete",result:i}},encodeResult(e,t,n){return Mx(jx(e,Nx(e,Yx(e,t))),n)},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=nn().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map((n)=>n.message).join("; ")}`}},du;function Gx(){if(du)return du;let e=nn();return du={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},du}var sa="2026-07-28";function $r(e){return e!==void 0&&Vt(e)?bv:gv}function Zy(e){if(e.revision!==void 0)return $r(e.revision).era;return e.era==="modern"?bv.era:gv.era}function iv(e){return hb.some((t)=>t.hasRequestMethod(e))}function av(e){return hb.some((t)=>t.hasNotificationMethod(e))}var hb=[gv,bv];function Fy(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Rr(e){if(!Fy(e))return;let t=e._meta;return Fy(t)?t:void 0}function _u(e){let t=Rr(e);return t!==void 0&&ct in t}function $v(e){let t=Rr(e)?.[ct];return typeof t==="string"?t:void 0}function pu(e){return $r(sa).validateEnvelopeMeta(e)}var Wx=g_({AnnotationsSchema:()=>Kt,AudioContentSchema:()=>ro,BaseMetadataSchema:()=>Ft,BaseRequestParamsSchema:()=>ze,BlobResourceContentsSchema:()=>Di,BooleanSchemaSchema:()=>Vi,CallToolRequestParamsSchema:()=>bl,CallToolRequestSchema:()=>$l,CallToolResultSchema:()=>Ji,CancelTaskRequestSchema:()=>Zg,CancelTaskResultSchema:()=>Fg,CancelledNotificationParamsSchema:()=>Tc,CancelledNotificationSchema:()=>Ni,ClientCapabilitiesSchema:()=>wc,ClientNotificationSchema:()=>Jg,ClientRequestSchema:()=>Kg,ClientResultSchema:()=>Vg,ClientTasksCapabilitySchema:()=>kc,CompatibilityCallToolResultSchema:()=>Pg,CompleteRequestParamsSchema:()=>Yl,CompleteRequestSchema:()=>Gl,CompleteResultSchema:()=>Wl,ContentBlockSchema:()=>no,CreateMessageRequestParamsSchema:()=>Nl,CreateMessageRequestSchema:()=>jl,CreateMessageResultSchema:()=>Al,CreateMessageResultWithToolsSchema:()=>Ml,CreateTaskResultSchema:()=>Ng,CursorSchema:()=>Ei,DiscoverRequestSchema:()=>Cc,DiscoverResultSchema:()=>Nc,ElicitRequestFormParamsSchema:()=>ao,ElicitRequestParamsSchema:()=>Zl,ElicitRequestSchema:()=>Fl,ElicitRequestURLParamsSchema:()=>Dl,ElicitResultSchema:()=>Vl,ElicitationCompleteNotificationParamsSchema:()=>Kl,ElicitationCompleteNotificationSchema:()=>Jl,EmbeddedResourceSchema:()=>ml,EmptyResultSchema:()=>Ci,EnumSchemaSchema:()=>Ll,GetPromptRequestParamsSchema:()=>ll,GetPromptRequestSchema:()=>ul,GetPromptResultSchema:()=>hl,GetTaskPayloadRequestSchema:()=>Ug,GetTaskPayloadResultSchema:()=>qg,GetTaskRequestSchema:()=>Ag,GetTaskResultSchema:()=>Mg,IconSchema:()=>xc,IconsSchema:()=>gr,ImageContentSchema:()=>to,ImplementationSchema:()=>Xn,InitializeRequestParamsSchema:()=>Ic,InitializeRequestSchema:()=>ji,InitializeResultSchema:()=>Pc,InitializedNotificationSchema:()=>Oc,JSONArraySchema:()=>Eg,JSONObjectSchema:()=>ve,JSONRPCErrorResponseSchema:()=>Gn,JSONRPCMessageSchema:()=>Wn,JSONRPCNotificationSchema:()=>Oi,JSONRPCRequestSchema:()=>Pi,JSONRPCResponseSchema:()=>wg,JSONRPCResultResponseSchema:()=>Yn,JSONValueSchema:()=>pr,LegacyTitledEnumSchemaSchema:()=>Yi,ListChangedOptionsBaseSchema:()=>Og,ListPromptsRequestSchema:()=>sl,ListPromptsResultSchema:()=>cl,ListResourceTemplatesRequestSchema:()=>Dc,ListResourceTemplatesResultSchema:()=>Zc,ListResourcesRequestSchema:()=>qc,ListResourcesResultSchema:()=>Lc,ListRootsRequestSchema:()=>Ql,ListRootsResultSchema:()=>eu,ListTasksRequestSchema:()=>Lg,ListTasksResultSchema:()=>Dg,ListToolsRequestSchema:()=>Sl,ListToolsResultSchema:()=>yl,LoggingLevelSchema:()=>yr,LoggingMessageNotificationParamsSchema:()=>xl,LoggingMessageNotificationSchema:()=>kl,ModelHintSchema:()=>El,ModelPreferencesSchema:()=>wl,MultiSelectEnumSchemaSchema:()=>ql,NotificationSchema:()=>Oe,NotificationsParamsSchema:()=>Pe,NumberSchemaSchema:()=>io,PaginatedRequestParamsSchema:()=>Mc,PaginatedRequestSchema:()=>vr,PaginatedResultSchema:()=>_r,PingRequestSchema:()=>Mi,PrimitiveSchemaDefinitionSchema:()=>Xi,ProgressNotificationParamsSchema:()=>Ac,ProgressNotificationSchema:()=>Ui,ProgressSchema:()=>jc,ProgressTokenSchema:()=>ki,PromptArgumentSchema:()=>il,PromptListChangedNotificationSchema:()=>gl,PromptMessageSchema:()=>fl,PromptReferenceSchema:()=>Hl,PromptSchema:()=>al,ReadResourceRequestParamsSchema:()=>Fc,ReadResourceRequestSchema:()=>Kc,ReadResourceResultSchema:()=>Jc,RelatedTaskMetadataSchema:()=>zc,RequestIdSchema:()=>hr,RequestMetaSchema:()=>wi,RequestSchema:()=>_e,ResourceContentsSchema:()=>qi,ResourceLinkSchema:()=>pl,ResourceListChangedNotificationSchema:()=>Vc,ResourceRequestParamsSchema:()=>Qn,ResourceSchema:()=>Zi,ResourceTemplateReferenceSchema:()=>Bl,ResourceTemplateSchema:()=>Uc,ResourceUpdatedNotificationParamsSchema:()=>nl,ResourceUpdatedNotificationSchema:()=>ol,ResultMetaObjectSchema:()=>Ii,ResultSchema:()=>Se,RoleSchema:()=>Sr,RootSchema:()=>Xl,RootsListChangedNotificationSchema:()=>tu,SamplingContentSchema:()=>Ol,SamplingMessageContentBlockSchema:()=>Gr,SamplingMessageSchema:()=>Cl,ServerCapabilitiesSchema:()=>Ai,ServerNotificationSchema:()=>Hg,ServerRequestSchema:()=>Bg,ServerResultSchema:()=>Yg,ServerTasksCapabilitySchema:()=>Ec,SetLevelRequestParamsSchema:()=>zl,SetLevelRequestSchema:()=>Tl,SingleSelectEnumSchemaSchema:()=>Ul,StringSchemaSchema:()=>oo,SubscribeRequestParamsSchema:()=>Bc,SubscribeRequestSchema:()=>Hc,SubscriptionFilterSchema:()=>Fi,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Qc,SubscriptionsAcknowledgedNotificationSchema:()=>el,SubscriptionsListenRequestParamsSchema:()=>Wc,SubscriptionsListenRequestSchema:()=>Xc,SubscriptionsListenResultMetaSchema:()=>tl,SubscriptionsListenResultSchema:()=>rl,TaskAugmentedRequestParamsSchema:()=>tn,TaskCreationParamsSchema:()=>Cg,TaskMetadataSchema:()=>Rc,TaskSchema:()=>br,TaskStatusNotificationParamsSchema:()=>nu,TaskStatusNotificationSchema:()=>jg,TaskStatusSchema:()=>ru,TextContentSchema:()=>eo,TextResourceContentsSchema:()=>Li,TitledMultiSelectEnumSchemaSchema:()=>Wi,TitledSingleSelectEnumSchemaSchema:()=>Hi,ToolAnnotationsSchema:()=>vl,ToolChoiceSchema:()=>Il,ToolExecutionSchema:()=>_l,ToolListChangedNotificationSchema:()=>Rl,ToolResultContentSchema:()=>Pl,ToolSchema:()=>Ki,ToolUseContentSchema:()=>dl,UnsubscribeRequestParamsSchema:()=>Yc,UnsubscribeRequestSchema:()=>Gc,UntitledMultiSelectEnumSchemaSchema:()=>Gi,UntitledSingleSelectEnumSchemaSchema:()=>Bi});var Bt=(e)=>Pi.safeParse(e).success,Su=(e)=>Oi.safeParse(e).success,Jt=(e)=>Yn.safeParse(e).success,Ht=(e)=>Gn.safeParse(e).success;var Yt=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";var Rv=(e)=>ji.safeParse(e).success;function zv(e){if(e.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Tv(e){if(e.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var Xx="Mcp-Param-",Ky="x-mcp-header",Qx=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,ek=new Set(["string","integer","boolean","number"]);function yu(e){let t=[],n=new Map,o=(i,a,s)=>{if(i===null||typeof i!=="object")return;let c=i;if(Ky in c){if(!s||a.length===0)return`${so(a)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let d=c[Ky];if(typeof d!=="string"||d.length===0)return`${so(a)}: x-mcp-header MUST be a non-empty string`;if(!Qx.test(d))return`${so(a)}: x-mcp-header '${d}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let m=typeof c.type==="string"?c.type:void 0;if(m===void 0||!ek.has(m))return`${so(a)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${m??"<none>"}`;let p=d.toLowerCase(),h=n.get(p);if(h!==void 0)return`x-mcp-header '${d}' is not case-insensitively unique (also declared as '${h}')`;n.set(p,d),t.push({path:a,headerName:d,type:m})}let u=c.properties;if(u!==null&&typeof u==="object")for(let[d,m]of Object.entries(u)){let p=o(m,[...a,d],s);if(p!==void 0)return p}for(let d of tk){let m=c[d];if(m===void 0)continue;let p=Array.isArray(m)?m:m!==null&&typeof m==="object"&&rk.has(d)?Object.values(m):[m];for(let h of p){let b=o(h,[...a,`<${d}>`],!1);if(b!==void 0)return b}}},r=o(e,[],!0);return r===void 0?{valid:!0,declarations:t}:{valid:!1,reason:r}}var tk=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],rk=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function so(e){return e.length===0?"<root>":e.join(".")}var nk="=?base64?",ok="?=",ik=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,ak=/^-?\d+(\.\d+)?$/;function sk(e){if(typeof e==="string")return e;if(typeof e==="boolean")return e?"true":"false";if(typeof e==="number"){if(!Number.isFinite(e))return;if(Number.isInteger(e)&&!Number.isSafeInteger(e))return;return String(e)}}function ck(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.codePointAt(o);return new TextDecoder("utf-8",{fatal:!0}).decode(n)}function gb(e){if(!(e.startsWith(nk)&&e.endsWith(ok)))return e;let t=e.slice(9,e.length-2);if(!ik.test(t))return;try{return ck(t)}catch{return}}function lk(e,t){let n=e;for(let o of t){if(n===null||typeof n!=="object")return;n=n[o]}return n}function vb(e,t,n){for(let o of e){let r=`${Xx}${o.headerName}`,i=n.get(r),a=lk(t,o.path);if(a===void 0||a===null)continue;let s=sk(a);if(s===void 0)continue;if(i===null)return sv("param-header-missing",r,`the body carries ${so(o.path)}=${JSON.stringify(a)} but the ${r} header is absent`);let c=gb(i);if(c===void 0)return sv("param-header-invalid-encoding",r,`the ${r} header carries an invalid Base64 sentinel value`);if(!((o.type==="integer"||o.type==="number")&&ak.test(c)&&typeof a==="number"?Number(c)===a:c===s))return sv("param-header-mismatch",r,`the ${r} header decodes to ${JSON.stringify(c)} but the body carries ${so(o.path)}=${JSON.stringify(a)}`)}}function sv(e,t,n){return{kind:"reject",rung:"param-header-validation",cell:e,httpStatus:400,code:lo,message:`Bad Request: the request headers and body disagree: ${n}`,data:{mismatch:{header:t,body:n}},settled:!0}}var lo=-32020,yO=[{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:[lo,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:[lo],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[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:[lo],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."}],xv={[I.ParseError]:400,[I.InvalidRequest]:400,[I.MethodNotFound]:404,[I.UnsupportedProtocolVersion]:400,[I.MissingRequiredClientCapability]:400,[lo]:400};function _b(e,t){if(t==="in-band")return e===I.MissingRequiredClientCapability?400:200;return xv[e]??400}function lt(e,t,n,o,r){return{kind:"reject",rung:e,cell:t,httpStatus:n,code:o.code,message:o.message,...o.data!==void 0&&{data:o.data},settled:r}}function Ct(e,t,n,o="era-classification"){return lt(o,e,400,new D(lo,`Bad Request: the request headers and body disagree: ${n}`,{mismatch:{header:t,body:n}}),!0)}var Jy={"tools/call":"name","prompts/get":"name","resources/read":"uri"};function mu(e){let t=0;while(t<e.length){let o=e.codePointAt(t);if(o!==9&&o!==32)break;t+=1}let n=e.length;while(n>t){let o=e.codePointAt(n-1);if(o!==9&&o!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}function Sb(e,t){if(t.messageKind!=="request")return;let n=t.message.method;if(e.mcpMethodHeader===void 0)return Ct("method-header-missing","(missing)",`the body names method ${n} but the required Mcp-Method header is absent`,"standard-header-validation");let o=Object.hasOwn(Jy,n)?Jy[n]:void 0;if(o===void 0)return;let r=t.message.params?.[o],i=typeof r==="string"?r:void 0;if(e.mcpNameHeader===void 0){if(i===void 0)return;return Ct("name-header-missing","(missing)",`the body carries params.${o}="${i}" but the required Mcp-Name header is absent`,"standard-header-validation")}let a=mu(e.mcpNameHeader),s=gb(a);if(s===void 0)return Ct("name-header-invalid-encoding",a,"the Mcp-Name header carries an invalid Base64 sentinel value","standard-header-validation");if(i!==void 0&&s!==i)return Ct("name-header-mismatch",a,`the body carries params.${o}="${i}" but the Mcp-Name header names "${s}"`,"standard-header-validation")}function fu(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function yb(e){if(e===void 0)return{era:"modern"};return{era:Vt(e)?"modern":"legacy",revision:e}}function uk(e){if(!_u(e))return!1;let t=$v(e);if(t===void 0||!Vt(t))return!1;let n=Rr(e);return n!==void 0&&pu(n).length===0}function dk(e){if(e.length===0)return lt("jsonrpc-shape","empty-batch",400,new D(I.InvalidRequest,"Bad Request: empty JSON-RPC batch"),!0);for(let t of e){if(_u(fu(t)?t.params:void 0))return lt("jsonrpc-shape","batch-with-modern-element",400,new D(I.InvalidRequest,"Bad Request: JSON-RPC batches may not contain requests for protocol revision 2026-07-28 or later"),!0);if(!(Bt(t)||Su(t)||Jt(t)||Ht(t)))return lt("jsonrpc-shape","batch-with-invalid-element",400,new D(I.InvalidRequest,"Bad Request: JSON-RPC batch contains an invalid message"),!0)}return{kind:"legacy",reason:"batch"}}function mk(e,t){let{params:n,method:o}=t,r=e.protocolVersionHeader,i=r!==void 0&&Vt(r);if(o==="initialize"&&!uk(n)){if(i)return Ct("initialize-with-modern-header",r,"an initialize request (legacy handshake) was sent with a modern MCP-Protocol-Version header");let a=fu(n)&&typeof n.protocolVersion==="string"?n.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...a!==void 0&&{requestedVersion:a}}}if(_u(n)){let a=Rr(n),s=(a===void 0?[]:pu(a))[0];if(s!==void 0)return lt("envelope","envelope-invalid",400,new D(I.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${s.key}: ${s.problem}`,{envelope:s}),!0);let c=$v(n);if(r!==void 0&&c!==void 0&&r!==c)return Ct("header-body-version-mismatch",r,`the body envelope names protocol version ${c} but the MCP-Protocol-Version header names ${r}`);if(e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Ct("method-header-mismatch",e.mcpMethodHeader,`the body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"request",message:t,classification:yb(c)}}if(i){let a=Rr(n),s=pu(a??{}).filter((u)=>u.problem==="missing").map((u)=>u.key),c=a===void 0?["_meta"]:s.length>0?s:[ct];return lt("envelope","modern-header-without-claim",400,new D(I.InvalidParams,`Invalid params: the MCP-Protocol-Version header names protocol revision ${r}, but the request is missing the required per-request envelope key(s): ${c.join(", ")}`,{envelope:{missing:c}}),!0)}return{kind:"legacy",reason:"no-claim",...r!==void 0&&{requestedVersion:r}}}function pk(e,t){let{params:n,method:o}=t,r=e.protocolVersionHeader,i=r!==void 0&&Vt(r);if(_u(n)){let a=$v(n);if(a===void 0){let c=Rr(n),u=(c===void 0?[]:pu(c)).find((d)=>d.key===ct)??{key:ct,problem:"expected a protocol version string"};return lt("envelope","notification-envelope-invalid",400,new D(I.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${u.key}: ${u.problem}`,{envelope:u}),!0)}if(r!==void 0&&r!==a)return Ct("notification-header-body-version-mismatch",r,`the notification envelope names protocol version ${a} but the MCP-Protocol-Version header names ${r}`);let s=yb(a);if(s.era==="modern"&&e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Ct("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"notification",message:t,classification:s}}if(i){if(e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Ct("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"notification",message:t,classification:{era:"modern",revision:r}}}return{kind:"legacy",reason:"notification",...r!==void 0&&{requestedVersion:r}}}function bb(e){if(e={...e,...e.protocolVersionHeader!==void 0&&{protocolVersionHeader:mu(e.protocolVersionHeader)},...e.mcpMethodHeader!==void 0&&{mcpMethodHeader:mu(e.mcpMethodHeader)},...e.mcpNameHeader!==void 0&&{mcpNameHeader:mu(e.mcpNameHeader)}},e.httpMethod.toUpperCase()!=="POST")return{kind:"legacy",reason:"http-method"};let t=e.body;if(Array.isArray(t))return dk(t);if(Jt(t)||Ht(t))return{kind:"legacy",reason:"response"};if(fu(t)&&Bt(t))return mk(e,t);if(fu(t)&&Su(t))return pk(e,t);return lt("jsonrpc-shape","invalid-json-rpc-body",400,new D(I.InvalidRequest,"Bad Request: the request body is not a valid JSON-RPC message"),!0)}function $b(e,t){switch(e.reason){case"http-method":return lt("http-method","modern-only-method-not-allowed",405,new D(-32000,"Method not allowed."),!0);case"batch":return lt("jsonrpc-shape","modern-only-batch-not-supported",400,new D(I.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return lt("jsonrpc-shape","modern-only-response-post",400,new D(I.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let n=e.requestedVersion;return lt("era-classification","modern-only-missing-envelope",400,n===void 0?new D(I.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...t]}):new vu({supported:[...t],requested:n}),!0)}}}function bu(e,t){return fi(e,t)}function ea(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function mo(e){if(e==null)return!1;let t=typeof e;if(t!=="object"&&t!=="function")return!1;if(!("~standard"in e))return!1;return typeof e["~standard"]?.validate==="function"}var Vy=!1,uv="draft-2020-12";function zr(e,t="input"){let n=e["~standard"],o;if(n.jsonSchema)o=n.jsonSchema[t]({target:uv});else if(n.vendor==="zod"){if(!("_zod"in e))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");if(!Vy)Vy=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.");o=Br(e,{target:uv,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output"){if(o.type!==void 0)return o;return Rb(o)?{type:"object",...o}:o}if(o.type!==void 0&&o.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}function Rb(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every((o)=>o!==null&&typeof o==="object"&&(o.type==="object"||Rb(o)))}return!1}function fk(e){if(!e.path?.length)return e.message;return`${e.path.map((t)=>String(typeof t==="object"?t.key:t)).join(".")}: ${e.message}`}async function rn(e,t){let n=await e["~standard"].validate(t);if(n.issues&&n.issues.length>0)return{success:!1,error:n.issues.map((o)=>fk(o)).join(", ")};return{success:!0,data:n.value}}function hk(e){let t=Br(e,{target:uv,io:"input"});return typeof t.pattern==="string"?t.pattern:void 0}var gk=/\\\.\\d\{(\d+)\}/;function vk(e){let t=gk.exec(e),n=[void 0,-1,0];if(t)n.push(Number(t[1]));return[!1,!0].flatMap((o)=>[!1,!0].flatMap((r)=>n.map((i)=>Hr({local:o,offset:r,precision:i}))))}function _k(e,t){let n;switch(e){case"email":n=[Xs()];break;case"uri":n=[Kn()];break;case"date":n=[Js()];break;case"date-time":n=vk(t);break}return new Set(n.map((o)=>hk(o)).filter((o)=>o!==void 0))}function Sk(e,t,n){if(n!=="zod")return!0;return _k(e,t).has(t)}function zb(e){let t=zr(e,"input"),n=t.properties||{},o=t.required||[];return Object.entries(n).map(([r,i])=>({name:r,description:i?.description,required:o.includes(r)}))}function na(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function yk(e){try{return zr(e,"input")}catch(t){let n=t instanceof Error?t.message:String(t);throw new D(I.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${n}`)}}var bk=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function kv(e){return bk.has(e)||e.startsWith("x-")}var $k=new Set(["$schema",...Object.keys(ao.shape.requestedSchema.shape)]),By={string:ea([oo,Bi,Hi,Yi]),number:ea([io]),integer:ea([io]),boolean:ea([Vi]),array:ea([Gi,Wi])},Rk=new Set(oo.shape.format.unwrap().options);function zk(e,t,n,o){if(!na(e))return e;let r=typeof e.type==="string"&&Object.hasOwn(By,e.type)?By[e.type]:void 0;if(r===void 0)return e;let i={};for(let[a,s]of Object.entries(e))if(r.has(a)||kv(a))i[a]=s;else if(a==="pattern"&&e.type==="string"&&typeof e.format==="string"){if(!Rk.has(e.format))i[a]=s;else if(typeof s!=="string"||!Sk(e.format,s,n))o.push(`${t}.${a}`)}else o.push(`${t}.${a}`);return i}function Tk(e,t){let n={},o=[];for(let[r,i]of Object.entries(e))if(r==="properties"&&na(i))n[r]=Object.fromEntries(Object.entries(i).map(([a,s])=>[a,zk(s,`properties.${a}`,t,o)]));else if($k.has(r))n[r]=i;else if(!kv(r))o.push(r);if(o.length>0)throw new D(I.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return n}function xk(e,t){if(!na(e.properties))return t;let n=Object.entries(e.properties).filter(([,o])=>!bu(Xi,o).success).map(([o])=>`properties.${o}`);return n.length>0?n.join(", "):t}function dv(e,t,n=""){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((o,r)=>dv(o,t[r],`${n}[${r}]`));if(!na(e)||!na(t))return[];return Object.entries(e).flatMap(([o,r])=>{let i=n?`${n}.${o}`:o;if(!Object.prototype.hasOwnProperty.call(t,o))return kv(o)?[]:[i];return dv(r,t[o],i)})}function kk(e){if(!mo(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,n=Tk(yk(e.requestedSchema),t),o=bu(ao.shape.requestedSchema,n);if(!o.success)throw new D(I.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${xk(n,o.error.message)}`);let r=dv(n,o.data);if(r.length>0)throw new D(I.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(", ")}`);let i=(o.data.required??[]).filter((a)=>!Object.prototype.hasOwnProperty.call(o.data.properties,a));if(i.length>0)throw new D(I.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${i.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function Ek(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==="string";if(!t&&!n)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}var Ev=Object.assign(Ek,{elicit(e){try{return{method:"elicitation/create",params:kk(e)}}catch(t){throw t instanceof D?TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var Tb=250;function xb(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function kb(e,t){return new Promise((n,o)=>{if(t?.aborted){o(t.reason instanceof te?t.reason:new te(ie.RequestTimeout,String(t.reason)));return}let r=setTimeout(()=>{t?.removeEventListener("abort",i),n()},e),i=()=>{clearTimeout(r),o(t?.reason instanceof te?t.reason:new te(ie.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",i,{once:!0})})}function Eb(e){let t=new AbortController,n=()=>t.abort(e?.reason);if(e?.addEventListener("abort",n,{once:!0}),e?.aborted)t.abort(e.reason);return{signal:t.signal,abort:(o)=>t.abort(o),dispose:()=>e?.removeEventListener("abort",n)}}var wk=["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"],Ik={IdJagTokenExchangeResponseSchema:Qg,OAuthClientInformationFullSchema:tv,OAuthClientInformationSchema:su,OAuthClientMetadataSchema:au,OAuthClientRegistrationErrorSchema:rv,OAuthErrorResponseSchema:ev,OAuthMetadataSchema:ou,OAuthProtectedResourceMetadataSchema:Gg,OAuthTokenRevocationRequestSchema:nv,OAuthTokensSchema:Xg,OpenIdProviderDiscoveryMetadataSchema:Wg,OpenIdProviderMetadataSchema:iu},wb={},Ib={};function Pb(e,t){let n=e.slice(0,-6);wb[n]=t,Ib[n]=(o)=>t.safeParse(o).success}for(let e of wk)Pb(e,Wx[e]);for(let[e,t]of Object.entries(Ik))Pb(e,t);var Pk=Object.freeze(wb),Ok=Object.freeze(Ib);function Ck(e){switch(e){case"initialize":case"notifications/initialized":return $r(void 0);case"server/discover":return $r(sa);default:return}}var Ob=60000,Nk=[ct,Xr,Ot,fr],jk=["inputResponses","requestState"];function Hy(e,t){let n=e.params;if(!ra(n))return{message:e,lifted:{}};let o=n._meta,r=ra(o)?Nk.filter((c)=>(c in o)):[],i=t==="request"?jk.filter((c)=>(c in n)):[];if(r.length===0&&i.length===0)return{message:e,lifted:{}};let a={},s={...n};if(r.length>0&&ra(o)){let c={},u={...o};for(let d of r)c[d]=o[d],delete u[d];if(a.envelope=c,Object.keys(u).length>0)s._meta=u;else delete s._meta}for(let c of i){if(c==="inputResponses")a.inputResponses=s[c];if(c==="requestState")a.requestState=s[c];delete s[c]}return{message:{...e,params:s},lifted:a}}function Yy(e,t){let n=e.validateResult(t,void 0);if(!n.ok&&n.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let r=e.validateResult(t,o);if(r.ok)return{value:r.value};return{issues:[{message:r.reason==="invalid"?r.message:`not-in-era: ${t}`}]}}}}}function ca(e){return()=>e}var Ak=ca(void 0);function wv(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:ca(t)}}}var Cb;function Nb(e,t){Cb(e,t)}var Iv=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{Cb=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??xi,this.setNotificationHandler("notifications/cancelled",(t)=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",(t)=>{this._onprogress(t)}),this.setRequestHandler("ping",(t)=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new te(ie.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,o,r=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:r,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new te(ie.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);if(t)clearTimeout(t.timeoutId),this._timeoutInfo.delete(e)}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=(r)=>{n?.(r),this._onerror(r)};let o=this._transport?.onmessage;this._transport.onmessage=(r,i)=>{if(o?.(r,i),Jt(r)||Ht(r))this._onresponse(r);else if(Bt(r))this._onrequest(r,i);else if(Su(r))this._onnotification(r,i);else this._onerror(Error(`Unknown message type: ${JSON.stringify(r)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new te(ie.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let o of e.values())o(n);for(let o of t.values())o.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=Hy(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let a=Zy(t.classification);if(a!==o.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${a} but this instance serves ${o.era}`));return}}if(av(n.method)&&!o.hasNotificationMethod(n.method))return;let r=this._notificationHandlers.get(n.method),i=this.fallbackNotificationHandler;if(r===void 0&&i===void 0)return;Promise.resolve().then(()=>r===void 0?i(n):r(n,o)).catch((a)=>this._onerror(Error(`Uncaught error in notification handler: ${a}`)))}_onrequest(e,t){let{message:n,lifted:o}=Hy(e,"request"),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let i=this._transport,a=(R,z,N)=>{let B={jsonrpc:"2.0",id:n.id,error:{code:R,message:z,...N!==void 0&&{data:N}}};i?.send(B).catch((P)=>this._onerror(Error(`Failed to send an error response: ${P}`)))};if(t?.classification!==void 0){let R=Zy(t.classification);if(R!==r.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${R} but this instance serves ${r.era}`));let z=t.classification.revision??R;a(I.UnsupportedProtocolVersion,`Unsupported protocol version: ${z}`,{supported:this._supportedProtocolVersions,requested:z});return}}if(iv(n.method)&&!r.hasRequestMethod(n.method)){a(I.MethodNotFound,"Method not found");return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){a(I.MethodNotFound,"Method not found");return}let c=r.checkInboundEnvelope(o);if(c!==void 0){a(I.InvalidParams,c);return}let u=(R,z)=>this._notificationViaCodec(this._resolveOutboundCodec(R.method),R,{...z,relatedRequestId:n.id}),d=(R,z,N)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(R.method),R,z,{...N,relatedRequestId:n.id}),m=new AbortController;this._requestHandlerAbortControllers.set(n.id,m);let p=o.inputResponses===void 0?void 0:Mk(o.inputResponses),h={sessionId:i?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...p!==void 0&&{inputResponses:p.accepted},...p!==void 0&&p.droppedKeys.length>0&&{droppedInputResponseKeys:p.droppedKeys},requestState:o.requestState===void 0?Ak:ca(o.requestState),signal:m.signal,send:(R,z,N)=>{let B=this._resolveOutboundCodec(R.method);if(this._assertOutboundRequestInEra(B,R.method),mo(z))return d(R,z,N);let P=Yy(B,R.method);if(P===void 0)throw TypeError(`'${R.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return d(R,P,z)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},b=this.buildContext(h,t);Promise.resolve().then(()=>s(n,b)).then(async(R)=>{if(m.signal.aborted)return;let z;try{z=r.encodeResult(n.method,R,this._outboundServerInfo())}catch(B){this._onerror(Error(`Failed to encode result for ${n.method}: ${B}`)),a(I.InternalError,"Internal error");return}let N={result:z,jsonrpc:"2.0",id:n.id};await i?.send(N)},async(R)=>{if(m.signal.aborted)return;let z=Number.isSafeInteger(R.code)?R.code:I.InternalError,N={jsonrpc:"2.0",id:n.id,error:{code:r.encodeErrorCode(z),message:R.message??"Internal error",...R.data!==void 0&&{data:R.data}}};await i?.send(N)}).catch((R)=>this._onerror(Error(`Failed to send response: ${R}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(n.id)===m)this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,o=Number(t),r=this._progressHandlers.get(o);if(!r){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(s){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(s);return}r(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Jt(e))n(e);else n(D.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let o=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(o,e.method),mo(t))return this._requestWithSchemaViaCodec(o,e,t,n);let r=Yy(o,e.method);if(r===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(o,e,r,t)}_negotiatedWireCodec(){return $r(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Ck(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(iv(t)&&!e.hasRequestMethod(t))throw new te(ie.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,n)}_requestWithSchemaViaCodec(e,t,n,o){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,headers:s}=o??{},c=Date.now(),u,d;return new Promise((m,p)=>{let h=(Y)=>{p(Y)};if(!this._transport){h(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(Y){h(Y);return}if(o?.signal?.aborted){let Y=o.signal.reason;throw Y instanceof te?Y:new te(ie.RequestTimeout,String(Y))}let b=e.era===sa&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,R=this._requestMessageId++;d=R;let z={...t,jsonrpc:"2.0",id:R};if(o?.onprogress)this._progressHandlers.set(R,o.onprogress),z.params={...t.params,_meta:{...t.params?._meta,progressToken:R}};let N=this._envelopeOutbound(z),B=!1,P=(Y)=>{if(B)return;if(this._progressHandlers.delete(R),b===void 0)this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:R,reason:String(Y)}}),{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch((ee)=>this._onerror(Error(`Failed to send cancellation: ${ee}`)));else b.abort();p(Y instanceof te?Y:new te(ie.RequestTimeout,String(Y)))};this._responseHandlers.set(R,(Y)=>{if(o?.signal?.aborted)return;if(B=!0,Y instanceof Error)return p(Y);let ee;try{ee=e.decodeResult(t.method,Y.result)}catch(ae){return p(ae instanceof Error?ae:Error(String(ae)))}if(ee.kind==="invalid")return p(ee.error);if(ee.kind==="input_required"){if(o?.allowInputRequired===!0)return m(Uk(ee));let ae={codec:e,request:t,resultSchema:n,options:o,flowStartedAt:c,retry:(ce,ue)=>this._requestWithSchemaViaCodec(e,ce===void 0?{method:t.method}:{method:t.method,params:ce},n,ue)};return m(this._resolveNonCompleteResult(ee,ae))}let ne=ee.result;rn(n,ne).then((ae)=>{if(ae.success)m(ae.data);else p(new te(ie.InvalidResult,`Invalid result for ${t.method}: ${ae.error}`))},p)}),u=()=>P(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let O=o?.timeout??Ob,J=()=>P(new te(ie.RequestTimeout,"Request timed out",{timeout:O}));this._setupTimeout(R,O,o?.maxTotalTimeout,J,o?.resetTimeoutOnProgress??!1),this._transport.send(N,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,headers:s,requestSignal:b?.signal}).catch((Y)=>{this._progressHandlers.delete(R),p(Y)})}).finally(()=>{if(u)o?.signal?.removeEventListener("abort",u);if(d!==void 0)this._responseHandlers.delete(d),this._cleanupTimeout(d)})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new te(ie.NotConnected,"Not connected");if(av(t.method)&&!e.hasNotificationMethod(t.method))throw new te(ie.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;this._transport?.send(o,n).catch((r)=>this._onerror(r))});return}await this._transport.send(o,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let o;if(typeof t==="function"){if(!iv(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(r,i)=>{let a=this._negotiatedWireCodec(),s=a.validateRequest(e,r);if(!s.ok&&s.reason==="not-in-era")s=a.validateInputRequest(e,r);if(!s.ok){if(s.reason==="not-in-era")throw new D(I.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(s.message)}return Promise.resolve(t(s.value,i))}}else if(n)o=async(r,i)=>{let a=await rn(t.params,{...r.params});if(!a.success)throw new D(I.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError("setRequestHandler: handler is required");this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==="function"){if(!av(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(o,r)=>{let i=r.validateNotification(e,o);if(!i.ok){if(i.reason==="not-in-era")throw new D(I.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(i.message)}return Promise.resolve(t(i.value))});return}if(!n)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async(o)=>{let r=await rn(t.params,{...o.params});if(!r.success)throw new D(I.InvalidParams,`Invalid params for notification ${e}: ${r.error}`);await n(r.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function ra(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Pv(e,t){let n={...e};for(let o in t){let r=o,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=ra(a)&&ra(i)?{...a,...i}:i}return n}function Gy(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Mk(e){let t={},n=[];if(!Gy(e))return{accepted:t,droppedKeys:n};for(let[o,r]of Object.entries(e)){if(!Gy(r)||"method"in r||"result"in r){n.push(o);continue}t[o]=r}return{accepted:t,droppedKeys:n}}function Uk(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}/*!
67
67
  * content-type
68
68
  * Copyright(c) 2015 Douglas Christopher Wilson
69
69
  * MIT Licensed
70
- */var Ik=h_((e)=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=r;function r(s){if(!s)throw TypeError("argument string is required");var c=typeof s==="object"?i(s):s;if(typeof c!=="string")throw TypeError("argument string is required to be a string");var u=c.indexOf(";"),d=u!==-1?c.slice(0,u).trim():c.trim();if(!o.test(d))throw TypeError("invalid media type");var m=new a(d.toLowerCase());if(u!==-1){var p,h,b;t.lastIndex=u;while(h=t.exec(c)){if(h.index!==u)throw TypeError("invalid parameter format");if(u+=h[0].length,p=h[1].toLowerCase(),b=h[2],b.charCodeAt(0)===34){if(b=b.slice(1,-1),b.indexOf("\\")!==-1)b=b.replace(n,"$1")}m.parameters[p]=b}if(u!==c.length)throw TypeError("invalid parameter format")}return m}function i(s){var c;if(typeof s.getHeader==="function")c=s.getHeader("content-type");else if(typeof s.headers==="object")c=s.headers&&s.headers["content-type"];if(typeof c!=="string")throw TypeError("content-type header is missing from object");return c}function a(s){this.parameters=Object.create(null),this.type=s}}),Pk=v_(Ik(),1);function Ov(e){if(!e)return;try{return Pk.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();if(t===""||e.slice(t.length).includes(","))return;return t}}function Cv(e){if(e==="application/json")return!0;return Ov(e)==="application/json"}var Ok=/^[A-Za-z0-9._-]{1,128}$/;function Ck(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" "))t.push("Tool name contains spaces, which may cause parsing issues");if(e.includes(","))t.push("Tool name contains commas, which may cause parsing issues");if(e.startsWith("-")||e.endsWith("-"))t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(e.startsWith(".")||e.endsWith("."))t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Ok.test(e)){let n=[...e].filter((o)=>!/[A-Za-z0-9._-]/.test(o)).filter((o,r,i)=>i.indexOf(o)===r);return t.push(`Tool name contains invalid characters: ${n.map((o)=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function Nk(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let n of t)console.warn(` - ${n}`);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 Nv(e){let t=Ck(e);return Nk(e,t.warnings),t.isValid}function jk(e){return typeof e==="object"&&e!==null&&"_zod"in e}function Ak(e){return typeof e==="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName==="string"}function Mk(e){if(typeof e!=="object"||e===null)return!1;if(mo(e))return!1;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return!1;return Object.values(e).every((n)=>jk(n))}function $u(e){if(e===void 0)return;if(Mk(e))return f(e);if(typeof e==="object"&&e!==null&&!mo(e)&&Object.values(e).some((t)=>Ak(t)))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(!mo(e))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return e}function la(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let o=e.length;if(o!==t.length)return!1;for(let r=0;r<o;r++)if(!la(e[r],t[r]))return!1;return!0}if(n==="object"){if(!e||!t)return e===t;let o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;for(let i of o)if(!la(e[i],t[i]))return!1;return!0}return e===t}function ht(e){return encodeURI(Uk(e))}function Uk(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var qk={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},Lk={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},Dk={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!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},Zk=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");function on(e,t=Object.create(null),n=Zk,o=""){if(e&&typeof e==="object"&&!Array.isArray(e)){let i=e.$id||e.id;if(i){let a=new URL(i,n.href);if(a.hash.length>1)t[a.href]=e;else if(a.hash="",o==="")n=a;else on(e,t,n)}}else if(e!==!0&&e!==!1)return t;let r=n.href+(o?"#"+o:"");if(t[r]!==void 0)throw Error(`Duplicate schema URI "${r}".`);if(t[r]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0)Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:r});if(e.$ref&&e.__absolute_ref__===void 0){let i=new URL(e.$ref,n.href);i.hash=i.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:i.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let i=new URL(e.$recursiveRef,n.href);i.hash=i.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:i.href})}if(e.$anchor){let i=new URL("#"+e.$anchor,n.href);t[i.href]=e}for(let i in e){if(Dk[i])continue;let a=`${o}/${ht(i)}`,s=e[i];if(Array.isArray(s)){if(qk[i]){let c=s.length;for(let u=0;u<c;u++)on(s[u],t,n,`${a}/${u}`)}}else if(Lk[i])for(let c in s)on(s[c],t,n,`${a}/${ht(c)}`);else on(s,t,n,a)}return t}var Kk=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Fk=[0,31,28,31,30,31,30,31,31,30,31,30,31],Vk=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Jk=/^(?=.{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,Bk=/^(?:[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,Hk=/^(?:(?:[^\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,Yk=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!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-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Gk=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Wk=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Xk=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Qk=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,eE=(e)=>{if(e[0]==='"')return!1;let[t,n,...o]=e.split("@");if(!t||!n||o.length!==0||t.length>64||n.length>253)return!1;if(t[0]==="."||t.endsWith(".")||t.includes(".."))return!1;if(!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t))return!1;return n.split(".").every((r)=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(r))},tE=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,rE=/^((([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,nE=(e)=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Nt(e){return e.test.bind(e)}var jb={date:Ab,time:Mb.bind(void 0,!1),"date-time":aE,duration:nE,uri:lE,"uri-reference":Nt(Bk),"uri-template":Nt(Hk),url:Nt(Yk),email:eE,hostname:Nt(Jk),ipv4:Nt(tE),ipv6:Nt(rE),regex:dE,uuid:Nt(Gk),"json-pointer":Nt(Wk),"json-pointer-uri-fragment":Nt(Xk),"relative-json-pointer":Nt(Qk)};function oE(e){return e%4===0&&(e%100!==0||e%400===0)}function Ab(e){let t=e.match(Kk);if(!t)return!1;let n=+t[1],o=+t[2],r=+t[3];return o>=1&&o<=12&&r>=1&&r<=(o==2&&oE(n)?29:Fk[o])}function Mb(e,t){let n=t.match(Vk);if(!n)return!1;let o=+n[1],r=+n[2],i=+n[3],a=!!n[5];return(o<=23&&r<=59&&i<=59||o==23&&r==59&&i==60)&&(!e||a)}var iE=/t|\s/i;function aE(e){let t=e.split(iE);return t.length==2&&Ab(t[0])&&Mb(!0,t[1])}var sE=/\/|:/,cE=/^(?:[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 lE(e){return sE.test(e)&&cE.test(e)}var uE=/[^\\]\\Z/;function dE(e){if(uE.test(e))return!1;try{return new RegExp(e,"u"),!0}catch(t){return!1}}function mE(e){let t=0,n=e.length,o=0,r;while(o<n)if(t++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<n){if(r=e.charCodeAt(o),(r&64512)==56320)o++}return t}function he(e,t,n="2019-09",o=on(t),r=!0,i=null,a="#",s="#",c=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:a,keyword:"false",keywordLocation:a,error:"False boolean schema."}]};let u=typeof e,d;switch(u){case"boolean":case"number":case"string":d=u;break;case"object":if(e===null)d="null";else if(Array.isArray(e))d="array";else d="object";break;default:throw Error(`Instances of "${u}" type are not supported.`)}let{$ref:m,$recursiveRef:p,$recursiveAnchor:h,type:b,const:R,enum:z,required:A,not:B,anyOf:P,allOf:O,oneOf:V,if:Y,then:ee,else:ne,format:ae,properties:ce,patternProperties:ue,additionalProperties:Te,unevaluatedProperties:tt,minProperties:Ne,maxProperties:rt,propertyNames:vt,dependentRequired:Ze,dependentSchemas:nt,dependencies:_t,prefixItems:Ye,items:je,additionalItems:At,unevaluatedItems:Mt,contains:St,minContains:ke,maxContains:Ae,minItems:Me,maxItems:ut,uniqueItems:kr,minimum:Ge,maximum:We,exclusiveMinimum:Ke,exclusiveMaximum:ot,multipleOf:it,minLength:yt,maxLength:bt,pattern:Gt,__absolute_ref__:$t,__absolute_recursive_ref__:Er}=t,q=[];if(h===!0&&i===null)i=t;if(p==="#"){let G=i===null?o[Er]:i,K=`${s}/$recursiveRef`,oe=he(e,i===null?t:i,n,o,r,G,a,K,c);if(!oe.valid)q.push({instanceLocation:a,keyword:"$recursiveRef",keywordLocation:K,error:"A subschema had errors."},...oe.errors)}if(m!==void 0){let G=o[$t||m];if(G===void 0){let L=`Unresolved $ref "${m}".`;if($t&&$t!==m)L+=` Absolute URI "${$t}".`;throw L+=`
70
+ */var qk=h_((e)=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=r;function r(s){if(!s)throw TypeError("argument string is required");var c=typeof s==="object"?i(s):s;if(typeof c!=="string")throw TypeError("argument string is required to be a string");var u=c.indexOf(";"),d=u!==-1?c.slice(0,u).trim():c.trim();if(!o.test(d))throw TypeError("invalid media type");var m=new a(d.toLowerCase());if(u!==-1){var p,h,b;t.lastIndex=u;while(h=t.exec(c)){if(h.index!==u)throw TypeError("invalid parameter format");if(u+=h[0].length,p=h[1].toLowerCase(),b=h[2],b.charCodeAt(0)===34){if(b=b.slice(1,-1),b.indexOf("\\")!==-1)b=b.replace(n,"$1")}m.parameters[p]=b}if(u!==c.length)throw TypeError("invalid parameter format")}return m}function i(s){var c;if(typeof s.getHeader==="function")c=s.getHeader("content-type");else if(typeof s.headers==="object")c=s.headers&&s.headers["content-type"];if(typeof c!=="string")throw TypeError("content-type header is missing from object");return c}function a(s){this.parameters=Object.create(null),this.type=s}}),Lk=v_(qk(),1);function Ov(e){if(!e)return;try{return Lk.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();if(t===""||e.slice(t.length).includes(","))return;return t}}function Cv(e){if(e==="application/json")return!0;return Ov(e)==="application/json"}var Dk=/^[A-Za-z0-9._-]{1,128}$/;function Zk(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" "))t.push("Tool name contains spaces, which may cause parsing issues");if(e.includes(","))t.push("Tool name contains commas, which may cause parsing issues");if(e.startsWith("-")||e.endsWith("-"))t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(e.startsWith(".")||e.endsWith("."))t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Dk.test(e)){let n=[...e].filter((o)=>!/[A-Za-z0-9._-]/.test(o)).filter((o,r,i)=>i.indexOf(o)===r);return t.push(`Tool name contains invalid characters: ${n.map((o)=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function Fk(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let n of t)console.warn(` - ${n}`);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 Nv(e){let t=Zk(e);return Fk(e,t.warnings),t.isValid}function Kk(e){return typeof e==="object"&&e!==null&&"_zod"in e}function Jk(e){return typeof e==="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName==="string"}function Vk(e){if(typeof e!=="object"||e===null)return!1;if(mo(e))return!1;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return!1;return Object.values(e).every((n)=>Kk(n))}function $u(e){if(e===void 0)return;if(Vk(e))return f(e);if(typeof e==="object"&&e!==null&&!mo(e)&&Object.values(e).some((t)=>Jk(t)))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(!mo(e))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return e}function la(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let o=e.length;if(o!==t.length)return!1;for(let r=0;r<o;r++)if(!la(e[r],t[r]))return!1;return!0}if(n==="object"){if(!e||!t)return e===t;let o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;for(let i of o)if(!la(e[i],t[i]))return!1;return!0}return e===t}function ht(e){return encodeURI(Bk(e))}function Bk(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var Hk={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},Yk={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},Gk={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!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},Wk=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");function on(e,t=Object.create(null),n=Wk,o=""){if(e&&typeof e==="object"&&!Array.isArray(e)){let i=e.$id||e.id;if(i){let a=new URL(i,n.href);if(a.hash.length>1)t[a.href]=e;else if(a.hash="",o==="")n=a;else on(e,t,n)}}else if(e!==!0&&e!==!1)return t;let r=n.href+(o?"#"+o:"");if(t[r]!==void 0)throw Error(`Duplicate schema URI "${r}".`);if(t[r]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0)Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:r});if(e.$ref&&e.__absolute_ref__===void 0){let i=new URL(e.$ref,n.href);i.hash=i.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:i.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let i=new URL(e.$recursiveRef,n.href);i.hash=i.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:i.href})}if(e.$anchor){let i=new URL("#"+e.$anchor,n.href);t[i.href]=e}for(let i in e){if(Gk[i])continue;let a=`${o}/${ht(i)}`,s=e[i];if(Array.isArray(s)){if(Hk[i]){let c=s.length;for(let u=0;u<c;u++)on(s[u],t,n,`${a}/${u}`)}}else if(Yk[i])for(let c in s)on(s[c],t,n,`${a}/${ht(c)}`);else on(s,t,n,a)}return t}var Xk=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Qk=[0,31,28,31,30,31,30,31,31,30,31,30,31],eE=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,tE=/^(?=.{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,rE=/^(?:[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,nE=/^(?:(?:[^\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,oE=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!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-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,iE=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,aE=/^(?:\/(?:[^~/]|~0|~1)*)*$/,sE=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,cE=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,lE=(e)=>{if(e[0]==='"')return!1;let[t,n,...o]=e.split("@");if(!t||!n||o.length!==0||t.length>64||n.length>253)return!1;if(t[0]==="."||t.endsWith(".")||t.includes(".."))return!1;if(!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t))return!1;return n.split(".").every((r)=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(r))},uE=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,dE=/^((([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,mE=(e)=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Nt(e){return e.test.bind(e)}var jb={date:Ab,time:Mb.bind(void 0,!1),"date-time":hE,duration:mE,uri:_E,"uri-reference":Nt(rE),"uri-template":Nt(nE),url:Nt(oE),email:lE,hostname:Nt(tE),ipv4:Nt(uE),ipv6:Nt(dE),regex:yE,uuid:Nt(iE),"json-pointer":Nt(aE),"json-pointer-uri-fragment":Nt(sE),"relative-json-pointer":Nt(cE)};function pE(e){return e%4===0&&(e%100!==0||e%400===0)}function Ab(e){let t=e.match(Xk);if(!t)return!1;let n=+t[1],o=+t[2],r=+t[3];return o>=1&&o<=12&&r>=1&&r<=(o==2&&pE(n)?29:Qk[o])}function Mb(e,t){let n=t.match(eE);if(!n)return!1;let o=+n[1],r=+n[2],i=+n[3],a=!!n[5];return(o<=23&&r<=59&&i<=59||o==23&&r==59&&i==60)&&(!e||a)}var fE=/t|\s/i;function hE(e){let t=e.split(fE);return t.length==2&&Ab(t[0])&&Mb(!0,t[1])}var gE=/\/|:/,vE=/^(?:[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 _E(e){return gE.test(e)&&vE.test(e)}var SE=/[^\\]\\Z/;function yE(e){if(SE.test(e))return!1;try{return new RegExp(e,"u"),!0}catch(t){return!1}}function bE(e){let t=0,n=e.length,o=0,r;while(o<n)if(t++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<n){if(r=e.charCodeAt(o),(r&64512)==56320)o++}return t}function he(e,t,n="2019-09",o=on(t),r=!0,i=null,a="#",s="#",c=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:a,keyword:"false",keywordLocation:a,error:"False boolean schema."}]};let u=typeof e,d;switch(u){case"boolean":case"number":case"string":d=u;break;case"object":if(e===null)d="null";else if(Array.isArray(e))d="array";else d="object";break;default:throw Error(`Instances of "${u}" type are not supported.`)}let{$ref:m,$recursiveRef:p,$recursiveAnchor:h,type:b,const:R,enum:z,required:N,not:B,anyOf:P,allOf:O,oneOf:J,if:Y,then:ee,else:ne,format:ae,properties:ce,patternProperties:ue,additionalProperties:Te,unevaluatedProperties:tt,minProperties:Ne,maxProperties:rt,propertyNames:vt,dependentRequired:Ze,dependentSchemas:nt,dependencies:_t,prefixItems:Ye,items:je,additionalItems:At,unevaluatedItems:Mt,contains:St,minContains:ke,maxContains:Ae,minItems:Me,maxItems:ut,uniqueItems:kr,minimum:Ge,maximum:We,exclusiveMinimum:Fe,exclusiveMaximum:ot,multipleOf:it,minLength:yt,maxLength:bt,pattern:Gt,__absolute_ref__:$t,__absolute_recursive_ref__:Er}=t,q=[];if(h===!0&&i===null)i=t;if(p==="#"){let G=i===null?o[Er]:i,F=`${s}/$recursiveRef`,oe=he(e,i===null?t:i,n,o,r,G,a,F,c);if(!oe.valid)q.push({instanceLocation:a,keyword:"$recursiveRef",keywordLocation:F,error:"A subschema had errors."},...oe.errors)}if(m!==void 0){let G=o[$t||m];if(G===void 0){let L=`Unresolved $ref "${m}".`;if($t&&$t!==m)L+=` Absolute URI "${$t}".`;throw L+=`
71
71
  Known schemas:
72
72
  - ${Object.keys(o).join(`
73
- - `)}`,Error(L)}let K=`${s}/$ref`,oe=he(e,G,n,o,r,i,a,K,c);if(!oe.valid)q.push({instanceLocation:a,keyword:"$ref",keywordLocation:K,error:"A subschema had errors."},...oe.errors);if(n==="4"||n==="7")return{valid:q.length===0,errors:q}}if(Array.isArray(b)){let G=b.length,K=!1;for(let oe=0;oe<G;oe++)if(d===b[oe]||b[oe]==="integer"&&d==="number"&&e%1===0&&e===e){K=!0;break}if(!K)q.push({instanceLocation:a,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${d}" is invalid. Expected "${b.join('", "')}".`})}else if(b==="integer"){if(d!=="number"||e%1||e!==e)q.push({instanceLocation:a,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${d}" is invalid. Expected "${b}".`})}else if(b!==void 0&&d!==b)q.push({instanceLocation:a,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${d}" is invalid. Expected "${b}".`});if(R!==void 0){if(d==="object"||d==="array"){if(!la(e,R))q.push({instanceLocation:a,keyword:"const",keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(R)}.`})}else if(e!==R)q.push({instanceLocation:a,keyword:"const",keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(R)}.`})}if(z!==void 0){if(d==="object"||d==="array"){if(!z.some((G)=>la(e,G)))q.push({instanceLocation:a,keyword:"enum",keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(z)}.`})}else if(!z.some((G)=>e===G))q.push({instanceLocation:a,keyword:"enum",keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(z)}.`})}if(B!==void 0){let G=`${s}/not`;if(he(e,B,n,o,r,i,a,G).valid)q.push({instanceLocation:a,keyword:"not",keywordLocation:G,error:'Instance matched "not" schema.'})}let Rt=[];if(P!==void 0){let G=`${s}/anyOf`,K=q.length,oe=!1;for(let L=0;L<P.length;L++){let M=P[L],X=Object.create(c),W=he(e,M,n,o,r,h===!0?i:null,a,`${G}/${L}`,X);if(q.push(...W.errors),oe=oe||W.valid,W.valid)Rt.push(X)}if(oe)q.length=K;else q.splice(K,0,{instanceLocation:a,keyword:"anyOf",keywordLocation:G,error:"Instance does not match any subschemas."})}if(O!==void 0){let G=`${s}/allOf`,K=q.length,oe=!0;for(let L=0;L<O.length;L++){let M=O[L],X=Object.create(c),W=he(e,M,n,o,r,h===!0?i:null,a,`${G}/${L}`,X);if(q.push(...W.errors),oe=oe&&W.valid,W.valid)Rt.push(X)}if(oe)q.length=K;else q.splice(K,0,{instanceLocation:a,keyword:"allOf",keywordLocation:G,error:"Instance does not match every subschema."})}if(V!==void 0){let G=`${s}/oneOf`,K=q.length,oe=V.filter((L,M)=>{let X=Object.create(c),W=he(e,L,n,o,r,h===!0?i:null,a,`${G}/${M}`,X);if(q.push(...W.errors),W.valid)Rt.push(X);return W.valid}).length;if(oe===1)q.length=K;else q.splice(K,0,{instanceLocation:a,keyword:"oneOf",keywordLocation:G,error:`Instance does not match exactly one subschema (${oe} matches).`})}if(d==="object"||d==="array")Object.assign(c,...Rt);if(Y!==void 0){let G=`${s}/if`;if(he(e,Y,n,o,r,i,a,G,c).valid){if(ee!==void 0){let K=he(e,ee,n,o,r,i,a,`${s}/then`,c);if(!K.valid)q.push({instanceLocation:a,keyword:"if",keywordLocation:G,error:'Instance does not match "then" schema.'},...K.errors)}}else if(ne!==void 0){let K=he(e,ne,n,o,r,i,a,`${s}/else`,c);if(!K.valid)q.push({instanceLocation:a,keyword:"if",keywordLocation:G,error:'Instance does not match "else" schema.'},...K.errors)}}if(d==="object"){if(A!==void 0){for(let L of A)if(!(L in e))q.push({instanceLocation:a,keyword:"required",keywordLocation:`${s}/required`,error:`Instance does not have required property "${L}".`})}let G=Object.keys(e);if(Ne!==void 0&&G.length<Ne)q.push({instanceLocation:a,keyword:"minProperties",keywordLocation:`${s}/minProperties`,error:`Instance does not have at least ${Ne} properties.`});if(rt!==void 0&&G.length>rt)q.push({instanceLocation:a,keyword:"maxProperties",keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${rt} properties.`});if(vt!==void 0){let L=`${s}/propertyNames`;for(let M in e){let X=`${a}/${ht(M)}`,W=he(M,vt,n,o,r,i,X,L);if(!W.valid)q.push({instanceLocation:a,keyword:"propertyNames",keywordLocation:L,error:`Property name "${M}" does not match schema.`},...W.errors)}}if(Ze!==void 0){let L=`${s}/dependantRequired`;for(let M in Ze)if(M in e){let X=Ze[M];for(let W of X)if(!(W in e))q.push({instanceLocation:a,keyword:"dependentRequired",keywordLocation:L,error:`Instance has "${M}" but does not have "${W}".`})}}if(nt!==void 0)for(let L in nt){let M=`${s}/dependentSchemas`;if(L in e){let X=he(e,nt[L],n,o,r,i,a,`${M}/${ht(L)}`,c);if(!X.valid)q.push({instanceLocation:a,keyword:"dependentSchemas",keywordLocation:M,error:`Instance has "${L}" but does not match dependant schema.`},...X.errors)}}if(_t!==void 0){let L=`${s}/dependencies`;for(let M in _t)if(M in e){let X=_t[M];if(Array.isArray(X)){for(let W of X)if(!(W in e))q.push({instanceLocation:a,keyword:"dependencies",keywordLocation:L,error:`Instance has "${M}" but does not have "${W}".`})}else{let W=he(e,X,n,o,r,i,a,`${L}/${ht(M)}`);if(!W.valid)q.push({instanceLocation:a,keyword:"dependencies",keywordLocation:L,error:`Instance has "${M}" but does not match dependant schema.`},...W.errors)}}}let K=Object.create(null),oe=!1;if(ce!==void 0){let L=`${s}/properties`;for(let M in ce){if(!(M in e))continue;let X=`${a}/${ht(M)}`,W=he(e[M],ce[M],n,o,r,i,X,`${L}/${ht(M)}`);if(W.valid)c[M]=K[M]=!0;else if(oe=r,q.push({instanceLocation:a,keyword:"properties",keywordLocation:L,error:`Property "${M}" does not match schema.`},...W.errors),oe)break}}if(!oe&&ue!==void 0){let L=`${s}/patternProperties`;for(let M in ue){let X=new RegExp(M,"u"),W=ue[M];for(let be in e){if(!X.test(be))continue;let wr=`${a}/${ht(be)}`,zt=he(e[be],W,n,o,r,i,wr,`${L}/${ht(M)}`);if(zt.valid)c[be]=K[be]=!0;else oe=r,q.push({instanceLocation:a,keyword:"patternProperties",keywordLocation:L,error:`Property "${be}" matches pattern "${M}" but does not match associated schema.`},...zt.errors)}}}if(!oe&&Te!==void 0){let L=`${s}/additionalProperties`;for(let M in e){if(K[M])continue;let X=`${a}/${ht(M)}`,W=he(e[M],Te,n,o,r,i,X,L);if(W.valid)c[M]=!0;else oe=r,q.push({instanceLocation:a,keyword:"additionalProperties",keywordLocation:L,error:`Property "${M}" does not match additional properties schema.`},...W.errors)}}else if(!oe&&tt!==void 0){let L=`${s}/unevaluatedProperties`;for(let M in e)if(!c[M]){let X=`${a}/${ht(M)}`,W=he(e[M],tt,n,o,r,i,X,L);if(W.valid)c[M]=!0;else q.push({instanceLocation:a,keyword:"unevaluatedProperties",keywordLocation:L,error:`Property "${M}" does not match unevaluated properties schema.`},...W.errors)}}}else if(d==="array"){if(ut!==void 0&&e.length>ut)q.push({instanceLocation:a,keyword:"maxItems",keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${ut}).`});if(Me!==void 0&&e.length<Me)q.push({instanceLocation:a,keyword:"minItems",keywordLocation:`${s}/minItems`,error:`Array has too few items (${e.length} < ${Me}).`});let G=e.length,K=0,oe=!1;if(Ye!==void 0){let L=`${s}/prefixItems`,M=Math.min(Ye.length,G);for(;K<M;K++){let X=he(e[K],Ye[K],n,o,r,i,`${a}/${K}`,`${L}/${K}`);if(c[K]=!0,!X.valid){if(oe=r,q.push({instanceLocation:a,keyword:"prefixItems",keywordLocation:L,error:"Items did not match schema."},...X.errors),oe)break}}}if(je!==void 0){let L=`${s}/items`;if(Array.isArray(je)){let M=Math.min(je.length,G);for(;K<M;K++){let X=he(e[K],je[K],n,o,r,i,`${a}/${K}`,`${L}/${K}`);if(c[K]=!0,!X.valid){if(oe=r,q.push({instanceLocation:a,keyword:"items",keywordLocation:L,error:"Items did not match schema."},...X.errors),oe)break}}}else for(;K<G;K++){let M=he(e[K],je,n,o,r,i,`${a}/${K}`,L);if(c[K]=!0,!M.valid){if(oe=r,q.push({instanceLocation:a,keyword:"items",keywordLocation:L,error:"Items did not match schema."},...M.errors),oe)break}}if(!oe&&At!==void 0){let M=`${s}/additionalItems`;for(;K<G;K++){let X=he(e[K],At,n,o,r,i,`${a}/${K}`,M);if(c[K]=!0,!X.valid)oe=r,q.push({instanceLocation:a,keyword:"additionalItems",keywordLocation:M,error:"Items did not match additional items schema."},...X.errors)}}}if(St!==void 0)if(G===0&&ke===void 0)q.push({instanceLocation:a,keyword:"contains",keywordLocation:`${s}/contains`,error:"Array is empty. It must contain at least one item matching the schema."});else if(ke!==void 0&&G<ke)q.push({instanceLocation:a,keyword:"minContains",keywordLocation:`${s}/minContains`,error:`Array has less items (${G}) than minContains (${ke}).`});else{let L=`${s}/contains`,M=q.length,X=0;for(let W=0;W<G;W++){let be=he(e[W],St,n,o,r,i,`${a}/${W}`,L);if(be.valid)c[W]=!0,X++;else q.push(...be.errors)}if(X>=(ke||0))q.length=M;if(ke===void 0&&Ae===void 0&&X===0)q.splice(M,0,{instanceLocation:a,keyword:"contains",keywordLocation:L,error:"Array does not contain item matching schema."});else if(ke!==void 0&&X<ke)q.push({instanceLocation:a,keyword:"minContains",keywordLocation:`${s}/minContains`,error:`Array must contain at least ${ke} items matching schema. Only ${X} items were found.`});else if(Ae!==void 0&&X>Ae)q.push({instanceLocation:a,keyword:"maxContains",keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${Ae} items matching schema. ${X} items were found.`})}if(!oe&&Mt!==void 0){let L=`${s}/unevaluatedItems`;for(;K<G;K++){if(c[K])continue;let M=he(e[K],Mt,n,o,r,i,`${a}/${K}`,L);if(c[K]=!0,!M.valid)q.push({instanceLocation:a,keyword:"unevaluatedItems",keywordLocation:L,error:"Items did not match unevaluated items schema."},...M.errors)}}if(kr)for(let L=0;L<G;L++){let M=e[L],X=typeof M==="object"&&M!==null;for(let W=0;W<G;W++){if(L===W)continue;let be=e[W];if(M===be||X&&typeof be==="object"&&be!==null&&la(M,be))q.push({instanceLocation:a,keyword:"uniqueItems",keywordLocation:`${s}/uniqueItems`,error:`Duplicate items at indexes ${L} and ${W}.`}),L=Number.MAX_SAFE_INTEGER,W=Number.MAX_SAFE_INTEGER}}}else if(d==="number"){if(n==="4"){if(Ge!==void 0&&(Ke===!0&&e<=Ge||e<Ge))q.push({instanceLocation:a,keyword:"minimum",keywordLocation:`${s}/minimum`,error:`${e} is less than ${Ke?"or equal to ":""} ${Ge}.`});if(We!==void 0&&(ot===!0&&e>=We||e>We))q.push({instanceLocation:a,keyword:"maximum",keywordLocation:`${s}/maximum`,error:`${e} is greater than ${ot?"or equal to ":""} ${We}.`})}else{if(Ge!==void 0&&e<Ge)q.push({instanceLocation:a,keyword:"minimum",keywordLocation:`${s}/minimum`,error:`${e} is less than ${Ge}.`});if(We!==void 0&&e>We)q.push({instanceLocation:a,keyword:"maximum",keywordLocation:`${s}/maximum`,error:`${e} is greater than ${We}.`});if(Ke!==void 0&&e<=Ke)q.push({instanceLocation:a,keyword:"exclusiveMinimum",keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${Ke}.`});if(ot!==void 0&&e>=ot)q.push({instanceLocation:a,keyword:"exclusiveMaximum",keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${ot}.`})}if(it!==void 0){let G=e%it;if(Math.abs(0-G)>=0.00000011920929&&Math.abs(it-G)>=0.00000011920929)q.push({instanceLocation:a,keyword:"multipleOf",keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${it}.`})}}else if(d==="string"){let G=yt===void 0&&bt===void 0?0:mE(e);if(yt!==void 0&&G<yt)q.push({instanceLocation:a,keyword:"minLength",keywordLocation:`${s}/minLength`,error:`String is too short (${G} < ${yt}).`});if(bt!==void 0&&G>bt)q.push({instanceLocation:a,keyword:"maxLength",keywordLocation:`${s}/maxLength`,error:`String is too long (${G} > ${bt}).`});if(Gt!==void 0&&!new RegExp(Gt,"u").test(e))q.push({instanceLocation:a,keyword:"pattern",keywordLocation:`${s}/pattern`,error:"String does not match pattern."});if(ae!==void 0&&jb[ae]&&!jb[ae](e))q.push({instanceLocation:a,keyword:"format",keywordLocation:`${s}/format`,error:`String does not match format "${ae}".`})}return{valid:q.length===0,errors:q}}var pE=class{schema;draft;shortCircuit;lookup;constructor(e,t="2019-09",n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=on(e)}validate(e){return he(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){if(t)e={...e,$id:t};on(e,this.lookup)}},Ru=class{shortcircuit;draft;constructor(e){this.shortcircuit=e?.shortcircuit??!0,this.draft=e?.draft}_draftFor(e){let t=y_(e,"pass an explicit { draft } to CfWorkerJsonSchemaValidator to validate other dialects.");return t==="draft-7"?"7":t}getValidator(e){let t=new pE(e,this.draft??this._draftFor(e),this.shortcircuit);return(n)=>{let o=t.validate(n);return o.valid?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:o.errors.map((r)=>`${r.instanceLocation}: ${r.error}`).join("; ")}}}};var Bb=Symbol.for("mcp.completable");function Av(e){return!!e&&typeof e==="object"&&Bb in e}function hE(e){return e[Bb]?.complete}var da=15000,gE=2147483647;function zu(e,t){if(!Number.isFinite(e)||e<1)return;let n=setInterval(t,Math.min(e,gE));return n.unref?.(),n}var Hb=class{_listeners=new Set;constructor(e){this.onerror=e}publish(e){for(let t of this._listeners)try{t(e)}catch(n){this.onerror?.(n instanceof Error?n:Error(String(n)))}}subscribe(e){this._listeners.add(e);let t=!0;return()=>{if(!t)return;t=!1,this._listeners.delete(e)}}get listenerCount(){return this._listeners.size}};function Yb(e){return{toolsChanged:()=>e.publish({kind:"tools_list_changed"}),promptsChanged:()=>e.publish({kind:"prompts_list_changed"}),resourcesChanged:()=>e.publish({kind:"resources_list_changed"}),resourceUpdated:(t)=>e.publish({kind:"resource_updated",uri:t})}}function vE(e,t){switch(t.kind){case"tools_list_changed":return e.toolsListChanged===!0;case"prompts_list_changed":return e.promptsListChanged===!0;case"resources_list_changed":return e.resourcesListChanged===!0;case"resource_updated":return e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.includes(t.uri)}}function _E(e,t){let n={},o=(r)=>t===void 0||r===!0;if(e.toolsListChanged===!0&&o(t?.tools?.listChanged))n.toolsListChanged=!0;if(e.promptsListChanged===!0&&o(t?.prompts?.listChanged))n.promptsListChanged=!0;if(e.resourcesListChanged===!0&&o(t?.resources?.listChanged))n.resourcesListChanged=!0;if(e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.length>0&&o(t?.resources?.subscribe))n.resourceSubscriptions=[...e.resourceSubscriptions];return n}function SE(e){switch(e.kind){case"tools_list_changed":return{method:"notifications/tools/list_changed"};case"prompts_list_changed":return{method:"notifications/prompts/list_changed"};case"resources_list_changed":return{method:"notifications/resources/list_changed"};case"resource_updated":return{method:"notifications/resources/updated",params:{uri:e.uri}}}}var Mv=1024;function Ub(e,t,n){return Response.json({jsonrpc:"2.0",error:{code:t,message:n},id:e},{status:200})}function qb(e,t){return{method:e.method,params:{...e.params,_meta:{...e.params?._meta,[Qr]:t}}}}function yE(e){let t=$r(sa).validateRequest("subscriptions/listen",e);return t.ok?t.value.params?.notifications:void 0}function Gb(e){let{bus:t,onerror:n}=e,o=e.maxSubscriptions??Mv,r=e.keepAliveMs??da,i=new Set;function a(s,c,u,d){if(i.size>=o)return n?.(Error(`subscriptions/listen refused: subscription limit reached (${o})`)),Ub(s.id,-32603,"Subscription limit reached");let m=yE(s);if(m===void 0)return Ub(s.id,-32602,"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter");let p=_E(m,u),h=s.id,b=new TextEncoder,R,z=!1,A,B,P,O=(ne)=>{if(z)return;try{R.enqueue(b.encode(ne))}catch(ae){n?.(ae instanceof Error?ae:Error(String(ae)))}},V=(ne,ae)=>{O(`event: message
73
+ - `)}`,Error(L)}let F=`${s}/$ref`,oe=he(e,G,n,o,r,i,a,F,c);if(!oe.valid)q.push({instanceLocation:a,keyword:"$ref",keywordLocation:F,error:"A subschema had errors."},...oe.errors);if(n==="4"||n==="7")return{valid:q.length===0,errors:q}}if(Array.isArray(b)){let G=b.length,F=!1;for(let oe=0;oe<G;oe++)if(d===b[oe]||b[oe]==="integer"&&d==="number"&&e%1===0&&e===e){F=!0;break}if(!F)q.push({instanceLocation:a,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${d}" is invalid. Expected "${b.join('", "')}".`})}else if(b==="integer"){if(d!=="number"||e%1||e!==e)q.push({instanceLocation:a,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${d}" is invalid. Expected "${b}".`})}else if(b!==void 0&&d!==b)q.push({instanceLocation:a,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${d}" is invalid. Expected "${b}".`});if(R!==void 0){if(d==="object"||d==="array"){if(!la(e,R))q.push({instanceLocation:a,keyword:"const",keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(R)}.`})}else if(e!==R)q.push({instanceLocation:a,keyword:"const",keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(R)}.`})}if(z!==void 0){if(d==="object"||d==="array"){if(!z.some((G)=>la(e,G)))q.push({instanceLocation:a,keyword:"enum",keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(z)}.`})}else if(!z.some((G)=>e===G))q.push({instanceLocation:a,keyword:"enum",keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(z)}.`})}if(B!==void 0){let G=`${s}/not`;if(he(e,B,n,o,r,i,a,G).valid)q.push({instanceLocation:a,keyword:"not",keywordLocation:G,error:'Instance matched "not" schema.'})}let Rt=[];if(P!==void 0){let G=`${s}/anyOf`,F=q.length,oe=!1;for(let L=0;L<P.length;L++){let M=P[L],X=Object.create(c),W=he(e,M,n,o,r,h===!0?i:null,a,`${G}/${L}`,X);if(q.push(...W.errors),oe=oe||W.valid,W.valid)Rt.push(X)}if(oe)q.length=F;else q.splice(F,0,{instanceLocation:a,keyword:"anyOf",keywordLocation:G,error:"Instance does not match any subschemas."})}if(O!==void 0){let G=`${s}/allOf`,F=q.length,oe=!0;for(let L=0;L<O.length;L++){let M=O[L],X=Object.create(c),W=he(e,M,n,o,r,h===!0?i:null,a,`${G}/${L}`,X);if(q.push(...W.errors),oe=oe&&W.valid,W.valid)Rt.push(X)}if(oe)q.length=F;else q.splice(F,0,{instanceLocation:a,keyword:"allOf",keywordLocation:G,error:"Instance does not match every subschema."})}if(J!==void 0){let G=`${s}/oneOf`,F=q.length,oe=J.filter((L,M)=>{let X=Object.create(c),W=he(e,L,n,o,r,h===!0?i:null,a,`${G}/${M}`,X);if(q.push(...W.errors),W.valid)Rt.push(X);return W.valid}).length;if(oe===1)q.length=F;else q.splice(F,0,{instanceLocation:a,keyword:"oneOf",keywordLocation:G,error:`Instance does not match exactly one subschema (${oe} matches).`})}if(d==="object"||d==="array")Object.assign(c,...Rt);if(Y!==void 0){let G=`${s}/if`;if(he(e,Y,n,o,r,i,a,G,c).valid){if(ee!==void 0){let F=he(e,ee,n,o,r,i,a,`${s}/then`,c);if(!F.valid)q.push({instanceLocation:a,keyword:"if",keywordLocation:G,error:'Instance does not match "then" schema.'},...F.errors)}}else if(ne!==void 0){let F=he(e,ne,n,o,r,i,a,`${s}/else`,c);if(!F.valid)q.push({instanceLocation:a,keyword:"if",keywordLocation:G,error:'Instance does not match "else" schema.'},...F.errors)}}if(d==="object"){if(N!==void 0){for(let L of N)if(!(L in e))q.push({instanceLocation:a,keyword:"required",keywordLocation:`${s}/required`,error:`Instance does not have required property "${L}".`})}let G=Object.keys(e);if(Ne!==void 0&&G.length<Ne)q.push({instanceLocation:a,keyword:"minProperties",keywordLocation:`${s}/minProperties`,error:`Instance does not have at least ${Ne} properties.`});if(rt!==void 0&&G.length>rt)q.push({instanceLocation:a,keyword:"maxProperties",keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${rt} properties.`});if(vt!==void 0){let L=`${s}/propertyNames`;for(let M in e){let X=`${a}/${ht(M)}`,W=he(M,vt,n,o,r,i,X,L);if(!W.valid)q.push({instanceLocation:a,keyword:"propertyNames",keywordLocation:L,error:`Property name "${M}" does not match schema.`},...W.errors)}}if(Ze!==void 0){let L=`${s}/dependantRequired`;for(let M in Ze)if(M in e){let X=Ze[M];for(let W of X)if(!(W in e))q.push({instanceLocation:a,keyword:"dependentRequired",keywordLocation:L,error:`Instance has "${M}" but does not have "${W}".`})}}if(nt!==void 0)for(let L in nt){let M=`${s}/dependentSchemas`;if(L in e){let X=he(e,nt[L],n,o,r,i,a,`${M}/${ht(L)}`,c);if(!X.valid)q.push({instanceLocation:a,keyword:"dependentSchemas",keywordLocation:M,error:`Instance has "${L}" but does not match dependant schema.`},...X.errors)}}if(_t!==void 0){let L=`${s}/dependencies`;for(let M in _t)if(M in e){let X=_t[M];if(Array.isArray(X)){for(let W of X)if(!(W in e))q.push({instanceLocation:a,keyword:"dependencies",keywordLocation:L,error:`Instance has "${M}" but does not have "${W}".`})}else{let W=he(e,X,n,o,r,i,a,`${L}/${ht(M)}`);if(!W.valid)q.push({instanceLocation:a,keyword:"dependencies",keywordLocation:L,error:`Instance has "${M}" but does not match dependant schema.`},...W.errors)}}}let F=Object.create(null),oe=!1;if(ce!==void 0){let L=`${s}/properties`;for(let M in ce){if(!(M in e))continue;let X=`${a}/${ht(M)}`,W=he(e[M],ce[M],n,o,r,i,X,`${L}/${ht(M)}`);if(W.valid)c[M]=F[M]=!0;else if(oe=r,q.push({instanceLocation:a,keyword:"properties",keywordLocation:L,error:`Property "${M}" does not match schema.`},...W.errors),oe)break}}if(!oe&&ue!==void 0){let L=`${s}/patternProperties`;for(let M in ue){let X=new RegExp(M,"u"),W=ue[M];for(let be in e){if(!X.test(be))continue;let wr=`${a}/${ht(be)}`,zt=he(e[be],W,n,o,r,i,wr,`${L}/${ht(M)}`);if(zt.valid)c[be]=F[be]=!0;else oe=r,q.push({instanceLocation:a,keyword:"patternProperties",keywordLocation:L,error:`Property "${be}" matches pattern "${M}" but does not match associated schema.`},...zt.errors)}}}if(!oe&&Te!==void 0){let L=`${s}/additionalProperties`;for(let M in e){if(F[M])continue;let X=`${a}/${ht(M)}`,W=he(e[M],Te,n,o,r,i,X,L);if(W.valid)c[M]=!0;else oe=r,q.push({instanceLocation:a,keyword:"additionalProperties",keywordLocation:L,error:`Property "${M}" does not match additional properties schema.`},...W.errors)}}else if(!oe&&tt!==void 0){let L=`${s}/unevaluatedProperties`;for(let M in e)if(!c[M]){let X=`${a}/${ht(M)}`,W=he(e[M],tt,n,o,r,i,X,L);if(W.valid)c[M]=!0;else q.push({instanceLocation:a,keyword:"unevaluatedProperties",keywordLocation:L,error:`Property "${M}" does not match unevaluated properties schema.`},...W.errors)}}}else if(d==="array"){if(ut!==void 0&&e.length>ut)q.push({instanceLocation:a,keyword:"maxItems",keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${ut}).`});if(Me!==void 0&&e.length<Me)q.push({instanceLocation:a,keyword:"minItems",keywordLocation:`${s}/minItems`,error:`Array has too few items (${e.length} < ${Me}).`});let G=e.length,F=0,oe=!1;if(Ye!==void 0){let L=`${s}/prefixItems`,M=Math.min(Ye.length,G);for(;F<M;F++){let X=he(e[F],Ye[F],n,o,r,i,`${a}/${F}`,`${L}/${F}`);if(c[F]=!0,!X.valid){if(oe=r,q.push({instanceLocation:a,keyword:"prefixItems",keywordLocation:L,error:"Items did not match schema."},...X.errors),oe)break}}}if(je!==void 0){let L=`${s}/items`;if(Array.isArray(je)){let M=Math.min(je.length,G);for(;F<M;F++){let X=he(e[F],je[F],n,o,r,i,`${a}/${F}`,`${L}/${F}`);if(c[F]=!0,!X.valid){if(oe=r,q.push({instanceLocation:a,keyword:"items",keywordLocation:L,error:"Items did not match schema."},...X.errors),oe)break}}}else for(;F<G;F++){let M=he(e[F],je,n,o,r,i,`${a}/${F}`,L);if(c[F]=!0,!M.valid){if(oe=r,q.push({instanceLocation:a,keyword:"items",keywordLocation:L,error:"Items did not match schema."},...M.errors),oe)break}}if(!oe&&At!==void 0){let M=`${s}/additionalItems`;for(;F<G;F++){let X=he(e[F],At,n,o,r,i,`${a}/${F}`,M);if(c[F]=!0,!X.valid)oe=r,q.push({instanceLocation:a,keyword:"additionalItems",keywordLocation:M,error:"Items did not match additional items schema."},...X.errors)}}}if(St!==void 0)if(G===0&&ke===void 0)q.push({instanceLocation:a,keyword:"contains",keywordLocation:`${s}/contains`,error:"Array is empty. It must contain at least one item matching the schema."});else if(ke!==void 0&&G<ke)q.push({instanceLocation:a,keyword:"minContains",keywordLocation:`${s}/minContains`,error:`Array has less items (${G}) than minContains (${ke}).`});else{let L=`${s}/contains`,M=q.length,X=0;for(let W=0;W<G;W++){let be=he(e[W],St,n,o,r,i,`${a}/${W}`,L);if(be.valid)c[W]=!0,X++;else q.push(...be.errors)}if(X>=(ke||0))q.length=M;if(ke===void 0&&Ae===void 0&&X===0)q.splice(M,0,{instanceLocation:a,keyword:"contains",keywordLocation:L,error:"Array does not contain item matching schema."});else if(ke!==void 0&&X<ke)q.push({instanceLocation:a,keyword:"minContains",keywordLocation:`${s}/minContains`,error:`Array must contain at least ${ke} items matching schema. Only ${X} items were found.`});else if(Ae!==void 0&&X>Ae)q.push({instanceLocation:a,keyword:"maxContains",keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${Ae} items matching schema. ${X} items were found.`})}if(!oe&&Mt!==void 0){let L=`${s}/unevaluatedItems`;for(;F<G;F++){if(c[F])continue;let M=he(e[F],Mt,n,o,r,i,`${a}/${F}`,L);if(c[F]=!0,!M.valid)q.push({instanceLocation:a,keyword:"unevaluatedItems",keywordLocation:L,error:"Items did not match unevaluated items schema."},...M.errors)}}if(kr)for(let L=0;L<G;L++){let M=e[L],X=typeof M==="object"&&M!==null;for(let W=0;W<G;W++){if(L===W)continue;let be=e[W];if(M===be||X&&typeof be==="object"&&be!==null&&la(M,be))q.push({instanceLocation:a,keyword:"uniqueItems",keywordLocation:`${s}/uniqueItems`,error:`Duplicate items at indexes ${L} and ${W}.`}),L=Number.MAX_SAFE_INTEGER,W=Number.MAX_SAFE_INTEGER}}}else if(d==="number"){if(n==="4"){if(Ge!==void 0&&(Fe===!0&&e<=Ge||e<Ge))q.push({instanceLocation:a,keyword:"minimum",keywordLocation:`${s}/minimum`,error:`${e} is less than ${Fe?"or equal to ":""} ${Ge}.`});if(We!==void 0&&(ot===!0&&e>=We||e>We))q.push({instanceLocation:a,keyword:"maximum",keywordLocation:`${s}/maximum`,error:`${e} is greater than ${ot?"or equal to ":""} ${We}.`})}else{if(Ge!==void 0&&e<Ge)q.push({instanceLocation:a,keyword:"minimum",keywordLocation:`${s}/minimum`,error:`${e} is less than ${Ge}.`});if(We!==void 0&&e>We)q.push({instanceLocation:a,keyword:"maximum",keywordLocation:`${s}/maximum`,error:`${e} is greater than ${We}.`});if(Fe!==void 0&&e<=Fe)q.push({instanceLocation:a,keyword:"exclusiveMinimum",keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${Fe}.`});if(ot!==void 0&&e>=ot)q.push({instanceLocation:a,keyword:"exclusiveMaximum",keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${ot}.`})}if(it!==void 0){let G=e%it;if(Math.abs(0-G)>=0.00000011920929&&Math.abs(it-G)>=0.00000011920929)q.push({instanceLocation:a,keyword:"multipleOf",keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${it}.`})}}else if(d==="string"){let G=yt===void 0&&bt===void 0?0:bE(e);if(yt!==void 0&&G<yt)q.push({instanceLocation:a,keyword:"minLength",keywordLocation:`${s}/minLength`,error:`String is too short (${G} < ${yt}).`});if(bt!==void 0&&G>bt)q.push({instanceLocation:a,keyword:"maxLength",keywordLocation:`${s}/maxLength`,error:`String is too long (${G} > ${bt}).`});if(Gt!==void 0&&!new RegExp(Gt,"u").test(e))q.push({instanceLocation:a,keyword:"pattern",keywordLocation:`${s}/pattern`,error:"String does not match pattern."});if(ae!==void 0&&jb[ae]&&!jb[ae](e))q.push({instanceLocation:a,keyword:"format",keywordLocation:`${s}/format`,error:`String does not match format "${ae}".`})}return{valid:q.length===0,errors:q}}var $E=class{schema;draft;shortCircuit;lookup;constructor(e,t="2019-09",n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=on(e)}validate(e){return he(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){if(t)e={...e,$id:t};on(e,this.lookup)}},Ru=class{shortcircuit;draft;constructor(e){this.shortcircuit=e?.shortcircuit??!0,this.draft=e?.draft}_draftFor(e){let t=y_(e,"pass an explicit { draft } to CfWorkerJsonSchemaValidator to validate other dialects.");return t==="draft-7"?"7":t}getValidator(e){let t=new $E(e,this.draft??this._draftFor(e),this.shortcircuit);return(n)=>{let o=t.validate(n);return o.valid?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:o.errors.map((r)=>`${r.instanceLocation}: ${r.error}`).join("; ")}}}};var Bb=Symbol.for("mcp.completable");function Av(e){return!!e&&typeof e==="object"&&Bb in e}function zE(e){return e[Bb]?.complete}var da=15000,TE=2147483647;function zu(e,t){if(!Number.isFinite(e)||e<1)return;let n=setInterval(t,Math.min(e,TE));return n.unref?.(),n}var Hb=class{_listeners=new Set;constructor(e){this.onerror=e}publish(e){for(let t of this._listeners)try{t(e)}catch(n){this.onerror?.(n instanceof Error?n:Error(String(n)))}}subscribe(e){this._listeners.add(e);let t=!0;return()=>{if(!t)return;t=!1,this._listeners.delete(e)}}get listenerCount(){return this._listeners.size}};function Yb(e){return{toolsChanged:()=>e.publish({kind:"tools_list_changed"}),promptsChanged:()=>e.publish({kind:"prompts_list_changed"}),resourcesChanged:()=>e.publish({kind:"resources_list_changed"}),resourceUpdated:(t)=>e.publish({kind:"resource_updated",uri:t})}}function xE(e,t){switch(t.kind){case"tools_list_changed":return e.toolsListChanged===!0;case"prompts_list_changed":return e.promptsListChanged===!0;case"resources_list_changed":return e.resourcesListChanged===!0;case"resource_updated":return e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.includes(t.uri)}}function kE(e,t){let n={},o=(r)=>t===void 0||r===!0;if(e.toolsListChanged===!0&&o(t?.tools?.listChanged))n.toolsListChanged=!0;if(e.promptsListChanged===!0&&o(t?.prompts?.listChanged))n.promptsListChanged=!0;if(e.resourcesListChanged===!0&&o(t?.resources?.listChanged))n.resourcesListChanged=!0;if(e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.length>0&&o(t?.resources?.subscribe))n.resourceSubscriptions=[...e.resourceSubscriptions];return n}function EE(e){switch(e.kind){case"tools_list_changed":return{method:"notifications/tools/list_changed"};case"prompts_list_changed":return{method:"notifications/prompts/list_changed"};case"resources_list_changed":return{method:"notifications/resources/list_changed"};case"resource_updated":return{method:"notifications/resources/updated",params:{uri:e.uri}}}}var Mv=1024;function Ub(e,t,n){return Response.json({jsonrpc:"2.0",error:{code:t,message:n},id:e},{status:200})}function qb(e,t){return{method:e.method,params:{...e.params,_meta:{...e.params?._meta,[Qr]:t}}}}function wE(e){let t=$r(sa).validateRequest("subscriptions/listen",e);return t.ok?t.value.params?.notifications:void 0}function Gb(e){let{bus:t,onerror:n}=e,o=e.maxSubscriptions??Mv,r=e.keepAliveMs??da,i=new Set;function a(s,c,u,d){if(i.size>=o)return n?.(Error(`subscriptions/listen refused: subscription limit reached (${o})`)),Ub(s.id,-32603,"Subscription limit reached");let m=wE(s);if(m===void 0)return Ub(s.id,-32602,"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter");let p=kE(m,u),h=s.id,b=new TextEncoder,R,z=!1,N,B,P,O=(ne)=>{if(z)return;try{R.enqueue(b.encode(ne))}catch(ae){n?.(ae instanceof Error?ae:Error(String(ae)))}},J=(ne,ae)=>{O(`event: message
74
74
  data: ${JSON.stringify({jsonrpc:"2.0",method:ne,params:ae})}
75
75
 
76
76
  `)},Y=(ne)=>{if(z)return;if(ne)O(`event: message
77
77
  data: ${JSON.stringify({jsonrpc:"2.0",id:h,result:{resultType:"complete",_meta:{[Qr]:h,[Pt]:d}}})}
78
78
 
79
- `);z=!0;try{A?.()}catch(ae){n?.(ae instanceof Error?ae:Error(String(ae)))}if(B!==void 0)clearInterval(B);P?.(),i.delete(Y);try{R.close()}catch{}},ee=new ReadableStream({start(ne){R=ne;let ae=qb({method:"notifications/subscriptions/acknowledged",params:{notifications:p}},h);V(ae.method,ae.params),A=t.subscribe((ce)=>{if(z||!vE(p,ce))return;let ue=qb(SE(ce),h);V(ue.method,ue.params)}),B=zu(r,()=>O(`: keepalive
79
+ `);z=!0;try{N?.()}catch(ae){n?.(ae instanceof Error?ae:Error(String(ae)))}if(B!==void 0)clearInterval(B);P?.(),i.delete(Y);try{R.close()}catch{}},ee=new ReadableStream({start(ne){R=ne;let ae=qb({method:"notifications/subscriptions/acknowledged",params:{notifications:p}},h);J(ae.method,ae.params),N=t.subscribe((ce)=>{if(z||!xE(p,ce))return;let ue=qb(EE(ce),h);J(ue.method,ue.params)}),B=zu(r,()=>O(`: keepalive
80
80
 
81
- `)),i.add(Y)},cancel(){Y(!1)}});if(c!==void 0)if(c.aborted)Y(!1);else{let ne=()=>Y(!1);c.addEventListener("abort",ne,{once:!0}),P=()=>c.removeEventListener("abort",ne)}return new Response(ee,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}return{serve:a,closeAll(){for(let s of i)s(!0)},get openCount(){return i.size}}}var bE=8,$E=600000;function RE(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??bE,roundTimeoutMs:e?.roundTimeoutMs??$E,legacyShim:e?.legacyShim??!0}}function Wb(e,t,n){if(n===null||typeof n!=="object"||typeof n.method!=="string")throw new D(I.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let o=n,r=Xy(o);if(r===void 0)throw new D(I.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${o.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:o,required:r}}function zE(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=[...t].map((o)=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function jv(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new D(I.InternalError,t)}var TE=class{constructor(e){this._host=e}async fulfill(e,t,n,o,r){let{maxRounds:i,roundTimeoutMs:a}=this._host,s=o.mcpReq.signal,c=r,u=0;while(!0){if(u+=1,u>i)return jv(e,xb(e,i));let d=c.inputRequests,m=d!=null&&Object.keys(d).length>0,p=typeof c.requestState==="string"?c.requestState:void 0;if(!m&&p===void 0)throw new D(I.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let h;if(m){let z=this._host.resolvedClientCapabilities(o),A=[];for(let[P,O]of Object.entries(d)){let{embedded:V,required:Y}=Wb(e,P,O);if(V.method!=="roots/list"&&V.params===void 0)throw new D(I.InternalError,`Handler for ${e} returned an input request '${P}' of kind '${V.method}' without params`);if(oa(Y,z)!==void 0)return jv(e,`Cannot request input '${P}' (${V.method}): the client on this 2025-era connection did not declare the required capability${z===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);A.push([P,V])}let B=Eb(s);try{let P={relatedRequestId:o.mcpReq.id,timeout:a,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:B.signal},O=await Promise.all(A.map(async([V,Y])=>{try{return[V,await this._dispatchLeg(Y,P)]}catch(ee){throw B.abort(ee),ee}}));h=Object.fromEntries(O)}catch(P){if(s.aborted)throw P;return jv(e,`Fulfilling input required by '${e}' failed: ${P instanceof Error?P.message:String(P)}`)}finally{B.dispose()}}else await kb(Tb,s);let b={...o,mcpReq:{...o.mcpReq,inputResponses:h,droppedInputResponseKeys:void 0,requestState:ca(p)}};if(p!==void 0){let z=await this._host.verifyRequestState(p,b,e);if(z!==void 0)b=wv(b,z)}let R=await t(n,b);if(!Yt(R))return R;c=R}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let n=e.params;if(n.mode==="url"&&n.elicitationId===void 0)n={...n,elicitationId:zE()};return await this._host.sendElicitation(n,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},xE=new Set(["tools/call","prompts/get","resources/read"]),Xb,Qb,e$;function t$(e,t){Xb(e,t)}function r$(e,t){Qb(e,t)}function n$(e){return e$(e)}var o$=class extends Iv{_clientCapabilities;_clientVersion;static{Xb=(e,t)=>{if(t.clientCapabilities!==void 0)e._clientCapabilities=t.clientCapabilities;if(t.clientInfo!==void 0)e._clientVersion=t.clientInfo},Qb=(e,t)=>{let n=t.filter((o)=>!e._supportedProtocolVersions.includes(o));if(n.length>0)e._supportedProtocolVersions=[...e._supportedProtocolVersions,...n];e.setRequestHandler("server/discover",()=>e._ondiscover())},e$=(e)=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new TE({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:(e)=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,n)=>this._verifyRequestState(e,t,n),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){super(t);if(this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Ru,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=RE(t?.inputRequired),t?.cacheHints!==void 0){for(let[n,o]of Object.entries(t.cacheHints))if(o!==void 0)Sv(o,`cacheHints['${n}']`);this._cacheHints=t.cacheHints}if(this.setRequestHandler("initialize",(n)=>this._oninitialize(n)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),pv(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let n=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:o}=e.params,r=bu(yr,o);if(r.success)this._loggingLevels.set(n,r.data);return{}})}buildContext(e,t){let n=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,r,i)=>{if(!this._capabilities.logging)return Promise.resolve();let a;if(this._servedModernEra()){if(a=e.mcpReq.envelope?.[fr],a===void 0)return Promise.resolve()}else a=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);if(a!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(a))return Promise.resolve();return e.mcpReq.notify({method:"notifications/message",params:{level:o,data:r,logger:i}})},elicitInput:(o,r)=>this.elicitInput(o,r),requestSampling:(o,r)=>this.createMessage(o,r)},http:n?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(yr.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let n=this._loggingLevels.get(t);return n?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(n):!1};registerCapabilities(e){if(this.transport)throw new te(ie.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;if(this._capabilities=Pv(this._capabilities,e),!t&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let n=this._cacheHints?.[e],o=xE.has(e);if(n===void 0&&!o)return async(r,i)=>{let a=await t(r,i);if(Yt(a))throw new D(I.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return a};return async(r,i)=>{let a=o?await this._invokeInputRequiredCapableHandler(e,t,r,i):await t(r,i);if(Yt(a)){if(!o)throw new D(I.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return a}return n===void 0?a:hu(a,n)}}return async(n,o)=>{let r=$r(this._negotiatedProtocolVersion),i=r.validateRequest("tools/call",n);if(!i.ok)throw new D(i.reason==="not-in-era"?I.InternalError:I.InvalidParams,i.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${i.message}`);let a=await this._invokeInputRequiredCapableHandler("tools/call",t,n,o);if(Yt(a))return a;let s=fv(a),c=r.validateResult("tools/call",s);if(!c.ok)throw new D(c.reason==="not-in-era"?I.InternalError:I.InvalidParams,c.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${c.message}`);return c.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&Jt(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,n,o){let r=this._servedModernEra(),i=o.mcpReq.requestState();if(i!==void 0&&typeof i!=="string")throw new D(I.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let a=o;if(typeof i==="string"){let m=await this._verifyRequestState(i,o,e);if(m!==void 0)a=wv(o,m)}let s;try{s=await t(n,a)}catch(m){if(m instanceof D&&m.code===I.UrlElicitationRequired){if(!r)throw m;throw new D(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 m}if(!Yt(s))return s;if(!r){if(!this._inputRequiredServing.legacyShim)throw new D(I.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??Wr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,n,a,s)}let c=s.inputRequests,u=c!=null&&Object.keys(c).length>0,d=typeof s.requestState==="string";if(!u&&!d)throw new D(I.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let m=this._inputRequestCapabilityView(o);for(let[p,h]of Object.entries(c)){let{embedded:b,required:R}=Wb(e,p,h),z=oa(R,m);if(z!==void 0)throw new aa({requiredCapabilities:z},`Cannot request input '${p}' (${b.method}): the request's client capabilities do not declare the required capability`)}}return s}async _verifyRequestState(e,t,n){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(Error(`requestState verification rejected ${n}: ${o instanceof Error?o.message:String(o)}`)),new D(I.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[Ot]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new te(ie.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new te(ie.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new te(ie.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new te(ie.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new te(ie.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new te(ie.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new te(ie.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new te(ie.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new te(ie.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new te(ie.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new te(ie.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new te(ie.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new te(ie.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new te(ie.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let n=eb(this._supportedProtocolVersions),o=n.includes(t)?t:n[0]??Wr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:pv(this._supportedProtocolVersions),capabilities:kE(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new te(ie.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages.at(-1),a=Array.isArray(i.content)?i.content:[i.content],s=a.some((m)=>m.type==="tool_result"),c=e.messages.length>1?e.messages.at(-2):void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],d=u.some((m)=>m.type==="tool_use");if(s){if(a.some((m)=>m.type!=="tool_result"))throw new D(I.InvalidParams,"The last message must contain only tool_result content if any is present");if(!d)throw new D(I.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(d){let m=new Set(u.filter((h)=>h.type==="tool_use").map((h)=>h.id)),p=new Set(a.filter((h)=>h.type==="tool_result").map((h)=>h.toolUseId));if(m.size!==p.size||![...m].every((h)=>p.has(h)))throw new D(I.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let n=Boolean(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),r=this._wireCodec().samplingResultVariant(n,o);if(!r.ok)throw new te(ie.InvalidResult,`Invalid sampling/createMessage result: ${r.reason==="invalid"?r.message:r.reason}`);return r.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new te(ie.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new te(ie.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,n){let o=e.mode??"form",r=n?.validateAcceptedContent??!0;switch(o){case"url":{let i=e;return this.request({method:"elicitation/create",params:i},t)}case"form":{let i=e.mode==="form"?e:{...e,mode:"form"},a=await this.request({method:"elicitation/create",params:i},t);if(r&&a.action==="accept"&&a.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(a.content);if(!s.valid)throw new D(I.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){if(s instanceof D)throw s;throw new D(I.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return a}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new te(ie.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function kE(e){return{...e}}var po=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(t===void 0||!t.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return Db;try{let n=zr(t.inputSchema,"input");return this._toolInputSchemaJson[e]=n,n}catch{return}}constructor(e,t){if(this.server=new o$(e,t),t?.capabilities?.tools)this.setToolRequestHandlers();if(t?.capabilities?.resources)this.setResourceRequestHandlers();if(t?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}_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(([,e])=>e.enabled).map(([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?zr(t.inputSchema,"input"):Db,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};if(t.outputSchema)n.outputSchema=zr(t.outputSchema,"output");return n})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let n=this._registeredTools[e.params.name];if(!n)throw new D(I.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new D(I.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(n,e.params.arguments,e.params.name),r=await this.executeToolHandler(n,o,t);if(await this.validateToolOutput(n,r,e.params.name),Yt(r))return r;return this.server.projectCallToolResult(r,n.outputSchemaJson)}catch(o){if(o instanceof D&&o.code===I.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,n){if(!e.inputSchema)return;let o=await rn(e.inputSchema,t??{});if(!o.success)throw new D(I.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${o.error}`);return o.data}async validateToolOutput(e,t,n){if(!e.outputSchema)return;if(Yt(t))return;if(t.isError)return;if(t.structuredContent===void 0)throw new D(I.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=await rn(e.outputSchema,t.structuredContent);if(!o.success)throw new D(I.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${o.error}`)}async executeToolHandler(e,t,n){return e.executor(t,n)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async(e)=>{switch(e.params.ref.type){case"ref/prompt":return zv(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Tv(e),this.handleResourceCompletion(e,e.params.ref);default:throw new D(I.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(e,t){let n=this._registeredPrompts[t.name];if(!n)throw new D(I.InvalidParams,`Prompt ${t.name} not found`);if(!n.enabled)throw new D(I.InvalidParams,`Prompt ${t.name} disabled`);if(!n.argsSchema)return ua;let o=Jb(Vb(n.argsSchema)?.[e.params.argument.name]);if(!Av(o))return ua;let r=hE(o);if(!r)return ua;return Fb(await r(e.params.argument.value,e.params.context))}async handleResourceCompletion(e,t){let n=Object.values(this._registeredResourceTemplates).find((r)=>r.resourceTemplate.uriTemplate.toString()===t.uri);if(!n){if(this._registeredResources[t.uri])return ua;throw new D(I.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return ua;return Fb(await o(e.params.argument.value,e.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(e,t)=>{let n=Object.entries(this._registeredResources).filter(([r,i])=>i.enabled).map(([r,i])=>({uri:r,name:i.name,...i.metadata})),o=[];for(let r of Object.values(this._registeredResourceTemplates)){if(!r.resourceTemplate.listCallback)continue;let i=await r.resourceTemplate.listCallback(t);for(let a of i.resources)o.push({...r.metadata,...a})}return{resources:[...n,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let n;try{n=new URL(e.params.uri)}catch{throw new D(I.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new D(I.InvalidParams,`Resource ${n} disabled`);return hu(await o.readCallback(n,t),o.cacheHint)}for(let r of Object.values(this._registeredResourceTemplates)){let i=r.resourceTemplate.uriTemplate.match(n.toString());if(i)return hu(await r.readCallback(n,i,t),r.cacheHint)}throw new gu(e.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(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?zb(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new D(I.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new D(I.InvalidParams,`Prompt ${e.params.name} disabled`);return n.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0}registerResource(e,t,n,o){let r=n.cacheHint,i=n;if(r!==void 0){Sv(r,`resource ${e}`);let a={...n};delete a.cacheHint,i=a}if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let a=this._createRegisteredResource(e,n.title,t,i,o);if(r!==void 0)a.cacheHint=r;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let a=this._createRegisteredResourceTemplate(e,n.title,t,i,o);if(r!==void 0)a.cacheHint=r;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}_createRegisteredResource(e,t,n,o,r){let i={name:e,title:t,metadata:o,readCallback:r,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:(a)=>{if(a.uri!==void 0&&a.uri!==n){if(delete this._registeredResources[n],a.uri)this._registeredResources[a.uri]=i}if(a.name!==void 0)i.name=a.name;if(a.title!==void 0)i.title=a.title;if(a.metadata!==void 0)i.metadata=a.metadata;if(a.callback!==void 0)i.readCallback=a.callback;if(a.enabled!==void 0)i.enabled=a.enabled;this.sendResourceListChanged()}};return this._registeredResources[n]=i,i}_createRegisteredResourceTemplate(e,t,n,o,r){let i={resourceTemplate:n,title:t,metadata:o,readCallback:r,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:(s)=>{if(s.name!==void 0&&s.name!==e){if(delete this._registeredResourceTemplates[e],s.name)this._registeredResourceTemplates[s.name]=i}if(s.title!==void 0)i.title=s.title;if(s.template!==void 0)i.resourceTemplate=s.template;if(s.metadata!==void 0)i.metadata=s.metadata;if(s.callback!==void 0)i.readCallback=s.callback;if(s.enabled!==void 0)i.enabled=s.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let a=n.uriTemplate.variableNames;if(Array.isArray(a)&&a.some((s)=>!!n.completeCallback(s)))this.setCompletionRequestHandler();return i}_createRegisteredPrompt(e,t,n,o,r,i,a){let s=o,c=r,u={title:t,description:n,argsSchema:o,icons:i,_meta:a,handler:Kb(e,o,r),enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:(d)=>{if(d.name!==void 0&&d.name!==e){if(delete this._registeredPrompts[e],d.name)this._registeredPrompts[d.name]=u}if(d.title!==void 0)u.title=d.title;if(d.description!==void 0)u.description=d.description;if(d.icons!==void 0)u.icons=d.icons;if(d._meta!==void 0)u._meta=d._meta;let m=!1;if(d.argsSchema!==void 0)u.argsSchema=d.argsSchema,s=d.argsSchema,m=!0;if(d.callback!==void 0)c=d.callback,m=!0;if(m)u.handler=Kb(e,s,c);if(d.enabled!==void 0)u.enabled=d.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[e]=u,o){let d=Vb(o);if(d){if(Object.values(d).some((m)=>Av(Jb(m))))this.setCompletionRequestHandler()}}return u}_createRegisteredTool(e,t,n,o,r,i,a,s,c,u){if(Nv(e),o!==void 0)try{let p=zr(o,"input");this._toolInputSchemaJson[e]=p;let h=yu(p);if(!h.valid)console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${h.reason}`)}catch{}let d=u,m={title:t,description:n,inputSchema:o,outputSchema:r,outputSchemaJson:Zb(r),annotations:i,icons:a,execution:s,_meta:c,handler:u,executor:Lb(o,u),enabled:!0,disable:()=>m.update({enabled:!1}),enable:()=>m.update({enabled:!0}),remove:()=>m.update({name:null}),update:(p)=>{if(p.name!==void 0&&p.name!==e){if(typeof p.name==="string")Nv(p.name);if(delete this._registeredTools[e],delete this._toolInputSchemaJson[e],p.name)delete this._toolInputSchemaJson[p.name],this._registeredTools[p.name]=m,e=p.name}if(p.title!==void 0)m.title=p.title;if(p.description!==void 0)m.description=p.description;let h=!1;if(p.paramsSchema!==void 0)m.inputSchema=p.paramsSchema,delete this._toolInputSchemaJson[e],h=!0;if(p.callback!==void 0)m.handler=p.callback,d=p.callback,h=!0;if(h)m.executor=Lb(m.inputSchema,d);if(p.outputSchema!==void 0)m.outputSchema=p.outputSchema,m.outputSchemaJson=Zb(p.outputSchema);if(p.annotations!==void 0)m.annotations=p.annotations;if(p.icons!==void 0)m.icons=p.icons;if(p._meta!==void 0)m._meta=p._meta;if(p.enabled!==void 0)m.enabled=p.enabled;this.sendToolListChanged()}};return this._registeredTools[e]=m,this.setToolRequestHandlers(),this.sendToolListChanged(),m}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:o,description:r,inputSchema:i,outputSchema:a,annotations:s,icons:c,_meta:u}=t;return this._createRegisteredTool(e,o,r,$u(i),$u(a),s,c,void 0,u,n)}registerPrompt(e,t,n){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:o,description:r,argsSchema:i,icons:a,_meta:s}=t,c=this._createRegisteredPrompt(e,o,r,$u(i),n,a,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}};function Lb(e,t){if(e){let o=t;return async(r,i)=>o(r,i)}let n=t;return async(o,r)=>n(r)}var Db={type:"object",properties:{}};function Zb(e){if(e===void 0)return;try{return zr(e,"output")}catch{return}}function Kb(e,t,n){if(t){let o=n;return async(r,i)=>{let a=await rn(t,r);if(!a.success)throw new D(I.InvalidParams,`Invalid arguments for prompt ${e}: ${a.error}`);return o(a.data,i)}}else{let o=n;return async(r,i)=>o(i)}}function Fb(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var ua={completion:{values:[],hasMore:!1}};function Vb(e){let t=e;if(t.shape&&typeof t.shape==="object")return t.shape}function EE(e){return e?.type==="optional"}function Jb(e){if(!EE(e))return e;return e.def?.innerType??e}var wE=class{onclose;onerror;onmessage;_classification;_responseMode;_started=!1;_used=!1;_closed=!1;_terminalDelivered=!1;_dispatchWindowOpen=!1;_requestId;_deferredResponse;_sse;_abortCleanup;_keepAliveMs;constructor(e){this._classification=e.classification,this._responseMode=e.responseMode??"auto",this._keepAliveMs=e.keepAliveMs??da}async start(){if(this._started)throw Error("PerRequestHTTPServerTransport is already started");this._started=!0}async handleMessage(e,t){if(this._used)throw Error("PerRequestHTTPServerTransport serves exactly one exchange; construct a new transport per request");if(!this._started||this.onmessage===void 0)throw Error("PerRequestHTTPServerTransport is not connected: connect a server to this transport before handling a message");if(this._closed)throw Error("PerRequestHTTPServerTransport is closed");this._used=!0;let n=t?.request?.signal;if(n?.aborted)throw await this.close(),new te(ie.ConnectionClosed,"The request was aborted before it could be handled");let o={classification:this._classification,...t?.request!==void 0&&{request:t.request},...t?.authInfo!==void 0&&{authInfo:t.authInfo}};if(Bt(e)){this._requestId=e.id;let r,i,a=new Promise((s,c)=>{r=s,i=c});if(this._deferredResponse={promise:a,resolve:r,reject:i,settled:!1},n!==void 0){let s=()=>void this.close();n.addEventListener("abort",s,{once:!0}),this._abortCleanup=()=>n.removeEventListener("abort",s)}this._dispatchWindowOpen=!0;try{this.onmessage(e,o)}finally{this._dispatchWindowOpen=!1}if(this._responseMode==="sse"&&!this._closed&&!this._deferredResponse.settled)this.upgradeToSse();return a}return this.onmessage(e,o),new Response(null,{status:202})}async send(e,t){if(this._closed)return;let n=Vt(e)||Ht(e),o=n?e.id:t?.relatedRequestId;if(this._requestId===void 0||o===void 0||o!==this._requestId){if(n)this.onerror?.(Error(`Received a response for an unknown request id: ${String(e.id)}`));return}if(n){if(this._terminalDelivered)return;this._terminalDelivered=!0;let r=Ht(e)?e.error.code:void 0,i=r!==void 0&&(this._dispatchWindowOpen||r===I.MissingRequiredClientCapability)?xv[r]:void 0;if(i!==void 0&&this._sse===void 0){this.settleResponse(Response.json(e,{status:i,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}if(this._sse!==void 0||this._responseMode==="sse"){if(this._sse===void 0)this.upgradeToSse();this.writeMessageFrame(e),this.finalizeStream();return}this.settleResponse(Response.json(e,{status:200,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}if(this._responseMode==="json")return;if(this._sse===void 0)this.upgradeToSse();this.writeMessageFrame(e)}writeCommentFrame(e){if(this._closed||this._sse===void 0||this._sse.closed)return;let t=e.split(`
81
+ `)),i.add(Y)},cancel(){Y(!1)}});if(c!==void 0)if(c.aborted)Y(!1);else{let ne=()=>Y(!1);c.addEventListener("abort",ne,{once:!0}),P=()=>c.removeEventListener("abort",ne)}return new Response(ee,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}return{serve:a,closeAll(){for(let s of i)s(!0)},get openCount(){return i.size}}}var IE=8,PE=600000;function OE(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??IE,roundTimeoutMs:e?.roundTimeoutMs??PE,legacyShim:e?.legacyShim??!0}}function Wb(e,t,n){if(n===null||typeof n!=="object"||typeof n.method!=="string")throw new D(I.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let o=n,r=Xy(o);if(r===void 0)throw new D(I.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${o.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:o,required:r}}function CE(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=[...t].map((o)=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function jv(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new D(I.InternalError,t)}var NE=class{constructor(e){this._host=e}async fulfill(e,t,n,o,r){let{maxRounds:i,roundTimeoutMs:a}=this._host,s=o.mcpReq.signal,c=r,u=0;while(!0){if(u+=1,u>i)return jv(e,xb(e,i));let d=c.inputRequests,m=d!=null&&Object.keys(d).length>0,p=typeof c.requestState==="string"?c.requestState:void 0;if(!m&&p===void 0)throw new D(I.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let h;if(m){let z=this._host.resolvedClientCapabilities(o),N=[];for(let[P,O]of Object.entries(d)){let{embedded:J,required:Y}=Wb(e,P,O);if(J.method!=="roots/list"&&J.params===void 0)throw new D(I.InternalError,`Handler for ${e} returned an input request '${P}' of kind '${J.method}' without params`);if(oa(Y,z)!==void 0)return jv(e,`Cannot request input '${P}' (${J.method}): the client on this 2025-era connection did not declare the required capability${z===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);N.push([P,J])}let B=Eb(s);try{let P={relatedRequestId:o.mcpReq.id,timeout:a,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:B.signal},O=await Promise.all(N.map(async([J,Y])=>{try{return[J,await this._dispatchLeg(Y,P)]}catch(ee){throw B.abort(ee),ee}}));h=Object.fromEntries(O)}catch(P){if(s.aborted)throw P;return jv(e,`Fulfilling input required by '${e}' failed: ${P instanceof Error?P.message:String(P)}`)}finally{B.dispose()}}else await kb(Tb,s);let b={...o,mcpReq:{...o.mcpReq,inputResponses:h,droppedInputResponseKeys:void 0,requestState:ca(p)}};if(p!==void 0){let z=await this._host.verifyRequestState(p,b,e);if(z!==void 0)b=wv(b,z)}let R=await t(n,b);if(!Yt(R))return R;c=R}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let n=e.params;if(n.mode==="url"&&n.elicitationId===void 0)n={...n,elicitationId:CE()};return await this._host.sendElicitation(n,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},jE=new Set(["tools/call","prompts/get","resources/read"]),Xb,Qb,e$;function t$(e,t){Xb(e,t)}function r$(e,t){Qb(e,t)}function n$(e){return e$(e)}var o$=class extends Iv{_clientCapabilities;_clientVersion;static{Xb=(e,t)=>{if(t.clientCapabilities!==void 0)e._clientCapabilities=t.clientCapabilities;if(t.clientInfo!==void 0)e._clientVersion=t.clientInfo},Qb=(e,t)=>{let n=t.filter((o)=>!e._supportedProtocolVersions.includes(o));if(n.length>0)e._supportedProtocolVersions=[...e._supportedProtocolVersions,...n];e.setRequestHandler("server/discover",()=>e._ondiscover())},e$=(e)=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new NE({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:(e)=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,n)=>this._verifyRequestState(e,t,n),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){super(t);if(this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Ru,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=OE(t?.inputRequired),t?.cacheHints!==void 0){for(let[n,o]of Object.entries(t.cacheHints))if(o!==void 0)Sv(o,`cacheHints['${n}']`);this._cacheHints=t.cacheHints}if(this.setRequestHandler("initialize",(n)=>this._oninitialize(n)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),pv(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let n=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:o}=e.params,r=bu(yr,o);if(r.success)this._loggingLevels.set(n,r.data);return{}})}buildContext(e,t){let n=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,r,i)=>{if(!this._capabilities.logging)return Promise.resolve();let a;if(this._servedModernEra()){if(a=e.mcpReq.envelope?.[fr],a===void 0)return Promise.resolve()}else a=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);if(a!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(a))return Promise.resolve();return e.mcpReq.notify({method:"notifications/message",params:{level:o,data:r,logger:i}})},elicitInput:(o,r)=>this.elicitInput(o,r),requestSampling:(o,r)=>this.createMessage(o,r)},http:n?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(yr.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let n=this._loggingLevels.get(t);return n?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(n):!1};registerCapabilities(e){if(this.transport)throw new te(ie.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;if(this._capabilities=Pv(this._capabilities,e),!t&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let n=this._cacheHints?.[e],o=jE.has(e);if(n===void 0&&!o)return async(r,i)=>{let a=await t(r,i);if(Yt(a))throw new D(I.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return a};return async(r,i)=>{let a=o?await this._invokeInputRequiredCapableHandler(e,t,r,i):await t(r,i);if(Yt(a)){if(!o)throw new D(I.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return a}return n===void 0?a:hu(a,n)}}return async(n,o)=>{let r=$r(this._negotiatedProtocolVersion),i=r.validateRequest("tools/call",n);if(!i.ok)throw new D(i.reason==="not-in-era"?I.InternalError:I.InvalidParams,i.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${i.message}`);let a=await this._invokeInputRequiredCapableHandler("tools/call",t,n,o);if(Yt(a))return a;let s=fv(a),c=r.validateResult("tools/call",s);if(!c.ok)throw new D(c.reason==="not-in-era"?I.InternalError:I.InvalidParams,c.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${c.message}`);return c.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&Vt(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,n,o){let r=this._servedModernEra(),i=o.mcpReq.requestState();if(i!==void 0&&typeof i!=="string")throw new D(I.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let a=o;if(typeof i==="string"){let m=await this._verifyRequestState(i,o,e);if(m!==void 0)a=wv(o,m)}let s;try{s=await t(n,a)}catch(m){if(m instanceof D&&m.code===I.UrlElicitationRequired){if(!r)throw m;throw new D(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 m}if(!Yt(s))return s;if(!r){if(!this._inputRequiredServing.legacyShim)throw new D(I.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??Wr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,n,a,s)}let c=s.inputRequests,u=c!=null&&Object.keys(c).length>0,d=typeof s.requestState==="string";if(!u&&!d)throw new D(I.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let m=this._inputRequestCapabilityView(o);for(let[p,h]of Object.entries(c)){let{embedded:b,required:R}=Wb(e,p,h),z=oa(R,m);if(z!==void 0)throw new aa({requiredCapabilities:z},`Cannot request input '${p}' (${b.method}): the request's client capabilities do not declare the required capability`)}}return s}async _verifyRequestState(e,t,n){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(Error(`requestState verification rejected ${n}: ${o instanceof Error?o.message:String(o)}`)),new D(I.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[Ot]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new te(ie.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new te(ie.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new te(ie.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new te(ie.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new te(ie.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new te(ie.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new te(ie.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new te(ie.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new te(ie.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new te(ie.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new te(ie.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new te(ie.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new te(ie.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new te(ie.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let n=eb(this._supportedProtocolVersions),o=n.includes(t)?t:n[0]??Wr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:pv(this._supportedProtocolVersions),capabilities:AE(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new te(ie.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages.at(-1),a=Array.isArray(i.content)?i.content:[i.content],s=a.some((m)=>m.type==="tool_result"),c=e.messages.length>1?e.messages.at(-2):void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],d=u.some((m)=>m.type==="tool_use");if(s){if(a.some((m)=>m.type!=="tool_result"))throw new D(I.InvalidParams,"The last message must contain only tool_result content if any is present");if(!d)throw new D(I.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(d){let m=new Set(u.filter((h)=>h.type==="tool_use").map((h)=>h.id)),p=new Set(a.filter((h)=>h.type==="tool_result").map((h)=>h.toolUseId));if(m.size!==p.size||![...m].every((h)=>p.has(h)))throw new D(I.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let n=Boolean(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),r=this._wireCodec().samplingResultVariant(n,o);if(!r.ok)throw new te(ie.InvalidResult,`Invalid sampling/createMessage result: ${r.reason==="invalid"?r.message:r.reason}`);return r.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new te(ie.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new te(ie.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,n){let o=e.mode??"form",r=n?.validateAcceptedContent??!0;switch(o){case"url":{let i=e;return this.request({method:"elicitation/create",params:i},t)}case"form":{let i=e.mode==="form"?e:{...e,mode:"form"},a=await this.request({method:"elicitation/create",params:i},t);if(r&&a.action==="accept"&&a.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(a.content);if(!s.valid)throw new D(I.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){if(s instanceof D)throw s;throw new D(I.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return a}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new te(ie.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function AE(e){return{...e}}var po=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(t===void 0||!t.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return Db;try{let n=zr(t.inputSchema,"input");return this._toolInputSchemaJson[e]=n,n}catch{return}}constructor(e,t){if(this.server=new o$(e,t),t?.capabilities?.tools)this.setToolRequestHandlers();if(t?.capabilities?.resources)this.setResourceRequestHandlers();if(t?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}_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(([,e])=>e.enabled).map(([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?zr(t.inputSchema,"input"):Db,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};if(t.outputSchema)n.outputSchema=zr(t.outputSchema,"output");return n})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let n=this._registeredTools[e.params.name];if(!n)throw new D(I.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new D(I.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(n,e.params.arguments,e.params.name),r=await this.executeToolHandler(n,o,t);if(await this.validateToolOutput(n,r,e.params.name),Yt(r))return r;return this.server.projectCallToolResult(r,n.outputSchemaJson)}catch(o){if(o instanceof D&&o.code===I.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,n){if(!e.inputSchema)return;let o=await rn(e.inputSchema,t??{});if(!o.success)throw new D(I.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${o.error}`);return o.data}async validateToolOutput(e,t,n){if(!e.outputSchema)return;if(Yt(t))return;if(t.isError)return;if(t.structuredContent===void 0)throw new D(I.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=await rn(e.outputSchema,t.structuredContent);if(!o.success)throw new D(I.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${o.error}`)}async executeToolHandler(e,t,n){return e.executor(t,n)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async(e)=>{switch(e.params.ref.type){case"ref/prompt":return zv(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Tv(e),this.handleResourceCompletion(e,e.params.ref);default:throw new D(I.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(e,t){let n=this._registeredPrompts[t.name];if(!n)throw new D(I.InvalidParams,`Prompt ${t.name} not found`);if(!n.enabled)throw new D(I.InvalidParams,`Prompt ${t.name} disabled`);if(!n.argsSchema)return ua;let o=Vb(Jb(n.argsSchema)?.[e.params.argument.name]);if(!Av(o))return ua;let r=zE(o);if(!r)return ua;return Kb(await r(e.params.argument.value,e.params.context))}async handleResourceCompletion(e,t){let n=Object.values(this._registeredResourceTemplates).find((r)=>r.resourceTemplate.uriTemplate.toString()===t.uri);if(!n){if(this._registeredResources[t.uri])return ua;throw new D(I.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return ua;return Kb(await o(e.params.argument.value,e.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(e,t)=>{let n=Object.entries(this._registeredResources).filter(([r,i])=>i.enabled).map(([r,i])=>({uri:r,name:i.name,...i.metadata})),o=[];for(let r of Object.values(this._registeredResourceTemplates)){if(!r.resourceTemplate.listCallback)continue;let i=await r.resourceTemplate.listCallback(t);for(let a of i.resources)o.push({...r.metadata,...a})}return{resources:[...n,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let n;try{n=new URL(e.params.uri)}catch{throw new D(I.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new D(I.InvalidParams,`Resource ${n} disabled`);return hu(await o.readCallback(n,t),o.cacheHint)}for(let r of Object.values(this._registeredResourceTemplates)){let i=r.resourceTemplate.uriTemplate.match(n.toString());if(i)return hu(await r.readCallback(n,i,t),r.cacheHint)}throw new gu(e.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(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?zb(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new D(I.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new D(I.InvalidParams,`Prompt ${e.params.name} disabled`);return n.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0}registerResource(e,t,n,o){let r=n.cacheHint,i=n;if(r!==void 0){Sv(r,`resource ${e}`);let a={...n};delete a.cacheHint,i=a}if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let a=this._createRegisteredResource(e,n.title,t,i,o);if(r!==void 0)a.cacheHint=r;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let a=this._createRegisteredResourceTemplate(e,n.title,t,i,o);if(r!==void 0)a.cacheHint=r;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}_createRegisteredResource(e,t,n,o,r){let i={name:e,title:t,metadata:o,readCallback:r,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:(a)=>{if(a.uri!==void 0&&a.uri!==n){if(delete this._registeredResources[n],a.uri)this._registeredResources[a.uri]=i}if(a.name!==void 0)i.name=a.name;if(a.title!==void 0)i.title=a.title;if(a.metadata!==void 0)i.metadata=a.metadata;if(a.callback!==void 0)i.readCallback=a.callback;if(a.enabled!==void 0)i.enabled=a.enabled;this.sendResourceListChanged()}};return this._registeredResources[n]=i,i}_createRegisteredResourceTemplate(e,t,n,o,r){let i={resourceTemplate:n,title:t,metadata:o,readCallback:r,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:(s)=>{if(s.name!==void 0&&s.name!==e){if(delete this._registeredResourceTemplates[e],s.name)this._registeredResourceTemplates[s.name]=i}if(s.title!==void 0)i.title=s.title;if(s.template!==void 0)i.resourceTemplate=s.template;if(s.metadata!==void 0)i.metadata=s.metadata;if(s.callback!==void 0)i.readCallback=s.callback;if(s.enabled!==void 0)i.enabled=s.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let a=n.uriTemplate.variableNames;if(Array.isArray(a)&&a.some((s)=>!!n.completeCallback(s)))this.setCompletionRequestHandler();return i}_createRegisteredPrompt(e,t,n,o,r,i,a){let s=o,c=r,u={title:t,description:n,argsSchema:o,icons:i,_meta:a,handler:Fb(e,o,r),enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:(d)=>{if(d.name!==void 0&&d.name!==e){if(delete this._registeredPrompts[e],d.name)this._registeredPrompts[d.name]=u}if(d.title!==void 0)u.title=d.title;if(d.description!==void 0)u.description=d.description;if(d.icons!==void 0)u.icons=d.icons;if(d._meta!==void 0)u._meta=d._meta;let m=!1;if(d.argsSchema!==void 0)u.argsSchema=d.argsSchema,s=d.argsSchema,m=!0;if(d.callback!==void 0)c=d.callback,m=!0;if(m)u.handler=Fb(e,s,c);if(d.enabled!==void 0)u.enabled=d.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[e]=u,o){let d=Jb(o);if(d){if(Object.values(d).some((m)=>Av(Vb(m))))this.setCompletionRequestHandler()}}return u}_createRegisteredTool(e,t,n,o,r,i,a,s,c,u){if(Nv(e),o!==void 0)try{let p=zr(o,"input");this._toolInputSchemaJson[e]=p;let h=yu(p);if(!h.valid)console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${h.reason}`)}catch{}let d=u,m={title:t,description:n,inputSchema:o,outputSchema:r,outputSchemaJson:Zb(r),annotations:i,icons:a,execution:s,_meta:c,handler:u,executor:Lb(o,u),enabled:!0,disable:()=>m.update({enabled:!1}),enable:()=>m.update({enabled:!0}),remove:()=>m.update({name:null}),update:(p)=>{if(p.name!==void 0&&p.name!==e){if(typeof p.name==="string")Nv(p.name);if(delete this._registeredTools[e],delete this._toolInputSchemaJson[e],p.name)delete this._toolInputSchemaJson[p.name],this._registeredTools[p.name]=m,e=p.name}if(p.title!==void 0)m.title=p.title;if(p.description!==void 0)m.description=p.description;let h=!1;if(p.paramsSchema!==void 0)m.inputSchema=p.paramsSchema,delete this._toolInputSchemaJson[e],h=!0;if(p.callback!==void 0)m.handler=p.callback,d=p.callback,h=!0;if(h)m.executor=Lb(m.inputSchema,d);if(p.outputSchema!==void 0)m.outputSchema=p.outputSchema,m.outputSchemaJson=Zb(p.outputSchema);if(p.annotations!==void 0)m.annotations=p.annotations;if(p.icons!==void 0)m.icons=p.icons;if(p._meta!==void 0)m._meta=p._meta;if(p.enabled!==void 0)m.enabled=p.enabled;this.sendToolListChanged()}};return this._registeredTools[e]=m,this.setToolRequestHandlers(),this.sendToolListChanged(),m}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:o,description:r,inputSchema:i,outputSchema:a,annotations:s,icons:c,_meta:u}=t;return this._createRegisteredTool(e,o,r,$u(i),$u(a),s,c,void 0,u,n)}registerPrompt(e,t,n){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:o,description:r,argsSchema:i,icons:a,_meta:s}=t,c=this._createRegisteredPrompt(e,o,r,$u(i),n,a,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}};function Lb(e,t){if(e){let o=t;return async(r,i)=>o(r,i)}let n=t;return async(o,r)=>n(r)}var Db={type:"object",properties:{}};function Zb(e){if(e===void 0)return;try{return zr(e,"output")}catch{return}}function Fb(e,t,n){if(t){let o=n;return async(r,i)=>{let a=await rn(t,r);if(!a.success)throw new D(I.InvalidParams,`Invalid arguments for prompt ${e}: ${a.error}`);return o(a.data,i)}}else{let o=n;return async(r,i)=>o(i)}}function Kb(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var ua={completion:{values:[],hasMore:!1}};function Jb(e){let t=e;if(t.shape&&typeof t.shape==="object")return t.shape}function ME(e){return e?.type==="optional"}function Vb(e){if(!ME(e))return e;return e.def?.innerType??e}var UE=class{onclose;onerror;onmessage;_classification;_responseMode;_started=!1;_used=!1;_closed=!1;_terminalDelivered=!1;_dispatchWindowOpen=!1;_requestId;_deferredResponse;_sse;_abortCleanup;_keepAliveMs;constructor(e){this._classification=e.classification,this._responseMode=e.responseMode??"auto",this._keepAliveMs=e.keepAliveMs??da}async start(){if(this._started)throw Error("PerRequestHTTPServerTransport is already started");this._started=!0}async handleMessage(e,t){if(this._used)throw Error("PerRequestHTTPServerTransport serves exactly one exchange; construct a new transport per request");if(!this._started||this.onmessage===void 0)throw Error("PerRequestHTTPServerTransport is not connected: connect a server to this transport before handling a message");if(this._closed)throw Error("PerRequestHTTPServerTransport is closed");this._used=!0;let n=t?.request?.signal;if(n?.aborted)throw await this.close(),new te(ie.ConnectionClosed,"The request was aborted before it could be handled");let o={classification:this._classification,...t?.request!==void 0&&{request:t.request},...t?.authInfo!==void 0&&{authInfo:t.authInfo}};if(Bt(e)){this._requestId=e.id;let r,i,a=new Promise((s,c)=>{r=s,i=c});if(this._deferredResponse={promise:a,resolve:r,reject:i,settled:!1},n!==void 0){let s=()=>void this.close();n.addEventListener("abort",s,{once:!0}),this._abortCleanup=()=>n.removeEventListener("abort",s)}this._dispatchWindowOpen=!0;try{this.onmessage(e,o)}finally{this._dispatchWindowOpen=!1}if(this._responseMode==="sse"&&!this._closed&&!this._deferredResponse.settled)this.upgradeToSse();return a}return this.onmessage(e,o),new Response(null,{status:202})}async send(e,t){if(this._closed)return;let n=Jt(e)||Ht(e),o=n?e.id:t?.relatedRequestId;if(this._requestId===void 0||o===void 0||o!==this._requestId){if(n)this.onerror?.(Error(`Received a response for an unknown request id: ${String(e.id)}`));return}if(n){if(this._terminalDelivered)return;this._terminalDelivered=!0;let r=Ht(e)?e.error.code:void 0,i=r!==void 0&&(this._dispatchWindowOpen||r===I.MissingRequiredClientCapability)?xv[r]:void 0;if(i!==void 0&&this._sse===void 0){this.settleResponse(Response.json(e,{status:i,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}if(this._sse!==void 0||this._responseMode==="sse"){if(this._sse===void 0)this.upgradeToSse();this.writeMessageFrame(e),this.finalizeStream();return}this.settleResponse(Response.json(e,{status:200,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}if(this._responseMode==="json")return;if(this._sse===void 0)this.upgradeToSse();this.writeMessageFrame(e)}writeCommentFrame(e){if(this._closed||this._sse===void 0||this._sse.closed)return;let t=e.split(`
82
82
  `).map((n)=>`: ${n}`).join(`
83
83
  `);this.writeFrame(`${t}
84
84
 
85
85
  `)}async close(){if(this._closed)return;if(this._closed=!0,this._abortCleanup?.(),this._abortCleanup=void 0,this._sse?.keepAliveTimer!==void 0)clearInterval(this._sse.keepAliveTimer);if(this._sse!==void 0&&!this._sse.closed){this._sse.closed=!0;try{this._sse.controller.close()}catch{}}if(this._deferredResponse!==void 0&&!this._deferredResponse.settled)this._deferredResponse.settled=!0,this._deferredResponse.reject(new te(ie.ConnectionClosed,"Connection closed before a response was produced"));this.onclose?.()}settleResponse(e){if(this._deferredResponse===void 0||this._deferredResponse.settled)return;this._deferredResponse.settled=!0,this._deferredResponse.resolve(e)}upgradeToSse(){let e,t=new ReadableStream({start:(n)=>{e=n},cancel:()=>{this.close()}});this._sse={controller:e,encoder:new TextEncoder,closed:!1},this._sse.keepAliveTimer=zu(this._keepAliveMs,()=>this.writeCommentFrame("keepalive")),this.settleResponse(new Response(t,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}}))}finalizeStream(){if(this._sse?.keepAliveTimer!==void 0)clearInterval(this._sse.keepAliveTimer);if(this._sse!==void 0&&!this._sse.closed){this._sse.closed=!0;try{this._sse.controller.close()}catch{}}queueMicrotask(()=>void this.close())}writeMessageFrame(e){this.writeFrame(`event: message
86
86
  data: ${JSON.stringify(e)}
87
87
 
88
- `)}writeFrame(e){if(this._sse===void 0||this._sse.closed)return;try{this._sse.controller.enqueue(this._sse.encoder.encode(e))}catch(t){this.onerror?.(Error(`Failed to write to the response stream: ${t}`))}}};async function IE(e,t,n){let o=new wE({classification:n.classification,...n.responseMode!==void 0&&{responseMode:n.responseMode},...n.keepAliveMs!==void 0&&{keepAliveMs:n.keepAliveMs}});return await e.connect(o),o.handleMessage(t,{...n.request!==void 0&&{request:n.request},...n.authInfo!==void 0&&{authInfo:n.authInfo}})}var Eu=class{sessionIdGenerator;_started=!1;_closed=!1;_streamMapping=new Map;_requestToStreamMapping=new Map;_requestResponseMap=new Map;_initialized=!1;_enableJsonResponse=!1;_standaloneSseStreamId="_GET_stream";_eventStore;_onsessioninitialized;_onsessionclosed;_allowedHosts;_allowedOrigins;_enableDnsRebindingProtection;_retryInterval;_supportedProtocolVersions;_keepAliveMs;sessionId;onclose;onerror;onmessage;constructor(e={}){this.sessionIdGenerator=e.sessionIdGenerator,this._enableJsonResponse=e.enableJsonResponse??!1,this._eventStore=e.eventStore,this._onsessioninitialized=e.onsessioninitialized,this._onsessionclosed=e.onsessionclosed,this._allowedHosts=e.allowedHosts,this._allowedOrigins=e.allowedOrigins,this._enableDnsRebindingProtection=e.enableDnsRebindingProtection??!1,this._retryInterval=e.retryInterval,this._supportedProtocolVersions=e.supportedProtocolVersions??xi,this._keepAliveMs=e.keepAliveMs??da}startKeepAlive(e,t){if(this._closed)return;let n=zu(this._keepAliveMs,()=>{try{e.enqueue(t.encode(`: keepalive
88
+ `)}writeFrame(e){if(this._sse===void 0||this._sse.closed)return;try{this._sse.controller.enqueue(this._sse.encoder.encode(e))}catch(t){this.onerror?.(Error(`Failed to write to the response stream: ${t}`))}}};async function qE(e,t,n){let o=new UE({classification:n.classification,...n.responseMode!==void 0&&{responseMode:n.responseMode},...n.keepAliveMs!==void 0&&{keepAliveMs:n.keepAliveMs}});return await e.connect(o),o.handleMessage(t,{...n.request!==void 0&&{request:n.request},...n.authInfo!==void 0&&{authInfo:n.authInfo}})}var Eu=class{sessionIdGenerator;_started=!1;_closed=!1;_streamMapping=new Map;_requestToStreamMapping=new Map;_requestResponseMap=new Map;_initialized=!1;_enableJsonResponse=!1;_standaloneSseStreamId="_GET_stream";_eventStore;_onsessioninitialized;_onsessionclosed;_allowedHosts;_allowedOrigins;_enableDnsRebindingProtection;_retryInterval;_supportedProtocolVersions;_keepAliveMs;sessionId;onclose;onerror;onmessage;constructor(e={}){this.sessionIdGenerator=e.sessionIdGenerator,this._enableJsonResponse=e.enableJsonResponse??!1,this._eventStore=e.eventStore,this._onsessioninitialized=e.onsessioninitialized,this._onsessionclosed=e.onsessionclosed,this._allowedHosts=e.allowedHosts,this._allowedOrigins=e.allowedOrigins,this._enableDnsRebindingProtection=e.enableDnsRebindingProtection??!1,this._retryInterval=e.retryInterval,this._supportedProtocolVersions=e.supportedProtocolVersions??xi,this._keepAliveMs=e.keepAliveMs??da}startKeepAlive(e,t){if(this._closed)return;let n=zu(this._keepAliveMs,()=>{try{e.enqueue(t.encode(`: keepalive
89
89
 
90
90
  `))}catch{if(n!==void 0)clearInterval(n)}});return n}async start(){if(this._started)throw Error("Transport already started");this._started=!0}setSupportedProtocolVersions(e){this._supportedProtocolVersions=e}createJsonErrorResponse(e,t,n,o){let r={code:t,message:n};if(o?.data!==void 0)r.data=o.data;return Response.json({jsonrpc:"2.0",error:r,id:null},{status:e,headers:{"Content-Type":"application/json",...o?.headers}})}validateRequestHeaders(e){if(!this._enableDnsRebindingProtection)return;if(this._allowedHosts&&this._allowedHosts.length>0){let t=e.headers.get("host");if(!t||!this._allowedHosts.includes(t)){let n=`Invalid Host header: ${t}`;return this.onerror?.(Error(n)),this.createJsonErrorResponse(403,-32000,n)}}if(this._allowedOrigins&&this._allowedOrigins.length>0){let t=e.headers.get("origin");if(t&&!this._allowedOrigins.includes(t)){let n=`Invalid Origin header: ${t}`;return this.onerror?.(Error(n)),this.createJsonErrorResponse(403,-32000,n)}}}async handleRequest(e,t){if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");let n=this.validateRequestHeaders(e);if(n)return n;switch(e.method){case"POST":return this.handlePostRequest(e,t);case"GET":return this.handleGetRequest(e);case"DELETE":return this.handleDeleteRequest(e);default:return this.handleUnsupportedRequest()}}supportsEmptySSEData(e){return this._supportedProtocolVersions.includes(e)&&e>="2025-11-25"}async writePrimingEvent(e,t,n,o){if(!this._eventStore)return;if(!this.supportsEmptySSEData(o))return;let r=await this._eventStore.storeEvent(n,{}),i=`id: ${r}
91
91
  data:
@@ -98,14 +98,14 @@ data:
98
98
  `;if(o)r+=`id: ${o}
99
99
  `;return r+=`data: ${JSON.stringify(n)}
100
100
 
101
- `,e.enqueue(t.encode(r)),!0}catch(r){return this.onerror?.(r),!1}}handleUnsupportedRequest(){return this.onerror?.(Error("Method not allowed.")),Response.json({jsonrpc:"2.0",error:{code:-32000,message:"Method not allowed."},id:null},{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest(e,t){try{let n=e.headers.get("accept");if(!n?.includes("application/json")||!n.includes("text/event-stream"))return this.onerror?.(Error("Not Acceptable: Client must accept both application/json and text/event-stream")),this.createJsonErrorResponse(406,-32000,"Not Acceptable: Client must accept both application/json and text/event-stream");if(!Cv(e.headers.get("content-type")))return this.onerror?.(Error("Unsupported Media Type: Content-Type must be application/json")),this.createJsonErrorResponse(415,-32000,"Unsupported Media Type: Content-Type must be application/json");let o=e,r;if(t?.parsedBody===void 0)try{r=await e.json()}catch(R){return this.onerror?.(R),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}else r=t.parsedBody;let i;try{i=Array.isArray(r)?r.map((R)=>Wn.parse(R)):[Wn.parse(r)]}catch(R){return this.onerror?.(R),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");let a=i.some((R)=>Rv(R));if(a){if(this._initialized&&this.sessionId!==void 0)return this.onerror?.(Error("Invalid Request: Server already initialized")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(i.length>1)return this.onerror?.(Error("Invalid Request: Only one initialization request is allowed")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");if(this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized)await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!a){let R=this.validateSession(e);if(R)return R;let z=this.validateProtocolVersion(e);if(z)return z}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");if(!i.some((R)=>Bt(R))){for(let R of i)this.onmessage?.(R,{authInfo:t?.authInfo,request:o});return new Response(null,{status:202})}let s=crypto.randomUUID(),c=i.find((R)=>Rv(R)),u=c?c.params.protocolVersion:e.headers.get("mcp-protocol-version")??bc;if(this._enableJsonResponse)return new Promise((R)=>{this._streamMapping.set(s,{resolveJson:R,cleanup:()=>{this._streamMapping.delete(s)}});for(let z of i)if(Bt(z))this._requestToStreamMapping.set(z.id,s);for(let z of i)this.onmessage?.(z,{authInfo:t?.authInfo,request:o})});let d=new TextEncoder,m,p,h=new ReadableStream({start:(R)=>{m=R},cancel:()=>{if(p!==void 0)clearInterval(p);if(this._streamMapping.get(s)?.controller===m)this._streamMapping.delete(s)}}),b={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};if(this.sessionId!==void 0)b["mcp-session-id"]=this.sessionId;for(let R of i)if(Bt(R))this._streamMapping.set(s,{controller:m,encoder:d,cleanup:()=>{if(p!==void 0)clearInterval(p);this._streamMapping.delete(s);try{m.close()}catch{}}}),this._requestToStreamMapping.set(R.id,s);await this.writePrimingEvent(m,d,s,u);for(let R of i){let z,A;if(Bt(R)&&this._eventStore&&this.supportsEmptySSEData(u))z=()=>{this.closeSSEStream(R.id)},A=()=>{this.closeStandaloneSSEStream()};this.onmessage?.(R,{authInfo:t?.authInfo,request:o,closeSSEStream:z,closeStandaloneSSEStream:A})}if(this._streamMapping.get(s)?.controller===m)p=this.startKeepAlive(m,d);return new Response(h,{status:200,headers:b})}catch(n){return this.onerror?.(n),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(n)})}}async handleDeleteRequest(e){let t=this.validateSession(e);if(t)return t;let n=this.validateProtocolVersion(e);if(n)return n;try{return await Promise.resolve(this._onsessionclosed?.(this.sessionId)),new Response(null,{status:200})}finally{await this.close()}}validateSession(e){if(this.sessionIdGenerator===void 0)return;if(!this._initialized)return this.onerror?.(Error("Bad Request: Server not initialized")),this.createJsonErrorResponse(400,-32000,"Bad Request: Server not initialized");let t=e.headers.get("mcp-session-id");if(!t)return this.onerror?.(Error("Bad Request: Mcp-Session-Id header is required")),this.createJsonErrorResponse(400,-32000,"Bad Request: Mcp-Session-Id header is required");if(t!==this.sessionId)return this.onerror?.(Error("Session not found")),this.createJsonErrorResponse(404,-32001,"Session not found")}validateProtocolVersion(e){let t=e.headers.get("mcp-protocol-version");if(t!==null&&!this._supportedProtocolVersions.includes(t)){let n=`Bad Request: Unsupported protocol version: ${t} (supported versions: ${this._supportedProtocolVersions.join(", ")})`;return this.onerror?.(Error(n)),this.createJsonErrorResponse(400,-32000,n)}}async close(){if(this._closed)return;this._closed=!0;for(let{cleanup:e}of this._streamMapping.values())e();this._streamMapping.clear(),this._requestResponseMap.clear(),this.onclose?.()}closeSSEStream(e){let t=this._requestToStreamMapping.get(e);if(!t)return;let n=this._streamMapping.get(t);if(n)n.cleanup()}closeStandaloneSSEStream(){let e=this._streamMapping.get(this._standaloneSseStreamId);if(e)e.cleanup()}async send(e,t){let n=t?.relatedRequestId;if(Vt(e)||Ht(e))n=e.id;if(n===void 0){if(Vt(e)||Ht(e))throw Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let i;if(this._eventStore)i=await this._eventStore.storeEvent(this._standaloneSseStreamId,e);let a=this._streamMapping.get(this._standaloneSseStreamId);if(a===void 0)return;if(a.controller&&a.encoder&&(i===void 0||!a.replayedEventIds?.has(i)))this.writeSSEEvent(a.controller,a.encoder,e,i);return}let o=this._requestToStreamMapping.get(n);if(!o)throw Error(`No connection established for request ID: ${String(n)}`);let r=this._streamMapping.get(o);if(!this._enableJsonResponse){let i;if(this._eventStore)i=await this._eventStore.storeEvent(o,e),r=this._streamMapping.get(o);if(r?.controller&&r?.encoder&&(i===void 0||!r.replayedEventIds?.has(i)))this.writeSSEEvent(r.controller,r.encoder,e,i)}if(Vt(e)||Ht(e)){this._requestResponseMap.set(n,e);let i=[...this._requestToStreamMapping.entries()].filter(([a,s])=>s===o).map(([a])=>a);if(i.every((a)=>this._requestResponseMap.has(a))){if(!r){if(this._enableJsonResponse)throw Error(`No connection established for request ID: ${String(n)}`);if(!this._eventStore){this.onerror?.(Error(`Response for request ID ${String(n)} is undeliverable: per-request stream is disconnected and no eventStore is configured`));for(let a of i)this._requestResponseMap.delete(a),this._requestToStreamMapping.delete(a);return}for(let a of i)this._requestResponseMap.delete(a),this._requestToStreamMapping.delete(a);return}if(this._enableJsonResponse&&r.resolveJson){let a={"Content-Type":"application/json"};if(this.sessionId!==void 0)a["mcp-session-id"]=this.sessionId;let s=i.map((c)=>this._requestResponseMap.get(c));if(s.length===1)r.resolveJson(Response.json(s[0],{status:200,headers:a}));else r.resolveJson(Response.json(s,{status:200,headers:a}));r.cleanup()}else r.cleanup();for(let a of i)this._requestResponseMap.delete(a),this._requestToStreamMapping.delete(a)}}}};function Tr(e){if(e===null||typeof e!=="object"||Array.isArray(e))return null;let{method:t,id:n}=e;if(typeof t!=="string")return null;return typeof n==="string"||typeof n==="number"?n:null}function xr(e,t,n,o,r=null){return Response.json({jsonrpc:"2.0",error:{code:t,message:n,...o!==void 0&&{data:o}},id:r},{status:e})}function Tu(e,t=null){return xr(e.httpStatus,e.code,e.message,e.data,t)}function xu(e){return e instanceof Error?e:Error(String(e))}function ku(e=null){return xr(500,-32603,"Internal server error",void 0,e)}function PE(e,t,n){return async(o,r)=>{if(o.method.toUpperCase()!=="POST")return xr(405,-32000,"Method not allowed.");try{let i=await e({era:"legacy",...r?.authInfo!==void 0&&{authInfo:r.authInfo},requestInfo:o}),a=new Eu({sessionIdGenerator:void 0,...n!==void 0&&{keepAliveMs:n}});await i.connect(a);let s=()=>{a.close().catch(()=>{}),i.close().catch(()=>{})};o.signal?.addEventListener("abort",s,{once:!0});let c=await a.handleRequest(o,{...r?.authInfo!==void 0&&{authInfo:r.authInfo},...r?.parsedBody!==void 0&&{parsedBody:r.parsedBody}});if(c.body===null||Ov(c.headers.get("content-type"))!=="text/event-stream")return s(),c;let u=c.body.getReader(),d=!1,m=()=>{if(!d)d=!0,s()},p=new ReadableStream({pull:async(h)=>{try{let{done:b,value:R}=await u.read();if(b){m(),h.close();return}if(R!==void 0)h.enqueue(R)}catch(b){m(),h.error(b)}},cancel:(h)=>(m(),u.cancel(h).catch(()=>{}))});return new Response(p,{status:c.status,statusText:c.statusText,headers:c.headers})}catch(i){try{t?.(xu(i))}catch{}return ku(Tr(r?.parsedBody))}}}async function i$(e,t,n=!0){let o=e.method.toUpperCase(),r,i=t,a=e,s=!1;if(o==="POST"){if(i===void 0){if(n)a=e.clone();let c;try{c=await e.text()}catch{return{step:"unreadable-body"}}try{r=c.length===0?void 0:JSON.parse(c)}catch{s=!0}if(!s&&r!==void 0)i=r}else r=i;if(s||r===void 0)return{step:"no-json-body",forwardRequest:a}}return{step:"classified",outcome:bb({httpMethod:o,protocolVersionHeader:e.headers.get("mcp-protocol-version")??void 0,mcpMethodHeader:e.headers.get("mcp-method")??void 0,mcpNameHeader:e.headers.get("mcp-name")??void 0,...r!==void 0&&{body:r}}),body:r,parsedBody:i,forwardRequest:a}}async function a$(e,t){let n=await i$(t===void 0&&e.method.toUpperCase()==="POST"?e.clone():e,t,!1);return n.step==="no-json-body"||n.step==="classified"&&n.outcome.kind==="legacy"}function s$(e,t={}){let{legacy:n,onerror:o,responseMode:r}=t;if(typeof n==="function")throw TypeError("The 'legacy' option only accepts 'stateless' or 'reject', not a handler function. To serve 2025-era traffic with your own handler, route in user land with the exported isLegacyRequest(request) predicate in front of a strict (legacy: 'reject') handler.");let i=new Set,a=!1,s=(z)=>{try{o?.(z)}catch{}},c=t.bus??new Hb(s),u=Yb(c),d=Gb({bus:c,maxSubscriptions:t.maxSubscriptions??Mv,keepAliveMs:t.keepAliveMs??da,onerror:s});if(r==="json")console.warn("responseMode: 'json' drops mid-call notifications. subscriptions/listen streams are always served over SSE regardless; other notifications emitted before a result are dropped.");let m=n==="reject"?void 0:PE(e,s,t.keepAliveMs);async function p(z,A,B){let P=z.classification.revision;if(P===void 0||!ia.includes(P)){let ce=new vu({supported:[...ia],requested:P??"unknown"});return s(ce),xr(400,ce.code,ce.message,ce.data,Tr(z.message))}let O=Sb({httpMethod:A.method,mcpMethodHeader:A.headers.get("mcp-method")??void 0,mcpNameHeader:A.headers.get("mcp-name")??void 0},z);if(O!==void 0)return s(Error(`Rejected inbound request (${O.cell}): ${O.message}`)),Tu(O,Tr(z.message));let V=z.messageKind==="request"?Rr(z.message.params):void 0,Y=V?.[Ot];if(z.messageKind==="request"){let ce=Wy(z.message.method);if(ce!==void 0){let ue=oa(ce,Y);if(ue!==void 0){let Te=new aa({requiredCapabilities:ue});return s(Te),xr(_b(Te.code,"ladder"),Te.code,Te.message,Te.data,z.message.id)}}}let ee=await e({era:"modern",...B!==void 0&&{authInfo:B},requestInfo:A}),ne=ee instanceof po?ee.server:ee;if(z.messageKind==="request"&&z.message.method==="subscriptions/listen"){let ce=ne.getCapabilities(),ue=n$(ne);return ee.close().catch(s),d.serve(z.message,A.signal,ce,ue)}if(z.messageKind==="request"&&z.message.method==="tools/call"&&ee instanceof po){let ce=z.message.params,ue=typeof ce?.name==="string"?ce.name:void 0,Te=ue===void 0?void 0:ee.toolInputSchemaJson(ue);if(Te!==void 0){let tt=yu(Te);if(tt.valid&&tt.declarations.length>0){let Ne=vb(tt.declarations,ce?.arguments,A.headers);if(Ne!==void 0)return ee.close().catch(s),s(Error(`Rejected inbound request (${Ne.cell}): ${Ne.message}`)),Tu(Ne,z.message.id)}}}if(Nb(ne,P),r$(ne,ia),V!==void 0)t$(ne,{clientInfo:V[Xr],clientCapabilities:Y});let ae=ne.onclose;i.add(ne),ne.onclose=()=>{i.delete(ne),ae?.()};try{let ce=await IE(ee,z.message,{classification:z.classification,request:A,...B!==void 0&&{authInfo:B},...r!==void 0&&{responseMode:r},...t.keepAliveMs!==void 0&&{keepAliveMs:t.keepAliveMs}});if(z.messageKind==="notification")queueMicrotask(()=>void ne.close().catch(()=>{}));return ce}catch(ce){if(ce instanceof te&&ce.code===ie.ConnectionClosed)return new Response(null,{status:499});return await ne.close().catch(()=>{}),i.delete(ne),s(xu(ce)),ku(Tr(z.message))}}async function h(z,A,B,P){if(m!==void 0)return m(A,{...B!==void 0&&{authInfo:B},...P!==void 0&&{parsedBody:P}});let O=$b(z,ia);if(O===void 0)return new Response(null,{status:202});return s(Error(`Rejected 2025-era request on a modern-only endpoint (${O.cell}): ${O.message}`)),Tu(O,Tr(P))}async function b(z,A){let B=A?.authInfo;if(z.method.toUpperCase()==="POST"&&!Cv(z.headers.get("content-type")))return s(Error("Unsupported Media Type: Content-Type must be application/json")),xr(415,-32000,"Unsupported Media Type: Content-Type must be application/json");let P=await i$(z,A?.parsedBody);if(P.step==="unreadable-body")return xr(400,-32700,"Parse error: the request body could not be read");if(P.step==="no-json-body"){if(m!==void 0)return m(P.forwardRequest,{...B!==void 0&&{authInfo:B}});return xr(400,-32700,"Parse error: the request body is not valid JSON")}let{outcome:O,body:V,parsedBody:Y,forwardRequest:ee}=P;try{switch(O.kind){case"reject":return s(Error(`Rejected inbound request (${O.cell}): ${O.message}`)),Tu(O,Tr(V));case"modern":return await p(O,z,B);case"legacy":return await h(O,ee,B,Y)}}catch(ne){return s(xu(ne)),ku(Tr(V))}}return{fetch:async(z,A)=>{if(a)throw Error("This MCP handler has been closed");try{return await b(z,A)}catch(B){return s(xu(B)),ku(Tr(A?.parsedBody))}},notify:u,bus:c,close:async()=>{a=!0,d.closeAll();let z=[...i].map((A)=>A.close().catch(()=>{}));i.clear(),await Promise.all(z)}}}function Uv(e){if(typeof e!=="string")return null;let t=e.replace(/[^\x20-\x7e]/g," ").replace(/\s+/g," ").trim();if(!t)return null;return t.slice(0,128).trim()}function c$(e,t,n){if(!t)return;let o=Uv(n.clientName);if(o)e.set("X-MCP-Client-Name",o);let r=n.clientInfo?.(),i=Uv(r?.name);if(i)e.set("X-MCP-Client-Info-Name",i);let a=Uv(r?.version);if(a)e.set("X-MCP-Client-Info-Version",a)}var OE=new Map([["oauth_connection_revoked","The upstream account for this server was disconnected. Reconnect it in MCPCloud to use this tool."],["oauth_refresh_failed","The upstream account for this server could not be refreshed. Reconnect it in MCPCloud to use this tool."],["oauth_refresh_token_missing","The upstream account for this server cannot be refreshed. Reconnect it in MCPCloud to use this tool."],["oauth_elicitation_required","Authentication is required to use this tool."],["oauth_rate_limited","Too many credential requests for this server. Wait a moment and retry."],["oauth_runtime_grant_invalid","MCPCloud rejected this server's credential request. Redeploy the server if this keeps happening."]]);function CE(e){if(!e||typeof e!=="object"||Array.isArray(e))return null;let t=e.error;if(!t||typeof t!=="object")return null;let n=t.code;return typeof n==="string"&&n?n:null}function qv(e,t){let n=CE(e);return n&&OE.get(n)||t}var l$=-32042;function u$(e){if(!e||typeof e!=="object"||Array.isArray(e))return null;let t=e.elicitation;if(!t||typeof t!=="object")return null;let n=t;if(typeof n.url!=="string"||!n.url)return null;return{url:n.url,message:typeof n.message==="string"&&n.message?n.message:"Authentication is required to use this tool.",elicitationId:typeof n.elicitationId==="string"?n.elicitationId:""}}async function NE(e,t,n){if(!e.oauth)throw Error("OAuth runtime settings are not available for this generated server.");let o=e.oauth.mode==="perMember"?t.runtimeToken:null,r=await qu(e,{connectionId:e.oauth.connectionId,forceRefresh:n,callerRuntimeToken:o}),i=await r.json().catch(()=>null);if(!r.ok){let s=u$(i);if(s)throw new D(l$,s.message,{elicitations:[{mode:"url",message:s.message,url:s.url,elicitationId:s.elicitationId}]});throw Error(qv(i,"Unable to resolve the delegated OAuth access token from MCPCloud."))}if(!i||typeof i!=="object"||Array.isArray(i))throw Error("Unable to resolve the delegated OAuth access token from MCPCloud.");let a=typeof i.accessToken==="string"&&i.accessToken.trim()?i.accessToken.trim():null;if(!a)throw Error("MCPCloud did not return an OAuth access token for this request.");return{accessToken:a,tokenType:typeof i.tokenType==="string"&&i.tokenType.trim()?i.tokenType.trim():null}}async function jE(e,t,n){if(!t.runtimeToken)throw Error("Per-member upstream keys require a protected deployment with a verified caller identity.");let o=await f_(e,{callerRuntimeToken:t.runtimeToken,reportInvalid:n}),r=await o.json().catch(()=>null);if(!o.ok){let a=u$(r);if(a)throw new D(l$,a.message,{elicitations:[{mode:"url",message:a.message,url:a.url,elicitationId:a.elicitationId}]});throw Error(qv(r,"Unable to resolve your upstream API key from MCPCloud."))}let i=r&&typeof r.apiKey==="string"&&r.apiKey.trim()?r.apiKey.trim():null;if(!i)throw Error("MCPCloud did not return an upstream API key for this request.");return i}function d$(e){return e.some((t)=>t.type==="oauth2"||t.type==="openIdConnect")}function m$(e,t,n){if(!n)return!1;let o=n.toolOverrides[e];if(o==="on")return!0;if(o==="off")return!1;return n.applyToAllTools||d$(t)}async function ma(e,t,n,o,r=!1){let i=new Headers;c$(i,e.forwardClientIdentity,o);for(let[u,d]of Object.entries(e.customHeaders))i.set(u,d);if(m$(t,n,e.oauth)&&e.oauth){let u=await NE(e,o,r);return i.set("Authorization",`${u.tokenType||"Bearer"} ${u.accessToken}`),i}let a=e.memberKey?await jE(e,o,r):e.apiKey;if(!a)return i;let s=n.find((u)=>u.type==="apiKey"&&u.in==="header");if(s)return i.set(s.name||e.apiKeyHeader,`${e.apiKeyPrefix}${a}`),i;if(n.find((u)=>u.type==="http"&&u.scheme?.toLowerCase()==="bearer"))return i.set("Authorization",`Bearer ${a}`),i;return i.set(e.apiKeyHeader,`${e.apiKeyPrefix}${a}`),i}var AE=new Set([408,429,500,502,503,504]);function p$(e){return AE.has(e)}class pa extends Error{status;retryable;retryAfterSeconds;constructor(e,t,n=null){super(e);this.name="UpstreamHttpError",this.status=t,this.retryable=p$(t),this.retryAfterSeconds=n}}class an extends Error{toolName;issues;constructor(e,t){super(`Invalid input for ${e}: ${t.join("; ")}`);this.name="ToolInputError",this.toolName=e,this.issues=t}}function Lv(e){if(e instanceof pa)return{error:e.message,errorClass:"UPSTREAM",httpStatus:e.status,retryable:e.retryable,...e.retryAfterSeconds!==null?{retryAfterSeconds:e.retryAfterSeconds}:{}};if(e instanceof an)return{error:e.message,errorClass:"BINDING_MISUSE",retryable:!1};return{error:e instanceof Error?e.message:typeof e==="string"?e:"Tool execution failed.",errorClass:"INTERNAL",retryable:!1}}function ME(e){return typeof e==="object"&&e!==null&&e.code===-32042}function f$(e){let t=Lv(e);return{content:[{type:"text",text:t.error}],isError:!0,_meta:{...t}}}function h$(e){let n=e.data?.elicitations;if(!Array.isArray(n))return[];return n.filter((o)=>Boolean(o)&&typeof o==="object"&&typeof o.url==="string")}function UE(e,t){let n=h$(e);if(n.length===0)return null;let o=e instanceof Error&&e.message||"Authorization is required.",r=Object.fromEntries(n.map((i,a)=>[i.elicitationId||`elicitation_${a}`,t.elicitUrl({url:i.url,message:i.message||o})]));return t({inputRequests:r})}function qE(e,t){if(!t)return null;if(t.elicitation)return null;let n=h$(e);if(n.length===0)return null;let o=e instanceof Error&&e.message||"Authorization is required.",r=n.map((i)=>`${i.message||o} Open this page to continue, then run the tool again: ${i.url}`);return r.push("Reconnecting or signing in to MCPCloud again will not resolve this — the credential has to be provided at the link above."),{content:[{type:"text",text:r.join(" ")}],isError:!0,_meta:{...Lv(e),errorClass:"POLICY_DENIED",retryable:!1,elicitationUndeliverable:!0,elicitationUrls:n.map((i)=>i.url)}}}async function fa(e,t){try{return await e()}catch(n){if(ME(n)){let o=qE(n,t?.clientCapabilities?.());if(o)return o;if(t?.era==="modern"&&t.inputRequired){let r=UE(n,t.inputRequired);if(r)return r}throw n}return f$(n)}}function ha(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function LE(e,t){let n=e.properties;if(!n||typeof n!=="object"||Array.isArray(n))return null;let o=n[t];if(!o||typeof o!=="object"||Array.isArray(o))return null;let r=o["x-location"];return typeof r==="string"&&r.trim()?r:null}function v$(e){return e.endpoint.protocol==="graphql"&&Boolean(e.endpoint.document)}function g$(e,t){if(/^https?:\/\//i.test(t))return new URL(t);let n=e.replace(/\/+$/,"");if(!/^https?:\/\//i.test(n))throw Error(`Upstream base URL is not configured for this server — set UPSTREAM_BASE_URL to an absolute http(s) URL in Settings → General (got ${n?`"${n}"`:"an empty value"}).`);return new URL(t?`${n}/${t.replace(/^\/+/,"")}`:n)}async function DE(e,t,n,o,r=!1){let i=g$(n.upstreamBaseUrl,e.endpoint.path),a=await ma(n,e.name,e.auth,o,r);if(v$(e)){a.set("Accept","application/json"),a.set("Content-Type","application/json");let m=Object.fromEntries(Object.entries(t).filter(([,h])=>h!==void 0)),p=JSON.stringify({query:e.endpoint.document,operationName:e.endpoint.operationId??e.endpoint.rootField??void 0,variables:m});return{url:i.toString(),init:{method:"POST",headers:a,body:p}}}let s=e.endpoint.path.replace(/\{([^}]+)\}/g,(m,p)=>encodeURIComponent(String(t[p]??"")));i.pathname=g$(n.upstreamBaseUrl,s).pathname;let c,u;for(let[m,p]of Object.entries(t)){let h=LE(e.inputSchema,m);if(h==="path")continue;if(h==="query"){if(Array.isArray(p))for(let b of p)i.searchParams.append(m,String(b));else if(p!==void 0&&p!==null)i.searchParams.set(m,String(p));continue}if(h==="header"&&p!==void 0&&p!==null){a.set(m,String(p));continue}if(m==="body"&&p!==void 0)u=p}let d=!["GET","HEAD"].includes(e.endpoint.method.toUpperCase());if(u!==void 0&&d)if(e.endpoint.requestBodyContentType==="application/x-www-form-urlencoded")c=_$(u),a.set("Content-Type","application/x-www-form-urlencoded");else c=JSON.stringify(u),a.set("Content-Type","application/json");return{url:i.toString(),init:{method:e.endpoint.method,headers:a,body:c}}}function _$(e){let t=new URLSearchParams;return Dv(t,null,e),t.toString()}function Dv(e,t,n){if(n===void 0||n===null)return;if(Array.isArray(n)){n.forEach((o,r)=>{Dv(e,t?`${t}[${r}]`:String(r),o)});return}if(ha(n)){for(let[o,r]of Object.entries(n)){let i=t?`${t}[${o}]`:o;Dv(e,i,r)}return}if(t===null)return;e.append(t,typeof n==="string"?n:String(n))}async function ZE(e){if((e.headers.get("content-type")||"").includes("application/json"))return await e.json();let n=await e.text();if(!n)return null;try{return JSON.parse(n)}catch{return n}}function S$(e){if(!ha(e)||!Array.isArray(e.errors)||!e.errors.length)return null;let t=e.errors.map((n)=>ha(n)&&typeof n.message==="string"?n.message.trim():null).filter((n)=>Boolean(n));return t.length?t.join(" "):"GraphQL execution failed."}function KE(e){if(!e)return null;let t=e.trim();if(!t)return null;let n=Number(t);if(Number.isFinite(n))return n>=0?Math.ceil(n):null;let o=Date.parse(t);if(Number.isNaN(o))return null;return Math.max(0,Math.ceil((o-Date.now())/1000))}function y$(e,t){if(!t?.memberKey)return null;if(e!==401&&e!==403)return null;let o=`The credential you connected for ${t.serverName?`“${t.serverName}”`:"this server"} was refused by the upstream API — it was most likely revoked, rotated or expired.`;return t.memberKey.connectPageUrl?`${o} Reconnect at ${t.memberKey.connectPageUrl} — signing in to MCPCloud again will not fix it.`:`${o} Reconnect it on this server's MCPCloud connect page — signing in to MCPCloud again will not fix it.`}function Zv(e,t,n,o=null,r){let i=S$(n),a=e.errorMappings.find((m)=>m.statusCode===String(t)),s=i||(typeof n==="string"?n:n?JSON.stringify(n,null,2):"No response body was returned."),c=a?.message?`${a.message} (HTTP ${t})`:`Upstream request failed with status ${t}.`,u=y$(t,r),d=u?`${c} ${u} ${s}`:`${c} ${s}`;return new pa(d,t,o)}function FE(e,t,n,o){if(!t.ok)throw Zv(e,t.status,n,KE(t.headers.get("retry-after")),o);if(!v$(e))return n;if(S$(n))throw Zv(e,t.status||200,n);if(!ha(n)||!ha(n.data))throw Error("GraphQL execution did not return a data payload.");if(e.endpoint.rootField&&Object.prototype.hasOwnProperty.call(n.data,e.endpoint.rootField))return n.data[e.endpoint.rootField];return n.data}function VE(e,t){if(t===null)return`${e.title} completed successfully.`;if(typeof t==="string")return t;return JSON.stringify(t,null,2)}function b$(e){let t=e.previousPem?.trim();if(!t)return{usable:!1,reason:"absent"};let n=e.previousUntil?.trim();if(!n)return{usable:!1,reason:"no-window"};let o=Number(n);if(!Number.isFinite(o))return{usable:!1,reason:"malformed-window"};if(o<=e.nowMs)return{usable:!1,reason:"expired"};return{usable:!0,pem:t,expiresAtMs:o}}var $$=null,R$=null;function JE(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function z$(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function T$(e){return e==="privateOrg"||e==="unlisted"}function Fv(e){if(e==="privateOrg")return{protected:!0,summary:"This MCP endpoint requires an MCPCloud runtime token for callers in the deployment organization."};if(e==="unlisted")return{protected:!0,summary:"This MCP endpoint requires an MCPCloud runtime token and does not rely on URL secrecy as the primary control."};return{protected:!1,summary:"This MCP endpoint is public."}}function Kv(e,t,n){return Response.json({error:t,message:n},{status:e})}function BE(e){let t=e.get("authorization")?.trim();if(!t)return null;return t.match(/^Bearer\s+(.+)$/i)?.[1]?.trim()||null}function x$(e){let t=atob(e);return Uint8Array.from(t,(n)=>n.charCodeAt(0))}function k$(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t+"=".repeat((4-t.length%4)%4);return x$(n)}function E$(e){let t=e.replace(/-----BEGIN[^-]+-----/g,"").replace(/-----END[^-]+-----/g,"").replace(/\s+/g,"");return z$(x$(t))}function HE(e){return JSON.parse(new TextDecoder().decode(k$(e)))}async function YE(e){return $$||=crypto.subtle.importKey("spki",E$(e.publicKey),{hash:"SHA-256",name:"RSASSA-PKCS1-v1_5"},!1,["verify"]),await $$}async function GE(e){return R$||=crypto.subtle.importKey("spki",E$(e),{hash:"SHA-256",name:"RSASSA-PKCS1-v1_5"},!1,["verify"]),await R$}async function WE(e,t,n){let[o,r,i]=e.split(".");if(!o||!r||!i)throw Error("Runtime token is malformed.");let a=HE(r);if(!JE(a))throw Error("Runtime token payload is invalid.");let s=z$(k$(i)),c=new TextEncoder().encode(`${o}.${r}`),u=await crypto.subtle.verify("RSASSA-PKCS1-v1_5",await YE(n),s,c);if(!u){let m=b$({previousPem:n.publicKeyPrevious,previousUntil:n.publicKeyPreviousUntil,nowMs:Date.now()});if(m.usable)try{u=await crypto.subtle.verify("RSASSA-PKCS1-v1_5",await GE(m.pem),s,c)}catch{u=!1}}if(!u)throw Error("Runtime token signature is invalid.");let d=Math.floor(Date.now()/1000);if(a.aud!==n.audience||a.iss!==n.issuer||a.deploymentId!==n.deploymentId||a.deploymentVersion!==n.deploymentVersion||a.accessMode!==t||a.orgId!==n.organizationId||a.serverId!==n.serverId||typeof a.exp!=="number"||a.exp<=d||typeof a.iat!=="number"||typeof a.jti!=="string"||typeof a.sub!=="string")throw Error("Runtime token claims are invalid.");return{sub:a.sub,clientName:typeof a.clientName==="string"?a.clientName:null}}async function Vv(e,t){if(!T$(t.accessMode))return{response:null,callerUserId:null,rawToken:null};if(!t.runtimeAuth)return{response:Kv(500,"runtime_auth_misconfigured","Runtime auth is not configured for this deployment."),callerUserId:null,rawToken:null};let n=BE(e.headers);if(!n)return{response:Kv(401,"runtime_auth_required","This MCP endpoint requires an MCPCloud runtime access token."),callerUserId:null,rawToken:null};try{let o=await WE(n,t.accessMode,t.runtimeAuth);return{response:null,callerUserId:o.sub,rawToken:n,callerClientName:o.clientName}}catch{return{response:Kv(401,"runtime_auth_invalid","This MCP endpoint requires a valid MCPCloud runtime access token."),callerUserId:null,rawToken:null}}}function I$(e,t,n){if(Math.abs(e.length-t.length)>n)return n+1;let o=Array.from({length:t.length+1},(r,i)=>i);for(let r=1;r<=e.length;r+=1){let i=[r],a=r;for(let s=1;s<=t.length;s+=1){let c=e[r-1]===t[s-1]?0:1;i[s]=Math.min(o[s]+1,i[s-1]+1,o[s-1]+c),a=Math.min(a,i[s])}if(a>n)return n+1;o=i}return o[t.length]}function XE(e,t){if(!t.length)return null;let n=Math.max(1,Math.floor(e.length/3)),o=e.toLowerCase(),r=null,i=n+1;for(let a of t){if(a.toLowerCase()===o)return a;let s=I$(o,a.toLowerCase(),n);if(s<=n&&s<i)r=a,i=s}return r}function P$(e,t,n){if(!t.length)return{suggestion:null,nearest:[]};let o=e.toLowerCase(),r=Math.max(1,e.length),i=t.map((c)=>({name:c,distance:I$(o,c.toLowerCase(),r)}));i.sort((c,u)=>c.distance-u.distance||(c.name<u.name?-1:1));let a=Math.max(1,Math.ceil(e.length/2)),[s]=i;return{suggestion:s.distance<=a?s.name:null,nearest:i.slice(0,n).map((c)=>c.name)}}function sn(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function $e(e){return e.length?`/${e.join("/")}`:"/"}function O$(e){let t=e.type;if(typeof t==="string")return[t];if(Array.isArray(t))return t.filter((n)=>typeof n==="string");return[]}function QE(e){return e.nullable===!0||O$(e).includes("null")}function Iu(e,t,n){let o=[];return wu(e,t,n,o),o}function C$(e,t){return Iu(e,t,[]).map((n)=>`${n.path} ${n.message}`)}function w$(e,t,n,o,r){let i=t[e];if(!Array.isArray(i)||!i.length)return!1;if(i.filter((s)=>sn(s)&&Iu(s,n,o).length===0).length>0)return!0;return r.push({path:$e(o),message:"must match at least one allowed schema"}),!0}function ew(e,t,n,o){if(!sn(t))return o.push({path:$e(n),message:"must be an object"}),!0;let r=sn(e.properties)?e.properties:{},i=Array.isArray(e.required)?e.required.filter((s)=>typeof s==="string"):[],a=sn(e.additionalProperties)?e.additionalProperties:null;for(let s of i)if(!(s in t)||t[s]===void 0)o.push({path:$e([...n,s]),message:"is required"});if(e.additionalProperties===!1){for(let s of Object.keys(t))if(!(s in r)){let c=XE(s,Object.keys(r));o.push({path:$e([...n,s]),message:c?`is not allowed (did you mean "${c}"?)`:"is not allowed"})}}else if(a)for(let[s,c]of Object.entries(t)){if(s in r)continue;wu(a,c,[...n,s],o)}for(let[s,c]of Object.entries(r)){if(!(s in t)||t[s]===void 0)continue;if(sn(c))wu(c,t[s],[...n,s],o)}return!0}function tw(e,t,n,o){if(!Array.isArray(t))return o.push({path:$e(n),message:"must be an array"}),!0;if(typeof e.minItems==="number"&&t.length<e.minItems)o.push({path:$e(n),message:`must contain at least ${e.minItems} items`});if(typeof e.maxItems==="number"&&t.length>e.maxItems)o.push({path:$e(n),message:`must contain no more than ${e.maxItems} items`});if(sn(e.items))t.forEach((r,i)=>wu(e.items,r,[...n,String(i)],o));return!0}function rw(e,t,n,o){if(typeof t!=="string")return o.push({path:$e(n),message:"must be a string"}),!0;if(typeof e.minLength==="number"&&t.length<e.minLength)o.push({path:$e(n),message:`must have length at least ${e.minLength}`});if(typeof e.maxLength==="number"&&t.length>e.maxLength)o.push({path:$e(n),message:`must have length no greater than ${e.maxLength}`});if(typeof e.pattern==="string"){if(!new RegExp(e.pattern).test(t))o.push({path:$e(n),message:`must match pattern ${e.pattern}`})}return!0}function nw(e,t,n,o,r){if(typeof n!=="number"||Number.isNaN(n))return r.push({path:$e(o),message:e==="integer"?"must be an integer":"must be a number"}),!0;if(e==="integer"&&!Number.isInteger(n))r.push({path:$e(o),message:"must be an integer"});if(typeof t.minimum==="number"&&n<t.minimum)r.push({path:$e(o),message:`must be at least ${t.minimum}`});if(typeof t.maximum==="number"&&n>t.maximum)r.push({path:$e(o),message:`must be no greater than ${t.maximum}`});return!0}function wu(e,t,n,o){if(t===null&&QE(e))return;if(w$("anyOf",e,t,n,o)||w$("oneOf",e,t,n,o))return;if(Object.prototype.hasOwnProperty.call(e,"const")&&t!==e.const){o.push({path:$e(n),message:`must equal ${JSON.stringify(e.const)}`});return}if(Array.isArray(e.enum)&&!e.enum.some((s)=>s===t)){o.push({path:$e(n),message:`must be one of ${e.enum.map((s)=>JSON.stringify(s)).join(", ")}`});return}let r=O$(e).filter((s)=>s!=="null"),i=r.length?r:Array.isArray(e.items)?["array"]:sn(e.properties)?["object"]:[];if(!i.length)return;if(i.length>1){if(!i.find((c)=>Iu({...e,type:c},t,n).length===0))o.push({path:$e(n),message:`must match one of the allowed types: ${i.join(", ")}`});return}let[a]=i;switch(a){case"object":ew(e,t,n,o);return;case"array":tw(e,t,n,o);return;case"string":rw(e,t,n,o);return;case"integer":case"number":nw(a,e,t,n,o);return;case"boolean":if(typeof t!=="boolean")o.push({path:$e(n),message:"must be a boolean"});return;case"null":if(t!==null)o.push({path:$e(n),message:"must be null"});return;default:return}}function ow(e,t,n){let o=Iu(t,n,[]);if(o.length)throw new an(e,o.map((r)=>`${r.path} ${r.message}`));return n}var fo=(e)=>e!==null&&Object.prototype.toString.call(e)==="[object Object]",Ou=(e,t)=>{if(e===t)return!0;if(typeof e!==typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Ou(e[n],t[n]))return!1;return!0}if(fo(e)&&fo(t)){let n=Object.entries(e),o=new Set(Object.keys(t));if(n.length!==o.size)return!1;for(let[r,i]of n){if(!Ou(i,t[r]))return!1;o.delete(r)}return o.size===0}return!1},Pu=(e)=>{if(e===""||e===!1||e===null||e===void 0)return!0;if(Array.isArray(e)&&e.length===0)return!0;if(fo(e)){for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}return!1},iw=(e)=>e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_",N$=(e)=>e>="0"&&e<="9"||e==="-",aw=(e)=>e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="_",_;(function(e){e.TOK_EOF="EOF",e.TOK_UNQUOTEDIDENTIFIER="UnquotedIdentifier",e.TOK_QUOTEDIDENTIFIER="QuotedIdentifier",e.TOK_RBRACKET="Rbracket",e.TOK_RPAREN="Rparen",e.TOK_COMMA="Comma",e.TOK_COLON="Colon",e.TOK_RBRACE="Rbrace",e.TOK_NUMBER="Number",e.TOK_CURRENT="Current",e.TOK_ROOT="Root",e.TOK_EXPREF="Expref",e.TOK_PIPE="Pipe",e.TOK_OR="Or",e.TOK_AND="And",e.TOK_EQ="EQ",e.TOK_GT="GT",e.TOK_LT="LT",e.TOK_GTE="GTE",e.TOK_LTE="LTE",e.TOK_NE="NE",e.TOK_FLATTEN="Flatten",e.TOK_STAR="Star",e.TOK_FILTER="Filter",e.TOK_DOT="Dot",e.TOK_NOT="Not",e.TOK_LBRACE="Lbrace",e.TOK_LBRACKET="Lbracket",e.TOK_LPAREN="Lparen",e.TOK_LITERAL="Literal"})(_||(_={}));var j$={"(":_.TOK_LPAREN,")":_.TOK_RPAREN,"*":_.TOK_STAR,",":_.TOK_COMMA,".":_.TOK_DOT,":":_.TOK_COLON,"@":_.TOK_CURRENT,["$"]:_.TOK_ROOT,"]":_.TOK_RBRACKET,"{":_.TOK_LBRACE,"}":_.TOK_RBRACE},sw={"!":!0,"<":!0,"=":!0,">":!0},cw={"\t":!0,"\n":!0,"\r":!0," ":!0};class A${constructor(){this._current=0}tokenize(e){let t=[];this._current=0;let n,o,r;while(this._current<e.length)if(iw(e[this._current]))n=this._current,o=this.consumeUnquotedIdentifier(e),t.push({start:n,type:_.TOK_UNQUOTEDIDENTIFIER,value:o});else if(j$[e[this._current]]!==void 0)t.push({start:this._current,type:j$[e[this._current]],value:e[this._current]}),this._current+=1;else if(N$(e[this._current]))r=this.consumeNumber(e),t.push(r);else if(e[this._current]==="[")r=this.consumeLBracket(e),t.push(r);else if(e[this._current]==='"')n=this._current,o=this.consumeQuotedIdentifier(e),t.push({start:n,type:_.TOK_QUOTEDIDENTIFIER,value:o});else if(e[this._current]==="'")n=this._current,o=this.consumeRawStringLiteral(e),t.push({start:n,type:_.TOK_LITERAL,value:o});else if(e[this._current]==="`"){n=this._current;let i=this.consumeLiteral(e);t.push({start:n,type:_.TOK_LITERAL,value:i})}else if(sw[e[this._current]]!==void 0)r=this.consumeOperator(e),r&&t.push(r);else if(cw[e[this._current]]!==void 0)this._current+=1;else if(e[this._current]==="&")if(n=this._current,this._current+=1,e[this._current]==="&")this._current+=1,t.push({start:n,type:_.TOK_AND,value:"&&"});else t.push({start:n,type:_.TOK_EXPREF,value:"&"});else if(e[this._current]==="|")if(n=this._current,this._current+=1,e[this._current]==="|")this._current+=1,t.push({start:n,type:_.TOK_OR,value:"||"});else t.push({start:n,type:_.TOK_PIPE,value:"|"});else{let i=Error(`Unknown character: ${e[this._current]}`);throw i.name="LexerError",i}return t}consumeUnquotedIdentifier(e){let t=this._current;this._current+=1;while(this._current<e.length&&aw(e[this._current]))this._current+=1;return e.slice(t,this._current)}consumeQuotedIdentifier(e){let t=this._current;this._current+=1;let n=e.length;while(e[this._current]!=='"'&&this._current<n){let o=this._current;if(e[o]==="\\"&&(e[o+1]==="\\"||e[o+1]==='"'))o+=2;else o+=1;this._current=o}return this._current+=1,JSON.parse(e.slice(t,this._current))}consumeRawStringLiteral(e){let t=this._current;this._current+=1;let n=e.length;while(e[this._current]!=="'"&&this._current<n){let r=this._current;if(e[r]==="\\"&&(e[r+1]==="\\"||e[r+1]==="'"))r+=2;else r+=1;this._current=r}return this._current+=1,e.slice(t+1,this._current-1).replace("\\'","'")}consumeNumber(e){let t=this._current;this._current+=1;let n=e.length;while(N$(e[this._current])&&this._current<n)this._current+=1;let o=parseInt(e.slice(t,this._current),10);return{start:t,value:o,type:_.TOK_NUMBER}}consumeLBracket(e){let t=this._current;if(this._current+=1,e[this._current]==="?")return this._current+=1,{start:t,type:_.TOK_FILTER,value:"[?"};if(e[this._current]==="]")return this._current+=1,{start:t,type:_.TOK_FLATTEN,value:"[]"};return{start:t,type:_.TOK_LBRACKET,value:"["}}consumeOperator(e){let t=this._current,n=e[t];if(this._current+=1,n==="!"){if(e[this._current]==="=")return this._current+=1,{start:t,type:_.TOK_NE,value:"!="};return{start:t,type:_.TOK_NOT,value:"!"}}if(n==="<"){if(e[this._current]==="=")return this._current+=1,{start:t,type:_.TOK_LTE,value:"<="};return{start:t,type:_.TOK_LT,value:"<"}}if(n===">"){if(e[this._current]==="=")return this._current+=1,{start:t,type:_.TOK_GTE,value:">="};return{start:t,type:_.TOK_GT,value:">"}}if(n==="="&&e[this._current]==="=")return this._current+=1,{start:t,type:_.TOK_EQ,value:"=="}}consumeLiteral(e){this._current+=1;let t=this._current,n=e.length;while(e[this._current]!=="`"&&this._current<n){let i=this._current;if(e[i]==="\\"&&(e[i+1]==="\\"||e[i+1]==="`"))i+=2;else i+=1;this._current=i}let o=e.slice(t,this._current).trimLeft();o=o.replace("\\`","`");let r=this.looksLikeJSON(o)?JSON.parse(o):JSON.parse(`"${o}"`);return this._current+=1,r}looksLikeJSON(e){let n=["true","false","null"],o="-0123456789";if(e==="")return!1;if('[{"'.includes(e[0]))return!0;if(n.includes(e))return!0;if("-0123456789".includes(e[0]))try{return JSON.parse(e),!0}catch(r){return!1}return!1}}var lw=new A$,Ce={[_.TOK_EOF]:0,[_.TOK_UNQUOTEDIDENTIFIER]:0,[_.TOK_QUOTEDIDENTIFIER]:0,[_.TOK_RBRACKET]:0,[_.TOK_RPAREN]:0,[_.TOK_COMMA]:0,[_.TOK_RBRACE]:0,[_.TOK_NUMBER]:0,[_.TOK_CURRENT]:0,[_.TOK_EXPREF]:0,[_.TOK_ROOT]:0,[_.TOK_PIPE]:1,[_.TOK_OR]:2,[_.TOK_AND]:3,[_.TOK_EQ]:5,[_.TOK_GT]:5,[_.TOK_LT]:5,[_.TOK_GTE]:5,[_.TOK_LTE]:5,[_.TOK_NE]:5,[_.TOK_FLATTEN]:9,[_.TOK_STAR]:20,[_.TOK_FILTER]:21,[_.TOK_DOT]:40,[_.TOK_NOT]:45,[_.TOK_LBRACE]:50,[_.TOK_LBRACKET]:55,[_.TOK_LPAREN]:60};class M${constructor(){this.index=0,this.tokens=[]}parse(e){this.loadTokens(e),this.index=0;let t=this.expression(0);if(this.lookahead(0)!==_.TOK_EOF){let n=this.lookaheadToken(0);this.errorToken(n,`Unexpected token type: ${n.type}, value: ${n.value}`)}return t}loadTokens(e){this.tokens=[...lw.tokenize(e),{type:_.TOK_EOF,value:"",start:e.length}]}expression(e){let t=this.lookaheadToken(0);this.advance();let n=this.nud(t),o=this.lookahead(0);while(e<Ce[o])this.advance(),n=this.led(o,n),o=this.lookahead(0);return n}lookahead(e){return this.tokens[this.index+e].type}lookaheadToken(e){return this.tokens[this.index+e]}advance(){this.index+=1}nud(e){let t,n,o;switch(e.type){case _.TOK_LITERAL:return{type:"Literal",value:e.value};case _.TOK_UNQUOTEDIDENTIFIER:return{type:"Field",name:e.value};case _.TOK_QUOTEDIDENTIFIER:let r={type:"Field",name:e.value};if(this.lookahead(0)===_.TOK_LPAREN)throw Error("Quoted identifier not allowed for function names.");else return r;case _.TOK_NOT:return n=this.expression(Ce.Not),{type:"NotExpression",children:[n]};case _.TOK_STAR:return t={type:"Identity"},n=this.lookahead(0)===_.TOK_RBRACKET&&{type:"Identity"}||this.parseProjectionRHS(Ce.Star),{type:"ValueProjection",children:[t,n]};case _.TOK_FILTER:return this.led(e.type,{type:"Identity"});case _.TOK_LBRACE:return this.parseMultiselectHash();case _.TOK_FLATTEN:return t={type:_.TOK_FLATTEN,children:[{type:"Identity"}]},n=this.parseProjectionRHS(Ce.Flatten),{type:"Projection",children:[t,n]};case _.TOK_LBRACKET:if(this.lookahead(0)===_.TOK_NUMBER||this.lookahead(0)===_.TOK_COLON)return n=this.parseIndexExpression(),this.projectIfSlice({type:"Identity"},n);if(this.lookahead(0)===_.TOK_STAR&&this.lookahead(1)===_.TOK_RBRACKET)return this.advance(),this.advance(),n=this.parseProjectionRHS(Ce.Star),{children:[{type:"Identity"},n],type:"Projection"};return this.parseMultiselectList();case _.TOK_CURRENT:return{type:_.TOK_CURRENT};case _.TOK_ROOT:return{type:_.TOK_ROOT};case _.TOK_EXPREF:return o=this.expression(Ce.Expref),{type:"ExpressionReference",children:[o]};case _.TOK_LPAREN:let i=[];while(this.lookahead(0)!==_.TOK_RPAREN){if(this.lookahead(0)===_.TOK_CURRENT)o={type:_.TOK_CURRENT},this.advance();else o=this.expression(0);i.push(o)}return this.match(_.TOK_RPAREN),i[0];default:this.errorToken(e)}}led(e,t){let n;switch(e){case _.TOK_DOT:let o=Ce.Dot;if(this.lookahead(0)!==_.TOK_STAR)return n=this.parseDotRHS(o),{type:"Subexpression",children:[t,n]};return this.advance(),n=this.parseProjectionRHS(o),{type:"ValueProjection",children:[t,n]};case _.TOK_PIPE:return n=this.expression(Ce.Pipe),{type:_.TOK_PIPE,children:[t,n]};case _.TOK_OR:return n=this.expression(Ce.Or),{type:"OrExpression",children:[t,n]};case _.TOK_AND:return n=this.expression(Ce.And),{type:"AndExpression",children:[t,n]};case _.TOK_LPAREN:let r=t.name,i=[],a;while(this.lookahead(0)!==_.TOK_RPAREN){if(this.lookahead(0)===_.TOK_CURRENT)a={type:_.TOK_CURRENT},this.advance();else a=this.expression(0);if(this.lookahead(0)===_.TOK_COMMA)this.match(_.TOK_COMMA);i.push(a)}return this.match(_.TOK_RPAREN),{name:r,type:"Function",children:i};case _.TOK_FILTER:let c=this.expression(0);return this.match(_.TOK_RBRACKET),n=this.lookahead(0)===_.TOK_FLATTEN&&{type:"Identity"}||this.parseProjectionRHS(Ce.Filter),{type:"FilterProjection",children:[t,n,c]};case _.TOK_FLATTEN:let u={type:_.TOK_FLATTEN,children:[t]},d=this.parseProjectionRHS(Ce.Flatten);return{type:"Projection",children:[u,d]};case _.TOK_EQ:case _.TOK_NE:case _.TOK_GT:case _.TOK_GTE:case _.TOK_LT:case _.TOK_LTE:return this.parseComparator(t,e);case _.TOK_LBRACKET:let m=this.lookaheadToken(0);if(m.type===_.TOK_NUMBER||m.type===_.TOK_COLON)return n=this.parseIndexExpression(),this.projectIfSlice(t,n);return this.match(_.TOK_STAR),this.match(_.TOK_RBRACKET),n=this.parseProjectionRHS(Ce.Star),{type:"Projection",children:[t,n]};default:return this.errorToken(this.lookaheadToken(0))}}match(e){if(this.lookahead(0)===e){this.advance();return}else{let t=this.lookaheadToken(0);this.errorToken(t,`Expected ${e}, got: ${t.type}`)}}errorToken(e,t=""){let n=Error(t||`Invalid token (${e.type}): "${e.value}"`);throw n.name="ParserError",n}parseIndexExpression(){if(this.lookahead(0)===_.TOK_COLON||this.lookahead(1)===_.TOK_COLON)return this.parseSliceExpression();let e={type:"Index",value:this.lookaheadToken(0).value};return this.advance(),this.match(_.TOK_RBRACKET),e}projectIfSlice(e,t){let n={type:"IndexExpression",children:[e,t]};if(t.type==="Slice")return{children:[n,this.parseProjectionRHS(Ce.Star)],type:"Projection"};return n}parseSliceExpression(){let e=[null,null,null],t=0,n=this.lookahead(0);while(n!==_.TOK_RBRACKET&&t<3){if(n===_.TOK_COLON)t+=1,this.advance();else if(n===_.TOK_NUMBER)e[t]=this.lookaheadToken(0).value,this.advance();else{let o=this.lookaheadToken(0);this.errorToken(o,`Syntax error, unexpected token: ${o.value}(${o.type})`)}n=this.lookahead(0)}return this.match(_.TOK_RBRACKET),{children:e,type:"Slice"}}parseComparator(e,t){let n=this.expression(Ce[t]);return{type:"Comparator",name:t,children:[e,n]}}parseDotRHS(e){let t=this.lookahead(0);if([_.TOK_UNQUOTEDIDENTIFIER,_.TOK_QUOTEDIDENTIFIER,_.TOK_STAR].includes(t))return this.expression(e);if(t===_.TOK_LBRACKET)return this.match(_.TOK_LBRACKET),this.parseMultiselectList();if(t===_.TOK_LBRACE)return this.match(_.TOK_LBRACE),this.parseMultiselectHash();let o=this.lookaheadToken(0);this.errorToken(o,`Syntax error, unexpected token: ${o.value}(${o.type})`)}parseProjectionRHS(e){if(Ce[this.lookahead(0)]<10)return{type:"Identity"};if(this.lookahead(0)===_.TOK_LBRACKET)return this.expression(e);if(this.lookahead(0)===_.TOK_FILTER)return this.expression(e);if(this.lookahead(0)===_.TOK_DOT)return this.match(_.TOK_DOT),this.parseDotRHS(e);let t=this.lookaheadToken(0);this.errorToken(t,`Syntax error, unexpected token: ${t.value}(${t.type})`)}parseMultiselectList(){let e=[];while(this.lookahead(0)!==_.TOK_RBRACKET){let t=this.expression(0);if(e.push(t),this.lookahead(0)===_.TOK_COMMA){if(this.match(_.TOK_COMMA),this.lookahead(0)===_.TOK_RBRACKET)throw Error("Unexpected token Rbracket")}}return this.match(_.TOK_RBRACKET),{type:"MultiSelectList",children:e}}parseMultiselectHash(){let e=[],t=[_.TOK_UNQUOTEDIDENTIFIER,_.TOK_QUOTEDIDENTIFIER],n,o,r;for(;;){if(n=this.lookaheadToken(0),!t.includes(n.type))throw Error(`Expecting an identifier token, got: ${n.type}`);if(o=n.value,this.advance(),this.match(_.TOK_COLON),r=this.expression(0),e.push({value:r,type:"KeyValuePair",name:o}),this.lookahead(0)===_.TOK_COMMA)this.match(_.TOK_COMMA);else if(this.lookahead(0)===_.TOK_RBRACE){this.match(_.TOK_RBRACE);break}}return{type:"MultiSelectHash",children:e}}}var uw=new M$,E;(function(e){e[e.TYPE_NUMBER=0]="TYPE_NUMBER",e[e.TYPE_ANY=1]="TYPE_ANY",e[e.TYPE_STRING=2]="TYPE_STRING",e[e.TYPE_ARRAY=3]="TYPE_ARRAY",e[e.TYPE_OBJECT=4]="TYPE_OBJECT",e[e.TYPE_BOOLEAN=5]="TYPE_BOOLEAN",e[e.TYPE_EXPREF=6]="TYPE_EXPREF",e[e.TYPE_NULL=7]="TYPE_NULL",e[e.TYPE_ARRAY_NUMBER=8]="TYPE_ARRAY_NUMBER",e[e.TYPE_ARRAY_STRING=9]="TYPE_ARRAY_STRING"})(E||(E={}));class U${constructor(e){this.TYPE_NAME_TABLE={[E.TYPE_NUMBER]:"number",[E.TYPE_ANY]:"any",[E.TYPE_STRING]:"string",[E.TYPE_ARRAY]:"array",[E.TYPE_OBJECT]:"object",[E.TYPE_BOOLEAN]:"boolean",[E.TYPE_EXPREF]:"expression",[E.TYPE_NULL]:"null",[E.TYPE_ARRAY_NUMBER]:"Array<number>",[E.TYPE_ARRAY_STRING]:"Array<string>"},this.functionAbs=([t])=>Math.abs(t),this.functionAvg=([t])=>{let n=0;for(let o=0;o<t.length;o+=1)n+=t[o];return n/t.length},this.functionCeil=([t])=>Math.ceil(t),this.functionContains=(t)=>{let[n,o]=t;return n.includes(o)},this.functionEndsWith=(t)=>{let[n,o]=t;return n.includes(o,n.length-o.length)},this.functionFloor=([t])=>Math.floor(t),this.functionJoin=(t)=>{let[n,o]=t;return o.join(n)},this.functionKeys=([t])=>Object.keys(t),this.functionLength=([t])=>{if(!fo(t))return t.length;return Object.keys(t).length},this.functionMap=(t)=>{if(!this._interpreter)return[];let n=[],o=this._interpreter,r=t[0],i=t[1];for(let a=0;a<i.length;a+=1)n.push(o.visit(r,i[a]));return n},this.functionMax=([t])=>{if(!t.length)return null;if(this.getTypeName(t[0])===E.TYPE_NUMBER)return Math.max(...t);let o=t,r=o[0];for(let i=1;i<o.length;i+=1)if(r.localeCompare(o[i])<0)r=o[i];return r},this.functionMaxBy=(t)=>{let n=t[1],o=t[0],r=this.createKeyFunction(n,[E.TYPE_NUMBER,E.TYPE_STRING]),i=-1/0,a,s;for(let c=0;c<o.length;c+=1)if(s=r&&r(o[c]),s!==void 0&&s>i)i=s,a=o[c];return a},this.functionMerge=(t)=>{let n={};for(let o=0;o<t.length;o+=1){let r=t[o];n=Object.assign(n,r)}return n},this.functionMin=([t])=>{if(!t.length)return null;if(this.getTypeName(t[0])===E.TYPE_NUMBER)return Math.min(...t);let o=t,r=o[0];for(let i=1;i<o.length;i+=1)if(o[i].localeCompare(r)<0)r=o[i];return r},this.functionMinBy=(t)=>{let n=t[1],o=t[0],r=this.createKeyFunction(n,[E.TYPE_NUMBER,E.TYPE_STRING]),i=1/0,a,s;for(let c=0;c<o.length;c+=1)if(s=r&&r(o[c]),s!==void 0&&s<i)i=s,a=o[c];return a},this.functionNotNull=(t)=>{for(let n=0;n<t.length;n+=1)if(this.getTypeName(t[n])!==E.TYPE_NULL)return t[n];return null},this.functionReverse=([t])=>{if(this.getTypeName(t)===E.TYPE_STRING){let r=t,i="";for(let a=r.length-1;a>=0;a-=1)i+=r[a];return i}let o=t.slice(0);return o.reverse(),o},this.functionSort=([t])=>[...t].sort(),this.functionSortBy=(t)=>{if(!this._interpreter)return[];let n=t[0].slice(0);if(n.length===0)return n;let o=this._interpreter,r=t[1],i=this.getTypeName(o.visit(r,n[0]));if(i!==void 0&&![E.TYPE_NUMBER,E.TYPE_STRING].includes(i))throw Error(`TypeError: unexpected type (${this.TYPE_NAME_TABLE[i]})`);let a=[];for(let s=0;s<n.length;s+=1)a.push([s,n[s]]);a.sort((s,c)=>{let u=o.visit(r,s[1]),d=o.visit(r,c[1]);if(this.getTypeName(u)!==i)throw Error(`TypeError: expected (${this.TYPE_NAME_TABLE[i]}), received ${this.TYPE_NAME_TABLE[this.getTypeName(u)]}`);else if(this.getTypeName(d)!==i)throw Error(`TypeError: expected (${this.TYPE_NAME_TABLE[i]}), received ${this.TYPE_NAME_TABLE[this.getTypeName(d)]}`);if(u>d)return 1;return u<d?-1:s[0]-c[0]});for(let s=0;s<a.length;s+=1)n[s]=a[s][1];return n},this.functionStartsWith=([t,n])=>t.startsWith(n),this.functionSum=([t])=>t.reduce((n,o)=>n+o,0),this.functionToArray=([t])=>{if(this.getTypeName(t)===E.TYPE_ARRAY)return t;return[t]},this.functionToNumber=([t])=>{let n=this.getTypeName(t),o;if(n===E.TYPE_NUMBER)return t;if(n===E.TYPE_STRING){if(o=+t,!isNaN(o))return o}return null},this.functionToString=([t])=>{if(this.getTypeName(t)===E.TYPE_STRING)return t;return JSON.stringify(t)},this.functionType=([t])=>{switch(this.getTypeName(t)){case E.TYPE_NUMBER:return"number";case E.TYPE_STRING:return"string";case E.TYPE_ARRAY:return"array";case E.TYPE_OBJECT:return"object";case E.TYPE_BOOLEAN:return"boolean";case E.TYPE_EXPREF:return"expref";case E.TYPE_NULL:return"null";default:return}},this.functionValues=([t])=>Object.values(t),this.functionTable={abs:{_func:this.functionAbs,_signature:[{types:[E.TYPE_NUMBER]}]},avg:{_func:this.functionAvg,_signature:[{types:[E.TYPE_ARRAY_NUMBER]}]},ceil:{_func:this.functionCeil,_signature:[{types:[E.TYPE_NUMBER]}]},contains:{_func:this.functionContains,_signature:[{types:[E.TYPE_STRING,E.TYPE_ARRAY]},{types:[E.TYPE_ANY]}]},ends_with:{_func:this.functionEndsWith,_signature:[{types:[E.TYPE_STRING]},{types:[E.TYPE_STRING]}]},floor:{_func:this.functionFloor,_signature:[{types:[E.TYPE_NUMBER]}]},join:{_func:this.functionJoin,_signature:[{types:[E.TYPE_STRING]},{types:[E.TYPE_ARRAY_STRING]}]},keys:{_func:this.functionKeys,_signature:[{types:[E.TYPE_OBJECT]}]},length:{_func:this.functionLength,_signature:[{types:[E.TYPE_STRING,E.TYPE_ARRAY,E.TYPE_OBJECT]}]},map:{_func:this.functionMap,_signature:[{types:[E.TYPE_EXPREF]},{types:[E.TYPE_ARRAY]}]},max:{_func:this.functionMax,_signature:[{types:[E.TYPE_ARRAY_NUMBER,E.TYPE_ARRAY_STRING]}]},max_by:{_func:this.functionMaxBy,_signature:[{types:[E.TYPE_ARRAY]},{types:[E.TYPE_EXPREF]}]},merge:{_func:this.functionMerge,_signature:[{types:[E.TYPE_OBJECT],variadic:!0}]},min:{_func:this.functionMin,_signature:[{types:[E.TYPE_ARRAY_NUMBER,E.TYPE_ARRAY_STRING]}]},min_by:{_func:this.functionMinBy,_signature:[{types:[E.TYPE_ARRAY]},{types:[E.TYPE_EXPREF]}]},not_null:{_func:this.functionNotNull,_signature:[{types:[E.TYPE_ANY],variadic:!0}]},reverse:{_func:this.functionReverse,_signature:[{types:[E.TYPE_STRING,E.TYPE_ARRAY]}]},sort:{_func:this.functionSort,_signature:[{types:[E.TYPE_ARRAY_STRING,E.TYPE_ARRAY_NUMBER]}]},sort_by:{_func:this.functionSortBy,_signature:[{types:[E.TYPE_ARRAY]},{types:[E.TYPE_EXPREF]}]},starts_with:{_func:this.functionStartsWith,_signature:[{types:[E.TYPE_STRING]},{types:[E.TYPE_STRING]}]},sum:{_func:this.functionSum,_signature:[{types:[E.TYPE_ARRAY_NUMBER]}]},to_array:{_func:this.functionToArray,_signature:[{types:[E.TYPE_ANY]}]},to_number:{_func:this.functionToNumber,_signature:[{types:[E.TYPE_ANY]}]},to_string:{_func:this.functionToString,_signature:[{types:[E.TYPE_ANY]}]},type:{_func:this.functionType,_signature:[{types:[E.TYPE_ANY]}]},values:{_func:this.functionValues,_signature:[{types:[E.TYPE_OBJECT]}]}},this._interpreter=e}registerFunction(e,t,n){if(e in this.functionTable)throw Error(`Function already defined: ${e}()`);this.functionTable[e]={_func:t.bind(this),_signature:n}}callFunction(e,t){let n=this.functionTable[e];if(n===void 0)throw Error(`Unknown function: ${e}()`);return this.validateArgs(e,t,n._signature),n._func.call(this,t)}validateInputSignatures(e,t){for(let n=0;n<t.length;n+=1)if("variadic"in t[n]&&n!==t.length-1)throw Error(`ArgumentError: ${e}() 'variadic' argument ${n+1} must occur last`)}validateArgs(e,t,n){var o,r;let i;this.validateInputSignatures(e,n);let a=n.filter((b)=>{var R;return(R=!b.optional)!==null&&R!==void 0?R:!1}).length,s=(r=(o=n[n.length-1])===null||o===void 0?void 0:o.variadic)!==null&&r!==void 0?r:!1,c=t.length<a,u=t.length>n.length,d=c&&(!s&&a>1||s)?"at least ":"";if(s&&c||!s&&(c||u))throw i=n.length>1,Error(`ArgumentError: ${e}() takes ${d}${a} argument${i&&"s"||""} but received ${t.length}`);let m,p,h;for(let b=0;b<n.length;b+=1){h=!1,m=n[b].types,p=this.getTypeName(t[b]);let R;for(R=0;R<m.length;R+=1)if(p!==void 0&&this.typeMatches(p,m[R],t[b])){h=!0;break}if(!h&&p!==void 0){let z=m.map((A)=>this.TYPE_NAME_TABLE[A]).join(" | ");throw Error(`TypeError: ${e}() expected argument ${b+1} to be type (${z}) but received type ${this.TYPE_NAME_TABLE[p]} instead.`)}}}typeMatches(e,t,n){if(t===E.TYPE_ANY)return!0;if(t===E.TYPE_ARRAY_STRING||t===E.TYPE_ARRAY_NUMBER||t===E.TYPE_ARRAY){if(t===E.TYPE_ARRAY)return e===E.TYPE_ARRAY;if(e===E.TYPE_ARRAY){let o;if(t===E.TYPE_ARRAY_NUMBER)o=E.TYPE_NUMBER;else if(t===E.TYPE_ARRAY_STRING)o=E.TYPE_STRING;for(let r=0;r<n.length;r+=1){let i=this.getTypeName(n[r]);if(i!==void 0&&o!==void 0&&!this.typeMatches(i,o,n[r]))return!1}return!0}}else return e===t;return!1}getTypeName(e){switch(Object.prototype.toString.call(e)){case"[object String]":return E.TYPE_STRING;case"[object Number]":return E.TYPE_NUMBER;case"[object Array]":return E.TYPE_ARRAY;case"[object Boolean]":return E.TYPE_BOOLEAN;case"[object Null]":return E.TYPE_NULL;case"[object Object]":if(e.jmespathType===_.TOK_EXPREF)return E.TYPE_EXPREF;return E.TYPE_OBJECT;default:return}}createKeyFunction(e,t){if(!this._interpreter)return;let n=this._interpreter;return(r)=>{let i=n.visit(e,r);if(!t.includes(this.getTypeName(i))){let a=`TypeError: expected one of (${t.map((s)=>this.TYPE_NAME_TABLE[s]).join(" | ")}), received ${this.TYPE_NAME_TABLE[this.getTypeName(i)]}`;throw Error(a)}return i}}}class q${constructor(){this._rootValue=null,this.runtime=new U$(this)}search(e,t){return this._rootValue=t,this.visit(e,t)}visit(e,t){let n,o,r,i,a,s,c,u,d,m,p;switch(e.type){case"Field":if(t===null)return null;if(fo(t)){if(s=t[e.name],s===void 0)return null;return s}return null;case"Subexpression":r=this.visit(e.children[0],t);for(m=1;m<e.children.length;m+=1)if(r=this.visit(e.children[1],r),r===null)return null;return r;case"IndexExpression":return c=this.visit(e.children[0],t),u=this.visit(e.children[1],c),u;case"Index":if(!Array.isArray(t))return null;let h=e.value;if(h<0)h=t.length+h;if(r=t[h],r===void 0)r=null;return r;case"Slice":if(!Array.isArray(t))return null;let b=[...e.children],R=this.computeSliceParams(t.length,b),[z,A,B]=R;if(r=[],B>0)for(m=z;m<A;m+=B)r.push(t[m]);else for(m=z;m>A;m+=B)r.push(t[m]);return r;case"Projection":if(p=this.visit(e.children[0],t),!Array.isArray(p))return null;d=[];for(m=0;m<p.length;m+=1)if(o=this.visit(e.children[1],p[m]),o!==null)d.push(o);return d;case"ValueProjection":if(p=this.visit(e.children[0],t),!fo(p))return null;d=[];let P=Object.values(p);for(m=0;m<P.length;m+=1)if(o=this.visit(e.children[1],P[m]),o!==null)d.push(o);return d;case"FilterProjection":if(p=this.visit(e.children[0],t),!Array.isArray(p))return null;let O=[],V=[];for(m=0;m<p.length;m+=1)if(n=this.visit(e.children[2],p[m]),!Pu(n))O.push(p[m]);for(let ue=0;ue<O.length;ue+=1)if(o=this.visit(e.children[1],O[ue]),o!==null)V.push(o);return V;case"Comparator":switch(i=this.visit(e.children[0],t),a=this.visit(e.children[1],t),e.name){case _.TOK_EQ:r=Ou(i,a);break;case _.TOK_NE:r=!Ou(i,a);break;case _.TOK_GT:r=i>a;break;case _.TOK_GTE:r=i>=a;break;case _.TOK_LT:r=i<a;break;case _.TOK_LTE:r=i<=a;break;default:throw Error(`Unknown comparator: ${e.name}`)}return r;case _.TOK_FLATTEN:let Y=this.visit(e.children[0],t);if(!Array.isArray(Y))return null;let ee=[];for(m=0;m<Y.length;m+=1)if(o=Y[m],Array.isArray(o))ee=[...ee,...o];else ee.push(o);return ee;case"Identity":return t;case"MultiSelectList":if(t===null)return null;d=[];for(m=0;m<e.children.length;m+=1)d.push(this.visit(e.children[m],t));return d;case"MultiSelectHash":if(t===null)return null;d={};let ne;for(m=0;m<e.children.length;m+=1)ne=e.children[m],d[ne.name]=this.visit(ne.value,t);return d;case"OrExpression":if(n=this.visit(e.children[0],t),Pu(n))n=this.visit(e.children[1],t);return n;case"AndExpression":if(i=this.visit(e.children[0],t),Pu(i))return i;return this.visit(e.children[1],t);case"NotExpression":return i=this.visit(e.children[0],t),Pu(i);case"Literal":return e.value;case _.TOK_PIPE:return c=this.visit(e.children[0],t),this.visit(e.children[1],c);case _.TOK_CURRENT:return t;case _.TOK_ROOT:return this._rootValue;case"Function":let ae=[];for(let ue=0;ue<e.children.length;ue+=1)ae.push(this.visit(e.children[ue],t));return this.runtime.callFunction(e.name,ae);case"ExpressionReference":let ce=e.children[0];return ce.jmespathType=_.TOK_EXPREF,ce;default:throw Error(`Unknown node type: ${e.type}`)}}computeSliceParams(e,t){let[n,o,r]=t;if(r===null)r=1;else if(r===0){let a=Error("Invalid slice, step cannot be 0");throw a.name="RuntimeError",a}let i=r<0?!0:!1;return n=n===null?i?e-1:0:this.capSliceRange(e,n,r),o=o===null?i?-1:e:this.capSliceRange(e,o,r),[n,o,r]}capSliceRange(e,t,n){let o=t;if(o<0){if(o+=e,o<0)o=n<0?-1:0}else if(o>=e)o=n<0?e-1:e;return o}}var dw=new q$,yC=E.TYPE_ANY,bC=E.TYPE_ARRAY,$C=E.TYPE_ARRAY_NUMBER,RC=E.TYPE_ARRAY_STRING,zC=E.TYPE_BOOLEAN,TC=E.TYPE_EXPREF,xC=E.TYPE_NULL,kC=E.TYPE_NUMBER,EC=E.TYPE_OBJECT,wC=E.TYPE_STRING;function L$(e,t){let n=uw.parse(t);return dw.search(n,e)}function Z$(e,t){return Jv(e.responseProjection,t)}function Jv(e,t){if(!e||typeof e!=="string"||!e.trim())return t;if(t===null||typeof t!=="object")return t;try{let n=L$(t,e);return n===void 0?null:n}catch{return t}}function D$(e){if(e===void 0)return 0;try{return new TextEncoder().encode(JSON.stringify(e)??"").length}catch{return 0}}function mw(e,t,n){let o=Z$(e,t),r=n?.projectionUsage;if(!r)return o;let i=e.responseProjection;if(!(Boolean(i&&typeof i==="string"&&i.trim())&&t!==null&&typeof t==="object"))return o;let s=D$(t),c=D$(o);return r.preBytes+=s,r.postBytes+=c,r.applied=r.applied||o!==t,o}function ho(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function gt(e,t){if(typeof e.description!=="string"||!e.description)return t;return t.describe(e.description)}function pw(e){let t=e.map((n)=>S(n));if(!t.length)return Z();if(t.length===1)return t[0];return j(t)}function jt(e,t){let n=e.type;if(!(e.nullable===!0||Array.isArray(n)&&n.includes("null")))return t;return t.nullable()}function ga(e){if(!ho(e))return Z();if(Array.isArray(e.enum)&&e.enum.length)return jt(e,gt(e,pw(e.enum)));if(Object.prototype.hasOwnProperty.call(e,"const"))return jt(e,gt(e,S(e.const)));for(let n of["oneOf","anyOf"]){let o=e[n];if(Array.isArray(o)&&o.length){let r=o.map((a)=>ga(a)),i=r.length===1?r[0]:j(r);return jt(e,gt(e,i))}}let t=typeof e.type==="string"?e.type:Array.isArray(e.type)?e.type.find((n)=>n!=="null"):null;if(t==="object"||!t&&(ho(e.properties)||Object.prototype.hasOwnProperty.call(e,"additionalProperties")))return K$(e);if(t==="array"){let n=ho(e.items)?ga(e.items):Z();return jt(e,gt(e,v(n)))}if(t==="string"){let n=l();if(typeof e.minLength==="number")n=n.min(e.minLength);if(typeof e.maxLength==="number")n=n.max(e.maxLength);return jt(e,gt(e,n))}if(t==="integer"){let n=x().int();if(typeof e.minimum==="number")n=n.min(e.minimum);if(typeof e.maximum==="number")n=n.max(e.maximum);return jt(e,gt(e,n))}if(t==="number"){let n=x();if(typeof e.minimum==="number")n=n.min(e.minimum);if(typeof e.maximum==="number")n=n.max(e.maximum);return jt(e,gt(e,n))}if(t==="boolean")return jt(e,gt(e,N()));if(t==="null")return gt(e,pt());return jt(e,gt(e,Z()))}function K$(e){if(!ho(e))return f({}).passthrough();let t=ho(e.properties)?e.properties:{},n=new Set(Array.isArray(e.required)?e.required.filter((i)=>typeof i==="string"):[]),o=Object.fromEntries(Object.entries(t).map(([i,a])=>{let s=ga(a),c=n.has(i)?s:s.optional();return[i,c]})),r=e.additionalProperties===!1?f(o).strict():ho(e.additionalProperties)?f(o).catchall(ga(e.additionalProperties)):f(o).passthrough();return jt(e,gt(e,r))}var go=new Map;function fw(e,t){let n=go.get(e)??{};go.set(e,{...n,...t})}function hw(){go.clear()}function gw(){let e={};for(let[t,n]of go)e[t]={...n};return e}function Bv(e,t){return go.get(e)?.description??t}function Hv(e,t){return go.get(e)?.title??t}function V$(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter((t)=>t.length>0)}function Yv(e){return[e.name,e.title,e.description,e.tags.join(" ")].join(" ")}function vw(e){let t=e.map((i)=>V$(Yv(i))),n=new Map;for(let i of t)for(let a of new Set(i))n.set(a,(n.get(a)??0)+1);let o=t.reduce((i,a)=>i+a.length,0),r=t.length?o/t.length:0;return{entries:e,docTokens:t,docFrequency:n,averageDocLength:r}}var F$=new WeakMap;function _w(e){let t=F$.get(e);if(t)return t;let n=vw(e);return F$.set(e,n),n}function Sw(e){let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return t}function yw(e,t,n){let o=e.docTokens[t];if(!o.length)return 0;let r=Sw(o),i=o.length,a=e.entries.length,s=e.averageDocLength||1,c=0;for(let u of n){let d=r.get(u);if(!d)continue;let m=e.docFrequency.get(u)??0,p=Math.log(1+(a-m+0.5)/(m+0.5)),h=d+1.5*(0.25+0.75*i/s);c+=p*(d*2.5/h)}return c}function bw(e){let t=e.match(/^\/(.+)\/([a-z]*)$/);if(!t)return null;try{return new RegExp(t[1],t[2])}catch{return null}}function Cu(e,t){return{name:e.name,title:e.title,description:e.description,score:t}}function $w(e,t,n){let o=[];for(let r of e){let i=t.flags.includes("g")?t.flags:`${t.flags}g`;if(new RegExp(t.source,i).test(Yv(r)))o.push(Cu(r,1));if(o.length>=n)break}return o}function Rw(e,t,n){let o=t.toLowerCase().trim();if(!o)return[];let r=[];for(let i of e){if(Yv(i).toLowerCase().includes(o))r.push(Cu(i,1));if(r.length>=n)break}return r}function Gv(e,t,n=10){let o=Math.max(1,Math.min(Math.floor(n)||10,100)),r=t.trim();if(!r)return e.slice(0,o).map((u)=>Cu(u,0));let i=bw(r);if(i)return $w(e,i,o);let a=_w(e),s=V$(r),c=a.entries.map((u,d)=>({entry:u,score:yw(a,d,s)})).filter((u)=>u.score>0).sort((u,d)=>d.score-u.score).slice(0,o).map((u)=>Cu(u.entry,Number(u.score.toFixed(4))));if(c.length>0)return c;return Rw(e,r,o)}var Wv="0.18.0";var Xv={maxDepth:2,maxKeys:12,maxVariants:3};function zw(e){if(e===null)return"null";if(Array.isArray(e))return"array";let t=typeof e;if(t==="object"&&e instanceof Date)return"Date";return t}function J$(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof Date)}function Tw(e,t){let n=[...new Set(e)];if(n.length===0)return"unknown";if(n.length===1)return n[0];let o=[...n].sort();if(o.length>t)return`${o.slice(0,t).join(" | ")} | …${o.length-t} more`;return o.join(" | ")}function Qv(e,t,n,o){if(!J$(e)&&!Array.isArray(e))return zw(e);if(Array.isArray(e)){if(e.length===0)return"unknown[0]";let s=e.slice(0,200).map((c)=>Qv(c,t,n,o));return`${Tw(s,o.maxVariants)}[${e.length}]`}let r=Object.keys(e);if(t<=0&&n.length===0)return"object";let i=r.slice(0,o.maxKeys),a=i.map((s)=>{let c=n[0]===s,u=c?n.slice(1):[],d=c?Math.max(t,1):t-1;return`${s}: ${Qv(e[s],d,u,o)}`});if(r.length>i.length)a.push(`…+${r.length-i.length} more`);return`{${a.join(", ")}}`}function va(e,t={}){let n={maxDepth:t.maxDepth??Xv.maxDepth,maxKeys:t.maxKeys??Xv.maxKeys,maxVariants:t.maxVariants??Xv.maxVariants};return Qv(e,n.maxDepth,t.focusPath??[],n)}function e_(e,t={}){if(!Array.isArray(e)||e.length===0)return[];let n=e.filter(J$);if(n.length===0)return[];let o=n.length,r=new Map,i=new Set;for(let a of n)for(let s of Object.keys(a))i.add(s);for(let a of i){let s=0;for(let c of n){let u=c[a];if(u===null||u===void 0)s+=1}if(s>0)r.set(a,s)}return[...r.entries()].map(([a,s])=>({field:a,missing:s,total:o,text:`${s}/${o} items have ${a} === null`})).sort((a,s)=>s.missing-a.missing||a.field.localeCompare(s.field)).slice(0,t.limit??3)}var xw=["read","write"],r_="__mcpcloud_call_tool",kw=`globalThis.tool = (name, args) =>
101
+ `,e.enqueue(t.encode(r)),!0}catch(r){return this.onerror?.(r),!1}}handleUnsupportedRequest(){return this.onerror?.(Error("Method not allowed.")),Response.json({jsonrpc:"2.0",error:{code:-32000,message:"Method not allowed."},id:null},{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest(e,t){try{let n=e.headers.get("accept");if(!n?.includes("application/json")||!n.includes("text/event-stream"))return this.onerror?.(Error("Not Acceptable: Client must accept both application/json and text/event-stream")),this.createJsonErrorResponse(406,-32000,"Not Acceptable: Client must accept both application/json and text/event-stream");if(!Cv(e.headers.get("content-type")))return this.onerror?.(Error("Unsupported Media Type: Content-Type must be application/json")),this.createJsonErrorResponse(415,-32000,"Unsupported Media Type: Content-Type must be application/json");let o=e,r;if(t?.parsedBody===void 0)try{r=await e.json()}catch(R){return this.onerror?.(R),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}else r=t.parsedBody;let i;try{i=Array.isArray(r)?r.map((R)=>Wn.parse(R)):[Wn.parse(r)]}catch(R){return this.onerror?.(R),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");let a=i.some((R)=>Rv(R));if(a){if(this._initialized&&this.sessionId!==void 0)return this.onerror?.(Error("Invalid Request: Server already initialized")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(i.length>1)return this.onerror?.(Error("Invalid Request: Only one initialization request is allowed")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");if(this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized)await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!a){let R=this.validateSession(e);if(R)return R;let z=this.validateProtocolVersion(e);if(z)return z}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");if(!i.some((R)=>Bt(R))){for(let R of i)this.onmessage?.(R,{authInfo:t?.authInfo,request:o});return new Response(null,{status:202})}let s=crypto.randomUUID(),c=i.find((R)=>Rv(R)),u=c?c.params.protocolVersion:e.headers.get("mcp-protocol-version")??bc;if(this._enableJsonResponse)return new Promise((R)=>{this._streamMapping.set(s,{resolveJson:R,cleanup:()=>{this._streamMapping.delete(s)}});for(let z of i)if(Bt(z))this._requestToStreamMapping.set(z.id,s);for(let z of i)this.onmessage?.(z,{authInfo:t?.authInfo,request:o})});let d=new TextEncoder,m,p,h=new ReadableStream({start:(R)=>{m=R},cancel:()=>{if(p!==void 0)clearInterval(p);if(this._streamMapping.get(s)?.controller===m)this._streamMapping.delete(s)}}),b={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};if(this.sessionId!==void 0)b["mcp-session-id"]=this.sessionId;for(let R of i)if(Bt(R))this._streamMapping.set(s,{controller:m,encoder:d,cleanup:()=>{if(p!==void 0)clearInterval(p);this._streamMapping.delete(s);try{m.close()}catch{}}}),this._requestToStreamMapping.set(R.id,s);await this.writePrimingEvent(m,d,s,u);for(let R of i){let z,N;if(Bt(R)&&this._eventStore&&this.supportsEmptySSEData(u))z=()=>{this.closeSSEStream(R.id)},N=()=>{this.closeStandaloneSSEStream()};this.onmessage?.(R,{authInfo:t?.authInfo,request:o,closeSSEStream:z,closeStandaloneSSEStream:N})}if(this._streamMapping.get(s)?.controller===m)p=this.startKeepAlive(m,d);return new Response(h,{status:200,headers:b})}catch(n){return this.onerror?.(n),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(n)})}}async handleDeleteRequest(e){let t=this.validateSession(e);if(t)return t;let n=this.validateProtocolVersion(e);if(n)return n;try{return await Promise.resolve(this._onsessionclosed?.(this.sessionId)),new Response(null,{status:200})}finally{await this.close()}}validateSession(e){if(this.sessionIdGenerator===void 0)return;if(!this._initialized)return this.onerror?.(Error("Bad Request: Server not initialized")),this.createJsonErrorResponse(400,-32000,"Bad Request: Server not initialized");let t=e.headers.get("mcp-session-id");if(!t)return this.onerror?.(Error("Bad Request: Mcp-Session-Id header is required")),this.createJsonErrorResponse(400,-32000,"Bad Request: Mcp-Session-Id header is required");if(t!==this.sessionId)return this.onerror?.(Error("Session not found")),this.createJsonErrorResponse(404,-32001,"Session not found")}validateProtocolVersion(e){let t=e.headers.get("mcp-protocol-version");if(t!==null&&!this._supportedProtocolVersions.includes(t)){let n=`Bad Request: Unsupported protocol version: ${t} (supported versions: ${this._supportedProtocolVersions.join(", ")})`;return this.onerror?.(Error(n)),this.createJsonErrorResponse(400,-32000,n)}}async close(){if(this._closed)return;this._closed=!0;for(let{cleanup:e}of this._streamMapping.values())e();this._streamMapping.clear(),this._requestResponseMap.clear(),this.onclose?.()}closeSSEStream(e){let t=this._requestToStreamMapping.get(e);if(!t)return;let n=this._streamMapping.get(t);if(n)n.cleanup()}closeStandaloneSSEStream(){let e=this._streamMapping.get(this._standaloneSseStreamId);if(e)e.cleanup()}async send(e,t){let n=t?.relatedRequestId;if(Jt(e)||Ht(e))n=e.id;if(n===void 0){if(Jt(e)||Ht(e))throw Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let i;if(this._eventStore)i=await this._eventStore.storeEvent(this._standaloneSseStreamId,e);let a=this._streamMapping.get(this._standaloneSseStreamId);if(a===void 0)return;if(a.controller&&a.encoder&&(i===void 0||!a.replayedEventIds?.has(i)))this.writeSSEEvent(a.controller,a.encoder,e,i);return}let o=this._requestToStreamMapping.get(n);if(!o)throw Error(`No connection established for request ID: ${String(n)}`);let r=this._streamMapping.get(o);if(!this._enableJsonResponse){let i;if(this._eventStore)i=await this._eventStore.storeEvent(o,e),r=this._streamMapping.get(o);if(r?.controller&&r?.encoder&&(i===void 0||!r.replayedEventIds?.has(i)))this.writeSSEEvent(r.controller,r.encoder,e,i)}if(Jt(e)||Ht(e)){this._requestResponseMap.set(n,e);let i=[...this._requestToStreamMapping.entries()].filter(([a,s])=>s===o).map(([a])=>a);if(i.every((a)=>this._requestResponseMap.has(a))){if(!r){if(this._enableJsonResponse)throw Error(`No connection established for request ID: ${String(n)}`);if(!this._eventStore){this.onerror?.(Error(`Response for request ID ${String(n)} is undeliverable: per-request stream is disconnected and no eventStore is configured`));for(let a of i)this._requestResponseMap.delete(a),this._requestToStreamMapping.delete(a);return}for(let a of i)this._requestResponseMap.delete(a),this._requestToStreamMapping.delete(a);return}if(this._enableJsonResponse&&r.resolveJson){let a={"Content-Type":"application/json"};if(this.sessionId!==void 0)a["mcp-session-id"]=this.sessionId;let s=i.map((c)=>this._requestResponseMap.get(c));if(s.length===1)r.resolveJson(Response.json(s[0],{status:200,headers:a}));else r.resolveJson(Response.json(s,{status:200,headers:a}));r.cleanup()}else r.cleanup();for(let a of i)this._requestResponseMap.delete(a),this._requestToStreamMapping.delete(a)}}}};function Tr(e){if(e===null||typeof e!=="object"||Array.isArray(e))return null;let{method:t,id:n}=e;if(typeof t!=="string")return null;return typeof n==="string"||typeof n==="number"?n:null}function xr(e,t,n,o,r=null){return Response.json({jsonrpc:"2.0",error:{code:t,message:n,...o!==void 0&&{data:o}},id:r},{status:e})}function Tu(e,t=null){return xr(e.httpStatus,e.code,e.message,e.data,t)}function xu(e){return e instanceof Error?e:Error(String(e))}function ku(e=null){return xr(500,-32603,"Internal server error",void 0,e)}function LE(e,t,n){return async(o,r)=>{if(o.method.toUpperCase()!=="POST")return xr(405,-32000,"Method not allowed.");try{let i=await e({era:"legacy",...r?.authInfo!==void 0&&{authInfo:r.authInfo},requestInfo:o}),a=new Eu({sessionIdGenerator:void 0,...n!==void 0&&{keepAliveMs:n}});await i.connect(a);let s=()=>{a.close().catch(()=>{}),i.close().catch(()=>{})};o.signal?.addEventListener("abort",s,{once:!0});let c=await a.handleRequest(o,{...r?.authInfo!==void 0&&{authInfo:r.authInfo},...r?.parsedBody!==void 0&&{parsedBody:r.parsedBody}});if(c.body===null||Ov(c.headers.get("content-type"))!=="text/event-stream")return s(),c;let u=c.body.getReader(),d=!1,m=()=>{if(!d)d=!0,s()},p=new ReadableStream({pull:async(h)=>{try{let{done:b,value:R}=await u.read();if(b){m(),h.close();return}if(R!==void 0)h.enqueue(R)}catch(b){m(),h.error(b)}},cancel:(h)=>(m(),u.cancel(h).catch(()=>{}))});return new Response(p,{status:c.status,statusText:c.statusText,headers:c.headers})}catch(i){try{t?.(xu(i))}catch{}return ku(Tr(r?.parsedBody))}}}async function i$(e,t,n=!0){let o=e.method.toUpperCase(),r,i=t,a=e,s=!1;if(o==="POST"){if(i===void 0){if(n)a=e.clone();let c;try{c=await e.text()}catch{return{step:"unreadable-body"}}try{r=c.length===0?void 0:JSON.parse(c)}catch{s=!0}if(!s&&r!==void 0)i=r}else r=i;if(s||r===void 0)return{step:"no-json-body",forwardRequest:a}}return{step:"classified",outcome:bb({httpMethod:o,protocolVersionHeader:e.headers.get("mcp-protocol-version")??void 0,mcpMethodHeader:e.headers.get("mcp-method")??void 0,mcpNameHeader:e.headers.get("mcp-name")??void 0,...r!==void 0&&{body:r}}),body:r,parsedBody:i,forwardRequest:a}}async function a$(e,t){let n=await i$(t===void 0&&e.method.toUpperCase()==="POST"?e.clone():e,t,!1);return n.step==="no-json-body"||n.step==="classified"&&n.outcome.kind==="legacy"}function s$(e,t={}){let{legacy:n,onerror:o,responseMode:r}=t;if(typeof n==="function")throw TypeError("The 'legacy' option only accepts 'stateless' or 'reject', not a handler function. To serve 2025-era traffic with your own handler, route in user land with the exported isLegacyRequest(request) predicate in front of a strict (legacy: 'reject') handler.");let i=new Set,a=!1,s=(z)=>{try{o?.(z)}catch{}},c=t.bus??new Hb(s),u=Yb(c),d=Gb({bus:c,maxSubscriptions:t.maxSubscriptions??Mv,keepAliveMs:t.keepAliveMs??da,onerror:s});if(r==="json")console.warn("responseMode: 'json' drops mid-call notifications. subscriptions/listen streams are always served over SSE regardless; other notifications emitted before a result are dropped.");let m=n==="reject"?void 0:LE(e,s,t.keepAliveMs);async function p(z,N,B){let P=z.classification.revision;if(P===void 0||!ia.includes(P)){let ce=new vu({supported:[...ia],requested:P??"unknown"});return s(ce),xr(400,ce.code,ce.message,ce.data,Tr(z.message))}let O=Sb({httpMethod:N.method,mcpMethodHeader:N.headers.get("mcp-method")??void 0,mcpNameHeader:N.headers.get("mcp-name")??void 0},z);if(O!==void 0)return s(Error(`Rejected inbound request (${O.cell}): ${O.message}`)),Tu(O,Tr(z.message));let J=z.messageKind==="request"?Rr(z.message.params):void 0,Y=J?.[Ot];if(z.messageKind==="request"){let ce=Wy(z.message.method);if(ce!==void 0){let ue=oa(ce,Y);if(ue!==void 0){let Te=new aa({requiredCapabilities:ue});return s(Te),xr(_b(Te.code,"ladder"),Te.code,Te.message,Te.data,z.message.id)}}}let ee=await e({era:"modern",...B!==void 0&&{authInfo:B},requestInfo:N}),ne=ee instanceof po?ee.server:ee;if(z.messageKind==="request"&&z.message.method==="subscriptions/listen"){let ce=ne.getCapabilities(),ue=n$(ne);return ee.close().catch(s),d.serve(z.message,N.signal,ce,ue)}if(z.messageKind==="request"&&z.message.method==="tools/call"&&ee instanceof po){let ce=z.message.params,ue=typeof ce?.name==="string"?ce.name:void 0,Te=ue===void 0?void 0:ee.toolInputSchemaJson(ue);if(Te!==void 0){let tt=yu(Te);if(tt.valid&&tt.declarations.length>0){let Ne=vb(tt.declarations,ce?.arguments,N.headers);if(Ne!==void 0)return ee.close().catch(s),s(Error(`Rejected inbound request (${Ne.cell}): ${Ne.message}`)),Tu(Ne,z.message.id)}}}if(Nb(ne,P),r$(ne,ia),J!==void 0)t$(ne,{clientInfo:J[Xr],clientCapabilities:Y});let ae=ne.onclose;i.add(ne),ne.onclose=()=>{i.delete(ne),ae?.()};try{let ce=await qE(ee,z.message,{classification:z.classification,request:N,...B!==void 0&&{authInfo:B},...r!==void 0&&{responseMode:r},...t.keepAliveMs!==void 0&&{keepAliveMs:t.keepAliveMs}});if(z.messageKind==="notification")queueMicrotask(()=>void ne.close().catch(()=>{}));return ce}catch(ce){if(ce instanceof te&&ce.code===ie.ConnectionClosed)return new Response(null,{status:499});return await ne.close().catch(()=>{}),i.delete(ne),s(xu(ce)),ku(Tr(z.message))}}async function h(z,N,B,P){if(m!==void 0)return m(N,{...B!==void 0&&{authInfo:B},...P!==void 0&&{parsedBody:P}});let O=$b(z,ia);if(O===void 0)return new Response(null,{status:202});return s(Error(`Rejected 2025-era request on a modern-only endpoint (${O.cell}): ${O.message}`)),Tu(O,Tr(P))}async function b(z,N){let B=N?.authInfo;if(z.method.toUpperCase()==="POST"&&!Cv(z.headers.get("content-type")))return s(Error("Unsupported Media Type: Content-Type must be application/json")),xr(415,-32000,"Unsupported Media Type: Content-Type must be application/json");let P=await i$(z,N?.parsedBody);if(P.step==="unreadable-body")return xr(400,-32700,"Parse error: the request body could not be read");if(P.step==="no-json-body"){if(m!==void 0)return m(P.forwardRequest,{...B!==void 0&&{authInfo:B}});return xr(400,-32700,"Parse error: the request body is not valid JSON")}let{outcome:O,body:J,parsedBody:Y,forwardRequest:ee}=P;try{switch(O.kind){case"reject":return s(Error(`Rejected inbound request (${O.cell}): ${O.message}`)),Tu(O,Tr(J));case"modern":return await p(O,z,B);case"legacy":return await h(O,ee,B,Y)}}catch(ne){return s(xu(ne)),ku(Tr(J))}}return{fetch:async(z,N)=>{if(a)throw Error("This MCP handler has been closed");try{return await b(z,N)}catch(B){return s(xu(B)),ku(Tr(N?.parsedBody))}},notify:u,bus:c,close:async()=>{a=!0,d.closeAll();let z=[...i].map((N)=>N.close().catch(()=>{}));i.clear(),await Promise.all(z)}}}function Uv(e){if(typeof e!=="string")return null;let t=e.replace(/[^\x20-\x7e]/g," ").replace(/\s+/g," ").trim();if(!t)return null;return t.slice(0,128).trim()}function c$(e,t,n){if(!t)return;let o=Uv(n.clientName);if(o)e.set("X-MCP-Client-Name",o);let r=n.clientInfo?.(),i=Uv(r?.name);if(i)e.set("X-MCP-Client-Info-Name",i);let a=Uv(r?.version);if(a)e.set("X-MCP-Client-Info-Version",a)}var DE=new Map([["oauth_connection_revoked","The upstream account for this server was disconnected. Reconnect it in MCPCloud to use this tool."],["oauth_refresh_failed","The upstream account for this server could not be refreshed. Reconnect it in MCPCloud to use this tool."],["oauth_refresh_token_missing","The upstream account for this server cannot be refreshed. Reconnect it in MCPCloud to use this tool."],["oauth_elicitation_required","Authentication is required to use this tool."],["oauth_rate_limited","Too many credential requests for this server. Wait a moment and retry."],["oauth_runtime_grant_invalid","MCPCloud rejected this server's credential request. Redeploy the server if this keeps happening."]]);function ZE(e){if(!e||typeof e!=="object"||Array.isArray(e))return null;let t=e.error;if(!t||typeof t!=="object")return null;let n=t.code;return typeof n==="string"&&n?n:null}function qv(e,t){let n=ZE(e);return n&&DE.get(n)||t}var l$=-32042;function u$(e){if(!e||typeof e!=="object"||Array.isArray(e))return null;let t=e.elicitation;if(!t||typeof t!=="object")return null;let n=t;if(typeof n.url!=="string"||!n.url)return null;return{url:n.url,message:typeof n.message==="string"&&n.message?n.message:"Authentication is required to use this tool.",elicitationId:typeof n.elicitationId==="string"?n.elicitationId:""}}async function FE(e,t,n){if(!e.oauth)throw Error("OAuth runtime settings are not available for this generated server.");let o=e.oauth.mode==="perMember"?t.runtimeToken:null,r=await qu(e,{connectionId:e.oauth.connectionId,forceRefresh:n,callerRuntimeToken:o}),i=await r.json().catch(()=>null);if(!r.ok){let s=u$(i);if(s)throw new D(l$,s.message,{elicitations:[{mode:"url",message:s.message,url:s.url,elicitationId:s.elicitationId}]});throw Error(qv(i,"Unable to resolve the delegated OAuth access token from MCPCloud."))}if(!i||typeof i!=="object"||Array.isArray(i))throw Error("Unable to resolve the delegated OAuth access token from MCPCloud.");let a=typeof i.accessToken==="string"&&i.accessToken.trim()?i.accessToken.trim():null;if(!a)throw Error("MCPCloud did not return an OAuth access token for this request.");return{accessToken:a,tokenType:typeof i.tokenType==="string"&&i.tokenType.trim()?i.tokenType.trim():null}}async function KE(e,t,n){if(!t.runtimeToken)throw Error("Per-member upstream keys require a protected deployment with a verified caller identity.");let o=await f_(e,{callerRuntimeToken:t.runtimeToken,reportInvalid:n}),r=await o.json().catch(()=>null);if(!o.ok){let a=u$(r);if(a)throw new D(l$,a.message,{elicitations:[{mode:"url",message:a.message,url:a.url,elicitationId:a.elicitationId}]});throw Error(qv(r,"Unable to resolve your upstream API key from MCPCloud."))}let i=r&&typeof r.apiKey==="string"&&r.apiKey.trim()?r.apiKey.trim():null;if(!i)throw Error("MCPCloud did not return an upstream API key for this request.");return i}function d$(e){return e.some((t)=>t.type==="oauth2"||t.type==="openIdConnect")}function m$(e,t,n){if(!n)return!1;let o=n.toolOverrides[e];if(o==="on")return!0;if(o==="off")return!1;return n.applyToAllTools||d$(t)}async function ma(e,t,n,o,r=!1){let i=new Headers;c$(i,e.forwardClientIdentity,o);for(let[u,d]of Object.entries(e.customHeaders))i.set(u,d);if(m$(t,n,e.oauth)&&e.oauth){let u=await FE(e,o,r);return i.set("Authorization",`${u.tokenType||"Bearer"} ${u.accessToken}`),i}let a=e.memberKey?await KE(e,o,r):e.apiKey;if(!a)return i;let s=n.find((u)=>u.type==="apiKey"&&u.in==="header");if(s)return i.set(s.name||e.apiKeyHeader,`${e.apiKeyPrefix}${a}`),i;if(n.find((u)=>u.type==="http"&&u.scheme?.toLowerCase()==="bearer"))return i.set("Authorization",`Bearer ${a}`),i;return i.set(e.apiKeyHeader,`${e.apiKeyPrefix}${a}`),i}var JE=new Set([408,429,500,502,503,504]);function p$(e){return JE.has(e)}class pa extends Error{status;retryable;retryAfterSeconds;constructor(e,t,n=null){super(e);this.name="UpstreamHttpError",this.status=t,this.retryable=p$(t),this.retryAfterSeconds=n}}class an extends Error{toolName;issues;constructor(e,t){super(`Invalid input for ${e}: ${t.join("; ")}`);this.name="ToolInputError",this.toolName=e,this.issues=t}}function Lv(e){if(e instanceof pa)return{error:e.message,errorClass:"UPSTREAM",httpStatus:e.status,retryable:e.retryable,...e.retryAfterSeconds!==null?{retryAfterSeconds:e.retryAfterSeconds}:{}};if(e instanceof an)return{error:e.message,errorClass:"BINDING_MISUSE",retryable:!1};return{error:e instanceof Error?e.message:typeof e==="string"?e:"Tool execution failed.",errorClass:"INTERNAL",retryable:!1}}function VE(e){return typeof e==="object"&&e!==null&&e.code===-32042}function f$(e){let t=Lv(e);return{content:[{type:"text",text:t.error}],isError:!0,_meta:{...t}}}function h$(e){let n=e.data?.elicitations;if(!Array.isArray(n))return[];return n.filter((o)=>Boolean(o)&&typeof o==="object"&&typeof o.url==="string")}function BE(e,t){let n=h$(e);if(n.length===0)return null;let o=e instanceof Error&&e.message||"Authorization is required.",r=Object.fromEntries(n.map((i,a)=>[i.elicitationId||`elicitation_${a}`,t.elicitUrl({url:i.url,message:i.message||o})]));return t({inputRequests:r})}function HE(e,t){if(!t)return null;if(t.elicitation)return null;let n=h$(e);if(n.length===0)return null;let o=e instanceof Error&&e.message||"Authorization is required.",r=n.map((i)=>`${i.message||o} Open this page to continue, then run the tool again: ${i.url}`);return r.push("Reconnecting or signing in to MCPCloud again will not resolve this — the credential has to be provided at the link above."),{content:[{type:"text",text:r.join(" ")}],isError:!0,_meta:{...Lv(e),errorClass:"POLICY_DENIED",retryable:!1,elicitationUndeliverable:!0,elicitationUrls:n.map((i)=>i.url)}}}async function fa(e,t){try{return await e()}catch(n){if(VE(n)){let o=HE(n,t?.clientCapabilities?.());if(o)return o;if(t?.era==="modern"&&t.inputRequired){let r=BE(n,t.inputRequired);if(r)return r}throw n}return f$(n)}}var YE=/^(?:invalid|missing|expired|revoked|bad)[_-]?(?:token|api[_-]?key|key|credentials?|auth)$|^(?:token|api[_-]?key|key|credentials?)[_-]?(?:expired|revoked|invalid|missing)$|^unauthenticated$/i;function g$(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function v$(e){if(!g$(e))return{code:null,message:null};let t=g$(e.error)?e.error:null,n=(...o)=>{for(let r of o)if(typeof r==="string"&&r.trim())return r.trim();return null};return{code:n(t?.code,t?.type,e.code,e.error_code,e.errorCode,typeof e.error==="string"?e.error:null),message:n(t?.message,e.message,e.error_description,e.detail)}}function _$(e){let{code:t}=v$(e);return t!==null&&YE.test(t)}function S$(e,t){if(e!==403)return null;let{code:n,message:o}=v$(t);if(!n&&!o)return null;return`The upstream API refused this action: ${[n,o].filter(Boolean).join(" — ")}. This is a permission decision, not a connection problem — reconnecting will not change it.`}function ha(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function GE(e,t){let n=e.properties;if(!n||typeof n!=="object"||Array.isArray(n))return null;let o=n[t];if(!o||typeof o!=="object"||Array.isArray(o))return null;let r=o["x-location"];return typeof r==="string"&&r.trim()?r:null}function b$(e){return e.endpoint.protocol==="graphql"&&Boolean(e.endpoint.document)}function y$(e,t){if(/^https?:\/\//i.test(t))return new URL(t);let n=e.replace(/\/+$/,"");if(!/^https?:\/\//i.test(n))throw Error(`Upstream base URL is not configured for this server — set UPSTREAM_BASE_URL to an absolute http(s) URL in Settings → General (got ${n?`"${n}"`:"an empty value"}).`);return new URL(t?`${n}/${t.replace(/^\/+/,"")}`:n)}async function WE(e,t,n,o,r=!1){let i=y$(n.upstreamBaseUrl,e.endpoint.path),a=await ma(n,e.name,e.auth,o,r);if(b$(e)){a.set("Accept","application/json"),a.set("Content-Type","application/json");let m=Object.fromEntries(Object.entries(t).filter(([,h])=>h!==void 0)),p=JSON.stringify({query:e.endpoint.document,operationName:e.endpoint.operationId??e.endpoint.rootField??void 0,variables:m});return{url:i.toString(),init:{method:"POST",headers:a,body:p}}}let s=e.endpoint.path.replace(/\{([^}]+)\}/g,(m,p)=>encodeURIComponent(String(t[p]??"")));i.pathname=y$(n.upstreamBaseUrl,s).pathname;let c,u;for(let[m,p]of Object.entries(t)){let h=GE(e.inputSchema,m);if(h==="path")continue;if(h==="query"){if(Array.isArray(p))for(let b of p)i.searchParams.append(m,String(b));else if(p!==void 0&&p!==null)i.searchParams.set(m,String(p));continue}if(h==="header"&&p!==void 0&&p!==null){a.set(m,String(p));continue}if(m==="body"&&p!==void 0)u=p}let d=!["GET","HEAD"].includes(e.endpoint.method.toUpperCase());if(u!==void 0&&d)if(e.endpoint.requestBodyContentType==="application/x-www-form-urlencoded")c=$$(u),a.set("Content-Type","application/x-www-form-urlencoded");else c=JSON.stringify(u),a.set("Content-Type","application/json");return{url:i.toString(),init:{method:e.endpoint.method,headers:a,body:c}}}function $$(e){let t=new URLSearchParams;return Dv(t,null,e),t.toString()}function Dv(e,t,n){if(n===void 0||n===null)return;if(Array.isArray(n)){n.forEach((o,r)=>{Dv(e,t?`${t}[${r}]`:String(r),o)});return}if(ha(n)){for(let[o,r]of Object.entries(n)){let i=t?`${t}[${o}]`:o;Dv(e,i,r)}return}if(t===null)return;e.append(t,typeof n==="string"?n:String(n))}async function XE(e){if((e.headers.get("content-type")||"").includes("application/json"))return await e.json();let n=await e.text();if(!n)return null;try{return JSON.parse(n)}catch{return n}}function R$(e){if(!ha(e)||!Array.isArray(e.errors)||!e.errors.length)return null;let t=e.errors.map((n)=>ha(n)&&typeof n.message==="string"?n.message.trim():null).filter((n)=>Boolean(n));return t.length?t.join(" "):"GraphQL execution failed."}function QE(e){if(!e)return null;let t=e.trim();if(!t)return null;let n=Number(t);if(Number.isFinite(n))return n>=0?Math.ceil(n):null;let o=Date.parse(t);if(Number.isNaN(o))return null;return Math.max(0,Math.ceil((o-Date.now())/1000))}function z$(e,t,n){if(!t?.memberKey)return null;if(e!==401&&!(e===403&&_$(n)))return null;let r=`The credential you connected for ${t.serverName?`“${t.serverName}”`:"this server"} was refused by the upstream API — it was most likely revoked, rotated or expired.`;return t.memberKey.connectPageUrl?`${r} Reconnect at ${t.memberKey.connectPageUrl} — signing in to MCPCloud again will not fix it.`:`${r} Reconnect it on this server's MCPCloud connect page — signing in to MCPCloud again will not fix it.`}function Zv(e,t,n,o=null,r){let i=R$(n),a=e.errorMappings.find((h)=>h.statusCode===String(t)),s=i||(typeof n==="string"?n:n?JSON.stringify(n,null,2):"No response body was returned."),c=a?.message?`${a.message} (HTTP ${t})`:`Upstream request failed with status ${t}.`,u=z$(t,r,n),d=u?null:S$(t,n),m=u??d,p=m?`${c} ${m} ${s}`:`${c} ${s}`;return new pa(p,t,o)}function ew(e,t,n,o){if(!t.ok)throw Zv(e,t.status,n,QE(t.headers.get("retry-after")),o);if(!b$(e))return n;if(R$(n))throw Zv(e,t.status||200,n);if(!ha(n)||!ha(n.data))throw Error("GraphQL execution did not return a data payload.");if(e.endpoint.rootField&&Object.prototype.hasOwnProperty.call(n.data,e.endpoint.rootField))return n.data[e.endpoint.rootField];return n.data}function tw(e,t){if(t===null)return`${e.title} completed successfully.`;if(typeof t==="string")return t;return JSON.stringify(t,null,2)}function T$(e){let t=e.previousPem?.trim();if(!t)return{usable:!1,reason:"absent"};let n=e.previousUntil?.trim();if(!n)return{usable:!1,reason:"no-window"};let o=Number(n);if(!Number.isFinite(o))return{usable:!1,reason:"malformed-window"};if(o<=e.nowMs)return{usable:!1,reason:"expired"};return{usable:!0,pem:t,expiresAtMs:o}}var x$=null,k$=null;function rw(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function E$(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function w$(e){return e==="privateOrg"||e==="unlisted"}function Kv(e){if(e==="privateOrg")return{protected:!0,summary:"This MCP endpoint requires an MCPCloud runtime token for callers in the deployment organization."};if(e==="unlisted")return{protected:!0,summary:"This MCP endpoint requires an MCPCloud runtime token and does not rely on URL secrecy as the primary control."};return{protected:!1,summary:"This MCP endpoint is public."}}function Fv(e,t,n){return Response.json({error:t,message:n},{status:e})}function nw(e){let t=e.get("authorization")?.trim();if(!t)return null;return t.match(/^Bearer\s+(.+)$/i)?.[1]?.trim()||null}function I$(e){let t=atob(e);return Uint8Array.from(t,(n)=>n.charCodeAt(0))}function P$(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t+"=".repeat((4-t.length%4)%4);return I$(n)}function O$(e){let t=e.replace(/-----BEGIN[^-]+-----/g,"").replace(/-----END[^-]+-----/g,"").replace(/\s+/g,"");return E$(I$(t))}function ow(e){return JSON.parse(new TextDecoder().decode(P$(e)))}async function iw(e){return x$||=crypto.subtle.importKey("spki",O$(e.publicKey),{hash:"SHA-256",name:"RSASSA-PKCS1-v1_5"},!1,["verify"]),await x$}async function aw(e){return k$||=crypto.subtle.importKey("spki",O$(e),{hash:"SHA-256",name:"RSASSA-PKCS1-v1_5"},!1,["verify"]),await k$}async function sw(e,t,n){let[o,r,i]=e.split(".");if(!o||!r||!i)throw Error("Runtime token is malformed.");let a=ow(r);if(!rw(a))throw Error("Runtime token payload is invalid.");let s=E$(P$(i)),c=new TextEncoder().encode(`${o}.${r}`),u=await crypto.subtle.verify("RSASSA-PKCS1-v1_5",await iw(n),s,c);if(!u){let m=T$({previousPem:n.publicKeyPrevious,previousUntil:n.publicKeyPreviousUntil,nowMs:Date.now()});if(m.usable)try{u=await crypto.subtle.verify("RSASSA-PKCS1-v1_5",await aw(m.pem),s,c)}catch{u=!1}}if(!u)throw Error("Runtime token signature is invalid.");let d=Math.floor(Date.now()/1000);if(a.aud!==n.audience||a.iss!==n.issuer||a.accessMode!==t||a.orgId!==n.organizationId||a.serverId!==n.serverId||typeof a.exp!=="number"||a.exp<=d||typeof a.iat!=="number"||typeof a.jti!=="string"||typeof a.sub!=="string")throw Error("Runtime token claims are invalid.");return{sub:a.sub,clientName:typeof a.clientName==="string"?a.clientName:null}}async function Jv(e,t){if(!w$(t.accessMode))return{response:null,callerUserId:null,rawToken:null};if(!t.runtimeAuth)return{response:Fv(500,"runtime_auth_misconfigured","Runtime auth is not configured for this deployment."),callerUserId:null,rawToken:null};let n=nw(e.headers);if(!n)return{response:Fv(401,"runtime_auth_required","This MCP endpoint requires an MCPCloud runtime access token."),callerUserId:null,rawToken:null};try{let o=await sw(n,t.accessMode,t.runtimeAuth);return{response:null,callerUserId:o.sub,rawToken:n,callerClientName:o.clientName}}catch{return{response:Fv(401,"runtime_auth_invalid","This MCP endpoint requires a valid MCPCloud runtime access token."),callerUserId:null,rawToken:null}}}function N$(e,t,n){if(Math.abs(e.length-t.length)>n)return n+1;let o=Array.from({length:t.length+1},(r,i)=>i);for(let r=1;r<=e.length;r+=1){let i=[r],a=r;for(let s=1;s<=t.length;s+=1){let c=e[r-1]===t[s-1]?0:1;i[s]=Math.min(o[s]+1,i[s-1]+1,o[s-1]+c),a=Math.min(a,i[s])}if(a>n)return n+1;o=i}return o[t.length]}function cw(e,t){if(!t.length)return null;let n=Math.max(1,Math.floor(e.length/3)),o=e.toLowerCase(),r=null,i=n+1;for(let a of t){if(a.toLowerCase()===o)return a;let s=N$(o,a.toLowerCase(),n);if(s<=n&&s<i)r=a,i=s}return r}function j$(e,t,n){if(!t.length)return{suggestion:null,nearest:[]};let o=e.toLowerCase(),r=Math.max(1,e.length),i=t.map((c)=>({name:c,distance:N$(o,c.toLowerCase(),r)}));i.sort((c,u)=>c.distance-u.distance||(c.name<u.name?-1:1));let a=Math.max(1,Math.ceil(e.length/2)),[s]=i;return{suggestion:s.distance<=a?s.name:null,nearest:i.slice(0,n).map((c)=>c.name)}}function sn(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function $e(e){return e.length?`/${e.join("/")}`:"/"}function A$(e){let t=e.type;if(typeof t==="string")return[t];if(Array.isArray(t))return t.filter((n)=>typeof n==="string");return[]}function lw(e){return e.nullable===!0||A$(e).includes("null")}function Iu(e,t,n){let o=[];return wu(e,t,n,o),o}function M$(e,t){return Iu(e,t,[]).map((n)=>`${n.path} ${n.message}`)}function C$(e,t,n,o,r){let i=t[e];if(!Array.isArray(i)||!i.length)return!1;if(i.filter((s)=>sn(s)&&Iu(s,n,o).length===0).length>0)return!0;return r.push({path:$e(o),message:"must match at least one allowed schema"}),!0}function uw(e,t,n,o){if(!sn(t))return o.push({path:$e(n),message:"must be an object"}),!0;let r=sn(e.properties)?e.properties:{},i=Array.isArray(e.required)?e.required.filter((s)=>typeof s==="string"):[],a=sn(e.additionalProperties)?e.additionalProperties:null;for(let s of i)if(!(s in t)||t[s]===void 0)o.push({path:$e([...n,s]),message:"is required"});if(e.additionalProperties===!1){for(let s of Object.keys(t))if(!(s in r)){let c=cw(s,Object.keys(r));o.push({path:$e([...n,s]),message:c?`is not allowed (did you mean "${c}"?)`:"is not allowed"})}}else if(a)for(let[s,c]of Object.entries(t)){if(s in r)continue;wu(a,c,[...n,s],o)}for(let[s,c]of Object.entries(r)){if(!(s in t)||t[s]===void 0)continue;if(sn(c))wu(c,t[s],[...n,s],o)}return!0}function dw(e,t,n,o){if(!Array.isArray(t))return o.push({path:$e(n),message:"must be an array"}),!0;if(typeof e.minItems==="number"&&t.length<e.minItems)o.push({path:$e(n),message:`must contain at least ${e.minItems} items`});if(typeof e.maxItems==="number"&&t.length>e.maxItems)o.push({path:$e(n),message:`must contain no more than ${e.maxItems} items`});if(sn(e.items))t.forEach((r,i)=>wu(e.items,r,[...n,String(i)],o));return!0}function mw(e,t,n,o){if(typeof t!=="string")return o.push({path:$e(n),message:"must be a string"}),!0;if(typeof e.minLength==="number"&&t.length<e.minLength)o.push({path:$e(n),message:`must have length at least ${e.minLength}`});if(typeof e.maxLength==="number"&&t.length>e.maxLength)o.push({path:$e(n),message:`must have length no greater than ${e.maxLength}`});if(typeof e.pattern==="string"){if(!new RegExp(e.pattern).test(t))o.push({path:$e(n),message:`must match pattern ${e.pattern}`})}return!0}function pw(e,t,n,o,r){if(typeof n!=="number"||Number.isNaN(n))return r.push({path:$e(o),message:e==="integer"?"must be an integer":"must be a number"}),!0;if(e==="integer"&&!Number.isInteger(n))r.push({path:$e(o),message:"must be an integer"});if(typeof t.minimum==="number"&&n<t.minimum)r.push({path:$e(o),message:`must be at least ${t.minimum}`});if(typeof t.maximum==="number"&&n>t.maximum)r.push({path:$e(o),message:`must be no greater than ${t.maximum}`});return!0}function wu(e,t,n,o){if(t===null&&lw(e))return;if(C$("anyOf",e,t,n,o)||C$("oneOf",e,t,n,o))return;if(Object.prototype.hasOwnProperty.call(e,"const")&&t!==e.const){o.push({path:$e(n),message:`must equal ${JSON.stringify(e.const)}`});return}if(Array.isArray(e.enum)&&!e.enum.some((s)=>s===t)){o.push({path:$e(n),message:`must be one of ${e.enum.map((s)=>JSON.stringify(s)).join(", ")}`});return}let r=A$(e).filter((s)=>s!=="null"),i=r.length?r:Array.isArray(e.items)?["array"]:sn(e.properties)?["object"]:[];if(!i.length)return;if(i.length>1){if(!i.find((c)=>Iu({...e,type:c},t,n).length===0))o.push({path:$e(n),message:`must match one of the allowed types: ${i.join(", ")}`});return}let[a]=i;switch(a){case"object":uw(e,t,n,o);return;case"array":dw(e,t,n,o);return;case"string":mw(e,t,n,o);return;case"integer":case"number":pw(a,e,t,n,o);return;case"boolean":if(typeof t!=="boolean")o.push({path:$e(n),message:"must be a boolean"});return;case"null":if(t!==null)o.push({path:$e(n),message:"must be null"});return;default:return}}function fw(e,t,n){let o=Iu(t,n,[]);if(o.length)throw new an(e,o.map((r)=>`${r.path} ${r.message}`));return n}var fo=(e)=>e!==null&&Object.prototype.toString.call(e)==="[object Object]",Ou=(e,t)=>{if(e===t)return!0;if(typeof e!==typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Ou(e[n],t[n]))return!1;return!0}if(fo(e)&&fo(t)){let n=Object.entries(e),o=new Set(Object.keys(t));if(n.length!==o.size)return!1;for(let[r,i]of n){if(!Ou(i,t[r]))return!1;o.delete(r)}return o.size===0}return!1},Pu=(e)=>{if(e===""||e===!1||e===null||e===void 0)return!0;if(Array.isArray(e)&&e.length===0)return!0;if(fo(e)){for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}return!1},hw=(e)=>e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_",U$=(e)=>e>="0"&&e<="9"||e==="-",gw=(e)=>e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="_",_;(function(e){e.TOK_EOF="EOF",e.TOK_UNQUOTEDIDENTIFIER="UnquotedIdentifier",e.TOK_QUOTEDIDENTIFIER="QuotedIdentifier",e.TOK_RBRACKET="Rbracket",e.TOK_RPAREN="Rparen",e.TOK_COMMA="Comma",e.TOK_COLON="Colon",e.TOK_RBRACE="Rbrace",e.TOK_NUMBER="Number",e.TOK_CURRENT="Current",e.TOK_ROOT="Root",e.TOK_EXPREF="Expref",e.TOK_PIPE="Pipe",e.TOK_OR="Or",e.TOK_AND="And",e.TOK_EQ="EQ",e.TOK_GT="GT",e.TOK_LT="LT",e.TOK_GTE="GTE",e.TOK_LTE="LTE",e.TOK_NE="NE",e.TOK_FLATTEN="Flatten",e.TOK_STAR="Star",e.TOK_FILTER="Filter",e.TOK_DOT="Dot",e.TOK_NOT="Not",e.TOK_LBRACE="Lbrace",e.TOK_LBRACKET="Lbracket",e.TOK_LPAREN="Lparen",e.TOK_LITERAL="Literal"})(_||(_={}));var q$={"(":_.TOK_LPAREN,")":_.TOK_RPAREN,"*":_.TOK_STAR,",":_.TOK_COMMA,".":_.TOK_DOT,":":_.TOK_COLON,"@":_.TOK_CURRENT,["$"]:_.TOK_ROOT,"]":_.TOK_RBRACKET,"{":_.TOK_LBRACE,"}":_.TOK_RBRACE},vw={"!":!0,"<":!0,"=":!0,">":!0},_w={"\t":!0,"\n":!0,"\r":!0," ":!0};class L${constructor(){this._current=0}tokenize(e){let t=[];this._current=0;let n,o,r;while(this._current<e.length)if(hw(e[this._current]))n=this._current,o=this.consumeUnquotedIdentifier(e),t.push({start:n,type:_.TOK_UNQUOTEDIDENTIFIER,value:o});else if(q$[e[this._current]]!==void 0)t.push({start:this._current,type:q$[e[this._current]],value:e[this._current]}),this._current+=1;else if(U$(e[this._current]))r=this.consumeNumber(e),t.push(r);else if(e[this._current]==="[")r=this.consumeLBracket(e),t.push(r);else if(e[this._current]==='"')n=this._current,o=this.consumeQuotedIdentifier(e),t.push({start:n,type:_.TOK_QUOTEDIDENTIFIER,value:o});else if(e[this._current]==="'")n=this._current,o=this.consumeRawStringLiteral(e),t.push({start:n,type:_.TOK_LITERAL,value:o});else if(e[this._current]==="`"){n=this._current;let i=this.consumeLiteral(e);t.push({start:n,type:_.TOK_LITERAL,value:i})}else if(vw[e[this._current]]!==void 0)r=this.consumeOperator(e),r&&t.push(r);else if(_w[e[this._current]]!==void 0)this._current+=1;else if(e[this._current]==="&")if(n=this._current,this._current+=1,e[this._current]==="&")this._current+=1,t.push({start:n,type:_.TOK_AND,value:"&&"});else t.push({start:n,type:_.TOK_EXPREF,value:"&"});else if(e[this._current]==="|")if(n=this._current,this._current+=1,e[this._current]==="|")this._current+=1,t.push({start:n,type:_.TOK_OR,value:"||"});else t.push({start:n,type:_.TOK_PIPE,value:"|"});else{let i=Error(`Unknown character: ${e[this._current]}`);throw i.name="LexerError",i}return t}consumeUnquotedIdentifier(e){let t=this._current;this._current+=1;while(this._current<e.length&&gw(e[this._current]))this._current+=1;return e.slice(t,this._current)}consumeQuotedIdentifier(e){let t=this._current;this._current+=1;let n=e.length;while(e[this._current]!=='"'&&this._current<n){let o=this._current;if(e[o]==="\\"&&(e[o+1]==="\\"||e[o+1]==='"'))o+=2;else o+=1;this._current=o}return this._current+=1,JSON.parse(e.slice(t,this._current))}consumeRawStringLiteral(e){let t=this._current;this._current+=1;let n=e.length;while(e[this._current]!=="'"&&this._current<n){let r=this._current;if(e[r]==="\\"&&(e[r+1]==="\\"||e[r+1]==="'"))r+=2;else r+=1;this._current=r}return this._current+=1,e.slice(t+1,this._current-1).replace("\\'","'")}consumeNumber(e){let t=this._current;this._current+=1;let n=e.length;while(U$(e[this._current])&&this._current<n)this._current+=1;let o=parseInt(e.slice(t,this._current),10);return{start:t,value:o,type:_.TOK_NUMBER}}consumeLBracket(e){let t=this._current;if(this._current+=1,e[this._current]==="?")return this._current+=1,{start:t,type:_.TOK_FILTER,value:"[?"};if(e[this._current]==="]")return this._current+=1,{start:t,type:_.TOK_FLATTEN,value:"[]"};return{start:t,type:_.TOK_LBRACKET,value:"["}}consumeOperator(e){let t=this._current,n=e[t];if(this._current+=1,n==="!"){if(e[this._current]==="=")return this._current+=1,{start:t,type:_.TOK_NE,value:"!="};return{start:t,type:_.TOK_NOT,value:"!"}}if(n==="<"){if(e[this._current]==="=")return this._current+=1,{start:t,type:_.TOK_LTE,value:"<="};return{start:t,type:_.TOK_LT,value:"<"}}if(n===">"){if(e[this._current]==="=")return this._current+=1,{start:t,type:_.TOK_GTE,value:">="};return{start:t,type:_.TOK_GT,value:">"}}if(n==="="&&e[this._current]==="=")return this._current+=1,{start:t,type:_.TOK_EQ,value:"=="}}consumeLiteral(e){this._current+=1;let t=this._current,n=e.length;while(e[this._current]!=="`"&&this._current<n){let i=this._current;if(e[i]==="\\"&&(e[i+1]==="\\"||e[i+1]==="`"))i+=2;else i+=1;this._current=i}let o=e.slice(t,this._current).trimLeft();o=o.replace("\\`","`");let r=this.looksLikeJSON(o)?JSON.parse(o):JSON.parse(`"${o}"`);return this._current+=1,r}looksLikeJSON(e){let n=["true","false","null"],o="-0123456789";if(e==="")return!1;if('[{"'.includes(e[0]))return!0;if(n.includes(e))return!0;if("-0123456789".includes(e[0]))try{return JSON.parse(e),!0}catch(r){return!1}return!1}}var Sw=new L$,Ce={[_.TOK_EOF]:0,[_.TOK_UNQUOTEDIDENTIFIER]:0,[_.TOK_QUOTEDIDENTIFIER]:0,[_.TOK_RBRACKET]:0,[_.TOK_RPAREN]:0,[_.TOK_COMMA]:0,[_.TOK_RBRACE]:0,[_.TOK_NUMBER]:0,[_.TOK_CURRENT]:0,[_.TOK_EXPREF]:0,[_.TOK_ROOT]:0,[_.TOK_PIPE]:1,[_.TOK_OR]:2,[_.TOK_AND]:3,[_.TOK_EQ]:5,[_.TOK_GT]:5,[_.TOK_LT]:5,[_.TOK_GTE]:5,[_.TOK_LTE]:5,[_.TOK_NE]:5,[_.TOK_FLATTEN]:9,[_.TOK_STAR]:20,[_.TOK_FILTER]:21,[_.TOK_DOT]:40,[_.TOK_NOT]:45,[_.TOK_LBRACE]:50,[_.TOK_LBRACKET]:55,[_.TOK_LPAREN]:60};class D${constructor(){this.index=0,this.tokens=[]}parse(e){this.loadTokens(e),this.index=0;let t=this.expression(0);if(this.lookahead(0)!==_.TOK_EOF){let n=this.lookaheadToken(0);this.errorToken(n,`Unexpected token type: ${n.type}, value: ${n.value}`)}return t}loadTokens(e){this.tokens=[...Sw.tokenize(e),{type:_.TOK_EOF,value:"",start:e.length}]}expression(e){let t=this.lookaheadToken(0);this.advance();let n=this.nud(t),o=this.lookahead(0);while(e<Ce[o])this.advance(),n=this.led(o,n),o=this.lookahead(0);return n}lookahead(e){return this.tokens[this.index+e].type}lookaheadToken(e){return this.tokens[this.index+e]}advance(){this.index+=1}nud(e){let t,n,o;switch(e.type){case _.TOK_LITERAL:return{type:"Literal",value:e.value};case _.TOK_UNQUOTEDIDENTIFIER:return{type:"Field",name:e.value};case _.TOK_QUOTEDIDENTIFIER:let r={type:"Field",name:e.value};if(this.lookahead(0)===_.TOK_LPAREN)throw Error("Quoted identifier not allowed for function names.");else return r;case _.TOK_NOT:return n=this.expression(Ce.Not),{type:"NotExpression",children:[n]};case _.TOK_STAR:return t={type:"Identity"},n=this.lookahead(0)===_.TOK_RBRACKET&&{type:"Identity"}||this.parseProjectionRHS(Ce.Star),{type:"ValueProjection",children:[t,n]};case _.TOK_FILTER:return this.led(e.type,{type:"Identity"});case _.TOK_LBRACE:return this.parseMultiselectHash();case _.TOK_FLATTEN:return t={type:_.TOK_FLATTEN,children:[{type:"Identity"}]},n=this.parseProjectionRHS(Ce.Flatten),{type:"Projection",children:[t,n]};case _.TOK_LBRACKET:if(this.lookahead(0)===_.TOK_NUMBER||this.lookahead(0)===_.TOK_COLON)return n=this.parseIndexExpression(),this.projectIfSlice({type:"Identity"},n);if(this.lookahead(0)===_.TOK_STAR&&this.lookahead(1)===_.TOK_RBRACKET)return this.advance(),this.advance(),n=this.parseProjectionRHS(Ce.Star),{children:[{type:"Identity"},n],type:"Projection"};return this.parseMultiselectList();case _.TOK_CURRENT:return{type:_.TOK_CURRENT};case _.TOK_ROOT:return{type:_.TOK_ROOT};case _.TOK_EXPREF:return o=this.expression(Ce.Expref),{type:"ExpressionReference",children:[o]};case _.TOK_LPAREN:let i=[];while(this.lookahead(0)!==_.TOK_RPAREN){if(this.lookahead(0)===_.TOK_CURRENT)o={type:_.TOK_CURRENT},this.advance();else o=this.expression(0);i.push(o)}return this.match(_.TOK_RPAREN),i[0];default:this.errorToken(e)}}led(e,t){let n;switch(e){case _.TOK_DOT:let o=Ce.Dot;if(this.lookahead(0)!==_.TOK_STAR)return n=this.parseDotRHS(o),{type:"Subexpression",children:[t,n]};return this.advance(),n=this.parseProjectionRHS(o),{type:"ValueProjection",children:[t,n]};case _.TOK_PIPE:return n=this.expression(Ce.Pipe),{type:_.TOK_PIPE,children:[t,n]};case _.TOK_OR:return n=this.expression(Ce.Or),{type:"OrExpression",children:[t,n]};case _.TOK_AND:return n=this.expression(Ce.And),{type:"AndExpression",children:[t,n]};case _.TOK_LPAREN:let r=t.name,i=[],a;while(this.lookahead(0)!==_.TOK_RPAREN){if(this.lookahead(0)===_.TOK_CURRENT)a={type:_.TOK_CURRENT},this.advance();else a=this.expression(0);if(this.lookahead(0)===_.TOK_COMMA)this.match(_.TOK_COMMA);i.push(a)}return this.match(_.TOK_RPAREN),{name:r,type:"Function",children:i};case _.TOK_FILTER:let c=this.expression(0);return this.match(_.TOK_RBRACKET),n=this.lookahead(0)===_.TOK_FLATTEN&&{type:"Identity"}||this.parseProjectionRHS(Ce.Filter),{type:"FilterProjection",children:[t,n,c]};case _.TOK_FLATTEN:let u={type:_.TOK_FLATTEN,children:[t]},d=this.parseProjectionRHS(Ce.Flatten);return{type:"Projection",children:[u,d]};case _.TOK_EQ:case _.TOK_NE:case _.TOK_GT:case _.TOK_GTE:case _.TOK_LT:case _.TOK_LTE:return this.parseComparator(t,e);case _.TOK_LBRACKET:let m=this.lookaheadToken(0);if(m.type===_.TOK_NUMBER||m.type===_.TOK_COLON)return n=this.parseIndexExpression(),this.projectIfSlice(t,n);return this.match(_.TOK_STAR),this.match(_.TOK_RBRACKET),n=this.parseProjectionRHS(Ce.Star),{type:"Projection",children:[t,n]};default:return this.errorToken(this.lookaheadToken(0))}}match(e){if(this.lookahead(0)===e){this.advance();return}else{let t=this.lookaheadToken(0);this.errorToken(t,`Expected ${e}, got: ${t.type}`)}}errorToken(e,t=""){let n=Error(t||`Invalid token (${e.type}): "${e.value}"`);throw n.name="ParserError",n}parseIndexExpression(){if(this.lookahead(0)===_.TOK_COLON||this.lookahead(1)===_.TOK_COLON)return this.parseSliceExpression();let e={type:"Index",value:this.lookaheadToken(0).value};return this.advance(),this.match(_.TOK_RBRACKET),e}projectIfSlice(e,t){let n={type:"IndexExpression",children:[e,t]};if(t.type==="Slice")return{children:[n,this.parseProjectionRHS(Ce.Star)],type:"Projection"};return n}parseSliceExpression(){let e=[null,null,null],t=0,n=this.lookahead(0);while(n!==_.TOK_RBRACKET&&t<3){if(n===_.TOK_COLON)t+=1,this.advance();else if(n===_.TOK_NUMBER)e[t]=this.lookaheadToken(0).value,this.advance();else{let o=this.lookaheadToken(0);this.errorToken(o,`Syntax error, unexpected token: ${o.value}(${o.type})`)}n=this.lookahead(0)}return this.match(_.TOK_RBRACKET),{children:e,type:"Slice"}}parseComparator(e,t){let n=this.expression(Ce[t]);return{type:"Comparator",name:t,children:[e,n]}}parseDotRHS(e){let t=this.lookahead(0);if([_.TOK_UNQUOTEDIDENTIFIER,_.TOK_QUOTEDIDENTIFIER,_.TOK_STAR].includes(t))return this.expression(e);if(t===_.TOK_LBRACKET)return this.match(_.TOK_LBRACKET),this.parseMultiselectList();if(t===_.TOK_LBRACE)return this.match(_.TOK_LBRACE),this.parseMultiselectHash();let o=this.lookaheadToken(0);this.errorToken(o,`Syntax error, unexpected token: ${o.value}(${o.type})`)}parseProjectionRHS(e){if(Ce[this.lookahead(0)]<10)return{type:"Identity"};if(this.lookahead(0)===_.TOK_LBRACKET)return this.expression(e);if(this.lookahead(0)===_.TOK_FILTER)return this.expression(e);if(this.lookahead(0)===_.TOK_DOT)return this.match(_.TOK_DOT),this.parseDotRHS(e);let t=this.lookaheadToken(0);this.errorToken(t,`Syntax error, unexpected token: ${t.value}(${t.type})`)}parseMultiselectList(){let e=[];while(this.lookahead(0)!==_.TOK_RBRACKET){let t=this.expression(0);if(e.push(t),this.lookahead(0)===_.TOK_COMMA){if(this.match(_.TOK_COMMA),this.lookahead(0)===_.TOK_RBRACKET)throw Error("Unexpected token Rbracket")}}return this.match(_.TOK_RBRACKET),{type:"MultiSelectList",children:e}}parseMultiselectHash(){let e=[],t=[_.TOK_UNQUOTEDIDENTIFIER,_.TOK_QUOTEDIDENTIFIER],n,o,r;for(;;){if(n=this.lookaheadToken(0),!t.includes(n.type))throw Error(`Expecting an identifier token, got: ${n.type}`);if(o=n.value,this.advance(),this.match(_.TOK_COLON),r=this.expression(0),e.push({value:r,type:"KeyValuePair",name:o}),this.lookahead(0)===_.TOK_COMMA)this.match(_.TOK_COMMA);else if(this.lookahead(0)===_.TOK_RBRACE){this.match(_.TOK_RBRACE);break}}return{type:"MultiSelectHash",children:e}}}var yw=new D$,E;(function(e){e[e.TYPE_NUMBER=0]="TYPE_NUMBER",e[e.TYPE_ANY=1]="TYPE_ANY",e[e.TYPE_STRING=2]="TYPE_STRING",e[e.TYPE_ARRAY=3]="TYPE_ARRAY",e[e.TYPE_OBJECT=4]="TYPE_OBJECT",e[e.TYPE_BOOLEAN=5]="TYPE_BOOLEAN",e[e.TYPE_EXPREF=6]="TYPE_EXPREF",e[e.TYPE_NULL=7]="TYPE_NULL",e[e.TYPE_ARRAY_NUMBER=8]="TYPE_ARRAY_NUMBER",e[e.TYPE_ARRAY_STRING=9]="TYPE_ARRAY_STRING"})(E||(E={}));class Z${constructor(e){this.TYPE_NAME_TABLE={[E.TYPE_NUMBER]:"number",[E.TYPE_ANY]:"any",[E.TYPE_STRING]:"string",[E.TYPE_ARRAY]:"array",[E.TYPE_OBJECT]:"object",[E.TYPE_BOOLEAN]:"boolean",[E.TYPE_EXPREF]:"expression",[E.TYPE_NULL]:"null",[E.TYPE_ARRAY_NUMBER]:"Array<number>",[E.TYPE_ARRAY_STRING]:"Array<string>"},this.functionAbs=([t])=>Math.abs(t),this.functionAvg=([t])=>{let n=0;for(let o=0;o<t.length;o+=1)n+=t[o];return n/t.length},this.functionCeil=([t])=>Math.ceil(t),this.functionContains=(t)=>{let[n,o]=t;return n.includes(o)},this.functionEndsWith=(t)=>{let[n,o]=t;return n.includes(o,n.length-o.length)},this.functionFloor=([t])=>Math.floor(t),this.functionJoin=(t)=>{let[n,o]=t;return o.join(n)},this.functionKeys=([t])=>Object.keys(t),this.functionLength=([t])=>{if(!fo(t))return t.length;return Object.keys(t).length},this.functionMap=(t)=>{if(!this._interpreter)return[];let n=[],o=this._interpreter,r=t[0],i=t[1];for(let a=0;a<i.length;a+=1)n.push(o.visit(r,i[a]));return n},this.functionMax=([t])=>{if(!t.length)return null;if(this.getTypeName(t[0])===E.TYPE_NUMBER)return Math.max(...t);let o=t,r=o[0];for(let i=1;i<o.length;i+=1)if(r.localeCompare(o[i])<0)r=o[i];return r},this.functionMaxBy=(t)=>{let n=t[1],o=t[0],r=this.createKeyFunction(n,[E.TYPE_NUMBER,E.TYPE_STRING]),i=-1/0,a,s;for(let c=0;c<o.length;c+=1)if(s=r&&r(o[c]),s!==void 0&&s>i)i=s,a=o[c];return a},this.functionMerge=(t)=>{let n={};for(let o=0;o<t.length;o+=1){let r=t[o];n=Object.assign(n,r)}return n},this.functionMin=([t])=>{if(!t.length)return null;if(this.getTypeName(t[0])===E.TYPE_NUMBER)return Math.min(...t);let o=t,r=o[0];for(let i=1;i<o.length;i+=1)if(o[i].localeCompare(r)<0)r=o[i];return r},this.functionMinBy=(t)=>{let n=t[1],o=t[0],r=this.createKeyFunction(n,[E.TYPE_NUMBER,E.TYPE_STRING]),i=1/0,a,s;for(let c=0;c<o.length;c+=1)if(s=r&&r(o[c]),s!==void 0&&s<i)i=s,a=o[c];return a},this.functionNotNull=(t)=>{for(let n=0;n<t.length;n+=1)if(this.getTypeName(t[n])!==E.TYPE_NULL)return t[n];return null},this.functionReverse=([t])=>{if(this.getTypeName(t)===E.TYPE_STRING){let r=t,i="";for(let a=r.length-1;a>=0;a-=1)i+=r[a];return i}let o=t.slice(0);return o.reverse(),o},this.functionSort=([t])=>[...t].sort(),this.functionSortBy=(t)=>{if(!this._interpreter)return[];let n=t[0].slice(0);if(n.length===0)return n;let o=this._interpreter,r=t[1],i=this.getTypeName(o.visit(r,n[0]));if(i!==void 0&&![E.TYPE_NUMBER,E.TYPE_STRING].includes(i))throw Error(`TypeError: unexpected type (${this.TYPE_NAME_TABLE[i]})`);let a=[];for(let s=0;s<n.length;s+=1)a.push([s,n[s]]);a.sort((s,c)=>{let u=o.visit(r,s[1]),d=o.visit(r,c[1]);if(this.getTypeName(u)!==i)throw Error(`TypeError: expected (${this.TYPE_NAME_TABLE[i]}), received ${this.TYPE_NAME_TABLE[this.getTypeName(u)]}`);else if(this.getTypeName(d)!==i)throw Error(`TypeError: expected (${this.TYPE_NAME_TABLE[i]}), received ${this.TYPE_NAME_TABLE[this.getTypeName(d)]}`);if(u>d)return 1;return u<d?-1:s[0]-c[0]});for(let s=0;s<a.length;s+=1)n[s]=a[s][1];return n},this.functionStartsWith=([t,n])=>t.startsWith(n),this.functionSum=([t])=>t.reduce((n,o)=>n+o,0),this.functionToArray=([t])=>{if(this.getTypeName(t)===E.TYPE_ARRAY)return t;return[t]},this.functionToNumber=([t])=>{let n=this.getTypeName(t),o;if(n===E.TYPE_NUMBER)return t;if(n===E.TYPE_STRING){if(o=+t,!isNaN(o))return o}return null},this.functionToString=([t])=>{if(this.getTypeName(t)===E.TYPE_STRING)return t;return JSON.stringify(t)},this.functionType=([t])=>{switch(this.getTypeName(t)){case E.TYPE_NUMBER:return"number";case E.TYPE_STRING:return"string";case E.TYPE_ARRAY:return"array";case E.TYPE_OBJECT:return"object";case E.TYPE_BOOLEAN:return"boolean";case E.TYPE_EXPREF:return"expref";case E.TYPE_NULL:return"null";default:return}},this.functionValues=([t])=>Object.values(t),this.functionTable={abs:{_func:this.functionAbs,_signature:[{types:[E.TYPE_NUMBER]}]},avg:{_func:this.functionAvg,_signature:[{types:[E.TYPE_ARRAY_NUMBER]}]},ceil:{_func:this.functionCeil,_signature:[{types:[E.TYPE_NUMBER]}]},contains:{_func:this.functionContains,_signature:[{types:[E.TYPE_STRING,E.TYPE_ARRAY]},{types:[E.TYPE_ANY]}]},ends_with:{_func:this.functionEndsWith,_signature:[{types:[E.TYPE_STRING]},{types:[E.TYPE_STRING]}]},floor:{_func:this.functionFloor,_signature:[{types:[E.TYPE_NUMBER]}]},join:{_func:this.functionJoin,_signature:[{types:[E.TYPE_STRING]},{types:[E.TYPE_ARRAY_STRING]}]},keys:{_func:this.functionKeys,_signature:[{types:[E.TYPE_OBJECT]}]},length:{_func:this.functionLength,_signature:[{types:[E.TYPE_STRING,E.TYPE_ARRAY,E.TYPE_OBJECT]}]},map:{_func:this.functionMap,_signature:[{types:[E.TYPE_EXPREF]},{types:[E.TYPE_ARRAY]}]},max:{_func:this.functionMax,_signature:[{types:[E.TYPE_ARRAY_NUMBER,E.TYPE_ARRAY_STRING]}]},max_by:{_func:this.functionMaxBy,_signature:[{types:[E.TYPE_ARRAY]},{types:[E.TYPE_EXPREF]}]},merge:{_func:this.functionMerge,_signature:[{types:[E.TYPE_OBJECT],variadic:!0}]},min:{_func:this.functionMin,_signature:[{types:[E.TYPE_ARRAY_NUMBER,E.TYPE_ARRAY_STRING]}]},min_by:{_func:this.functionMinBy,_signature:[{types:[E.TYPE_ARRAY]},{types:[E.TYPE_EXPREF]}]},not_null:{_func:this.functionNotNull,_signature:[{types:[E.TYPE_ANY],variadic:!0}]},reverse:{_func:this.functionReverse,_signature:[{types:[E.TYPE_STRING,E.TYPE_ARRAY]}]},sort:{_func:this.functionSort,_signature:[{types:[E.TYPE_ARRAY_STRING,E.TYPE_ARRAY_NUMBER]}]},sort_by:{_func:this.functionSortBy,_signature:[{types:[E.TYPE_ARRAY]},{types:[E.TYPE_EXPREF]}]},starts_with:{_func:this.functionStartsWith,_signature:[{types:[E.TYPE_STRING]},{types:[E.TYPE_STRING]}]},sum:{_func:this.functionSum,_signature:[{types:[E.TYPE_ARRAY_NUMBER]}]},to_array:{_func:this.functionToArray,_signature:[{types:[E.TYPE_ANY]}]},to_number:{_func:this.functionToNumber,_signature:[{types:[E.TYPE_ANY]}]},to_string:{_func:this.functionToString,_signature:[{types:[E.TYPE_ANY]}]},type:{_func:this.functionType,_signature:[{types:[E.TYPE_ANY]}]},values:{_func:this.functionValues,_signature:[{types:[E.TYPE_OBJECT]}]}},this._interpreter=e}registerFunction(e,t,n){if(e in this.functionTable)throw Error(`Function already defined: ${e}()`);this.functionTable[e]={_func:t.bind(this),_signature:n}}callFunction(e,t){let n=this.functionTable[e];if(n===void 0)throw Error(`Unknown function: ${e}()`);return this.validateArgs(e,t,n._signature),n._func.call(this,t)}validateInputSignatures(e,t){for(let n=0;n<t.length;n+=1)if("variadic"in t[n]&&n!==t.length-1)throw Error(`ArgumentError: ${e}() 'variadic' argument ${n+1} must occur last`)}validateArgs(e,t,n){var o,r;let i;this.validateInputSignatures(e,n);let a=n.filter((b)=>{var R;return(R=!b.optional)!==null&&R!==void 0?R:!1}).length,s=(r=(o=n[n.length-1])===null||o===void 0?void 0:o.variadic)!==null&&r!==void 0?r:!1,c=t.length<a,u=t.length>n.length,d=c&&(!s&&a>1||s)?"at least ":"";if(s&&c||!s&&(c||u))throw i=n.length>1,Error(`ArgumentError: ${e}() takes ${d}${a} argument${i&&"s"||""} but received ${t.length}`);let m,p,h;for(let b=0;b<n.length;b+=1){h=!1,m=n[b].types,p=this.getTypeName(t[b]);let R;for(R=0;R<m.length;R+=1)if(p!==void 0&&this.typeMatches(p,m[R],t[b])){h=!0;break}if(!h&&p!==void 0){let z=m.map((N)=>this.TYPE_NAME_TABLE[N]).join(" | ");throw Error(`TypeError: ${e}() expected argument ${b+1} to be type (${z}) but received type ${this.TYPE_NAME_TABLE[p]} instead.`)}}}typeMatches(e,t,n){if(t===E.TYPE_ANY)return!0;if(t===E.TYPE_ARRAY_STRING||t===E.TYPE_ARRAY_NUMBER||t===E.TYPE_ARRAY){if(t===E.TYPE_ARRAY)return e===E.TYPE_ARRAY;if(e===E.TYPE_ARRAY){let o;if(t===E.TYPE_ARRAY_NUMBER)o=E.TYPE_NUMBER;else if(t===E.TYPE_ARRAY_STRING)o=E.TYPE_STRING;for(let r=0;r<n.length;r+=1){let i=this.getTypeName(n[r]);if(i!==void 0&&o!==void 0&&!this.typeMatches(i,o,n[r]))return!1}return!0}}else return e===t;return!1}getTypeName(e){switch(Object.prototype.toString.call(e)){case"[object String]":return E.TYPE_STRING;case"[object Number]":return E.TYPE_NUMBER;case"[object Array]":return E.TYPE_ARRAY;case"[object Boolean]":return E.TYPE_BOOLEAN;case"[object Null]":return E.TYPE_NULL;case"[object Object]":if(e.jmespathType===_.TOK_EXPREF)return E.TYPE_EXPREF;return E.TYPE_OBJECT;default:return}}createKeyFunction(e,t){if(!this._interpreter)return;let n=this._interpreter;return(r)=>{let i=n.visit(e,r);if(!t.includes(this.getTypeName(i))){let a=`TypeError: expected one of (${t.map((s)=>this.TYPE_NAME_TABLE[s]).join(" | ")}), received ${this.TYPE_NAME_TABLE[this.getTypeName(i)]}`;throw Error(a)}return i}}}class F${constructor(){this._rootValue=null,this.runtime=new Z$(this)}search(e,t){return this._rootValue=t,this.visit(e,t)}visit(e,t){let n,o,r,i,a,s,c,u,d,m,p;switch(e.type){case"Field":if(t===null)return null;if(fo(t)){if(s=t[e.name],s===void 0)return null;return s}return null;case"Subexpression":r=this.visit(e.children[0],t);for(m=1;m<e.children.length;m+=1)if(r=this.visit(e.children[1],r),r===null)return null;return r;case"IndexExpression":return c=this.visit(e.children[0],t),u=this.visit(e.children[1],c),u;case"Index":if(!Array.isArray(t))return null;let h=e.value;if(h<0)h=t.length+h;if(r=t[h],r===void 0)r=null;return r;case"Slice":if(!Array.isArray(t))return null;let b=[...e.children],R=this.computeSliceParams(t.length,b),[z,N,B]=R;if(r=[],B>0)for(m=z;m<N;m+=B)r.push(t[m]);else for(m=z;m>N;m+=B)r.push(t[m]);return r;case"Projection":if(p=this.visit(e.children[0],t),!Array.isArray(p))return null;d=[];for(m=0;m<p.length;m+=1)if(o=this.visit(e.children[1],p[m]),o!==null)d.push(o);return d;case"ValueProjection":if(p=this.visit(e.children[0],t),!fo(p))return null;d=[];let P=Object.values(p);for(m=0;m<P.length;m+=1)if(o=this.visit(e.children[1],P[m]),o!==null)d.push(o);return d;case"FilterProjection":if(p=this.visit(e.children[0],t),!Array.isArray(p))return null;let O=[],J=[];for(m=0;m<p.length;m+=1)if(n=this.visit(e.children[2],p[m]),!Pu(n))O.push(p[m]);for(let ue=0;ue<O.length;ue+=1)if(o=this.visit(e.children[1],O[ue]),o!==null)J.push(o);return J;case"Comparator":switch(i=this.visit(e.children[0],t),a=this.visit(e.children[1],t),e.name){case _.TOK_EQ:r=Ou(i,a);break;case _.TOK_NE:r=!Ou(i,a);break;case _.TOK_GT:r=i>a;break;case _.TOK_GTE:r=i>=a;break;case _.TOK_LT:r=i<a;break;case _.TOK_LTE:r=i<=a;break;default:throw Error(`Unknown comparator: ${e.name}`)}return r;case _.TOK_FLATTEN:let Y=this.visit(e.children[0],t);if(!Array.isArray(Y))return null;let ee=[];for(m=0;m<Y.length;m+=1)if(o=Y[m],Array.isArray(o))ee=[...ee,...o];else ee.push(o);return ee;case"Identity":return t;case"MultiSelectList":if(t===null)return null;d=[];for(m=0;m<e.children.length;m+=1)d.push(this.visit(e.children[m],t));return d;case"MultiSelectHash":if(t===null)return null;d={};let ne;for(m=0;m<e.children.length;m+=1)ne=e.children[m],d[ne.name]=this.visit(ne.value,t);return d;case"OrExpression":if(n=this.visit(e.children[0],t),Pu(n))n=this.visit(e.children[1],t);return n;case"AndExpression":if(i=this.visit(e.children[0],t),Pu(i))return i;return this.visit(e.children[1],t);case"NotExpression":return i=this.visit(e.children[0],t),Pu(i);case"Literal":return e.value;case _.TOK_PIPE:return c=this.visit(e.children[0],t),this.visit(e.children[1],c);case _.TOK_CURRENT:return t;case _.TOK_ROOT:return this._rootValue;case"Function":let ae=[];for(let ue=0;ue<e.children.length;ue+=1)ae.push(this.visit(e.children[ue],t));return this.runtime.callFunction(e.name,ae);case"ExpressionReference":let ce=e.children[0];return ce.jmespathType=_.TOK_EXPREF,ce;default:throw Error(`Unknown node type: ${e.type}`)}}computeSliceParams(e,t){let[n,o,r]=t;if(r===null)r=1;else if(r===0){let a=Error("Invalid slice, step cannot be 0");throw a.name="RuntimeError",a}let i=r<0?!0:!1;return n=n===null?i?e-1:0:this.capSliceRange(e,n,r),o=o===null?i?-1:e:this.capSliceRange(e,o,r),[n,o,r]}capSliceRange(e,t,n){let o=t;if(o<0){if(o+=e,o<0)o=n<0?-1:0}else if(o>=e)o=n<0?e-1:e;return o}}var bw=new F$,CC=E.TYPE_ANY,NC=E.TYPE_ARRAY,jC=E.TYPE_ARRAY_NUMBER,AC=E.TYPE_ARRAY_STRING,MC=E.TYPE_BOOLEAN,UC=E.TYPE_EXPREF,qC=E.TYPE_NULL,LC=E.TYPE_NUMBER,DC=E.TYPE_OBJECT,ZC=E.TYPE_STRING;function K$(e,t){let n=yw.parse(t);return bw.search(n,e)}function V$(e,t){return Vv(e.responseProjection,t)}function Vv(e,t){if(!e||typeof e!=="string"||!e.trim())return t;if(t===null||typeof t!=="object")return t;try{let n=K$(t,e);return n===void 0?null:n}catch{return t}}function J$(e){if(e===void 0)return 0;try{return new TextEncoder().encode(JSON.stringify(e)??"").length}catch{return 0}}function $w(e,t,n){let o=V$(e,t),r=n?.projectionUsage;if(!r)return o;let i=e.responseProjection;if(!(Boolean(i&&typeof i==="string"&&i.trim())&&t!==null&&typeof t==="object"))return o;let s=J$(t),c=J$(o);return r.preBytes+=s,r.postBytes+=c,r.applied=r.applied||o!==t,o}function ho(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function gt(e,t){if(typeof e.description!=="string"||!e.description)return t;return t.describe(e.description)}function Rw(e){let t=e.map((n)=>S(n));if(!t.length)return Z();if(t.length===1)return t[0];return A(t)}function jt(e,t){let n=e.type;if(!(e.nullable===!0||Array.isArray(n)&&n.includes("null")))return t;return t.nullable()}function ga(e){if(!ho(e))return Z();if(Array.isArray(e.enum)&&e.enum.length)return jt(e,gt(e,Rw(e.enum)));if(Object.prototype.hasOwnProperty.call(e,"const"))return jt(e,gt(e,S(e.const)));for(let n of["oneOf","anyOf"]){let o=e[n];if(Array.isArray(o)&&o.length){let r=o.map((a)=>ga(a)),i=r.length===1?r[0]:A(r);return jt(e,gt(e,i))}}let t=typeof e.type==="string"?e.type:Array.isArray(e.type)?e.type.find((n)=>n!=="null"):null;if(t==="object"||!t&&(ho(e.properties)||Object.prototype.hasOwnProperty.call(e,"additionalProperties")))return B$(e);if(t==="array"){let n=ho(e.items)?ga(e.items):Z();return jt(e,gt(e,v(n)))}if(t==="string"){let n=l();if(typeof e.minLength==="number")n=n.min(e.minLength);if(typeof e.maxLength==="number")n=n.max(e.maxLength);return jt(e,gt(e,n))}if(t==="integer"){let n=x().int();if(typeof e.minimum==="number")n=n.min(e.minimum);if(typeof e.maximum==="number")n=n.max(e.maximum);return jt(e,gt(e,n))}if(t==="number"){let n=x();if(typeof e.minimum==="number")n=n.min(e.minimum);if(typeof e.maximum==="number")n=n.max(e.maximum);return jt(e,gt(e,n))}if(t==="boolean")return jt(e,gt(e,j()));if(t==="null")return gt(e,pt());return jt(e,gt(e,Z()))}function B$(e){if(!ho(e))return f({}).passthrough();let t=ho(e.properties)?e.properties:{},n=new Set(Array.isArray(e.required)?e.required.filter((i)=>typeof i==="string"):[]),o=Object.fromEntries(Object.entries(t).map(([i,a])=>{let s=ga(a),c=n.has(i)?s:s.optional();return[i,c]})),r=e.additionalProperties===!1?f(o).strict():ho(e.additionalProperties)?f(o).catchall(ga(e.additionalProperties)):f(o).passthrough();return jt(e,gt(e,r))}var go=new Map;function zw(e,t){let n=go.get(e)??{};go.set(e,{...n,...t})}function Tw(){go.clear()}function xw(){let e={};for(let[t,n]of go)e[t]={...n};return e}function Bv(e,t){return go.get(e)?.description??t}function Hv(e,t){return go.get(e)?.title??t}function Y$(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter((t)=>t.length>0)}function Yv(e){return[e.name,e.title,e.description,e.tags.join(" ")].join(" ")}function kw(e){let t=e.map((i)=>Y$(Yv(i))),n=new Map;for(let i of t)for(let a of new Set(i))n.set(a,(n.get(a)??0)+1);let o=t.reduce((i,a)=>i+a.length,0),r=t.length?o/t.length:0;return{entries:e,docTokens:t,docFrequency:n,averageDocLength:r}}var H$=new WeakMap;function Ew(e){let t=H$.get(e);if(t)return t;let n=kw(e);return H$.set(e,n),n}function ww(e){let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return t}function Iw(e,t,n){let o=e.docTokens[t];if(!o.length)return 0;let r=ww(o),i=o.length,a=e.entries.length,s=e.averageDocLength||1,c=0;for(let u of n){let d=r.get(u);if(!d)continue;let m=e.docFrequency.get(u)??0,p=Math.log(1+(a-m+0.5)/(m+0.5)),h=d+1.5*(0.25+0.75*i/s);c+=p*(d*2.5/h)}return c}function Pw(e){let t=e.match(/^\/(.+)\/([a-z]*)$/);if(!t)return null;try{return new RegExp(t[1],t[2])}catch{return null}}function Cu(e,t){return{name:e.name,title:e.title,description:e.description,score:t}}function Ow(e,t,n){let o=[];for(let r of e){let i=t.flags.includes("g")?t.flags:`${t.flags}g`;if(new RegExp(t.source,i).test(Yv(r)))o.push(Cu(r,1));if(o.length>=n)break}return o}function Cw(e,t,n){let o=t.toLowerCase().trim();if(!o)return[];let r=[];for(let i of e){if(Yv(i).toLowerCase().includes(o))r.push(Cu(i,1));if(r.length>=n)break}return r}function Gv(e,t,n=10){let o=Math.max(1,Math.min(Math.floor(n)||10,100)),r=t.trim();if(!r)return e.slice(0,o).map((u)=>Cu(u,0));let i=Pw(r);if(i)return Ow(e,i,o);let a=Ew(e),s=Y$(r),c=a.entries.map((u,d)=>({entry:u,score:Iw(a,d,s)})).filter((u)=>u.score>0).sort((u,d)=>d.score-u.score).slice(0,o).map((u)=>Cu(u.entry,Number(u.score.toFixed(4))));if(c.length>0)return c;return Cw(e,r,o)}var Wv="0.19.1";function Nw(e){let t=3735928559,n=1103547991;for(let o=0;o<e.length;o++){let r=e.charCodeAt(o);t=Math.imul(t^r,2654435761),n=Math.imul(n^r,1597334677)}return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),(4294967296*(2097151&n)+(t>>>0)).toString(16)}function G$(e){let t=JSON.stringify(e,(n,o)=>typeof o==="function"?void 0:o);return`mcpc-${Nw(t??"")}`}function W$(e,t){let n=e.headers.get("mcp-session-id")?.trim();if(!n||!n.startsWith("mcpc-"))return!1;return n!==t}async function X$(e){if(e.method!=="POST")return!1;try{let t=await e.clone().json();return(Array.isArray(t)?t:[t]).some((o)=>typeof o==="object"&&o!==null&&o.method==="initialize")}catch{return!1}}function Q$(){return Response.json({jsonrpc:"2.0",id:null,error:{code:-32001,message:"Session not found: this server's tools changed since you connected. Reconnect to load the current tools."}},{status:404})}function eR(e,t){if(!e.ok)return e;let n=new Headers(e.headers);return n.set("Mcp-Session-Id",t),new Response(e.body,{status:e.status,statusText:e.statusText,headers:n})}var Xv={maxDepth:2,maxKeys:12,maxVariants:3};function jw(e){if(e===null)return"null";if(Array.isArray(e))return"array";let t=typeof e;if(t==="object"&&e instanceof Date)return"Date";return t}function tR(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof Date)}function Aw(e,t){let n=[...new Set(e)];if(n.length===0)return"unknown";if(n.length===1)return n[0];let o=[...n].sort();if(o.length>t)return`${o.slice(0,t).join(" | ")} | …${o.length-t} more`;return o.join(" | ")}function Qv(e,t,n,o){if(!tR(e)&&!Array.isArray(e))return jw(e);if(Array.isArray(e)){if(e.length===0)return"unknown[0]";let s=e.slice(0,200).map((c)=>Qv(c,t,n,o));return`${Aw(s,o.maxVariants)}[${e.length}]`}let r=Object.keys(e);if(t<=0&&n.length===0)return"object";let i=r.slice(0,o.maxKeys),a=i.map((s)=>{let c=n[0]===s,u=c?n.slice(1):[],d=c?Math.max(t,1):t-1;return`${s}: ${Qv(e[s],d,u,o)}`});if(r.length>i.length)a.push(`…+${r.length-i.length} more`);return`{${a.join(", ")}}`}function va(e,t={}){let n={maxDepth:t.maxDepth??Xv.maxDepth,maxKeys:t.maxKeys??Xv.maxKeys,maxVariants:t.maxVariants??Xv.maxVariants};return Qv(e,n.maxDepth,t.focusPath??[],n)}function e_(e,t={}){if(!Array.isArray(e)||e.length===0)return[];let n=e.filter(tR);if(n.length===0)return[];let o=n.length,r=new Map,i=new Set;for(let a of n)for(let s of Object.keys(a))i.add(s);for(let a of i){let s=0;for(let c of n){let u=c[a];if(u===null||u===void 0)s+=1}if(s>0)r.set(a,s)}return[...r.entries()].map(([a,s])=>({field:a,missing:s,total:o,text:`${s}/${o} items have ${a} === null`})).sort((a,s)=>s.missing-a.missing||a.field.localeCompare(s.field)).slice(0,t.limit??3)}var Mw=["read","write"],r_="__mcpcloud_call_tool",Uw=`globalThis.tool = (name, args) =>
102
102
  globalThis.${r_}(String(name), JSON.stringify(args ?? {}))
103
- .then((json) => JSON.parse(json));`;function B$(e,t,n,o){let r=[],i=!1,a=!1,s=!1,c=t.newFunction(r_,(d,m)=>{let p=t.newPromise(),h="<unknown>";try{h=t.getString(d);let b=t.getString(m);if(r.length>=o){i=!0;let O=t.newString(`Tool-call budget exhausted: ${o} calls per execution.`);return p.reject(O),O.dispose(),p.settled.then(()=>e.executePendingJobs()),p.handle}if(n.isKnownTool&&!n.isKnownTool(h)){let O=n.describeUnknownTool?n.describeUnknownTool(h):`Unknown tool "${h}".`;r.push({name:h,args:t_(b),durationMs:0,mutates:!1,error:O});let V=t.newString(O);return p.reject(V),V.dispose(),p.settled.then(()=>e.executePendingJobs()),p.handle}let R=n.refuseToolCall?.(h)??null;if(R){a=!0,r.push({name:h,args:t_(b),durationMs:0,mutates:!0,error:R});let O=t.newString(R);return p.reject(O),O.dispose(),p.settled.then(()=>e.executePendingJobs()),p.handle}if(n.effectClassFor){let O=n.allowedEffects??xw,V=n.effectClassFor(h)??null;if(V===null||!O.includes(V)){a=!0;let Y=V===null?`Tool "${h}" has no classified effect and cannot be called from Code Mode.`:`Tool "${h}" is a ${V} operation, which Code Mode does not permit. Call it directly instead.`;r.push({name:h,args:t_(b),durationMs:0,mutates:V!=="read",error:Y});let ee=t.newString(Y);return p.reject(ee),ee.dispose(),p.settled.then(()=>e.executePendingJobs()),p.handle}}let z={};try{z=JSON.parse(b)}catch{z={}}let A=n.isMutation?n.isMutation(h)!==!1:!0,B=Date.now(),P={name:h,args:z,durationMs:0,mutates:A};return r.push(P),n.callTool({name:h,args:z}).then((O)=>{P.durationMs=Date.now()-B;let V=n.projectionFor?.(h),Y=Jv(V,O);if(V){let ae=JSON.stringify(O??null).length,ce=JSON.stringify(Y??null).length;P.preProjectionBytes=ae,P.postProjectionBytes=ce}P.resultShape=va(Y);let ee=e_(Y);if(ee.length)P.facts=ee.map((ae)=>ae.text);let ne=t.newString(JSON.stringify(Y??null));p.resolve(ne),ne.dispose()}).catch((O)=>{P.durationMs=Date.now()-B,P.error=O instanceof Error?O.message:String(O);let V=t.newString(P.error);p.reject(V),V.dispose()}).finally(()=>{e.executePendingJobs()}),p.handle}catch(b){let R=b instanceof Error?b.message:String(b),z=`Tool "${h}" could not be dispatched: ${R}`;r.push({name:h,args:{},durationMs:0,mutates:!0,error:z}),s=!0;let A=t.newString(z);return p.reject(A),A.dispose(),p.settled.then(()=>e.executePendingJobs()),p.handle}});t.setProp(t.global,r_,c),c.dispose();let u=t.evalCode(kw,"mcpcloud:shim");if(u.error){let d=t.dump(u.error);throw u.error.dispose(),Error(`Failed to install the guest tool shim: ${String(d)}`)}return u.value.dispose(),{spans:r,exceededCap:()=>i,deniedByPolicy:()=>a,hostThrew:()=>s}}function t_(e){try{return JSON.parse(e)}catch{return{}}}var Ew=40,_a=200,ww=6,H$=["log","warn","error","info","debug"],n_="__mcpcloud_console",Iw=`globalThis.console = {
104
- ${H$.map((e)=>` ${e}: (...args) => globalThis.${n_}(${JSON.stringify(e)}, JSON.stringify(args.slice(0, ${ww}).map((value) => (value instanceof Error ? { __mcpcloudError: value.name + ': ' + value.message } : value)))),`).join(`
103
+ .then((json) => JSON.parse(json));`;function rR(e,t,n,o){let r=[],i=!1,a=!1,s=!1,c=t.newFunction(r_,(d,m)=>{let p=t.newPromise(),h="<unknown>";try{h=t.getString(d);let b=t.getString(m);if(r.length>=o){i=!0;let O=t.newString(`Tool-call budget exhausted: ${o} calls per execution.`);return p.reject(O),O.dispose(),p.settled.then(()=>e.executePendingJobs()),p.handle}if(n.isKnownTool&&!n.isKnownTool(h)){let O=n.describeUnknownTool?n.describeUnknownTool(h):`Unknown tool "${h}".`;r.push({name:h,args:t_(b),durationMs:0,mutates:!1,error:O});let J=t.newString(O);return p.reject(J),J.dispose(),p.settled.then(()=>e.executePendingJobs()),p.handle}let R=n.refuseToolCall?.(h)??null;if(R){a=!0,r.push({name:h,args:t_(b),durationMs:0,mutates:!0,error:R});let O=t.newString(R);return p.reject(O),O.dispose(),p.settled.then(()=>e.executePendingJobs()),p.handle}if(n.effectClassFor){let O=n.allowedEffects??Mw,J=n.effectClassFor(h)??null;if(J===null||!O.includes(J)){a=!0;let Y=J===null?`Tool "${h}" has no classified effect and cannot be called from Code Mode.`:`Tool "${h}" is a ${J} operation, which Code Mode does not permit. Call it directly instead.`;r.push({name:h,args:t_(b),durationMs:0,mutates:J!=="read",error:Y});let ee=t.newString(Y);return p.reject(ee),ee.dispose(),p.settled.then(()=>e.executePendingJobs()),p.handle}}let z={};try{z=JSON.parse(b)}catch{z={}}let N=n.isMutation?n.isMutation(h)!==!1:!0,B=Date.now(),P={name:h,args:z,durationMs:0,mutates:N};return r.push(P),n.callTool({name:h,args:z}).then((O)=>{P.durationMs=Date.now()-B;let J=n.projectionFor?.(h),Y=Vv(J,O);if(J){let ae=JSON.stringify(O??null).length,ce=JSON.stringify(Y??null).length;P.preProjectionBytes=ae,P.postProjectionBytes=ce}P.resultShape=va(Y);let ee=e_(Y);if(ee.length)P.facts=ee.map((ae)=>ae.text);let ne=t.newString(JSON.stringify(Y??null));p.resolve(ne),ne.dispose()}).catch((O)=>{P.durationMs=Date.now()-B,P.error=O instanceof Error?O.message:String(O);let J=t.newString(P.error);p.reject(J),J.dispose()}).finally(()=>{e.executePendingJobs()}),p.handle}catch(b){let R=b instanceof Error?b.message:String(b),z=`Tool "${h}" could not be dispatched: ${R}`;r.push({name:h,args:{},durationMs:0,mutates:!0,error:z}),s=!0;let N=t.newString(z);return p.reject(N),N.dispose(),p.settled.then(()=>e.executePendingJobs()),p.handle}});t.setProp(t.global,r_,c),c.dispose();let u=t.evalCode(Uw,"mcpcloud:shim");if(u.error){let d=t.dump(u.error);throw u.error.dispose(),Error(`Failed to install the guest tool shim: ${String(d)}`)}return u.value.dispose(),{spans:r,exceededCap:()=>i,deniedByPolicy:()=>a,hostThrew:()=>s}}function t_(e){try{return JSON.parse(e)}catch{return{}}}var qw=40,_a=200,Lw=6,nR=["log","warn","error","info","debug"],n_="__mcpcloud_console",Dw=`globalThis.console = {
104
+ ${nR.map((e)=>` ${e}: (...args) => globalThis.${n_}(${JSON.stringify(e)}, JSON.stringify(args.slice(0, ${Lw}).map((value) => (value instanceof Error ? { __mcpcloudError: value.name + ': ' + value.message } : value)))),`).join(`
105
105
  `)}
106
- };`;function Pw(e){let t=e?.__mcpcloudError;if(typeof t==="string")return t.length>_a?`${t.slice(0,_a)}…`:t;if(typeof e==="string")return e.length>_a?`${e.slice(0,_a)}… (+${e.length-_a} chars)`:e;if(e===null||typeof e==="number"||typeof e==="boolean")return String(e);return va(e)}function Y$(e){let t=[],n=e.newFunction(n_,(r,i)=>{if(t.length>=Ew)return;let a=e.getString(r),s;try{s=JSON.parse(e.getString(i))}catch{return}t.push({level:H$.includes(a)?a:"log",message:s.map(Pw).join(" ")})});e.setProp(e.global,n_,n),n.dispose();let o=e.evalCode(Iw,"mcpcloud:console");if(o.error){let r=e.dump(o.error);throw o.error.dispose(),Error(`Failed to install the guest console: ${String(r)}`)}return o.value.dispose(),{entries:t}}var W$={opcodeBudget:2000000,memoryBytes:67108864,stackBytes:1048576,wallClockMs:30000,maxToolCalls:200},o_="__mcpcloud_sandbox__",X$="code";function Q$(e){if(!e)return null;let t=e.match(new RegExp(`\\(${X$}:(\\d+):(\\d+)\\)`));if(!t)return null;return{line:Number(t[1]),column:Number(t[2])}}function G$(e){let t=e instanceof Error?e.message:String(e);return/maximum call stack size exceeded|stack overflow/i.test(t)}function Ow(e){return/^SyntaxError\b/.test(e)}function Nu(e){if(typeof e==="string")return{message:e};if(e&&typeof e==="object"){let t=e,n=typeof t.name==="string"?t.name:"Error",o=typeof t.message==="string"?t.message:String(e),r=typeof t.stack==="string"?t.stack.split(`
107
- `).filter((i)=>i.trim()&&i.includes(o_)).map((i)=>i.replace(o_,X$)).join(`
108
- `).trim():void 0;return{message:`${n}: ${o}`,...r?{stack:r}:{}}}return{message:String(e)}}function ju(e){if(e.alive)e.dispose()}function Cw(e,t){if(e.typeof(t)!=="object")return!1;let n=e.getProp(t,"then"),o=e.typeof(n)==="function";return n.dispose(),o}function Nw(e,t){e.setMemoryLimit(t.memoryBytes),e.setMaxStackSize(t.stackBytes);let n=0,o=null,r=Date.now()+t.wallClockMs;return e.setInterruptHandler(()=>{if(n+=1,n>t.opcodeBudget)return o="opcodes",!0;if(Date.now()>r)return o="wall_clock",!0;return!1}),e.setModuleLoader(()=>{throw Error("Module imports are not available in this sandbox.")}),{readTicks:()=>n,readReason:()=>o}}async function i_(e,t){let n={...W$,...e.limits},o=e.engine.newRuntime(),{readTicks:r,readReason:i}=Nw(o,n),a=o.newContext(),s=!1,{entries:c}=Y$(a),u=[],d=()=>!1,m=()=>!1;if(e.bindings){let h=B$(o,a,e.bindings,n.maxToolCalls);u=h.spans,d=h.exceededCap,m=h.deniedByPolicy}let p=(h,b,R={})=>({ok:!1,kind:h,message:b,opcodesUsed:r(),spans:u,logs:c,...R});try{let h=a.evalCode(t,o_);if(h.error){let A=a.dump(h.error);if(ju(h.error),m())return p("policy_denied",Nu(A).message);if(d())return p("budget_exhausted",`Execution exceeded its budget of ${n.maxToolCalls} tool calls. Filter before the loop, or page the input.`,{budget:"tool_calls"});let B=i();if(B==="opcodes")return p("budget_exhausted",`Execution exceeded its compute budget of ${n.opcodeBudget.toLocaleString()} opcodes.`,{budget:"opcodes"});if(B==="wall_clock")return p("timeout",`Execution exceeded its ${n.wallClockMs} ms deadline.`,{budget:"wall_clock"});let P=Nu(A);if(/out of memory/i.test(P.message))return p("budget_exhausted",P.message,{budget:"memory"});if(G$(P.message))return p("budget_exhausted",P.message,{budget:"stack"});return p(Ow(P.message)?"syntax_error":"runtime_error",P.message,P.stack?{stack:P.stack}:{})}if(!Cw(a,h.value)){let A=a.dump(h.value);return ju(h.value),{ok:!0,value:A,opcodesUsed:r(),spans:u,logs:c}}let b=a.resolvePromise(h.value);ju(h.value),o.executePendingJobs();let R=await b;if(R.error){let A=a.dump(R.error);if(R.error.dispose(),m())return p("policy_denied",Nu(A).message);if(d())return p("budget_exhausted",`Execution exceeded its budget of ${n.maxToolCalls} tool calls. Filter before the loop, or page the input.`,{budget:"tool_calls"});let B=Nu(A);return p("runtime_error",B.message,B.stack?{stack:B.stack}:{})}let z=a.dump(R.value);return ju(R.value),{ok:!0,value:z,opcodesUsed:r(),spans:u,logs:c}}catch(h){if(G$(h))return s=!0,p("budget_exhausted","Execution exceeded the available call stack. Rewrite deep recursion as iteration.",{budget:"stack"});throw h}finally{if(!s)a.dispose(),o.dispose()}}function c_(e){if(!e?.engine)return!1;return(e.mode??"opt-in")!=="off"}var jw=Symbol.for("@mcpcloud/runtime.codeModeEngineProvider");function Aw(){return globalThis[jw]??null}function tR(e){let t=Aw();if(!e||e.engine||!t)return e;return{...e,engine:t}}function s_(e){if(!e)return null;if(e.readOnlyHint===!0)return"read";if(e.destructiveHint===!0)return"delete";if(e.readOnlyHint===!1)return"write";return null}function Mw(e,t){let n=e.content?.[0],o=n&&n.type==="text"&&typeof n.text==="string"?n.text:null;if(e.isError)throw Error(o??`Tool "${t}" failed.`);if(o===null)return null;try{return JSON.parse(o)}catch{return o}}function Uw(e,t){let{suggestion:n,nearest:o}=P$(e,t,5),r=[`Unknown tool "${e}".`];if(n)r.push(`Did you mean "${n}"?`);let i=n?o.filter((a)=>a!==n):o;if(i.length)r.push(`Nearest: ${i.join(", ")}`);return r.join(" ")}var a_=12,qw=8;function Lw(e,t){if(!e)return[];let n=e.split(`
109
- `);if(t<1||t>n.length)return[];let o=Math.max(1,t-1),r=Math.min(n.length,t+1),i=String(r).length;return Array.from({length:r-o+1},(a,s)=>{let c=o+s,u=c===t?">":" ",d=n[c-1],m=d.length>100?`${d.slice(0,100)}…`:d;return` ${u} ${String(c).padStart(i)} | ${m}`})}function rR(e,t){if(e.ok)return"";let n=[`ExecutionError: ${e.kind}`,` ${e.message}`];if(e.budget)n.push(` budget: ${e.budget}`);let o=e.spans;if(o.length){let r=o.filter((c)=>c.error),i=r.length===1&&r[0].error===e.message;n.push(` tool calls (${o.length}):`);let a=o.length<=a_?o:[...o.slice(0,a_-4),null,...o.slice(-3)];for(let c of a){if(c===null){n.push(` … ${o.length-a_+1} more`);continue}let u=c.error?i?"ERROR (message above)":`ERROR ${c.error}`:c.resultShape??"ok",d=c.mutates&&!c.error?" ⚠ COMMITTED":"";n.push(` ${c.name}(${JSON.stringify(c.args)}) ${c.durationMs}ms → ${u}${d}`)}let s=o.find((c)=>c.facts?.length)?.facts?.[0];if(s)n.push(` shape: ${s}`)}if(e.logs.length){let r=e.logs.slice(-qw),i=e.logs.length-r.length;if(n.push(` console (${e.logs.length}):`),i>0)n.push(` … ${i} earlier`);for(let a of r)n.push(` ${a.level}: ${a.message}`)}if(e.stack){let r=e.stack.split(`
110
- `)[0].trim();n.push(` at: ${r}`);let i=Q$(e.stack);if(i)n.push(...Lw(t,i.line))}return n.join(`
111
- `)}function nR(e,t,n,o){let r=new Map(e.map((i)=>[i.definition.name,i]));return async(i)=>{let a=i?.code;if(typeof a!=="string"||!a.trim())return{isError:!0,content:[{type:"text",text:"Provide JavaScript to run in `code`."}]};let s=await o.engine(),c=await i_({engine:s,limits:o.limits,bindings:{allowedEffects:o.allowedEffects,isKnownTool:(u)=>r.has(u),describeUnknownTool:(u)=>Uw(u,[...r.keys()]),effectClassFor:(u)=>s_(r.get(u)?.definition.annotations),isMutation:(u)=>s_(r.get(u)?.definition.annotations)!=="read",callTool:async({name:u,args:d})=>{let m=r.get(u);if(!m)throw Error(`Unknown tool "${u}".`);return Mw(await m.handler(d,t,n),u)}}},a);if(c.ok)return{content:[{type:"text",text:JSON.stringify(c.value??null,null,2)}],_meta:{opcodesUsed:c.opcodesUsed,toolCalls:c.spans.length}};return{isError:!0,content:[{type:"text",text:rR(c)}],_meta:{error:c.message,errorClass:c.kind,...c.budget?{budget:c.budget}:{},opcodesUsed:c.opcodesUsed,toolCalls:c.spans.length}}}}var l_="codemode_execute",eR='Run JavaScript against this server\'s tools and get back only the final result. Call tools with `await tool("toolName", { ...args })`. Loops, filtering and Promise.all all work, and intermediate results never enter your context. Your code is evaluated as a script, not as a function body: the answer is the value of the last expression, so a top-level `return` is a syntax error. The usual shape is `(async () => { const r = await tool("toolName", {}); return r })()`. Read and write tools are available; destructive ones must be called directly.';function u_(e){return e==="default"?`${eR} Prefer this over calling many tools one at a time.`:`${eR} Useful when a task chains several tools together.`}var Dw={type:"object",properties:{}},Zw=new Set(["x-location"]),Kw=new Set(["description","title","format","examples","deprecated","readOnly","writeOnly"]);function oR(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function d_(e){if(Array.isArray(e))return Object.freeze(e.map(d_));if(!oR(e))return e;let t={};for(let[n,o]of Object.entries(e)){if(Zw.has(n))continue;if(o===null&&Kw.has(n))continue;t[n]=d_(o)}return Object.freeze(t)}function iR(e,t){let n=oR(t)?d_(t):Object.freeze({...Dw});return{"~standard":{version:1,vendor:"mcpcloud",validate:(o)=>{let r=C$(n,o);if(r.length===0)return{value:o};return{issues:[{message:new an(e,r).message}]}},jsonSchema:{input:()=>n,output:()=>n}}}}function Fw(e){let t=e.headers.get("accept")||"";return e.method==="GET"&&t.includes("text/html")}function aR(e,t){let n=new URL(e.url),o=Ma(t),r=Fv(o);return Response.json({status:"ok",message:r.protected?"This Worker exposes a protected MCP endpoint. Use the /mcp path with an MCP client plus an MCPCloud runtime access token, and /health for liveness checks.":"This Worker exposes an MCP endpoint. Use the /mcp path with an MCP client, and /health for liveness checks.",accessMode:o,authentication:{required:r.protected,scheme:r.protected?"Bearer runtime token":null,summary:r.summary},runtime:Wv,endpoints:{health:`${n.origin}/health`,mcp:`${n.origin}/mcp`}},{status:200})}var Vw=60000;function Jw(e){let t={ttlMs:Vw,cacheScope:e==="public"?"public":"private"};return{"tools/list":t,"prompts/list":t,"resources/list":t,"resources/templates/list":t,"resources/read":t,"server/discover":t}}function m_(e,t){return{era:e.era,inputRequired:Ev,clientCapabilities:()=>t.server.getClientCapabilities()}}function Bw(e){return Response.json({jsonrpc:"2.0",id:null,error:{code:-32000,message:e==="GET"?"This MCP endpoint is stateless and offers no server-initiated stream. Send JSON-RPC requests with POST.":"This MCP endpoint is stateless and issues no session to terminate."}},{status:405,headers:{Allow:"POST"}})}function Hw(e,t,n,o){for(let{definition:r,handler:i}of t)e.registerTool(r.name,{title:Hv(r.name,r.title),description:Bv(r.name,r.description),inputSchema:iR(r.name,r.inputSchema),...r.annotations?{annotations:r.annotations}:{}},async(a)=>fa(()=>i(a,n,o),m_(o,e)))}function sR(e,t,n,o,r){let i=nR(t,n,o,r);e.registerTool(l_,{title:"Run code against these tools",description:u_(r.mode??"opt-in"),inputSchema:f({code:l().describe("JavaScript to run, evaluated as a script. Use `await tool(name, args)`. "+"The answer is the value of the last expression — a top-level `return` "+"will not parse. Usual shape: `(async () => { ... })()`.")}),annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!0}},async(a)=>fa(()=>i(a),m_(o,e)))}function Yw(e,t,n,o){let r=t.map(({definition:s})=>({name:s.name,title:s.title,description:s.description,tags:s.semanticTags})),i=Object.fromEntries(t.map(({definition:s,handler:c})=>[s.name,(u)=>c(u,n,o)])),a=Object.fromEntries(t.map(({definition:s})=>[s.name,s]));e.registerTool("searchTools",{title:"Search tools",description:"Find tools on this server by keyword or /regex/. Returns matching tool names and summaries WITHOUT their full input schemas, to save tokens. Call getToolDefinition for a tool's input schema, then useTool to run it.",inputSchema:f({query:l(),limit:x().int().optional()})},async(s)=>{let c=s,u=Gv(r,c.query??"",typeof c.limit==="number"?c.limit:10);return{content:[{type:"text",text:JSON.stringify(u,null,2)}]}}),e.registerTool("getToolDefinition",{title:"Get tool definition",description:"Fetch the full definition (input schema, description) for one tool by exact name. Discover names with searchTools first.",inputSchema:f({name:l()})},async(s)=>{let c=s,u=c.name?a[c.name]:void 0;if(!u)return{isError:!0,content:[{type:"text",text:`Unknown tool '${c.name??""}'. Use searchTools to list available tools.`}]};return{content:[{type:"text",text:JSON.stringify({name:u.name,title:u.title,description:u.description,inputSchema:u.inputSchema,outputSchema:u.outputSchema},null,2)}]}}),e.registerTool("useTool",{title:"Use tool",description:"Execute a tool by exact name with its arguments. Get the argument shape from getToolDefinition first.",inputSchema:f({name:l(),arguments:f({}).passthrough().optional()})},async(s)=>{let c=s,u=c.name?i[c.name]:void 0;if(!u){let d=`Unknown tool '${c.name??""}'. Use searchTools to list available tools.`;return{isError:!0,content:[{type:"text",text:d}],_meta:{error:d,errorClass:"BINDING_MISUSE",retryable:!1}}}return fa(()=>u(c.arguments??{}),m_(o,e))})}function Gw(e,t){return e.replace(/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/g,(n,o)=>{let r=t[o];return r==null?"":String(r)})}function Ww(e,t){let n=e.registerPrompt.bind(e);for(let o of t){let r={};for(let i of o.arguments)r[i.name]=i.required===!1?l().optional():l();n(o.name,{title:o.name,description:o.description??void 0,argsSchema:r},(i)=>({messages:[{role:"user",content:{type:"text",text:Gw(o.template,i??{})}}]}))}}async function Xw(e,t,n){if(e.resourceType==="static")return e.staticContent??"";let o=t.upstreamBaseUrl;if(!o)return`Dynamic resource "${e.uri}" has no upstream base URL configured.`;let r=e.upstreamPathTemplate??"",i=`${o.replace(/\/+$/,"")}/${r.replace(/^\/+/,"")}`,a=await ma(t,e.uri,[],n);return await(await fetch(i,{method:"GET",headers:a})).text()}function Qw(e,t,n,o){let r=e.registerResource.bind(e);for(let i of t)r(i.name,i.uri,{title:i.name,description:i.description??void 0,mimeType:i.mimeType},async()=>({contents:[{uri:i.uri,mimeType:i.mimeType,text:await Xw(i,n,o)}]}))}function eI(e){function t(a,s){let c=new po({name:a.serverName,version:a.serverVersion},{cacheHints:Jw(a.accessMode)});s.clientInfo=()=>c.server.getClientVersion();let u=tR(e.codeMode),d=c_(u)?u:null;if(d?.mode==="default")sR(c,e.tools,a,s,d);if(e.discoveryMode==="wrapper")Yw(c,e.tools,a,s);else Hw(c,e.tools,a,s);if(d&&d.mode!=="default")sR(c,e.tools,a,s,d);if(e.prompts&&e.prompts.length>0)Ww(c,e.prompts);if(e.resources&&e.resources.length>0)Qw(c,e.resources,a,s);return c}function n(a){return t(Ua(e.identity,a),{userId:null,runtimeToken:null})}function o(a,s){if(!s?.applied||s.preBytes<=0)return a;let c=new Headers(a.headers);return c.set("x-mcpcloud-projection-pre-bytes",String(s.preBytes)),c.set("x-mcpcloud-projection-post-bytes",String(s.postBytes)),new Response(a.body,{status:a.status,statusText:a.statusText,headers:c})}async function r(a,s,c){if(await a$(a)){let d=t(s,{...c,era:"legacy"}),m=new Eu({sessionIdGenerator:void 0,enableJsonResponse:!0});return await d.connect(m),await m.handleRequest(a)}return await s$((d)=>t(s,{...c,era:d.era}),{legacy:"reject",responseMode:"json"}).fetch(a)}async function i(a,s){let{pathname:c}=new URL(a.url);if(c==="/health")return Response.json({status:"ok",runtime:Wv});if(c==="/")return aR(a,s);if(c!=="/mcp")return new Response("Not found",{status:404});if(Fw(a))return aR(a,s);let u=Ua(e.identity,s),d=await Vv(a,u);if(d.response)return d.response;if(a.method==="GET"||a.method==="DELETE")return Bw(a.method);let m={userId:d.callerUserId,runtimeToken:d.rawToken,clientName:d.callerClientName??null,projectionUsage:{preBytes:0,postBytes:0,applied:!1}},p=await r(a,u,m);return o(p,m.projectionUsage)}return{createServer:n,handleRequest:i,options:e}}function tI(e){return{async fetch(t,n){return await e.handleRequest(t,n)}}}export{l_ as CODE_MODE_TOOL_NAME,W$ as DEFAULT_SANDBOX_LIMITS,D as McpError,po as McpServer,D as ProtocolError,an as ToolInputError,pa as UpstreamHttpError,Eu as WebStandardStreamableHTTPServerTransport,Z$ as applyResponseProjection,mw as applyResponseProjectionMeasured,ow as assertValidInput,Vv as authorizeRuntimeRequest,rR as buildFailureDigest,ma as buildUpstreamHeaders,DE as buildUpstreamRequest,Lv as classifyToolError,hw as clearMetadataOverrides,u_ as codeModeDescription,eI as defineServer,e_ as describeDistribution,y$ as describeRefusedMemberCredential,Fv as describeRuntimeAccess,s_ as effectClassFromAnnotations,_$ as encodeFormUrlencodedBody,VE as formatToolResultText,gw as getMetadataOverrides,Uu as getProcessEnv,d$ as hasOauthSecurity,T$ as isProtectedRuntimeAccessMode,p$ as isRetryableUpstreamStatus,K$ as jsonSchemaToZodObject,ga as jsonSchemaToZodSchema,Zv as mapUpstreamError,FE as normalizeUpstreamPayload,ZE as parseUpstreamResponse,qu as postOAuthRuntimeRequest,Bv as resolveDescription,Ma as resolveRuntimeAccessMode,Ua as resolveRuntimeConfig,Hv as resolveTitle,m$ as resolveUseOAuth,i_ as runInSandbox,fa as runToolHandler,Gv as searchCatalog,fw as setMetadataOverride,c_ as shouldRegisterCodeMode,va as summarizeShape,f$ as toToolErrorResult,tI as toWorkerHandler,Ti as z};
106
+ };`;function Zw(e){let t=e?.__mcpcloudError;if(typeof t==="string")return t.length>_a?`${t.slice(0,_a)}…`:t;if(typeof e==="string")return e.length>_a?`${e.slice(0,_a)}… (+${e.length-_a} chars)`:e;if(e===null||typeof e==="number"||typeof e==="boolean")return String(e);return va(e)}function oR(e){let t=[],n=e.newFunction(n_,(r,i)=>{if(t.length>=qw)return;let a=e.getString(r),s;try{s=JSON.parse(e.getString(i))}catch{return}t.push({level:nR.includes(a)?a:"log",message:s.map(Zw).join(" ")})});e.setProp(e.global,n_,n),n.dispose();let o=e.evalCode(Dw,"mcpcloud:console");if(o.error){let r=e.dump(o.error);throw o.error.dispose(),Error(`Failed to install the guest console: ${String(r)}`)}return o.value.dispose(),{entries:t}}var aR={opcodeBudget:2000000,memoryBytes:67108864,stackBytes:1048576,wallClockMs:30000,maxToolCalls:200},o_="__mcpcloud_sandbox__",sR="code";function cR(e){if(!e)return null;let t=e.match(new RegExp(`\\(${sR}:(\\d+):(\\d+)\\)`));if(!t)return null;return{line:Number(t[1]),column:Number(t[2])}}function iR(e){let t=e instanceof Error?e.message:String(e);return/maximum call stack size exceeded|stack overflow/i.test(t)}function Fw(e){return/^SyntaxError\b/.test(e)}function Nu(e){if(typeof e==="string")return{message:e};if(e&&typeof e==="object"){let t=e,n=typeof t.name==="string"?t.name:"Error",o=typeof t.message==="string"?t.message:String(e),r=typeof t.stack==="string"?t.stack.split(`
107
+ `).filter((i)=>i.trim()&&i.includes(o_)).map((i)=>i.replace(o_,sR)).join(`
108
+ `).trim():void 0;return{message:`${n}: ${o}`,...r?{stack:r}:{}}}return{message:String(e)}}function ju(e){if(e.alive)e.dispose()}function Kw(e,t){if(e.typeof(t)!=="object")return!1;let n=e.getProp(t,"then"),o=e.typeof(n)==="function";return n.dispose(),o}function Jw(e,t){e.setMemoryLimit(t.memoryBytes),e.setMaxStackSize(t.stackBytes);let n=0,o=null,r=Date.now()+t.wallClockMs;return e.setInterruptHandler(()=>{if(n+=1,n>t.opcodeBudget)return o="opcodes",!0;if(Date.now()>r)return o="wall_clock",!0;return!1}),e.setModuleLoader(()=>{throw Error("Module imports are not available in this sandbox.")}),{readTicks:()=>n,readReason:()=>o}}async function i_(e,t){let n={...aR,...e.limits},o=e.engine.newRuntime(),{readTicks:r,readReason:i}=Jw(o,n),a=o.newContext(),s=!1,{entries:c}=oR(a),u=[],d=()=>!1,m=()=>!1;if(e.bindings){let h=rR(o,a,e.bindings,n.maxToolCalls);u=h.spans,d=h.exceededCap,m=h.deniedByPolicy}let p=(h,b,R={})=>({ok:!1,kind:h,message:b,opcodesUsed:r(),spans:u,logs:c,...R});try{let h=a.evalCode(t,o_);if(h.error){let N=a.dump(h.error);if(ju(h.error),m())return p("policy_denied",Nu(N).message);if(d())return p("budget_exhausted",`Execution exceeded its budget of ${n.maxToolCalls} tool calls. Filter before the loop, or page the input.`,{budget:"tool_calls"});let B=i();if(B==="opcodes")return p("budget_exhausted",`Execution exceeded its compute budget of ${n.opcodeBudget.toLocaleString()} opcodes.`,{budget:"opcodes"});if(B==="wall_clock")return p("timeout",`Execution exceeded its ${n.wallClockMs} ms deadline.`,{budget:"wall_clock"});let P=Nu(N);if(/out of memory/i.test(P.message))return p("budget_exhausted",P.message,{budget:"memory"});if(iR(P.message))return p("budget_exhausted",P.message,{budget:"stack"});return p(Fw(P.message)?"syntax_error":"runtime_error",P.message,P.stack?{stack:P.stack}:{})}if(!Kw(a,h.value)){let N=a.dump(h.value);return ju(h.value),{ok:!0,value:N,opcodesUsed:r(),spans:u,logs:c}}let b=a.resolvePromise(h.value);ju(h.value),o.executePendingJobs();let R=await b;if(R.error){let N=a.dump(R.error);if(R.error.dispose(),m())return p("policy_denied",Nu(N).message);if(d())return p("budget_exhausted",`Execution exceeded its budget of ${n.maxToolCalls} tool calls. Filter before the loop, or page the input.`,{budget:"tool_calls"});let B=Nu(N);return p("runtime_error",B.message,B.stack?{stack:B.stack}:{})}let z=a.dump(R.value);return ju(R.value),{ok:!0,value:z,opcodesUsed:r(),spans:u,logs:c}}catch(h){if(iR(h))return s=!0,p("budget_exhausted","Execution exceeded the available call stack. Rewrite deep recursion as iteration.",{budget:"stack"});throw h}finally{if(!s)a.dispose(),o.dispose()}}function c_(e){if(!e?.engine)return!1;return(e.mode??"opt-in")!=="off"}var Vw=Symbol.for("@mcpcloud/runtime.codeModeEngineProvider");function Bw(){return globalThis[Vw]??null}function uR(e){let t=Bw();if(!e||e.engine||!t)return e;return{...e,engine:t}}function s_(e){if(!e)return null;if(e.readOnlyHint===!0)return"read";if(e.destructiveHint===!0)return"delete";if(e.readOnlyHint===!1)return"write";return null}function Hw(e,t){let n=e.content?.[0],o=n&&n.type==="text"&&typeof n.text==="string"?n.text:null;if(e.isError)throw Error(o??`Tool "${t}" failed.`);if(o===null)return null;try{return JSON.parse(o)}catch{return o}}function Yw(e,t){let{suggestion:n,nearest:o}=j$(e,t,5),r=[`Unknown tool "${e}".`];if(n)r.push(`Did you mean "${n}"?`);let i=n?o.filter((a)=>a!==n):o;if(i.length)r.push(`Nearest: ${i.join(", ")}`);return r.join(" ")}var a_=12,Gw=8;function Ww(e,t){if(!e)return[];let n=e.split(`
109
+ `);if(t<1||t>n.length)return[];let o=Math.max(1,t-1),r=Math.min(n.length,t+1),i=String(r).length;return Array.from({length:r-o+1},(a,s)=>{let c=o+s,u=c===t?">":" ",d=n[c-1],m=d.length>100?`${d.slice(0,100)}…`:d;return` ${u} ${String(c).padStart(i)} | ${m}`})}function dR(e,t){if(e.ok)return"";let n=[`ExecutionError: ${e.kind}`,` ${e.message}`];if(e.budget)n.push(` budget: ${e.budget}`);let o=e.spans;if(o.length){let r=o.filter((c)=>c.error),i=r.length===1&&r[0].error===e.message;n.push(` tool calls (${o.length}):`);let a=o.length<=a_?o:[...o.slice(0,a_-4),null,...o.slice(-3)];for(let c of a){if(c===null){n.push(` … ${o.length-a_+1} more`);continue}let u=c.error?i?"ERROR (message above)":`ERROR ${c.error}`:c.resultShape??"ok",d=c.mutates&&!c.error?" ⚠ COMMITTED":"";n.push(` ${c.name}(${JSON.stringify(c.args)}) ${c.durationMs}ms → ${u}${d}`)}let s=o.find((c)=>c.facts?.length)?.facts?.[0];if(s)n.push(` shape: ${s}`)}if(e.logs.length){let r=e.logs.slice(-Gw),i=e.logs.length-r.length;if(n.push(` console (${e.logs.length}):`),i>0)n.push(` … ${i} earlier`);for(let a of r)n.push(` ${a.level}: ${a.message}`)}if(e.stack){let r=e.stack.split(`
110
+ `)[0].trim();n.push(` at: ${r}`);let i=cR(e.stack);if(i)n.push(...Ww(t,i.line))}return n.join(`
111
+ `)}function mR(e,t,n,o){let r=new Map(e.map((i)=>[i.definition.name,i]));return async(i)=>{let a=i?.code;if(typeof a!=="string"||!a.trim())return{isError:!0,content:[{type:"text",text:"Provide JavaScript to run in `code`."}]};let s=await o.engine(),c=await i_({engine:s,limits:o.limits,bindings:{allowedEffects:o.allowedEffects,isKnownTool:(u)=>r.has(u),describeUnknownTool:(u)=>Yw(u,[...r.keys()]),effectClassFor:(u)=>s_(r.get(u)?.definition.annotations),isMutation:(u)=>s_(r.get(u)?.definition.annotations)!=="read",callTool:async({name:u,args:d})=>{let m=r.get(u);if(!m)throw Error(`Unknown tool "${u}".`);return Hw(await m.handler(d,t,n),u)}}},a);if(c.ok)return{content:[{type:"text",text:JSON.stringify(c.value??null,null,2)}],_meta:{opcodesUsed:c.opcodesUsed,toolCalls:c.spans.length}};return{isError:!0,content:[{type:"text",text:dR(c)}],_meta:{error:c.message,errorClass:c.kind,...c.budget?{budget:c.budget}:{},opcodesUsed:c.opcodesUsed,toolCalls:c.spans.length}}}}var l_="codemode_execute",lR='Run JavaScript against this server\'s tools and get back only the final result. Call tools with `await tool("toolName", { ...args })`. Loops, filtering and Promise.all all work, and intermediate results never enter your context. Your code is evaluated as a script, not as a function body: the answer is the value of the last expression, so a top-level `return` is a syntax error. The usual shape is `(async () => { const r = await tool("toolName", {}); return r })()`. Read and write tools are available; destructive ones must be called directly.';function u_(e){return e==="default"?`${lR} Prefer this over calling many tools one at a time.`:`${lR} Useful when a task chains several tools together.`}var Xw={type:"object",properties:{}},Qw=new Set(["x-location"]),eI=new Set(["description","title","format","examples","deprecated","readOnly","writeOnly"]);function pR(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function d_(e){if(Array.isArray(e))return Object.freeze(e.map(d_));if(!pR(e))return e;let t={};for(let[n,o]of Object.entries(e)){if(Qw.has(n))continue;if(o===null&&eI.has(n))continue;t[n]=d_(o)}return Object.freeze(t)}function fR(e,t){let n=pR(t)?d_(t):Object.freeze({...Xw});return{"~standard":{version:1,vendor:"mcpcloud",validate:(o)=>{let r=M$(n,o);if(r.length===0)return{value:o};return{issues:[{message:new an(e,r).message}]}},jsonSchema:{input:()=>n,output:()=>n}}}}function tI(e){let t=e.headers.get("accept")||"";return e.method==="GET"&&t.includes("text/html")}function hR(e,t){let n=new URL(e.url),o=Ma(t),r=Kv(o);return Response.json({status:"ok",message:r.protected?"This Worker exposes a protected MCP endpoint. Use the /mcp path with an MCP client plus an MCPCloud runtime access token, and /health for liveness checks.":"This Worker exposes an MCP endpoint. Use the /mcp path with an MCP client, and /health for liveness checks.",accessMode:o,authentication:{required:r.protected,scheme:r.protected?"Bearer runtime token":null,summary:r.summary},runtime:Wv,endpoints:{health:`${n.origin}/health`,mcp:`${n.origin}/mcp`}},{status:200})}var rI=60000;function nI(e){let t={ttlMs:rI,cacheScope:e==="public"?"public":"private"};return{"tools/list":t,"prompts/list":t,"resources/list":t,"resources/templates/list":t,"resources/read":t,"server/discover":t}}function m_(e,t){return{era:e.era,inputRequired:Ev,clientCapabilities:()=>t.server.getClientCapabilities()}}function oI(e){return Response.json({jsonrpc:"2.0",id:null,error:{code:-32000,message:e==="GET"?"This MCP endpoint is stateless and offers no server-initiated stream. Send JSON-RPC requests with POST.":"This MCP endpoint is stateless and issues no session to terminate."}},{status:405,headers:{Allow:"POST"}})}function iI(e,t,n,o){for(let{definition:r,handler:i}of t)e.registerTool(r.name,{title:Hv(r.name,r.title),description:Bv(r.name,r.description),inputSchema:fR(r.name,r.inputSchema),...r.annotations?{annotations:r.annotations}:{}},async(a)=>fa(()=>i(a,n,o),m_(o,e)))}function gR(e,t,n,o,r){let i=mR(t,n,o,r);e.registerTool(l_,{title:"Run code against these tools",description:u_(r.mode??"opt-in"),inputSchema:f({code:l().describe("JavaScript to run, evaluated as a script. Use `await tool(name, args)`. "+"The answer is the value of the last expression — a top-level `return` "+"will not parse. Usual shape: `(async () => { ... })()`.")}),annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!0}},async(a)=>fa(()=>i(a),m_(o,e)))}function aI(e,t,n,o){let r=t.map(({definition:s})=>({name:s.name,title:s.title,description:s.description,tags:s.semanticTags})),i=Object.fromEntries(t.map(({definition:s,handler:c})=>[s.name,(u)=>c(u,n,o)])),a=Object.fromEntries(t.map(({definition:s})=>[s.name,s]));e.registerTool("searchTools",{title:"Search tools",description:"Find tools on this server by keyword or /regex/. Returns matching tool names and summaries WITHOUT their full input schemas, to save tokens. Call getToolDefinition for a tool's input schema, then useTool to run it.",inputSchema:f({query:l(),limit:x().int().optional()})},async(s)=>{let c=s,u=Gv(r,c.query??"",typeof c.limit==="number"?c.limit:10);return{content:[{type:"text",text:JSON.stringify(u,null,2)}]}}),e.registerTool("getToolDefinition",{title:"Get tool definition",description:"Fetch the full definition (input schema, description) for one tool by exact name. Discover names with searchTools first.",inputSchema:f({name:l()})},async(s)=>{let c=s,u=c.name?a[c.name]:void 0;if(!u)return{isError:!0,content:[{type:"text",text:`Unknown tool '${c.name??""}'. Use searchTools to list available tools.`}]};return{content:[{type:"text",text:JSON.stringify({name:u.name,title:u.title,description:u.description,inputSchema:u.inputSchema,outputSchema:u.outputSchema},null,2)}]}}),e.registerTool("useTool",{title:"Use tool",description:"Execute a tool by exact name with its arguments. Get the argument shape from getToolDefinition first.",inputSchema:f({name:l(),arguments:f({}).passthrough().optional()})},async(s)=>{let c=s,u=c.name?i[c.name]:void 0;if(!u){let d=`Unknown tool '${c.name??""}'. Use searchTools to list available tools.`;return{isError:!0,content:[{type:"text",text:d}],_meta:{error:d,errorClass:"BINDING_MISUSE",retryable:!1}}}return fa(()=>u(c.arguments??{}),m_(o,e))})}function sI(e,t){return e.replace(/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/g,(n,o)=>{let r=t[o];return r==null?"":String(r)})}function cI(e,t){let n=e.registerPrompt.bind(e);for(let o of t){let r={};for(let i of o.arguments)r[i.name]=i.required===!1?l().optional():l();n(o.name,{title:o.name,description:o.description??void 0,argsSchema:r},(i)=>({messages:[{role:"user",content:{type:"text",text:sI(o.template,i??{})}}]}))}}async function lI(e,t,n){if(e.resourceType==="static")return e.staticContent??"";let o=t.upstreamBaseUrl;if(!o)return`Dynamic resource "${e.uri}" has no upstream base URL configured.`;let r=e.upstreamPathTemplate??"",i=`${o.replace(/\/+$/,"")}/${r.replace(/^\/+/,"")}`,a=await ma(t,e.uri,[],n);return await(await fetch(i,{method:"GET",headers:a})).text()}function uI(e,t,n,o){let r=e.registerResource.bind(e);for(let i of t)r(i.name,i.uri,{title:i.name,description:i.description??void 0,mimeType:i.mimeType},async()=>({contents:[{uri:i.uri,mimeType:i.mimeType,text:await lI(i,n,o)}]}))}function dI(e){function t(c,u){let d=new po({name:c.serverName,version:c.serverVersion},{cacheHints:nI(c.accessMode)});u.clientInfo=()=>d.server.getClientVersion();let m=uR(e.codeMode),p=c_(m)?m:null;if(p?.mode==="default")gR(d,e.tools,c,u,p);if(e.discoveryMode==="wrapper")aI(d,e.tools,c,u);else iI(d,e.tools,c,u);if(p&&p.mode!=="default")gR(d,e.tools,c,u,p);if(e.prompts&&e.prompts.length>0)cI(d,e.prompts);if(e.resources&&e.resources.length>0)uI(d,e.resources,c,u);return d}function n(c){return t(Ua(e.identity,c),{userId:null,runtimeToken:null})}function o(c,u){if(!u?.applied||u.preBytes<=0)return c;let d=new Headers(c.headers);return d.set("x-mcpcloud-projection-pre-bytes",String(u.preBytes)),d.set("x-mcpcloud-projection-post-bytes",String(u.postBytes)),new Response(c.body,{status:c.status,statusText:c.statusText,headers:d})}async function r(c,u,d){if(await a$(c)){let p=t(u,{...d,era:"legacy"}),h=new Eu({sessionIdGenerator:void 0,enableJsonResponse:!0});return await p.connect(h),await h.handleRequest(c)}return await s$((p)=>t(u,{...d,era:p.era}),{legacy:"reject",responseMode:"json"}).fetch(c)}let i=null;function a(){return i??=G$({discoveryMode:e.discoveryMode??"all",codeMode:e.codeMode?.mode??null,tools:e.tools.map((c)=>c.definition),prompts:e.prompts??[],resources:e.resources??[]}),i}async function s(c,u){let{pathname:d}=new URL(c.url);if(d==="/health")return Response.json({status:"ok",runtime:Wv});if(d==="/")return hR(c,u);if(d!=="/mcp")return new Response("Not found",{status:404});if(tI(c))return hR(c,u);let m=Ua(e.identity,u),p=await Jv(c,m);if(p.response)return p.response;let h=m.catalogSessions?a():null,b=h!==null&&await X$(c);if(h&&!b&&W$(c,h))return Q$();if(c.method==="GET"||c.method==="DELETE")return oI(c.method);let R={userId:p.callerUserId,runtimeToken:p.rawToken,clientName:p.callerClientName??null,projectionUsage:{preBytes:0,postBytes:0,applied:!1}},z=await r(c,m,R),N=o(z,R.projectionUsage);return b?eR(N,h):N}return{createServer:n,handleRequest:s,options:e}}function mI(e){return{async fetch(t,n){return await e.handleRequest(t,n)}}}export{l_ as CODE_MODE_TOOL_NAME,aR as DEFAULT_SANDBOX_LIMITS,D as McpError,po as McpServer,D as ProtocolError,an as ToolInputError,pa as UpstreamHttpError,Eu as WebStandardStreamableHTTPServerTransport,V$ as applyResponseProjection,$w as applyResponseProjectionMeasured,fw as assertValidInput,Jv as authorizeRuntimeRequest,dR as buildFailureDigest,ma as buildUpstreamHeaders,WE as buildUpstreamRequest,Lv as classifyToolError,Tw as clearMetadataOverrides,u_ as codeModeDescription,dI as defineServer,e_ as describeDistribution,z$ as describeRefusedMemberCredential,Kv as describeRuntimeAccess,s_ as effectClassFromAnnotations,$$ as encodeFormUrlencodedBody,tw as formatToolResultText,xw as getMetadataOverrides,Uu as getProcessEnv,d$ as hasOauthSecurity,w$ as isProtectedRuntimeAccessMode,p$ as isRetryableUpstreamStatus,B$ as jsonSchemaToZodObject,ga as jsonSchemaToZodSchema,Zv as mapUpstreamError,ew as normalizeUpstreamPayload,XE as parseUpstreamResponse,qu as postOAuthRuntimeRequest,Bv as resolveDescription,Ma as resolveRuntimeAccessMode,Ua as resolveRuntimeConfig,Hv as resolveTitle,m$ as resolveUseOAuth,i_ as runInSandbox,fa as runToolHandler,Gv as searchCatalog,zw as setMetadataOverride,c_ as shouldRegisterCodeMode,va as summarizeShape,f$ as toToolErrorResult,mI as toWorkerHandler,Ti as z};