@reqvire-org/ads 0.3.37 → 0.3.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +3 -1
  2. package/dist/bootstrap-ds/README.md +2 -2
  3. package/dist/bootstrap-ds/package.json +1 -1
  4. package/dist/cli.mjs +9 -1
  5. package/dist/config.mjs +4 -2
  6. package/dist/mcp/preview-owner-guard.mjs +7 -4
  7. package/dist/mcp/preview-widget.bundle.js +46 -47
  8. package/dist/mcp/project-widget.bundle.js +45 -46
  9. package/dist/mcp/server.mjs +5 -0
  10. package/dist/mcp/widget.bundle.js +47 -48
  11. package/dist/preview-bun.mjs +5 -2
  12. package/dist/resource-limits.mjs +146 -0
  13. package/dist/runtime-requirements.mjs +21 -0
  14. package/dist/scenarios-compiler.mjs +4 -3
  15. package/dist/showcase/client.bundle.js +56 -57
  16. package/dist/showcase/sandbox.bundle.js +1 -1
  17. package/dist/skills/ads-break-ui/SKILL.md +3 -2
  18. package/dist/skills/ads-break-ui/references/runtimes.md +85 -1
  19. package/dist/skills/ads-designer/SKILL.md +3 -2
  20. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +2 -2
  21. package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +1 -1
  22. package/dist/skills/ads-designer/references/cli.md +2 -2
  23. package/dist/skills/ads-designer/references/runtimes.md +85 -1
  24. package/dist/skills/ads-import/SKILL.md +3 -2
  25. package/dist/skills/ads-import/references/cli.md +2 -2
  26. package/dist/skills/ads-import/references/runtimes.md +85 -1
  27. package/dist/skills/ads-motion/SKILL.md +3 -2
  28. package/dist/skills/ads-motion/references/runtimes.md +85 -1
  29. package/dist/skills/ads-port/SKILL.md +3 -2
  30. package/dist/skills/ads-port/references/cli.md +2 -2
  31. package/dist/skills/ads-port/references/runtimes.md +85 -1
  32. package/dist/verification/browser.mjs +8 -8
  33. package/docs/CHANGELOG.md +33 -13
  34. package/docs/GUIDE.md +1 -1
  35. package/docs/MCP.md +22 -2
  36. package/package.json +2 -2
@@ -1,78 +1,77 @@
1
- var FD=Object.defineProperty;var qD=(Q)=>Q;function OD(Q,H){this[Q]=qD.bind(null,H)}var tQ=(Q,H)=>{for(var W in H)FD(Q,W,{get:H[W],enumerable:!0,configurable:!0,set:OD.bind(H,W)})};var{create:_D,defineProperty:P6,getOwnPropertyDescriptor:UD,getOwnPropertyNames:zD,getPrototypeOf:bD}=Object,PD=Object.prototype.hasOwnProperty,G5=(Q,H)=>()=>(H||Q((H={exports:{}}).exports,H),H.exports),N5=(Q,H)=>{let W={};for(var Y in Q)P6(W,Y,{get:Q[Y],enumerable:!0});if(H)P6(W,Symbol.toStringTag,{value:"Module"});return W},ZD=(Q,H,W,Y)=>{if(H&&typeof H==="object"||typeof H==="function"){for(var J=zD(H),G=0,N=J.length,X;G<N;G++)if(X=J[G],!PD.call(Q,X)&&X!==W)P6(Q,X,{get:((D)=>H[D]).bind(null,X),enumerable:!(Y=UD(H,X))||Y.enumerable})}return Q},B5=(Q,H,W)=>(W=Q!=null?_D(bD(Q)):{},ZD(H||!Q||!Q.__esModule?P6(W,"default",{value:Q,enumerable:!0}):W,Q));var $D=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function X5(Q){return typeof Q==="string"&&$D.has(Q.replace(/#$/,""))}var K={};tQ(K,{xor:()=>CB,xid:()=>YB,void:()=>LB,uuidv7:()=>t5,uuidv6:()=>r5,uuidv4:()=>n5,uuid:()=>o5,util:()=>k,url:()=>BW,uppercase:()=>i0,unknown:()=>L,union:()=>$,undefined:()=>IB,ulid:()=>WB,uint64:()=>ZB,uint32:()=>zB,tuple:()=>G7,trim:()=>a0,treeifyError:()=>t8,transform:()=>Q8,toUpperCase:()=>QW,toLowerCase:()=>e0,toJSONSchema:()=>H0,templateLiteral:()=>cB,symbol:()=>$B,superRefine:()=>C7,success:()=>fB,stringbool:()=>sB,stringFormat:()=>wB,string:()=>B,strictObject:()=>RB,startsWith:()=>n0,slugify:()=>HW,size:()=>aH,setErrorMap:()=>D2,set:()=>xB,safeParseAsync:()=>yN,safeParse:()=>H1,safeEncodeAsync:()=>pN,safeEncode:()=>mN,safeDecodeAsync:()=>dN,safeDecode:()=>cN,registry:()=>s6,regexes:()=>PQ,regex:()=>p0,refine:()=>R7,record:()=>b,readonly:()=>$7,property:()=>bY,promise:()=>pB,prettifyError:()=>s8,preprocess:()=>QH,prefault:()=>q7,positive:()=>OY,pipe:()=>SY,partialRecord:()=>SB,parseAsync:()=>vN,parse:()=>xN,overwrite:()=>CQ,optional:()=>T,object:()=>M,number:()=>U,nullish:()=>hB,nullable:()=>Y1,null:()=>lQ,normalize:()=>s0,nonpositive:()=>UY,nonoptional:()=>O7,nonnegative:()=>zY,never:()=>eY,negative:()=>_Y,nativeEnum:()=>vB,nanoid:()=>e5,nan:()=>uB,multipleOf:()=>OH,minSize:()=>fQ,minLength:()=>aQ,mime:()=>t0,meta:()=>rB,maxSize:()=>_H,maxLength:()=>eH,map:()=>gB,mac:()=>NB,lte:()=>ZQ,lt:()=>yQ,lowercase:()=>d0,looseRecord:()=>kB,looseObject:()=>R,locales:()=>s4,literal:()=>F,length:()=>Q0,lazy:()=>ZH,ksuid:()=>JB,keyof:()=>jB,jwt:()=>VB,json:()=>aB,iso:()=>$Q,ipv6:()=>BB,ipv4:()=>GB,invertCodec:()=>mB,intersection:()=>SQ,int64:()=>PB,int32:()=>UB,int:()=>CY,instanceof:()=>tB,includes:()=>o0,httpUrl:()=>s5,hostname:()=>AB,hex:()=>FB,hash:()=>qB,guid:()=>i5,gte:()=>AQ,gt:()=>hQ,globalRegistry:()=>YQ,getErrorMap:()=>K2,function:()=>dB,fromJSONSchema:()=>QX,formatError:()=>c4,float64:()=>_B,float32:()=>OB,flattenError:()=>m4,file:()=>yB,exactOptional:()=>M7,enum:()=>S,endsWith:()=>r0,encodeAsync:()=>uN,encode:()=>hN,emoji:()=>a5,email:()=>xY,e164:()=>MB,discriminatedUnion:()=>PH,describe:()=>nB,decodeAsync:()=>lN,decode:()=>fN,date:()=>TB,custom:()=>oB,cuid2:()=>HB,cuid:()=>QB,core:()=>eQ,config:()=>s,coerce:()=>M1,codec:()=>lB,clone:()=>VQ,cidrv6:()=>DB,cidrv4:()=>XB,check:()=>iB,catch:()=>z7,boolean:()=>P,bigint:()=>bB,base64url:()=>EB,base64:()=>KB,array:()=>A,any:()=>aY,_function:()=>dB,_default:()=>A7,_ZodString:()=>kY,ZodXor:()=>H7,ZodXID:()=>lY,ZodVoid:()=>eN,ZodUnknown:()=>sN,ZodUnion:()=>X1,ZodUndefined:()=>nN,ZodUUID:()=>uQ,ZodURL:()=>G1,ZodULID:()=>uY,ZodType:()=>x,ZodTuple:()=>J7,ZodTransform:()=>K7,ZodTemplateLiteral:()=>I7,ZodSymbol:()=>oN,ZodSuccess:()=>_7,ZodStringFormat:()=>c,ZodString:()=>NW,ZodSet:()=>B7,ZodRecord:()=>JW,ZodRealError:()=>UQ,ZodReadonly:()=>Z7,ZodPromise:()=>T7,ZodPreprocess:()=>P7,ZodPrefault:()=>F7,ZodPipe:()=>D1,ZodOptional:()=>H8,ZodObject:()=>B1,ZodNumberFormat:()=>W0,ZodNumber:()=>DW,ZodNullable:()=>V7,ZodNull:()=>rN,ZodNonOptional:()=>W8,ZodNever:()=>aN,ZodNanoID:()=>yY,ZodNaN:()=>b7,ZodMap:()=>N7,ZodMAC:()=>iN,ZodLiteral:()=>X7,ZodLazy:()=>L7,ZodKSUID:()=>mY,ZodJWT:()=>tY,ZodIssueCode:()=>k7,ZodIntersection:()=>Y7,ZodISOTime:()=>jY,ZodISODuration:()=>RY,ZodISODateTime:()=>LY,ZodISODate:()=>TY,ZodIPv6:()=>pY,ZodIPv4:()=>cY,ZodGUID:()=>W1,ZodFunction:()=>j7,ZodFirstPartyTypeKind:()=>S7,ZodFile:()=>D7,ZodExactOptional:()=>E7,ZodError:()=>B2,ZodEnum:()=>GW,ZodEmoji:()=>vY,ZodEmail:()=>gY,ZodE164:()=>rY,ZodDiscriminatedUnion:()=>W7,ZodDefault:()=>w7,ZodDate:()=>N1,ZodCustomStringFormat:()=>XW,ZodCustom:()=>E1,ZodCodec:()=>K1,ZodCatch:()=>U7,ZodCUID2:()=>fY,ZodCUID:()=>hY,ZodCIDRv6:()=>iY,ZodCIDRv4:()=>dY,ZodBoolean:()=>KW,ZodBigIntFormat:()=>sY,ZodBigInt:()=>EW,ZodBase64URL:()=>nY,ZodBase64:()=>oY,ZodArray:()=>Q7,ZodAny:()=>tN,TimePrecision:()=>KG,NEVER:()=>g4,$output:()=>JG,$input:()=>GG,$brand:()=>h8});var eQ={};tQ(eQ,{version:()=>o3,util:()=>k,treeifyError:()=>t8,toJSONSchema:()=>H0,toDotPath:()=>A5,safeParseAsync:()=>e8,safeParse:()=>a8,safeEncodeAsync:()=>JK,safeEncode:()=>WK,safeDecodeAsync:()=>GK,safeDecode:()=>YK,registry:()=>s6,regexes:()=>PQ,process:()=>l,prettifyError:()=>s8,parseAsync:()=>j6,parse:()=>T6,meta:()=>pG,locales:()=>s4,isValidJWT:()=>y5,isValidBase64URL:()=>v5,isValidBase64:()=>AJ,initializeContext:()=>UH,globalRegistry:()=>YQ,globalConfig:()=>oH,formatError:()=>c4,flattenError:()=>m4,finalize:()=>bH,extractDefs:()=>zH,encodeAsync:()=>QK,encode:()=>aD,describe:()=>cG,decodeAsync:()=>HK,decode:()=>eD,createToJSONSchemaMethod:()=>iG,createStandardJSONSchemaMethod:()=>YW,config:()=>s,clone:()=>VQ,_xor:()=>yK,_xid:()=>XY,_void:()=>gG,_uuidv7:()=>WY,_uuidv6:()=>HY,_uuidv4:()=>QY,_uuid:()=>e6,_url:()=>e4,_uppercase:()=>i0,_unknown:()=>SG,_union:()=>vK,_undefined:()=>jG,_ulid:()=>BY,_uint64:()=>LG,_uint32:()=>zG,_tuple:()=>uK,_trim:()=>a0,_transform:()=>oK,_toUpperCase:()=>QW,_toLowerCase:()=>e0,_templateLiteral:()=>W2,_symbol:()=>TG,_superRefine:()=>mG,_success:()=>aK,_stringbool:()=>dG,_stringFormat:()=>WW,_string:()=>BG,_startsWith:()=>n0,_slugify:()=>HW,_size:()=>aH,_set:()=>cK,_safeParseAsync:()=>m0,_safeParse:()=>l0,_safeEncodeAsync:()=>v6,_safeEncode:()=>g6,_safeDecodeAsync:()=>y6,_safeDecode:()=>x6,_regex:()=>p0,_refine:()=>lG,_record:()=>lK,_readonly:()=>H2,_property:()=>bY,_promise:()=>J2,_positive:()=>OY,_pipe:()=>Q2,_parseAsync:()=>u0,_parse:()=>f0,_overwrite:()=>CQ,_optional:()=>nK,_number:()=>AG,_nullable:()=>rK,_null:()=>RG,_normalize:()=>s0,_nonpositive:()=>UY,_nonoptional:()=>sK,_nonnegative:()=>zY,_never:()=>kG,_negative:()=>_Y,_nativeEnum:()=>dK,_nanoid:()=>JY,_nan:()=>yG,_multipleOf:()=>OH,_minSize:()=>fQ,_minLength:()=>aQ,_min:()=>AQ,_mime:()=>t0,_maxSize:()=>_H,_maxLength:()=>eH,_max:()=>ZQ,_map:()=>mK,_mac:()=>DG,_lte:()=>ZQ,_lt:()=>yQ,_lowercase:()=>d0,_literal:()=>iK,_length:()=>Q0,_lazy:()=>Y2,_ksuid:()=>DY,_jwt:()=>qY,_isoTime:()=>VG,_isoDuration:()=>wG,_isoDateTime:()=>EG,_isoDate:()=>MG,_ipv6:()=>EY,_ipv4:()=>KY,_intersection:()=>fK,_int64:()=>IG,_int32:()=>UG,_int:()=>qG,_includes:()=>o0,_guid:()=>a4,_gte:()=>AQ,_gt:()=>hQ,_float64:()=>_G,_float32:()=>OG,_file:()=>fG,_enum:()=>pK,_endsWith:()=>r0,_encodeAsync:()=>S6,_encode:()=>R6,_emoji:()=>YY,_email:()=>a6,_e164:()=>FY,_discriminatedUnion:()=>hK,_default:()=>tK,_decodeAsync:()=>k6,_decode:()=>C6,_date:()=>xG,_custom:()=>uG,_cuid2:()=>NY,_cuid:()=>GY,_coercedString:()=>XG,_coercedNumber:()=>FG,_coercedDate:()=>vG,_coercedBoolean:()=>PG,_coercedBigint:()=>$G,_cidrv6:()=>VY,_cidrv4:()=>MY,_check:()=>m5,_catch:()=>eK,_boolean:()=>bG,_bigint:()=>ZG,_base64url:()=>AY,_base64:()=>wY,_array:()=>hG,_any:()=>CG,TimePrecision:()=>KG,NEVER:()=>g4,JSONSchemaGenerator:()=>RN,JSONSchema:()=>c5,Doc:()=>l6,$output:()=>JG,$input:()=>GG,$constructor:()=>V,$brand:()=>h8,$ZodXor:()=>kJ,$ZodXID:()=>JJ,$ZodVoid:()=>jJ,$ZodUnknown:()=>LJ,$ZodUnion:()=>n4,$ZodUndefined:()=>ZJ,$ZodUUID:()=>t3,$ZodURL:()=>a3,$ZodULID:()=>YJ,$ZodType:()=>g,$ZodTuple:()=>n6,$ZodTransform:()=>mJ,$ZodTemplateLiteral:()=>eJ,$ZodSymbol:()=>PJ,$ZodSuccess:()=>nJ,$ZodStringFormat:()=>m,$ZodString:()=>sH,$ZodSet:()=>hJ,$ZodRegistry:()=>NG,$ZodRecord:()=>vJ,$ZodRealError:()=>_Q,$ZodReadonly:()=>aJ,$ZodPromise:()=>HG,$ZodPreprocess:()=>sJ,$ZodPrefault:()=>iJ,$ZodPipe:()=>t6,$ZodOptional:()=>r6,$ZodObjectJIT:()=>SJ,$ZodObject:()=>u5,$ZodNumberFormat:()=>zJ,$ZodNumber:()=>i6,$ZodNullable:()=>pJ,$ZodNull:()=>$J,$ZodNonOptional:()=>oJ,$ZodNever:()=>TJ,$ZodNanoID:()=>QJ,$ZodNaN:()=>tJ,$ZodMap:()=>yJ,$ZodMAC:()=>MJ,$ZodLiteral:()=>uJ,$ZodLazy:()=>WG,$ZodKSUID:()=>GJ,$ZodJWT:()=>_J,$ZodIntersection:()=>xJ,$ZodISOTime:()=>XJ,$ZodISODuration:()=>DJ,$ZodISODateTime:()=>NJ,$ZodISODate:()=>BJ,$ZodIPv6:()=>EJ,$ZodIPv4:()=>KJ,$ZodGUID:()=>r3,$ZodFunction:()=>QG,$ZodFile:()=>lJ,$ZodExactOptional:()=>cJ,$ZodError:()=>l4,$ZodEnum:()=>fJ,$ZodEncodeError:()=>nH,$ZodEmoji:()=>e3,$ZodEmail:()=>s3,$ZodE164:()=>OJ,$ZodDiscriminatedUnion:()=>gJ,$ZodDefault:()=>dJ,$ZodDate:()=>RJ,$ZodCustomStringFormat:()=>UJ,$ZodCustom:()=>YG,$ZodCodec:()=>r4,$ZodCheckUpperCase:()=>u3,$ZodCheckStringFormat:()=>c0,$ZodCheckStartsWith:()=>m3,$ZodCheckSizeEquals:()=>g3,$ZodCheckRegex:()=>h3,$ZodCheckProperty:()=>p3,$ZodCheckOverwrite:()=>i3,$ZodCheckNumberFormat:()=>R3,$ZodCheckMultipleOf:()=>j3,$ZodCheckMinSize:()=>k3,$ZodCheckMinLength:()=>v3,$ZodCheckMimeType:()=>d3,$ZodCheckMaxSize:()=>S3,$ZodCheckMaxLength:()=>x3,$ZodCheckLowerCase:()=>f3,$ZodCheckLessThan:()=>f6,$ZodCheckLengthEquals:()=>y3,$ZodCheckIncludes:()=>l3,$ZodCheckGreaterThan:()=>u6,$ZodCheckEndsWith:()=>c3,$ZodCheckBigIntFormat:()=>C3,$ZodCheck:()=>p,$ZodCatch:()=>rJ,$ZodCUID2:()=>WJ,$ZodCUID:()=>HJ,$ZodCIDRv6:()=>wJ,$ZodCIDRv4:()=>VJ,$ZodBoolean:()=>o4,$ZodBigIntFormat:()=>bJ,$ZodBigInt:()=>o6,$ZodBase64URL:()=>qJ,$ZodBase64:()=>FJ,$ZodAsyncError:()=>vQ,$ZodArray:()=>CJ,$ZodAny:()=>IJ});var D5,g4=Object.freeze({status:"aborted"});function V(Q,H,W){function Y(X,D){if(!X._zod)Object.defineProperty(X,"_zod",{value:{def:D,constr:N,traits:new Set},enumerable:!1});if(X._zod.traits.has(Q))return;X._zod.traits.add(Q),H(X,D);let E=N.prototype,w=Object.keys(E);for(let q=0;q<w.length;q++){let O=w[q];if(!(O in X))X[O]=E[O].bind(X)}}let J=W?.Parent??Object;class G extends J{}Object.defineProperty(G,"name",{value:Q});function N(X){var D;let E=W?.Parent?new G:this;Y(E,X),(D=E._zod).deferred??(D.deferred=[]);for(let w of E._zod.deferred)w();return E}return Object.defineProperty(N,"init",{value:Y}),Object.defineProperty(N,Symbol.hasInstance,{value:(X)=>{if(W?.Parent&&X instanceof W.Parent)return!0;return X?._zod?.traits?.has(Q)}}),Object.defineProperty(N,"name",{value:Q}),N}var h8=Symbol("zod_brand");class vQ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class nH extends Error{constructor(Q){super(`Encountered unidirectional transform during encode: ${Q}`);this.name="ZodEncodeError"}}(D5=globalThis).__zod_globalConfig??(D5.__zod_globalConfig={});var oH=globalThis.__zod_globalConfig;function s(Q){if(Q)Object.assign(oH,Q);return oH}var k={};tQ(k,{unwrapMessage:()=>x4,uint8ArrayToHex:()=>tD,uint8ArrayToBase64url:()=>nD,uint8ArrayToBase64:()=>M5,stringifyPrimitive:()=>L6,slugify:()=>l8,shallowClone:()=>c8,safeExtend:()=>mD,required:()=>dD,randomString:()=>xD,propertyKeyTypes:()=>h4,promiseAllObject:()=>gD,primitiveTypes:()=>p8,prefixIssues:()=>OQ,pick:()=>fD,partial:()=>pD,parsedType:()=>r8,optionalKeys:()=>d8,omit:()=>uD,objectClone:()=>CD,numKeys:()=>vD,nullish:()=>wH,normalizeParams:()=>z,mergeDefs:()=>sQ,merge:()=>cD,jsonStringifyReplacer:()=>v0,joinValues:()=>Z6,issue:()=>h0,isPlainObject:()=>FH,isObject:()=>rH,hexToUint8Array:()=>rD,getSizableOrigin:()=>f4,getParsedType:()=>yD,getLengthableOrigin:()=>u4,getEnumValues:()=>v4,getElementAtPath:()=>kD,floatSafeRemainder:()=>u8,finalizeIssue:()=>wQ,extend:()=>lD,explicitlyAborted:()=>n8,escapeRegex:()=>TQ,esc:()=>$6,defineLazy:()=>y,createTransparentProxy:()=>hD,cloneDef:()=>SD,clone:()=>VQ,cleanRegex:()=>y4,cleanEnum:()=>iD,captureStackTrace:()=>I6,cached:()=>y0,base64urlToUint8Array:()=>oD,base64ToUint8Array:()=>E5,assignProp:()=>AH,assertNotEqual:()=>LD,assertNever:()=>jD,assertIs:()=>TD,assertEqual:()=>ID,assert:()=>RD,allowsEval:()=>m8,aborted:()=>qH,NUMBER_FORMAT_RANGES:()=>i8,Class:()=>V5,BIGINT_FORMAT_RANGES:()=>o8});function ID(Q){return Q}function LD(Q){return Q}function TD(Q){}function jD(Q){throw Error("Unexpected value in exhaustive check")}function RD(Q){}function v4(Q){let H=Object.values(Q).filter((Y)=>typeof Y==="number");return Object.entries(Q).filter(([Y,J])=>H.indexOf(+Y)===-1).map(([Y,J])=>J)}function Z6(Q,H="|"){return Q.map((W)=>L6(W)).join(H)}function v0(Q,H){if(typeof H==="bigint")return H.toString();return H}function y0(Q){return{get value(){{let W=Q();return Object.defineProperty(this,"value",{value:W}),W}throw Error("cached value already set")}}}function wH(Q){return Q===null||Q===void 0}function y4(Q){let H=Q.startsWith("^")?1:0,W=Q.endsWith("$")?Q.length-1:Q.length;return Q.slice(H,W)}function u8(Q,H){let W=Q/H,Y=Math.round(W),J=Number.EPSILON*Math.max(Math.abs(W),1);if(Math.abs(W-Y)<J)return 0;return W-Y}var K5=Symbol("evaluating");function y(Q,H,W){let Y=void 0;Object.defineProperty(Q,H,{get(){if(Y===K5)return;if(Y===void 0)Y=K5,Y=W();return Y},set(J){Object.defineProperty(Q,H,{value:J})},configurable:!0})}function CD(Q){return Object.create(Object.getPrototypeOf(Q),Object.getOwnPropertyDescriptors(Q))}function AH(Q,H,W){Object.defineProperty(Q,H,{value:W,writable:!0,enumerable:!0,configurable:!0})}function sQ(...Q){let H={};for(let W of Q){let Y=Object.getOwnPropertyDescriptors(W);Object.assign(H,Y)}return Object.defineProperties({},H)}function SD(Q){return sQ(Q._zod.def)}function kD(Q,H){if(!H)return Q;return H.reduce((W,Y)=>W?.[Y],Q)}function gD(Q){let H=Object.keys(Q),W=H.map((Y)=>Q[Y]);return Promise.all(W).then((Y)=>{let J={};for(let G=0;G<H.length;G++)J[H[G]]=Y[G];return J})}function xD(Q=10){let W="";for(let Y=0;Y<Q;Y++)W+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return W}function $6(Q){return JSON.stringify(Q)}function l8(Q){return Q.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var I6="captureStackTrace"in Error?Error.captureStackTrace:(...Q)=>{};function rH(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}var m8=y0(()=>{if(oH.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(Q){return!1}});function FH(Q){if(rH(Q)===!1)return!1;let H=Q.constructor;if(H===void 0)return!0;if(typeof H!=="function")return!0;let W=H.prototype;if(rH(W)===!1)return!1;if(Object.prototype.hasOwnProperty.call(W,"isPrototypeOf")===!1)return!1;return!0}function c8(Q){if(FH(Q))return{...Q};if(Array.isArray(Q))return[...Q];if(Q instanceof Map)return new Map(Q);if(Q instanceof Set)return new Set(Q);return Q}function vD(Q){let H=0;for(let W in Q)if(Object.prototype.hasOwnProperty.call(Q,W))H++;return H}var yD=(Q)=>{let H=typeof Q;switch(H){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(Q)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(Q))return"array";if(Q===null)return"null";if(Q.then&&typeof Q.then==="function"&&Q.catch&&typeof Q.catch==="function")return"promise";if(typeof Map<"u"&&Q instanceof Map)return"map";if(typeof Set<"u"&&Q instanceof Set)return"set";if(typeof Date<"u"&&Q instanceof Date)return"date";if(typeof File<"u"&&Q instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${H}`)}},h4=new Set(["string","number","symbol"]),p8=new Set(["string","number","bigint","boolean","symbol","undefined"]);function TQ(Q){return Q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function VQ(Q,H,W){let Y=new Q._zod.constr(H??Q._zod.def);if(!H||W?.parent)Y._zod.parent=Q;return Y}function z(Q){let H=Q;if(!H)return{};if(typeof H==="string")return{error:()=>H};if(H?.message!==void 0){if(H?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");H.error=H.message}if(delete H.message,typeof H.error==="string")return{...H,error:()=>H.error};return H}function hD(Q){let H;return new Proxy({},{get(W,Y,J){return H??(H=Q()),Reflect.get(H,Y,J)},set(W,Y,J,G){return H??(H=Q()),Reflect.set(H,Y,J,G)},has(W,Y){return H??(H=Q()),Reflect.has(H,Y)},deleteProperty(W,Y){return H??(H=Q()),Reflect.deleteProperty(H,Y)},ownKeys(W){return H??(H=Q()),Reflect.ownKeys(H)},getOwnPropertyDescriptor(W,Y){return H??(H=Q()),Reflect.getOwnPropertyDescriptor(H,Y)},defineProperty(W,Y,J){return H??(H=Q()),Reflect.defineProperty(H,Y,J)}})}function L6(Q){if(typeof Q==="bigint")return Q.toString()+"n";if(typeof Q==="string")return`"${Q}"`;return`${Q}`}function d8(Q){return Object.keys(Q).filter((H)=>{return Q[H]._zod.optin==="optional"&&Q[H]._zod.optout==="optional"})}var i8={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]},o8={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function fD(Q,H){let W=Q._zod.def,Y=W.checks;if(Y&&Y.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let G=sQ(Q._zod.def,{get shape(){let N={};for(let X in H){if(!(X in W.shape))throw Error(`Unrecognized key: "${X}"`);if(!H[X])continue;N[X]=W.shape[X]}return AH(this,"shape",N),N},checks:[]});return VQ(Q,G)}function uD(Q,H){let W=Q._zod.def,Y=W.checks;if(Y&&Y.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let G=sQ(Q._zod.def,{get shape(){let N={...Q._zod.def.shape};for(let X in H){if(!(X in W.shape))throw Error(`Unrecognized key: "${X}"`);if(!H[X])continue;delete N[X]}return AH(this,"shape",N),N},checks:[]});return VQ(Q,G)}function lD(Q,H){if(!FH(H))throw Error("Invalid input to extend: expected a plain object");let W=Q._zod.def.checks;if(W&&W.length>0){let G=Q._zod.def.shape;for(let N in H)if(Object.getOwnPropertyDescriptor(G,N)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let J=sQ(Q._zod.def,{get shape(){let G={...Q._zod.def.shape,...H};return AH(this,"shape",G),G}});return VQ(Q,J)}function mD(Q,H){if(!FH(H))throw Error("Invalid input to safeExtend: expected a plain object");let W=sQ(Q._zod.def,{get shape(){let Y={...Q._zod.def.shape,...H};return AH(this,"shape",Y),Y}});return VQ(Q,W)}function cD(Q,H){if(Q._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let W=sQ(Q._zod.def,{get shape(){let Y={...Q._zod.def.shape,...H._zod.def.shape};return AH(this,"shape",Y),Y},get catchall(){return H._zod.def.catchall},checks:H._zod.def.checks??[]});return VQ(Q,W)}function pD(Q,H,W){let J=H._zod.def.checks;if(J&&J.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let N=sQ(H._zod.def,{get shape(){let X=H._zod.def.shape,D={...X};if(W)for(let E in W){if(!(E in X))throw Error(`Unrecognized key: "${E}"`);if(!W[E])continue;D[E]=Q?new Q({type:"optional",innerType:X[E]}):X[E]}else for(let E in X)D[E]=Q?new Q({type:"optional",innerType:X[E]}):X[E];return AH(this,"shape",D),D},checks:[]});return VQ(H,N)}function dD(Q,H,W){let Y=sQ(H._zod.def,{get shape(){let J=H._zod.def.shape,G={...J};if(W)for(let N in W){if(!(N in G))throw Error(`Unrecognized key: "${N}"`);if(!W[N])continue;G[N]=new Q({type:"nonoptional",innerType:J[N]})}else for(let N in J)G[N]=new Q({type:"nonoptional",innerType:J[N]});return AH(this,"shape",G),G}});return VQ(H,Y)}function qH(Q,H=0){if(Q.aborted===!0)return!0;for(let W=H;W<Q.issues.length;W++)if(Q.issues[W]?.continue!==!0)return!0;return!1}function n8(Q,H=0){if(Q.aborted===!0)return!0;for(let W=H;W<Q.issues.length;W++)if(Q.issues[W]?.continue===!1)return!0;return!1}function OQ(Q,H){return H.map((W)=>{var Y;return(Y=W).path??(Y.path=[]),W.path.unshift(Q),W})}function x4(Q){return typeof Q==="string"?Q:Q?.message}function wQ(Q,H,W){let Y=Q.message?Q.message:x4(Q.inst?._zod.def?.error?.(Q))??x4(H?.error?.(Q))??x4(W.customError?.(Q))??x4(W.localeError?.(Q))??"Invalid input",{inst:J,continue:G,input:N,...X}=Q;if(X.path??(X.path=[]),X.message=Y,H?.reportInput)X.input=N;return X}function f4(Q){if(Q instanceof Set)return"set";if(Q instanceof Map)return"map";if(Q instanceof File)return"file";return"unknown"}function u4(Q){if(Array.isArray(Q))return"array";if(typeof Q==="string")return"string";return"unknown"}function r8(Q){let H=typeof Q;switch(H){case"number":return Number.isNaN(Q)?"nan":"number";case"object":{if(Q===null)return"null";if(Array.isArray(Q))return"array";let W=Q;if(W&&Object.getPrototypeOf(W)!==Object.prototype&&"constructor"in W&&W.constructor)return W.constructor.name}}return H}function h0(...Q){let[H,W,Y]=Q;if(typeof H==="string")return{message:H,code:"custom",input:W,inst:Y};return{...H}}function iD(Q){return Object.entries(Q).filter(([H,W])=>{return Number.isNaN(Number.parseInt(H,10))}).map((H)=>H[1])}function E5(Q){let H=atob(Q),W=new Uint8Array(H.length);for(let Y=0;Y<H.length;Y++)W[Y]=H.charCodeAt(Y);return W}function M5(Q){let H="";for(let W=0;W<Q.length;W++)H+=String.fromCharCode(Q[W]);return btoa(H)}function oD(Q){let H=Q.replace(/-/g,"+").replace(/_/g,"/"),W="=".repeat((4-H.length%4)%4);return E5(H+W)}function nD(Q){return M5(Q).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function rD(Q){let H=Q.replace(/^0x/,"");if(H.length%2!==0)throw Error("Invalid hex string length");let W=new Uint8Array(H.length/2);for(let Y=0;Y<H.length;Y+=2)W[Y/2]=Number.parseInt(H.slice(Y,Y+2),16);return W}function tD(Q){return Array.from(Q).map((H)=>H.toString(16).padStart(2,"0")).join("")}class V5{constructor(...Q){}}var w5=(Q,H)=>{Q.name="$ZodError",Object.defineProperty(Q,"_zod",{value:Q._zod,enumerable:!1}),Object.defineProperty(Q,"issues",{value:H,enumerable:!1}),Q.message=JSON.stringify(H,v0,2),Object.defineProperty(Q,"toString",{value:()=>Q.message,enumerable:!1})},l4=V("$ZodError",w5),_Q=V("$ZodError",w5,{Parent:Error});function m4(Q,H=(W)=>W.message){let W={},Y=[];for(let J of Q.issues)if(J.path.length>0)W[J.path[0]]=W[J.path[0]]||[],W[J.path[0]].push(H(J));else Y.push(H(J));return{formErrors:Y,fieldErrors:W}}function c4(Q,H=(W)=>W.message){let W={_errors:[]},Y=(J,G=[])=>{for(let N of J.issues)if(N.code==="invalid_union"&&N.errors.length)N.errors.map((X)=>Y({issues:X},[...G,...N.path]));else if(N.code==="invalid_key")Y({issues:N.issues},[...G,...N.path]);else if(N.code==="invalid_element")Y({issues:N.issues},[...G,...N.path]);else{let X=[...G,...N.path];if(X.length===0)W._errors.push(H(N));else{let D=W,E=0;while(E<X.length){let w=X[E];if(E!==X.length-1)D[w]=D[w]||{_errors:[]};else D[w]=D[w]||{_errors:[]},D[w]._errors.push(H(N));D=D[w],E++}}}};return Y(Q),W}function t8(Q,H=(W)=>W.message){let W={errors:[]},Y=(J,G=[])=>{var N,X;for(let D of J.issues)if(D.code==="invalid_union"&&D.errors.length)D.errors.map((E)=>Y({issues:E},[...G,...D.path]));else if(D.code==="invalid_key")Y({issues:D.issues},[...G,...D.path]);else if(D.code==="invalid_element")Y({issues:D.issues},[...G,...D.path]);else{let E=[...G,...D.path];if(E.length===0){W.errors.push(H(D));continue}let w=W,q=0;while(q<E.length){let O=E[q],_=q===E.length-1;if(typeof O==="string")w.properties??(w.properties={}),(N=w.properties)[O]??(N[O]={errors:[]}),w=w.properties[O];else w.items??(w.items=[]),(X=w.items)[O]??(X[O]={errors:[]}),w=w.items[O];if(_)w.errors.push(H(D));q++}}};return Y(Q),W}function A5(Q){let H=[],W=Q.map((Y)=>typeof Y==="object"?Y.key:Y);for(let Y of W)if(typeof Y==="number")H.push(`[${Y}]`);else if(typeof Y==="symbol")H.push(`[${JSON.stringify(String(Y))}]`);else if(/[^\w$]/.test(Y))H.push(`[${JSON.stringify(Y)}]`);else{if(H.length)H.push(".");H.push(Y)}return H.join("")}function s8(Q){let H=[],W=[...Q.issues].sort((Y,J)=>(Y.path??[]).length-(J.path??[]).length);for(let Y of W)if(H.push(`✖ ${Y.message}`),Y.path?.length)H.push(` → at ${A5(Y.path)}`);return H.join(`
2
- `)}var f0=(Q)=>(H,W,Y,J)=>{let G=Y?{...Y,async:!1}:{async:!1},N=H._zod.run({value:W,issues:[]},G);if(N instanceof Promise)throw new vQ;if(N.issues.length){let X=new(J?.Err??Q)(N.issues.map((D)=>wQ(D,G,s())));throw I6(X,J?.callee),X}return N.value},T6=f0(_Q),u0=(Q)=>async(H,W,Y,J)=>{let G=Y?{...Y,async:!0}:{async:!0},N=H._zod.run({value:W,issues:[]},G);if(N instanceof Promise)N=await N;if(N.issues.length){let X=new(J?.Err??Q)(N.issues.map((D)=>wQ(D,G,s())));throw I6(X,J?.callee),X}return N.value},j6=u0(_Q),l0=(Q)=>(H,W,Y)=>{let J=Y?{...Y,async:!1}:{async:!1},G=H._zod.run({value:W,issues:[]},J);if(G instanceof Promise)throw new vQ;return G.issues.length?{success:!1,error:new(Q??l4)(G.issues.map((N)=>wQ(N,J,s())))}:{success:!0,data:G.value}},a8=l0(_Q),m0=(Q)=>async(H,W,Y)=>{let J=Y?{...Y,async:!0}:{async:!0},G=H._zod.run({value:W,issues:[]},J);if(G instanceof Promise)G=await G;return G.issues.length?{success:!1,error:new Q(G.issues.map((N)=>wQ(N,J,s())))}:{success:!0,data:G.value}},e8=m0(_Q),R6=(Q)=>(H,W,Y)=>{let J=Y?{...Y,direction:"backward"}:{direction:"backward"};return f0(Q)(H,W,J)},aD=R6(_Q),C6=(Q)=>(H,W,Y)=>{return f0(Q)(H,W,Y)},eD=C6(_Q),S6=(Q)=>async(H,W,Y)=>{let J=Y?{...Y,direction:"backward"}:{direction:"backward"};return u0(Q)(H,W,J)},QK=S6(_Q),k6=(Q)=>async(H,W,Y)=>{return u0(Q)(H,W,Y)},HK=k6(_Q),g6=(Q)=>(H,W,Y)=>{let J=Y?{...Y,direction:"backward"}:{direction:"backward"};return l0(Q)(H,W,J)},WK=g6(_Q),x6=(Q)=>(H,W,Y)=>{return l0(Q)(H,W,Y)},YK=x6(_Q),v6=(Q)=>async(H,W,Y)=>{let J=Y?{...Y,direction:"backward"}:{direction:"backward"};return m0(Q)(H,W,J)},JK=v6(_Q),y6=(Q)=>async(H,W,Y)=>{return m0(Q)(H,W,Y)},GK=y6(_Q);var PQ={};tQ(PQ,{xid:()=>Y3,uuid7:()=>DK,uuid6:()=>XK,uuid4:()=>BK,uuid:()=>tH,uppercase:()=>T3,unicodeEmail:()=>F5,undefined:()=>I3,ulid:()=>W3,time:()=>_3,string:()=>z3,sha512_hex:()=>RK,sha512_base64url:()=>SK,sha512_base64:()=>CK,sha384_hex:()=>LK,sha384_base64url:()=>jK,sha384_base64:()=>TK,sha256_hex:()=>ZK,sha256_base64url:()=>IK,sha256_base64:()=>$K,sha1_hex:()=>zK,sha1_base64url:()=>PK,sha1_base64:()=>bK,rfc5322Email:()=>EK,number:()=>p4,null:()=>$3,nanoid:()=>G3,md5_hex:()=>OK,md5_base64url:()=>UK,md5_base64:()=>_K,mac:()=>M3,lowercase:()=>L3,ksuid:()=>J3,ipv6:()=>E3,ipv4:()=>K3,integer:()=>P3,idnEmail:()=>MK,httpProtocol:()=>F3,html5Email:()=>KK,hostname:()=>AK,hex:()=>qK,guid:()=>B3,extendedDuration:()=>NK,emoji:()=>D3,email:()=>X3,e164:()=>q3,duration:()=>N3,domain:()=>FK,datetime:()=>U3,date:()=>O3,cuid2:()=>H3,cuid:()=>Q3,cidrv6:()=>w3,cidrv4:()=>V3,browserEmail:()=>VK,boolean:()=>Z3,bigint:()=>b3,base64url:()=>h6,base64:()=>A3});var Q3=/^[cC][0-9a-z]{6,}$/,H3=/^[0-9a-z]+$/,W3=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Y3=/^[0-9a-vA-V]{20}$/,J3=/^[A-Za-z0-9]{27}$/,G3=/^[a-zA-Z0-9_-]{21}$/,N3=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,NK=/^[-+]?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)?)??$/,B3=/^([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})$/,tH=(Q)=>{if(!Q)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}-${Q}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},BK=tH(4),XK=tH(6),DK=tH(7),X3=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,KK=/^[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])?)*$/,EK=/^(([^<>()\[\]\\.,;:\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,}))$/,F5=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,MK=F5,VK=/^[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])?)*$/,wK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function D3(){return new RegExp(wK,"u")}var K3=/^(?:(?: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])$/,E3=/^(([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}|:))$/,M3=(Q)=>{let H=TQ(Q??":");return new RegExp(`^(?:[0-9A-F]{2}${H}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${H}){5}[0-9a-f]{2}$`)},V3=/^((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])$/,w3=/^(([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])$/,A3=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,h6=/^[A-Za-z0-9_-]*$/,AK=/^(?=.{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])?)*\.?$/,FK=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,F3=/^https?$/,q3=/^\+[1-9]\d{6,14}$/,q5="(?:(?:\\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])))",O3=new RegExp(`^${q5}$`);function O5(Q){return typeof Q.precision==="number"?Q.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":Q.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{${Q.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function _3(Q){return new RegExp(`^${O5(Q)}$`)}function U3(Q){let H=O5({precision:Q.precision}),W=["Z"];if(Q.local)W.push("");if(Q.offset)W.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let Y=`${H}(?:${W.join("|")})`;return new RegExp(`^${q5}T(?:${Y})$`)}var z3=(Q)=>{let H=Q?`[\\s\\S]{${Q?.minimum??0},${Q?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${H}$`)},b3=/^-?\d+n?$/,P3=/^-?\d+$/,p4=/^-?\d+(?:\.\d+)?$/,Z3=/^(?:true|false)$/i,$3=/^null$/i;var I3=/^undefined$/i;var L3=/^[^A-Z]*$/,T3=/^[^a-z]*$/,qK=/^[0-9a-fA-F]*$/;function d4(Q,H){return new RegExp(`^[A-Za-z0-9+/]{${Q}}${H}$`)}function i4(Q){return new RegExp(`^[A-Za-z0-9_-]{${Q}}$`)}var OK=/^[0-9a-fA-F]{32}$/,_K=d4(22,"=="),UK=i4(22),zK=/^[0-9a-fA-F]{40}$/,bK=d4(27,"="),PK=i4(27),ZK=/^[0-9a-fA-F]{64}$/,$K=d4(43,"="),IK=i4(43),LK=/^[0-9a-fA-F]{96}$/,TK=d4(64,""),jK=i4(64),RK=/^[0-9a-fA-F]{128}$/,CK=d4(86,"=="),SK=i4(86);var p=V("$ZodCheck",(Q,H)=>{var W;Q._zod??(Q._zod={}),Q._zod.def=H,(W=Q._zod).onattach??(W.onattach=[])}),U5={number:"number",bigint:"bigint",object:"date"},f6=V("$ZodCheckLessThan",(Q,H)=>{p.init(Q,H);let W=U5[typeof H.value];Q._zod.onattach.push((Y)=>{let J=Y._zod.bag,G=(H.inclusive?J.maximum:J.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(H.value<G)if(H.inclusive)J.maximum=H.value;else J.exclusiveMaximum=H.value}),Q._zod.check=(Y)=>{if(H.inclusive?Y.value<=H.value:Y.value<H.value)return;Y.issues.push({origin:W,code:"too_big",maximum:typeof H.value==="object"?H.value.getTime():H.value,input:Y.value,inclusive:H.inclusive,inst:Q,continue:!H.abort})}}),u6=V("$ZodCheckGreaterThan",(Q,H)=>{p.init(Q,H);let W=U5[typeof H.value];Q._zod.onattach.push((Y)=>{let J=Y._zod.bag,G=(H.inclusive?J.minimum:J.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(H.value>G)if(H.inclusive)J.minimum=H.value;else J.exclusiveMinimum=H.value}),Q._zod.check=(Y)=>{if(H.inclusive?Y.value>=H.value:Y.value>H.value)return;Y.issues.push({origin:W,code:"too_small",minimum:typeof H.value==="object"?H.value.getTime():H.value,input:Y.value,inclusive:H.inclusive,inst:Q,continue:!H.abort})}}),j3=V("$ZodCheckMultipleOf",(Q,H)=>{p.init(Q,H),Q._zod.onattach.push((W)=>{var Y;(Y=W._zod.bag).multipleOf??(Y.multipleOf=H.value)}),Q._zod.check=(W)=>{if(typeof W.value!==typeof H.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof W.value==="bigint"?W.value%H.value===BigInt(0):u8(W.value,H.value)===0)return;W.issues.push({origin:typeof W.value,code:"not_multiple_of",divisor:H.value,input:W.value,inst:Q,continue:!H.abort})}}),R3=V("$ZodCheckNumberFormat",(Q,H)=>{p.init(Q,H),H.format=H.format||"float64";let W=H.format?.includes("int"),Y=W?"int":"number",[J,G]=i8[H.format];Q._zod.onattach.push((N)=>{let X=N._zod.bag;if(X.format=H.format,X.minimum=J,X.maximum=G,W)X.pattern=P3}),Q._zod.check=(N)=>{let X=N.value;if(W){if(!Number.isInteger(X)){N.issues.push({expected:Y,format:H.format,code:"invalid_type",continue:!1,input:X,inst:Q});return}if(!Number.isSafeInteger(X)){if(X>0)N.issues.push({input:X,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:Q,origin:Y,inclusive:!0,continue:!H.abort});else N.issues.push({input:X,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:Q,origin:Y,inclusive:!0,continue:!H.abort});return}}if(X<J)N.issues.push({origin:"number",input:X,code:"too_small",minimum:J,inclusive:!0,inst:Q,continue:!H.abort});if(X>G)N.issues.push({origin:"number",input:X,code:"too_big",maximum:G,inclusive:!0,inst:Q,continue:!H.abort})}}),C3=V("$ZodCheckBigIntFormat",(Q,H)=>{p.init(Q,H);let[W,Y]=o8[H.format];Q._zod.onattach.push((J)=>{let G=J._zod.bag;G.format=H.format,G.minimum=W,G.maximum=Y}),Q._zod.check=(J)=>{let G=J.value;if(G<W)J.issues.push({origin:"bigint",input:G,code:"too_small",minimum:W,inclusive:!0,inst:Q,continue:!H.abort});if(G>Y)J.issues.push({origin:"bigint",input:G,code:"too_big",maximum:Y,inclusive:!0,inst:Q,continue:!H.abort})}}),S3=V("$ZodCheckMaxSize",(Q,H)=>{var W;p.init(Q,H),(W=Q._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!wH(J)&&J.size!==void 0}),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag.maximum??Number.POSITIVE_INFINITY;if(H.maximum<J)Y._zod.bag.maximum=H.maximum}),Q._zod.check=(Y)=>{let J=Y.value;if(J.size<=H.maximum)return;Y.issues.push({origin:f4(J),code:"too_big",maximum:H.maximum,inclusive:!0,input:J,inst:Q,continue:!H.abort})}}),k3=V("$ZodCheckMinSize",(Q,H)=>{var W;p.init(Q,H),(W=Q._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!wH(J)&&J.size!==void 0}),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(H.minimum>J)Y._zod.bag.minimum=H.minimum}),Q._zod.check=(Y)=>{let J=Y.value;if(J.size>=H.minimum)return;Y.issues.push({origin:f4(J),code:"too_small",minimum:H.minimum,inclusive:!0,input:J,inst:Q,continue:!H.abort})}}),g3=V("$ZodCheckSizeEquals",(Q,H)=>{var W;p.init(Q,H),(W=Q._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!wH(J)&&J.size!==void 0}),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.minimum=H.size,J.maximum=H.size,J.size=H.size}),Q._zod.check=(Y)=>{let J=Y.value,G=J.size;if(G===H.size)return;let N=G>H.size;Y.issues.push({origin:f4(J),...N?{code:"too_big",maximum:H.size}:{code:"too_small",minimum:H.size},inclusive:!0,exact:!0,input:Y.value,inst:Q,continue:!H.abort})}}),x3=V("$ZodCheckMaxLength",(Q,H)=>{var W;p.init(Q,H),(W=Q._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!wH(J)&&J.length!==void 0}),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag.maximum??Number.POSITIVE_INFINITY;if(H.maximum<J)Y._zod.bag.maximum=H.maximum}),Q._zod.check=(Y)=>{let J=Y.value;if(J.length<=H.maximum)return;let N=u4(J);Y.issues.push({origin:N,code:"too_big",maximum:H.maximum,inclusive:!0,input:J,inst:Q,continue:!H.abort})}}),v3=V("$ZodCheckMinLength",(Q,H)=>{var W;p.init(Q,H),(W=Q._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!wH(J)&&J.length!==void 0}),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(H.minimum>J)Y._zod.bag.minimum=H.minimum}),Q._zod.check=(Y)=>{let J=Y.value;if(J.length>=H.minimum)return;let N=u4(J);Y.issues.push({origin:N,code:"too_small",minimum:H.minimum,inclusive:!0,input:J,inst:Q,continue:!H.abort})}}),y3=V("$ZodCheckLengthEquals",(Q,H)=>{var W;p.init(Q,H),(W=Q._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!wH(J)&&J.length!==void 0}),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.minimum=H.length,J.maximum=H.length,J.length=H.length}),Q._zod.check=(Y)=>{let J=Y.value,G=J.length;if(G===H.length)return;let N=u4(J),X=G>H.length;Y.issues.push({origin:N,...X?{code:"too_big",maximum:H.length}:{code:"too_small",minimum:H.length},inclusive:!0,exact:!0,input:Y.value,inst:Q,continue:!H.abort})}}),c0=V("$ZodCheckStringFormat",(Q,H)=>{var W,Y;if(p.init(Q,H),Q._zod.onattach.push((J)=>{let G=J._zod.bag;if(G.format=H.format,H.pattern)G.patterns??(G.patterns=new Set),G.patterns.add(H.pattern)}),H.pattern)(W=Q._zod).check??(W.check=(J)=>{if(H.pattern.lastIndex=0,H.pattern.test(J.value))return;J.issues.push({origin:"string",code:"invalid_format",format:H.format,input:J.value,...H.pattern?{pattern:H.pattern.toString()}:{},inst:Q,continue:!H.abort})});else(Y=Q._zod).check??(Y.check=()=>{})}),h3=V("$ZodCheckRegex",(Q,H)=>{c0.init(Q,H),Q._zod.check=(W)=>{if(H.pattern.lastIndex=0,H.pattern.test(W.value))return;W.issues.push({origin:"string",code:"invalid_format",format:"regex",input:W.value,pattern:H.pattern.toString(),inst:Q,continue:!H.abort})}}),f3=V("$ZodCheckLowerCase",(Q,H)=>{H.pattern??(H.pattern=L3),c0.init(Q,H)}),u3=V("$ZodCheckUpperCase",(Q,H)=>{H.pattern??(H.pattern=T3),c0.init(Q,H)}),l3=V("$ZodCheckIncludes",(Q,H)=>{p.init(Q,H);let W=TQ(H.includes),Y=new RegExp(typeof H.position==="number"?`^.{${H.position}}${W}`:W);H.pattern=Y,Q._zod.onattach.push((J)=>{let G=J._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(Y)}),Q._zod.check=(J)=>{if(J.value.includes(H.includes,H.position))return;J.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:H.includes,input:J.value,inst:Q,continue:!H.abort})}}),m3=V("$ZodCheckStartsWith",(Q,H)=>{p.init(Q,H);let W=new RegExp(`^${TQ(H.prefix)}.*`);H.pattern??(H.pattern=W),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(W)}),Q._zod.check=(Y)=>{if(Y.value.startsWith(H.prefix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:H.prefix,input:Y.value,inst:Q,continue:!H.abort})}}),c3=V("$ZodCheckEndsWith",(Q,H)=>{p.init(Q,H);let W=new RegExp(`.*${TQ(H.suffix)}$`);H.pattern??(H.pattern=W),Q._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(W)}),Q._zod.check=(Y)=>{if(Y.value.endsWith(H.suffix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:H.suffix,input:Y.value,inst:Q,continue:!H.abort})}});function _5(Q,H,W){if(Q.issues.length)H.issues.push(...OQ(W,Q.issues))}var p3=V("$ZodCheckProperty",(Q,H)=>{p.init(Q,H),Q._zod.check=(W)=>{let Y=H.schema._zod.run({value:W.value[H.property],issues:[]},{});if(Y instanceof Promise)return Y.then((J)=>_5(J,W,H.property));_5(Y,W,H.property);return}}),d3=V("$ZodCheckMimeType",(Q,H)=>{p.init(Q,H);let W=new Set(H.mime);Q._zod.onattach.push((Y)=>{Y._zod.bag.mime=H.mime}),Q._zod.check=(Y)=>{if(W.has(Y.value.type))return;Y.issues.push({code:"invalid_value",values:H.mime,input:Y.value.type,inst:Q,continue:!H.abort})}}),i3=V("$ZodCheckOverwrite",(Q,H)=>{p.init(Q,H),Q._zod.check=(W)=>{W.value=H.tx(W.value)}});class l6{constructor(Q=[]){if(this.content=[],this.indent=0,this)this.args=Q}indented(Q){this.indent+=1,Q(this),this.indent-=1}write(Q){if(typeof Q==="function"){Q(this,{execution:"sync"}),Q(this,{execution:"async"});return}let W=Q.split(`
3
- `).filter((G)=>G),Y=Math.min(...W.map((G)=>G.length-G.trimStart().length)),J=W.map((G)=>G.slice(Y)).map((G)=>" ".repeat(this.indent*2)+G);for(let G of J)this.content.push(G)}compile(){let Q=Function,H=this?.args,Y=[...(this?.content??[""]).map((J)=>` ${J}`)];return new Q(...H,Y.join(`
4
- `))}}var o3={major:4,minor:4,patch:3};var g=V("$ZodType",(Q,H)=>{var W;Q??(Q={}),Q._zod.def=H,Q._zod.bag=Q._zod.bag||{},Q._zod.version=o3;let Y=[...Q._zod.def.checks??[]];if(Q._zod.traits.has("$ZodCheck"))Y.unshift(Q);for(let J of Y)for(let G of J._zod.onattach)G(Q);if(Y.length===0)(W=Q._zod).deferred??(W.deferred=[]),Q._zod.deferred?.push(()=>{Q._zod.run=Q._zod.parse});else{let J=(N,X,D)=>{let E=qH(N),w;for(let q of X){if(q._zod.def.when){if(n8(N))continue;if(!q._zod.def.when(N))continue}else if(E)continue;let O=N.issues.length,_=q._zod.check(N);if(_ instanceof Promise&&D?.async===!1)throw new vQ;if(w||_ instanceof Promise)w=(w??Promise.resolve()).then(async()=>{if(await _,N.issues.length===O)return;if(!E)E=qH(N,O)});else{if(N.issues.length===O)continue;if(!E)E=qH(N,O)}}if(w)return w.then(()=>{return N});return N},G=(N,X,D)=>{if(qH(N))return N.aborted=!0,N;let E=J(X,Y,D);if(E instanceof Promise){if(D.async===!1)throw new vQ;return E.then((w)=>Q._zod.parse(w,D))}return Q._zod.parse(E,D)};Q._zod.run=(N,X)=>{if(X.skipChecks)return Q._zod.parse(N,X);if(X.direction==="backward"){let E=Q._zod.parse({value:N.value,issues:[]},{...X,skipChecks:!0});if(E instanceof Promise)return E.then((w)=>{return G(w,N,X)});return G(E,N,X)}let D=Q._zod.parse(N,X);if(D instanceof Promise){if(X.async===!1)throw new vQ;return D.then((E)=>J(E,Y,X))}return J(D,Y,X)}}y(Q,"~standard",()=>({validate:(J)=>{try{let G=a8(Q,J);return G.success?{value:G.data}:{issues:G.error?.issues}}catch(G){return e8(Q,J).then((N)=>N.success?{value:N.data}:{issues:N.error?.issues})}},vendor:"zod",version:1}))}),sH=V("$ZodString",(Q,H)=>{g.init(Q,H),Q._zod.pattern=[...Q?._zod.bag?.patterns??[]].pop()??z3(Q._zod.bag),Q._zod.parse=(W,Y)=>{if(H.coerce)try{W.value=String(W.value)}catch(J){}if(typeof W.value==="string")return W;return W.issues.push({expected:"string",code:"invalid_type",input:W.value,inst:Q}),W}}),m=V("$ZodStringFormat",(Q,H)=>{c0.init(Q,H),sH.init(Q,H)}),r3=V("$ZodGUID",(Q,H)=>{H.pattern??(H.pattern=B3),m.init(Q,H)}),t3=V("$ZodUUID",(Q,H)=>{if(H.version){let Y={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[H.version];if(Y===void 0)throw Error(`Invalid UUID version: "${H.version}"`);H.pattern??(H.pattern=tH(Y))}else H.pattern??(H.pattern=tH());m.init(Q,H)}),s3=V("$ZodEmail",(Q,H)=>{H.pattern??(H.pattern=X3),m.init(Q,H)}),a3=V("$ZodURL",(Q,H)=>{m.init(Q,H),Q._zod.check=(W)=>{try{let Y=W.value.trim();if(!H.normalize&&H.protocol?.source===F3.source){if(!/^https?:\/\//i.test(Y)){W.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:W.value,inst:Q,continue:!H.abort});return}}let J=new URL(Y);if(H.hostname){if(H.hostname.lastIndex=0,!H.hostname.test(J.hostname))W.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:H.hostname.source,input:W.value,inst:Q,continue:!H.abort})}if(H.protocol){if(H.protocol.lastIndex=0,!H.protocol.test(J.protocol.endsWith(":")?J.protocol.slice(0,-1):J.protocol))W.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:H.protocol.source,input:W.value,inst:Q,continue:!H.abort})}if(H.normalize)W.value=J.href;else W.value=Y;return}catch(Y){W.issues.push({code:"invalid_format",format:"url",input:W.value,inst:Q,continue:!H.abort})}}}),e3=V("$ZodEmoji",(Q,H)=>{H.pattern??(H.pattern=D3()),m.init(Q,H)}),QJ=V("$ZodNanoID",(Q,H)=>{H.pattern??(H.pattern=G3),m.init(Q,H)}),HJ=V("$ZodCUID",(Q,H)=>{H.pattern??(H.pattern=Q3),m.init(Q,H)}),WJ=V("$ZodCUID2",(Q,H)=>{H.pattern??(H.pattern=H3),m.init(Q,H)}),YJ=V("$ZodULID",(Q,H)=>{H.pattern??(H.pattern=W3),m.init(Q,H)}),JJ=V("$ZodXID",(Q,H)=>{H.pattern??(H.pattern=Y3),m.init(Q,H)}),GJ=V("$ZodKSUID",(Q,H)=>{H.pattern??(H.pattern=J3),m.init(Q,H)}),NJ=V("$ZodISODateTime",(Q,H)=>{H.pattern??(H.pattern=U3(H)),m.init(Q,H)}),BJ=V("$ZodISODate",(Q,H)=>{H.pattern??(H.pattern=O3),m.init(Q,H)}),XJ=V("$ZodISOTime",(Q,H)=>{H.pattern??(H.pattern=_3(H)),m.init(Q,H)}),DJ=V("$ZodISODuration",(Q,H)=>{H.pattern??(H.pattern=N3),m.init(Q,H)}),KJ=V("$ZodIPv4",(Q,H)=>{H.pattern??(H.pattern=K3),m.init(Q,H),Q._zod.bag.format="ipv4"}),EJ=V("$ZodIPv6",(Q,H)=>{H.pattern??(H.pattern=E3),m.init(Q,H),Q._zod.bag.format="ipv6",Q._zod.check=(W)=>{try{new URL(`http://[${W.value}]`)}catch{W.issues.push({code:"invalid_format",format:"ipv6",input:W.value,inst:Q,continue:!H.abort})}}}),MJ=V("$ZodMAC",(Q,H)=>{H.pattern??(H.pattern=M3(H.delimiter)),m.init(Q,H),Q._zod.bag.format="mac"}),VJ=V("$ZodCIDRv4",(Q,H)=>{H.pattern??(H.pattern=V3),m.init(Q,H)}),wJ=V("$ZodCIDRv6",(Q,H)=>{H.pattern??(H.pattern=w3),m.init(Q,H),Q._zod.check=(W)=>{let Y=W.value.split("/");try{if(Y.length!==2)throw Error();let[J,G]=Y;if(!G)throw Error();let N=Number(G);if(`${N}`!==G)throw Error();if(N<0||N>128)throw Error();new URL(`http://[${J}]`)}catch{W.issues.push({code:"invalid_format",format:"cidrv6",input:W.value,inst:Q,continue:!H.abort})}}});function AJ(Q){if(Q==="")return!0;if(/\s/.test(Q))return!1;if(Q.length%4!==0)return!1;try{return atob(Q),!0}catch{return!1}}var FJ=V("$ZodBase64",(Q,H)=>{H.pattern??(H.pattern=A3),m.init(Q,H),Q._zod.bag.contentEncoding="base64",Q._zod.check=(W)=>{if(AJ(W.value))return;W.issues.push({code:"invalid_format",format:"base64",input:W.value,inst:Q,continue:!H.abort})}});function v5(Q){if(!h6.test(Q))return!1;let H=Q.replace(/[-_]/g,(Y)=>Y==="-"?"+":"/"),W=H.padEnd(Math.ceil(H.length/4)*4,"=");return AJ(W)}var qJ=V("$ZodBase64URL",(Q,H)=>{H.pattern??(H.pattern=h6),m.init(Q,H),Q._zod.bag.contentEncoding="base64url",Q._zod.check=(W)=>{if(v5(W.value))return;W.issues.push({code:"invalid_format",format:"base64url",input:W.value,inst:Q,continue:!H.abort})}}),OJ=V("$ZodE164",(Q,H)=>{H.pattern??(H.pattern=q3),m.init(Q,H)});function y5(Q,H=null){try{let W=Q.split(".");if(W.length!==3)return!1;let[Y]=W;if(!Y)return!1;let J=JSON.parse(atob(Y));if("typ"in J&&J?.typ!=="JWT")return!1;if(!J.alg)return!1;if(H&&(!("alg"in J)||J.alg!==H))return!1;return!0}catch{return!1}}var _J=V("$ZodJWT",(Q,H)=>{m.init(Q,H),Q._zod.check=(W)=>{if(y5(W.value,H.alg))return;W.issues.push({code:"invalid_format",format:"jwt",input:W.value,inst:Q,continue:!H.abort})}}),UJ=V("$ZodCustomStringFormat",(Q,H)=>{m.init(Q,H),Q._zod.check=(W)=>{if(H.fn(W.value))return;W.issues.push({code:"invalid_format",format:H.format,input:W.value,inst:Q,continue:!H.abort})}}),i6=V("$ZodNumber",(Q,H)=>{g.init(Q,H),Q._zod.pattern=Q._zod.bag.pattern??p4,Q._zod.parse=(W,Y)=>{if(H.coerce)try{W.value=Number(W.value)}catch(N){}let J=W.value;if(typeof J==="number"&&!Number.isNaN(J)&&Number.isFinite(J))return W;let G=typeof J==="number"?Number.isNaN(J)?"NaN":!Number.isFinite(J)?"Infinity":void 0:void 0;return W.issues.push({expected:"number",code:"invalid_type",input:J,inst:Q,...G?{received:G}:{}}),W}}),zJ=V("$ZodNumberFormat",(Q,H)=>{R3.init(Q,H),i6.init(Q,H)}),o4=V("$ZodBoolean",(Q,H)=>{g.init(Q,H),Q._zod.pattern=Z3,Q._zod.parse=(W,Y)=>{if(H.coerce)try{W.value=Boolean(W.value)}catch(G){}let J=W.value;if(typeof J==="boolean")return W;return W.issues.push({expected:"boolean",code:"invalid_type",input:J,inst:Q}),W}}),o6=V("$ZodBigInt",(Q,H)=>{g.init(Q,H),Q._zod.pattern=b3,Q._zod.parse=(W,Y)=>{if(H.coerce)try{W.value=BigInt(W.value)}catch(J){}if(typeof W.value==="bigint")return W;return W.issues.push({expected:"bigint",code:"invalid_type",input:W.value,inst:Q}),W}}),bJ=V("$ZodBigIntFormat",(Q,H)=>{C3.init(Q,H),o6.init(Q,H)}),PJ=V("$ZodSymbol",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(typeof J==="symbol")return W;return W.issues.push({expected:"symbol",code:"invalid_type",input:J,inst:Q}),W}}),ZJ=V("$ZodUndefined",(Q,H)=>{g.init(Q,H),Q._zod.pattern=I3,Q._zod.values=new Set([void 0]),Q._zod.parse=(W,Y)=>{let J=W.value;if(typeof J>"u")return W;return W.issues.push({expected:"undefined",code:"invalid_type",input:J,inst:Q}),W}}),$J=V("$ZodNull",(Q,H)=>{g.init(Q,H),Q._zod.pattern=$3,Q._zod.values=new Set([null]),Q._zod.parse=(W,Y)=>{let J=W.value;if(J===null)return W;return W.issues.push({expected:"null",code:"invalid_type",input:J,inst:Q}),W}}),IJ=V("$ZodAny",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W)=>W}),LJ=V("$ZodUnknown",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W)=>W}),TJ=V("$ZodNever",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W,Y)=>{return W.issues.push({expected:"never",code:"invalid_type",input:W.value,inst:Q}),W}}),jJ=V("$ZodVoid",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(typeof J>"u")return W;return W.issues.push({expected:"void",code:"invalid_type",input:J,inst:Q}),W}}),RJ=V("$ZodDate",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W,Y)=>{if(H.coerce)try{W.value=new Date(W.value)}catch(X){}let J=W.value,G=J instanceof Date;if(G&&!Number.isNaN(J.getTime()))return W;return W.issues.push({expected:"date",code:"invalid_type",input:J,...G?{received:"Invalid Date"}:{},inst:Q}),W}});function b5(Q,H,W){if(Q.issues.length)H.issues.push(...OQ(W,Q.issues));H.value[W]=Q.value}var CJ=V("$ZodArray",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(!Array.isArray(J))return W.issues.push({expected:"array",code:"invalid_type",input:J,inst:Q}),W;W.value=Array(J.length);let G=[];for(let N=0;N<J.length;N++){let X=J[N],D=H.element._zod.run({value:X,issues:[]},Y);if(D instanceof Promise)G.push(D.then((E)=>b5(E,W,N)));else b5(D,W,N)}if(G.length)return Promise.all(G).then(()=>W);return W}});function d6(Q,H,W,Y,J,G){let N=W in Y;if(Q.issues.length){if(J&&G&&!N)return;H.issues.push(...OQ(W,Q.issues))}if(!N&&!J){if(!Q.issues.length)H.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[W]});return}if(Q.value===void 0){if(N)H.value[W]=void 0}else H.value[W]=Q.value}function h5(Q){let H=Object.keys(Q.shape);for(let Y of H)if(!Q.shape?.[Y]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${Y}": expected a Zod schema`);let W=d8(Q.shape);return{...Q,keys:H,keySet:new Set(H),numKeys:H.length,optionalKeys:new Set(W)}}function f5(Q,H,W,Y,J,G){let N=[],X=J.keySet,D=J.catchall._zod,E=D.def.type,w=D.optin==="optional",q=D.optout==="optional";for(let O in H){if(O==="__proto__")continue;if(X.has(O))continue;if(E==="never"){N.push(O);continue}let _=D.run({value:H[O],issues:[]},Y);if(_ instanceof Promise)Q.push(_.then((I)=>d6(I,W,O,H,w,q)));else d6(_,W,O,H,w,q)}if(N.length)W.issues.push({code:"unrecognized_keys",keys:N,input:H,inst:G});if(!Q.length)return W;return Promise.all(Q).then(()=>{return W})}var u5=V("$ZodObject",(Q,H)=>{if(g.init(Q,H),!Object.getOwnPropertyDescriptor(H,"shape")?.get){let X=H.shape;Object.defineProperty(H,"shape",{get:()=>{let D={...X};return Object.defineProperty(H,"shape",{value:D}),D}})}let Y=y0(()=>h5(H));y(Q._zod,"propValues",()=>{let X=H.shape,D={};for(let E in X){let w=X[E]._zod;if(w.values){D[E]??(D[E]=new Set);for(let q of w.values)D[E].add(q)}}return D});let J=rH,G=H.catchall,N;Q._zod.parse=(X,D)=>{N??(N=Y.value);let E=X.value;if(!J(E))return X.issues.push({expected:"object",code:"invalid_type",input:E,inst:Q}),X;X.value={};let w=[],q=N.shape;for(let O of N.keys){let _=q[O],I=_._zod.optin==="optional",j=_._zod.optout==="optional",C=_._zod.run({value:E[O],issues:[]},D);if(C instanceof Promise)w.push(C.then((v)=>d6(v,X,O,E,I,j)));else d6(C,X,O,E,I,j)}if(!G)return w.length?Promise.all(w).then(()=>X):X;return f5(w,E,X,D,Y.value,Q)}}),SJ=V("$ZodObjectJIT",(Q,H)=>{u5.init(Q,H);let W=Q._zod.parse,Y=y0(()=>h5(H)),J=(O)=>{let _=new l6(["shape","payload","ctx"]),I=Y.value,j=(f)=>{let u=$6(f);return`shape[${u}]._zod.run({ value: input[${u}], issues: [] }, ctx)`};_.write("const input = payload.value;");let C=Object.create(null),v=0;for(let f of I.keys)C[f]=`key_${v++}`;_.write("const newResult = {};");for(let f of I.keys){let u=C[f],o=$6(f),d=O[f],QQ=d?._zod?.optin==="optional",oQ=d?._zod?.optout==="optional";if(_.write(`const ${u} = ${j(f)};`),QQ&&oQ)_.write(`
5
- if (${u}.issues.length) {
6
- if (${o} in input) {
7
- payload.issues = payload.issues.concat(${u}.issues.map(iss => ({
1
+ var{create:dm,defineProperty:ii,getOwnPropertyDescriptor:pm,getOwnPropertyNames:hm,getPrototypeOf:mm}=Object,fm=Object.prototype.hasOwnProperty,Gc=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Kc=(e,t)=>{let o={};for(var r in e)ii(o,r,{get:e[r],enumerable:!0});if(t)ii(o,Symbol.toStringTag,{value:"Module"});return o},gm=(e,t,o,r)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var n=hm(t),i=0,a=n.length,c;i<a;i++)if(c=n[i],!fm.call(e,c)&&c!==o)ii(e,c,{get:((p)=>t[p]).bind(null,c),enumerable:!(r=pm(t,c))||r.enumerable})}return e},Yc=(e,t,o)=>(o=e!=null?dm(mm(e)):{},gm(t||!e||!e.__esModule?ii(o,"default",{value:e,enumerable:!0}):o,e));var Sm=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function Qc(e){return typeof e==="string"&&Sm.has(e.replace(/#$/,""))}var Xc,pa=Object.freeze({status:"aborted"});function m(e,t,o){function r(c,p){if(!c._zod)Object.defineProperty(c,"_zod",{value:{def:p,constr:a,traits:new Set},enumerable:!1});if(c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,p);let d=a.prototype,f=Object.keys(d);for(let S=0;S<f.length;S++){let _=f[S];if(!(_ in c))c[_]=d[_].bind(c)}}let n=o?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(c){var p;let d=o?.Parent?new i:this;r(d,c),(p=d._zod).deferred??(p.deferred=[]);for(let f of d._zod.deferred)f();return d}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:(c)=>{if(o?.Parent&&c instanceof o.Parent)return!0;return c?._zod?.traits?.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}var _m=Symbol("zod_brand");class Ie extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Nr extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Xc=globalThis).__zod_globalConfig??(Xc.__zod_globalConfig={});var so=globalThis.__zod_globalConfig;function ce(e){if(e)Object.assign(so,e);return so}function ci(e){let t=Object.values(e).filter((r)=>typeof r==="number");return Object.entries(e).filter(([r,n])=>t.indexOf(+r)===-1).map(([r,n])=>n)}function ma(e,t="|"){return e.map((o)=>_a(o)).join(t)}function Mr(e,t){if(typeof t==="bigint")return t.toString();return t}function qr(e){return{get value(){{let o=e();return Object.defineProperty(this,"value",{value:o}),o}throw Error("cached value already set")}}}function li(e){return e===null||e===void 0}function ui(e){let t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function tl(e,t){let o=e/t,r=Math.round(o),n=Number.EPSILON*Math.max(Math.abs(o),1);if(Math.abs(o-r)<n)return 0;return o-r}var el=Symbol("evaluating");function N(e,t,o){let r=void 0;Object.defineProperty(e,t,{get(){if(r===el)return;if(r===void 0)r=el,r=o();return r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function yt(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function Be(...e){let t={};for(let o of e){let r=Object.getOwnPropertyDescriptors(o);Object.assign(t,r)}return Object.defineProperties({},t)}function fa(e){return JSON.stringify(e)}function ol(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ga="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function io(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var rl=qr(()=>{if(so.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function zt(e){if(io(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let o=t.prototype;if(io(o)===!1)return!1;if(Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)return!1;return!0}function Sa(e){if(zt(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var nl=new Set(["string","number","symbol"]);function We(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _e(e,t,o){let r=new e._zod.constr(t??e._zod.def);if(!t||o?.parent)r._zod.parent=e;return r}function w(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 _a(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function sl(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var il={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function bm(e,t){let o=e._zod.def,r=o.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=Be(e._zod.def,{get shape(){let a={};for(let c in t){if(!(c in o.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;a[c]=o.shape[c]}return yt(this,"shape",a),a},checks:[]});return _e(e,i)}function ym(e,t){let o=e._zod.def,r=o.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=Be(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let c in t){if(!(c in o.shape))throw Error(`Unrecognized key: "${c}"`);if(!t[c])continue;delete a[c]}return yt(this,"shape",a),a},checks:[]});return _e(e,i)}function zm(e,t){if(!zt(t))throw Error("Invalid input to extend: expected a plain object");let o=e._zod.def.checks;if(o&&o.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 n=Be(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return yt(this,"shape",i),i}});return _e(e,n)}function vm(e,t){if(!zt(t))throw Error("Invalid input to safeExtend: expected a plain object");let o=Be(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return yt(this,"shape",r),r}});return _e(e,o)}function Rm(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let o=Be(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return yt(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return _e(e,o)}function wm(e,t,o){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let a=Be(t._zod.def,{get shape(){let c=t._zod.def.shape,p={...c};if(o)for(let d in o){if(!(d in c))throw Error(`Unrecognized key: "${d}"`);if(!o[d])continue;p[d]=e?new e({type:"optional",innerType:c[d]}):c[d]}else for(let d in c)p[d]=e?new e({type:"optional",innerType:c[d]}):c[d];return yt(this,"shape",p),p},checks:[]});return _e(t,a)}function xm(e,t,o){let r=Be(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(o)for(let a in o){if(!(a in i))throw Error(`Unrecognized key: "${a}"`);if(!o[a])continue;i[a]=new e({type:"nonoptional",innerType:n[a]})}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return yt(this,"shape",i),i}});return _e(t,r)}function vt(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function al(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue===!1)return!0;return!1}function Ge(e,t){return t.map((o)=>{var r;return(r=o).path??(r.path=[]),o.path.unshift(e),o})}function ai(e){return typeof e==="string"?e:e?.message}function be(e,t,o){let r=e.message?e.message:ai(e.inst?._zod.def?.error?.(e))??ai(t?.error?.(e))??ai(o.customError?.(e))??ai(o.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...c}=e;if(c.path??(c.path=[]),c.message=r,t?.reportInput)c.input=a;return c}function di(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function cl(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let o=e;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return t}function Rt(...e){let[t,o,r]=e;if(typeof t==="string")return{message:t,code:"custom",input:o,inst:r};return{...t}}var ll=(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,Mr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},pi=m("$ZodError",ll),ba=m("$ZodError",ll,{Parent:Error});function ya(e,t=(o)=>o.message){let o={},r=[];for(let n of e.issues)if(n.path.length>0)o[n.path[0]]=o[n.path[0]]||[],o[n.path[0]].push(t(n));else r.push(t(n));return{formErrors:r,fieldErrors:o}}function za(e,t=(o)=>o.message){let o={_errors:[]},r=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map((c)=>r({issues:c},[...i,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...i,...a.path]);else{let c=[...i,...a.path];if(c.length===0)o._errors.push(t(a));else{let p=o,d=0;while(d<c.length){let f=c[d];if(d!==c.length-1)p[f]=p[f]||{_errors:[]};else p[f]=p[f]||{_errors:[]},p[f]._errors.push(t(a));p=p[f],d++}}}};return r(e),o}var hi=(e)=>(t,o,r,n)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:o,issues:[]},i);if(a instanceof Promise)throw new Ie;if(a.issues.length){let c=new(n?.Err??e)(a.issues.map((p)=>be(p,i,ce())));throw ga(c,n?.callee),c}return a.value};var mi=(e)=>async(t,o,r,n)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:o,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let c=new(n?.Err??e)(a.issues.map((p)=>be(p,i,ce())));throw ga(c,n?.callee),c}return a.value};var Ar=(e)=>(t,o,r)=>{let n=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:o,issues:[]},n);if(i instanceof Promise)throw new Ie;return i.issues.length?{success:!1,error:new(e??pi)(i.issues.map((a)=>be(a,n,ce())))}:{success:!0,data:i.value}},ul=Ar(ba),jr=(e)=>async(t,o,r)=>{let n=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:o,issues:[]},n);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((a)=>be(a,n,ce())))}:{success:!0,data:i.value}},dl=jr(ba),pl=(e)=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return hi(e)(t,o,n)};var hl=(e)=>(t,o,r)=>hi(e)(t,o,r);var ml=(e)=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return mi(e)(t,o,n)};var fl=(e)=>async(t,o,r)=>mi(e)(t,o,r);var gl=(e)=>(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return Ar(e)(t,o,n)};var Sl=(e)=>(t,o,r)=>Ar(e)(t,o,r);var _l=(e)=>async(t,o,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return jr(e)(t,o,n)};var bl=(e)=>async(t,o,r)=>jr(e)(t,o,r);var yl=/^[cC][0-9a-z]{6,}$/,zl=/^[0-9a-z]+$/,vl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Rl=/^[0-9a-vA-V]{20}$/,wl=/^[A-Za-z0-9]{27}$/,xl=/^[a-zA-Z0-9_-]{21}$/,Pl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Tl=/^([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})$/,va=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var kl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Tm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function El(){return new RegExp(Tm,"u")}var $l=/^(?:(?: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])$/,Cl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Il=/^((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])$/,Ol=/^(([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])$/,Nl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ra=/^[A-Za-z0-9_-]*$/;var Ml=/^https?$/,ql=/^\+[1-9]\d{6,14}$/,Al="(?:(?:\\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])))",jl=new RegExp(`^${Al}$`);function Ll(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 Ul(e){return new RegExp(`^${Ll(e)}$`)}function Zl(e){let t=Ll({precision:e.precision}),o=["Z"];if(e.local)o.push("");if(e.offset)o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${o.join("|")})`;return new RegExp(`^${Al}T(?:${r})$`)}var Dl=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var Vl=/^-?\d+$/,wa=/^-?\d+(?:\.\d+)?$/,Hl=/^(?:true|false)$/i,Fl=/^null$/i;var Jl=/^undefined$/i;var Bl=/^[^A-Z]*$/,Wl=/^[^a-z]*$/;var X=m("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Gl={number:"number",bigint:"bigint",object:"date"},xa=m("$ZodCheckLessThan",(e,t)=>{X.init(e,t);let o=Gl[typeof t.value];e._zod.onattach.push((r)=>{let n=r._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<i)if(t.inclusive)n.maximum=t.value;else n.exclusiveMaximum=t.value}),e._zod.check=(r)=>{if(t.inclusive?r.value<=t.value:r.value<t.value)return;r.issues.push({origin:o,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pa=m("$ZodCheckGreaterThan",(e,t)=>{X.init(e,t);let o=Gl[typeof t.value];e._zod.onattach.push((r)=>{let n=r._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>i)if(t.inclusive)n.minimum=t.value;else n.exclusiveMinimum=t.value}),e._zod.check=(r)=>{if(t.inclusive?r.value>=t.value:r.value>t.value)return;r.issues.push({origin:o,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Kl=m("$ZodCheckMultipleOf",(e,t)=>{X.init(e,t),e._zod.onattach.push((o)=>{var r;(r=o._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=(o)=>{if(typeof o.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof o.value==="bigint"?o.value%t.value===BigInt(0):tl(o.value,t.value)===0)return;o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:t.value,input:o.value,inst:e,continue:!t.abort})}}),Yl=m("$ZodCheckNumberFormat",(e,t)=>{X.init(e,t),t.format=t.format||"float64";let o=t.format?.includes("int"),r=o?"int":"number",[n,i]=il[t.format];e._zod.onattach.push((a)=>{let c=a._zod.bag;if(c.format=t.format,c.minimum=n,c.maximum=i,o)c.pattern=Vl}),e._zod.check=(a)=>{let c=a.value;if(o){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});else a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}if(c<n)a.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(c>i)a.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var Ql=m("$ZodCheckMaxLength",(e,t)=>{var o;X.init(e,t),(o=e._zod.def).when??(o.when=(r)=>{let n=r.value;return!li(n)&&n.length!==void 0}),e._zod.onattach.push((r)=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<n)r._zod.bag.maximum=t.maximum}),e._zod.check=(r)=>{let n=r.value;if(n.length<=t.maximum)return;let a=di(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Xl=m("$ZodCheckMinLength",(e,t)=>{var o;X.init(e,t),(o=e._zod.def).when??(o.when=(r)=>{let n=r.value;return!li(n)&&n.length!==void 0}),e._zod.onattach.push((r)=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>n)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let n=r.value;if(n.length>=t.minimum)return;let a=di(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),eu=m("$ZodCheckLengthEquals",(e,t)=>{var o;X.init(e,t),(o=e._zod.def).when??(o.when=(r)=>{let n=r.value;return!li(n)&&n.length!==void 0}),e._zod.onattach.push((r)=>{let n=r._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=(r)=>{let n=r.value,i=n.length;if(i===t.length)return;let a=di(n),c=i>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ur=m("$ZodCheckStringFormat",(e,t)=>{var o,r;if(X.init(e,t),e._zod.onattach.push((n)=>{let i=n._zod.bag;if(i.format=t.format,t.pattern)i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern)}),t.pattern)(o=e._zod).check??(o.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(r=e._zod).check??(r.check=()=>{})}),tu=m("$ZodCheckRegex",(e,t)=>{Ur.init(e,t),e._zod.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ou=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Bl),Ur.init(e,t)}),ru=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Wl),Ur.init(e,t)}),nu=m("$ZodCheckIncludes",(e,t)=>{X.init(e,t);let o=We(t.includes),r=new RegExp(typeof t.position==="number"?`^.{${t.position}}${o}`:o);t.pattern=r,e._zod.onattach.push((n)=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),su=m("$ZodCheckStartsWith",(e,t)=>{X.init(e,t);let o=new RegExp(`^${We(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push((r)=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(o)}),e._zod.check=(r)=>{if(r.value.startsWith(t.prefix))return;r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),iu=m("$ZodCheckEndsWith",(e,t)=>{X.init(e,t);let o=new RegExp(`.*${We(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push((r)=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(o)}),e._zod.check=(r)=>{if(r.value.endsWith(t.suffix))return;r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});var au=m("$ZodCheckOverwrite",(e,t)=>{X.init(e,t),e._zod.check=(o)=>{o.value=t.tx(o.value)}});class Ta{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 o=e.split(`
2
+ `).filter((i)=>i),r=Math.min(...o.map((i)=>i.length-i.trimStart().length)),n=o.map((i)=>i.slice(r)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of n)this.content.push(i)}compile(){let e=Function,t=this?.args,r=[...(this?.content??[""]).map((n)=>` ${n}`)];return new e(...t,r.join(`
3
+ `))}}var lu={major:4,minor:4,patch:3};var A=m("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=lu;let r=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))r.unshift(e);for(let n of r)for(let i of n._zod.onattach)i(e);if(r.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,c,p)=>{let d=vt(a),f;for(let S of c){if(S._zod.def.when){if(al(a))continue;if(!S._zod.def.when(a))continue}else if(d)continue;let _=a.issues.length,b=S._zod.check(a);if(b instanceof Promise&&p?.async===!1)throw new Ie;if(f||b instanceof Promise)f=(f??Promise.resolve()).then(async()=>{if(await b,a.issues.length===_)return;if(!d)d=vt(a,_)});else{if(a.issues.length===_)continue;if(!d)d=vt(a,_)}}if(f)return f.then(()=>a);return a},i=(a,c,p)=>{if(vt(a))return a.aborted=!0,a;let d=n(c,r,p);if(d instanceof Promise){if(p.async===!1)throw new Ie;return d.then((f)=>e._zod.parse(f,p))}return e._zod.parse(d,p)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let d=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});if(d instanceof Promise)return d.then((f)=>i(f,a,c));return i(d,a,c)}let p=e._zod.parse(a,c);if(p instanceof Promise){if(c.async===!1)throw new Ie;return p.then((d)=>n(d,r,c))}return n(p,r,c)}}N(e,"~standard",()=>({validate:(n)=>{try{let i=ul(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return dl(e,n).then((a)=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Si=m("$ZodString",(e,t)=>{A.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Dl(e._zod.bag),e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=String(o.value)}catch(n){}if(typeof o.value==="string")return o;return o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),Z=m("$ZodStringFormat",(e,t)=>{Ur.init(e,t),Si.init(e,t)}),_u=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Tl),Z.init(e,t)}),bu=m("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=va(r))}else t.pattern??(t.pattern=va());Z.init(e,t)}),yu=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=kl),Z.init(e,t)}),zu=m("$ZodURL",(e,t)=>{Z.init(e,t),e._zod.check=(o)=>{try{let r=o.value.trim();if(!t.normalize&&t.protocol?.source===Ml.source){if(!/^https?:\/\//i.test(r)){o.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:o.value,inst:e,continue:!t.abort});return}}let n=new URL(r);if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(n.hostname))o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:o.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol))o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:o.value,inst:e,continue:!t.abort})}if(t.normalize)o.value=n.href;else o.value=r;return}catch(r){o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!t.abort})}}}),vu=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=El()),Z.init(e,t)}),Ru=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=xl),Z.init(e,t)}),wu=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=yl),Z.init(e,t)}),xu=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=zl),Z.init(e,t)}),Pu=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=vl),Z.init(e,t)}),Tu=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Rl),Z.init(e,t)}),ku=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=wl),Z.init(e,t)}),Eu=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Zl(t)),Z.init(e,t)}),$u=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=jl),Z.init(e,t)}),Cu=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ul(t)),Z.init(e,t)}),Iu=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Pl),Z.init(e,t)}),Ou=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=$l),Z.init(e,t),e._zod.bag.format="ipv4"}),Nu=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Cl),Z.init(e,t),e._zod.bag.format="ipv6",e._zod.check=(o)=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}});var Mu=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Il),Z.init(e,t)}),qu=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ol),Z.init(e,t),e._zod.check=(o)=>{let r=o.value.split("/");try{if(r.length!==2)throw Error();let[n,i]=r;if(!i)throw Error();let a=Number(i);if(`${a}`!==i)throw Error();if(a<0||a>128)throw Error();new URL(`http://[${n}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});function Au(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 ju=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Nl),Z.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(o)=>{if(Au(o.value))return;o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function km(e){if(!Ra.test(e))return!1;let t=e.replace(/[-_]/g,(r)=>r==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return Au(o)}var Lu=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ra),Z.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(o)=>{if(km(o.value))return;o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Uu=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ql),Z.init(e,t)});function Em(e,t=null){try{let o=e.split(".");if(o.length!==3)return!1;let[r]=o;if(!r)return!1;let n=JSON.parse(atob(r));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var Zu=m("$ZodJWT",(e,t)=>{Z.init(e,t),e._zod.check=(o)=>{if(Em(o.value,t.alg))return;o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}});var Ea=m("$ZodNumber",(e,t)=>{A.init(e,t),e._zod.pattern=e._zod.bag.pattern??wa,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=Number(o.value)}catch(a){}let n=o.value;if(typeof n==="number"&&!Number.isNaN(n)&&Number.isFinite(n))return o;let i=typeof n==="number"?Number.isNaN(n)?"NaN":!Number.isFinite(n)?"Infinity":void 0:void 0;return o.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),o}}),Du=m("$ZodNumberFormat",(e,t)=>{Yl.init(e,t),Ea.init(e,t)}),Vu=m("$ZodBoolean",(e,t)=>{A.init(e,t),e._zod.pattern=Hl,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=Boolean(o.value)}catch(i){}let n=o.value;if(typeof n==="boolean")return o;return o.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),o}});var Hu=m("$ZodUndefined",(e,t)=>{A.init(e,t),e._zod.pattern=Jl,e._zod.values=new Set([void 0]),e._zod.parse=(o,r)=>{let n=o.value;if(typeof n>"u")return o;return o.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),o}}),Fu=m("$ZodNull",(e,t)=>{A.init(e,t),e._zod.pattern=Fl,e._zod.values=new Set([null]),e._zod.parse=(o,r)=>{let n=o.value;if(n===null)return o;return o.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),o}}),Ju=m("$ZodAny",(e,t)=>{A.init(e,t),e._zod.parse=(o)=>o}),Bu=m("$ZodUnknown",(e,t)=>{A.init(e,t),e._zod.parse=(o)=>o}),Wu=m("$ZodNever",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)});function uu(e,t,o){if(e.issues.length)t.issues.push(...Ge(o,e.issues));t.value[o]=e.value}var Gu=m("$ZodArray",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!Array.isArray(n))return o.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),o;o.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let c=n[a],p=t.element._zod.run({value:c,issues:[]},r);if(p instanceof Promise)i.push(p.then((d)=>uu(d,o,a)));else uu(p,o,a)}if(i.length)return Promise.all(i).then(()=>o);return o}});function gi(e,t,o,r,n,i){let a=o in r;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...Ge(o,e.issues))}if(!a&&!n){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[o]});return}if(e.value===void 0){if(a)t.value[o]=void 0}else t.value[o]=e.value}function Ku(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let o=sl(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function Yu(e,t,o,r,n,i){let a=[],c=n.keySet,p=n.catchall._zod,d=p.def.type,f=p.optin==="optional",S=p.optout==="optional";for(let _ in t){if(_==="__proto__")continue;if(c.has(_))continue;if(d==="never"){a.push(_);continue}let b=p.run({value:t[_],issues:[]},r);if(b instanceof Promise)e.push(b.then((P)=>gi(P,o,_,t,f,S)));else gi(b,o,_,t,f,S)}if(a.length)o.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i});if(!e.length)return o;return Promise.all(e).then(()=>o)}var $m=m("$ZodObject",(e,t)=>{if(A.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:()=>{let p={...c};return Object.defineProperty(t,"shape",{value:p}),p}})}let r=qr(()=>Ku(t));N(e._zod,"propValues",()=>{let c=t.shape,p={};for(let d in c){let f=c[d]._zod;if(f.values){p[d]??(p[d]=new Set);for(let S of f.values)p[d].add(S)}}return p});let n=io,i=t.catchall,a;e._zod.parse=(c,p)=>{a??(a=r.value);let d=c.value;if(!n(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c;c.value={};let f=[],S=a.shape;for(let _ of a.keys){let b=S[_],P=b._zod.optin==="optional",k=b._zod.optout==="optional",E=b._zod.run({value:d[_],issues:[]},p);if(E instanceof Promise)f.push(E.then((I)=>gi(I,c,_,d,P,k)));else gi(E,c,_,d,P,k)}if(!i)return f.length?Promise.all(f).then(()=>c):c;return Yu(f,d,c,p,r.value,e)}}),Qu=m("$ZodObjectJIT",(e,t)=>{$m.init(e,t);let o=e._zod.parse,r=qr(()=>Ku(t)),n=(_)=>{let b=new Ta(["shape","payload","ctx"]),P=r.value,k=(M)=>{let q=fa(M);return`shape[${q}]._zod.run({ value: input[${q}], issues: [] }, ctx)`};b.write("const input = payload.value;");let E=Object.create(null),I=0;for(let M of P.keys)E[M]=`key_${I++}`;b.write("const newResult = {};");for(let M of P.keys){let q=E[M],V=fa(M),U=_[M],K=U?._zod?.optin==="optional",Ee=U?._zod?.optout==="optional";if(b.write(`const ${q} = ${k(M)};`),K&&Ee)b.write(`
4
+ if (${q}.issues.length) {
5
+ if (${V} in input) {
6
+ payload.issues = payload.issues.concat(${q}.issues.map(iss => ({
8
7
  ...iss,
9
- path: iss.path ? [${o}, ...iss.path] : [${o}]
8
+ path: iss.path ? [${V}, ...iss.path] : [${V}]
10
9
  })));
11
10
  }
12
11
  }
13
12
 
14
- if (${u}.value === undefined) {
15
- if (${o} in input) {
16
- newResult[${o}] = undefined;
13
+ if (${q}.value === undefined) {
14
+ if (${V} in input) {
15
+ newResult[${V}] = undefined;
17
16
  }
18
17
  } else {
19
- newResult[${o}] = ${u}.value;
18
+ newResult[${V}] = ${q}.value;
20
19
  }
21
20
 
22
- `);else if(!QQ)_.write(`
23
- const ${u}_present = ${o} in input;
24
- if (${u}.issues.length) {
25
- payload.issues = payload.issues.concat(${u}.issues.map(iss => ({
21
+ `);else if(!K)b.write(`
22
+ const ${q}_present = ${V} in input;
23
+ if (${q}.issues.length) {
24
+ payload.issues = payload.issues.concat(${q}.issues.map(iss => ({
26
25
  ...iss,
27
- path: iss.path ? [${o}, ...iss.path] : [${o}]
26
+ path: iss.path ? [${V}, ...iss.path] : [${V}]
28
27
  })));
29
28
  }
30
- if (!${u}_present && !${u}.issues.length) {
29
+ if (!${q}_present && !${q}.issues.length) {
31
30
  payload.issues.push({
32
31
  code: "invalid_type",
33
32
  expected: "nonoptional",
34
33
  input: undefined,
35
- path: [${o}]
34
+ path: [${V}]
36
35
  });
37
36
  }
38
37
 
39
- if (${u}_present) {
40
- if (${u}.value === undefined) {
41
- newResult[${o}] = undefined;
38
+ if (${q}_present) {
39
+ if (${q}.value === undefined) {
40
+ newResult[${V}] = undefined;
42
41
  } else {
43
- newResult[${o}] = ${u}.value;
42
+ newResult[${V}] = ${q}.value;
44
43
  }
45
44
  }
46
45
 
47
- `);else _.write(`
48
- if (${u}.issues.length) {
49
- payload.issues = payload.issues.concat(${u}.issues.map(iss => ({
46
+ `);else b.write(`
47
+ if (${q}.issues.length) {
48
+ payload.issues = payload.issues.concat(${q}.issues.map(iss => ({
50
49
  ...iss,
51
- path: iss.path ? [${o}, ...iss.path] : [${o}]
50
+ path: iss.path ? [${V}, ...iss.path] : [${V}]
52
51
  })));
53
52
  }
54
53
 
55
- if (${u}.value === undefined) {
56
- if (${o} in input) {
57
- newResult[${o}] = undefined;
54
+ if (${q}.value === undefined) {
55
+ if (${V} in input) {
56
+ newResult[${V}] = undefined;
58
57
  }
59
58
  } else {
60
- newResult[${o}] = ${u}.value;
59
+ newResult[${V}] = ${q}.value;
61
60
  }
62
61
 
63
- `)}_.write("payload.value = newResult;"),_.write("return payload;");let i=_.compile();return(f,u)=>i(O,f,u)},G,N=rH,X=!oH.jitless,E=X&&m8.value,w=H.catchall,q;Q._zod.parse=(O,_)=>{q??(q=Y.value);let I=O.value;if(!N(I))return O.issues.push({expected:"object",code:"invalid_type",input:I,inst:Q}),O;if(X&&E&&_?.async===!1&&_.jitless!==!0){if(!G)G=J(H.shape);if(O=G(O,_),!w)return O;return f5([],I,O,_,q,Q)}return W(O,_)}});function P5(Q,H,W,Y){for(let G of Q)if(G.issues.length===0)return H.value=G.value,H;let J=Q.filter((G)=>!qH(G));if(J.length===1)return H.value=J[0].value,J[0];return H.issues.push({code:"invalid_union",input:H.value,inst:W,errors:Q.map((G)=>G.issues.map((N)=>wQ(N,Y,s())))}),H}var n4=V("$ZodUnion",(Q,H)=>{g.init(Q,H),y(Q._zod,"optin",()=>H.options.some((Y)=>Y._zod.optin==="optional")?"optional":void 0),y(Q._zod,"optout",()=>H.options.some((Y)=>Y._zod.optout==="optional")?"optional":void 0),y(Q._zod,"values",()=>{if(H.options.every((Y)=>Y._zod.values))return new Set(H.options.flatMap((Y)=>Array.from(Y._zod.values)));return}),y(Q._zod,"pattern",()=>{if(H.options.every((Y)=>Y._zod.pattern)){let Y=H.options.map((J)=>J._zod.pattern);return new RegExp(`^(${Y.map((J)=>y4(J.source)).join("|")})$`)}return});let W=H.options.length===1?H.options[0]._zod.run:null;Q._zod.parse=(Y,J)=>{if(W)return W(Y,J);let G=!1,N=[];for(let X of H.options){let D=X._zod.run({value:Y.value,issues:[]},J);if(D instanceof Promise)N.push(D),G=!0;else{if(D.issues.length===0)return D;N.push(D)}}if(!G)return P5(N,Y,Q,J);return Promise.all(N).then((X)=>{return P5(X,Y,Q,J)})}});function Z5(Q,H,W,Y){let J=Q.filter((G)=>G.issues.length===0);if(J.length===1)return H.value=J[0].value,H;if(J.length===0)H.issues.push({code:"invalid_union",input:H.value,inst:W,errors:Q.map((G)=>G.issues.map((N)=>wQ(N,Y,s())))});else H.issues.push({code:"invalid_union",input:H.value,inst:W,errors:[],inclusive:!1});return H}var kJ=V("$ZodXor",(Q,H)=>{n4.init(Q,H),H.inclusive=!1;let W=H.options.length===1?H.options[0]._zod.run:null;Q._zod.parse=(Y,J)=>{if(W)return W(Y,J);let G=!1,N=[];for(let X of H.options){let D=X._zod.run({value:Y.value,issues:[]},J);if(D instanceof Promise)N.push(D),G=!0;else N.push(D)}if(!G)return Z5(N,Y,Q,J);return Promise.all(N).then((X)=>{return Z5(X,Y,Q,J)})}}),gJ=V("$ZodDiscriminatedUnion",(Q,H)=>{H.inclusive=!1,n4.init(Q,H);let W=Q._zod.parse;y(Q._zod,"propValues",()=>{let J={};for(let G of H.options){let N=G._zod.propValues;if(!N||Object.keys(N).length===0)throw Error(`Invalid discriminated union option at index "${H.options.indexOf(G)}"`);for(let[X,D]of Object.entries(N)){if(!J[X])J[X]=new Set;for(let E of D)J[X].add(E)}}return J});let Y=y0(()=>{let J=H.options,G=new Map;for(let N of J){let X=N._zod.propValues?.[H.discriminator];if(!X||X.size===0)throw Error(`Invalid discriminated union option at index "${H.options.indexOf(N)}"`);for(let D of X){if(G.has(D))throw Error(`Duplicate discriminator value "${String(D)}"`);G.set(D,N)}}return G});Q._zod.parse=(J,G)=>{let N=J.value;if(!rH(N))return J.issues.push({code:"invalid_type",expected:"object",input:N,inst:Q}),J;let X=Y.value.get(N?.[H.discriminator]);if(X)return X._zod.run(J,G);if(H.unionFallback||G.direction==="backward")return W(J,G);return J.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:H.discriminator,options:Array.from(Y.value.keys()),input:N,path:[H.discriminator],inst:Q}),J}}),xJ=V("$ZodIntersection",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value,G=H.left._zod.run({value:J,issues:[]},Y),N=H.right._zod.run({value:J,issues:[]},Y);if(G instanceof Promise||N instanceof Promise)return Promise.all([G,N]).then(([D,E])=>{return $5(W,D,E)});return $5(W,G,N)}});function n3(Q,H){if(Q===H)return{valid:!0,data:Q};if(Q instanceof Date&&H instanceof Date&&+Q===+H)return{valid:!0,data:Q};if(FH(Q)&&FH(H)){let W=Object.keys(H),Y=Object.keys(Q).filter((G)=>W.indexOf(G)!==-1),J={...Q,...H};for(let G of Y){let N=n3(Q[G],H[G]);if(!N.valid)return{valid:!1,mergeErrorPath:[G,...N.mergeErrorPath]};J[G]=N.data}return{valid:!0,data:J}}if(Array.isArray(Q)&&Array.isArray(H)){if(Q.length!==H.length)return{valid:!1,mergeErrorPath:[]};let W=[];for(let Y=0;Y<Q.length;Y++){let J=Q[Y],G=H[Y],N=n3(J,G);if(!N.valid)return{valid:!1,mergeErrorPath:[Y,...N.mergeErrorPath]};W.push(N.data)}return{valid:!0,data:W}}return{valid:!1,mergeErrorPath:[]}}function $5(Q,H,W){let Y=new Map,J;for(let X of H.issues)if(X.code==="unrecognized_keys"){J??(J=X);for(let D of X.keys){if(!Y.has(D))Y.set(D,{});Y.get(D).l=!0}}else Q.issues.push(X);for(let X of W.issues)if(X.code==="unrecognized_keys")for(let D of X.keys){if(!Y.has(D))Y.set(D,{});Y.get(D).r=!0}else Q.issues.push(X);let G=[...Y].filter(([,X])=>X.l&&X.r).map(([X])=>X);if(G.length&&J)Q.issues.push({...J,keys:G});if(qH(Q))return Q;let N=n3(H.value,W.value);if(!N.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(N.mergeErrorPath)}`);return Q.value=N.data,Q}var n6=V("$ZodTuple",(Q,H)=>{g.init(Q,H);let W=H.items;Q._zod.parse=(Y,J)=>{let G=Y.value;if(!Array.isArray(G))return Y.issues.push({input:G,inst:Q,expected:"tuple",code:"invalid_type"}),Y;Y.value=[];let N=[],X=I5(W,"optin"),D=I5(W,"optout");if(!H.rest){if(G.length<X)return Y.issues.push({code:"too_small",minimum:X,inclusive:!0,input:G,inst:Q,origin:"array"}),Y;if(G.length>W.length)Y.issues.push({code:"too_big",maximum:W.length,inclusive:!0,input:G,inst:Q,origin:"array"})}let E=Array(W.length);for(let w=0;w<W.length;w++){let q=W[w]._zod.run({value:G[w],issues:[]},J);if(q instanceof Promise)N.push(q.then((O)=>{E[w]=O}));else E[w]=q}if(H.rest){let w=W.length-1,q=G.slice(W.length);for(let O of q){w++;let _=H.rest._zod.run({value:O,issues:[]},J);if(_ instanceof Promise)N.push(_.then((I)=>L5(I,Y,w)));else L5(_,Y,w)}}if(N.length)return Promise.all(N).then(()=>T5(E,Y,W,G,D));return T5(E,Y,W,G,D)}});function I5(Q,H){for(let W=Q.length-1;W>=0;W--)if(Q[W]._zod[H]!=="optional")return W+1;return 0}function L5(Q,H,W){if(Q.issues.length)H.issues.push(...OQ(W,Q.issues));H.value[W]=Q.value}function T5(Q,H,W,Y,J){for(let G=0;G<W.length;G++){let N=Q[G],X=G<Y.length;if(N.issues.length){if(!X&&G>=J){H.value.length=G;break}H.issues.push(...OQ(G,N.issues))}H.value[G]=N.value}for(let G=H.value.length-1;G>=Y.length;G--)if(W[G]._zod.optout==="optional"&&H.value[G]===void 0)H.value.length=G;else break;return H}var vJ=V("$ZodRecord",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(!FH(J))return W.issues.push({expected:"record",code:"invalid_type",input:J,inst:Q}),W;let G=[],N=H.keyType._zod.values;if(N){W.value={};let X=new Set;for(let E of N)if(typeof E==="string"||typeof E==="number"||typeof E==="symbol"){X.add(typeof E==="number"?E.toString():E);let w=H.keyType._zod.run({value:E,issues:[]},Y);if(w instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(w.issues.length){W.issues.push({code:"invalid_key",origin:"record",issues:w.issues.map((_)=>wQ(_,Y,s())),input:E,path:[E],inst:Q});continue}let q=w.value,O=H.valueType._zod.run({value:J[E],issues:[]},Y);if(O instanceof Promise)G.push(O.then((_)=>{if(_.issues.length)W.issues.push(...OQ(E,_.issues));W.value[q]=_.value}));else{if(O.issues.length)W.issues.push(...OQ(E,O.issues));W.value[q]=O.value}}let D;for(let E in J)if(!X.has(E))D=D??[],D.push(E);if(D&&D.length>0)W.issues.push({code:"unrecognized_keys",input:J,inst:Q,keys:D})}else{W.value={};for(let X of Reflect.ownKeys(J)){if(X==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(J,X))continue;let D=H.keyType._zod.run({value:X,issues:[]},Y);if(D instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof X==="string"&&p4.test(X)&&D.issues.length){let q=H.keyType._zod.run({value:Number(X),issues:[]},Y);if(q instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(q.issues.length===0)D=q}if(D.issues.length){if(H.mode==="loose")W.value[X]=J[X];else W.issues.push({code:"invalid_key",origin:"record",issues:D.issues.map((q)=>wQ(q,Y,s())),input:X,path:[X],inst:Q});continue}let w=H.valueType._zod.run({value:J[X],issues:[]},Y);if(w instanceof Promise)G.push(w.then((q)=>{if(q.issues.length)W.issues.push(...OQ(X,q.issues));W.value[D.value]=q.value}));else{if(w.issues.length)W.issues.push(...OQ(X,w.issues));W.value[D.value]=w.value}}}if(G.length)return Promise.all(G).then(()=>W);return W}}),yJ=V("$ZodMap",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(!(J instanceof Map))return W.issues.push({expected:"map",code:"invalid_type",input:J,inst:Q}),W;let G=[];W.value=new Map;for(let[N,X]of J){let D=H.keyType._zod.run({value:N,issues:[]},Y),E=H.valueType._zod.run({value:X,issues:[]},Y);if(D instanceof Promise||E instanceof Promise)G.push(Promise.all([D,E]).then(([w,q])=>{j5(w,q,W,N,J,Q,Y)}));else j5(D,E,W,N,J,Q,Y)}if(G.length)return Promise.all(G).then(()=>W);return W}});function j5(Q,H,W,Y,J,G,N){if(Q.issues.length)if(h4.has(typeof Y))W.issues.push(...OQ(Y,Q.issues));else W.issues.push({code:"invalid_key",origin:"map",input:J,inst:G,issues:Q.issues.map((X)=>wQ(X,N,s()))});if(H.issues.length)if(h4.has(typeof Y))W.issues.push(...OQ(Y,H.issues));else W.issues.push({origin:"map",code:"invalid_element",input:J,inst:G,key:Y,issues:H.issues.map((X)=>wQ(X,N,s()))});W.value.set(Q.value,H.value)}var hJ=V("$ZodSet",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(!(J instanceof Set))return W.issues.push({input:J,inst:Q,expected:"set",code:"invalid_type"}),W;let G=[];W.value=new Set;for(let N of J){let X=H.valueType._zod.run({value:N,issues:[]},Y);if(X instanceof Promise)G.push(X.then((D)=>R5(D,W)));else R5(X,W)}if(G.length)return Promise.all(G).then(()=>W);return W}});function R5(Q,H){if(Q.issues.length)H.issues.push(...Q.issues);H.value.add(Q.value)}var fJ=V("$ZodEnum",(Q,H)=>{g.init(Q,H);let W=v4(H.entries),Y=new Set(W);Q._zod.values=Y,Q._zod.pattern=new RegExp(`^(${W.filter((J)=>h4.has(typeof J)).map((J)=>typeof J==="string"?TQ(J):J.toString()).join("|")})$`),Q._zod.parse=(J,G)=>{let N=J.value;if(Y.has(N))return J;return J.issues.push({code:"invalid_value",values:W,input:N,inst:Q}),J}}),uJ=V("$ZodLiteral",(Q,H)=>{if(g.init(Q,H),H.values.length===0)throw Error("Cannot create literal schema with no valid values");let W=new Set(H.values);Q._zod.values=W,Q._zod.pattern=new RegExp(`^(${H.values.map((Y)=>typeof Y==="string"?TQ(Y):Y?TQ(Y.toString()):String(Y)).join("|")})$`),Q._zod.parse=(Y,J)=>{let G=Y.value;if(W.has(G))return Y;return Y.issues.push({code:"invalid_value",values:H.values,input:G,inst:Q}),Y}}),lJ=V("$ZodFile",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W,Y)=>{let J=W.value;if(J instanceof File)return W;return W.issues.push({expected:"file",code:"invalid_type",input:J,inst:Q}),W}}),mJ=V("$ZodTransform",(Q,H)=>{g.init(Q,H),Q._zod.optin="optional",Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")throw new nH(Q.constructor.name);let J=H.transform(W.value,W);if(Y.async)return(J instanceof Promise?J:Promise.resolve(J)).then((N)=>{return W.value=N,W.fallback=!0,W});if(J instanceof Promise)throw new vQ;return W.value=J,W.fallback=!0,W}});function C5(Q,H){if(H===void 0&&(Q.issues.length||Q.fallback))return{issues:[],value:void 0};return Q}var r6=V("$ZodOptional",(Q,H)=>{g.init(Q,H),Q._zod.optin="optional",Q._zod.optout="optional",y(Q._zod,"values",()=>{return H.innerType._zod.values?new Set([...H.innerType._zod.values,void 0]):void 0}),y(Q._zod,"pattern",()=>{let W=H.innerType._zod.pattern;return W?new RegExp(`^(${y4(W.source)})?$`):void 0}),Q._zod.parse=(W,Y)=>{if(H.innerType._zod.optin==="optional"){let J=W.value,G=H.innerType._zod.run(W,Y);if(G instanceof Promise)return G.then((N)=>C5(N,J));return C5(G,J)}if(W.value===void 0)return W;return H.innerType._zod.run(W,Y)}}),cJ=V("$ZodExactOptional",(Q,H)=>{r6.init(Q,H),y(Q._zod,"values",()=>H.innerType._zod.values),y(Q._zod,"pattern",()=>H.innerType._zod.pattern),Q._zod.parse=(W,Y)=>{return H.innerType._zod.run(W,Y)}}),pJ=V("$ZodNullable",(Q,H)=>{g.init(Q,H),y(Q._zod,"optin",()=>H.innerType._zod.optin),y(Q._zod,"optout",()=>H.innerType._zod.optout),y(Q._zod,"pattern",()=>{let W=H.innerType._zod.pattern;return W?new RegExp(`^(${y4(W.source)}|null)$`):void 0}),y(Q._zod,"values",()=>{return H.innerType._zod.values?new Set([...H.innerType._zod.values,null]):void 0}),Q._zod.parse=(W,Y)=>{if(W.value===null)return W;return H.innerType._zod.run(W,Y)}}),dJ=V("$ZodDefault",(Q,H)=>{g.init(Q,H),Q._zod.optin="optional",y(Q._zod,"values",()=>H.innerType._zod.values),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")return H.innerType._zod.run(W,Y);if(W.value===void 0)return W.value=H.defaultValue,W;let J=H.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>S5(G,H));return S5(J,H)}});function S5(Q,H){if(Q.value===void 0)Q.value=H.defaultValue;return Q}var iJ=V("$ZodPrefault",(Q,H)=>{g.init(Q,H),Q._zod.optin="optional",y(Q._zod,"values",()=>H.innerType._zod.values),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")return H.innerType._zod.run(W,Y);if(W.value===void 0)W.value=H.defaultValue;return H.innerType._zod.run(W,Y)}}),oJ=V("$ZodNonOptional",(Q,H)=>{g.init(Q,H),y(Q._zod,"values",()=>{let W=H.innerType._zod.values;return W?new Set([...W].filter((Y)=>Y!==void 0)):void 0}),Q._zod.parse=(W,Y)=>{let J=H.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>k5(G,Q));return k5(J,Q)}});function k5(Q,H){if(!Q.issues.length&&Q.value===void 0)Q.issues.push({code:"invalid_type",expected:"nonoptional",input:Q.value,inst:H});return Q}var nJ=V("$ZodSuccess",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")throw new nH("ZodSuccess");let J=H.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>{return W.value=G.issues.length===0,W});return W.value=J.issues.length===0,W}}),rJ=V("$ZodCatch",(Q,H)=>{g.init(Q,H),Q._zod.optin="optional",y(Q._zod,"optout",()=>H.innerType._zod.optout),y(Q._zod,"values",()=>H.innerType._zod.values),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")return H.innerType._zod.run(W,Y);let J=H.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>{if(W.value=G.value,G.issues.length)W.value=H.catchValue({...W,error:{issues:G.issues.map((N)=>wQ(N,Y,s()))},input:W.value}),W.issues=[],W.fallback=!0;return W});if(W.value=J.value,J.issues.length)W.value=H.catchValue({...W,error:{issues:J.issues.map((G)=>wQ(G,Y,s()))},input:W.value}),W.issues=[],W.fallback=!0;return W}}),tJ=V("$ZodNaN",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W,Y)=>{if(typeof W.value!=="number"||!Number.isNaN(W.value))return W.issues.push({input:W.value,inst:Q,expected:"nan",code:"invalid_type"}),W;return W}}),t6=V("$ZodPipe",(Q,H)=>{g.init(Q,H),y(Q._zod,"values",()=>H.in._zod.values),y(Q._zod,"optin",()=>H.in._zod.optin),y(Q._zod,"optout",()=>H.out._zod.optout),y(Q._zod,"propValues",()=>H.in._zod.propValues),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward"){let G=H.out._zod.run(W,Y);if(G instanceof Promise)return G.then((N)=>m6(N,H.in,Y));return m6(G,H.in,Y)}let J=H.in._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>m6(G,H.out,Y));return m6(J,H.out,Y)}});function m6(Q,H,W){if(Q.issues.length)return Q.aborted=!0,Q;return H._zod.run({value:Q.value,issues:Q.issues,fallback:Q.fallback},W)}var r4=V("$ZodCodec",(Q,H)=>{g.init(Q,H),y(Q._zod,"values",()=>H.in._zod.values),y(Q._zod,"optin",()=>H.in._zod.optin),y(Q._zod,"optout",()=>H.out._zod.optout),y(Q._zod,"propValues",()=>H.in._zod.propValues),Q._zod.parse=(W,Y)=>{if((Y.direction||"forward")==="forward"){let G=H.in._zod.run(W,Y);if(G instanceof Promise)return G.then((N)=>c6(N,H,Y));return c6(G,H,Y)}else{let G=H.out._zod.run(W,Y);if(G instanceof Promise)return G.then((N)=>c6(N,H,Y));return c6(G,H,Y)}}});function c6(Q,H,W){if(Q.issues.length)return Q.aborted=!0,Q;if((W.direction||"forward")==="forward"){let J=H.transform(Q.value,Q);if(J instanceof Promise)return J.then((G)=>p6(Q,G,H.out,W));return p6(Q,J,H.out,W)}else{let J=H.reverseTransform(Q.value,Q);if(J instanceof Promise)return J.then((G)=>p6(Q,G,H.in,W));return p6(Q,J,H.in,W)}}function p6(Q,H,W,Y){if(Q.issues.length)return Q.aborted=!0,Q;return W._zod.run({value:H,issues:Q.issues},Y)}var sJ=V("$ZodPreprocess",(Q,H)=>{t6.init(Q,H)}),aJ=V("$ZodReadonly",(Q,H)=>{g.init(Q,H),y(Q._zod,"propValues",()=>H.innerType._zod.propValues),y(Q._zod,"values",()=>H.innerType._zod.values),y(Q._zod,"optin",()=>H.innerType?._zod?.optin),y(Q._zod,"optout",()=>H.innerType?._zod?.optout),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")return H.innerType._zod.run(W,Y);let J=H.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then(g5);return g5(J)}});function g5(Q){return Q.value=Object.freeze(Q.value),Q}var eJ=V("$ZodTemplateLiteral",(Q,H)=>{g.init(Q,H);let W=[];for(let Y of H.parts)if(typeof Y==="object"&&Y!==null){if(!Y._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...Y._zod.traits].shift()}`);let J=Y._zod.pattern instanceof RegExp?Y._zod.pattern.source:Y._zod.pattern;if(!J)throw Error(`Invalid template literal part: ${Y._zod.traits}`);let G=J.startsWith("^")?1:0,N=J.endsWith("$")?J.length-1:J.length;W.push(J.slice(G,N))}else if(Y===null||p8.has(typeof Y))W.push(TQ(`${Y}`));else throw Error(`Invalid template literal part: ${Y}`);Q._zod.pattern=new RegExp(`^${W.join("")}$`),Q._zod.parse=(Y,J)=>{if(typeof Y.value!=="string")return Y.issues.push({input:Y.value,inst:Q,expected:"string",code:"invalid_type"}),Y;if(Q._zod.pattern.lastIndex=0,!Q._zod.pattern.test(Y.value))return Y.issues.push({input:Y.value,inst:Q,code:"invalid_format",format:H.format??"template_literal",pattern:Q._zod.pattern.source}),Y;return Y}}),QG=V("$ZodFunction",(Q,H)=>{return g.init(Q,H),Q._def=H,Q._zod.def=H,Q.implement=(W)=>{if(typeof W!=="function")throw Error("implement() must be called with a function");return function(...Y){let J=Q._def.input?T6(Q._def.input,Y):Y,G=Reflect.apply(W,this,J);if(Q._def.output)return T6(Q._def.output,G);return G}},Q.implementAsync=(W)=>{if(typeof W!=="function")throw Error("implementAsync() must be called with a function");return async function(...Y){let J=Q._def.input?await j6(Q._def.input,Y):Y,G=await Reflect.apply(W,this,J);if(Q._def.output)return await j6(Q._def.output,G);return G}},Q._zod.parse=(W,Y)=>{if(typeof W.value!=="function")return W.issues.push({code:"invalid_type",expected:"function",input:W.value,inst:Q}),W;if(Q._def.output&&Q._def.output._zod.def.type==="promise")W.value=Q.implementAsync(W.value);else W.value=Q.implement(W.value);return W},Q.input=(...W)=>{let Y=Q.constructor;if(Array.isArray(W[0]))return new Y({type:"function",input:new n6({type:"tuple",items:W[0],rest:W[1]}),output:Q._def.output});return new Y({type:"function",input:W[0],output:Q._def.output})},Q.output=(W)=>{return new Q.constructor({type:"function",input:Q._def.input,output:W})},Q}),HG=V("$ZodPromise",(Q,H)=>{g.init(Q,H),Q._zod.parse=(W,Y)=>{return Promise.resolve(W.value).then((J)=>H.innerType._zod.run({value:J,issues:[]},Y))}}),WG=V("$ZodLazy",(Q,H)=>{g.init(Q,H),y(Q._zod,"innerType",()=>{let W=H;if(!W._cachedInner)W._cachedInner=H.getter();return W._cachedInner}),y(Q._zod,"pattern",()=>Q._zod.innerType?._zod?.pattern),y(Q._zod,"propValues",()=>Q._zod.innerType?._zod?.propValues),y(Q._zod,"optin",()=>Q._zod.innerType?._zod?.optin??void 0),y(Q._zod,"optout",()=>Q._zod.innerType?._zod?.optout??void 0),Q._zod.parse=(W,Y)=>{return Q._zod.innerType._zod.run(W,Y)}}),YG=V("$ZodCustom",(Q,H)=>{p.init(Q,H),g.init(Q,H),Q._zod.parse=(W,Y)=>{return W},Q._zod.check=(W)=>{let Y=W.value,J=H.fn(Y);if(J instanceof Promise)return J.then((G)=>x5(G,W,Y,Q));x5(J,W,Y,Q);return}});function x5(Q,H,W,Y){if(!Q){let J={code:"custom",input:W,inst:Y,path:[...Y._zod.def.path??[]],continue:!Y._zod.def.abort};if(Y._zod.def.params)J.params=Y._zod.def.params;H.issues.push(h0(J))}}var s4={};tQ(s4,{en:()=>t4});var gK=()=>{let Q={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 H(J){return Q[J]??null}let W={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"},Y={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let G=Y[J.expected]??J.expected,N=r8(J.input),X=Y[N]??N;return`Invalid input: expected ${G}, received ${X}`}case"invalid_value":if(J.values.length===1)return`Invalid input: expected ${L6(J.values[0])}`;return`Invalid option: expected one of ${Z6(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",N=H(J.origin);if(N)return`Too big: expected ${J.origin??"value"} to have ${G}${J.maximum.toString()} ${N.unit??"elements"}`;return`Too big: expected ${J.origin??"value"} to be ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",N=H(J.origin);if(N)return`Too small: expected ${J.origin} to have ${G}${J.minimum.toString()} ${N.unit}`;return`Too small: expected ${J.origin} to be ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Invalid string: must start with "${G.prefix}"`;if(G.format==="ends_with")return`Invalid string: must end with "${G.suffix}"`;if(G.format==="includes")return`Invalid string: must include "${G.includes}"`;if(G.format==="regex")return`Invalid string: must match pattern ${G.pattern}`;return`Invalid ${W[G.format]??J.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${J.divisor}`;case"unrecognized_keys":return`Unrecognized key${J.keys.length>1?"s":""}: ${Z6(J.keys,", ")}`;case"invalid_key":return`Invalid key in ${J.origin}`;case"invalid_union":if(J.options&&Array.isArray(J.options)&&J.options.length>0)return`Invalid discriminator value. Expected ${J.options.map((N)=>`'${N}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${J.origin}`;default:return"Invalid input"}}};function t4(){return{localeError:gK()}}var l5,JG=Symbol("ZodOutput"),GG=Symbol("ZodInput");class NG{constructor(){this._map=new WeakMap,this._idmap=new Map}add(Q,...H){let W=H[0];if(this._map.set(Q,W),W&&typeof W==="object"&&"id"in W)this._idmap.set(W.id,Q);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(Q){let H=this._map.get(Q);if(H&&typeof H==="object"&&"id"in H)this._idmap.delete(H.id);return this._map.delete(Q),this}get(Q){let H=Q._zod.parent;if(H){let W={...this.get(H)??{}};delete W.id;let Y={...W,...this._map.get(Q)};return Object.keys(Y).length?Y:void 0}return this._map.get(Q)}has(Q){return this._map.has(Q)}}function s6(){return new NG}(l5=globalThis).__zod_globalRegistry??(l5.__zod_globalRegistry=s6());var YQ=globalThis.__zod_globalRegistry;function BG(Q,H){return new Q({type:"string",...z(H)})}function XG(Q,H){return new Q({type:"string",coerce:!0,...z(H)})}function a6(Q,H){return new Q({type:"string",format:"email",check:"string_format",abort:!1,...z(H)})}function a4(Q,H){return new Q({type:"string",format:"guid",check:"string_format",abort:!1,...z(H)})}function e6(Q,H){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,...z(H)})}function QY(Q,H){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(H)})}function HY(Q,H){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(H)})}function WY(Q,H){return new Q({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(H)})}function e4(Q,H){return new Q({type:"string",format:"url",check:"string_format",abort:!1,...z(H)})}function YY(Q,H){return new Q({type:"string",format:"emoji",check:"string_format",abort:!1,...z(H)})}function JY(Q,H){return new Q({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(H)})}function GY(Q,H){return new Q({type:"string",format:"cuid",check:"string_format",abort:!1,...z(H)})}function NY(Q,H){return new Q({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(H)})}function BY(Q,H){return new Q({type:"string",format:"ulid",check:"string_format",abort:!1,...z(H)})}function XY(Q,H){return new Q({type:"string",format:"xid",check:"string_format",abort:!1,...z(H)})}function DY(Q,H){return new Q({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(H)})}function KY(Q,H){return new Q({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(H)})}function EY(Q,H){return new Q({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(H)})}function DG(Q,H){return new Q({type:"string",format:"mac",check:"string_format",abort:!1,...z(H)})}function MY(Q,H){return new Q({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(H)})}function VY(Q,H){return new Q({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(H)})}function wY(Q,H){return new Q({type:"string",format:"base64",check:"string_format",abort:!1,...z(H)})}function AY(Q,H){return new Q({type:"string",format:"base64url",check:"string_format",abort:!1,...z(H)})}function FY(Q,H){return new Q({type:"string",format:"e164",check:"string_format",abort:!1,...z(H)})}function qY(Q,H){return new Q({type:"string",format:"jwt",check:"string_format",abort:!1,...z(H)})}var KG={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function EG(Q,H){return new Q({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(H)})}function MG(Q,H){return new Q({type:"string",format:"date",check:"string_format",...z(H)})}function VG(Q,H){return new Q({type:"string",format:"time",check:"string_format",precision:null,...z(H)})}function wG(Q,H){return new Q({type:"string",format:"duration",check:"string_format",...z(H)})}function AG(Q,H){return new Q({type:"number",checks:[],...z(H)})}function FG(Q,H){return new Q({type:"number",coerce:!0,checks:[],...z(H)})}function qG(Q,H){return new Q({type:"number",check:"number_format",abort:!1,format:"safeint",...z(H)})}function OG(Q,H){return new Q({type:"number",check:"number_format",abort:!1,format:"float32",...z(H)})}function _G(Q,H){return new Q({type:"number",check:"number_format",abort:!1,format:"float64",...z(H)})}function UG(Q,H){return new Q({type:"number",check:"number_format",abort:!1,format:"int32",...z(H)})}function zG(Q,H){return new Q({type:"number",check:"number_format",abort:!1,format:"uint32",...z(H)})}function bG(Q,H){return new Q({type:"boolean",...z(H)})}function PG(Q,H){return new Q({type:"boolean",coerce:!0,...z(H)})}function ZG(Q,H){return new Q({type:"bigint",...z(H)})}function $G(Q,H){return new Q({type:"bigint",coerce:!0,...z(H)})}function IG(Q,H){return new Q({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(H)})}function LG(Q,H){return new Q({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(H)})}function TG(Q,H){return new Q({type:"symbol",...z(H)})}function jG(Q,H){return new Q({type:"undefined",...z(H)})}function RG(Q,H){return new Q({type:"null",...z(H)})}function CG(Q){return new Q({type:"any"})}function SG(Q){return new Q({type:"unknown"})}function kG(Q,H){return new Q({type:"never",...z(H)})}function gG(Q,H){return new Q({type:"void",...z(H)})}function xG(Q,H){return new Q({type:"date",...z(H)})}function vG(Q,H){return new Q({type:"date",coerce:!0,...z(H)})}function yG(Q,H){return new Q({type:"nan",...z(H)})}function yQ(Q,H){return new f6({check:"less_than",...z(H),value:Q,inclusive:!1})}function ZQ(Q,H){return new f6({check:"less_than",...z(H),value:Q,inclusive:!0})}function hQ(Q,H){return new u6({check:"greater_than",...z(H),value:Q,inclusive:!1})}function AQ(Q,H){return new u6({check:"greater_than",...z(H),value:Q,inclusive:!0})}function OY(Q){return hQ(0,Q)}function _Y(Q){return yQ(0,Q)}function UY(Q){return ZQ(0,Q)}function zY(Q){return AQ(0,Q)}function OH(Q,H){return new j3({check:"multiple_of",...z(H),value:Q})}function _H(Q,H){return new S3({check:"max_size",...z(H),maximum:Q})}function fQ(Q,H){return new k3({check:"min_size",...z(H),minimum:Q})}function aH(Q,H){return new g3({check:"size_equals",...z(H),size:Q})}function eH(Q,H){return new x3({check:"max_length",...z(H),maximum:Q})}function aQ(Q,H){return new v3({check:"min_length",...z(H),minimum:Q})}function Q0(Q,H){return new y3({check:"length_equals",...z(H),length:Q})}function p0(Q,H){return new h3({check:"string_format",format:"regex",...z(H),pattern:Q})}function d0(Q){return new f3({check:"string_format",format:"lowercase",...z(Q)})}function i0(Q){return new u3({check:"string_format",format:"uppercase",...z(Q)})}function o0(Q,H){return new l3({check:"string_format",format:"includes",...z(H),includes:Q})}function n0(Q,H){return new m3({check:"string_format",format:"starts_with",...z(H),prefix:Q})}function r0(Q,H){return new c3({check:"string_format",format:"ends_with",...z(H),suffix:Q})}function bY(Q,H,W){return new p3({check:"property",property:Q,schema:H,...z(W)})}function t0(Q,H){return new d3({check:"mime_type",mime:Q,...z(H)})}function CQ(Q){return new i3({check:"overwrite",tx:Q})}function s0(Q){return CQ((H)=>H.normalize(Q))}function a0(){return CQ((Q)=>Q.trim())}function e0(){return CQ((Q)=>Q.toLowerCase())}function QW(){return CQ((Q)=>Q.toUpperCase())}function HW(){return CQ((Q)=>l8(Q))}function hG(Q,H,W){return new Q({type:"array",element:H,...z(W)})}function vK(Q,H,W){return new Q({type:"union",options:H,...z(W)})}function yK(Q,H,W){return new Q({type:"union",options:H,inclusive:!1,...z(W)})}function hK(Q,H,W,Y){return new Q({type:"union",options:W,discriminator:H,...z(Y)})}function fK(Q,H,W){return new Q({type:"intersection",left:H,right:W})}function uK(Q,H,W,Y){let J=W instanceof g;return new Q({type:"tuple",items:H,rest:J?W:null,...z(J?Y:W)})}function lK(Q,H,W,Y){return new Q({type:"record",keyType:H,valueType:W,...z(Y)})}function mK(Q,H,W,Y){return new Q({type:"map",keyType:H,valueType:W,...z(Y)})}function cK(Q,H,W){return new Q({type:"set",valueType:H,...z(W)})}function pK(Q,H,W){let Y=Array.isArray(H)?Object.fromEntries(H.map((J)=>[J,J])):H;return new Q({type:"enum",entries:Y,...z(W)})}function dK(Q,H,W){return new Q({type:"enum",entries:H,...z(W)})}function iK(Q,H,W){return new Q({type:"literal",values:Array.isArray(H)?H:[H],...z(W)})}function fG(Q,H){return new Q({type:"file",...z(H)})}function oK(Q,H){return new Q({type:"transform",transform:H})}function nK(Q,H){return new Q({type:"optional",innerType:H})}function rK(Q,H){return new Q({type:"nullable",innerType:H})}function tK(Q,H,W){return new Q({type:"default",innerType:H,get defaultValue(){return typeof W==="function"?W():c8(W)}})}function sK(Q,H,W){return new Q({type:"nonoptional",innerType:H,...z(W)})}function aK(Q,H){return new Q({type:"success",innerType:H})}function eK(Q,H,W){return new Q({type:"catch",innerType:H,catchValue:typeof W==="function"?W:()=>W})}function Q2(Q,H,W){return new Q({type:"pipe",in:H,out:W})}function H2(Q,H){return new Q({type:"readonly",innerType:H})}function W2(Q,H,W){return new Q({type:"template_literal",parts:H,...z(W)})}function Y2(Q,H){return new Q({type:"lazy",getter:H})}function J2(Q,H){return new Q({type:"promise",innerType:H})}function uG(Q,H,W){let Y=z(W);return Y.abort??(Y.abort=!0),new Q({type:"custom",check:"custom",fn:H,...Y})}function lG(Q,H,W){return new Q({type:"custom",check:"custom",fn:H,...z(W)})}function mG(Q,H){let W=m5((Y)=>{return Y.addIssue=(J)=>{if(typeof J==="string")Y.issues.push(h0(J,Y.value,W._zod.def));else{let G=J;if(G.fatal)G.continue=!1;G.code??(G.code="custom"),G.input??(G.input=Y.value),G.inst??(G.inst=W),G.continue??(G.continue=!W._zod.def.abort),Y.issues.push(h0(G))}},Q(Y.value,Y)},H);return W}function m5(Q,H){let W=new p({check:"custom",...z(H)});return W._zod.check=Q,W}function cG(Q){let H=new p({check:"describe"});return H._zod.onattach=[(W)=>{let Y=YQ.get(W)??{};YQ.add(W,{...Y,description:Q})}],H._zod.check=()=>{},H}function pG(Q){let H=new p({check:"meta"});return H._zod.onattach=[(W)=>{let Y=YQ.get(W)??{};YQ.add(W,{...Y,...Q})}],H._zod.check=()=>{},H}function dG(Q,H){let W=z(H),Y=W.truthy??["true","1","yes","on","y","enabled"],J=W.falsy??["false","0","no","off","n","disabled"];if(W.case!=="sensitive")Y=Y.map((_)=>typeof _==="string"?_.toLowerCase():_),J=J.map((_)=>typeof _==="string"?_.toLowerCase():_);let G=new Set(Y),N=new Set(J),X=Q.Codec??r4,D=Q.Boolean??o4,w=new(Q.String??sH)({type:"string",error:W.error}),q=new D({type:"boolean",error:W.error}),O=new X({type:"pipe",in:w,out:q,transform:(_,I)=>{let j=_;if(W.case!=="sensitive")j=j.toLowerCase();if(G.has(j))return!0;else if(N.has(j))return!1;else return I.issues.push({code:"invalid_value",expected:"stringbool",values:[...G,...N],input:I.value,inst:O,continue:!1}),{}},reverseTransform:(_,I)=>{if(_===!0)return Y[0]||"true";else return J[0]||"false"},error:W.error});return O}function WW(Q,H,W,Y={}){let J=z(Y),G={...z(Y),check:"string_format",type:"string",format:H,fn:typeof W==="function"?W:(X)=>W.test(X),...J};if(W instanceof RegExp)G.pattern=W;return new Q(G)}function UH(Q){let H=Q?.target??"draft-2020-12";if(H==="draft-4")H="draft-04";if(H==="draft-7")H="draft-07";return{processors:Q.processors??{},metadataRegistry:Q?.metadata??YQ,target:H,unrepresentable:Q?.unrepresentable??"throw",override:Q?.override??(()=>{}),io:Q?.io??"output",counter:0,seen:new Map,cycles:Q?.cycles??"ref",reused:Q?.reused??"inline",external:Q?.external??void 0}}function l(Q,H,W={path:[],schemaPath:[]}){var Y;let J=Q._zod.def,G=H.seen.get(Q);if(G){if(G.count++,W.schemaPath.includes(Q))G.cycle=W.path;return G.schema}let N={schema:{},count:1,cycle:void 0,path:W.path};H.seen.set(Q,N);let X=Q._zod.toJSONSchema?.();if(X)N.schema=X;else{let w={...W,schemaPath:[...W.schemaPath,Q],path:W.path};if(Q._zod.processJSONSchema)Q._zod.processJSONSchema(H,N.schema,w);else{let O=N.schema,_=H.processors[J.type];if(!_)throw Error(`[toJSONSchema]: Non-representable type encountered: ${J.type}`);_(Q,H,O,w)}let q=Q._zod.parent;if(q){if(!N.ref)N.ref=q;l(q,H,w),H.seen.get(q).isParent=!0}}let D=H.metadataRegistry.get(Q);if(D)Object.assign(N.schema,D);if(H.io==="input"&&FQ(Q))delete N.schema.examples,delete N.schema.default;if(H.io==="input"&&"_prefault"in N.schema)(Y=N.schema).default??(Y.default=N.schema._prefault);return delete N.schema._prefault,H.seen.get(Q).schema}function zH(Q,H){let W=Q.seen.get(H);if(!W)throw Error("Unprocessed schema. This is a bug in Zod.");let Y=new Map;for(let N of Q.seen.entries()){let X=Q.metadataRegistry.get(N[0])?.id;if(X){let D=Y.get(X);if(D&&D!==N[0])throw Error(`Duplicate schema id "${X}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);Y.set(X,N[0])}}let J=(N)=>{let X=Q.target==="draft-2020-12"?"$defs":"definitions";if(Q.external){let q=Q.external.registry.get(N[0])?.id,O=Q.external.uri??((I)=>I);if(q)return{ref:O(q)};let _=N[1].defId??N[1].schema.id??`schema${Q.counter++}`;return N[1].defId=_,{defId:_,ref:`${O("__shared")}#/${X}/${_}`}}if(N[1]===W)return{ref:"#"};let E=`${"#"}/${X}/`,w=N[1].schema.id??`__schema${Q.counter++}`;return{defId:w,ref:E+w}},G=(N)=>{if(N[1].schema.$ref)return;let X=N[1],{ref:D,defId:E}=J(N);if(X.def={...X.schema},E)X.defId=E;let w=X.schema;for(let q in w)delete w[q];w.$ref=D};if(Q.cycles==="throw")for(let N of Q.seen.entries()){let X=N[1];if(X.cycle)throw Error(`Cycle detected: #/${X.cycle?.join("/")}/<root>
62
+ `)}b.write("payload.value = newResult;"),b.write("return payload;");let D=b.compile();return(M,q)=>D(_,M,q)},i,a=io,c=!so.jitless,d=c&&rl.value,f=t.catchall,S;e._zod.parse=(_,b)=>{S??(S=r.value);let P=_.value;if(!a(P))return _.issues.push({expected:"object",code:"invalid_type",input:P,inst:e}),_;if(c&&d&&b?.async===!1&&b.jitless!==!0){if(!i)i=n(t.shape);if(_=i(_,b),!f)return _;return Yu([],P,_,b,S,e)}return o(_,b)}});function du(e,t,o,r){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter((i)=>!vt(i));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map((i)=>i.issues.map((a)=>be(a,r,ce())))}),t}var $a=m("$ZodUnion",(e,t)=>{A.init(e,t),N(e._zod,"optin",()=>t.options.some((r)=>r._zod.optin==="optional")?"optional":void 0),N(e._zod,"optout",()=>t.options.some((r)=>r._zod.optout==="optional")?"optional":void 0),N(e._zod,"values",()=>{if(t.options.every((r)=>r._zod.values))return new Set(t.options.flatMap((r)=>Array.from(r._zod.values)));return}),N(e._zod,"pattern",()=>{if(t.options.every((r)=>r._zod.pattern)){let r=t.options.map((n)=>n._zod.pattern);return new RegExp(`^(${r.map((n)=>ui(n.source)).join("|")})$`)}return});let o=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,n)=>{if(o)return o(r,n);let i=!1,a=[];for(let c of t.options){let p=c._zod.run({value:r.value,issues:[]},n);if(p instanceof Promise)a.push(p),i=!0;else{if(p.issues.length===0)return p;a.push(p)}}if(!i)return du(a,r,e,n);return Promise.all(a).then((c)=>du(c,r,e,n))}});var Xu=m("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,$a.init(e,t);let o=e._zod.parse;N(e._zod,"propValues",()=>{let n={};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[c,p]of Object.entries(a)){if(!n[c])n[c]=new Set;for(let d of p)n[c].add(d)}}return n});let r=qr(()=>{let n=t.options,i=new Map;for(let a of n){let c=a._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let p of c){if(i.has(p))throw Error(`Duplicate discriminator value "${String(p)}"`);i.set(p,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!io(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let c=r.value.get(a?.[t.discriminator]);if(c)return c._zod.run(n,i);if(t.unionFallback||i.direction==="backward")return o(n,i);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:a,path:[t.discriminator],inst:e}),n}}),ed=m("$ZodIntersection",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>{let n=o.value,i=t.left._zod.run({value:n,issues:[]},r),a=t.right._zod.run({value:n,issues:[]},r);if(i instanceof Promise||a instanceof Promise)return Promise.all([i,a]).then(([p,d])=>pu(o,p,d));return pu(o,i,a)}});function ka(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(zt(e)&&zt(t)){let o=Object.keys(t),r=Object.keys(e).filter((i)=>o.indexOf(i)!==-1),n={...e,...t};for(let i of r){let a=ka(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let o=[];for(let r=0;r<e.length;r++){let n=e[r],i=t[r],a=ka(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};o.push(a.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function pu(e,t,o){let r=new Map,n;for(let c of t.issues)if(c.code==="unrecognized_keys"){n??(n=c);for(let p of c.keys){if(!r.has(p))r.set(p,{});r.get(p).l=!0}}else e.issues.push(c);for(let c of o.issues)if(c.code==="unrecognized_keys")for(let p of c.keys){if(!r.has(p))r.set(p,{});r.get(p).r=!0}else e.issues.push(c);let i=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(i.length&&n)e.issues.push({...n,keys:i});if(vt(e))return e;let a=ka(t.value,o.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var td=m("$ZodRecord",(e,t)=>{A.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!zt(n))return o.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),o;let i=[],a=t.keyType._zod.values;if(a){o.value={};let c=new Set;for(let d of a)if(typeof d==="string"||typeof d==="number"||typeof d==="symbol"){c.add(typeof d==="number"?d.toString():d);let f=t.keyType._zod.run({value:d,issues:[]},r);if(f instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(f.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map((b)=>be(b,r,ce())),input:d,path:[d],inst:e});continue}let S=f.value,_=t.valueType._zod.run({value:n[d],issues:[]},r);if(_ instanceof Promise)i.push(_.then((b)=>{if(b.issues.length)o.issues.push(...Ge(d,b.issues));o.value[S]=b.value}));else{if(_.issues.length)o.issues.push(...Ge(d,_.issues));o.value[S]=_.value}}let p;for(let d in n)if(!c.has(d))p=p??[],p.push(d);if(p&&p.length>0)o.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:p})}else{o.value={};for(let c of Reflect.ownKeys(n)){if(c==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(n,c))continue;let p=t.keyType._zod.run({value:c,issues:[]},r);if(p instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof c==="string"&&wa.test(c)&&p.issues.length){let S=t.keyType._zod.run({value:Number(c),issues:[]},r);if(S instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(S.issues.length===0)p=S}if(p.issues.length){if(t.mode==="loose")o.value[c]=n[c];else o.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map((S)=>be(S,r,ce())),input:c,path:[c],inst:e});continue}let f=t.valueType._zod.run({value:n[c],issues:[]},r);if(f instanceof Promise)i.push(f.then((S)=>{if(S.issues.length)o.issues.push(...Ge(c,S.issues));o.value[p.value]=S.value}));else{if(f.issues.length)o.issues.push(...Ge(c,f.issues));o.value[p.value]=f.value}}}if(i.length)return Promise.all(i).then(()=>o);return o}});var od=m("$ZodEnum",(e,t)=>{A.init(e,t);let o=ci(t.entries),r=new Set(o);e._zod.values=r,e._zod.pattern=new RegExp(`^(${o.filter((n)=>nl.has(typeof n)).map((n)=>typeof n==="string"?We(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;if(r.has(a))return n;return n.issues.push({code:"invalid_value",values:o,input:a,inst:e}),n}}),rd=m("$ZodLiteral",(e,t)=>{if(A.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let o=new Set(t.values);e._zod.values=o,e._zod.pattern=new RegExp(`^(${t.values.map((r)=>typeof r==="string"?We(r):r?We(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let i=r.value;if(o.has(i))return r;return r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}});var nd=m("$ZodTransform",(e,t)=>{A.init(e,t),e._zod.optin="optional",e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new Nr(e.constructor.name);let n=t.transform(o.value,o);if(r.async)return(n instanceof Promise?n:Promise.resolve(n)).then((a)=>(o.value=a,o.fallback=!0,o));if(n instanceof Promise)throw new Ie;return o.value=n,o.fallback=!0,o}});function hu(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var Ca=m("$ZodOptional",(e,t)=>{A.init(e,t),e._zod.optin="optional",e._zod.optout="optional",N(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),N(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${ui(o.source)})?$`):void 0}),e._zod.parse=(o,r)=>{if(t.innerType._zod.optin==="optional"){let n=o.value,i=t.innerType._zod.run(o,r);if(i instanceof Promise)return i.then((a)=>hu(a,n));return hu(i,n)}if(o.value===void 0)return o;return t.innerType._zod.run(o,r)}}),sd=m("$ZodExactOptional",(e,t)=>{Ca.init(e,t),N(e._zod,"values",()=>t.innerType._zod.values),N(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(o,r)=>t.innerType._zod.run(o,r)}),id=m("$ZodNullable",(e,t)=>{A.init(e,t),N(e._zod,"optin",()=>t.innerType._zod.optin),N(e._zod,"optout",()=>t.innerType._zod.optout),N(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${ui(o.source)}|null)$`):void 0}),N(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,r)=>{if(o.value===null)return o;return t.innerType._zod.run(o,r)}}),ad=m("$ZodDefault",(e,t)=>{A.init(e,t),e._zod.optin="optional",N(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);if(o.value===void 0)return o.value=t.defaultValue,o;let n=t.innerType._zod.run(o,r);if(n instanceof Promise)return n.then((i)=>mu(i,t));return mu(n,t)}});function mu(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var cd=m("$ZodPrefault",(e,t)=>{A.init(e,t),e._zod.optin="optional",N(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);if(o.value===void 0)o.value=t.defaultValue;return t.innerType._zod.run(o,r)}}),ld=m("$ZodNonOptional",(e,t)=>{A.init(e,t),N(e._zod,"values",()=>{let o=t.innerType._zod.values;return o?new Set([...o].filter((r)=>r!==void 0)):void 0}),e._zod.parse=(o,r)=>{let n=t.innerType._zod.run(o,r);if(n instanceof Promise)return n.then((i)=>fu(i,e));return fu(n,e)}});function fu(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 ud=m("$ZodCatch",(e,t)=>{A.init(e,t),e._zod.optin="optional",N(e._zod,"optout",()=>t.innerType._zod.optout),N(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);let n=t.innerType._zod.run(o,r);if(n instanceof Promise)return n.then((i)=>{if(o.value=i.value,i.issues.length)o.value=t.catchValue({...o,error:{issues:i.issues.map((a)=>be(a,r,ce()))},input:o.value}),o.issues=[],o.fallback=!0;return o});if(o.value=n.value,n.issues.length)o.value=t.catchValue({...o,error:{issues:n.issues.map((i)=>be(i,r,ce()))},input:o.value}),o.issues=[],o.fallback=!0;return o}});var Ia=m("$ZodPipe",(e,t)=>{A.init(e,t),N(e._zod,"values",()=>t.in._zod.values),N(e._zod,"optin",()=>t.in._zod.optin),N(e._zod,"optout",()=>t.out._zod.optout),N(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,r)=>{if(r.direction==="backward"){let i=t.out._zod.run(o,r);if(i instanceof Promise)return i.then((a)=>fi(a,t.in,r));return fi(i,t.in,r)}let n=t.in._zod.run(o,r);if(n instanceof Promise)return n.then((i)=>fi(i,t.out,r));return fi(n,t.out,r)}});function fi(e,t,o){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},o)}var dd=m("$ZodPreprocess",(e,t)=>{Ia.init(e,t)}),pd=m("$ZodReadonly",(e,t)=>{A.init(e,t),N(e._zod,"propValues",()=>t.innerType._zod.propValues),N(e._zod,"values",()=>t.innerType._zod.values),N(e._zod,"optin",()=>t.innerType?._zod?.optin),N(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);let n=t.innerType._zod.run(o,r);if(n instanceof Promise)return n.then(gu);return gu(n)}});function gu(e){return e.value=Object.freeze(e.value),e}var hd=m("$ZodLazy",(e,t)=>{A.init(e,t),N(e._zod,"innerType",()=>{let o=t;if(!o._cachedInner)o._cachedInner=t.getter();return o._cachedInner}),N(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),N(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),N(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),N(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(o,r)=>e._zod.innerType._zod.run(o,r)}),md=m("$ZodCustom",(e,t)=>{X.init(e,t),A.init(e,t),e._zod.parse=(o,r)=>o,e._zod.check=(o)=>{let r=o.value,n=t.fn(r);if(n instanceof Promise)return n.then((i)=>Su(i,o,r,e));Su(n,o,r,e);return}});function Su(e,t,o,r){if(!e){let n={code:"custom",input:o,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};if(r._zod.def.params)n.params=r._zod.def.params;t.issues.push(Rt(n))}}var Cm=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let o={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"},r={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let i=r[n.expected]??n.expected,a=cl(n.input),c=r[a]??a;return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${_a(n.values[0])}`;return`Invalid option: expected one of ${ma(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a)return`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a)return`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`;return`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;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 ${o[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${ma(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0)return`Invalid discriminator value. Expected ${n.options.map((a)=>`'${a}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Oa(){return{localeError:Cm()}}var fd,Im=Symbol("ZodOutput"),Om=Symbol("ZodInput");class gd{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let o=t[0];if(this._map.set(e,o),o&&typeof o==="object"&&"id"in o)this._idmap.set(o.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 o={...this.get(t)??{}};delete o.id;let r={...o,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Sd(){return new gd}(fd=globalThis).__zod_globalRegistry??(fd.__zod_globalRegistry=Sd());var Ke=globalThis.__zod_globalRegistry;function _d(e,t){return new e({type:"string",...w(t)})}function Na(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...w(t)})}function Ma(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...w(t)})}function bd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...w(t)})}function yd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...w(t)})}function zd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...w(t)})}function vd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...w(t)})}function qa(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...w(t)})}function Rd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...w(t)})}function wd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...w(t)})}function xd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...w(t)})}function Pd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...w(t)})}function Td(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...w(t)})}function kd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...w(t)})}function Ed(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...w(t)})}function $d(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...w(t)})}function Cd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...w(t)})}function Id(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...w(t)})}function Od(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...w(t)})}function Nd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...w(t)})}function Md(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...w(t)})}function qd(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...w(t)})}function Ad(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...w(t)})}function jd(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...w(t)})}function Ld(e,t){return new e({type:"string",format:"date",check:"string_format",...w(t)})}function Ud(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...w(t)})}function Zd(e,t){return new e({type:"string",format:"duration",check:"string_format",...w(t)})}function Dd(e,t){return new e({type:"number",checks:[],...w(t)})}function Vd(e,t){return new e({type:"number",coerce:!0,checks:[],...w(t)})}function Hd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...w(t)})}function Fd(e,t){return new e({type:"boolean",...w(t)})}function Jd(e,t){return new e({type:"undefined",...w(t)})}function Bd(e,t){return new e({type:"null",...w(t)})}function Wd(e){return new e({type:"any"})}function Gd(e){return new e({type:"unknown"})}function Kd(e,t){return new e({type:"never",...w(t)})}function _i(e,t){return new xa({check:"less_than",...w(t),value:e,inclusive:!1})}function Zr(e,t){return new xa({check:"less_than",...w(t),value:e,inclusive:!0})}function bi(e,t){return new Pa({check:"greater_than",...w(t),value:e,inclusive:!1})}function Dr(e,t){return new Pa({check:"greater_than",...w(t),value:e,inclusive:!0})}function yi(e,t){return new Kl({check:"multiple_of",...w(t),value:e})}function zi(e,t){return new Ql({check:"max_length",...w(t),maximum:e})}function ao(e,t){return new Xl({check:"min_length",...w(t),minimum:e})}function vi(e,t){return new eu({check:"length_equals",...w(t),length:e})}function Aa(e,t){return new tu({check:"string_format",format:"regex",...w(t),pattern:e})}function ja(e){return new ou({check:"string_format",format:"lowercase",...w(e)})}function La(e){return new ru({check:"string_format",format:"uppercase",...w(e)})}function Ua(e,t){return new nu({check:"string_format",format:"includes",...w(t),includes:e})}function Za(e,t){return new su({check:"string_format",format:"starts_with",...w(t),prefix:e})}function Da(e,t){return new iu({check:"string_format",format:"ends_with",...w(t),suffix:e})}function Ye(e){return new au({check:"overwrite",tx:e})}function Va(e){return Ye((t)=>t.normalize(e))}function Ha(){return Ye((e)=>e.trim())}function Fa(){return Ye((e)=>e.toLowerCase())}function Ja(){return Ye((e)=>e.toUpperCase())}function Ba(){return Ye((e)=>ol(e))}function Yd(e,t,o){return new e({type:"array",element:t,...w(o)})}function Qd(e,t,o){return new e({type:"custom",check:"custom",fn:t,...w(o)})}function Xd(e,t){let o=Nm((r)=>(r.addIssue=(n)=>{if(typeof n==="string")r.issues.push(Rt(n,r.value,o._zod.def));else{let i=n;if(i.fatal)i.continue=!1;i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=o),i.continue??(i.continue=!o._zod.def.abort),r.issues.push(Rt(i))}},e(r.value,r)),t);return o}function Nm(e,t){let o=new X({check:"custom",...w(t)});return o._zod.check=e,o}function Hr(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??Ke,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 j(e,t,o={path:[],schemaPath:[]}){var r;let n=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,o.schemaPath.includes(e))i.cycle=o.path;return i.schema}let a={schema:{},count:1,cycle:void 0,path:o.path};t.seen.set(e,a);let c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{let f={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,f);else{let _=a.schema,b=t.processors[n.type];if(!b)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);b(e,t,_,f)}let S=e._zod.parent;if(S){if(!a.ref)a.ref=S;j(S,t,f),t.seen.get(S).isParent=!0}}let p=t.metadataRegistry.get(e);if(p)Object.assign(a.schema,p);if(t.io==="input"&&le(e))delete a.schema.examples,delete a.schema.default;if(t.io==="input"&&"_prefault"in a.schema)(r=a.schema).default??(r.default=a.schema._prefault);return delete a.schema._prefault,t.seen.get(e).schema}function Fr(e,t){let o=e.seen.get(t);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let a of e.seen.entries()){let c=e.metadataRegistry.get(a[0])?.id;if(c){let p=r.get(c);if(p&&p!==a[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,a[0])}}let n=(a)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let S=e.external.registry.get(a[0])?.id,_=e.external.uri??((P)=>P);if(S)return{ref:_(S)};let b=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=b,{defId:b,ref:`${_("__shared")}#/${c}/${b}`}}if(a[1]===o)return{ref:"#"};let d=`${"#"}/${c}/`,f=a[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:d+f}},i=(a)=>{if(a[1].schema.$ref)return;let c=a[1],{ref:p,defId:d}=n(a);if(c.def={...c.schema},d)c.defId=d;let f=c.schema;for(let S in f)delete f[S];f.$ref=p};if(e.cycles==="throw")for(let a of e.seen.entries()){let c=a[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
64
63
 
65
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let N of Q.seen.entries()){let X=N[1];if(H===N[0]){G(N);continue}if(Q.external){let E=Q.external.registry.get(N[0])?.id;if(H!==N[0]&&E){G(N);continue}}if(Q.metadataRegistry.get(N[0])?.id){G(N);continue}if(X.cycle){G(N);continue}if(X.count>1){if(Q.reused==="ref"){G(N);continue}}}}function bH(Q,H){let W=Q.seen.get(H);if(!W)throw Error("Unprocessed schema. This is a bug in Zod.");let Y=(X)=>{let D=Q.seen.get(X);if(D.ref===null)return;let E=D.def??D.schema,w={...E},q=D.ref;if(D.ref=null,q){Y(q);let _=Q.seen.get(q),I=_.schema;if(I.$ref&&(Q.target==="draft-07"||Q.target==="draft-04"||Q.target==="openapi-3.0"))E.allOf=E.allOf??[],E.allOf.push(I);else Object.assign(E,I);if(Object.assign(E,w),X._zod.parent===q)for(let C in E){if(C==="$ref"||C==="allOf")continue;if(!(C in w))delete E[C]}if(I.$ref&&_.def)for(let C in E){if(C==="$ref"||C==="allOf")continue;if(C in _.def&&JSON.stringify(E[C])===JSON.stringify(_.def[C]))delete E[C]}}let O=X._zod.parent;if(O&&O!==q){Y(O);let _=Q.seen.get(O);if(_?.schema.$ref){if(E.$ref=_.schema.$ref,_.def)for(let I in E){if(I==="$ref"||I==="allOf")continue;if(I in _.def&&JSON.stringify(E[I])===JSON.stringify(_.def[I]))delete E[I]}}}Q.override({zodSchema:X,jsonSchema:E,path:D.path??[]})};for(let X of[...Q.seen.entries()].reverse())Y(X[0]);let J={};if(Q.target==="draft-2020-12")J.$schema="https://json-schema.org/draft/2020-12/schema";else if(Q.target==="draft-07")J.$schema="http://json-schema.org/draft-07/schema#";else if(Q.target==="draft-04")J.$schema="http://json-schema.org/draft-04/schema#";else if(Q.target==="openapi-3.0");if(Q.external?.uri){let X=Q.external.registry.get(H)?.id;if(!X)throw Error("Schema is missing an `id` property");J.$id=Q.external.uri(X)}Object.assign(J,W.def??W.schema);let G=Q.metadataRegistry.get(H)?.id;if(G!==void 0&&J.id===G)delete J.id;let N=Q.external?.defs??{};for(let X of Q.seen.entries()){let D=X[1];if(D.def&&D.defId){if(D.def.id===D.defId)delete D.def.id;N[D.defId]=D.def}}if(Q.external);else if(Object.keys(N).length>0)if(Q.target==="draft-2020-12")J.$defs=N;else J.definitions=N;try{let X=JSON.parse(JSON.stringify(J));return Object.defineProperty(X,"~standard",{value:{...H["~standard"],jsonSchema:{input:YW(H,"input",Q.processors),output:YW(H,"output",Q.processors)}},enumerable:!1,writable:!1}),X}catch(X){throw Error("Error converting schema to JSON.")}}function FQ(Q,H){let W=H??{seen:new Set};if(W.seen.has(Q))return!1;W.seen.add(Q);let Y=Q._zod.def;if(Y.type==="transform")return!0;if(Y.type==="array")return FQ(Y.element,W);if(Y.type==="set")return FQ(Y.valueType,W);if(Y.type==="lazy")return FQ(Y.getter(),W);if(Y.type==="promise"||Y.type==="optional"||Y.type==="nonoptional"||Y.type==="nullable"||Y.type==="readonly"||Y.type==="default"||Y.type==="prefault")return FQ(Y.innerType,W);if(Y.type==="intersection")return FQ(Y.left,W)||FQ(Y.right,W);if(Y.type==="record"||Y.type==="map")return FQ(Y.keyType,W)||FQ(Y.valueType,W);if(Y.type==="pipe"){if(Q._zod.traits.has("$ZodCodec"))return!0;return FQ(Y.in,W)||FQ(Y.out,W)}if(Y.type==="object"){for(let J in Y.shape)if(FQ(Y.shape[J],W))return!0;return!1}if(Y.type==="union"){for(let J of Y.options)if(FQ(J,W))return!0;return!1}if(Y.type==="tuple"){for(let J of Y.items)if(FQ(J,W))return!0;if(Y.rest&&FQ(Y.rest,W))return!0;return!1}return!1}var iG=(Q,H={})=>(W)=>{let Y=UH({...W,processors:H});return l(Q,Y),zH(Y,Q),bH(Y,Q)},YW=(Q,H,W={})=>(Y)=>{let{libraryOptions:J,target:G}=Y??{},N=UH({...J??{},target:G,io:H,processors:W});return l(Q,N),zH(N,Q),bH(N,Q)};var G2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oG=(Q,H,W,Y)=>{let J=W;J.type="string";let{minimum:G,maximum:N,format:X,patterns:D,contentEncoding:E}=Q._zod.bag;if(typeof G==="number")J.minLength=G;if(typeof N==="number")J.maxLength=N;if(X){if(J.format=G2[X]??X,J.format==="")delete J.format;if(X==="time")delete J.format}if(E)J.contentEncoding=E;if(D&&D.size>0){let w=[...D];if(w.length===1)J.pattern=w[0].source;else if(w.length>1)J.allOf=[...w.map((q)=>({...H.target==="draft-07"||H.target==="draft-04"||H.target==="openapi-3.0"?{type:"string"}:{},pattern:q.source}))]}},nG=(Q,H,W,Y)=>{let J=W,{minimum:G,maximum:N,format:X,multipleOf:D,exclusiveMaximum:E,exclusiveMinimum:w}=Q._zod.bag;if(typeof X==="string"&&X.includes("int"))J.type="integer";else J.type="number";let q=typeof w==="number"&&w>=(G??Number.NEGATIVE_INFINITY),O=typeof E==="number"&&E<=(N??Number.POSITIVE_INFINITY),_=H.target==="draft-04"||H.target==="openapi-3.0";if(q)if(_)J.minimum=w,J.exclusiveMinimum=!0;else J.exclusiveMinimum=w;else if(typeof G==="number")J.minimum=G;if(O)if(_)J.maximum=E,J.exclusiveMaximum=!0;else J.exclusiveMaximum=E;else if(typeof N==="number")J.maximum=N;if(typeof D==="number")J.multipleOf=D},rG=(Q,H,W,Y)=>{W.type="boolean"},tG=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},sG=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},aG=(Q,H,W,Y)=>{if(H.target==="openapi-3.0")W.type="string",W.nullable=!0,W.enum=[null];else W.type="null"},eG=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},QN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},HN=(Q,H,W,Y)=>{W.not={}},WN=(Q,H,W,Y)=>{},YN=(Q,H,W,Y)=>{},JN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},GN=(Q,H,W,Y)=>{let J=Q._zod.def,G=v4(J.entries);if(G.every((N)=>typeof N==="number"))W.type="number";if(G.every((N)=>typeof N==="string"))W.type="string";W.enum=G},NN=(Q,H,W,Y)=>{let J=Q._zod.def,G=[];for(let N of J.values)if(N===void 0){if(H.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof N==="bigint")if(H.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else G.push(Number(N));else G.push(N);if(G.length===0);else if(G.length===1){let N=G[0];if(W.type=N===null?"null":typeof N,H.target==="draft-04"||H.target==="openapi-3.0")W.enum=[N];else W.const=N}else{if(G.every((N)=>typeof N==="number"))W.type="number";if(G.every((N)=>typeof N==="string"))W.type="string";if(G.every((N)=>typeof N==="boolean"))W.type="boolean";if(G.every((N)=>N===null))W.type="null";W.enum=G}},BN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},XN=(Q,H,W,Y)=>{let J=W,G=Q._zod.pattern;if(!G)throw Error("Pattern not found in template literal");J.type="string",J.pattern=G.source},DN=(Q,H,W,Y)=>{let J=W,G={type:"string",format:"binary",contentEncoding:"binary"},{minimum:N,maximum:X,mime:D}=Q._zod.bag;if(N!==void 0)G.minLength=N;if(X!==void 0)G.maxLength=X;if(D)if(D.length===1)G.contentMediaType=D[0],Object.assign(J,G);else Object.assign(J,G),J.anyOf=D.map((E)=>({contentMediaType:E}));else Object.assign(J,G)},KN=(Q,H,W,Y)=>{W.type="boolean"},EN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},MN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},VN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},wN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},AN=(Q,H,W,Y)=>{if(H.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},FN=(Q,H,W,Y)=>{let J=W,G=Q._zod.def,{minimum:N,maximum:X}=Q._zod.bag;if(typeof N==="number")J.minItems=N;if(typeof X==="number")J.maxItems=X;J.type="array",J.items=l(G.element,H,{...Y,path:[...Y.path,"items"]})},qN=(Q,H,W,Y)=>{let J=W,G=Q._zod.def;J.type="object",J.properties={};let N=G.shape;for(let E in N)J.properties[E]=l(N[E],H,{...Y,path:[...Y.path,"properties",E]});let X=new Set(Object.keys(N)),D=new Set([...X].filter((E)=>{let w=G.shape[E]._zod;if(H.io==="input")return w.optin===void 0;else return w.optout===void 0}));if(D.size>0)J.required=Array.from(D);if(G.catchall?._zod.def.type==="never")J.additionalProperties=!1;else if(!G.catchall){if(H.io==="output")J.additionalProperties=!1}else if(G.catchall)J.additionalProperties=l(G.catchall,H,{...Y,path:[...Y.path,"additionalProperties"]})},ZY=(Q,H,W,Y)=>{let J=Q._zod.def,G=J.inclusive===!1,N=J.options.map((X,D)=>l(X,H,{...Y,path:[...Y.path,G?"oneOf":"anyOf",D]}));if(G)W.oneOf=N;else W.anyOf=N},ON=(Q,H,W,Y)=>{let J=Q._zod.def,G=l(J.left,H,{...Y,path:[...Y.path,"allOf",0]}),N=l(J.right,H,{...Y,path:[...Y.path,"allOf",1]}),X=(E)=>("allOf"in E)&&Object.keys(E).length===1,D=[...X(G)?G.allOf:[G],...X(N)?N.allOf:[N]];W.allOf=D},_N=(Q,H,W,Y)=>{let J=W,G=Q._zod.def;J.type="array";let N=H.target==="draft-2020-12"?"prefixItems":"items",X=H.target==="draft-2020-12"?"items":H.target==="openapi-3.0"?"items":"additionalItems",D=G.items.map((O,_)=>l(O,H,{...Y,path:[...Y.path,N,_]})),E=G.rest?l(G.rest,H,{...Y,path:[...Y.path,X,...H.target==="openapi-3.0"?[G.items.length]:[]]}):null;if(H.target==="draft-2020-12"){if(J.prefixItems=D,E)J.items=E}else if(H.target==="openapi-3.0"){if(J.items={anyOf:D},E)J.items.anyOf.push(E);if(J.minItems=D.length,!E)J.maxItems=D.length}else if(J.items=D,E)J.additionalItems=E;let{minimum:w,maximum:q}=Q._zod.bag;if(typeof w==="number")J.minItems=w;if(typeof q==="number")J.maxItems=q},UN=(Q,H,W,Y)=>{let J=W,G=Q._zod.def;J.type="object";let N=G.keyType,D=N._zod.bag?.patterns;if(G.mode==="loose"&&D&&D.size>0){let w=l(G.valueType,H,{...Y,path:[...Y.path,"patternProperties","*"]});J.patternProperties={};for(let q of D)J.patternProperties[q.source]=w}else{if(H.target==="draft-07"||H.target==="draft-2020-12")J.propertyNames=l(G.keyType,H,{...Y,path:[...Y.path,"propertyNames"]});J.additionalProperties=l(G.valueType,H,{...Y,path:[...Y.path,"additionalProperties"]})}let E=N._zod.values;if(E){let w=[...E].filter((q)=>typeof q==="string"||typeof q==="number");if(w.length>0)J.required=w}},zN=(Q,H,W,Y)=>{let J=Q._zod.def,G=l(J.innerType,H,Y),N=H.seen.get(Q);if(H.target==="openapi-3.0")N.ref=J.innerType,W.nullable=!0;else W.anyOf=[G,{type:"null"}]},bN=(Q,H,W,Y)=>{let J=Q._zod.def;l(J.innerType,H,Y);let G=H.seen.get(Q);G.ref=J.innerType},PN=(Q,H,W,Y)=>{let J=Q._zod.def;l(J.innerType,H,Y);let G=H.seen.get(Q);G.ref=J.innerType,W.default=JSON.parse(JSON.stringify(J.defaultValue))},ZN=(Q,H,W,Y)=>{let J=Q._zod.def;l(J.innerType,H,Y);let G=H.seen.get(Q);if(G.ref=J.innerType,H.io==="input")W._prefault=JSON.parse(JSON.stringify(J.defaultValue))},$N=(Q,H,W,Y)=>{let J=Q._zod.def;l(J.innerType,H,Y);let G=H.seen.get(Q);G.ref=J.innerType;let N;try{N=J.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}W.default=N},IN=(Q,H,W,Y)=>{let J=Q._zod.def,G=J.in._zod.traits.has("$ZodTransform"),N=H.io==="input"?G?J.out:J.in:J.out;l(N,H,Y);let X=H.seen.get(Q);X.ref=N},LN=(Q,H,W,Y)=>{let J=Q._zod.def;l(J.innerType,H,Y);let G=H.seen.get(Q);G.ref=J.innerType,W.readOnly=!0},TN=(Q,H,W,Y)=>{let J=Q._zod.def;l(J.innerType,H,Y);let G=H.seen.get(Q);G.ref=J.innerType},$Y=(Q,H,W,Y)=>{let J=Q._zod.def;l(J.innerType,H,Y);let G=H.seen.get(Q);G.ref=J.innerType},jN=(Q,H,W,Y)=>{let J=Q._zod.innerType;l(J,H,Y);let G=H.seen.get(Q);G.ref=J},PY={string:oG,number:nG,boolean:rG,bigint:tG,symbol:sG,null:aG,undefined:eG,void:QN,never:HN,any:WN,unknown:YN,date:JN,enum:GN,literal:NN,nan:BN,template_literal:XN,file:DN,success:KN,custom:EN,function:MN,transform:VN,map:wN,set:AN,array:FN,object:qN,union:ZY,intersection:ON,tuple:_N,record:UN,nullable:zN,nonoptional:bN,default:PN,prefault:ZN,catch:$N,pipe:IN,readonly:LN,promise:TN,optional:$Y,lazy:jN};function H0(Q,H){if("_idmap"in Q){let Y=Q,J=UH({...H,processors:PY}),G={};for(let D of Y._idmap.entries()){let[E,w]=D;l(w,J)}let N={},X={registry:Y,uri:H?.uri,defs:G};J.external=X;for(let D of Y._idmap.entries()){let[E,w]=D;zH(J,w),N[E]=bH(J,w)}if(Object.keys(G).length>0){let D=J.target==="draft-2020-12"?"$defs":"definitions";N.__shared={[D]:G}}return{schemas:N}}let W=UH({...H,processors:PY});return l(Q,W),zH(W,Q),bH(W,Q)}class RN{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(Q){this.ctx.counter=Q}get seen(){return this.ctx.seen}constructor(Q){let H=Q?.target??"draft-2020-12";if(H==="draft-4")H="draft-04";if(H==="draft-7")H="draft-07";this.ctx=UH({processors:PY,target:H,...Q?.metadata&&{metadata:Q.metadata},...Q?.unrepresentable&&{unrepresentable:Q.unrepresentable},...Q?.override&&{override:Q.override},...Q?.io&&{io:Q.io}})}process(Q,H={path:[],schemaPath:[]}){return l(Q,this.ctx,H)}emit(Q,H){if(H){if(H.cycles)this.ctx.cycles=H.cycles;if(H.reused)this.ctx.reused=H.reused;if(H.external)this.ctx.external=H.external}zH(this.ctx,Q);let W=bH(this.ctx,Q),{"~standard":Y,...J}=W;return J}}var c5={};var Q1={};tQ(Q1,{xor:()=>CB,xid:()=>YB,void:()=>LB,uuidv7:()=>t5,uuidv6:()=>r5,uuidv4:()=>n5,uuid:()=>o5,url:()=>BW,unknown:()=>L,union:()=>$,undefined:()=>IB,ulid:()=>WB,uint64:()=>ZB,uint32:()=>zB,tuple:()=>G7,transform:()=>Q8,templateLiteral:()=>cB,symbol:()=>$B,superRefine:()=>C7,success:()=>fB,stringbool:()=>sB,stringFormat:()=>wB,string:()=>B,strictObject:()=>RB,set:()=>xB,refine:()=>R7,record:()=>b,readonly:()=>$7,promise:()=>pB,preprocess:()=>QH,prefault:()=>q7,pipe:()=>SY,partialRecord:()=>SB,optional:()=>T,object:()=>M,number:()=>U,nullish:()=>hB,nullable:()=>Y1,null:()=>lQ,nonoptional:()=>O7,never:()=>eY,nativeEnum:()=>vB,nanoid:()=>e5,nan:()=>uB,meta:()=>rB,map:()=>gB,mac:()=>NB,looseRecord:()=>kB,looseObject:()=>R,literal:()=>F,lazy:()=>ZH,ksuid:()=>JB,keyof:()=>jB,jwt:()=>VB,json:()=>aB,ipv6:()=>BB,ipv4:()=>GB,invertCodec:()=>mB,intersection:()=>SQ,int64:()=>PB,int32:()=>UB,int:()=>CY,instanceof:()=>tB,httpUrl:()=>s5,hostname:()=>AB,hex:()=>FB,hash:()=>qB,guid:()=>i5,function:()=>dB,float64:()=>_B,float32:()=>OB,file:()=>yB,exactOptional:()=>M7,enum:()=>S,emoji:()=>a5,email:()=>xY,e164:()=>MB,discriminatedUnion:()=>PH,describe:()=>nB,date:()=>TB,custom:()=>oB,cuid2:()=>HB,cuid:()=>QB,codec:()=>lB,cidrv6:()=>DB,cidrv4:()=>XB,check:()=>iB,catch:()=>z7,boolean:()=>P,bigint:()=>bB,base64url:()=>EB,base64:()=>KB,array:()=>A,any:()=>aY,_function:()=>dB,_default:()=>A7,_ZodString:()=>kY,ZodXor:()=>H7,ZodXID:()=>lY,ZodVoid:()=>eN,ZodUnknown:()=>sN,ZodUnion:()=>X1,ZodUndefined:()=>nN,ZodUUID:()=>uQ,ZodURL:()=>G1,ZodULID:()=>uY,ZodType:()=>x,ZodTuple:()=>J7,ZodTransform:()=>K7,ZodTemplateLiteral:()=>I7,ZodSymbol:()=>oN,ZodSuccess:()=>_7,ZodStringFormat:()=>c,ZodString:()=>NW,ZodSet:()=>B7,ZodRecord:()=>JW,ZodReadonly:()=>Z7,ZodPromise:()=>T7,ZodPreprocess:()=>P7,ZodPrefault:()=>F7,ZodPipe:()=>D1,ZodOptional:()=>H8,ZodObject:()=>B1,ZodNumberFormat:()=>W0,ZodNumber:()=>DW,ZodNullable:()=>V7,ZodNull:()=>rN,ZodNonOptional:()=>W8,ZodNever:()=>aN,ZodNanoID:()=>yY,ZodNaN:()=>b7,ZodMap:()=>N7,ZodMAC:()=>iN,ZodLiteral:()=>X7,ZodLazy:()=>L7,ZodKSUID:()=>mY,ZodJWT:()=>tY,ZodIntersection:()=>Y7,ZodIPv6:()=>pY,ZodIPv4:()=>cY,ZodGUID:()=>W1,ZodFunction:()=>j7,ZodFile:()=>D7,ZodExactOptional:()=>E7,ZodEnum:()=>GW,ZodEmoji:()=>vY,ZodEmail:()=>gY,ZodE164:()=>rY,ZodDiscriminatedUnion:()=>W7,ZodDefault:()=>w7,ZodDate:()=>N1,ZodCustomStringFormat:()=>XW,ZodCustom:()=>E1,ZodCodec:()=>K1,ZodCatch:()=>U7,ZodCUID2:()=>fY,ZodCUID:()=>hY,ZodCIDRv6:()=>iY,ZodCIDRv4:()=>dY,ZodBoolean:()=>KW,ZodBigIntFormat:()=>sY,ZodBigInt:()=>EW,ZodBase64URL:()=>nY,ZodBase64:()=>oY,ZodArray:()=>Q7,ZodAny:()=>tN});var IY={};tQ(IY,{uppercase:()=>i0,trim:()=>a0,toUpperCase:()=>QW,toLowerCase:()=>e0,startsWith:()=>n0,slugify:()=>HW,size:()=>aH,regex:()=>p0,property:()=>bY,positive:()=>OY,overwrite:()=>CQ,normalize:()=>s0,nonpositive:()=>UY,nonnegative:()=>zY,negative:()=>_Y,multipleOf:()=>OH,minSize:()=>fQ,minLength:()=>aQ,mime:()=>t0,maxSize:()=>_H,maxLength:()=>eH,lte:()=>ZQ,lt:()=>yQ,lowercase:()=>d0,length:()=>Q0,includes:()=>o0,gte:()=>AQ,gt:()=>hQ,endsWith:()=>r0});var $Q={};tQ($Q,{time:()=>kN,duration:()=>gN,datetime:()=>CN,date:()=>SN,ZodISOTime:()=>jY,ZodISODuration:()=>RY,ZodISODateTime:()=>LY,ZodISODate:()=>TY});var LY=V("ZodISODateTime",(Q,H)=>{NJ.init(Q,H),c.init(Q,H)});function CN(Q){return EG(LY,Q)}var TY=V("ZodISODate",(Q,H)=>{BJ.init(Q,H),c.init(Q,H)});function SN(Q){return MG(TY,Q)}var jY=V("ZodISOTime",(Q,H)=>{XJ.init(Q,H),c.init(Q,H)});function kN(Q){return VG(jY,Q)}var RY=V("ZodISODuration",(Q,H)=>{DJ.init(Q,H),c.init(Q,H)});function gN(Q){return wG(RY,Q)}var p5=(Q,H)=>{l4.init(Q,H),Q.name="ZodError",Object.defineProperties(Q,{format:{value:(W)=>c4(Q,W)},flatten:{value:(W)=>m4(Q,W)},addIssue:{value:(W)=>{Q.issues.push(W),Q.message=JSON.stringify(Q.issues,v0,2)}},addIssues:{value:(W)=>{Q.issues.push(...W),Q.message=JSON.stringify(Q.issues,v0,2)}},isEmpty:{get(){return Q.issues.length===0}}})},B2=V("ZodError",p5),UQ=V("ZodError",p5,{Parent:Error});var xN=f0(UQ),vN=u0(UQ),H1=l0(UQ),yN=m0(UQ),hN=R6(UQ),fN=C6(UQ),uN=S6(UQ),lN=k6(UQ),mN=g6(UQ),cN=x6(UQ),pN=v6(UQ),dN=y6(UQ);var d5=new WeakMap;function J1(Q,H,W){let Y=Object.getPrototypeOf(Q),J=d5.get(Y);if(!J)J=new Set,d5.set(Y,J);if(J.has(H))return;J.add(H);for(let G in W){let N=W[G];Object.defineProperty(Y,G,{configurable:!0,enumerable:!1,get(){let X=N.bind(this);return Object.defineProperty(this,G,{configurable:!0,writable:!0,enumerable:!0,value:X}),X},set(X){Object.defineProperty(this,G,{configurable:!0,writable:!0,enumerable:!0,value:X})}})}}var x=V("ZodType",(Q,H)=>{return g.init(Q,H),Object.assign(Q["~standard"],{jsonSchema:{input:YW(Q,"input"),output:YW(Q,"output")}}),Q.toJSONSchema=iG(Q,{}),Q.def=H,Q.type=H.type,Object.defineProperty(Q,"_def",{value:H}),Q.parse=(W,Y)=>xN(Q,W,Y,{callee:Q.parse}),Q.safeParse=(W,Y)=>H1(Q,W,Y),Q.parseAsync=async(W,Y)=>vN(Q,W,Y,{callee:Q.parseAsync}),Q.safeParseAsync=async(W,Y)=>yN(Q,W,Y),Q.spa=Q.safeParseAsync,Q.encode=(W,Y)=>hN(Q,W,Y),Q.decode=(W,Y)=>fN(Q,W,Y),Q.encodeAsync=async(W,Y)=>uN(Q,W,Y),Q.decodeAsync=async(W,Y)=>lN(Q,W,Y),Q.safeEncode=(W,Y)=>mN(Q,W,Y),Q.safeDecode=(W,Y)=>cN(Q,W,Y),Q.safeEncodeAsync=async(W,Y)=>pN(Q,W,Y),Q.safeDecodeAsync=async(W,Y)=>dN(Q,W,Y),J1(Q,"ZodType",{check(...W){let Y=this.def;return this.clone(k.mergeDefs(Y,{checks:[...Y.checks??[],...W.map((J)=>typeof J==="function"?{_zod:{check:J,def:{check:"custom"},onattach:[]}}:J)]}),{parent:!0})},with(...W){return this.check(...W)},clone(W,Y){return VQ(this,W,Y)},brand(){return this},register(W,Y){return W.add(this,Y),this},refine(W,Y){return this.check(R7(W,Y))},superRefine(W,Y){return this.check(C7(W,Y))},overwrite(W){return this.check(CQ(W))},optional(){return T(this)},exactOptional(){return M7(this)},nullable(){return Y1(this)},nullish(){return T(Y1(this))},nonoptional(W){return O7(this,W)},array(){return A(this)},or(W){return $([this,W])},and(W){return SQ(this,W)},transform(W){return SY(this,Q8(W))},default(W){return A7(this,W)},prefault(W){return q7(this,W)},catch(W){return z7(this,W)},pipe(W){return SY(this,W)},readonly(){return $7(this)},describe(W){let Y=this.clone();return YQ.add(Y,{description:W}),Y},meta(...W){if(W.length===0)return YQ.get(this);let Y=this.clone();return YQ.add(Y,W[0]),Y},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(W){return W(this)}}),Object.defineProperty(Q,"description",{get(){return YQ.get(Q)?.description},configurable:!0}),Q}),kY=V("_ZodString",(Q,H)=>{sH.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(Y,J,G)=>oG(Q,Y,J,G);let W=Q._zod.bag;Q.format=W.format??null,Q.minLength=W.minimum??null,Q.maxLength=W.maximum??null,J1(Q,"_ZodString",{regex(...Y){return this.check(p0(...Y))},includes(...Y){return this.check(o0(...Y))},startsWith(...Y){return this.check(n0(...Y))},endsWith(...Y){return this.check(r0(...Y))},min(...Y){return this.check(aQ(...Y))},max(...Y){return this.check(eH(...Y))},length(...Y){return this.check(Q0(...Y))},nonempty(...Y){return this.check(aQ(1,...Y))},lowercase(Y){return this.check(d0(Y))},uppercase(Y){return this.check(i0(Y))},trim(){return this.check(a0())},normalize(...Y){return this.check(s0(...Y))},toLowerCase(){return this.check(e0())},toUpperCase(){return this.check(QW())},slugify(){return this.check(HW())}})}),NW=V("ZodString",(Q,H)=>{sH.init(Q,H),kY.init(Q,H),Q.email=(W)=>Q.check(a6(gY,W)),Q.url=(W)=>Q.check(e4(G1,W)),Q.jwt=(W)=>Q.check(qY(tY,W)),Q.emoji=(W)=>Q.check(YY(vY,W)),Q.guid=(W)=>Q.check(a4(W1,W)),Q.uuid=(W)=>Q.check(e6(uQ,W)),Q.uuidv4=(W)=>Q.check(QY(uQ,W)),Q.uuidv6=(W)=>Q.check(HY(uQ,W)),Q.uuidv7=(W)=>Q.check(WY(uQ,W)),Q.nanoid=(W)=>Q.check(JY(yY,W)),Q.guid=(W)=>Q.check(a4(W1,W)),Q.cuid=(W)=>Q.check(GY(hY,W)),Q.cuid2=(W)=>Q.check(NY(fY,W)),Q.ulid=(W)=>Q.check(BY(uY,W)),Q.base64=(W)=>Q.check(wY(oY,W)),Q.base64url=(W)=>Q.check(AY(nY,W)),Q.xid=(W)=>Q.check(XY(lY,W)),Q.ksuid=(W)=>Q.check(DY(mY,W)),Q.ipv4=(W)=>Q.check(KY(cY,W)),Q.ipv6=(W)=>Q.check(EY(pY,W)),Q.cidrv4=(W)=>Q.check(MY(dY,W)),Q.cidrv6=(W)=>Q.check(VY(iY,W)),Q.e164=(W)=>Q.check(FY(rY,W)),Q.datetime=(W)=>Q.check(CN(W)),Q.date=(W)=>Q.check(SN(W)),Q.time=(W)=>Q.check(kN(W)),Q.duration=(W)=>Q.check(gN(W))});function B(Q){return BG(NW,Q)}var c=V("ZodStringFormat",(Q,H)=>{m.init(Q,H),kY.init(Q,H)}),gY=V("ZodEmail",(Q,H)=>{s3.init(Q,H),c.init(Q,H)});function xY(Q){return a6(gY,Q)}var W1=V("ZodGUID",(Q,H)=>{r3.init(Q,H),c.init(Q,H)});function i5(Q){return a4(W1,Q)}var uQ=V("ZodUUID",(Q,H)=>{t3.init(Q,H),c.init(Q,H)});function o5(Q){return e6(uQ,Q)}function n5(Q){return QY(uQ,Q)}function r5(Q){return HY(uQ,Q)}function t5(Q){return WY(uQ,Q)}var G1=V("ZodURL",(Q,H)=>{a3.init(Q,H),c.init(Q,H)});function BW(Q){return e4(G1,Q)}function s5(Q){return e4(G1,{protocol:PQ.httpProtocol,hostname:PQ.domain,...k.normalizeParams(Q)})}var vY=V("ZodEmoji",(Q,H)=>{e3.init(Q,H),c.init(Q,H)});function a5(Q){return YY(vY,Q)}var yY=V("ZodNanoID",(Q,H)=>{QJ.init(Q,H),c.init(Q,H)});function e5(Q){return JY(yY,Q)}var hY=V("ZodCUID",(Q,H)=>{HJ.init(Q,H),c.init(Q,H)});function QB(Q){return GY(hY,Q)}var fY=V("ZodCUID2",(Q,H)=>{WJ.init(Q,H),c.init(Q,H)});function HB(Q){return NY(fY,Q)}var uY=V("ZodULID",(Q,H)=>{YJ.init(Q,H),c.init(Q,H)});function WB(Q){return BY(uY,Q)}var lY=V("ZodXID",(Q,H)=>{JJ.init(Q,H),c.init(Q,H)});function YB(Q){return XY(lY,Q)}var mY=V("ZodKSUID",(Q,H)=>{GJ.init(Q,H),c.init(Q,H)});function JB(Q){return DY(mY,Q)}var cY=V("ZodIPv4",(Q,H)=>{KJ.init(Q,H),c.init(Q,H)});function GB(Q){return KY(cY,Q)}var iN=V("ZodMAC",(Q,H)=>{MJ.init(Q,H),c.init(Q,H)});function NB(Q){return DG(iN,Q)}var pY=V("ZodIPv6",(Q,H)=>{EJ.init(Q,H),c.init(Q,H)});function BB(Q){return EY(pY,Q)}var dY=V("ZodCIDRv4",(Q,H)=>{VJ.init(Q,H),c.init(Q,H)});function XB(Q){return MY(dY,Q)}var iY=V("ZodCIDRv6",(Q,H)=>{wJ.init(Q,H),c.init(Q,H)});function DB(Q){return VY(iY,Q)}var oY=V("ZodBase64",(Q,H)=>{FJ.init(Q,H),c.init(Q,H)});function KB(Q){return wY(oY,Q)}var nY=V("ZodBase64URL",(Q,H)=>{qJ.init(Q,H),c.init(Q,H)});function EB(Q){return AY(nY,Q)}var rY=V("ZodE164",(Q,H)=>{OJ.init(Q,H),c.init(Q,H)});function MB(Q){return FY(rY,Q)}var tY=V("ZodJWT",(Q,H)=>{_J.init(Q,H),c.init(Q,H)});function VB(Q){return qY(tY,Q)}var XW=V("ZodCustomStringFormat",(Q,H)=>{UJ.init(Q,H),c.init(Q,H)});function wB(Q,H,W={}){return WW(XW,Q,H,W)}function AB(Q){return WW(XW,"hostname",PQ.hostname,Q)}function FB(Q){return WW(XW,"hex",PQ.hex,Q)}function qB(Q,H){let W=H?.enc??"hex",Y=`${Q}_${W}`,J=PQ[Y];if(!J)throw Error(`Unrecognized hash format: ${Y}`);return WW(XW,Y,J,H)}var DW=V("ZodNumber",(Q,H)=>{i6.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(Y,J,G)=>nG(Q,Y,J,G),J1(Q,"ZodNumber",{gt(Y,J){return this.check(hQ(Y,J))},gte(Y,J){return this.check(AQ(Y,J))},min(Y,J){return this.check(AQ(Y,J))},lt(Y,J){return this.check(yQ(Y,J))},lte(Y,J){return this.check(ZQ(Y,J))},max(Y,J){return this.check(ZQ(Y,J))},int(Y){return this.check(CY(Y))},safe(Y){return this.check(CY(Y))},positive(Y){return this.check(hQ(0,Y))},nonnegative(Y){return this.check(AQ(0,Y))},negative(Y){return this.check(yQ(0,Y))},nonpositive(Y){return this.check(ZQ(0,Y))},multipleOf(Y,J){return this.check(OH(Y,J))},step(Y,J){return this.check(OH(Y,J))},finite(){return this}});let W=Q._zod.bag;Q.minValue=Math.max(W.minimum??Number.NEGATIVE_INFINITY,W.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,Q.maxValue=Math.min(W.maximum??Number.POSITIVE_INFINITY,W.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,Q.isInt=(W.format??"").includes("int")||Number.isSafeInteger(W.multipleOf??0.5),Q.isFinite=!0,Q.format=W.format??null});function U(Q){return AG(DW,Q)}var W0=V("ZodNumberFormat",(Q,H)=>{zJ.init(Q,H),DW.init(Q,H)});function CY(Q){return qG(W0,Q)}function OB(Q){return OG(W0,Q)}function _B(Q){return _G(W0,Q)}function UB(Q){return UG(W0,Q)}function zB(Q){return zG(W0,Q)}var KW=V("ZodBoolean",(Q,H)=>{o4.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>rG(Q,W,Y,J)});function P(Q){return bG(KW,Q)}var EW=V("ZodBigInt",(Q,H)=>{o6.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(Y,J,G)=>tG(Q,Y,J,G),Q.gte=(Y,J)=>Q.check(AQ(Y,J)),Q.min=(Y,J)=>Q.check(AQ(Y,J)),Q.gt=(Y,J)=>Q.check(hQ(Y,J)),Q.gte=(Y,J)=>Q.check(AQ(Y,J)),Q.min=(Y,J)=>Q.check(AQ(Y,J)),Q.lt=(Y,J)=>Q.check(yQ(Y,J)),Q.lte=(Y,J)=>Q.check(ZQ(Y,J)),Q.max=(Y,J)=>Q.check(ZQ(Y,J)),Q.positive=(Y)=>Q.check(hQ(BigInt(0),Y)),Q.negative=(Y)=>Q.check(yQ(BigInt(0),Y)),Q.nonpositive=(Y)=>Q.check(ZQ(BigInt(0),Y)),Q.nonnegative=(Y)=>Q.check(AQ(BigInt(0),Y)),Q.multipleOf=(Y,J)=>Q.check(OH(Y,J));let W=Q._zod.bag;Q.minValue=W.minimum??null,Q.maxValue=W.maximum??null,Q.format=W.format??null});function bB(Q){return ZG(EW,Q)}var sY=V("ZodBigIntFormat",(Q,H)=>{bJ.init(Q,H),EW.init(Q,H)});function PB(Q){return IG(sY,Q)}function ZB(Q){return LG(sY,Q)}var oN=V("ZodSymbol",(Q,H)=>{PJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>sG(Q,W,Y,J)});function $B(Q){return TG(oN,Q)}var nN=V("ZodUndefined",(Q,H)=>{ZJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>eG(Q,W,Y,J)});function IB(Q){return jG(nN,Q)}var rN=V("ZodNull",(Q,H)=>{$J.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>aG(Q,W,Y,J)});function lQ(Q){return RG(rN,Q)}var tN=V("ZodAny",(Q,H)=>{IJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>WN(Q,W,Y,J)});function aY(){return CG(tN)}var sN=V("ZodUnknown",(Q,H)=>{LJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>YN(Q,W,Y,J)});function L(){return SG(sN)}var aN=V("ZodNever",(Q,H)=>{TJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>HN(Q,W,Y,J)});function eY(Q){return kG(aN,Q)}var eN=V("ZodVoid",(Q,H)=>{jJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>QN(Q,W,Y,J)});function LB(Q){return gG(eN,Q)}var N1=V("ZodDate",(Q,H)=>{RJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(Y,J,G)=>JN(Q,Y,J,G),Q.min=(Y,J)=>Q.check(AQ(Y,J)),Q.max=(Y,J)=>Q.check(ZQ(Y,J));let W=Q._zod.bag;Q.minDate=W.minimum?new Date(W.minimum):null,Q.maxDate=W.maximum?new Date(W.maximum):null});function TB(Q){return xG(N1,Q)}var Q7=V("ZodArray",(Q,H)=>{CJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>FN(Q,W,Y,J),Q.element=H.element,J1(Q,"ZodArray",{min(W,Y){return this.check(aQ(W,Y))},nonempty(W){return this.check(aQ(1,W))},max(W,Y){return this.check(eH(W,Y))},length(W,Y){return this.check(Q0(W,Y))},unwrap(){return this.element}})});function A(Q,H){return hG(Q7,Q,H)}function jB(Q){let H=Q._zod.def.shape;return S(Object.keys(H))}var B1=V("ZodObject",(Q,H)=>{SJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>qN(Q,W,Y,J),k.defineLazy(Q,"shape",()=>{return H.shape}),J1(Q,"ZodObject",{keyof(){return S(Object.keys(this._zod.def.shape))},catchall(W){return this.clone({...this._zod.def,catchall:W})},passthrough(){return this.clone({...this._zod.def,catchall:L()})},loose(){return this.clone({...this._zod.def,catchall:L()})},strict(){return this.clone({...this._zod.def,catchall:eY()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(W){return k.extend(this,W)},safeExtend(W){return k.safeExtend(this,W)},merge(W){return k.merge(this,W)},pick(W){return k.pick(this,W)},omit(W){return k.omit(this,W)},partial(...W){return k.partial(H8,this,W[0])},required(...W){return k.required(W8,this,W[0])}})});function M(Q,H){let W={type:"object",shape:Q??{},...k.normalizeParams(H)};return new B1(W)}function RB(Q,H){return new B1({type:"object",shape:Q,catchall:eY(),...k.normalizeParams(H)})}function R(Q,H){return new B1({type:"object",shape:Q,catchall:L(),...k.normalizeParams(H)})}var X1=V("ZodUnion",(Q,H)=>{n4.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>ZY(Q,W,Y,J),Q.options=H.options});function $(Q,H){return new X1({type:"union",options:Q,...k.normalizeParams(H)})}var H7=V("ZodXor",(Q,H)=>{X1.init(Q,H),kJ.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>ZY(Q,W,Y,J),Q.options=H.options});function CB(Q,H){return new H7({type:"union",options:Q,inclusive:!1,...k.normalizeParams(H)})}var W7=V("ZodDiscriminatedUnion",(Q,H)=>{X1.init(Q,H),gJ.init(Q,H)});function PH(Q,H,W){return new W7({type:"union",options:H,discriminator:Q,...k.normalizeParams(W)})}var Y7=V("ZodIntersection",(Q,H)=>{xJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>ON(Q,W,Y,J)});function SQ(Q,H){return new Y7({type:"intersection",left:Q,right:H})}var J7=V("ZodTuple",(Q,H)=>{n6.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>_N(Q,W,Y,J),Q.rest=(W)=>Q.clone({...Q._zod.def,rest:W})});function G7(Q,H,W){let Y=H instanceof g,J=Y?W:H;return new J7({type:"tuple",items:Q,rest:Y?H:null,...k.normalizeParams(J)})}var JW=V("ZodRecord",(Q,H)=>{vJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>UN(Q,W,Y,J),Q.keyType=H.keyType,Q.valueType=H.valueType});function b(Q,H,W){if(!H||!H._zod)return new JW({type:"record",keyType:B(),valueType:Q,...k.normalizeParams(H)});return new JW({type:"record",keyType:Q,valueType:H,...k.normalizeParams(W)})}function SB(Q,H,W){let Y=VQ(Q);return Y._zod.values=void 0,new JW({type:"record",keyType:Y,valueType:H,...k.normalizeParams(W)})}function kB(Q,H,W){return new JW({type:"record",keyType:Q,valueType:H,mode:"loose",...k.normalizeParams(W)})}var N7=V("ZodMap",(Q,H)=>{yJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>wN(Q,W,Y,J),Q.keyType=H.keyType,Q.valueType=H.valueType,Q.min=(...W)=>Q.check(fQ(...W)),Q.nonempty=(W)=>Q.check(fQ(1,W)),Q.max=(...W)=>Q.check(_H(...W)),Q.size=(...W)=>Q.check(aH(...W))});function gB(Q,H,W){return new N7({type:"map",keyType:Q,valueType:H,...k.normalizeParams(W)})}var B7=V("ZodSet",(Q,H)=>{hJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>AN(Q,W,Y,J),Q.min=(...W)=>Q.check(fQ(...W)),Q.nonempty=(W)=>Q.check(fQ(1,W)),Q.max=(...W)=>Q.check(_H(...W)),Q.size=(...W)=>Q.check(aH(...W))});function xB(Q,H){return new B7({type:"set",valueType:Q,...k.normalizeParams(H)})}var GW=V("ZodEnum",(Q,H)=>{fJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(Y,J,G)=>GN(Q,Y,J,G),Q.enum=H.entries,Q.options=Object.values(H.entries);let W=new Set(Object.keys(H.entries));Q.extract=(Y,J)=>{let G={};for(let N of Y)if(W.has(N))G[N]=H.entries[N];else throw Error(`Key ${N} not found in enum`);return new GW({...H,checks:[],...k.normalizeParams(J),entries:G})},Q.exclude=(Y,J)=>{let G={...H.entries};for(let N of Y)if(W.has(N))delete G[N];else throw Error(`Key ${N} not found in enum`);return new GW({...H,checks:[],...k.normalizeParams(J),entries:G})}});function S(Q,H){let W=Array.isArray(Q)?Object.fromEntries(Q.map((Y)=>[Y,Y])):Q;return new GW({type:"enum",entries:W,...k.normalizeParams(H)})}function vB(Q,H){return new GW({type:"enum",entries:Q,...k.normalizeParams(H)})}var X7=V("ZodLiteral",(Q,H)=>{uJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>NN(Q,W,Y,J),Q.values=new Set(H.values),Object.defineProperty(Q,"value",{get(){if(H.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return H.values[0]}})});function F(Q,H){return new X7({type:"literal",values:Array.isArray(Q)?Q:[Q],...k.normalizeParams(H)})}var D7=V("ZodFile",(Q,H)=>{lJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>DN(Q,W,Y,J),Q.min=(W,Y)=>Q.check(fQ(W,Y)),Q.max=(W,Y)=>Q.check(_H(W,Y)),Q.mime=(W,Y)=>Q.check(t0(Array.isArray(W)?W:[W],Y))});function yB(Q){return fG(D7,Q)}var K7=V("ZodTransform",(Q,H)=>{mJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>VN(Q,W,Y,J),Q._zod.parse=(W,Y)=>{if(Y.direction==="backward")throw new nH(Q.constructor.name);W.addIssue=(G)=>{if(typeof G==="string")W.issues.push(k.issue(G,W.value,H));else{let N=G;if(N.fatal)N.continue=!1;N.code??(N.code="custom"),N.input??(N.input=W.value),N.inst??(N.inst=Q),W.issues.push(k.issue(N))}};let J=H.transform(W.value,W);if(J instanceof Promise)return J.then((G)=>{return W.value=G,W.fallback=!0,W});return W.value=J,W.fallback=!0,W}});function Q8(Q){return new K7({type:"transform",transform:Q})}var H8=V("ZodOptional",(Q,H)=>{r6.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>$Y(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function T(Q){return new H8({type:"optional",innerType:Q})}var E7=V("ZodExactOptional",(Q,H)=>{cJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>$Y(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function M7(Q){return new E7({type:"optional",innerType:Q})}var V7=V("ZodNullable",(Q,H)=>{pJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>zN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function Y1(Q){return new V7({type:"nullable",innerType:Q})}function hB(Q){return T(Y1(Q))}var w7=V("ZodDefault",(Q,H)=>{dJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>PN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType,Q.removeDefault=Q.unwrap});function A7(Q,H){return new w7({type:"default",innerType:Q,get defaultValue(){return typeof H==="function"?H():k.shallowClone(H)}})}var F7=V("ZodPrefault",(Q,H)=>{iJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>ZN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function q7(Q,H){return new F7({type:"prefault",innerType:Q,get defaultValue(){return typeof H==="function"?H():k.shallowClone(H)}})}var W8=V("ZodNonOptional",(Q,H)=>{oJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>bN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function O7(Q,H){return new W8({type:"nonoptional",innerType:Q,...k.normalizeParams(H)})}var _7=V("ZodSuccess",(Q,H)=>{nJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>KN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function fB(Q){return new _7({type:"success",innerType:Q})}var U7=V("ZodCatch",(Q,H)=>{rJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>$N(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType,Q.removeCatch=Q.unwrap});function z7(Q,H){return new U7({type:"catch",innerType:Q,catchValue:typeof H==="function"?H:()=>H})}var b7=V("ZodNaN",(Q,H)=>{tJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>BN(Q,W,Y,J)});function uB(Q){return yG(b7,Q)}var D1=V("ZodPipe",(Q,H)=>{t6.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>IN(Q,W,Y,J),Q.in=H.in,Q.out=H.out});function SY(Q,H){return new D1({type:"pipe",in:Q,out:H})}var K1=V("ZodCodec",(Q,H)=>{D1.init(Q,H),r4.init(Q,H)});function lB(Q,H,W){return new K1({type:"pipe",in:Q,out:H,transform:W.decode,reverseTransform:W.encode})}function mB(Q){let H=Q._zod.def;return new K1({type:"pipe",in:H.out,out:H.in,transform:H.reverseTransform,reverseTransform:H.transform})}var P7=V("ZodPreprocess",(Q,H)=>{D1.init(Q,H),sJ.init(Q,H)}),Z7=V("ZodReadonly",(Q,H)=>{aJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>LN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function $7(Q){return new Z7({type:"readonly",innerType:Q})}var I7=V("ZodTemplateLiteral",(Q,H)=>{eJ.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>XN(Q,W,Y,J)});function cB(Q,H){return new I7({type:"template_literal",parts:Q,...k.normalizeParams(H)})}var L7=V("ZodLazy",(Q,H)=>{WG.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>jN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.getter()});function ZH(Q){return new L7({type:"lazy",getter:Q})}var T7=V("ZodPromise",(Q,H)=>{HG.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>TN(Q,W,Y,J),Q.unwrap=()=>Q._zod.def.innerType});function pB(Q){return new T7({type:"promise",innerType:Q})}var j7=V("ZodFunction",(Q,H)=>{QG.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>MN(Q,W,Y,J)});function dB(Q){return new j7({type:"function",input:Array.isArray(Q?.input)?G7(Q?.input):Q?.input??A(L()),output:Q?.output??L()})}var E1=V("ZodCustom",(Q,H)=>{YG.init(Q,H),x.init(Q,H),Q._zod.processJSONSchema=(W,Y,J)=>EN(Q,W,Y,J)});function iB(Q){let H=new p({check:"custom"});return H._zod.check=Q,H}function oB(Q,H){return uG(E1,Q??(()=>!0),H)}function R7(Q,H={}){return lG(E1,Q,H)}function C7(Q,H){return mG(Q,H)}var nB=cG,rB=pG;function tB(Q,H={}){let W=new E1({type:"custom",check:"custom",fn:(Y)=>Y instanceof Q,abort:!0,...k.normalizeParams(H)});return W._zod.bag.Class=Q,W._zod.check=(Y)=>{if(!(Y.value instanceof Q))Y.issues.push({code:"invalid_type",expected:Q.name,input:Y.value,inst:W,path:[...W._zod.def.path??[]]})},W}var sB=(...Q)=>dG({Codec:K1,Boolean:KW,String:NW},...Q);function aB(Q){let H=ZH(()=>{return $([B(Q),U(),P(),lQ(),A(H),b(B(),H)])});return H}function QH(Q,H){return new P7({type:"pipe",in:Q8(Q),out:H})}var k7={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 D2(Q){s({customError:Q})}function K2(){return s().customError}var S7;(function(Q){})(S7||(S7={}));var Z={...Q1,...IY,iso:$Q},E2=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 M2(Q,H){let W=Q.$schema;if(W==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(W==="http://json-schema.org/draft-07/schema#")return"draft-7";if(W==="http://json-schema.org/draft-04/schema#")return"draft-4";return H??"draft-2020-12"}function V2(Q,H){if(!Q.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let W=Q.slice(1).split("/").filter(Boolean);if(W.length===0)return H.rootSchema;let Y=H.version==="draft-2020-12"?"$defs":"definitions";if(W[0]===Y){let J=W[1];if(!J||!H.defs[J])throw Error(`Reference not found: ${Q}`);return H.defs[J]}throw Error(`Reference not found: ${Q}`)}function eB(Q,H){if(Q.not!==void 0){if(typeof Q.not==="object"&&Object.keys(Q.not).length===0)return Z.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(Q.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(Q.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(Q.if!==void 0||Q.then!==void 0||Q.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(Q.dependentSchemas!==void 0||Q.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(Q.$ref){let J=Q.$ref;if(H.refs.has(J))return H.refs.get(J);if(H.processing.has(J))return Z.lazy(()=>{if(!H.refs.has(J))throw Error(`Circular reference not resolved: ${J}`);return H.refs.get(J)});H.processing.add(J);let G=V2(J,H),N=DQ(G,H);return H.refs.set(J,N),H.processing.delete(J),N}if(Q.enum!==void 0){let J=Q.enum;if(H.version==="openapi-3.0"&&Q.nullable===!0&&J.length===1&&J[0]===null)return Z.null();if(J.length===0)return Z.never();if(J.length===1)return Z.literal(J[0]);if(J.every((N)=>typeof N==="string"))return Z.enum(J);let G=J.map((N)=>Z.literal(N));if(G.length<2)return G[0];return Z.union([G[0],G[1],...G.slice(2)])}if(Q.const!==void 0)return Z.literal(Q.const);let W=Q.type;if(Array.isArray(W)){let J=W.map((G)=>{let N={...Q,type:G};return eB(N,H)});if(J.length===0)return Z.never();if(J.length===1)return J[0];return Z.union(J)}if(!W)return Z.any();let Y;switch(W){case"string":{let J=Z.string();if(Q.format){let G=Q.format;if(G==="email")J=J.check(Z.email());else if(G==="uri"||G==="uri-reference")J=J.check(Z.url());else if(G==="uuid"||G==="guid")J=J.check(Z.uuid());else if(G==="date-time")J=J.check(Z.iso.datetime());else if(G==="date")J=J.check(Z.iso.date());else if(G==="time")J=J.check(Z.iso.time());else if(G==="duration")J=J.check(Z.iso.duration());else if(G==="ipv4")J=J.check(Z.ipv4());else if(G==="ipv6")J=J.check(Z.ipv6());else if(G==="mac")J=J.check(Z.mac());else if(G==="cidr")J=J.check(Z.cidrv4());else if(G==="cidr-v6")J=J.check(Z.cidrv6());else if(G==="base64")J=J.check(Z.base64());else if(G==="base64url")J=J.check(Z.base64url());else if(G==="e164")J=J.check(Z.e164());else if(G==="jwt")J=J.check(Z.jwt());else if(G==="emoji")J=J.check(Z.emoji());else if(G==="nanoid")J=J.check(Z.nanoid());else if(G==="cuid")J=J.check(Z.cuid());else if(G==="cuid2")J=J.check(Z.cuid2());else if(G==="ulid")J=J.check(Z.ulid());else if(G==="xid")J=J.check(Z.xid());else if(G==="ksuid")J=J.check(Z.ksuid())}if(typeof Q.minLength==="number")J=J.min(Q.minLength);if(typeof Q.maxLength==="number")J=J.max(Q.maxLength);if(Q.pattern)J=J.regex(new RegExp(Q.pattern));Y=J;break}case"number":case"integer":{let J=W==="integer"?Z.number().int():Z.number();if(typeof Q.minimum==="number")J=J.min(Q.minimum);if(typeof Q.maximum==="number")J=J.max(Q.maximum);if(typeof Q.exclusiveMinimum==="number")J=J.gt(Q.exclusiveMinimum);else if(Q.exclusiveMinimum===!0&&typeof Q.minimum==="number")J=J.gt(Q.minimum);if(typeof Q.exclusiveMaximum==="number")J=J.lt(Q.exclusiveMaximum);else if(Q.exclusiveMaximum===!0&&typeof Q.maximum==="number")J=J.lt(Q.maximum);if(typeof Q.multipleOf==="number")J=J.multipleOf(Q.multipleOf);Y=J;break}case"boolean":{Y=Z.boolean();break}case"null":{Y=Z.null();break}case"object":{let J={},G=Q.properties||{},N=new Set(Q.required||[]);for(let[D,E]of Object.entries(G)){let w=DQ(E,H);J[D]=N.has(D)?w:w.optional()}if(Q.propertyNames){let D=DQ(Q.propertyNames,H),E=Q.additionalProperties&&typeof Q.additionalProperties==="object"?DQ(Q.additionalProperties,H):Z.any();if(Object.keys(J).length===0){Y=Z.record(D,E);break}let w=Z.object(J).passthrough(),q=Z.looseRecord(D,E);Y=Z.intersection(w,q);break}if(Q.patternProperties){let D=Q.patternProperties,E=Object.keys(D),w=[];for(let O of E){let _=DQ(D[O],H),I=Z.string().regex(new RegExp(O));w.push(Z.looseRecord(I,_))}let q=[];if(Object.keys(J).length>0)q.push(Z.object(J).passthrough());if(q.push(...w),q.length===0)Y=Z.object({}).passthrough();else if(q.length===1)Y=q[0];else{let O=Z.intersection(q[0],q[1]);for(let _=2;_<q.length;_++)O=Z.intersection(O,q[_]);Y=O}break}let X=Z.object(J);if(Q.additionalProperties===!1)Y=X.strict();else if(typeof Q.additionalProperties==="object")Y=X.catchall(DQ(Q.additionalProperties,H));else Y=X.passthrough();break}case"array":{let{prefixItems:J,items:G}=Q;if(J&&Array.isArray(J)){let N=J.map((D)=>DQ(D,H)),X=G&&typeof G==="object"&&!Array.isArray(G)?DQ(G,H):void 0;if(X)Y=Z.tuple(N).rest(X);else Y=Z.tuple(N);if(typeof Q.minItems==="number")Y=Y.check(Z.minLength(Q.minItems));if(typeof Q.maxItems==="number")Y=Y.check(Z.maxLength(Q.maxItems))}else if(Array.isArray(G)){let N=G.map((D)=>DQ(D,H)),X=Q.additionalItems&&typeof Q.additionalItems==="object"?DQ(Q.additionalItems,H):void 0;if(X)Y=Z.tuple(N).rest(X);else Y=Z.tuple(N);if(typeof Q.minItems==="number")Y=Y.check(Z.minLength(Q.minItems));if(typeof Q.maxItems==="number")Y=Y.check(Z.maxLength(Q.maxItems))}else if(G!==void 0){let N=DQ(G,H),X=Z.array(N);if(typeof Q.minItems==="number")X=X.min(Q.minItems);if(typeof Q.maxItems==="number")X=X.max(Q.maxItems);Y=X}else Y=Z.array(Z.any());break}default:throw Error(`Unsupported type: ${W}`)}return Y}function DQ(Q,H){if(typeof Q==="boolean")return Q?Z.any():Z.never();let W=eB(Q,H),Y=Q.type||Q.enum!==void 0||Q.const!==void 0;if(Q.anyOf&&Array.isArray(Q.anyOf)){let X=Q.anyOf.map((E)=>DQ(E,H)),D=Z.union(X);W=Y?Z.intersection(W,D):D}if(Q.oneOf&&Array.isArray(Q.oneOf)){let X=Q.oneOf.map((E)=>DQ(E,H)),D=Z.xor(X);W=Y?Z.intersection(W,D):D}if(Q.allOf&&Array.isArray(Q.allOf))if(Q.allOf.length===0)W=Y?W:Z.any();else{let X=Y?W:DQ(Q.allOf[0],H),D=Y?0:1;for(let E=D;E<Q.allOf.length;E++)X=Z.intersection(X,DQ(Q.allOf[E],H));W=X}if(Q.nullable===!0&&H.version==="openapi-3.0")W=Z.nullable(W);if(Q.readOnly===!0)W=Z.readonly(W);if(Q.default!==void 0)W=W.default(Q.default);let J={},G=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let X of G)if(X in Q)J[X]=Q[X];let N=["contentEncoding","contentMediaType","contentSchema"];for(let X of N)if(X in Q)J[X]=Q[X];for(let X of Object.keys(Q))if(!E2.has(X))J[X]=Q[X];if(Object.keys(J).length>0)H.registry.add(W,J);if(Q.description)W=W.describe(Q.description);return W}function QX(Q,H){if(typeof Q==="boolean")return Q?Z.any():Z.never();let W;try{W=JSON.parse(JSON.stringify(Q))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let Y=M2(W,H?.defaultTarget),J=W.$defs||W.definitions||{},G={version:Y,defs:J,refs:new Map,processing:new Set,rootSchema:W,registry:H?.registry??YQ};return DQ(W,G)}var M1={};tQ(M1,{string:()=>w2,number:()=>A2,date:()=>O2,boolean:()=>F2,bigint:()=>q2});function w2(Q){return XG(NW,Q)}function A2(Q){return FG(DW,Q)}function F2(Q){return PG(KW,Q)}function q2(Q){return $G(EW,Q)}function O2(Q){return vG(N1,Q)}s(t4());var Y8="2025-11-25";var J8=[Y8,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],G8="io.modelcontextprotocol/related-task",Y0="io.modelcontextprotocol/protocolVersion",MW="io.modelcontextprotocol/clientInfo",IH="io.modelcontextprotocol/serverInfo",J0="io.modelcontextprotocol/clientCapabilities",N8="io.modelcontextprotocol/subscriptionId",VW="io.modelcontextprotocol/logLevel";var G0="2.0";var HH=ZH(()=>$([B(),U(),P(),lQ(),b(B(),HH),A(HH)])),n=b(B(),HH),B8=A(HH),wW=$([B(),U().int()]),AW=B(),V1=M({ttl:U().optional()}),w1=M({taskId:B()}),FW=R({progressToken:wW.optional(),[G8]:w1.optional()}),WQ=M({_meta:FW.optional()}),LH=WQ.extend({task:V1.optional()}),r=M({method:B(),params:WQ.loose().optional()}),KQ=M({_meta:FW.optional()}),JQ=M({method:B(),params:KQ.loose().optional()}),qW=R({get[IH](){return cQ.optional().catch(void 0)}}),t=R({_meta:qW.optional()}),kQ=$([B(),U().int()]),OW=M({jsonrpc:F(G0),id:kQ,...r.shape}).strict(),_W=M({jsonrpc:F(G0),...JQ.shape}).strict(),N0=M({jsonrpc:F(G0),id:kQ,result:t}).strict(),B0=M({jsonrpc:F(G0),id:kQ.optional(),error:M({code:U().int(),message:B(),data:L().optional()})}).strict(),X0=$([OW,_W,N0,B0]),X8=$([N0,B0]),TH=t.strict(),A1=KQ.extend({requestId:kQ.optional(),reason:B().optional()}),UW=JQ.extend({method:F("notifications/cancelled"),params:A1}),F1=M({src:B(),mimeType:B().optional(),sizes:A(B()).optional(),theme:S(["light","dark"]).optional()}),WH=M({icons:A(F1).optional()}),mQ=M({name:B(),title:B().optional()}),cQ=mQ.extend({...mQ.shape,...WH.shape,version:B(),websiteUrl:B().optional(),description:B().optional()}),U2=SQ(M({applyDefaults:P().optional()}),n),z2=QH((Q)=>{if(Q&&typeof Q==="object"&&!Array.isArray(Q)&&Object.keys(Q).length===0)return{form:{}};return Q},SQ(M({form:U2.optional(),url:n.optional()}),n.optional())),D8=R({list:n.optional(),cancel:n.optional(),requests:R({sampling:R({createMessage:n.optional()}).optional(),elicitation:R({create:n.optional()}).optional()}).optional()}),K8=R({list:n.optional(),cancel:n.optional(),requests:R({tools:R({call:n.optional()}).optional()}).optional()}),q1=M({experimental:b(B(),n).optional(),sampling:M({context:n.optional(),tools:n.optional()}).optional(),elicitation:z2.optional(),roots:M({listChanged:P().optional()}).optional(),tasks:D8.optional(),extensions:b(B(),n).optional()}),O1=WQ.extend({protocolVersion:B(),capabilities:q1,clientInfo:cQ}),_1=r.extend({method:F("initialize"),params:O1}),zW=M({experimental:b(B(),n).optional(),logging:n.optional(),completions:n.optional(),prompts:M({listChanged:P().optional()}).optional(),resources:M({subscribe:P().optional(),listChanged:P().optional()}).optional(),tools:M({listChanged:P().optional()}).optional(),tasks:K8.optional(),extensions:b(B(),n).optional()}),U1=t.extend({protocolVersion:B(),capabilities:zW,serverInfo:cQ,instructions:B().optional()}),z1=JQ.extend({method:F("notifications/initialized"),params:KQ.optional()}),b1=r.extend({method:F("server/discover"),params:WQ.optional()}),bW=t.extend({supportedVersions:A(B()),capabilities:zW,instructions:B().optional()}),PW=r.extend({method:F("ping"),params:WQ.optional()}),P1=M({progress:U(),total:T(U()),message:T(B())}),Z1=M({...KQ.shape,...P1.shape,progressToken:wW}),ZW=JQ.extend({method:F("notifications/progress"),params:Z1}),$1=WQ.extend({cursor:AW.optional()}),YH=r.extend({params:$1.optional()}),JH=t.extend({nextCursor:AW.optional()}),$W=M({uri:B(),mimeType:T(B()),_meta:b(B(),L()).optional()}),IW=$W.extend({text:B()}),x7=B().refine((Q)=>{try{return atob(Q),!0}catch{return!1}},{message:"Invalid Base64 string"}),LW=$W.extend({blob:x7}),GH=S(["user","assistant"]),pQ=M({audience:A(GH).optional(),priority:U().min(0).max(1).optional(),lastModified:$Q.datetime({offset:!0}).optional()}),TW=M({...mQ.shape,...WH.shape,uri:B(),description:T(B()),mimeType:T(B()),size:T(U()),annotations:pQ.optional(),_meta:T(R({}))}),I1=M({...mQ.shape,...WH.shape,uriTemplate:B(),description:T(B()),mimeType:T(B()),annotations:pQ.optional(),_meta:T(R({}))}),L1=YH.extend({method:F("resources/list")}),T1=JH.extend({resources:A(TW)}),j1=YH.extend({method:F("resources/templates/list")}),R1=JH.extend({resourceTemplates:A(I1)}),D0=WQ.extend({uri:B()}),C1=D0,S1=r.extend({method:F("resources/read"),params:C1}),k1=t.extend({contents:A($([IW,LW]))}),g1=JQ.extend({method:F("notifications/resources/list_changed"),params:KQ.optional()}),x1=D0,v1=r.extend({method:F("resources/subscribe"),params:x1}),y1=D0,h1=r.extend({method:F("resources/unsubscribe"),params:y1}),jW=M({toolsListChanged:P().optional(),promptsListChanged:P().optional(),resourcesListChanged:P().optional(),resourceSubscriptions:A(B()).optional()}),f1=WQ.extend({notifications:jW}),u1=r.extend({method:F("subscriptions/listen"),params:f1}),l1=KQ.extend({notifications:jW}),m1=JQ.extend({method:F("notifications/subscriptions/acknowledged"),params:l1}),c1=qW.extend({[N8]:kQ}),p1=t.extend({_meta:c1}),d1=KQ.extend({uri:B()}),i1=JQ.extend({method:F("notifications/resources/updated"),params:d1}),o1=M({name:B(),description:T(B()),required:T(P())}),n1=M({...mQ.shape,...WH.shape,description:T(B()),arguments:T(A(o1)),_meta:T(R({}))}),r1=YH.extend({method:F("prompts/list")}),t1=JH.extend({prompts:A(n1)}),s1=WQ.extend({name:B(),arguments:b(B(),B()).optional()}),a1=r.extend({method:F("prompts/get"),params:s1}),K0=M({type:F("text"),text:B(),annotations:pQ.optional(),_meta:b(B(),L()).optional()}),E0=M({type:F("image"),data:x7,mimeType:B(),annotations:pQ.optional(),_meta:b(B(),L()).optional()}),M0=M({type:F("audio"),data:x7,mimeType:B(),annotations:pQ.optional(),_meta:b(B(),L()).optional()}),e1=M({type:F("tool_use"),name:B(),id:B(),input:b(B(),L()),_meta:b(B(),L()).optional()}),V0=M({type:F("resource"),resource:$([IW,LW]),annotations:pQ.optional(),_meta:b(B(),L()).optional()}),w0=TW.extend({type:F("resource_link")}),dQ=$([K0,E0,M0,w0,V0]),Q9=M({role:GH,content:dQ}),H9=t.extend({description:B().optional(),messages:A(Q9)}),W9=JQ.extend({method:F("notifications/prompts/list_changed"),params:KQ.optional()}),Y9=M({title:B().optional(),readOnlyHint:P().optional(),destructiveHint:P().optional(),idempotentHint:P().optional(),openWorldHint:P().optional()}),J9=M({taskSupport:S(["required","optional","forbidden"]).optional()}),jH=M({...mQ.shape,...WH.shape,description:B().optional(),inputSchema:M({type:F("object"),properties:b(B(),HH).optional(),required:A(B()).optional()}).catchall(L()),outputSchema:R({$schema:B().optional()}).optional(),annotations:Y9.optional(),execution:J9.optional(),_meta:b(B(),L()).optional()}),G9=YH.extend({method:F("tools/list")}),N9=JH.extend({tools:A(jH)}),RH=t.extend({content:A(dQ).default([]),structuredContent:L().optional(),isError:P().optional()}),E8=RH.or(t.extend({toolResult:L()})),B9=LH.extend({name:B(),arguments:b(B(),L()).optional()}),X9=r.extend({method:F("tools/call"),params:B9}),D9=JQ.extend({method:F("notifications/tools/list_changed"),params:KQ.optional()}),M8=M({autoRefresh:P().default(!0),debounceMs:U().int().nonnegative().default(300)}),RW=S(["debug","info","notice","warning","error","critical","alert","emergency"]),K9=WQ.extend({level:RW}),E9=r.extend({method:F("logging/setLevel"),params:K9}),M9=KQ.extend({level:RW,logger:B().optional(),data:L()}),V9=JQ.extend({method:F("notifications/message"),params:M9}),w9=M({name:B().optional()}),A9=M({hints:A(w9).optional(),costPriority:U().min(0).max(1).optional(),speedPriority:U().min(0).max(1).optional(),intelligencePriority:U().min(0).max(1).optional()}),F9=M({mode:S(["auto","required","none"]).optional()}),q9=M({type:F("tool_result"),toolUseId:B().describe("The unique identifier for the corresponding tool call."),content:A(dQ),structuredContent:L().optional(),isError:P().optional(),_meta:b(B(),L()).optional()}),O9=PH("type",[K0,E0,M0]),$H=PH("type",[K0,E0,M0,e1,q9]),_9=M({role:GH,content:$([$H,A($H)]),_meta:b(B(),L()).optional()}),U9=LH.extend({messages:A(_9),modelPreferences:A9.optional(),systemPrompt:B().optional(),includeContext:S(["none","thisServer","allServers"]).optional(),temperature:U().optional(),maxTokens:U().int(),stopSequences:A(B()).optional(),metadata:n.optional(),tools:A(jH).optional(),toolChoice:F9.optional()}),z9=r.extend({method:F("sampling/createMessage"),params:U9}),b9=t.extend({model:B(),stopReason:T(S(["endTurn","stopSequence","maxTokens"]).or(B())),role:GH,content:O9}),P9=t.extend({model:B(),stopReason:T(S(["endTurn","stopSequence","maxTokens","toolUse"]).or(B())),role:GH,content:$([$H,A($H)])}),CW=M({type:F("boolean"),title:B().optional(),description:B().optional(),default:P().optional()}),A0=M({type:F("string"),title:B().optional(),description:B().optional(),minLength:U().optional(),maxLength:U().optional(),format:S(["email","uri","date","date-time"]).optional(),default:B().optional()}),F0=M({type:S(["number","integer"]),title:B().optional(),description:B().optional(),minimum:U().optional(),maximum:U().optional(),default:U().optional()}),SW=M({type:F("string"),title:B().optional(),description:B().optional(),enum:A(B()),default:B().optional()}),kW=M({type:F("string"),title:B().optional(),description:B().optional(),oneOf:A(M({const:B(),title:B()})),default:B().optional()}),gW=M({type:F("string"),title:B().optional(),description:B().optional(),enum:A(B()),enumNames:A(B()).optional(),default:B().optional()}),Z9=$([SW,kW]),xW=M({type:F("array"),title:B().optional(),description:B().optional(),minItems:U().optional(),maxItems:U().optional(),items:M({type:F("string"),enum:A(B())}),default:A(B()).optional()}),vW=M({type:F("array"),title:B().optional(),description:B().optional(),minItems:U().optional(),maxItems:U().optional(),items:M({anyOf:A(M({const:B(),title:B()}))}),default:A(B()).optional()}),$9=$([xW,vW]),I9=$([gW,Z9,$9]),yW=$([I9,CW,A0,F0]),q0=LH.extend({mode:F("form").optional(),message:B(),requestedSchema:M({type:F("object"),properties:b(B(),yW),required:A(B()).optional()}).catchall(L())}),L9=LH.extend({mode:F("url"),message:B(),elicitationId:B(),url:B().url()}),T9=$([q0,L9]),j9=r.extend({method:F("elicitation/create"),params:T9}),R9=KQ.extend({elicitationId:B()}),C9=JQ.extend({method:F("notifications/elicitation/complete"),params:R9}),S9=t.extend({action:S(["accept","decline","cancel"]),content:QH((Q)=>Q===null?void 0:Q,b(B(),$([B(),U(),P(),A(B())])).optional())}),k9=M({type:F("ref/resource"),uri:B()}),g9=M({type:F("ref/prompt"),name:B()}),x9=WQ.extend({ref:$([g9,k9]),argument:M({name:B(),value:B()}),context:M({arguments:b(B(),B()).optional()}).optional()}),v9=r.extend({method:F("completion/complete"),params:x9}),y9=t.extend({completion:R({values:A(B()).max(100),total:T(U().int()),hasMore:T(P())})}),h9=M({uri:B().startsWith("file://"),name:B().optional(),_meta:b(B(),L()).optional()}),f9=r.extend({method:F("roots/list"),params:WQ.optional()}),u9=t.extend({roots:A(h9)}),l9=JQ.extend({method:F("notifications/roots/list_changed"),params:KQ.optional()}),V8=R({ttl:U().optional(),pollInterval:U().optional()}),m9=S(["working","input_required","completed","failed","cancelled"]),NH=M({taskId:B(),status:m9,ttl:$([U(),lQ()]),createdAt:B(),lastUpdatedAt:B(),pollInterval:T(U()),statusMessage:T(B())}),w8=t.extend({task:NH}),c9=KQ.merge(NH),A8=JQ.extend({method:F("notifications/tasks/status"),params:c9}),F8=r.extend({method:F("tasks/get"),params:WQ.extend({taskId:B()})}),q8=t.merge(NH),O8=r.extend({method:F("tasks/result"),params:WQ.extend({taskId:B()})}),_8=t.loose(),U8=YH.extend({method:F("tasks/list")}),z8=JH.extend({tasks:A(NH)}),b8=r.extend({method:F("tasks/cancel"),params:WQ.extend({taskId:B()})}),P8=t.merge(NH),Z8=$([PW,_1,b1,v9,E9,a1,r1,L1,j1,S1,v1,h1,u1,X9,G9]),$8=$([UW,ZW,z1,l9]),I8=$([TH,b9,P9,S9,u9]),L8=$([PW,z9,j9,f9]),T8=$([UW,ZW,V9,i1,g1,D9,W9,m1,C9]),j8=$([TH,U1,bW,y9,H9,t1,T1,R1,k1,RH,N9,p1]),HQ=BW().superRefine((Q,H)=>{if(!URL.canParse(Q))return H.addIssue({code:k7.custom,message:"URL must be parseable",fatal:!0}),g4}).refine((Q)=>{let H=new URL(Q);return H.protocol!=="javascript:"&&H.protocol!=="data:"&&H.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),p9=R({resource:B().url(),authorization_servers:A(HQ).optional(),jwks_uri:B().url().optional(),scopes_supported:A(B()).optional(),bearer_methods_supported:A(B()).optional(),resource_signing_alg_values_supported:A(B()).optional(),resource_name:B().optional(),resource_documentation:B().optional(),resource_policy_uri:B().url().optional(),resource_tos_uri:B().url().optional(),tls_client_certificate_bound_access_tokens:P().optional(),authorization_details_types_supported:A(B()).optional(),dpop_signing_alg_values_supported:A(B()).optional(),dpop_bound_access_tokens_required:P().optional()}),hW=R({issuer:B(),authorization_endpoint:HQ,token_endpoint:HQ,registration_endpoint:HQ.optional(),scopes_supported:A(B()).optional(),response_types_supported:A(B()),response_modes_supported:A(B()).optional(),grant_types_supported:A(B()).optional(),token_endpoint_auth_methods_supported:A(B()).optional(),token_endpoint_auth_signing_alg_values_supported:A(B()).optional(),service_documentation:HQ.optional(),revocation_endpoint:HQ.optional(),revocation_endpoint_auth_methods_supported:A(B()).optional(),revocation_endpoint_auth_signing_alg_values_supported:A(B()).optional(),introspection_endpoint:B().optional(),introspection_endpoint_auth_methods_supported:A(B()).optional(),introspection_endpoint_auth_signing_alg_values_supported:A(B()).optional(),code_challenge_methods_supported:A(B()).optional(),client_id_metadata_document_supported:P().optional(),authorization_response_iss_parameter_supported:P().optional().catch(void 0),dpop_signing_alg_values_supported:A(B()).optional()}),d9=R({issuer:B(),authorization_endpoint:HQ,token_endpoint:HQ,userinfo_endpoint:HQ.optional(),jwks_uri:HQ,registration_endpoint:HQ.optional(),scopes_supported:A(B()).optional(),response_types_supported:A(B()),response_modes_supported:A(B()).optional(),grant_types_supported:A(B()).optional(),acr_values_supported:A(B()).optional(),subject_types_supported:A(B()),id_token_signing_alg_values_supported:A(B()),id_token_encryption_alg_values_supported:A(B()).optional(),id_token_encryption_enc_values_supported:A(B()).optional(),userinfo_signing_alg_values_supported:A(B()).optional(),userinfo_encryption_alg_values_supported:A(B()).optional(),userinfo_encryption_enc_values_supported:A(B()).optional(),request_object_signing_alg_values_supported:A(B()).optional(),request_object_encryption_alg_values_supported:A(B()).optional(),request_object_encryption_enc_values_supported:A(B()).optional(),token_endpoint_auth_methods_supported:A(B()).optional(),token_endpoint_auth_signing_alg_values_supported:A(B()).optional(),display_values_supported:A(B()).optional(),claim_types_supported:A(B()).optional(),claims_supported:A(B()).optional(),service_documentation:B().optional(),claims_locales_supported:A(B()).optional(),ui_locales_supported:A(B()).optional(),claims_parameter_supported:P().optional(),request_parameter_supported:P().optional(),request_uri_parameter_supported:P().optional(),require_request_uri_registration:P().optional(),op_policy_uri:HQ.optional(),op_tos_uri:HQ.optional(),client_id_metadata_document_supported:P().optional(),authorization_response_iss_parameter_supported:P().optional().catch(void 0)}),i9=M({...d9.shape,...hW.pick({code_challenge_methods_supported:!0}).shape}),o9=M({access_token:B(),id_token:B().optional(),token_type:B(),expires_in:M1.number().optional(),scope:B().optional(),refresh_token:B().optional(),issuer:B().optional().catch(void 0)}).strip(),n9=M({issued_token_type:F("urn:ietf:params:oauth:token-type:id-jag"),access_token:B(),token_type:B().optional(),expires_in:U().optional(),scope:B().optional()}).strip(),r9=M({error:B(),error_description:B().optional(),error_uri:B().optional()}),g7=HQ.optional().or(F("").transform(()=>{return})),t9=M({redirect_uris:A(HQ),token_endpoint_auth_method:B().optional(),grant_types:A(B()).optional(),response_types:A(B()).optional(),application_type:B().optional(),client_name:B().optional(),client_uri:HQ.optional(),logo_uri:g7,scope:B().optional(),contacts:A(B()).optional(),tos_uri:g7,policy_uri:B().optional(),jwks_uri:HQ.optional(),jwks:aY().optional(),software_id:B().optional(),software_version:B().optional(),software_statement:B().optional()}).strip(),s9=M({client_id:B(),client_secret:B().optional(),client_id_issued_at:U().optional(),client_secret_expires_at:U().optional(),issuer:B().optional().catch(void 0)}).strip(),a9=t9.merge(s9),R8=M({error:B(),error_description:B().optional()}).strip(),C8=M({token:B(),token_type_hint:B().optional()}).strip();var l7=Symbol.for("mcp.sdk.errorBrands");function O0(Q,H){let W=new Set,Y=H;while(typeof Y==="function"){let J=Y.mcpBrand;if(Object.prototype.hasOwnProperty.call(Y,"mcpBrand")&&typeof J==="string")W.add(J);Y=Object.getPrototypeOf(Y)}if(W.size===0)return;Object.defineProperty(Q,l7,{value:W,enumerable:!1,configurable:!0})}function IQ(Q,H){try{if(typeof H==="object"&&H!==null&&Object.prototype.hasOwnProperty.call(Q,"mcpBrand")&&typeof Q.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(H,l7)){let W=H[l7];if(W&&typeof W.has==="function"&&W.has(Q.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(Q,H)}var b2=class Q extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](H){return IQ(this,H)}static isInstance(H){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return IQ(this,H)}constructor(H,W,Y){super(W);this.code=H,this.errorUri=Y,this.name="OAuthError",O0(this,new.target)}toResponseObject(){let H={error:this.code,error_description:this.message};if(this.errorUri)H.error_uri=this.errorUri;return H}static fromResponse(H){return new Q(H.error,H.error_description??H.error,H.error_uri)}},GQ=function(Q){return Q.NotConnected="NOT_CONNECTED",Q.AlreadyConnected="ALREADY_CONNECTED",Q.NotInitialized="NOT_INITIALIZED",Q.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",Q.RequestTimeout="REQUEST_TIMEOUT",Q.ConnectionClosed="CONNECTION_CLOSED",Q.SendFailed="SEND_FAILED",Q.InvalidResult="INVALID_RESULT",Q.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",Q.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",Q.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",Q.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",Q.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",Q.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",Q.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",Q.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",Q.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",Q.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",Q.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",Q}({}),e=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](Q){return IQ(this,Q)}static isInstance(Q){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 IQ(this,Q)}constructor(Q,H,W,Y){super(H,Y);this.code=Q,this.data=W,this.name="SdkError",O0(this,new.target)}},P2=class extends e{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(Q,H,W,Y){super(Q,H,W,Y);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};var Z2="2026-07-28";function zX(Q){return Q>=Z2}function bX(Q){let H=Q.structuredContent;if(H===void 0)return Q;if(!(typeof H!=="object"||H===null||Array.isArray(H)))return Q;if(Q.content?.some((W)=>W.type==="text")??!1)return Q;return{...Q,content:[...Q.content??[],{type:"text",text:JSON.stringify(H)}]}}var PX=["task","inputRequests","requestState"];function $2(Q){if(Q===null||typeof Q!=="object"||Array.isArray(Q)||Q.content!==void 0||PX.some((H)=>(H in Q)))return Q;return{...Q,content:[]}}function I2(){let Q=ZH(()=>$([B(),U(),P(),lQ(),b(B(),Q),A(Q)])),H=b(B(),Q),W=$([B(),U().int()]),Y=B(),J=M({ttl:U().optional()}),G=M({taskId:B()}),N=R({progressToken:W.optional(),"io.modelcontextprotocol/related-task":G.optional()}),X=M({_meta:N.optional()}),D=X.extend({task:J.optional()}),E=M({method:B(),params:X.loose().optional()}),w=M({_meta:N.optional()}),q=M({method:B(),params:w.loose().optional()}),O=R({_meta:N.optional()}),_=$([B(),U().int()]),I=O.strict(),j=w.extend({requestId:_.optional(),reason:B().optional()}),C=q.extend({method:F("notifications/cancelled"),params:j}),v=M({src:B(),mimeType:B().optional(),sizes:A(B()).optional(),theme:S(["light","dark"]).optional()}),i=M({icons:A(v).optional()}),f=M({name:B(),title:B().optional()}),u=f.extend({...f.shape,...i.shape,version:B(),websiteUrl:B().optional(),description:B().optional()}),o=SQ(M({applyDefaults:P().optional()}),H),d=QH((XQ)=>{if(XQ&&typeof XQ==="object"&&!Array.isArray(XQ)&&Object.keys(XQ).length===0)return{form:{}};return XQ},SQ(M({form:o.optional(),url:H.optional()}),H.optional())),QQ=R({list:H.optional(),cancel:H.optional(),requests:R({sampling:R({createMessage:H.optional()}).optional(),elicitation:R({create:H.optional()}).optional()}).optional()}),oQ=R({list:H.optional(),cancel:H.optional(),requests:R({tools:R({call:H.optional()}).optional()}).optional()}),EQ=M({experimental:b(B(),H).optional(),sampling:M({context:H.optional(),tools:H.optional()}).optional(),elicitation:d.optional(),roots:M({listChanged:P().optional()}).optional(),tasks:QQ.optional(),extensions:b(B(),H).optional()}),BH=X.extend({protocolVersion:B(),capabilities:EQ,clientInfo:u}),kH=E.extend({method:F("initialize"),params:BH}),fW=M({experimental:b(B(),H).optional(),logging:H.optional(),completions:H.optional(),prompts:M({listChanged:P().optional()}).optional(),resources:M({subscribe:P().optional(),listChanged:P().optional()}).optional(),tools:M({listChanged:P().optional()}).optional(),tasks:oQ.optional(),extensions:b(B(),H).optional()}),uW=O.extend({protocolVersion:B(),capabilities:fW,serverInfo:u,instructions:B().optional()}),_0=q.extend({method:F("notifications/initialized"),params:w.optional()}),XH=E.extend({method:F("ping"),params:X.optional()}),gH=M({progress:U(),total:T(U()),message:T(B())}),gQ=M({...w.shape,...gH.shape,progressToken:W}),DH=q.extend({method:F("notifications/progress"),params:gQ}),U0=X.extend({cursor:Y.optional()}),nQ=E.extend({params:U0.optional()}),rQ=O.extend({nextCursor:Y.optional()}),z0=M({uri:B(),mimeType:T(B()),_meta:b(B(),L()).optional()}),b0=z0.extend({text:B()}),xH=B().refine((XQ)=>{try{return atob(XQ),!0}catch{return!1}},{message:"Invalid Base64 string"}),P0=z0.extend({blob:xH}),xQ=S(["user","assistant"]),jQ=M({audience:A(xQ).optional(),priority:U().min(0).max(1).optional(),lastModified:$Q.datetime({offset:!0}).optional()}),vH=M({...f.shape,...i.shape,uri:B(),description:T(B()),mimeType:T(B()),size:T(U()),annotations:jQ.optional(),_meta:T(R({}))}),lW=M({...f.shape,...i.shape,uriTemplate:B(),description:T(B()),mimeType:T(B()),annotations:jQ.optional(),_meta:T(R({}))}),mW=nQ.extend({method:F("resources/list")}),cW=rQ.extend({resources:A(vH)}),KH=nQ.extend({method:F("resources/templates/list")}),Z0=rQ.extend({resourceTemplates:A(lW)}),yH=X.extend({uri:B()}),pW=yH,dW=E.extend({method:F("resources/read"),params:pW}),iW=O.extend({contents:A($([b0,P0]))}),oW=q.extend({method:F("notifications/resources/list_changed"),params:w.optional()}),nW=yH,rW=E.extend({method:F("resources/subscribe"),params:nW}),tW=yH,sW=E.extend({method:F("resources/unsubscribe"),params:tW}),aW=w.extend({uri:B()}),eW=q.extend({method:F("notifications/resources/updated"),params:aW}),Q4=M({name:B(),description:T(B()),required:T(P())}),H4=M({...f.shape,...i.shape,description:T(B()),arguments:T(A(Q4)),_meta:T(R({}))}),W4=nQ.extend({method:F("prompts/list")}),Y4=rQ.extend({prompts:A(H4)}),J4=X.extend({name:B(),arguments:b(B(),B()).optional()}),G4=E.extend({method:F("prompts/get"),params:J4}),hH=M({type:F("text"),text:B(),annotations:jQ.optional(),_meta:b(B(),L()).optional()}),fH=M({type:F("image"),data:xH,mimeType:B(),annotations:jQ.optional(),_meta:b(B(),L()).optional()}),uH=M({type:F("audio"),data:xH,mimeType:B(),annotations:jQ.optional(),_meta:b(B(),L()).optional()}),N4=M({type:F("tool_use"),name:B(),id:B(),input:b(B(),L()),_meta:b(B(),L()).optional()}),EH=M({type:F("resource"),resource:$([b0,P0]),annotations:jQ.optional(),_meta:b(B(),L()).optional()}),B4=vH.extend({type:F("resource_link")}),LQ=$([hH,fH,uH,B4,EH]),$0=M({role:xQ,content:LQ}),I0=O.extend({description:B().optional(),messages:A($0)}),lH=q.extend({method:F("notifications/prompts/list_changed"),params:w.optional()}),X4=M({title:B().optional(),readOnlyHint:P().optional(),destructiveHint:P().optional(),idempotentHint:P().optional(),openWorldHint:P().optional()}),L0=M({taskSupport:S(["required","optional","forbidden"]).optional()}),mH=M({...f.shape,...i.shape,description:B().optional(),inputSchema:M({type:F("object"),properties:b(B(),Q).optional(),required:A(B()).optional()}).catchall(L()),outputSchema:M({type:F("object"),properties:b(B(),Q).optional(),required:A(B()).optional()}).catchall(L()).optional(),annotations:X4.optional(),execution:L0.optional(),_meta:b(B(),L()).optional()}),T0=nQ.extend({method:F("tools/list")}),j0=rQ.extend({tools:A(mH)}),R0=O.extend({content:A(LQ),structuredContent:b(B(),L()).optional(),isError:P().optional()}),BQ=D.extend({name:B(),arguments:b(B(),L()).optional()}),D4=E.extend({method:F("tools/call"),params:BQ}),B6=q.extend({method:F("notifications/tools/list_changed"),params:w.optional()}),C0=S(["debug","info","notice","warning","error","critical","alert","emergency"]),K4=X.extend({level:C0}),E4=E.extend({method:F("logging/setLevel"),params:K4}),M4=w.extend({level:C0,logger:B().optional(),data:L()}),V4=q.extend({method:F("notifications/message"),params:M4}),w4=M({name:B().optional()}),A4=M({hints:A(w4).optional(),costPriority:U().min(0).max(1).optional(),speedPriority:U().min(0).max(1).optional(),intelligencePriority:U().min(0).max(1).optional()}),F4=M({mode:S(["auto","required","none"]).optional()}),X6=M({type:F("tool_result"),toolUseId:B().describe("The unique identifier for the corresponding tool call."),content:A(LQ),structuredContent:M({}).loose().optional(),isError:P().optional(),_meta:b(B(),L()).optional()}),q4=PH("type",[hH,fH,uH]),MH=PH("type",[hH,fH,uH,N4,X6]),O4=M({role:xQ,content:$([MH,A(MH)]),_meta:b(B(),L()).optional()}),_4=D.extend({messages:A(O4),modelPreferences:A4.optional(),systemPrompt:B().optional(),includeContext:S(["none","thisServer","allServers"]).optional(),temperature:U().optional(),maxTokens:U().int(),stopSequences:A(B()).optional(),metadata:H.optional(),tools:A(mH).optional(),toolChoice:F4.optional()}),U4=E.extend({method:F("sampling/createMessage"),params:_4}),z4=O.extend({model:B(),stopReason:T(S(["endTurn","stopSequence","maxTokens"]).or(B())),role:xQ,content:q4}),b4=O.extend({model:B(),stopReason:T(S(["endTurn","stopSequence","maxTokens","toolUse"]).or(B())),role:xQ,content:$([MH,A(MH)])}),P4=M({type:F("boolean"),title:B().optional(),description:B().optional(),default:P().optional()}),Z4=M({type:F("string"),title:B().optional(),description:B().optional(),minLength:U().optional(),maxLength:U().optional(),format:S(["email","uri","date","date-time"]).optional(),default:B().optional()}),$4=M({type:S(["number","integer"]),title:B().optional(),description:B().optional(),minimum:U().optional(),maximum:U().optional(),default:U().optional()}),I4=M({type:F("string"),title:B().optional(),description:B().optional(),enum:A(B()),default:B().optional()}),L4=M({type:F("string"),title:B().optional(),description:B().optional(),oneOf:A(M({const:B(),title:B()})),default:B().optional()}),T4=M({type:F("string"),title:B().optional(),description:B().optional(),enum:A(B()),enumNames:A(B()).optional(),default:B().optional()}),j4=$([I4,L4]),cH=M({type:F("array"),title:B().optional(),description:B().optional(),minItems:U().optional(),maxItems:U().optional(),items:M({type:F("string"),enum:A(B())}),default:A(B()).optional()}),pH=M({type:F("array"),title:B().optional(),description:B().optional(),minItems:U().optional(),maxItems:U().optional(),items:M({anyOf:A(M({const:B(),title:B()}))}),default:A(B()).optional()}),D6=$([cH,pH]),K6=$([T4,j4,D6]),zQ=$([K6,P4,Z4,$4]),bQ=D.extend({mode:F("form").optional(),message:B(),requestedSchema:M({type:F("object"),properties:b(B(),zQ),required:A(B()).optional()}).catchall(L())}),R4=D.extend({mode:F("url"),message:B(),elicitationId:B(),url:B().url()}),RQ=$([bQ,R4]),E6=E.extend({method:F("elicitation/create"),params:RQ}),M6=w.extend({elicitationId:B()}),V6=q.extend({method:F("notifications/elicitation/complete"),params:M6}),w6=O.extend({action:S(["accept","decline","cancel"]),content:QH((XQ)=>XQ===null?void 0:XQ,b(B(),$([B(),U(),P(),A(B())])).optional())}),A6=M({type:F("ref/resource"),uri:B()}),F6=M({type:F("ref/prompt"),name:B()}),q6=X.extend({ref:$([F6,A6]),argument:M({name:B(),value:B()}),context:M({arguments:b(B(),B()).optional()}).optional()}),C4=E.extend({method:F("completion/complete"),params:q6}),O6=O.extend({completion:R({values:A(B()).max(100),total:T(U().int()),hasMore:T(P())})}),_6=M({uri:B().startsWith("file://"),name:B().optional(),_meta:b(B(),L()).optional()}),S0=E.extend({method:F("roots/list"),params:X.optional()}),S4=O.extend({roots:A(_6)}),U6=q.extend({method:F("notifications/roots/list_changed"),params:w.optional()}),z6=R({ttl:U().optional(),pollInterval:U().optional()}),k4=S(["working","input_required","completed","failed","cancelled"]),VH=M({taskId:B(),status:k4,ttl:$([U(),lQ()]),createdAt:B(),lastUpdatedAt:B(),pollInterval:T(U()),statusMessage:T(B())}),qQ=O.extend({task:VH}),b6=w.merge(VH),dH=q.extend({method:F("notifications/tasks/status"),params:b6}),k0=E.extend({method:F("tasks/get"),params:X.extend({taskId:B()})}),g0=O.merge(VH),x0=E.extend({method:F("tasks/result"),params:X.extend({taskId:B()})}),y8=O.loose(),MQ=nQ.extend({method:F("tasks/list")}),a=rQ.extend({tasks:A(VH)}),iH=E.extend({method:F("tasks/cancel"),params:X.extend({taskId:B()})});return{JSONValueSchema:Q,JSONObjectSchema:H,ProgressTokenSchema:W,CursorSchema:Y,TaskMetadataSchema:J,RelatedTaskMetadataSchema:G,RequestMetaSchema:N,BaseRequestParamsSchema:X,TaskAugmentedRequestParamsSchema:D,RequestSchema:E,NotificationsParamsSchema:w,NotificationSchema:q,ResultSchema:O,RequestIdSchema:_,EmptyResultSchema:I,CancelledNotificationParamsSchema:j,CancelledNotificationSchema:C,IconSchema:v,IconsSchema:i,BaseMetadataSchema:f,ImplementationSchema:u,ClientTasksCapabilitySchema:QQ,ServerTasksCapabilitySchema:oQ,ClientCapabilitiesSchema:EQ,InitializeRequestParamsSchema:BH,InitializeRequestSchema:kH,ServerCapabilitiesSchema:fW,InitializeResultSchema:uW,InitializedNotificationSchema:_0,PingRequestSchema:XH,ProgressSchema:gH,ProgressNotificationParamsSchema:gQ,ProgressNotificationSchema:DH,PaginatedRequestParamsSchema:U0,PaginatedRequestSchema:nQ,PaginatedResultSchema:rQ,ResourceContentsSchema:z0,TextResourceContentsSchema:b0,BlobResourceContentsSchema:P0,RoleSchema:xQ,AnnotationsSchema:jQ,ResourceSchema:vH,ResourceTemplateSchema:lW,ListResourcesRequestSchema:mW,ListResourcesResultSchema:cW,ListResourceTemplatesRequestSchema:KH,ListResourceTemplatesResultSchema:Z0,ResourceRequestParamsSchema:yH,ReadResourceRequestParamsSchema:pW,ReadResourceRequestSchema:dW,ReadResourceResultSchema:iW,ResourceListChangedNotificationSchema:oW,SubscribeRequestParamsSchema:nW,SubscribeRequestSchema:rW,UnsubscribeRequestParamsSchema:tW,UnsubscribeRequestSchema:sW,ResourceUpdatedNotificationParamsSchema:aW,ResourceUpdatedNotificationSchema:eW,PromptArgumentSchema:Q4,PromptSchema:H4,ListPromptsRequestSchema:W4,ListPromptsResultSchema:Y4,GetPromptRequestParamsSchema:J4,GetPromptRequestSchema:G4,TextContentSchema:hH,ImageContentSchema:fH,AudioContentSchema:uH,ToolUseContentSchema:N4,EmbeddedResourceSchema:EH,ResourceLinkSchema:B4,ContentBlockSchema:LQ,PromptMessageSchema:$0,GetPromptResultSchema:I0,PromptListChangedNotificationSchema:lH,ToolAnnotationsSchema:X4,ToolExecutionSchema:L0,ToolSchema:mH,ListToolsRequestSchema:T0,ListToolsResultSchema:j0,CallToolResultSchema:R0,CallToolRequestParamsSchema:BQ,CallToolRequestSchema:D4,ToolListChangedNotificationSchema:B6,LoggingLevelSchema:C0,SetLevelRequestParamsSchema:K4,SetLevelRequestSchema:E4,LoggingMessageNotificationParamsSchema:M4,LoggingMessageNotificationSchema:V4,ModelHintSchema:w4,ModelPreferencesSchema:A4,ToolChoiceSchema:F4,ToolResultContentSchema:X6,SamplingContentSchema:q4,SamplingMessageContentBlockSchema:MH,SamplingMessageSchema:O4,CreateMessageRequestParamsSchema:_4,CreateMessageRequestSchema:U4,CreateMessageResultSchema:z4,CreateMessageResultWithToolsSchema:b4,BooleanSchemaSchema:P4,StringSchemaSchema:Z4,NumberSchemaSchema:$4,UntitledSingleSelectEnumSchemaSchema:I4,TitledSingleSelectEnumSchemaSchema:L4,LegacyTitledEnumSchemaSchema:T4,SingleSelectEnumSchemaSchema:j4,UntitledMultiSelectEnumSchemaSchema:cH,TitledMultiSelectEnumSchemaSchema:pH,MultiSelectEnumSchemaSchema:D6,EnumSchemaSchema:K6,PrimitiveSchemaDefinitionSchema:zQ,ElicitRequestFormParamsSchema:bQ,ElicitRequestURLParamsSchema:R4,ElicitRequestParamsSchema:RQ,ElicitRequestSchema:E6,ElicitationCompleteNotificationParamsSchema:M6,ElicitationCompleteNotificationSchema:V6,ElicitResultSchema:w6,ResourceTemplateReferenceSchema:A6,PromptReferenceSchema:F6,CompleteRequestParamsSchema:q6,CompleteRequestSchema:C4,CompleteResultSchema:O6,RootSchema:_6,ListRootsRequestSchema:S0,ListRootsResultSchema:S4,RootsListChangedNotificationSchema:U6,TaskCreationParamsSchema:z6,TaskStatusSchema:k4,TaskSchema:VH,CreateTaskResultSchema:qQ,TaskStatusNotificationParamsSchema:b6,TaskStatusNotificationSchema:dH,GetTaskRequestSchema:k0,GetTaskResultSchema:g0,GetTaskPayloadRequestSchema:x0,GetTaskPayloadResultSchema:y8,ListTasksRequestSchema:MQ,ListTasksResultSchema:a,CancelTaskRequestSchema:iH,CancelTaskResultSchema:O.merge(VH),ClientRequestSchema:$([XH,kH,C4,E4,G4,W4,mW,KH,dW,rW,sW,D4,T0,k0,x0,MQ,iH]),ClientNotificationSchema:$([C,DH,_0,U6,dH]),ClientResultSchema:$([I,z4,b4,w6,S4,g0,a,qQ]),ServerRequestSchema:$([XH,U4,E6,S0,k0,x0,MQ,iH]),ServerNotificationSchema:$([C,DH,V4,eW,oW,B6,lH,dH,V6]),ServerResultSchema:$([I,uW,O6,I0,Y4,cW,Z0,iW,R0,j0,g0,a,qQ]),CallToolResultWireSchema:L().superRefine((XQ,AD)=>{if(typeof XQ!=="object"||XQ===null||Array.isArray(XQ)||XQ.content!==void 0)return;for(let J5 of PX)if(J5 in XQ){AD.addIssue({code:"custom",message:`content is required when the body carries '${J5}' — another result family cannot default into an empty tools/call success`});return}}).transform($2).pipe(R0)}}var L2;function ZX(){return L2??=I2()}function $X(Q){return Q.type!=="object"}var T2=new Set(["const","enum","default","examples"]),j2=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function KX(Q){return Q!==void 0&&!(typeof Q==="string"&&Q.startsWith("#"))}function R2(Q){let H=typeof Q.$schema==="string"?Q.$schema:void 0;if(KX(Q.$id))return{...H!==void 0&&{$schema:H},type:"object",properties:{result:Q},required:["result"]};let W=X5(Q.$schema)&&Q.$recursiveAnchor!==!0,Y=(J,G)=>{if(Array.isArray(J))return J.map((D)=>Y(D,!1));if(J===null||typeof J!=="object")return J;if(!G&&KX(J.$id))return J;let N={},X=!1;for(let[D,E]of Object.entries(J))if(G)N[D]=Y(E,!1);else if((D==="$ref"||D==="$dynamicRef")&&typeof E==="string")N[D]=E==="#"?"#/properties/result":E.startsWith("#/")?`#/properties/result${E.slice(1)}`:E;else if(D==="$recursiveRef"&&E==="#"&&W)X=!0;else if(T2.has(D))N[D]=E;else if(j2.has(D))N[D]=Y(E,!0);else N[D]=Y(E,!1);if(X)if("$ref"in N)N.allOf=[...Array.isArray(N.allOf)?N.allOf:[],{$ref:"#/properties/result"}];else N.$ref="#/properties/result";return N};return{...H!==void 0&&{$schema:H},type:"object",properties:{result:Y(Q,!1)},required:["result"]}}var IX={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},LX={"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},C2={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},S8;function o7(){if(S8)return S8;let Q=ZX();return S8={requestSchemas:{ping:Q.PingRequestSchema,initialize:Q.InitializeRequestSchema,"completion/complete":Q.CompleteRequestSchema,"logging/setLevel":Q.SetLevelRequestSchema,"prompts/get":Q.GetPromptRequestSchema,"prompts/list":Q.ListPromptsRequestSchema,"resources/list":Q.ListResourcesRequestSchema,"resources/templates/list":Q.ListResourceTemplatesRequestSchema,"resources/read":Q.ReadResourceRequestSchema,"resources/subscribe":Q.SubscribeRequestSchema,"resources/unsubscribe":Q.UnsubscribeRequestSchema,"tools/call":Q.CallToolRequestSchema,"tools/list":Q.ListToolsRequestSchema,"tasks/get":Q.GetTaskRequestSchema,"tasks/result":Q.GetTaskPayloadRequestSchema,"tasks/list":Q.ListTasksRequestSchema,"tasks/cancel":Q.CancelTaskRequestSchema,"sampling/createMessage":Q.CreateMessageRequestSchema,"elicitation/create":Q.ElicitRequestSchema,"roots/list":Q.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":Q.CancelledNotificationSchema,"notifications/progress":Q.ProgressNotificationSchema,"notifications/initialized":Q.InitializedNotificationSchema,"notifications/roots/list_changed":Q.RootsListChangedNotificationSchema,"notifications/tasks/status":Q.TaskStatusNotificationSchema,"notifications/message":Q.LoggingMessageNotificationSchema,"notifications/resources/updated":Q.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":Q.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":Q.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":Q.PromptListChangedNotificationSchema,"notifications/elicitation/complete":Q.ElicitationCompleteNotificationSchema},resultSchemas:{ping:Q.EmptyResultSchema,initialize:Q.InitializeResultSchema,"completion/complete":Q.CompleteResultSchema,"logging/setLevel":Q.EmptyResultSchema,"prompts/get":Q.GetPromptResultSchema,"prompts/list":Q.ListPromptsResultSchema,"resources/list":Q.ListResourcesResultSchema,"resources/templates/list":Q.ListResourceTemplatesResultSchema,"resources/read":Q.ReadResourceResultSchema,"resources/subscribe":Q.EmptyResultSchema,"resources/unsubscribe":Q.EmptyResultSchema,"tools/call":Q.CallToolResultWireSchema,"tools/list":Q.ListToolsResultSchema,"sampling/createMessage":Q.CreateMessageResultWithToolsSchema,"elicitation/create":Q.ElicitResultSchema,"roots/list":Q.ListRootsResultSchema}},S8}function TX(Q){return Object.prototype.hasOwnProperty.call(IX,Q)}function jX(Q){return Object.prototype.hasOwnProperty.call(LX,Q)}function S2(Q){return Object.prototype.hasOwnProperty.call(C2,Q)}function k2(Q){return S2(Q)?o7().resultSchemas[Q]:void 0}function g2(Q){return TX(Q)?o7().requestSchemas[Q]:void 0}function x2(Q){return jX(Q)?o7().notificationSchemas[Q]:void 0}var uV=Object.keys(IX),lV=Object.keys(LX);function m7(Q){return Q!==null&&typeof Q==="object"&&!Array.isArray(Q)}function k8(Q,H){if(Q===void 0)return{ok:!1,reason:"not-in-era"};let W=Q.safeParse(H);return W.success?{ok:!0,value:W.data}:{ok:!1,reason:"invalid",message:String(W.error)}}var EX={ok:!1,reason:"not-in-era"};function MX(Q){return m7(Q)&&m7(Q.outputSchema)&&$X(Q.outputSchema)}function VX(Q){return Q}var n7={era:"2025-11-25",hasRequestMethod:TX,hasNotificationMethod:jX,validateRequest:(Q,H)=>k8(g2(Q),H),validateResult:(Q,H)=>k8(k2(Q),H),validateNotification:(Q,H)=>k8(x2(Q),H),hasInputRequestMethod:()=>!1,validateInputRequest:()=>EX,validateInputResponse:()=>EX,samplingResultVariant:(Q,H)=>{let W=ZX();return k8(Q?W.CreateMessageResultWithToolsSchema:W.CreateMessageResultSchema,H)},outboundEnvelope:(Q)=>{return},validateEnvelopeMeta:(Q)=>[],projectCallToolResult(Q,H){let W=bX(Q),Y=W.structuredContent;if(Y===void 0)return W;let J=typeof Y!=="object"||Y===null||Array.isArray(Y),G=H!==void 0&&$X(H);if(!J&&!G)return W;return{...W,structuredContent:{result:Y}}},decodeResult(Q,H){if(m7(H)&&"resultType"in H){let W={...H};return delete W.resultType,{kind:"complete",result:VX(W)}}return{kind:"complete",result:VX(H)}},encodeResult(Q,H){if(Q!=="tools/list")return H;let W=H.tools;if(!Array.isArray(W)||!W.some((Y)=>MX(Y)))return H;return{...H,tools:W.map((Y)=>MX(Y)?{...Y,outputSchema:R2(Y.outputSchema)}:Y)}},encodeErrorCode:(Q)=>Q===-32002?-32602:Q,checkInboundEnvelope:(Q)=>{return}};function v2(){let Q=ZH(()=>$([B(),U(),P(),lQ(),b(B(),Q),A(Q)])),H=b(B(),Q),W=$([B(),U().int()]),Y=B(),J=$([B(),U().int()]),G=S(["user","assistant"]),N=S(["debug","info","notice","warning","error","critical","alert","emergency"]),X=B().refine((a)=>{try{return atob(a),!0}catch{return!1}},{message:"Invalid Base64 string"}),D=M({ttl:U().optional()}),E=M({taskId:B()}),w=R({progressToken:W.optional(),"io.modelcontextprotocol/related-task":E.optional()}),q=M({_meta:w.optional()}),O=q.extend({task:D.optional()}),_=M({_meta:w.optional()}),I=M({method:B(),params:_.loose().optional()}),j=M({src:B(),mimeType:B().optional(),sizes:A(B()).optional(),theme:S(["light","dark"]).optional()}),C=M({icons:A(j).optional()}),v=M({name:B(),title:B().optional()}),i=v.extend({...v.shape,...C.shape,version:B(),websiteUrl:B().optional(),description:B().optional()}),f=SQ(M({applyDefaults:P().optional()}),H),u=QH((a)=>{if(a&&typeof a==="object"&&!Array.isArray(a)&&Object.keys(a).length===0)return{form:{}};return a},SQ(M({form:f.optional(),url:H.optional()}),H.optional())),o=R({list:H.optional(),cancel:H.optional(),requests:R({sampling:R({createMessage:H.optional()}).optional(),elicitation:R({create:H.optional()}).optional()}).optional()}),d=R({list:H.optional(),cancel:H.optional(),requests:R({tools:R({call:H.optional()}).optional()}).optional()}),QQ=M({experimental:b(B(),H).optional(),sampling:M({context:H.optional(),tools:H.optional()}).optional(),elicitation:u.optional(),roots:M({listChanged:P().optional()}).optional(),tasks:o.optional(),extensions:b(B(),H).optional()}),oQ=M({experimental:b(B(),H).optional(),logging:H.optional(),completions:H.optional(),prompts:M({listChanged:P().optional()}).optional(),resources:M({subscribe:P().optional(),listChanged:P().optional()}).optional(),tools:M({listChanged:P().optional()}).optional(),tasks:d.optional(),extensions:b(B(),H).optional()}),EQ=M({progress:U(),total:T(U()),message:T(B())}),BH=M({..._.shape,...EQ.shape,progressToken:W}),kH=I.extend({method:F("notifications/progress"),params:BH}),fW=_.extend({level:N,logger:B().optional(),data:L()}),uW=I.extend({method:F("notifications/message"),params:fW}),_0=M({uri:B(),mimeType:T(B()),_meta:b(B(),L()).optional()}),XH=_0.extend({text:B()}),gH=_0.extend({blob:X}),gQ=M({audience:A(G).optional(),priority:U().min(0).max(1).optional(),lastModified:$Q.datetime({offset:!0}).optional()}),DH=M({...v.shape,...C.shape,uri:B(),description:T(B()),mimeType:T(B()),size:T(U()),annotations:gQ.optional(),_meta:T(R({}))}),U0=M({...v.shape,...C.shape,uriTemplate:B(),description:T(B()),mimeType:T(B()),annotations:gQ.optional(),_meta:T(R({}))}),nQ=I.extend({method:F("notifications/resources/list_changed"),params:_.optional()}),rQ=_.extend({uri:B()}),z0=I.extend({method:F("notifications/resources/updated"),params:rQ}),b0=M({name:B(),description:T(B()),required:T(P())}),xH=M({...v.shape,...C.shape,description:T(B()),arguments:T(A(b0)),_meta:T(R({}))}),P0=I.extend({method:F("notifications/prompts/list_changed"),params:_.optional()}),xQ=M({type:F("text"),text:B(),annotations:gQ.optional(),_meta:b(B(),L()).optional()}),jQ=M({type:F("image"),data:X,mimeType:B(),annotations:gQ.optional(),_meta:b(B(),L()).optional()}),vH=M({type:F("audio"),data:X,mimeType:B(),annotations:gQ.optional(),_meta:b(B(),L()).optional()}),lW=M({type:F("tool_use"),name:B(),id:B(),input:b(B(),L()),_meta:b(B(),L()).optional()}),mW=M({type:F("resource"),resource:$([XH,gH]),annotations:gQ.optional(),_meta:b(B(),L()).optional()}),cW=DH.extend({type:F("resource_link")}),KH=$([xQ,jQ,vH,cW,mW]),Z0=M({role:G,content:KH}),yH=M({title:B().optional(),readOnlyHint:P().optional(),destructiveHint:P().optional(),idempotentHint:P().optional(),openWorldHint:P().optional()}),pW=I.extend({method:F("notifications/tools/list_changed"),params:_.optional()}),dW=M({name:B().optional()}),iW=M({hints:A(dW).optional(),costPriority:U().min(0).max(1).optional(),speedPriority:U().min(0).max(1).optional(),intelligencePriority:U().min(0).max(1).optional()}),oW=M({mode:S(["auto","required","none"]).optional()}),nW=M({type:F("boolean"),title:B().optional(),description:B().optional(),default:P().optional()}),rW=M({type:F("string"),title:B().optional(),description:B().optional(),minLength:U().optional(),maxLength:U().optional(),format:S(["email","uri","date","date-time"]).optional(),default:B().optional()}),tW=M({type:S(["number","integer"]),title:B().optional(),description:B().optional(),minimum:U().optional(),maximum:U().optional(),default:U().optional()}),sW=M({type:F("string"),title:B().optional(),description:B().optional(),enum:A(B()),default:B().optional()}),aW=M({type:F("string"),title:B().optional(),description:B().optional(),oneOf:A(M({const:B(),title:B()})),default:B().optional()}),eW=M({type:F("string"),title:B().optional(),description:B().optional(),enum:A(B()),enumNames:A(B()).optional(),default:B().optional()}),Q4=$([sW,aW]),H4=M({type:F("array"),title:B().optional(),description:B().optional(),minItems:U().optional(),maxItems:U().optional(),items:M({type:F("string"),enum:A(B())}),default:A(B()).optional()}),W4=M({type:F("array"),title:B().optional(),description:B().optional(),minItems:U().optional(),maxItems:U().optional(),items:M({anyOf:A(M({const:B(),title:B()}))}),default:A(B()).optional()}),Y4=$([H4,W4]),J4=$([eW,Q4,Y4]),G4=$([J4,nW,rW,tW]),hH=O.extend({mode:F("form").optional(),message:B(),requestedSchema:M({type:F("object"),properties:b(B(),G4),required:A(B()).optional()}).catchall(L())}),fH=M({type:F("ref/resource"),uri:B()}),uH=M({type:F("ref/prompt"),name:B()}),N4=M({uri:B().startsWith("file://"),name:B().optional(),_meta:b(B(),L()).optional()}),EH=QQ.shape,B4=M({experimental:EH.experimental,sampling:EH.sampling,elicitation:EH.elicitation,roots:EH.roots,extensions:EH.extensions}),LQ=oQ.shape,$0=M({experimental:LQ.experimental,logging:LQ.logging,completions:LQ.completions,prompts:LQ.prompts,resources:LQ.resources,tools:LQ.tools,extensions:LQ.extensions}),I0=R({progressToken:W.optional(),[Y0]:B(),[MW]:i.optional(),[J0]:B4,[VW]:N.optional()}),lH=M({...v.shape,...C.shape,description:B().optional(),inputSchema:R({$schema:B().optional(),type:F("object")}),outputSchema:R({$schema:B().optional()}).optional(),annotations:yH.optional(),_meta:b(B(),L()).optional()}),X4=M({type:F("tool_result"),toolUseId:B(),content:A(KH),structuredContent:L().optional(),isError:P().optional(),_meta:b(B(),L()).optional()}),L0=$([xQ,jQ,vH,lW,X4]),mH=M({role:G,content:$([L0,A(L0)]),_meta:b(B(),L()).optional()}),T0=B(),j0=R({[IH]:i.optional().catch(void 0)}),R0=j0.optional();function BQ(a){return R({_meta:R0,resultType:T0.default("complete"),...a})}let D4=BQ({}),B6=BQ({nextCursor:Y.optional()}),C0=BQ({content:A(KH),structuredContent:L().optional(),isError:P().optional()}),K4=BQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),tools:A(lH),nextCursor:Y.optional()}),E4=BQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),prompts:A(xH),nextCursor:Y.optional()}),M4=BQ({description:B().optional(),messages:A(Z0)}),V4=BQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),resources:A(DH),nextCursor:Y.optional()}),w4=BQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),resourceTemplates:A(U0),nextCursor:Y.optional()}),A4=BQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),contents:A($([XH,gH]))}),F4=BQ({completion:M({values:A(B()).max(100),total:U().int().optional(),hasMore:P().optional()}).loose()}),X6=BQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"])}),q4=BQ({ttlMs:U().int().min(0).catch(0),cacheScope:S(["public","private"]).catch("private"),supportedVersions:A(B()),capabilities:$0,instructions:B().optional()}),MH=M({messages:A(mH),modelPreferences:iW.optional(),systemPrompt:B().optional(),includeContext:S(["none","thisServer","allServers"]).optional(),temperature:U().optional(),maxTokens:U().int(),stopSequences:A(B()).optional(),metadata:H.optional(),tools:A(lH).optional(),toolChoice:oW.optional()}),O4=M({method:F("sampling/createMessage"),params:MH}),_4=M({method:F("roots/list"),params:M({_meta:b(B(),L()).optional()}).optional()}),U4=M({...mH.shape,model:B(),stopReason:B().optional()}),z4=M({roots:A(N4)}),b4=M({action:S(["accept","decline","cancel"]),content:b(B(),$([B(),U(),P(),A(B())])).optional()}),P4=M({mode:F("url"),message:B(),url:B().url()}),Z4=$([hH,P4]),$4=M({method:F("elicitation/create"),params:Z4}),I4=$([O4,_4,$4]),L4=$([U4,z4,b4]),T4=b(B(),I4),j4=b(B(),L4),cH=BQ({inputRequests:T4.optional(),requestState:B().optional()}),pH={inputResponses:j4.optional(),requestState:B().optional()},D6=M({_meta:I0,...pH}),K6=R({progressToken:W.optional()});function zQ(a,iH){return M({method:F(a),params:M({_meta:I0,...iH})})}function bQ(a,iH){return M({method:F(a),params:M({_meta:K6.optional(),...iH}).optional()})}let R4={name:B(),arguments:b(B(),L()).optional(),...pH},RQ={cursor:Y.optional()},E6=zQ("tools/call",R4),M6=zQ("tools/list",RQ),V6=zQ("prompts/list",RQ),w6=zQ("prompts/get",{name:B(),arguments:b(B(),B()).optional(),...pH}),A6=zQ("resources/list",RQ),F6=zQ("resources/templates/list",RQ),q6=zQ("resources/read",{uri:B(),...pH}),C4={ref:$([uH,fH]),argument:M({name:B(),value:B()}),context:M({arguments:b(B(),B()).optional()}).optional()},O6=zQ("completion/complete",C4),_6=zQ("server/discover",{}),S0=M({toolsListChanged:P().optional(),promptsListChanged:P().optional(),resourcesListChanged:P().optional(),resourceSubscriptions:A(B()).optional()}),S4={notifications:S0},U6=zQ("subscriptions/listen",S4),z6=j0.extend({"io.modelcontextprotocol/subscriptionId":J}),k4=R({_meta:z6,resultType:T0.default("complete")}),VH={"tools/call":bQ("tools/call",R4),"tools/list":bQ("tools/list",RQ),"prompts/get":bQ("prompts/get",{name:B(),arguments:b(B(),B()).optional()}),"prompts/list":bQ("prompts/list",RQ),"resources/list":bQ("resources/list",RQ),"resources/templates/list":bQ("resources/templates/list",RQ),"resources/read":bQ("resources/read",{uri:B()}),"completion/complete":bQ("completion/complete",C4),"server/discover":bQ("server/discover",{}),"subscriptions/listen":bQ("subscriptions/listen",S4)};function qQ(a){return R({_meta:R0,...a})}let b6={"tools/call":qQ({content:A(KH),structuredContent:L().optional(),isError:P().optional()}),"tools/list":qQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),tools:A(lH),nextCursor:Y.optional()}),"prompts/get":qQ({description:B().optional(),messages:A(Z0)}),"prompts/list":qQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),prompts:A(xH),nextCursor:Y.optional()}),"resources/list":qQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),resources:A(DH),nextCursor:Y.optional()}),"resources/templates/list":qQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),resourceTemplates:A(U0),nextCursor:Y.optional()}),"resources/read":qQ({ttlMs:U().int().min(0),cacheScope:S(["public","private"]),contents:A($([XH,gH]))}),"completion/complete":qQ({completion:M({values:A(B()).max(100),total:U().int().optional(),hasMore:P().optional()}).loose()}),"server/discover":qQ({ttlMs:U().int().min(0).catch(0),cacheScope:S(["public","private"]).catch("private"),supportedVersions:A(B()),capabilities:$0,instructions:B().optional()}),"subscriptions/listen":qQ({})},dH=R({"io.modelcontextprotocol/subscriptionId":J.optional()}),k0=M({method:F("notifications/subscriptions/acknowledged"),params:M({_meta:dH.optional(),notifications:S0})}),g0=M({_meta:dH.optional(),requestId:J,reason:B().optional()}),x0=M({method:F("notifications/cancelled"),params:g0}),y8={"notifications/cancelled":x0,"notifications/progress":kH,"notifications/message":uW,"notifications/resources/updated":z0,"notifications/resources/list_changed":nQ,"notifications/tools/list_changed":pW,"notifications/prompts/list_changed":P0,"notifications/subscriptions/acknowledged":k0},MQ=(a)=>M({jsonrpc:F("2.0"),id:$([B(),U().int()]),result:a}).strict();return{JSONValueSchema:Q,JSONObjectSchema:H,ProgressTokenSchema:W,CursorSchema:Y,RequestIdSchema:J,RoleSchema:G,LoggingLevelSchema:N,TaskMetadataSchema:D,RelatedTaskMetadataSchema:E,RequestMetaSchema:w,BaseRequestParamsSchema:q,TaskAugmentedRequestParamsSchema:O,NotificationsParamsSchema:_,NotificationSchema:I,IconSchema:j,IconsSchema:C,BaseMetadataSchema:v,ImplementationSchema:i,ClientTasksCapabilitySchema:o,ServerTasksCapabilitySchema:d,ClientCapabilitiesSchema:QQ,ServerCapabilitiesSchema:oQ,ProgressSchema:EQ,ProgressNotificationParamsSchema:BH,ProgressNotificationSchema:kH,LoggingMessageNotificationParamsSchema:fW,LoggingMessageNotificationSchema:uW,ResourceContentsSchema:_0,TextResourceContentsSchema:XH,BlobResourceContentsSchema:gH,AnnotationsSchema:gQ,ResourceSchema:DH,ResourceTemplateSchema:U0,ResourceListChangedNotificationSchema:nQ,ResourceUpdatedNotificationParamsSchema:rQ,ResourceUpdatedNotificationSchema:z0,PromptArgumentSchema:b0,PromptSchema:xH,PromptListChangedNotificationSchema:P0,TextContentSchema:xQ,ImageContentSchema:jQ,AudioContentSchema:vH,ToolUseContentSchema:lW,EmbeddedResourceSchema:mW,ResourceLinkSchema:cW,ContentBlockSchema:KH,PromptMessageSchema:Z0,ToolAnnotationsSchema:yH,ToolListChangedNotificationSchema:pW,ModelHintSchema:dW,ModelPreferencesSchema:iW,ToolChoiceSchema:oW,BooleanSchemaSchema:nW,StringSchemaSchema:rW,NumberSchemaSchema:tW,UntitledSingleSelectEnumSchemaSchema:sW,TitledSingleSelectEnumSchemaSchema:aW,LegacyTitledEnumSchemaSchema:eW,SingleSelectEnumSchemaSchema:Q4,UntitledMultiSelectEnumSchemaSchema:H4,TitledMultiSelectEnumSchemaSchema:W4,MultiSelectEnumSchemaSchema:Y4,EnumSchemaSchema:J4,PrimitiveSchemaDefinitionSchema:G4,ElicitRequestFormParamsSchema:hH,ResourceTemplateReferenceSchema:fH,PromptReferenceSchema:uH,RootSchema:N4,ClientCapabilities2026Schema:B4,ServerCapabilities2026Schema:$0,RequestMetaEnvelopeSchema:I0,ToolSchema:lH,ToolResultContentSchema:X4,SamplingMessageContentBlockSchema:L0,SamplingMessageSchema:mH,ResultTypeSchema:T0,ResultMetaSchema:j0,ResultSchema:D4,PaginatedResultSchema:B6,CallToolResultSchema:C0,ListToolsResultSchema:K4,ListPromptsResultSchema:E4,GetPromptResultSchema:M4,ListResourcesResultSchema:V4,ListResourceTemplatesResultSchema:w4,ReadResourceResultSchema:A4,CompleteResultSchema:F4,CacheableResultSchema:X6,DiscoverResultSchema:q4,CreateMessageRequestParamsSchema:MH,CreateMessageRequestSchema:O4,ListRootsRequestSchema:_4,CreateMessageResultSchema:U4,ListRootsResultSchema:z4,ElicitResultSchema:b4,ElicitRequestURLParamsSchema:P4,ElicitRequestParamsSchema:Z4,ElicitRequestSchema:$4,InputRequestSchema:I4,InputResponseSchema:L4,InputRequestsSchema:T4,InputResponsesSchema:j4,InputRequiredResultSchema:cH,InputResponseRequestParamsSchema:D6,CallToolRequestSchema:E6,ListToolsRequestSchema:M6,ListPromptsRequestSchema:V6,GetPromptRequestSchema:w6,ListResourcesRequestSchema:A6,ListResourceTemplatesRequestSchema:F6,ReadResourceRequestSchema:q6,CompleteRequestSchema:O6,DiscoverRequestSchema:_6,SubscriptionFilterSchema:S0,SubscriptionsListenRequestSchema:U6,SubscriptionsListenResultMetaSchema:z6,SubscriptionsListenResultSchema:k4,dispatchRequestSchemas:VH,dispatchResultSchemas:b6,NotificationMetaSchema:dH,SubscriptionsAcknowledgedNotificationSchema:k0,CancelledNotificationParamsSchema:g0,CancelledNotificationSchema:x0,notificationSchemas2026:y8,JSONRPCResultResponseSchema:MQ(D4),CallToolResultResponseSchema:MQ($([C0,cH])),ListToolsResultResponseSchema:MQ(K4),ListPromptsResultResponseSchema:MQ(E4),GetPromptResultResponseSchema:MQ($([M4,cH])),ListResourcesResultResponseSchema:MQ(V4),ListResourceTemplatesResultResponseSchema:MQ(w4),ReadResourceResultResponseSchema:MQ($([A4,cH])),CompleteResultResponseSchema:MQ(F4),DiscoverResultResponseSchema:MQ(q4),SubscriptionsListenResultResponseSchema:MQ(k4)}}var y2;function CH(){return y2??=v2()}var h2=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function f2(Q){return h2.includes(Q)}var r7=Symbol("modelcontextprotocol.resultCacheHintFallback");function u2(Q){return Q[r7]}function RX(Q){return typeof Q==="number"&&Number.isSafeInteger(Q)&&Q>=0}function CX(Q){return Q==="public"||Q==="private"}var h=function(Q){return Q[Q.ParseError=-32700]="ParseError",Q[Q.InvalidRequest=-32600]="InvalidRequest",Q[Q.MethodNotFound=-32601]="MethodNotFound",Q[Q.InvalidParams=-32602]="InvalidParams",Q[Q.InternalError=-32603]="InternalError",Q[Q.ResourceNotFound=-32002]="ResourceNotFound",Q[Q.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",Q[Q.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",Q[Q.UrlElicitationRequired=-32042]="UrlElicitationRequired",Q}({}),NQ=class Q extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](H){return IQ(this,H)}static isInstance(H){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return IQ(this,H)}constructor(H,W,Y){super(W);this.code=H,this.data=Y,this.name="ProtocolError",O0(this,new.target)}static fromError(H,W,Y){if(H===h.UrlElicitationRequired&&Y){let J=Y;if(J.elicitations)return new kX(J.elicitations,W)}if(H===h.UnsupportedProtocolVersion&&Y){let J=Y;if(Array.isArray(J.supported)&&typeof J.requested==="string")return new gX({supported:J.supported,requested:J.requested},W)}if(H===h.InvalidParams||H===h.ResourceNotFound){let J=Y;if(typeof J?.uri==="string"&&(H===h.ResourceNotFound||Object.keys(J).length===1))return new SX(J.uri,W)}if(H===h.MissingRequiredClientCapability&&Y){let J=Y;if(J.requiredCapabilities!==null&&typeof J.requiredCapabilities==="object"&&!Array.isArray(J.requiredCapabilities))return new xX({requiredCapabilities:J.requiredCapabilities},W)}return new Q(H,W,Y)}},SX=class extends NQ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(Q,H=`Resource not found: ${Q}`){super(h.InvalidParams,H,{uri:Q})}get uri(){return this.data.uri}},kX=class extends NQ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(Q,H=`URL elicitation${Q.length>1?"s":""} required`){super(h.UrlElicitationRequired,H,{elicitations:Q})}get elicitations(){return this.data?.elicitations??[]}},gX=class extends NQ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(Q,H=`Unsupported protocol version: ${Q.requested}`){super(h.UnsupportedProtocolVersion,H,Q)}get supported(){return this.data.supported}get requested(){return this.data.requested}},xX=class extends NQ{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(Q,H=`Missing required client capabilities: ${Object.keys(Q.requiredCapabilities).join(", ")}`){super(h.MissingRequiredClientCapability,H,Q)}get requiredCapabilities(){return this.data.requiredCapabilities}},l2=0,m2="private",c2=["tools/call","prompts/get","resources/read"];function p2(Q,H){let W=H.resultType;if(W===void 0)return{...H,resultType:"complete"};if(W==="complete")return H;if(c2.includes(Q))return H;throw new NQ(h.InternalError,`Handler for ${Q} returned resultType '${String(W)}', but results of ${Q} only support 'complete' on protocol revision 2026-07-28`)}function d2(Q,H){let W=u2(H);if(H.resultType!=="complete"||!f2(Q))return W===void 0?H:t2(H);let Y=H,J=RX(Y.ttlMs)?Y.ttlMs:n2(W),G=CX(Y.cacheScope)?Y.cacheScope:r2(W),N={...Y,ttlMs:J,cacheScope:G};return delete N[r7],N}function i2(Q){return Q!==null&&typeof Q==="object"&&!Array.isArray(Q)}function o2(Q,H){if(H===void 0)return Q;let W=Q._meta;if(W===void 0)return{...Q,_meta:{[IH]:H}};if(!i2(W))return Q;if(W[IH]!==void 0)return Q;return{...Q,_meta:{...W,[IH]:H}}}function n2(Q){return Q!==void 0&&RX(Q.ttlMs)?Q.ttlMs:l2}function r2(Q){return Q!==void 0&&CX(Q.cacheScope)?Q.cacheScope:m2}function t2(Q){let H={...Q};return delete H[r7],H}var s2=["elicitation/create","sampling/createMessage","roots/list"],g8;function vX(){if(g8)return g8;let Q=CH();return g8={request:{"elicitation/create":M({method:F("elicitation/create"),params:Q.ElicitRequestParamsSchema}),"sampling/createMessage":M({method:F("sampling/createMessage"),params:Q.CreateMessageRequestParamsSchema}),"roots/list":M({method:F("roots/list"),params:R({}).optional()})},response:{"elicitation/create":Q.ElicitResultSchema,"sampling/createMessage":Q.CreateMessageResultSchema,"roots/list":Q.ListRootsResultSchema}},g8}function yX(Q){return s2.includes(Q)}function v7(Q){return yX(Q)?vX().request[Q]:void 0}function a2(Q){return yX(Q)?vX().response[Q]:void 0}var t7={"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},hX={"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 fX(Q){return Object.prototype.hasOwnProperty.call(t7,Q)}function uX(Q){return Object.prototype.hasOwnProperty.call(hX,Q)}function e2(Q){return Object.prototype.hasOwnProperty.call(t7,Q)}function QE(Q){return fX(Q)?CH().dispatchRequestSchemas[Q]:void 0}function HE(Q){return e2(Q)?CH().dispatchResultSchemas[Q]:void 0}function WE(Q){return uX(Q)?CH().notificationSchemas2026[Q]:void 0}var mV=Object.keys(t7),cV=Object.keys(hX);function H6(Q){return Q!==null&&typeof Q==="object"&&!Array.isArray(Q)}function e9(Q,H){if(Q===void 0)return{ok:!1,reason:"not-in-era"};let W=Q.safeParse(H);return W.success?{ok:!0,value:W.data}:{ok:!1,reason:"invalid",message:String(W.error)}}var YE={ok:!1,reason:"not-in-era"},JE=[Y0,J0];function GE(Q,H){let W=H,Y=!1,J=()=>{if(!Y)W={...W},Y=!0;return W},G=H.tools;if(Q==="tools/list"&&Array.isArray(G)&&G.some((X)=>H6(X)&&("execution"in X)))J().tools=G.map((X)=>{if(!H6(X)||!("execution"in X))return X;let D={...X};return delete D.execution,D});let N=H.capabilities;if(H6(N)&&"tasks"in N){let X={...N};delete X.tasks,J().capabilities=X}return W}var s7={era:"2026-07-28",hasRequestMethod:fX,hasNotificationMethod:uX,hasInputRequestMethod:(Q)=>v7(Q)!==void 0,validateRequest:(Q,H)=>e9(QE(Q),H),validateResult:(Q,H)=>e9(HE(Q),H),validateNotification:(Q,H)=>e9(WE(Q),H),validateInputRequest:(Q,H)=>e9(v7(Q),H),validateInputResponse:(Q,H)=>e9(a2(Q),H),samplingResultVariant:()=>YE,outboundEnvelope(Q){return{[Y0]:Q.protocolVersion,[MW]:Q.clientInfo,[J0]:Q.clientCapabilities,...Q.logLevel!==void 0&&{[VW]:Q.logLevel}}},validateEnvelopeMeta(Q){let H=[];for(let Y of JE)if(!(Y in Q))H.push({key:Y,problem:"missing"});let W=CH().RequestMetaEnvelopeSchema.safeParse(Q);if(!W.success)for(let Y of W.error.issues){let J=Y.path.map(String),G=J.length>0?J.join("."):"_meta";if(J.length===1&&H.some((N)=>N.key===G&&N.problem==="missing"))continue;H.push({key:G,problem:Y.message})}return H},projectCallToolResult:(Q)=>bX(Q),inputRequestSchema:v7,decodeResult(Q,H){if(!H6(H))return{kind:"invalid",error:new e(GQ.InvalidResult,`Invalid result for ${Q}: not an object`,{method:Q})};let W=H.resultType;if(W===void 0)return{kind:"invalid",error:new e(GQ.InvalidResult,`Invalid result for ${Q}: 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:Q,violation:"missing-resultType"})};if(typeof W!=="string")return{kind:"invalid",error:new e(GQ.InvalidResult,`Invalid result for ${Q}: non-string resultType`,{method:Q,resultType:W})};if(W==="input_required"){let N=H.inputRequests,X=H6(N)?N:{},D=H.requestState,E=H._meta===void 0?void 0:CH().ResultMetaSchema.safeParse(H._meta),w=E?.success?E.data:void 0;if(Object.keys(X).length===0&&typeof D!=="string")return{kind:"invalid",error:new e(GQ.InvalidResult,`Invalid result for ${Q}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:Q,violation:"input-required-missing-both"})};return{kind:"input_required",inputRequests:X,...typeof D==="string"&&{requestState:D},...w!==void 0&&{_meta:w}}}if(W!=="complete")return{kind:"invalid",error:new e(GQ.UnsupportedResultType,`Unsupported result type '${W}' for ${Q}`,{resultType:W,method:Q})};let Y=NE(),J=Object.hasOwn(Y,Q)?Y[Q]:void 0;if(J!==void 0){let N=J.safeParse(H);if(!N.success)return{kind:"invalid",error:new e(GQ.InvalidResult,`Invalid result for ${Q}: ${N.error}`,{method:Q})}}let G={...H};return delete G.resultType,{kind:"complete",result:G}},encodeResult(Q,H,W){return o2(d2(Q,p2(Q,GE(Q,H))),W)},encodeErrorCode:(Q)=>Q===-32002?-32602:Q,checkInboundEnvelope(Q){if(Q.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let H=CH().RequestMetaEnvelopeSchema.safeParse(Q.envelope);if(!H.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${H.error.issues.map((W)=>W.message).join("; ")}`}},x8;function NE(){if(x8)return x8;let Q=CH();return x8={"tools/call":Q.CallToolResultSchema,"tools/list":Q.ListToolsResultSchema,"prompts/get":Q.GetPromptResultSchema,"prompts/list":Q.ListPromptsResultSchema,"resources/list":Q.ListResourcesResultSchema,"resources/templates/list":Q.ListResourceTemplatesResultSchema,"resources/read":Q.ReadResourceResultSchema,"completion/complete":Q.CompleteResultSchema,"server/discover":Q.DiscoverResultSchema},x8}var a7="2026-07-28";function Y6(Q){return Q!==void 0&&zX(Q)?s7:n7}function wX(Q){if(Q.revision!==void 0)return Y6(Q.revision).era;return Q.era==="modern"?s7.era:n7.era}function y7(Q){return lX.some((H)=>H.hasRequestMethod(Q))}function h7(Q){return lX.some((H)=>H.hasNotificationMethod(Q))}function AX(Q){return Q==="tasks/get"||Q==="tasks/cancel"}var lX=[n7,s7],BE=N5({AnnotationsSchema:()=>pQ,AudioContentSchema:()=>M0,BaseMetadataSchema:()=>mQ,BaseRequestParamsSchema:()=>WQ,BlobResourceContentsSchema:()=>LW,BooleanSchemaSchema:()=>CW,CallToolRequestParamsSchema:()=>B9,CallToolRequestSchema:()=>X9,CallToolResultSchema:()=>RH,CancelTaskRequestSchema:()=>b8,CancelTaskResultSchema:()=>P8,CancelledNotificationParamsSchema:()=>A1,CancelledNotificationSchema:()=>UW,ClientCapabilitiesSchema:()=>q1,ClientNotificationSchema:()=>$8,ClientRequestSchema:()=>Z8,ClientResultSchema:()=>I8,ClientTasksCapabilitySchema:()=>D8,CompatibilityCallToolResultSchema:()=>E8,CompleteRequestParamsSchema:()=>x9,CompleteRequestSchema:()=>v9,CompleteResultSchema:()=>y9,ContentBlockSchema:()=>dQ,CreateMessageRequestParamsSchema:()=>U9,CreateMessageRequestSchema:()=>z9,CreateMessageResultSchema:()=>b9,CreateMessageResultWithToolsSchema:()=>P9,CreateTaskResultSchema:()=>w8,CursorSchema:()=>AW,DiscoverRequestSchema:()=>b1,DiscoverResultSchema:()=>bW,ElicitRequestFormParamsSchema:()=>q0,ElicitRequestParamsSchema:()=>T9,ElicitRequestSchema:()=>j9,ElicitRequestURLParamsSchema:()=>L9,ElicitResultSchema:()=>S9,ElicitationCompleteNotificationParamsSchema:()=>R9,ElicitationCompleteNotificationSchema:()=>C9,EmbeddedResourceSchema:()=>V0,EmptyResultSchema:()=>TH,EnumSchemaSchema:()=>I9,GetPromptRequestParamsSchema:()=>s1,GetPromptRequestSchema:()=>a1,GetPromptResultSchema:()=>H9,GetTaskPayloadRequestSchema:()=>O8,GetTaskPayloadResultSchema:()=>_8,GetTaskRequestSchema:()=>F8,GetTaskResultSchema:()=>q8,IconSchema:()=>F1,IconsSchema:()=>WH,ImageContentSchema:()=>E0,ImplementationSchema:()=>cQ,InitializeRequestParamsSchema:()=>O1,InitializeRequestSchema:()=>_1,InitializeResultSchema:()=>U1,InitializedNotificationSchema:()=>z1,JSONArraySchema:()=>B8,JSONObjectSchema:()=>n,JSONRPCErrorResponseSchema:()=>B0,JSONRPCMessageSchema:()=>X0,JSONRPCNotificationSchema:()=>_W,JSONRPCRequestSchema:()=>OW,JSONRPCResponseSchema:()=>X8,JSONRPCResultResponseSchema:()=>N0,JSONValueSchema:()=>HH,LegacyTitledEnumSchemaSchema:()=>gW,ListChangedOptionsBaseSchema:()=>M8,ListPromptsRequestSchema:()=>r1,ListPromptsResultSchema:()=>t1,ListResourceTemplatesRequestSchema:()=>j1,ListResourceTemplatesResultSchema:()=>R1,ListResourcesRequestSchema:()=>L1,ListResourcesResultSchema:()=>T1,ListRootsRequestSchema:()=>f9,ListRootsResultSchema:()=>u9,ListTasksRequestSchema:()=>U8,ListTasksResultSchema:()=>z8,ListToolsRequestSchema:()=>G9,ListToolsResultSchema:()=>N9,LoggingLevelSchema:()=>RW,LoggingMessageNotificationParamsSchema:()=>M9,LoggingMessageNotificationSchema:()=>V9,ModelHintSchema:()=>w9,ModelPreferencesSchema:()=>A9,MultiSelectEnumSchemaSchema:()=>$9,NotificationSchema:()=>JQ,NotificationsParamsSchema:()=>KQ,NumberSchemaSchema:()=>F0,PaginatedRequestParamsSchema:()=>$1,PaginatedRequestSchema:()=>YH,PaginatedResultSchema:()=>JH,PingRequestSchema:()=>PW,PrimitiveSchemaDefinitionSchema:()=>yW,ProgressNotificationParamsSchema:()=>Z1,ProgressNotificationSchema:()=>ZW,ProgressSchema:()=>P1,ProgressTokenSchema:()=>wW,PromptArgumentSchema:()=>o1,PromptListChangedNotificationSchema:()=>W9,PromptMessageSchema:()=>Q9,PromptReferenceSchema:()=>g9,PromptSchema:()=>n1,ReadResourceRequestParamsSchema:()=>C1,ReadResourceRequestSchema:()=>S1,ReadResourceResultSchema:()=>k1,RelatedTaskMetadataSchema:()=>w1,RequestIdSchema:()=>kQ,RequestMetaSchema:()=>FW,RequestSchema:()=>r,ResourceContentsSchema:()=>$W,ResourceLinkSchema:()=>w0,ResourceListChangedNotificationSchema:()=>g1,ResourceRequestParamsSchema:()=>D0,ResourceSchema:()=>TW,ResourceTemplateReferenceSchema:()=>k9,ResourceTemplateSchema:()=>I1,ResourceUpdatedNotificationParamsSchema:()=>d1,ResourceUpdatedNotificationSchema:()=>i1,ResultMetaObjectSchema:()=>qW,ResultSchema:()=>t,RoleSchema:()=>GH,RootSchema:()=>h9,RootsListChangedNotificationSchema:()=>l9,SamplingContentSchema:()=>O9,SamplingMessageContentBlockSchema:()=>$H,SamplingMessageSchema:()=>_9,ServerCapabilitiesSchema:()=>zW,ServerNotificationSchema:()=>T8,ServerRequestSchema:()=>L8,ServerResultSchema:()=>j8,ServerTasksCapabilitySchema:()=>K8,SetLevelRequestParamsSchema:()=>K9,SetLevelRequestSchema:()=>E9,SingleSelectEnumSchemaSchema:()=>Z9,StringSchemaSchema:()=>A0,SubscribeRequestParamsSchema:()=>x1,SubscribeRequestSchema:()=>v1,SubscriptionFilterSchema:()=>jW,SubscriptionsAcknowledgedNotificationParamsSchema:()=>l1,SubscriptionsAcknowledgedNotificationSchema:()=>m1,SubscriptionsListenRequestParamsSchema:()=>f1,SubscriptionsListenRequestSchema:()=>u1,SubscriptionsListenResultMetaSchema:()=>c1,SubscriptionsListenResultSchema:()=>p1,TaskAugmentedRequestParamsSchema:()=>LH,TaskCreationParamsSchema:()=>V8,TaskMetadataSchema:()=>V1,TaskSchema:()=>NH,TaskStatusNotificationParamsSchema:()=>c9,TaskStatusNotificationSchema:()=>A8,TaskStatusSchema:()=>m9,TextContentSchema:()=>K0,TextResourceContentsSchema:()=>IW,TitledMultiSelectEnumSchemaSchema:()=>vW,TitledSingleSelectEnumSchemaSchema:()=>kW,ToolAnnotationsSchema:()=>Y9,ToolChoiceSchema:()=>F9,ToolExecutionSchema:()=>J9,ToolListChangedNotificationSchema:()=>D9,ToolResultContentSchema:()=>q9,ToolSchema:()=>jH,ToolUseContentSchema:()=>e1,UnsubscribeRequestParamsSchema:()=>y1,UnsubscribeRequestSchema:()=>h1,UntitledMultiSelectEnumSchemaSchema:()=>xW,UntitledSingleSelectEnumSchemaSchema:()=>SW});var mX=(Q)=>OW.safeParse(Q).success,cX=(Q)=>_W.safeParse(Q).success,c7=(Q)=>N0.safeParse(Q).success,pX=(Q)=>B0.safeParse(Q).success;var W6=-32020,pV=[{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:[h.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:[W6,h.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:[h.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:[h.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:[h.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:[W6],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half — including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[h.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:[W6],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."}],dV={[h.ParseError]:400,[h.InvalidRequest]:400,[h.MethodNotFound]:404,[h.UnsupportedProtocolVersion]:400,[h.MissingRequiredClientCapability]:400,[W6]:400};function e7(Q,H){return H1(Q,H)}function Q6(Q){return new Set(Q.flatMap((H)=>Object.keys(H.shape)))}function p7(Q){if(Q==null)return!1;let H=typeof Q;if(H!=="object"&&H!=="function")return!1;if(!("~standard"in Q))return!1;return typeof Q["~standard"]?.validate==="function"}var FX=!1,d7="draft-2020-12";function XE(Q,H="input"){let W=Q["~standard"],Y;if(W.jsonSchema)Y=W.jsonSchema[H]({target:d7});else if(W.vendor==="zod"){if(!("_zod"in Q))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(!FX)FX=!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.");Y=H0(Q,{target:d7,io:H})}else throw Error(`Schema library "${W.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(H==="output"){if(Y.type!==void 0)return Y;return dX(Y)?{type:"object",...Y}:Y}if(Y.type!==void 0&&Y.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(Y.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...Y}}function dX(Q){if("properties"in Q||"patternProperties"in Q||"additionalProperties"in Q||"required"in Q)return!0;for(let H of["oneOf","anyOf","allOf"]){let W=Q[H];if(Array.isArray(W)&&W.length>0)return W.every((Y)=>Y!==null&&typeof Y==="object"&&(Y.type==="object"||dX(Y)))}return!1}function DE(Q){if(!Q.path?.length)return Q.message;return`${Q.path.map((H)=>String(typeof H==="object"?H.key:H)).join(".")}: ${Q.message}`}async function f7(Q,H){let W=await Q["~standard"].validate(H);if(W.issues&&W.issues.length>0)return{success:!1,error:W.issues.map((Y)=>DE(Y)).join(", ")};return{success:!0,data:W.value}}function KE(Q){let H=H0(Q,{target:d7,io:"input"});return typeof H.pattern==="string"?H.pattern:void 0}var EE=/\\\.\\d\{(\d+)\}/;function ME(Q){let H=EE.exec(Q),W=[void 0,-1,0];if(H)W.push(Number(H[1]));return[!1,!0].flatMap((Y)=>[!1,!0].flatMap((J)=>W.map((G)=>$Q.datetime({local:Y,offset:J,precision:G}))))}function VE(Q,H){let W;switch(Q){case"email":W=[xY()];break;case"uri":W=[BW()];break;case"date":W=[$Q.date()];break;case"date-time":W=ME(H);break}return new Set(W.map((Y)=>KE(Y)).filter((Y)=>Y!==void 0))}function wE(Q,H,W){if(W!=="zod")return!0;return VE(Q,H).has(H)}function J6(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}function AE(Q){try{return XE(Q,"input")}catch(H){let W=H instanceof Error?H.message:String(H);throw new NQ(h.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${W}`)}}var FE=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Q5(Q){return FE.has(Q)||Q.startsWith("x-")}var qE=new Set(["$schema",...Object.keys(q0.shape.requestedSchema.shape)]),qX={string:Q6([A0,SW,kW,gW]),number:Q6([F0]),integer:Q6([F0]),boolean:Q6([CW]),array:Q6([xW,vW])},OE=new Set(A0.shape.format.unwrap().options);function _E(Q,H,W,Y){if(!J6(Q))return Q;let J=typeof Q.type==="string"&&Object.hasOwn(qX,Q.type)?qX[Q.type]:void 0;if(J===void 0)return Q;let G={};for(let[N,X]of Object.entries(Q))if(J.has(N)||Q5(N))G[N]=X;else if(N==="pattern"&&Q.type==="string"&&typeof Q.format==="string"){if(!OE.has(Q.format))G[N]=X;else if(typeof X!=="string"||!wE(Q.format,X,W))Y.push(`${H}.${N}`)}else Y.push(`${H}.${N}`);return G}function UE(Q,H){let W={},Y=[];for(let[J,G]of Object.entries(Q))if(J==="properties"&&J6(G))W[J]=Object.fromEntries(Object.entries(G).map(([N,X])=>[N,_E(X,`properties.${N}`,H,Y)]));else if(qE.has(J))W[J]=G;else if(!Q5(J))Y.push(J);if(Y.length>0)throw new NQ(h.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${Y.join(", ")}`);return W}function zE(Q,H){if(!J6(Q.properties))return H;let W=Object.entries(Q.properties).filter(([,Y])=>!e7(yW,Y).success).map(([Y])=>`properties.${Y}`);return W.length>0?W.join(", "):H}function i7(Q,H,W=""){if(Array.isArray(Q)&&Array.isArray(H))return Q.flatMap((Y,J)=>i7(Y,H[J],`${W}[${J}]`));if(!J6(Q)||!J6(H))return[];return Object.entries(Q).flatMap(([Y,J])=>{let G=W?`${W}.${Y}`:Y;if(!Object.prototype.hasOwnProperty.call(H,Y))return Q5(Y)?[]:[G];return i7(J,H[Y],G)})}function bE(Q){if(!p7(Q.requestedSchema))return{...Q,mode:"form",requestedSchema:Q.requestedSchema};let H=Q.requestedSchema["~standard"].vendor,W=UE(AE(Q.requestedSchema),H),Y=e7(q0.shape.requestedSchema,W);if(!Y.success)throw new NQ(h.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${zE(W,Y.error.message)}`);let J=i7(W,Y.data);if(J.length>0)throw new NQ(h.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${J.join(", ")}`);let G=(Y.data.required??[]).filter((N)=>!Object.prototype.hasOwnProperty.call(Y.data.properties,N));if(G.length>0)throw new NQ(h.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${G.join(", ")}`);return{...Q,mode:"form",requestedSchema:Y.data}}function PE(Q){let H=Q.inputRequests!==void 0&&Object.keys(Q.inputRequests).length>0,W=typeof Q.requestState==="string";if(!H&&!W)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",...Q.inputRequests!==void 0&&{inputRequests:Q.inputRequests},...Q.requestState!==void 0&&{requestState:Q.requestState}}}var iV=Object.assign(PE,{elicit(Q){try{return{method:"elicitation/create",params:bE(Q)}}catch(H){throw H instanceof NQ?TypeError(H.message,{cause:H}):H}},elicitUrl(Q){return{method:"elicitation/create",params:{...Q,mode:"url"}}},createMessage(Q){return{method:"sampling/createMessage",params:Q}},listRoots(){return{method:"roots/list"}}});var ZE=["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"],$E={IdJagTokenExchangeResponseSchema:n9,OAuthClientInformationFullSchema:a9,OAuthClientInformationSchema:s9,OAuthClientMetadataSchema:t9,OAuthClientRegistrationErrorSchema:R8,OAuthErrorResponseSchema:r9,OAuthMetadataSchema:hW,OAuthProtectedResourceMetadataSchema:p9,OAuthTokenRevocationRequestSchema:C8,OAuthTokensSchema:o9,OpenIdProviderDiscoveryMetadataSchema:i9,OpenIdProviderMetadataSchema:d9},iX={},oX={};function nX(Q,H){let W=Q.slice(0,-6);iX[W]=H,oX[W]=(Y)=>H.safeParse(Y).success}for(let Q of ZE)nX(Q,BE[Q]);for(let[Q,H]of Object.entries($E))nX(Q,H);var IE=Object.freeze(iX),LE=Object.freeze(oX);function TE(Q){switch(Q){case"initialize":case"notifications/initialized":return Y6(void 0);case"server/discover":return Y6(a7);default:return}}var rX=60000,jE=[Y0,MW,J0,VW],RE=["inputResponses","requestState"];function OX(Q,H){let W=Q.params;if(!u7(W))return{message:Q,lifted:{}};let Y=W._meta,J=u7(Y)?jE.filter((D)=>(D in Y)):[],G=H==="request"?RE.filter((D)=>(D in W)):[];if(J.length===0&&G.length===0)return{message:Q,lifted:{}};let N={},X={...W};if(J.length>0&&u7(Y)){let D={},E={...Y};for(let w of J)D[w]=Y[w],delete E[w];if(N.envelope=D,Object.keys(E).length>0)X._meta=E;else delete X._meta}for(let D of G){if(D==="inputResponses")N.inputResponses=X[D];if(D==="requestState")N.requestState=X[D];delete X[D]}return{message:{...Q,params:X},lifted:N}}function _X(Q,H){let W=Q.validateResult(H,void 0);if(!W.ok&&W.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(Y){let J=Q.validateResult(H,Y);if(J.ok)return{value:J.value};return{issues:[{message:J.reason==="invalid"?J.message:`not-in-era: ${H}`}]}}}}}function tX(Q){return()=>Q}var CE=tX(void 0),SE,H5=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{SE=(Q,H)=>{Q._negotiatedProtocolVersion=H}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(Q){this._options=Q,this._supportedProtocolVersions=Q?.supportedProtocolVersions??J8,this.setNotificationHandler("notifications/cancelled",(H)=>{this._oncancel(H)}),this.setNotificationHandler("notifications/progress",(H)=>{this._onprogress(H)}),this.setRequestHandler("ping",(H)=>({}))}_shouldDropInbound(Q){}_outboundMetaEnvelope(){}_envelopeOutbound(Q){let H=this._outboundMetaEnvelope();if(H===void 0)return Q;let W=Q.params??{};return{...Q,params:{...W,_meta:{...H,...W._meta}}}}_resolveNonCompleteResult(Q,H){return Promise.reject(new e(GQ.UnsupportedResultType,`Unsupported result type '${Q.kind}' for ${H.request.method}`,{resultType:Q.kind,method:H.request.method}))}_getRequestHandler(Q){return this._requestHandlers.get(Q)}async _oncancel(Q){if(Q.params.requestId===void 0)return;this._requestHandlerAbortControllers.get(Q.params.requestId)?.abort(Q.params.reason)}_setupTimeout(Q,H,W,Y,J=!1){this._timeoutInfo.set(Q,{timeoutId:setTimeout(Y,H),startTime:Date.now(),timeout:H,maxTotalTimeout:W,resetTimeoutOnProgress:J,onTimeout:Y})}_resetTimeout(Q){let H=this._timeoutInfo.get(Q);if(!H)return!1;let W=Date.now()-H.startTime;if(H.maxTotalTimeout&&W>=H.maxTotalTimeout)throw this._timeoutInfo.delete(Q),new e(GQ.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:H.maxTotalTimeout,totalElapsed:W});return clearTimeout(H.timeoutId),H.timeoutId=setTimeout(H.onTimeout,H.timeout),!0}_cleanupTimeout(Q){let H=this._timeoutInfo.get(Q);if(H)clearTimeout(H.timeoutId),this._timeoutInfo.delete(Q)}async connect(Q){this._transport=Q;let H=this.transport?.onclose;this._transport.onclose=()=>{try{H?.()}finally{this._onclose()}};let W=this.transport?.onerror;this._transport.onerror=(J)=>{W?.(J),this._onerror(J)};let Y=this._transport?.onmessage;this._transport.onmessage=(J,G)=>{if(Y?.(J,G),c7(J)||pX(J))this._onresponse(J);else if(mX(J))this._onrequest(J,G);else if(cX(J))this._onnotification(J,G);else this._onerror(Error(`Unknown message type: ${JSON.stringify(J)}`))},Q.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let Q=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let Y of this._timeoutInfo.values())clearTimeout(Y.timeoutId);this._timeoutInfo.clear();let H=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let W=new e(GQ.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let Y of Q.values())Y(W);for(let Y of H.values())Y.abort(W)}}_onerror(Q){this.onerror?.(Q)}_onnotification(Q,H){let{message:W}=OX(Q,"notification"),Y=this._negotiatedWireCodec();if(H?.classification===void 0&&this._shouldDropInbound(Q)==="drop")return;if(H?.classification!==void 0){let N=wX(H.classification);if(N!==Y.era){this._onerror(Error(`Era mismatch on inbound notification '${W.method}': classified as ${N} but this instance serves ${Y.era}`));return}}if(h7(W.method)&&!Y.hasNotificationMethod(W.method))return;let J=this._notificationHandlers.get(W.method),G=this.fallbackNotificationHandler;if(J===void 0&&G===void 0)return;Promise.resolve().then(()=>J===void 0?G(W):J(W,Y)).catch((N)=>this._onerror(Error(`Uncaught error in notification handler: ${N}`)))}_onrequest(Q,H){let{message:W,lifted:Y}=OX(Q,"request"),J=this._negotiatedWireCodec();if(H?.classification===void 0&&this._shouldDropInbound(Q)==="drop"){this._onerror(Error(`Dropped inbound request '${Q.method}': not servable on this connection's protocol era`));return}let G=this._transport,N=(j,C,v)=>{let i={jsonrpc:"2.0",id:W.id,error:{code:j,message:C,...v!==void 0&&{data:v}}};G?.send(i).catch((f)=>this._onerror(Error(`Failed to send an error response: ${f}`)))};if(H?.classification!==void 0){let j=wX(H.classification);if(j!==J.era){this._onerror(Error(`Era mismatch on inbound request '${W.method}': classified as ${j} but this instance serves ${J.era}`));let C=H.classification.revision??j;N(h.UnsupportedProtocolVersion,`Unsupported protocol version: ${C}`,{supported:this._supportedProtocolVersions,requested:C});return}}if(y7(W.method)&&!J.hasRequestMethod(W.method)&&!(AX(W.method)&&this._customSchemaRequestMethods.has(W.method))){N(h.MethodNotFound,"Method not found");return}let X=this._requestHandlers.get(W.method)??this.fallbackRequestHandler;if(X===void 0){N(h.MethodNotFound,"Method not found");return}let D=J.checkInboundEnvelope(Y);if(D!==void 0){N(h.InvalidParams,D);return}let E=(j,C)=>this._notificationViaCodec(this._resolveOutboundCodec(j.method),j,{...C,relatedRequestId:W.id}),w=(j,C,v)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(j.method),j,C,{...v,relatedRequestId:W.id}),q=new AbortController;this._requestHandlerAbortControllers.set(W.id,q);let O=Y.inputResponses===void 0?void 0:kE(Y.inputResponses),_={sessionId:G?.sessionId,mcpReq:{id:W.id,method:W.method,_meta:W.params?._meta,...Y.envelope!==void 0&&{envelope:Y.envelope},...O!==void 0&&{inputResponses:O.accepted},...O!==void 0&&O.droppedKeys.length>0&&{droppedInputResponseKeys:O.droppedKeys},requestState:Y.requestState===void 0?CE:tX(Y.requestState),signal:q.signal,send:(j,C,v)=>{let i=this._resolveOutboundCodec(j.method);if(this._assertOutboundRequestInEra(i,j.method),p7(C))return w(j,C,v);let f=_X(i,j.method);if(f===void 0)throw TypeError(`'${j.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return w(j,f,C)},notify:E},http:H?.authInfo?{authInfo:H.authInfo}:void 0},I=this.buildContext(_,H);Promise.resolve().then(()=>X(W,I)).then(async(j)=>{if(q.signal.aborted)return;let C;try{C=J.encodeResult(W.method,j,this._outboundServerInfo())}catch(i){this._onerror(Error(`Failed to encode result for ${W.method}: ${i}`)),N(h.InternalError,"Internal error");return}let v={result:C,jsonrpc:"2.0",id:W.id};await G?.send(v)},async(j)=>{if(q.signal.aborted)return;let C=Number.isSafeInteger(j.code)?j.code:h.InternalError,v={jsonrpc:"2.0",id:W.id,error:{code:J.encodeErrorCode(C),message:j.message??"Internal error",...j.data!==void 0&&{data:j.data}}};await G?.send(v)}).catch((j)=>this._onerror(Error(`Failed to send response: ${j}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(W.id)===q)this._requestHandlerAbortControllers.delete(W.id)})}_onprogress(Q){let{progressToken:H,...W}=Q.params,Y=Number(H),J=this._progressHandlers.get(Y);if(!J){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(Q)}`));return}let G=this._responseHandlers.get(Y),N=this._timeoutInfo.get(Y);if(N&&G&&N.resetTimeoutOnProgress)try{this._resetTimeout(Y)}catch(X){this._responseHandlers.delete(Y),this._progressHandlers.delete(Y),this._cleanupTimeout(Y),G(X);return}J(W)}_onresponse(Q){let H=Number(Q.id),W=this._responseHandlers.get(H);if(W===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(Q)}`));return}if(this._responseHandlers.delete(H),this._cleanupTimeout(H),this._progressHandlers.delete(H),c7(Q))W(Q);else W(NQ.fromError(Q.error.code,Q.error.message,Q.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(Q,H,W){let Y=this._resolveOutboundCodec(Q.method);if(p7(H)){if(!AX(Q.method))this._assertOutboundRequestInEra(Y,Q.method);return this._requestWithSchemaViaCodec(Y,Q,H,W)}this._assertOutboundRequestInEra(Y,Q.method);let J=_X(Y,Q.method);if(J===void 0)throw TypeError(`'${Q.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(Y,Q,J,H)}_negotiatedWireCodec(){return Y6(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(Q){if(this._negotiatedProtocolVersion===void 0){let H=TE(Q);if(H)return H}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(Q,H){if(y7(H)&&!Q.hasRequestMethod(H))throw new e(GQ.MethodNotSupportedByProtocolVersion,`Method '${H}' is not supported by the negotiated protocol version (wire era ${Q.era})`,{method:H,era:Q.era})}_requestWithSchema(Q,H,W){let Y=this._resolveOutboundCodec(Q.method);return this._assertOutboundRequestInEra(Y,Q.method),this._requestWithSchemaViaCodec(Y,Q,H,W)}_requestWithSchemaViaCodec(Q,H,W,Y){let{relatedRequestId:J,resumptionToken:G,onresumptiontoken:N,headers:X}=Y??{},D=Date.now(),E,w;return new Promise((q,O)=>{let _=(d)=>{O(d)};if(!this._transport){_(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(H.method)}catch(d){_(d);return}if(Y?.signal?.aborted){let d=Y.signal.reason;throw d instanceof e?d:new e(GQ.RequestTimeout,String(d))}let I=Q.era===a7&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,j=this._requestMessageId++;w=j;let C={...H,jsonrpc:"2.0",id:j};if(Y?.onprogress)this._progressHandlers.set(j,Y.onprogress),C.params={...H.params,_meta:{...H.params?._meta,progressToken:j}};let v=this._envelopeOutbound(C),i=!1,f=(d)=>{if(i)return;if(this._progressHandlers.delete(j),I===void 0){if(H.method!=="initialize")this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:j,reason:String(d)}}),{relatedRequestId:J,resumptionToken:G,onresumptiontoken:N}).catch((QQ)=>this._onerror(Error(`Failed to send cancellation: ${QQ}`)))}else I.abort();O(d instanceof e?d:new e(GQ.RequestTimeout,String(d)))};this._responseHandlers.set(j,(d)=>{if(Y?.signal?.aborted)return;if(i=!0,d instanceof Error)return O(d);let QQ;try{QQ=Q.decodeResult(H.method,d.result)}catch(EQ){return O(EQ instanceof Error?EQ:Error(String(EQ)))}if(QQ.kind==="invalid")return O(QQ.error);if(QQ.kind==="input_required"){if(Y?.allowInputRequired===!0)return q(gE(QQ));let EQ={codec:Q,request:H,resultSchema:W,options:Y,flowStartedAt:D,retry:(BH,kH)=>this._requestWithSchemaViaCodec(Q,BH===void 0?{method:H.method}:{method:H.method,params:BH},W,kH)};return q(this._resolveNonCompleteResult(QQ,EQ))}let oQ=QQ.result;f7(W,oQ).then((EQ)=>{if(EQ.success)q(EQ.data);else O(new e(GQ.InvalidResult,`Invalid result for ${H.method}: ${EQ.error}`))},O)}),E=()=>f(Y?.signal?.reason),Y?.signal?.addEventListener("abort",E,{once:!0});let u=Y?.timeout??rX,o=()=>f(new e(GQ.RequestTimeout,"Request timed out",{timeout:u}));this._setupTimeout(j,u,Y?.maxTotalTimeout,o,Y?.resetTimeoutOnProgress??!1),this._transport.send(v,{relatedRequestId:J,resumptionToken:G,onresumptiontoken:N,headers:X,requestSignal:I?.signal}).catch((d)=>{this._progressHandlers.delete(j),O(d)})}).finally(()=>{if(E)Y?.signal?.removeEventListener("abort",E);if(w!==void 0)this._responseHandlers.delete(w),this._cleanupTimeout(w)})}async notification(Q,H){return await this._notificationViaCodec(this._resolveOutboundCodec(Q.method),Q,H)}async _notificationViaCodec(Q,H,W){if(!this._transport)throw new e(GQ.NotConnected,"Not connected");if(h7(H.method)&&!Q.hasNotificationMethod(H.method))throw new e(GQ.MethodNotSupportedByProtocolVersion,`Notification '${H.method}' is not supported by the negotiated protocol version (wire era ${Q.era})`,{method:H.method,era:Q.era});this.assertNotificationCapability(H.method);let Y=this._envelopeOutbound({jsonrpc:"2.0",...H});if((this._options?.debouncedNotificationMethods??[]).includes(H.method)&&!H.params&&W?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(H.method))return;this._pendingDebouncedNotifications.add(H.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(H.method),!this._transport)return;this._transport?.send(Y,W).catch((J)=>this._onerror(J))});return}await this._transport.send(Y,W)}setRequestHandler(Q,H,W){this.assertRequestHandlerCapability(Q);let Y;if(typeof H==="function"){if(!y7(Q))throw TypeError(`'${Q}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);Y=(J,G)=>{let N=this._negotiatedWireCodec(),X=N.validateRequest(Q,J);if(!X.ok&&X.reason==="not-in-era")X=N.validateInputRequest(Q,J);if(!X.ok){if(X.reason==="not-in-era")throw new NQ(h.InternalError,`No wire schema for ${Q} in the resolved era`);throw Error(X.message)}return Promise.resolve(H(X.value,G))}}else if(W)Y=async(J,G)=>{let N=await f7(H.params,{...J.params});if(!N.success)throw new NQ(h.InvalidParams,`Invalid params for ${Q}: ${N.error}`);return W(N.data,G)};else throw TypeError("setRequestHandler: handler is required");if(typeof H==="function")this._customSchemaRequestMethods.delete(Q);else this._customSchemaRequestMethods.add(Q);this._requestHandlers.set(Q,this._wrapHandler(Q,Y))}_wrapHandler(Q,H){return H}_outboundServerInfo(){}removeRequestHandler(Q){this._requestHandlers.delete(Q),this._customSchemaRequestMethods.delete(Q)}assertCanSetRequestHandler(Q){if(this._requestHandlers.has(Q))throw Error(`A request handler for ${Q} already exists, which would be overridden`)}setNotificationHandler(Q,H,W){if(typeof H==="function"){if(!h7(Q))throw TypeError(`'${Q}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(Q,(Y,J)=>{let G=J.validateNotification(Q,Y);if(!G.ok){if(G.reason==="not-in-era")throw new NQ(h.InternalError,`No wire schema for ${Q} in the resolved era`);throw Error(G.message)}return Promise.resolve(H(G.value))});return}if(!W)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(Q,async(Y)=>{let J=await f7(H.params,{...Y.params});if(!J.success)throw new NQ(h.InvalidParams,`Invalid params for notification ${Q}: ${J.error}`);await W(J.data,Y)})}removeNotificationHandler(Q){this._notificationHandlers.delete(Q)}};function u7(Q){return Q!==null&&typeof Q==="object"&&!Array.isArray(Q)}function UX(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}function kE(Q){let H={},W=[];if(!UX(Q))return{accepted:H,droppedKeys:W};for(let[Y,J]of Object.entries(Q)){if(!UX(J)||"method"in J||"result"in J){W.push(Y);continue}H[Y]=J}return{accepted:H,droppedKeys:W}}function gE(Q){return{resultType:"input_required",inputRequests:Q.inputRequests,...Q.requestState!==void 0&&{requestState:Q.requestState},...Q._meta!==void 0&&{_meta:Q._meta}}}/*!
64
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let c=a[1];if(t===a[0]){i(a);continue}if(e.external){let d=e.external.registry.get(a[0])?.id;if(t!==a[0]&&d){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(c.cycle){i(a);continue}if(c.count>1){if(e.reused==="ref"){i(a);continue}}}}function Jr(e,t){let o=e.seen.get(t);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let r=(c)=>{let p=e.seen.get(c);if(p.ref===null)return;let d=p.def??p.schema,f={...d},S=p.ref;if(p.ref=null,S){r(S);let b=e.seen.get(S),P=b.schema;if(P.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))d.allOf=d.allOf??[],d.allOf.push(P);else Object.assign(d,P);if(Object.assign(d,f),c._zod.parent===S)for(let E in d){if(E==="$ref"||E==="allOf")continue;if(!(E in f))delete d[E]}if(P.$ref&&b.def)for(let E in d){if(E==="$ref"||E==="allOf")continue;if(E in b.def&&JSON.stringify(d[E])===JSON.stringify(b.def[E]))delete d[E]}}let _=c._zod.parent;if(_&&_!==S){r(_);let b=e.seen.get(_);if(b?.schema.$ref){if(d.$ref=b.schema.$ref,b.def)for(let P in d){if(P==="$ref"||P==="allOf")continue;if(P in b.def&&JSON.stringify(d[P])===JSON.stringify(b.def[P]))delete d[P]}}}e.override({zodSchema:c,jsonSchema:d,path:p.path??[]})};for(let c of[...e.seen.entries()].reverse())r(c[0]);let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Object.assign(n,o.def??o.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&n.id===i)delete n.id;let a=e.external?.defs??{};for(let c of e.seen.entries()){let p=c[1];if(p.def&&p.defId){if(p.def.id===p.defId)delete p.def.id;a[p.defId]=p.def}}if(e.external);else if(Object.keys(a).length>0)if(e.target==="draft-2020-12")n.$defs=a;else n.definitions=a;try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Vr(t,"input",e.processors),output:Vr(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function le(e,t){let o=t??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return le(r.element,o);if(r.type==="set")return le(r.valueType,o);if(r.type==="lazy")return le(r.getter(),o);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return le(r.innerType,o);if(r.type==="intersection")return le(r.left,o)||le(r.right,o);if(r.type==="record"||r.type==="map")return le(r.keyType,o)||le(r.valueType,o);if(r.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return le(r.in,o)||le(r.out,o)}if(r.type==="object"){for(let n in r.shape)if(le(r.shape[n],o))return!0;return!1}if(r.type==="union"){for(let n of r.options)if(le(n,o))return!0;return!1}if(r.type==="tuple"){for(let n of r.items)if(le(n,o))return!0;if(r.rest&&le(r.rest,o))return!0;return!1}return!1}var ep=(e,t={})=>(o)=>{let r=Hr({...o,processors:t});return j(e,r),Fr(r,e),Jr(r,e)},Vr=(e,t,o={})=>(r)=>{let{libraryOptions:n,target:i}=r??{},a=Hr({...n??{},target:i,io:t,processors:o});return j(e,a),Fr(a,e),Jr(a,e)};var Mm={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Wa=(e,t,o,r)=>{let n=o;n.type="string";let{minimum:i,maximum:a,format:c,patterns:p,contentEncoding:d}=e._zod.bag;if(typeof i==="number")n.minLength=i;if(typeof a==="number")n.maxLength=a;if(c){if(n.format=Mm[c]??c,n.format==="")delete n.format;if(c==="time")delete n.format}if(d)n.contentEncoding=d;if(p&&p.size>0){let f=[...p];if(f.length===1)n.pattern=f[0].source;else if(f.length>1)n.allOf=[...f.map((S)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))]}},Ga=(e,t,o,r)=>{let n=o,{minimum:i,maximum:a,format:c,multipleOf:p,exclusiveMaximum:d,exclusiveMinimum:f}=e._zod.bag;if(typeof c==="string"&&c.includes("int"))n.type="integer";else n.type="number";let S=typeof f==="number"&&f>=(i??Number.NEGATIVE_INFINITY),_=typeof d==="number"&&d<=(a??Number.POSITIVE_INFINITY),b=t.target==="draft-04"||t.target==="openapi-3.0";if(S)if(b)n.minimum=f,n.exclusiveMinimum=!0;else n.exclusiveMinimum=f;else if(typeof i==="number")n.minimum=i;if(_)if(b)n.maximum=d,n.exclusiveMaximum=!0;else n.exclusiveMaximum=d;else if(typeof a==="number")n.maximum=a;if(typeof p==="number")n.multipleOf=p},Ka=(e,t,o,r)=>{o.type="boolean"},op=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},rp=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},Ya=(e,t,o,r)=>{if(t.target==="openapi-3.0")o.type="string",o.nullable=!0,o.enum=[null];else o.type="null"},Qa=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},np=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Xa=(e,t,o,r)=>{o.not={}},ec=(e,t,o,r)=>{},tc=(e,t,o,r)=>{},sp=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},oc=(e,t,o,r)=>{let n=e._zod.def,i=ci(n.entries);if(i.every((a)=>typeof a==="number"))o.type="number";if(i.every((a)=>typeof a==="string"))o.type="string";o.enum=i},rc=(e,t,o,r)=>{let n=e._zod.def,i=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(a));else i.push(a);if(i.length===0);else if(i.length===1){let a=i[0];if(o.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0")o.enum=[a];else o.const=a}else{if(i.every((a)=>typeof a==="number"))o.type="number";if(i.every((a)=>typeof a==="string"))o.type="string";if(i.every((a)=>typeof a==="boolean"))o.type="boolean";if(i.every((a)=>a===null))o.type="null";o.enum=i}},ip=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},ap=(e,t,o,r)=>{let n=o,i=e._zod.pattern;if(!i)throw Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},cp=(e,t,o,r)=>{let n=o,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:c,mime:p}=e._zod.bag;if(a!==void 0)i.minLength=a;if(c!==void 0)i.maxLength=c;if(p)if(p.length===1)i.contentMediaType=p[0],Object.assign(n,i);else Object.assign(n,i),n.anyOf=p.map((d)=>({contentMediaType:d}));else Object.assign(n,i)},lp=(e,t,o,r)=>{o.type="boolean"},nc=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},up=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},sc=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},dp=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},pp=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},ic=(e,t,o,r)=>{let n=o,i=e._zod.def,{minimum:a,maximum:c}=e._zod.bag;if(typeof a==="number")n.minItems=a;if(typeof c==="number")n.maxItems=c;n.type="array",n.items=j(i.element,t,{...r,path:[...r.path,"items"]})},ac=(e,t,o,r)=>{let n=o,i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let d in a)n.properties[d]=j(a[d],t,{...r,path:[...r.path,"properties",d]});let c=new Set(Object.keys(a)),p=new Set([...c].filter((d)=>{let f=i.shape[d]._zod;if(t.io==="input")return f.optin===void 0;else return f.optout===void 0}));if(p.size>0)n.required=Array.from(p);if(i.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")n.additionalProperties=!1}else if(i.catchall)n.additionalProperties=j(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})},cc=(e,t,o,r)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((c,p)=>j(c,t,{...r,path:[...r.path,i?"oneOf":"anyOf",p]}));if(i)o.oneOf=a;else o.anyOf=a},lc=(e,t,o,r)=>{let n=e._zod.def,i=j(n.left,t,{...r,path:[...r.path,"allOf",0]}),a=j(n.right,t,{...r,path:[...r.path,"allOf",1]}),c=(d)=>("allOf"in d)&&Object.keys(d).length===1,p=[...c(i)?i.allOf:[i],...c(a)?a.allOf:[a]];o.allOf=p},hp=(e,t,o,r)=>{let n=o,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",p=i.items.map((_,b)=>j(_,t,{...r,path:[...r.path,a,b]})),d=i.rest?j(i.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(n.prefixItems=p,d)n.items=d}else if(t.target==="openapi-3.0"){if(n.items={anyOf:p},d)n.items.anyOf.push(d);if(n.minItems=p.length,!d)n.maxItems=p.length}else if(n.items=p,d)n.additionalItems=d;let{minimum:f,maximum:S}=e._zod.bag;if(typeof f==="number")n.minItems=f;if(typeof S==="number")n.maxItems=S},uc=(e,t,o,r)=>{let n=o,i=e._zod.def;n.type="object";let a=i.keyType,p=a._zod.bag?.patterns;if(i.mode==="loose"&&p&&p.size>0){let f=j(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(let S of p)n.patternProperties[S.source]=f}else{if(t.target==="draft-07"||t.target==="draft-2020-12")n.propertyNames=j(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});n.additionalProperties=j(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let d=a._zod.values;if(d){let f=[...d].filter((S)=>typeof S==="string"||typeof S==="number");if(f.length>0)n.required=f}},dc=(e,t,o,r)=>{let n=e._zod.def,i=j(n.innerType,t,r),a=t.seen.get(e);if(t.target==="openapi-3.0")a.ref=n.innerType,o.nullable=!0;else o.anyOf=[i,{type:"null"}]},pc=(e,t,o,r)=>{let n=e._zod.def;j(n.innerType,t,r);let i=t.seen.get(e);i.ref=n.innerType},hc=(e,t,o,r)=>{let n=e._zod.def;j(n.innerType,t,r);let i=t.seen.get(e);i.ref=n.innerType,o.default=JSON.parse(JSON.stringify(n.defaultValue))},mc=(e,t,o,r)=>{let n=e._zod.def;j(n.innerType,t,r);let i=t.seen.get(e);if(i.ref=n.innerType,t.io==="input")o._prefault=JSON.parse(JSON.stringify(n.defaultValue))},fc=(e,t,o,r)=>{let n=e._zod.def;j(n.innerType,t,r);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}o.default=a},gc=(e,t,o,r)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;j(a,t,r);let c=t.seen.get(e);c.ref=a},Sc=(e,t,o,r)=>{let n=e._zod.def;j(n.innerType,t,r);let i=t.seen.get(e);i.ref=n.innerType,o.readOnly=!0},mp=(e,t,o,r)=>{let n=e._zod.def;j(n.innerType,t,r);let i=t.seen.get(e);i.ref=n.innerType},Ri=(e,t,o,r)=>{let n=e._zod.def;j(n.innerType,t,r);let i=t.seen.get(e);i.ref=n.innerType},_c=(e,t,o,r)=>{let n=e._zod.innerType;j(n,t,r);let i=t.seen.get(e);i.ref=n},tp={string:Wa,number:Ga,boolean:Ka,bigint:op,symbol:rp,null:Ya,undefined:Qa,void:np,never:Xa,any:ec,unknown:tc,date:sp,enum:oc,literal:rc,nan:ip,template_literal:ap,file:cp,success:lp,custom:nc,function:up,transform:sc,map:dp,set:pp,array:ic,object:ac,union:cc,intersection:lc,tuple:hp,record:uc,nullable:dc,nonoptional:pc,default:hc,prefault:mc,catch:fc,pipe:gc,readonly:Sc,promise:mp,optional:Ri,lazy:_c};function wi(e,t){if("_idmap"in e){let r=e,n=Hr({...t,processors:tp}),i={};for(let p of r._idmap.entries()){let[d,f]=p;j(f,n)}let a={},c={registry:r,uri:t?.uri,defs:i};n.external=c;for(let p of r._idmap.entries()){let[d,f]=p;Fr(n,f),a[d]=Jr(n,f)}if(Object.keys(i).length>0){let p=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[p]:i}}return{schemas:a}}let o=Hr({...t,processors:tp});return j(e,o),Fr(o,e),Jr(o,e)}var Vm=m("ZodISODateTime",(e,t)=>{Eu.init(e,t),H.init(e,t)});function lo(e){return jd(Vm,e)}var Hm=m("ZodISODate",(e,t)=>{$u.init(e,t),H.init(e,t)});function bc(e){return Ld(Hm,e)}var Fm=m("ZodISOTime",(e,t)=>{Cu.init(e,t),H.init(e,t)});function fp(e){return Ud(Fm,e)}var Jm=m("ZodISODuration",(e,t)=>{Iu.init(e,t),H.init(e,t)});function gp(e){return Zd(Jm,e)}var Bm=(e,t)=>{pi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(o)=>za(e,o)},flatten:{value:(o)=>ya(e,o)},addIssue:{value:(o)=>{e.issues.push(o),e.message=JSON.stringify(e.issues,Mr,2)}},addIssues:{value:(o)=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,Mr,2)}},isEmpty:{get(){return e.issues.length===0}}})};var he=m("ZodError",Bm,{Parent:Error});var _p=hi(he),bp=mi(he),Pi=Ar(he),yp=jr(he),zp=pl(he),vp=hl(he),Rp=ml(he),wp=fl(he),xp=gl(he),Pp=Sl(he),Tp=_l(he),kp=bl(he);var Ep=new WeakMap;function Br(e,t,o){let r=Object.getPrototypeOf(e),n=Ep.get(r);if(!n)n=new Set,Ep.set(r,n);if(n.has(t))return;n.add(t);for(let i in o){let a=o[i];Object.defineProperty(r,i,{configurable:!0,enumerable:!1,get(){let c=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}var L=m("ZodType",(e,t)=>(A.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Vr(e,"input"),output:Vr(e,"output")}}),e.toJSONSchema=ep(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,r)=>_p(e,o,r,{callee:e.parse}),e.safeParse=(o,r)=>Pi(e,o,r),e.parseAsync=async(o,r)=>bp(e,o,r,{callee:e.parseAsync}),e.safeParseAsync=async(o,r)=>yp(e,o,r),e.spa=e.safeParseAsync,e.encode=(o,r)=>zp(e,o,r),e.decode=(o,r)=>vp(e,o,r),e.encodeAsync=async(o,r)=>Rp(e,o,r),e.decodeAsync=async(o,r)=>wp(e,o,r),e.safeEncode=(o,r)=>xp(e,o,r),e.safeDecode=(o,r)=>Pp(e,o,r),e.safeEncodeAsync=async(o,r)=>Tp(e,o,r),e.safeDecodeAsync=async(o,r)=>kp(e,o,r),Br(e,"ZodType",{check(...o){let r=this.def;return this.clone(Be(r,{checks:[...r.checks??[],...o.map((n)=>typeof n==="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...o){return this.check(...o)},clone(o,r){return _e(this,o,r)},brand(){return this},register(o,r){return o.add(this,r),this},refine(o,r){return this.check(Af(o,r))},superRefine(o,r){return this.check(jf(o,r))},overwrite(o){return this.check(Ye(o))},optional(){return x(this)},exactOptional(){return Rf(this)},nullable(){return Op(this)},nullish(){return x(Op(this))},nonoptional(o){return Ef(this,o)},array(){return h(this)},or(o){return z([this,o])},and(o){return Oe(this,o)},transform(o){return Np(this,Vp(o))},default(o){return Pf(this,o)},prefault(o){return kf(this,o)},catch(o){return Cf(this,o)},pipe(o){return Np(this,o)},readonly(){return Nf(this)},describe(o){let r=this.clone();return Ke.add(r,{description:o}),r},meta(...o){if(o.length===0)return Ke.get(this);let r=this.clone();return Ke.add(r,o[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(o){return o(this)}}),Object.defineProperty(e,"description",{get(){return Ke.get(e)?.description},configurable:!0}),e)),Mp=m("_ZodString",(e,t)=>{Si.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Wa(e,r,n,i);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,Br(e,"_ZodString",{regex(...r){return this.check(Aa(...r))},includes(...r){return this.check(Ua(...r))},startsWith(...r){return this.check(Za(...r))},endsWith(...r){return this.check(Da(...r))},min(...r){return this.check(ao(...r))},max(...r){return this.check(zi(...r))},length(...r){return this.check(vi(...r))},nonempty(...r){return this.check(ao(1,...r))},lowercase(r){return this.check(ja(r))},uppercase(r){return this.check(La(r))},trim(){return this.check(Ha())},normalize(...r){return this.check(Va(...r))},toLowerCase(){return this.check(Fa())},toUpperCase(){return this.check(Ja())},slugify(){return this.check(Ba())}})}),qp=m("ZodString",(e,t)=>{Si.init(e,t),Mp.init(e,t),e.email=(o)=>e.check(Na(Ap,o)),e.url=(o)=>e.check(qa(Lp,o)),e.jwt=(o)=>e.check(Ad(uf,o)),e.emoji=(o)=>e.check(Rd(Gm,o)),e.guid=(o)=>e.check(Ma($p,o)),e.uuid=(o)=>e.check(bd(Ti,o)),e.uuidv4=(o)=>e.check(yd(Ti,o)),e.uuidv6=(o)=>e.check(zd(Ti,o)),e.uuidv7=(o)=>e.check(vd(Ti,o)),e.nanoid=(o)=>e.check(wd(Km,o)),e.guid=(o)=>e.check(Ma($p,o)),e.cuid=(o)=>e.check(xd(Ym,o)),e.cuid2=(o)=>e.check(Pd(Qm,o)),e.ulid=(o)=>e.check(Td(Xm,o)),e.base64=(o)=>e.check(Nd(af,o)),e.base64url=(o)=>e.check(Md(cf,o)),e.xid=(o)=>e.check(kd(ef,o)),e.ksuid=(o)=>e.check(Ed(tf,o)),e.ipv4=(o)=>e.check($d(of,o)),e.ipv6=(o)=>e.check(Cd(rf,o)),e.cidrv4=(o)=>e.check(Id(nf,o)),e.cidrv6=(o)=>e.check(Od(sf,o)),e.e164=(o)=>e.check(qd(lf,o)),e.datetime=(o)=>e.check(lo(o)),e.date=(o)=>e.check(bc(o)),e.time=(o)=>e.check(fp(o)),e.duration=(o)=>e.check(gp(o))});function s(e){return _d(qp,e)}var H=m("ZodStringFormat",(e,t)=>{Z.init(e,t),Mp.init(e,t)}),Ap=m("ZodEmail",(e,t)=>{yu.init(e,t),H.init(e,t)});function jp(e){return Na(Ap,e)}var $p=m("ZodGUID",(e,t)=>{_u.init(e,t),H.init(e,t)});var Ti=m("ZodUUID",(e,t)=>{bu.init(e,t),H.init(e,t)});var Lp=m("ZodURL",(e,t)=>{zu.init(e,t),H.init(e,t)});function ki(e){return qa(Lp,e)}var Gm=m("ZodEmoji",(e,t)=>{vu.init(e,t),H.init(e,t)});var Km=m("ZodNanoID",(e,t)=>{Ru.init(e,t),H.init(e,t)});var Ym=m("ZodCUID",(e,t)=>{wu.init(e,t),H.init(e,t)});var Qm=m("ZodCUID2",(e,t)=>{xu.init(e,t),H.init(e,t)});var Xm=m("ZodULID",(e,t)=>{Pu.init(e,t),H.init(e,t)});var ef=m("ZodXID",(e,t)=>{Tu.init(e,t),H.init(e,t)});var tf=m("ZodKSUID",(e,t)=>{ku.init(e,t),H.init(e,t)});var of=m("ZodIPv4",(e,t)=>{Ou.init(e,t),H.init(e,t)});var rf=m("ZodIPv6",(e,t)=>{Nu.init(e,t),H.init(e,t)});var nf=m("ZodCIDRv4",(e,t)=>{Mu.init(e,t),H.init(e,t)});var sf=m("ZodCIDRv6",(e,t)=>{qu.init(e,t),H.init(e,t)});var af=m("ZodBase64",(e,t)=>{ju.init(e,t),H.init(e,t)});var cf=m("ZodBase64URL",(e,t)=>{Lu.init(e,t),H.init(e,t)});var lf=m("ZodE164",(e,t)=>{Uu.init(e,t),H.init(e,t)});var uf=m("ZodJWT",(e,t)=>{Zu.init(e,t),H.init(e,t)});var Ei=m("ZodNumber",(e,t)=>{Ea.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Ga(e,r,n,i),Br(e,"ZodNumber",{gt(r,n){return this.check(bi(r,n))},gte(r,n){return this.check(Dr(r,n))},min(r,n){return this.check(Dr(r,n))},lt(r,n){return this.check(_i(r,n))},lte(r,n){return this.check(Zr(r,n))},max(r,n){return this.check(Zr(r,n))},int(r){return this.check(Cp(r))},safe(r){return this.check(Cp(r))},positive(r){return this.check(bi(0,r))},nonnegative(r){return this.check(Dr(0,r))},negative(r){return this.check(_i(0,r))},nonpositive(r){return this.check(Zr(0,r))},multipleOf(r,n){return this.check(yi(r,n))},step(r,n){return this.check(yi(r,n))},finite(){return this}});let o=e._zod.bag;e.minValue=Math.max(o.minimum??Number.NEGATIVE_INFINITY,o.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(o.maximum??Number.POSITIVE_INFINITY,o.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(o.format??"").includes("int")||Number.isSafeInteger(o.multipleOf??0.5),e.isFinite=!0,e.format=o.format??null});function g(e){return Dd(Ei,e)}var df=m("ZodNumberFormat",(e,t)=>{Du.init(e,t),Ei.init(e,t)});function Cp(e){return Hd(df,e)}var Up=m("ZodBoolean",(e,t)=>{Vu.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ka(e,o,r,n)});function v(e){return Fd(Up,e)}var pf=m("ZodUndefined",(e,t)=>{Hu.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Qa(e,o,r,n)});function zc(e){return Jd(pf,e)}var hf=m("ZodNull",(e,t)=>{Fu.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ya(e,o,r,n)});function wt(e){return Bd(hf,e)}var mf=m("ZodAny",(e,t)=>{Ju.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ec(e,o,r,n)});function $i(){return Wd(mf)}var ff=m("ZodUnknown",(e,t)=>{Bu.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>tc(e,o,r,n)});function R(){return Gd(ff)}var gf=m("ZodNever",(e,t)=>{Wu.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Xa(e,o,r,n)});function vc(e){return Kd(gf,e)}var Sf=m("ZodArray",(e,t)=>{Gu.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ic(e,o,r,n),e.element=t.element,Br(e,"ZodArray",{min(o,r){return this.check(ao(o,r))},nonempty(o){return this.check(ao(1,o))},max(o,r){return this.check(zi(o,r))},length(o,r){return this.check(vi(o,r))},unwrap(){return this.element}})});function h(e,t){return Yd(Sf,e,t)}var Zp=m("ZodObject",(e,t)=>{Qu.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ac(e,o,r,n),N(e,"shape",()=>t.shape),Br(e,"ZodObject",{keyof(){return C(Object.keys(this._zod.def.shape))},catchall(o){return this.clone({...this._zod.def,catchall:o})},passthrough(){return this.clone({...this._zod.def,catchall:R()})},loose(){return this.clone({...this._zod.def,catchall:R()})},strict(){return this.clone({...this._zod.def,catchall:vc()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(o){return zm(this,o)},safeExtend(o){return vm(this,o)},merge(o){return Rm(this,o)},pick(o){return bm(this,o)},omit(o){return ym(this,o)},partial(...o){return wm(Hp,this,o[0])},required(...o){return xm(Fp,this,o[0])}})});function l(e,t){let o={type:"object",shape:e??{},...w(t)};return new Zp(o)}function T(e,t){return new Zp({type:"object",shape:e,catchall:R(),...w(t)})}var Dp=m("ZodUnion",(e,t)=>{$a.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>cc(e,o,r,n),e.options=t.options});function z(e,t){return new Dp({type:"union",options:e,...w(t)})}var _f=m("ZodDiscriminatedUnion",(e,t)=>{Dp.init(e,t),Xu.init(e,t)});function uo(e,t,o){return new _f({type:"union",options:t,discriminator:e,...w(o)})}var bf=m("ZodIntersection",(e,t)=>{ed.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>lc(e,o,r,n)});function Oe(e,t){return new bf({type:"intersection",left:e,right:t})}var Ip=m("ZodRecord",(e,t)=>{td.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>uc(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function y(e,t,o){if(!t||!t._zod)return new Ip({type:"record",keyType:s(),valueType:e,...w(t)});return new Ip({type:"record",keyType:e,valueType:t,...w(o)})}var yc=m("ZodEnum",(e,t)=>{od.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,i)=>oc(e,r,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let o=new Set(Object.keys(t.entries));e.extract=(r,n)=>{let i={};for(let a of r)if(o.has(a))i[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new yc({...t,checks:[],...w(n),entries:i})},e.exclude=(r,n)=>{let i={...t.entries};for(let a of r)if(o.has(a))delete i[a];else throw Error(`Key ${a} not found in enum`);return new yc({...t,checks:[],...w(n),entries:i})}});function C(e,t){let o=Array.isArray(e)?Object.fromEntries(e.map((r)=>[r,r])):e;return new yc({type:"enum",entries:o,...w(t)})}var yf=m("ZodLiteral",(e,t)=>{rd.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>rc(e,o,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function u(e,t){return new yf({type:"literal",values:Array.isArray(e)?e:[e],...w(t)})}var zf=m("ZodTransform",(e,t)=>{nd.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>sc(e,o,r,n),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new Nr(e.constructor.name);o.addIssue=(i)=>{if(typeof i==="string")o.issues.push(Rt(i,o.value,t));else{let a=i;if(a.fatal)a.continue=!1;a.code??(a.code="custom"),a.input??(a.input=o.value),a.inst??(a.inst=e),o.issues.push(Rt(a))}};let n=t.transform(o.value,o);if(n instanceof Promise)return n.then((i)=>(o.value=i,o.fallback=!0,o));return o.value=n,o.fallback=!0,o}});function Vp(e){return new zf({type:"transform",transform:e})}var Hp=m("ZodOptional",(e,t)=>{Ca.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ri(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function x(e){return new Hp({type:"optional",innerType:e})}var vf=m("ZodExactOptional",(e,t)=>{sd.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ri(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Rf(e){return new vf({type:"optional",innerType:e})}var wf=m("ZodNullable",(e,t)=>{id.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>dc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Op(e){return new wf({type:"nullable",innerType:e})}var xf=m("ZodDefault",(e,t)=>{ad.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>hc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Pf(e,t){return new xf({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Sa(t)}})}var Tf=m("ZodPrefault",(e,t)=>{cd.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>mc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function kf(e,t){return new Tf({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Sa(t)}})}var Fp=m("ZodNonOptional",(e,t)=>{ld.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>pc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Ef(e,t){return new Fp({type:"nonoptional",innerType:e,...w(t)})}var $f=m("ZodCatch",(e,t)=>{ud.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>fc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Cf(e,t){return new $f({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var Jp=m("ZodPipe",(e,t)=>{Ia.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>gc(e,o,r,n),e.in=t.in,e.out=t.out});function Np(e,t){return new Jp({type:"pipe",in:e,out:t})}var If=m("ZodPreprocess",(e,t)=>{Jp.init(e,t),dd.init(e,t)}),Of=m("ZodReadonly",(e,t)=>{pd.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Sc(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});function Nf(e){return new Of({type:"readonly",innerType:e})}var Mf=m("ZodLazy",(e,t)=>{hd.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>_c(e,o,r,n),e.unwrap=()=>e._zod.def.getter()});function Wr(e){return new Mf({type:"lazy",getter:e})}var qf=m("ZodCustom",(e,t)=>{md.init(e,t),L.init(e,t),e._zod.processJSONSchema=(o,r,n)=>nc(e,o,r,n)});function Af(e,t={}){return Qd(qf,e,t)}function jf(e,t){return Xd(e,t)}function xt(e,t){return new If({type:"pipe",in:Vp(e),out:t})}var Wp={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var Bp;(function(e){})(Bp||(Bp={}));function Lf(e){return Vd(Ei,e)}ce(Oa());var Ci="2025-11-25";var Ii=[Ci,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Oi="io.modelcontextprotocol/related-task",Pt="io.modelcontextprotocol/protocolVersion",po="io.modelcontextprotocol/clientInfo",Xe="io.modelcontextprotocol/serverInfo",Tt="io.modelcontextprotocol/clientCapabilities",Ni="io.modelcontextprotocol/subscriptionId",ho="io.modelcontextprotocol/logLevel";var kt="2.0";var Ne=Wr(()=>z([s(),g(),v(),wt(),y(s(),Ne),h(Ne)])),F=y(s(),Ne),Mi=h(Ne),mo=z([s(),g().int()]),fo=s(),Gr=l({ttl:g().optional()}),Kr=l({taskId:s()}),go=T({progressToken:mo.optional(),[Oi]:Kr.optional()}),Q=l({_meta:go.optional()}),et=Q.extend({task:Gr.optional()}),J=l({method:s(),params:Q.loose().optional()}),se=l({_meta:go.optional()}),ee=l({method:s(),params:se.loose().optional()}),So=T({get[Xe](){return xe.optional().catch(void 0)}}),B=T({_meta:So.optional()}),ye=z([s(),g().int()]),_o=l({jsonrpc:u(kt),id:ye,...J.shape}).strict(),bo=l({jsonrpc:u(kt),...ee.shape}).strict(),Et=l({jsonrpc:u(kt),id:ye,result:B}).strict(),$t=l({jsonrpc:u(kt),id:ye.optional(),error:l({code:g().int(),message:s(),data:R().optional()})}).strict(),Ct=z([_o,bo,Et,$t]),qi=z([Et,$t]),tt=B.strict(),Yr=se.extend({requestId:ye.optional(),reason:s().optional()}),yo=ee.extend({method:u("notifications/cancelled"),params:Yr}),Qr=l({src:s(),mimeType:s().optional(),sizes:h(s()).optional(),theme:C(["light","dark"]).optional()}),Me=l({icons:h(Qr).optional()}),we=l({name:s(),title:s().optional()}),xe=we.extend({...we.shape,...Me.shape,version:s(),websiteUrl:s().optional(),description:s().optional()}),Zf=Oe(l({applyDefaults:v().optional()}),F),Df=xt((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)&&Object.keys(e).length===0)return{form:{}};return e},Oe(l({form:Zf.optional(),url:F.optional()}),F.optional())),Ai=T({list:F.optional(),cancel:F.optional(),requests:T({sampling:T({createMessage:F.optional()}).optional(),elicitation:T({create:F.optional()}).optional()}).optional()}),ji=T({list:F.optional(),cancel:F.optional(),requests:T({tools:T({call:F.optional()}).optional()}).optional()}),Xr=l({experimental:y(s(),F).optional(),sampling:l({context:F.optional(),tools:F.optional()}).optional(),elicitation:Df.optional(),roots:l({listChanged:v().optional()}).optional(),tasks:Ai.optional(),extensions:y(s(),F).optional()}),en=Q.extend({protocolVersion:s(),capabilities:Xr,clientInfo:xe}),tn=J.extend({method:u("initialize"),params:en}),zo=l({experimental:y(s(),F).optional(),logging:F.optional(),completions:F.optional(),prompts:l({listChanged:v().optional()}).optional(),resources:l({subscribe:v().optional(),listChanged:v().optional()}).optional(),tools:l({listChanged:v().optional()}).optional(),tasks:ji.optional(),extensions:y(s(),F).optional()}),on=B.extend({protocolVersion:s(),capabilities:zo,serverInfo:xe,instructions:s().optional()}),rn=ee.extend({method:u("notifications/initialized"),params:se.optional()}),nn=J.extend({method:u("server/discover"),params:Q.optional()}),vo=B.extend({supportedVersions:h(s()),capabilities:zo,instructions:s().optional()}),Ro=J.extend({method:u("ping"),params:Q.optional()}),sn=l({progress:g(),total:x(g()),message:x(s())}),an=l({...se.shape,...sn.shape,progressToken:mo}),wo=ee.extend({method:u("notifications/progress"),params:an}),cn=Q.extend({cursor:fo.optional()}),qe=J.extend({params:cn.optional()}),Ae=B.extend({nextCursor:fo.optional()}),xo=l({uri:s(),mimeType:x(s()),_meta:y(s(),R()).optional()}),Po=xo.extend({text:s()}),xc=s().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),To=xo.extend({blob:xc}),je=C(["user","assistant"]),Pe=l({audience:h(je).optional(),priority:g().min(0).max(1).optional(),lastModified:lo({offset:!0}).optional()}),ko=l({...we.shape,...Me.shape,uri:s(),description:x(s()),mimeType:x(s()),size:x(g()),annotations:Pe.optional(),_meta:x(T({}))}),ln=l({...we.shape,...Me.shape,uriTemplate:s(),description:x(s()),mimeType:x(s()),annotations:Pe.optional(),_meta:x(T({}))}),un=qe.extend({method:u("resources/list")}),dn=Ae.extend({resources:h(ko)}),pn=qe.extend({method:u("resources/templates/list")}),hn=Ae.extend({resourceTemplates:h(ln)}),It=Q.extend({uri:s()}),mn=It,fn=J.extend({method:u("resources/read"),params:mn}),gn=B.extend({contents:h(z([Po,To]))}),Sn=ee.extend({method:u("notifications/resources/list_changed"),params:se.optional()}),_n=It,bn=J.extend({method:u("resources/subscribe"),params:_n}),yn=It,zn=J.extend({method:u("resources/unsubscribe"),params:yn}),Eo=l({toolsListChanged:v().optional(),promptsListChanged:v().optional(),resourcesListChanged:v().optional(),resourceSubscriptions:h(s()).optional()}),vn=Q.extend({notifications:Eo}),Rn=J.extend({method:u("subscriptions/listen"),params:vn}),wn=se.extend({notifications:Eo}),xn=ee.extend({method:u("notifications/subscriptions/acknowledged"),params:wn}),Pn=So.extend({[Ni]:ye}),Tn=B.extend({_meta:Pn}),kn=se.extend({uri:s()}),En=ee.extend({method:u("notifications/resources/updated"),params:kn}),$n=l({name:s(),description:x(s()),required:x(v())}),Cn=l({...we.shape,...Me.shape,description:x(s()),arguments:x(h($n)),_meta:x(T({}))}),In=qe.extend({method:u("prompts/list")}),On=Ae.extend({prompts:h(Cn)}),Nn=Q.extend({name:s(),arguments:y(s(),s()).optional()}),Mn=J.extend({method:u("prompts/get"),params:Nn}),Ot=l({type:u("text"),text:s(),annotations:Pe.optional(),_meta:y(s(),R()).optional()}),Nt=l({type:u("image"),data:xc,mimeType:s(),annotations:Pe.optional(),_meta:y(s(),R()).optional()}),Mt=l({type:u("audio"),data:xc,mimeType:s(),annotations:Pe.optional(),_meta:y(s(),R()).optional()}),qn=l({type:u("tool_use"),name:s(),id:s(),input:y(s(),R()),_meta:y(s(),R()).optional()}),qt=l({type:u("resource"),resource:z([Po,To]),annotations:Pe.optional(),_meta:y(s(),R()).optional()}),At=ko.extend({type:u("resource_link")}),Te=z([Ot,Nt,Mt,At,qt]),An=l({role:je,content:Te}),jn=B.extend({description:s().optional(),messages:h(An)}),Ln=ee.extend({method:u("notifications/prompts/list_changed"),params:se.optional()}),Un=l({title:s().optional(),readOnlyHint:v().optional(),destructiveHint:v().optional(),idempotentHint:v().optional(),openWorldHint:v().optional()}),Zn=l({taskSupport:C(["required","optional","forbidden"]).optional()}),ot=l({...we.shape,...Me.shape,description:s().optional(),inputSchema:l({type:u("object"),properties:y(s(),Ne).optional(),required:h(s()).optional()}).catchall(R()),outputSchema:T({$schema:s().optional()}).optional(),annotations:Un.optional(),execution:Zn.optional(),_meta:y(s(),R()).optional()}),Dn=qe.extend({method:u("tools/list")}),Vn=Ae.extend({tools:h(ot)}),rt=B.extend({content:h(Te).default([]),structuredContent:R().optional(),isError:v().optional()}),Li=rt.or(B.extend({toolResult:R()})),Hn=et.extend({name:s(),arguments:y(s(),R()).optional()}),Fn=J.extend({method:u("tools/call"),params:Hn}),Jn=ee.extend({method:u("notifications/tools/list_changed"),params:se.optional()}),Ui=l({autoRefresh:v().default(!0),debounceMs:g().int().nonnegative().default(300)}),$o=C(["debug","info","notice","warning","error","critical","alert","emergency"]),Bn=Q.extend({level:$o}),Wn=J.extend({method:u("logging/setLevel"),params:Bn}),Gn=se.extend({level:$o,logger:s().optional(),data:R()}),Kn=ee.extend({method:u("notifications/message"),params:Gn}),Yn=l({name:s().optional()}),Qn=l({hints:h(Yn).optional(),costPriority:g().min(0).max(1).optional(),speedPriority:g().min(0).max(1).optional(),intelligencePriority:g().min(0).max(1).optional()}),Xn=l({mode:C(["auto","required","none"]).optional()}),es=l({type:u("tool_result"),toolUseId:s().describe("The unique identifier for the corresponding tool call."),content:h(Te),structuredContent:R().optional(),isError:v().optional(),_meta:y(s(),R()).optional()}),ts=uo("type",[Ot,Nt,Mt]),Qe=uo("type",[Ot,Nt,Mt,qn,es]),os=l({role:je,content:z([Qe,h(Qe)]),_meta:y(s(),R()).optional()}),rs=et.extend({messages:h(os),modelPreferences:Qn.optional(),systemPrompt:s().optional(),includeContext:C(["none","thisServer","allServers"]).optional(),temperature:g().optional(),maxTokens:g().int(),stopSequences:h(s()).optional(),metadata:F.optional(),tools:h(ot).optional(),toolChoice:Xn.optional()}),ns=J.extend({method:u("sampling/createMessage"),params:rs}),ss=B.extend({model:s(),stopReason:x(C(["endTurn","stopSequence","maxTokens"]).or(s())),role:je,content:ts}),is=B.extend({model:s(),stopReason:x(C(["endTurn","stopSequence","maxTokens","toolUse"]).or(s())),role:je,content:z([Qe,h(Qe)])}),Co=l({type:u("boolean"),title:s().optional(),description:s().optional(),default:v().optional()}),jt=l({type:u("string"),title:s().optional(),description:s().optional(),minLength:g().optional(),maxLength:g().optional(),format:C(["email","uri","date","date-time"]).optional(),default:s().optional()}),Lt=l({type:C(["number","integer"]),title:s().optional(),description:s().optional(),minimum:g().optional(),maximum:g().optional(),default:g().optional()}),Io=l({type:u("string"),title:s().optional(),description:s().optional(),enum:h(s()),default:s().optional()}),Oo=l({type:u("string"),title:s().optional(),description:s().optional(),oneOf:h(l({const:s(),title:s()})),default:s().optional()}),No=l({type:u("string"),title:s().optional(),description:s().optional(),enum:h(s()),enumNames:h(s()).optional(),default:s().optional()}),as=z([Io,Oo]),Mo=l({type:u("array"),title:s().optional(),description:s().optional(),minItems:g().optional(),maxItems:g().optional(),items:l({type:u("string"),enum:h(s())}),default:h(s()).optional()}),qo=l({type:u("array"),title:s().optional(),description:s().optional(),minItems:g().optional(),maxItems:g().optional(),items:l({anyOf:h(l({const:s(),title:s()}))}),default:h(s()).optional()}),cs=z([Mo,qo]),ls=z([No,as,cs]),Ao=z([ls,Co,jt,Lt]),Ut=et.extend({mode:u("form").optional(),message:s(),requestedSchema:l({type:u("object"),properties:y(s(),Ao),required:h(s()).optional()}).catchall(R())}),us=et.extend({mode:u("url"),message:s(),elicitationId:s(),url:s().url()}),ds=z([Ut,us]),ps=J.extend({method:u("elicitation/create"),params:ds}),hs=se.extend({elicitationId:s()}),ms=ee.extend({method:u("notifications/elicitation/complete"),params:hs}),fs=B.extend({action:C(["accept","decline","cancel"]),content:xt((e)=>e===null?void 0:e,y(s(),z([s(),g(),v(),h(s())])).optional())}),gs=l({type:u("ref/resource"),uri:s()}),Ss=l({type:u("ref/prompt"),name:s()}),_s=Q.extend({ref:z([Ss,gs]),argument:l({name:s(),value:s()}),context:l({arguments:y(s(),s()).optional()}).optional()}),bs=J.extend({method:u("completion/complete"),params:_s}),ys=B.extend({completion:T({values:h(s()).max(100),total:x(g().int()),hasMore:x(v())})}),zs=l({uri:s().startsWith("file://"),name:s().optional(),_meta:y(s(),R()).optional()}),vs=J.extend({method:u("roots/list"),params:Q.optional()}),Rs=B.extend({roots:h(zs)}),ws=ee.extend({method:u("notifications/roots/list_changed"),params:se.optional()}),Zi=T({ttl:g().optional(),pollInterval:g().optional()}),xs=C(["working","input_required","completed","failed","cancelled"]),Le=l({taskId:s(),status:xs,ttl:z([g(),wt()]),createdAt:s(),lastUpdatedAt:s(),pollInterval:x(g()),statusMessage:x(s())}),Di=B.extend({task:Le}),Ps=se.merge(Le),Vi=ee.extend({method:u("notifications/tasks/status"),params:Ps}),Hi=J.extend({method:u("tasks/get"),params:Q.extend({taskId:s()})}),Fi=B.merge(Le),Ji=J.extend({method:u("tasks/result"),params:Q.extend({taskId:s()})}),Bi=B.loose(),Wi=qe.extend({method:u("tasks/list")}),Gi=Ae.extend({tasks:h(Le)}),Ki=J.extend({method:u("tasks/cancel"),params:Q.extend({taskId:s()})}),Yi=B.merge(Le),Qi=z([Ro,tn,nn,bs,Wn,Mn,In,un,pn,fn,bn,zn,Rn,Fn,Dn]),Xi=z([yo,wo,rn,ws]),ea=z([tt,ss,is,fs,Rs]),ta=z([Ro,ns,ps,vs]),oa=z([yo,wo,Kn,En,Sn,Jn,Ln,xn,ms]),ra=z([tt,on,vo,ys,jn,On,dn,hn,gn,rt,Vn,Tn]),Y=ki().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Wp.custom,message:"URL must be parseable",fatal:!0}),pa}).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"}),Ts=T({resource:s().url(),authorization_servers:h(Y).optional(),jwks_uri:s().url().optional(),scopes_supported:h(s()).optional(),bearer_methods_supported:h(s()).optional(),resource_signing_alg_values_supported:h(s()).optional(),resource_name:s().optional(),resource_documentation:s().optional(),resource_policy_uri:s().url().optional(),resource_tos_uri:s().url().optional(),tls_client_certificate_bound_access_tokens:v().optional(),authorization_details_types_supported:h(s()).optional(),dpop_signing_alg_values_supported:h(s()).optional(),dpop_bound_access_tokens_required:v().optional()}),jo=T({issuer:s(),authorization_endpoint:Y,token_endpoint:Y,registration_endpoint:Y.optional(),scopes_supported:h(s()).optional(),response_types_supported:h(s()),response_modes_supported:h(s()).optional(),grant_types_supported:h(s()).optional(),token_endpoint_auth_methods_supported:h(s()).optional(),token_endpoint_auth_signing_alg_values_supported:h(s()).optional(),service_documentation:Y.optional(),revocation_endpoint:Y.optional(),revocation_endpoint_auth_methods_supported:h(s()).optional(),revocation_endpoint_auth_signing_alg_values_supported:h(s()).optional(),introspection_endpoint:s().optional(),introspection_endpoint_auth_methods_supported:h(s()).optional(),introspection_endpoint_auth_signing_alg_values_supported:h(s()).optional(),code_challenge_methods_supported:h(s()).optional(),client_id_metadata_document_supported:v().optional(),authorization_response_iss_parameter_supported:v().optional().catch(void 0),dpop_signing_alg_values_supported:h(s()).optional()}),ks=T({issuer:s(),authorization_endpoint:Y,token_endpoint:Y,userinfo_endpoint:Y.optional(),jwks_uri:Y,registration_endpoint:Y.optional(),scopes_supported:h(s()).optional(),response_types_supported:h(s()),response_modes_supported:h(s()).optional(),grant_types_supported:h(s()).optional(),acr_values_supported:h(s()).optional(),subject_types_supported:h(s()),id_token_signing_alg_values_supported:h(s()),id_token_encryption_alg_values_supported:h(s()).optional(),id_token_encryption_enc_values_supported:h(s()).optional(),userinfo_signing_alg_values_supported:h(s()).optional(),userinfo_encryption_alg_values_supported:h(s()).optional(),userinfo_encryption_enc_values_supported:h(s()).optional(),request_object_signing_alg_values_supported:h(s()).optional(),request_object_encryption_alg_values_supported:h(s()).optional(),request_object_encryption_enc_values_supported:h(s()).optional(),token_endpoint_auth_methods_supported:h(s()).optional(),token_endpoint_auth_signing_alg_values_supported:h(s()).optional(),display_values_supported:h(s()).optional(),claim_types_supported:h(s()).optional(),claims_supported:h(s()).optional(),service_documentation:s().optional(),claims_locales_supported:h(s()).optional(),ui_locales_supported:h(s()).optional(),claims_parameter_supported:v().optional(),request_parameter_supported:v().optional(),request_uri_parameter_supported:v().optional(),require_request_uri_registration:v().optional(),op_policy_uri:Y.optional(),op_tos_uri:Y.optional(),client_id_metadata_document_supported:v().optional(),authorization_response_iss_parameter_supported:v().optional().catch(void 0)}),Es=l({...ks.shape,...jo.pick({code_challenge_methods_supported:!0}).shape}),$s=l({access_token:s(),id_token:s().optional(),token_type:s(),expires_in:Lf().optional(),scope:s().optional(),refresh_token:s().optional(),issuer:s().optional().catch(void 0)}).strip(),Cs=l({issued_token_type:u("urn:ietf:params:oauth:token-type:id-jag"),access_token:s(),token_type:s().optional(),expires_in:g().optional(),scope:s().optional()}).strip(),Is=l({error:s(),error_description:s().optional(),error_uri:s().optional()}),wc=Y.optional().or(u("").transform(()=>{return})),Os=l({redirect_uris:h(Y),token_endpoint_auth_method:s().optional(),grant_types:h(s()).optional(),response_types:h(s()).optional(),application_type:s().optional(),client_name:s().optional(),client_uri:Y.optional(),logo_uri:wc,scope:s().optional(),contacts:h(s()).optional(),tos_uri:wc,policy_uri:s().optional(),jwks_uri:Y.optional(),jwks:$i().optional(),software_id:s().optional(),software_version:s().optional(),software_statement:s().optional()}).strip(),Ns=l({client_id:s(),client_secret:s().optional(),client_id_issued_at:g().optional(),client_secret_expires_at:g().optional(),issuer:s().optional().catch(void 0)}).strip(),Ms=Os.merge(Ns),na=l({error:s(),error_description:s().optional()}).strip(),sa=l({token:s(),token_type_hint:s().optional()}).strip();var Cc=Symbol.for("mcp.sdk.errorBrands");function Zt(e,t){let o=new Set,r=t;while(typeof r==="function"){let n=r.mcpBrand;if(Object.prototype.hasOwnProperty.call(r,"mcpBrand")&&typeof n==="string")o.add(n);r=Object.getPrototypeOf(r)}if(o.size===0)return;Object.defineProperty(e,Cc,{value:o,enumerable:!1,configurable:!0})}function me(e,t){try{if(typeof t==="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(t,Cc)){let o=t[Cc];if(o&&typeof o.has==="function"&&o.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var Vf=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return me(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 me(this,t)}constructor(t,o,r){super(o);this.code=t,this.errorUri=r,this.name="OAuthError",Zt(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)}},te=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}({}),G=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return me(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 me(this,e)}constructor(e,t,o,r){super(t,r);this.code=e,this.data=o,this.name="SdkError",Zt(this,new.target)}},Hf=class extends G{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,o,r){super(e,t,o,r);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};var Ff="2026-07-28";function gh(e){return e>=Ff}function Sh(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((o)=>o.type==="text")??!1)return e;return{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var _h=["task","inputRequests","requestState"];function Jf(e){if(e===null||typeof e!=="object"||Array.isArray(e)||e.content!==void 0||_h.some((t)=>(t in e)))return e;return{...e,content:[]}}function Bf(){let e=Wr(()=>z([s(),g(),v(),wt(),y(s(),e),h(e)])),t=y(s(),e),o=z([s(),g().int()]),r=s(),n=l({ttl:g().optional()}),i=l({taskId:s()}),a=T({progressToken:o.optional(),"io.modelcontextprotocol/related-task":i.optional()}),c=l({_meta:a.optional()}),p=c.extend({task:n.optional()}),d=l({method:s(),params:c.loose().optional()}),f=l({_meta:a.optional()}),S=l({method:s(),params:f.loose().optional()}),_=T({_meta:a.optional()}),b=z([s(),g().int()]),P=_.strict(),k=f.extend({requestId:b.optional(),reason:s().optional()}),E=S.extend({method:u("notifications/cancelled"),params:k}),I=l({src:s(),mimeType:s().optional(),sizes:h(s()).optional(),theme:C(["light","dark"]).optional()}),D=l({icons:h(I).optional()}),M=l({name:s(),title:s().optional()}),q=M.extend({...M.shape,...D.shape,version:s(),websiteUrl:s().optional(),description:s().optional()}),V=Oe(l({applyDefaults:v().optional()}),t),U=xt((ne)=>{if(ne&&typeof ne==="object"&&!Array.isArray(ne)&&Object.keys(ne).length===0)return{form:{}};return ne},Oe(l({form:V.optional(),url:t.optional()}),t.optional())),K=T({list:t.optional(),cancel:t.optional(),requests:T({sampling:T({createMessage:t.optional()}).optional(),elicitation:T({create:t.optional()}).optional()}).optional()}),Ee=T({list:t.optional(),cancel:t.optional(),requests:T({tools:T({call:t.optional()}).optional()}).optional()}),ie=l({experimental:y(s(),t).optional(),sampling:l({context:t.optional(),tools:t.optional()}).optional(),elicitation:U.optional(),roots:l({listChanged:v().optional()}).optional(),tasks:K.optional(),extensions:y(s(),t).optional()}),Ue=c.extend({protocolVersion:s(),capabilities:ie,clientInfo:q}),it=d.extend({method:u("initialize"),params:Ue}),Lo=l({experimental:y(s(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:l({listChanged:v().optional()}).optional(),resources:l({subscribe:v().optional(),listChanged:v().optional()}).optional(),tools:l({listChanged:v().optional()}).optional(),tasks:Ee.optional(),extensions:y(s(),t).optional()}),Uo=_.extend({protocolVersion:s(),capabilities:Lo,serverInfo:q,instructions:s().optional()}),Dt=S.extend({method:u("notifications/initialized"),params:f.optional()}),Ze=d.extend({method:u("ping"),params:c.optional()}),at=l({progress:g(),total:x(g()),message:x(s())}),ze=l({...f.shape,...at.shape,progressToken:o}),De=S.extend({method:u("notifications/progress"),params:ze}),Vt=c.extend({cursor:r.optional()}),$e=d.extend({params:Vt.optional()}),Ce=_.extend({nextCursor:r.optional()}),Ht=l({uri:s(),mimeType:x(s()),_meta:y(s(),R()).optional()}),Ft=Ht.extend({text:s()}),ct=s().refine((ne)=>{try{return atob(ne),!0}catch{return!1}},{message:"Invalid Base64 string"}),Jt=Ht.extend({blob:ct}),ve=C(["user","assistant"]),ge=l({audience:h(ve).optional(),priority:g().min(0).max(1).optional(),lastModified:lo({offset:!0}).optional()}),lt=l({...M.shape,...D.shape,uri:s(),description:x(s()),mimeType:x(s()),size:x(g()),annotations:ge.optional(),_meta:x(T({}))}),Zo=l({...M.shape,...D.shape,uriTemplate:s(),description:x(s()),mimeType:x(s()),annotations:ge.optional(),_meta:x(T({}))}),Do=$e.extend({method:u("resources/list")}),Vo=Ce.extend({resources:h(lt)}),Ve=$e.extend({method:u("resources/templates/list")}),Bt=Ce.extend({resourceTemplates:h(Zo)}),ut=c.extend({uri:s()}),Ho=ut,Fo=d.extend({method:u("resources/read"),params:Ho}),Jo=_.extend({contents:h(z([Ft,Jt]))}),Bo=S.extend({method:u("notifications/resources/list_changed"),params:f.optional()}),Wo=ut,Go=d.extend({method:u("resources/subscribe"),params:Wo}),Ko=ut,Yo=d.extend({method:u("resources/unsubscribe"),params:Ko}),Qo=f.extend({uri:s()}),Xo=S.extend({method:u("notifications/resources/updated"),params:Qo}),er=l({name:s(),description:x(s()),required:x(v())}),tr=l({...M.shape,...D.shape,description:x(s()),arguments:x(h(er)),_meta:x(T({}))}),or=$e.extend({method:u("prompts/list")}),rr=Ce.extend({prompts:h(tr)}),nr=c.extend({name:s(),arguments:y(s(),s()).optional()}),sr=d.extend({method:u("prompts/get"),params:nr}),dt=l({type:u("text"),text:s(),annotations:ge.optional(),_meta:y(s(),R()).optional()}),pt=l({type:u("image"),data:ct,mimeType:s(),annotations:ge.optional(),_meta:y(s(),R()).optional()}),ht=l({type:u("audio"),data:ct,mimeType:s(),annotations:ge.optional(),_meta:y(s(),R()).optional()}),ir=l({type:u("tool_use"),name:s(),id:s(),input:y(s(),R()),_meta:y(s(),R()).optional()}),He=l({type:u("resource"),resource:z([Ft,Jt]),annotations:ge.optional(),_meta:y(s(),R()).optional()}),ar=lt.extend({type:u("resource_link")}),fe=z([dt,pt,ht,ar,He]),Wt=l({role:ve,content:fe}),Gt=_.extend({description:s().optional(),messages:h(Wt)}),mt=S.extend({method:u("notifications/prompts/list_changed"),params:f.optional()}),cr=l({title:s().optional(),readOnlyHint:v().optional(),destructiveHint:v().optional(),idempotentHint:v().optional(),openWorldHint:v().optional()}),Kt=l({taskSupport:C(["required","optional","forbidden"]).optional()}),ft=l({...M.shape,...D.shape,description:s().optional(),inputSchema:l({type:u("object"),properties:y(s(),e).optional(),required:h(s()).optional()}).catchall(R()),outputSchema:l({type:u("object"),properties:y(s(),e).optional(),required:h(s()).optional()}).catchall(R()).optional(),annotations:cr.optional(),execution:Kt.optional(),_meta:y(s(),R()).optional()}),Yt=$e.extend({method:u("tools/list")}),Qt=Ce.extend({tools:h(ft)}),Xt=_.extend({content:h(fe),structuredContent:y(s(),R()).optional(),isError:v().optional()}),re=p.extend({name:s(),arguments:y(s(),R()).optional()}),lr=d.extend({method:u("tools/call"),params:re}),Hs=S.extend({method:u("notifications/tools/list_changed"),params:f.optional()}),eo=C(["debug","info","notice","warning","error","critical","alert","emergency"]),ur=c.extend({level:eo}),dr=d.extend({method:u("logging/setLevel"),params:ur}),pr=f.extend({level:eo,logger:s().optional(),data:R()}),hr=S.extend({method:u("notifications/message"),params:pr}),mr=l({name:s().optional()}),fr=l({hints:h(mr).optional(),costPriority:g().min(0).max(1).optional(),speedPriority:g().min(0).max(1).optional(),intelligencePriority:g().min(0).max(1).optional()}),gr=l({mode:C(["auto","required","none"]).optional()}),Fs=l({type:u("tool_result"),toolUseId:s().describe("The unique identifier for the corresponding tool call."),content:h(fe),structuredContent:l({}).loose().optional(),isError:v().optional(),_meta:y(s(),R()).optional()}),Sr=uo("type",[dt,pt,ht]),Fe=uo("type",[dt,pt,ht,ir,Fs]),_r=l({role:ve,content:z([Fe,h(Fe)]),_meta:y(s(),R()).optional()}),br=p.extend({messages:h(_r),modelPreferences:fr.optional(),systemPrompt:s().optional(),includeContext:C(["none","thisServer","allServers"]).optional(),temperature:g().optional(),maxTokens:g().int(),stopSequences:h(s()).optional(),metadata:t.optional(),tools:h(ft).optional(),toolChoice:gr.optional()}),yr=d.extend({method:u("sampling/createMessage"),params:br}),zr=_.extend({model:s(),stopReason:x(C(["endTurn","stopSequence","maxTokens"]).or(s())),role:ve,content:Sr}),vr=_.extend({model:s(),stopReason:x(C(["endTurn","stopSequence","maxTokens","toolUse"]).or(s())),role:ve,content:z([Fe,h(Fe)])}),Rr=l({type:u("boolean"),title:s().optional(),description:s().optional(),default:v().optional()}),wr=l({type:u("string"),title:s().optional(),description:s().optional(),minLength:g().optional(),maxLength:g().optional(),format:C(["email","uri","date","date-time"]).optional(),default:s().optional()}),xr=l({type:C(["number","integer"]),title:s().optional(),description:s().optional(),minimum:g().optional(),maximum:g().optional(),default:g().optional()}),Pr=l({type:u("string"),title:s().optional(),description:s().optional(),enum:h(s()),default:s().optional()}),Tr=l({type:u("string"),title:s().optional(),description:s().optional(),oneOf:h(l({const:s(),title:s()})),default:s().optional()}),kr=l({type:u("string"),title:s().optional(),description:s().optional(),enum:h(s()),enumNames:h(s()).optional(),default:s().optional()}),Er=z([Pr,Tr]),gt=l({type:u("array"),title:s().optional(),description:s().optional(),minItems:g().optional(),maxItems:g().optional(),items:l({type:u("string"),enum:h(s())}),default:h(s()).optional()}),St=l({type:u("array"),title:s().optional(),description:s().optional(),minItems:g().optional(),maxItems:g().optional(),items:l({anyOf:h(l({const:s(),title:s()}))}),default:h(s()).optional()}),Js=z([gt,St]),Bs=z([kr,Er,Js]),de=z([Bs,Rr,wr,xr]),pe=p.extend({mode:u("form").optional(),message:s(),requestedSchema:l({type:u("object"),properties:y(s(),de),required:h(s()).optional()}).catchall(R())}),$r=p.extend({mode:u("url"),message:s(),elicitationId:s(),url:s().url()}),Se=z([pe,$r]),Ws=d.extend({method:u("elicitation/create"),params:Se}),Gs=f.extend({elicitationId:s()}),Ks=S.extend({method:u("notifications/elicitation/complete"),params:Gs}),Ys=_.extend({action:C(["accept","decline","cancel"]),content:xt((ne)=>ne===null?void 0:ne,y(s(),z([s(),g(),v(),h(s())])).optional())}),Qs=l({type:u("ref/resource"),uri:s()}),Xs=l({type:u("ref/prompt"),name:s()}),ei=c.extend({ref:z([Xs,Qs]),argument:l({name:s(),value:s()}),context:l({arguments:y(s(),s()).optional()}).optional()}),Cr=d.extend({method:u("completion/complete"),params:ei}),ti=_.extend({completion:T({values:h(s()).max(100),total:x(g().int()),hasMore:x(v())})}),oi=l({uri:s().startsWith("file://"),name:s().optional(),_meta:y(s(),R()).optional()}),to=d.extend({method:u("roots/list"),params:c.optional()}),Ir=_.extend({roots:h(oi)}),ri=S.extend({method:u("notifications/roots/list_changed"),params:f.optional()}),ni=T({ttl:g().optional(),pollInterval:g().optional()}),Or=C(["working","input_required","completed","failed","cancelled"]),Je=l({taskId:s(),status:Or,ttl:z([g(),wt()]),createdAt:s(),lastUpdatedAt:s(),pollInterval:x(g()),statusMessage:x(s())}),ue=_.extend({task:Je}),si=f.merge(Je),_t=S.extend({method:u("notifications/tasks/status"),params:si}),oo=d.extend({method:u("tasks/get"),params:c.extend({taskId:s()})}),ro=_.merge(Je),no=d.extend({method:u("tasks/result"),params:c.extend({taskId:s()})}),da=_.loose(),ae=$e.extend({method:u("tasks/list")}),W=Ce.extend({tasks:h(Je)}),bt=d.extend({method:u("tasks/cancel"),params:c.extend({taskId:s()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:r,TaskMetadataSchema:n,RelatedTaskMetadataSchema:i,RequestMetaSchema:a,BaseRequestParamsSchema:c,TaskAugmentedRequestParamsSchema:p,RequestSchema:d,NotificationsParamsSchema:f,NotificationSchema:S,ResultSchema:_,RequestIdSchema:b,EmptyResultSchema:P,CancelledNotificationParamsSchema:k,CancelledNotificationSchema:E,IconSchema:I,IconsSchema:D,BaseMetadataSchema:M,ImplementationSchema:q,ClientTasksCapabilitySchema:K,ServerTasksCapabilitySchema:Ee,ClientCapabilitiesSchema:ie,InitializeRequestParamsSchema:Ue,InitializeRequestSchema:it,ServerCapabilitiesSchema:Lo,InitializeResultSchema:Uo,InitializedNotificationSchema:Dt,PingRequestSchema:Ze,ProgressSchema:at,ProgressNotificationParamsSchema:ze,ProgressNotificationSchema:De,PaginatedRequestParamsSchema:Vt,PaginatedRequestSchema:$e,PaginatedResultSchema:Ce,ResourceContentsSchema:Ht,TextResourceContentsSchema:Ft,BlobResourceContentsSchema:Jt,RoleSchema:ve,AnnotationsSchema:ge,ResourceSchema:lt,ResourceTemplateSchema:Zo,ListResourcesRequestSchema:Do,ListResourcesResultSchema:Vo,ListResourceTemplatesRequestSchema:Ve,ListResourceTemplatesResultSchema:Bt,ResourceRequestParamsSchema:ut,ReadResourceRequestParamsSchema:Ho,ReadResourceRequestSchema:Fo,ReadResourceResultSchema:Jo,ResourceListChangedNotificationSchema:Bo,SubscribeRequestParamsSchema:Wo,SubscribeRequestSchema:Go,UnsubscribeRequestParamsSchema:Ko,UnsubscribeRequestSchema:Yo,ResourceUpdatedNotificationParamsSchema:Qo,ResourceUpdatedNotificationSchema:Xo,PromptArgumentSchema:er,PromptSchema:tr,ListPromptsRequestSchema:or,ListPromptsResultSchema:rr,GetPromptRequestParamsSchema:nr,GetPromptRequestSchema:sr,TextContentSchema:dt,ImageContentSchema:pt,AudioContentSchema:ht,ToolUseContentSchema:ir,EmbeddedResourceSchema:He,ResourceLinkSchema:ar,ContentBlockSchema:fe,PromptMessageSchema:Wt,GetPromptResultSchema:Gt,PromptListChangedNotificationSchema:mt,ToolAnnotationsSchema:cr,ToolExecutionSchema:Kt,ToolSchema:ft,ListToolsRequestSchema:Yt,ListToolsResultSchema:Qt,CallToolResultSchema:Xt,CallToolRequestParamsSchema:re,CallToolRequestSchema:lr,ToolListChangedNotificationSchema:Hs,LoggingLevelSchema:eo,SetLevelRequestParamsSchema:ur,SetLevelRequestSchema:dr,LoggingMessageNotificationParamsSchema:pr,LoggingMessageNotificationSchema:hr,ModelHintSchema:mr,ModelPreferencesSchema:fr,ToolChoiceSchema:gr,ToolResultContentSchema:Fs,SamplingContentSchema:Sr,SamplingMessageContentBlockSchema:Fe,SamplingMessageSchema:_r,CreateMessageRequestParamsSchema:br,CreateMessageRequestSchema:yr,CreateMessageResultSchema:zr,CreateMessageResultWithToolsSchema:vr,BooleanSchemaSchema:Rr,StringSchemaSchema:wr,NumberSchemaSchema:xr,UntitledSingleSelectEnumSchemaSchema:Pr,TitledSingleSelectEnumSchemaSchema:Tr,LegacyTitledEnumSchemaSchema:kr,SingleSelectEnumSchemaSchema:Er,UntitledMultiSelectEnumSchemaSchema:gt,TitledMultiSelectEnumSchemaSchema:St,MultiSelectEnumSchemaSchema:Js,EnumSchemaSchema:Bs,PrimitiveSchemaDefinitionSchema:de,ElicitRequestFormParamsSchema:pe,ElicitRequestURLParamsSchema:$r,ElicitRequestParamsSchema:Se,ElicitRequestSchema:Ws,ElicitationCompleteNotificationParamsSchema:Gs,ElicitationCompleteNotificationSchema:Ks,ElicitResultSchema:Ys,ResourceTemplateReferenceSchema:Qs,PromptReferenceSchema:Xs,CompleteRequestParamsSchema:ei,CompleteRequestSchema:Cr,CompleteResultSchema:ti,RootSchema:oi,ListRootsRequestSchema:to,ListRootsResultSchema:Ir,RootsListChangedNotificationSchema:ri,TaskCreationParamsSchema:ni,TaskStatusSchema:Or,TaskSchema:Je,CreateTaskResultSchema:ue,TaskStatusNotificationParamsSchema:si,TaskStatusNotificationSchema:_t,GetTaskRequestSchema:oo,GetTaskResultSchema:ro,GetTaskPayloadRequestSchema:no,GetTaskPayloadResultSchema:da,ListTasksRequestSchema:ae,ListTasksResultSchema:W,CancelTaskRequestSchema:bt,CancelTaskResultSchema:_.merge(Je),ClientRequestSchema:z([Ze,it,Cr,dr,sr,or,Do,Ve,Fo,Go,Yo,lr,Yt,oo,no,ae,bt]),ClientNotificationSchema:z([E,De,Dt,ri,_t]),ClientResultSchema:z([P,zr,vr,Ys,Ir,ro,W,ue]),ServerRequestSchema:z([Ze,yr,Ws,to,oo,no,ae,bt]),ServerNotificationSchema:z([E,De,hr,Xo,Bo,Hs,mt,_t,Ks]),ServerResultSchema:z([P,Uo,ti,Gt,rr,Vo,Bt,Jo,Xt,Qt,ro,W,ue]),CallToolResultWireSchema:R().superRefine((ne,um)=>{if(typeof ne!=="object"||ne===null||Array.isArray(ne)||ne.content!==void 0)return;for(let Wc of _h)if(Wc in ne){um.addIssue({code:"custom",message:`content is required when the body carries '${Wc}' — another result family cannot default into an empty tools/call success`});return}}).transform(Jf).pipe(Xt)}}var Wf;function bh(){return Wf??=Bf()}function yh(e){return e.type!=="object"}var Gf=new Set(["const","enum","default","examples"]),Kf=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function sh(e){return e!==void 0&&!(typeof e==="string"&&e.startsWith("#"))}function Yf(e){let t=typeof e.$schema==="string"?e.$schema:void 0;if(sh(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let o=Qc(e.$schema)&&e.$recursiveAnchor!==!0,r=(n,i)=>{if(Array.isArray(n))return n.map((p)=>r(p,!1));if(n===null||typeof n!=="object")return n;if(!i&&sh(n.$id))return n;let a={},c=!1;for(let[p,d]of Object.entries(n))if(i)a[p]=r(d,!1);else if((p==="$ref"||p==="$dynamicRef")&&typeof d==="string")a[p]=d==="#"?"#/properties/result":d.startsWith("#/")?`#/properties/result${d.slice(1)}`:d;else if(p==="$recursiveRef"&&d==="#"&&o)c=!0;else if(Gf.has(p))a[p]=d;else if(Kf.has(p))a[p]=r(d,!0);else a[p]=r(d,!1);if(c)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:r(e,!1)},required:["result"]}}var zh={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},vh={"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},Qf={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},ia;function Ac(){if(ia)return ia;let e=bh();return ia={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}},ia}function Rh(e){return Object.prototype.hasOwnProperty.call(zh,e)}function wh(e){return Object.prototype.hasOwnProperty.call(vh,e)}function Xf(e){return Object.prototype.hasOwnProperty.call(Qf,e)}function eg(e){return Xf(e)?Ac().resultSchemas[e]:void 0}function tg(e){return Rh(e)?Ac().requestSchemas[e]:void 0}function og(e){return wh(e)?Ac().notificationSchemas[e]:void 0}var cy=Object.keys(zh),ly=Object.keys(vh);function Ic(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function aa(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}var ih={ok:!1,reason:"not-in-era"};function ah(e){return Ic(e)&&Ic(e.outputSchema)&&yh(e.outputSchema)}function ch(e){return e}var jc={era:"2025-11-25",hasRequestMethod:Rh,hasNotificationMethod:wh,validateRequest:(e,t)=>aa(tg(e),t),validateResult:(e,t)=>aa(eg(e),t),validateNotification:(e,t)=>aa(og(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>ih,validateInputResponse:()=>ih,samplingResultVariant:(e,t)=>{let o=bh();return aa(e?o.CreateMessageResultWithToolsSchema:o.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let o=Sh(e),r=o.structuredContent;if(r===void 0)return o;let n=typeof r!=="object"||r===null||Array.isArray(r),i=t!==void 0&&yh(t);if(!n&&!i)return o;return{...o,structuredContent:{result:r}}},decodeResult(e,t){if(Ic(t)&&"resultType"in t){let o={...t};return delete o.resultType,{kind:"complete",result:ch(o)}}return{kind:"complete",result:ch(t)}},encodeResult(e,t){if(e!=="tools/list")return t;let o=t.tools;if(!Array.isArray(o)||!o.some((r)=>ah(r)))return t;return{...t,tools:o.map((r)=>ah(r)?{...r,outputSchema:Yf(r.outputSchema)}:r)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function rg(){let e=Wr(()=>z([s(),g(),v(),wt(),y(s(),e),h(e)])),t=y(s(),e),o=z([s(),g().int()]),r=s(),n=z([s(),g().int()]),i=C(["user","assistant"]),a=C(["debug","info","notice","warning","error","critical","alert","emergency"]),c=s().refine((W)=>{try{return atob(W),!0}catch{return!1}},{message:"Invalid Base64 string"}),p=l({ttl:g().optional()}),d=l({taskId:s()}),f=T({progressToken:o.optional(),"io.modelcontextprotocol/related-task":d.optional()}),S=l({_meta:f.optional()}),_=S.extend({task:p.optional()}),b=l({_meta:f.optional()}),P=l({method:s(),params:b.loose().optional()}),k=l({src:s(),mimeType:s().optional(),sizes:h(s()).optional(),theme:C(["light","dark"]).optional()}),E=l({icons:h(k).optional()}),I=l({name:s(),title:s().optional()}),D=I.extend({...I.shape,...E.shape,version:s(),websiteUrl:s().optional(),description:s().optional()}),M=Oe(l({applyDefaults:v().optional()}),t),q=xt((W)=>{if(W&&typeof W==="object"&&!Array.isArray(W)&&Object.keys(W).length===0)return{form:{}};return W},Oe(l({form:M.optional(),url:t.optional()}),t.optional())),V=T({list:t.optional(),cancel:t.optional(),requests:T({sampling:T({createMessage:t.optional()}).optional(),elicitation:T({create:t.optional()}).optional()}).optional()}),U=T({list:t.optional(),cancel:t.optional(),requests:T({tools:T({call:t.optional()}).optional()}).optional()}),K=l({experimental:y(s(),t).optional(),sampling:l({context:t.optional(),tools:t.optional()}).optional(),elicitation:q.optional(),roots:l({listChanged:v().optional()}).optional(),tasks:V.optional(),extensions:y(s(),t).optional()}),Ee=l({experimental:y(s(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:l({listChanged:v().optional()}).optional(),resources:l({subscribe:v().optional(),listChanged:v().optional()}).optional(),tools:l({listChanged:v().optional()}).optional(),tasks:U.optional(),extensions:y(s(),t).optional()}),ie=l({progress:g(),total:x(g()),message:x(s())}),Ue=l({...b.shape,...ie.shape,progressToken:o}),it=P.extend({method:u("notifications/progress"),params:Ue}),Lo=b.extend({level:a,logger:s().optional(),data:R()}),Uo=P.extend({method:u("notifications/message"),params:Lo}),Dt=l({uri:s(),mimeType:x(s()),_meta:y(s(),R()).optional()}),Ze=Dt.extend({text:s()}),at=Dt.extend({blob:c}),ze=l({audience:h(i).optional(),priority:g().min(0).max(1).optional(),lastModified:lo({offset:!0}).optional()}),De=l({...I.shape,...E.shape,uri:s(),description:x(s()),mimeType:x(s()),size:x(g()),annotations:ze.optional(),_meta:x(T({}))}),Vt=l({...I.shape,...E.shape,uriTemplate:s(),description:x(s()),mimeType:x(s()),annotations:ze.optional(),_meta:x(T({}))}),$e=P.extend({method:u("notifications/resources/list_changed"),params:b.optional()}),Ce=b.extend({uri:s()}),Ht=P.extend({method:u("notifications/resources/updated"),params:Ce}),Ft=l({name:s(),description:x(s()),required:x(v())}),ct=l({...I.shape,...E.shape,description:x(s()),arguments:x(h(Ft)),_meta:x(T({}))}),Jt=P.extend({method:u("notifications/prompts/list_changed"),params:b.optional()}),ve=l({type:u("text"),text:s(),annotations:ze.optional(),_meta:y(s(),R()).optional()}),ge=l({type:u("image"),data:c,mimeType:s(),annotations:ze.optional(),_meta:y(s(),R()).optional()}),lt=l({type:u("audio"),data:c,mimeType:s(),annotations:ze.optional(),_meta:y(s(),R()).optional()}),Zo=l({type:u("tool_use"),name:s(),id:s(),input:y(s(),R()),_meta:y(s(),R()).optional()}),Do=l({type:u("resource"),resource:z([Ze,at]),annotations:ze.optional(),_meta:y(s(),R()).optional()}),Vo=De.extend({type:u("resource_link")}),Ve=z([ve,ge,lt,Vo,Do]),Bt=l({role:i,content:Ve}),ut=l({title:s().optional(),readOnlyHint:v().optional(),destructiveHint:v().optional(),idempotentHint:v().optional(),openWorldHint:v().optional()}),Ho=P.extend({method:u("notifications/tools/list_changed"),params:b.optional()}),Fo=l({name:s().optional()}),Jo=l({hints:h(Fo).optional(),costPriority:g().min(0).max(1).optional(),speedPriority:g().min(0).max(1).optional(),intelligencePriority:g().min(0).max(1).optional()}),Bo=l({mode:C(["auto","required","none"]).optional()}),Wo=l({type:u("boolean"),title:s().optional(),description:s().optional(),default:v().optional()}),Go=l({type:u("string"),title:s().optional(),description:s().optional(),minLength:g().optional(),maxLength:g().optional(),format:C(["email","uri","date","date-time"]).optional(),default:s().optional()}),Ko=l({type:C(["number","integer"]),title:s().optional(),description:s().optional(),minimum:g().optional(),maximum:g().optional(),default:g().optional()}),Yo=l({type:u("string"),title:s().optional(),description:s().optional(),enum:h(s()),default:s().optional()}),Qo=l({type:u("string"),title:s().optional(),description:s().optional(),oneOf:h(l({const:s(),title:s()})),default:s().optional()}),Xo=l({type:u("string"),title:s().optional(),description:s().optional(),enum:h(s()),enumNames:h(s()).optional(),default:s().optional()}),er=z([Yo,Qo]),tr=l({type:u("array"),title:s().optional(),description:s().optional(),minItems:g().optional(),maxItems:g().optional(),items:l({type:u("string"),enum:h(s())}),default:h(s()).optional()}),or=l({type:u("array"),title:s().optional(),description:s().optional(),minItems:g().optional(),maxItems:g().optional(),items:l({anyOf:h(l({const:s(),title:s()}))}),default:h(s()).optional()}),rr=z([tr,or]),nr=z([Xo,er,rr]),sr=z([nr,Wo,Go,Ko]),dt=_.extend({mode:u("form").optional(),message:s(),requestedSchema:l({type:u("object"),properties:y(s(),sr),required:h(s()).optional()}).catchall(R())}),pt=l({type:u("ref/resource"),uri:s()}),ht=l({type:u("ref/prompt"),name:s()}),ir=l({uri:s().startsWith("file://"),name:s().optional(),_meta:y(s(),R()).optional()}),He=K.shape,ar=l({experimental:He.experimental,sampling:He.sampling,elicitation:He.elicitation,roots:He.roots,extensions:He.extensions}),fe=Ee.shape,Wt=l({experimental:fe.experimental,logging:fe.logging,completions:fe.completions,prompts:fe.prompts,resources:fe.resources,tools:fe.tools,extensions:fe.extensions}),Gt=T({progressToken:o.optional(),[Pt]:s(),[po]:D.optional(),[Tt]:ar,[ho]:a.optional()}),mt=l({...I.shape,...E.shape,description:s().optional(),inputSchema:T({$schema:s().optional(),type:u("object")}),outputSchema:T({$schema:s().optional()}).optional(),annotations:ut.optional(),_meta:y(s(),R()).optional()}),cr=l({type:u("tool_result"),toolUseId:s(),content:h(Ve),structuredContent:R().optional(),isError:v().optional(),_meta:y(s(),R()).optional()}),Kt=z([ve,ge,lt,Zo,cr]),ft=l({role:i,content:z([Kt,h(Kt)]),_meta:y(s(),R()).optional()}),Yt=s(),Qt=T({[Xe]:D.optional().catch(void 0)}),Xt=Qt.optional();function re(W){return T({_meta:Xt,resultType:Yt.default("complete"),...W})}let lr=re({}),Hs=re({nextCursor:r.optional()}),eo=re({content:h(Ve),structuredContent:R().optional(),isError:v().optional()}),ur=re({ttlMs:g().int().min(0),cacheScope:C(["public","private"]),tools:h(mt),nextCursor:r.optional()}),dr=re({ttlMs:g().int().min(0),cacheScope:C(["public","private"]),prompts:h(ct),nextCursor:r.optional()}),pr=re({description:s().optional(),messages:h(Bt)}),hr=re({ttlMs:g().int().min(0),cacheScope:C(["public","private"]),resources:h(De),nextCursor:r.optional()}),mr=re({ttlMs:g().int().min(0),cacheScope:C(["public","private"]),resourceTemplates:h(Vt),nextCursor:r.optional()}),fr=re({ttlMs:g().int().min(0),cacheScope:C(["public","private"]),contents:h(z([Ze,at]))}),gr=re({completion:l({values:h(s()).max(100),total:g().int().optional(),hasMore:v().optional()}).loose()}),Fs=re({ttlMs:g().int().min(0),cacheScope:C(["public","private"])}),Sr=re({ttlMs:g().int().min(0).catch(0),cacheScope:C(["public","private"]).catch("private"),supportedVersions:h(s()),capabilities:Wt,instructions:s().optional()}),Fe=l({messages:h(ft),modelPreferences:Jo.optional(),systemPrompt:s().optional(),includeContext:C(["none","thisServer","allServers"]).optional(),temperature:g().optional(),maxTokens:g().int(),stopSequences:h(s()).optional(),metadata:t.optional(),tools:h(mt).optional(),toolChoice:Bo.optional()}),_r=l({method:u("sampling/createMessage"),params:Fe}),br=l({method:u("roots/list"),params:l({_meta:y(s(),R()).optional()}).optional()}),yr=l({...ft.shape,model:s(),stopReason:s().optional()}),zr=l({roots:h(ir)}),vr=l({action:C(["accept","decline","cancel"]),content:y(s(),z([s(),g(),v(),h(s())])).optional()}),Rr=l({mode:u("url"),message:s(),url:s().url()}),wr=z([dt,Rr]),xr=l({method:u("elicitation/create"),params:wr}),Pr=z([_r,br,xr]),Tr=z([yr,zr,vr]),kr=y(s(),Pr),Er=y(s(),Tr),gt=re({inputRequests:kr.optional(),requestState:s().optional()}),St={inputResponses:Er.optional(),requestState:s().optional()},Js=l({_meta:Gt,...St}),Bs=T({progressToken:o.optional()});function de(W,bt){return l({method:u(W),params:l({_meta:Gt,...bt})})}function pe(W,bt){return l({method:u(W),params:l({_meta:Bs.optional(),...bt}).optional()})}let $r={name:s(),arguments:y(s(),R()).optional(),...St},Se={cursor:r.optional()},Ws=de("tools/call",$r),Gs=de("tools/list",Se),Ks=de("prompts/list",Se),Ys=de("prompts/get",{name:s(),arguments:y(s(),s()).optional(),...St}),Qs=de("resources/list",Se),Xs=de("resources/templates/list",Se),ei=de("resources/read",{uri:s(),...St}),Cr={ref:z([ht,pt]),argument:l({name:s(),value:s()}),context:l({arguments:y(s(),s()).optional()}).optional()},ti=de("completion/complete",Cr),oi=de("server/discover",{}),to=l({toolsListChanged:v().optional(),promptsListChanged:v().optional(),resourcesListChanged:v().optional(),resourceSubscriptions:h(s()).optional()}),Ir={notifications:to},ri=de("subscriptions/listen",Ir),ni=Qt.extend({"io.modelcontextprotocol/subscriptionId":n}),Or=T({_meta:ni,resultType:Yt.default("complete")}),Je={"tools/call":pe("tools/call",$r),"tools/list":pe("tools/list",Se),"prompts/get":pe("prompts/get",{name:s(),arguments:y(s(),s()).optional()}),"prompts/list":pe("prompts/list",Se),"resources/list":pe("resources/list",Se),"resources/templates/list":pe("resources/templates/list",Se),"resources/read":pe("resources/read",{uri:s()}),"completion/complete":pe("completion/complete",Cr),"server/discover":pe("server/discover",{}),"subscriptions/listen":pe("subscriptions/listen",Ir)};function ue(W){return T({_meta:Xt,...W})}let si={"tools/call":ue({content:h(Ve),structuredContent:R().optional(),isError:v().optional()}),"tools/list":ue({ttlMs:g().int().min(0),cacheScope:C(["public","private"]),tools:h(mt),nextCursor:r.optional()}),"prompts/get":ue({description:s().optional(),messages:h(Bt)}),"prompts/list":ue({ttlMs:g().int().min(0),cacheScope:C(["public","private"]),prompts:h(ct),nextCursor:r.optional()}),"resources/list":ue({ttlMs:g().int().min(0),cacheScope:C(["public","private"]),resources:h(De),nextCursor:r.optional()}),"resources/templates/list":ue({ttlMs:g().int().min(0),cacheScope:C(["public","private"]),resourceTemplates:h(Vt),nextCursor:r.optional()}),"resources/read":ue({ttlMs:g().int().min(0),cacheScope:C(["public","private"]),contents:h(z([Ze,at]))}),"completion/complete":ue({completion:l({values:h(s()).max(100),total:g().int().optional(),hasMore:v().optional()}).loose()}),"server/discover":ue({ttlMs:g().int().min(0).catch(0),cacheScope:C(["public","private"]).catch("private"),supportedVersions:h(s()),capabilities:Wt,instructions:s().optional()}),"subscriptions/listen":ue({})},_t=T({"io.modelcontextprotocol/subscriptionId":n.optional()}),oo=l({method:u("notifications/subscriptions/acknowledged"),params:l({_meta:_t.optional(),notifications:to})}),ro=l({_meta:_t.optional(),requestId:n,reason:s().optional()}),no=l({method:u("notifications/cancelled"),params:ro}),da={"notifications/cancelled":no,"notifications/progress":it,"notifications/message":Uo,"notifications/resources/updated":Ht,"notifications/resources/list_changed":$e,"notifications/tools/list_changed":Ho,"notifications/prompts/list_changed":Jt,"notifications/subscriptions/acknowledged":oo},ae=(W)=>l({jsonrpc:u("2.0"),id:z([s(),g().int()]),result:W}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:r,RequestIdSchema:n,RoleSchema:i,LoggingLevelSchema:a,TaskMetadataSchema:p,RelatedTaskMetadataSchema:d,RequestMetaSchema:f,BaseRequestParamsSchema:S,TaskAugmentedRequestParamsSchema:_,NotificationsParamsSchema:b,NotificationSchema:P,IconSchema:k,IconsSchema:E,BaseMetadataSchema:I,ImplementationSchema:D,ClientTasksCapabilitySchema:V,ServerTasksCapabilitySchema:U,ClientCapabilitiesSchema:K,ServerCapabilitiesSchema:Ee,ProgressSchema:ie,ProgressNotificationParamsSchema:Ue,ProgressNotificationSchema:it,LoggingMessageNotificationParamsSchema:Lo,LoggingMessageNotificationSchema:Uo,ResourceContentsSchema:Dt,TextResourceContentsSchema:Ze,BlobResourceContentsSchema:at,AnnotationsSchema:ze,ResourceSchema:De,ResourceTemplateSchema:Vt,ResourceListChangedNotificationSchema:$e,ResourceUpdatedNotificationParamsSchema:Ce,ResourceUpdatedNotificationSchema:Ht,PromptArgumentSchema:Ft,PromptSchema:ct,PromptListChangedNotificationSchema:Jt,TextContentSchema:ve,ImageContentSchema:ge,AudioContentSchema:lt,ToolUseContentSchema:Zo,EmbeddedResourceSchema:Do,ResourceLinkSchema:Vo,ContentBlockSchema:Ve,PromptMessageSchema:Bt,ToolAnnotationsSchema:ut,ToolListChangedNotificationSchema:Ho,ModelHintSchema:Fo,ModelPreferencesSchema:Jo,ToolChoiceSchema:Bo,BooleanSchemaSchema:Wo,StringSchemaSchema:Go,NumberSchemaSchema:Ko,UntitledSingleSelectEnumSchemaSchema:Yo,TitledSingleSelectEnumSchemaSchema:Qo,LegacyTitledEnumSchemaSchema:Xo,SingleSelectEnumSchemaSchema:er,UntitledMultiSelectEnumSchemaSchema:tr,TitledMultiSelectEnumSchemaSchema:or,MultiSelectEnumSchemaSchema:rr,EnumSchemaSchema:nr,PrimitiveSchemaDefinitionSchema:sr,ElicitRequestFormParamsSchema:dt,ResourceTemplateReferenceSchema:pt,PromptReferenceSchema:ht,RootSchema:ir,ClientCapabilities2026Schema:ar,ServerCapabilities2026Schema:Wt,RequestMetaEnvelopeSchema:Gt,ToolSchema:mt,ToolResultContentSchema:cr,SamplingMessageContentBlockSchema:Kt,SamplingMessageSchema:ft,ResultTypeSchema:Yt,ResultMetaSchema:Qt,ResultSchema:lr,PaginatedResultSchema:Hs,CallToolResultSchema:eo,ListToolsResultSchema:ur,ListPromptsResultSchema:dr,GetPromptResultSchema:pr,ListResourcesResultSchema:hr,ListResourceTemplatesResultSchema:mr,ReadResourceResultSchema:fr,CompleteResultSchema:gr,CacheableResultSchema:Fs,DiscoverResultSchema:Sr,CreateMessageRequestParamsSchema:Fe,CreateMessageRequestSchema:_r,ListRootsRequestSchema:br,CreateMessageResultSchema:yr,ListRootsResultSchema:zr,ElicitResultSchema:vr,ElicitRequestURLParamsSchema:Rr,ElicitRequestParamsSchema:wr,ElicitRequestSchema:xr,InputRequestSchema:Pr,InputResponseSchema:Tr,InputRequestsSchema:kr,InputResponsesSchema:Er,InputRequiredResultSchema:gt,InputResponseRequestParamsSchema:Js,CallToolRequestSchema:Ws,ListToolsRequestSchema:Gs,ListPromptsRequestSchema:Ks,GetPromptRequestSchema:Ys,ListResourcesRequestSchema:Qs,ListResourceTemplatesRequestSchema:Xs,ReadResourceRequestSchema:ei,CompleteRequestSchema:ti,DiscoverRequestSchema:oi,SubscriptionFilterSchema:to,SubscriptionsListenRequestSchema:ri,SubscriptionsListenResultMetaSchema:ni,SubscriptionsListenResultSchema:Or,dispatchRequestSchemas:Je,dispatchResultSchemas:si,NotificationMetaSchema:_t,SubscriptionsAcknowledgedNotificationSchema:oo,CancelledNotificationParamsSchema:ro,CancelledNotificationSchema:no,notificationSchemas2026:da,JSONRPCResultResponseSchema:ae(lr),CallToolResultResponseSchema:ae(z([eo,gt])),ListToolsResultResponseSchema:ae(ur),ListPromptsResultResponseSchema:ae(dr),GetPromptResultResponseSchema:ae(z([pr,gt])),ListResourcesResultResponseSchema:ae(hr),ListResourceTemplatesResultResponseSchema:ae(mr),ReadResourceResultResponseSchema:ae(z([fr,gt])),CompleteResultResponseSchema:ae(gr),DiscoverResultResponseSchema:ae(Sr),SubscriptionsListenResultResponseSchema:ae(Or)}}var ng;function nt(){return ng??=rg()}var sg=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function ig(e){return sg.includes(e)}var Lc=Symbol("modelcontextprotocol.resultCacheHintFallback");function ag(e){return e[Lc]}function xh(e){return typeof e==="number"&&Number.isSafeInteger(e)&&e>=0}function Ph(e){return e==="public"||e==="private"}var O=function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e}({}),oe=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return me(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 me(this,t)}constructor(t,o,r){super(o);this.code=t,this.data=r,this.name="ProtocolError",Zt(this,new.target)}static fromError(t,o,r){if(t===O.UrlElicitationRequired&&r){let n=r;if(n.elicitations)return new kh(n.elicitations,o)}if(t===O.UnsupportedProtocolVersion&&r){let n=r;if(Array.isArray(n.supported)&&typeof n.requested==="string")return new Eh({supported:n.supported,requested:n.requested},o)}if(t===O.InvalidParams||t===O.ResourceNotFound){let n=r;if(typeof n?.uri==="string"&&(t===O.ResourceNotFound||Object.keys(n).length===1))return new Th(n.uri,o)}if(t===O.MissingRequiredClientCapability&&r){let n=r;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities==="object"&&!Array.isArray(n.requiredCapabilities))return new $h({requiredCapabilities:n.requiredCapabilities},o)}return new e(t,o,r)}},Th=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(O.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},kh=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(O.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Eh=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(O.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},$h=class extends oe{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(O.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},cg=0,lg="private",ug=["tools/call","prompts/get","resources/read"];function dg(e,t){let o=t.resultType;if(o===void 0)return{...t,resultType:"complete"};if(o==="complete")return t;if(ug.includes(e))return t;throw new oe(O.InternalError,`Handler for ${e} returned resultType '${String(o)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function pg(e,t){let o=ag(t);if(t.resultType!=="complete"||!ig(e))return o===void 0?t:Sg(t);let r=t,n=xh(r.ttlMs)?r.ttlMs:fg(o),i=Ph(r.cacheScope)?r.cacheScope:gg(o),a={...r,ttlMs:n,cacheScope:i};return delete a[Lc],a}function hg(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function mg(e,t){if(t===void 0)return e;let o=e._meta;if(o===void 0)return{...e,_meta:{[Xe]:t}};if(!hg(o))return e;if(o[Xe]!==void 0)return e;return{...e,_meta:{...o,[Xe]:t}}}function fg(e){return e!==void 0&&xh(e.ttlMs)?e.ttlMs:cg}function gg(e){return e!==void 0&&Ph(e.cacheScope)?e.cacheScope:lg}function Sg(e){let t={...e};return delete t[Lc],t}var _g=["elicitation/create","sampling/createMessage","roots/list"],ca;function Ch(){if(ca)return ca;let e=nt();return ca={request:{"elicitation/create":l({method:u("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":l({method:u("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":l({method:u("roots/list"),params:T({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},ca}function Ih(e){return _g.includes(e)}function Pc(e){return Ih(e)?Ch().request[e]:void 0}function bg(e){return Ih(e)?Ch().response[e]:void 0}var Uc={"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},Oh={"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 Nh(e){return Object.prototype.hasOwnProperty.call(Uc,e)}function Mh(e){return Object.prototype.hasOwnProperty.call(Oh,e)}function yg(e){return Object.prototype.hasOwnProperty.call(Uc,e)}function zg(e){return Nh(e)?nt().dispatchRequestSchemas[e]:void 0}function vg(e){return yg(e)?nt().dispatchResultSchemas[e]:void 0}function Rg(e){return Mh(e)?nt().notificationSchemas2026[e]:void 0}var uy=Object.keys(Uc),dy=Object.keys(Oh);function js(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function qs(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}var wg={ok:!1,reason:"not-in-era"},xg=[Pt,Tt];function Pg(e,t){let o=t,r=!1,n=()=>{if(!r)o={...o},r=!0;return o},i=t.tools;if(e==="tools/list"&&Array.isArray(i)&&i.some((c)=>js(c)&&("execution"in c)))n().tools=i.map((c)=>{if(!js(c)||!("execution"in c))return c;let p={...c};return delete p.execution,p});let a=t.capabilities;if(js(a)&&"tasks"in a){let c={...a};delete c.tasks,n().capabilities=c}return o}var Zc={era:"2026-07-28",hasRequestMethod:Nh,hasNotificationMethod:Mh,hasInputRequestMethod:(e)=>Pc(e)!==void 0,validateRequest:(e,t)=>qs(zg(e),t),validateResult:(e,t)=>qs(vg(e),t),validateNotification:(e,t)=>qs(Rg(e),t),validateInputRequest:(e,t)=>qs(Pc(e),t),validateInputResponse:(e,t)=>qs(bg(e),t),samplingResultVariant:()=>wg,outboundEnvelope(e){return{[Pt]:e.protocolVersion,[po]:e.clientInfo,[Tt]:e.clientCapabilities,...e.logLevel!==void 0&&{[ho]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let r of xg)if(!(r in e))t.push({key:r,problem:"missing"});let o=nt().RequestMetaEnvelopeSchema.safeParse(e);if(!o.success)for(let r of o.error.issues){let n=r.path.map(String),i=n.length>0?n.join("."):"_meta";if(n.length===1&&t.some((a)=>a.key===i&&a.problem==="missing"))continue;t.push({key:i,problem:r.message})}return t},projectCallToolResult:(e)=>Sh(e),inputRequestSchema:Pc,decodeResult(e,t){if(!js(t))return{kind:"invalid",error:new G(te.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let o=t.resultType;if(o===void 0)return{kind:"invalid",error:new G(te.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 o!=="string")return{kind:"invalid",error:new G(te.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:o})};if(o==="input_required"){let a=t.inputRequests,c=js(a)?a:{},p=t.requestState,d=t._meta===void 0?void 0:nt().ResultMetaSchema.safeParse(t._meta),f=d?.success?d.data:void 0;if(Object.keys(c).length===0&&typeof p!=="string")return{kind:"invalid",error:new G(te.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:c,...typeof p==="string"&&{requestState:p},...f!==void 0&&{_meta:f}}}if(o!=="complete")return{kind:"invalid",error:new G(te.UnsupportedResultType,`Unsupported result type '${o}' for ${e}`,{resultType:o,method:e})};let r=Tg(),n=Object.hasOwn(r,e)?r[e]:void 0;if(n!==void 0){let a=n.safeParse(t);if(!a.success)return{kind:"invalid",error:new G(te.InvalidResult,`Invalid result for ${e}: ${a.error}`,{method:e})}}let i={...t};return delete i.resultType,{kind:"complete",result:i}},encodeResult(e,t,o){return mg(pg(e,dg(e,Pg(e,t))),o)},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=nt().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map((o)=>o.message).join("; ")}`}},la;function Tg(){if(la)return la;let e=nt();return la={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},la}var Dc="2026-07-28";function Us(e){return e!==void 0&&gh(e)?Zc:jc}function lh(e){if(e.revision!==void 0)return Us(e.revision).era;return e.era==="modern"?Zc.era:jc.era}function Tc(e){return qh.some((t)=>t.hasRequestMethod(e))}function kc(e){return qh.some((t)=>t.hasNotificationMethod(e))}function uh(e){return e==="tasks/get"||e==="tasks/cancel"}var qh=[jc,Zc],kg=Kc({AnnotationsSchema:()=>Pe,AudioContentSchema:()=>Mt,BaseMetadataSchema:()=>we,BaseRequestParamsSchema:()=>Q,BlobResourceContentsSchema:()=>To,BooleanSchemaSchema:()=>Co,CallToolRequestParamsSchema:()=>Hn,CallToolRequestSchema:()=>Fn,CallToolResultSchema:()=>rt,CancelTaskRequestSchema:()=>Ki,CancelTaskResultSchema:()=>Yi,CancelledNotificationParamsSchema:()=>Yr,CancelledNotificationSchema:()=>yo,ClientCapabilitiesSchema:()=>Xr,ClientNotificationSchema:()=>Xi,ClientRequestSchema:()=>Qi,ClientResultSchema:()=>ea,ClientTasksCapabilitySchema:()=>Ai,CompatibilityCallToolResultSchema:()=>Li,CompleteRequestParamsSchema:()=>_s,CompleteRequestSchema:()=>bs,CompleteResultSchema:()=>ys,ContentBlockSchema:()=>Te,CreateMessageRequestParamsSchema:()=>rs,CreateMessageRequestSchema:()=>ns,CreateMessageResultSchema:()=>ss,CreateMessageResultWithToolsSchema:()=>is,CreateTaskResultSchema:()=>Di,CursorSchema:()=>fo,DiscoverRequestSchema:()=>nn,DiscoverResultSchema:()=>vo,ElicitRequestFormParamsSchema:()=>Ut,ElicitRequestParamsSchema:()=>ds,ElicitRequestSchema:()=>ps,ElicitRequestURLParamsSchema:()=>us,ElicitResultSchema:()=>fs,ElicitationCompleteNotificationParamsSchema:()=>hs,ElicitationCompleteNotificationSchema:()=>ms,EmbeddedResourceSchema:()=>qt,EmptyResultSchema:()=>tt,EnumSchemaSchema:()=>ls,GetPromptRequestParamsSchema:()=>Nn,GetPromptRequestSchema:()=>Mn,GetPromptResultSchema:()=>jn,GetTaskPayloadRequestSchema:()=>Ji,GetTaskPayloadResultSchema:()=>Bi,GetTaskRequestSchema:()=>Hi,GetTaskResultSchema:()=>Fi,IconSchema:()=>Qr,IconsSchema:()=>Me,ImageContentSchema:()=>Nt,ImplementationSchema:()=>xe,InitializeRequestParamsSchema:()=>en,InitializeRequestSchema:()=>tn,InitializeResultSchema:()=>on,InitializedNotificationSchema:()=>rn,JSONArraySchema:()=>Mi,JSONObjectSchema:()=>F,JSONRPCErrorResponseSchema:()=>$t,JSONRPCMessageSchema:()=>Ct,JSONRPCNotificationSchema:()=>bo,JSONRPCRequestSchema:()=>_o,JSONRPCResponseSchema:()=>qi,JSONRPCResultResponseSchema:()=>Et,JSONValueSchema:()=>Ne,LegacyTitledEnumSchemaSchema:()=>No,ListChangedOptionsBaseSchema:()=>Ui,ListPromptsRequestSchema:()=>In,ListPromptsResultSchema:()=>On,ListResourceTemplatesRequestSchema:()=>pn,ListResourceTemplatesResultSchema:()=>hn,ListResourcesRequestSchema:()=>un,ListResourcesResultSchema:()=>dn,ListRootsRequestSchema:()=>vs,ListRootsResultSchema:()=>Rs,ListTasksRequestSchema:()=>Wi,ListTasksResultSchema:()=>Gi,ListToolsRequestSchema:()=>Dn,ListToolsResultSchema:()=>Vn,LoggingLevelSchema:()=>$o,LoggingMessageNotificationParamsSchema:()=>Gn,LoggingMessageNotificationSchema:()=>Kn,ModelHintSchema:()=>Yn,ModelPreferencesSchema:()=>Qn,MultiSelectEnumSchemaSchema:()=>cs,NotificationSchema:()=>ee,NotificationsParamsSchema:()=>se,NumberSchemaSchema:()=>Lt,PaginatedRequestParamsSchema:()=>cn,PaginatedRequestSchema:()=>qe,PaginatedResultSchema:()=>Ae,PingRequestSchema:()=>Ro,PrimitiveSchemaDefinitionSchema:()=>Ao,ProgressNotificationParamsSchema:()=>an,ProgressNotificationSchema:()=>wo,ProgressSchema:()=>sn,ProgressTokenSchema:()=>mo,PromptArgumentSchema:()=>$n,PromptListChangedNotificationSchema:()=>Ln,PromptMessageSchema:()=>An,PromptReferenceSchema:()=>Ss,PromptSchema:()=>Cn,ReadResourceRequestParamsSchema:()=>mn,ReadResourceRequestSchema:()=>fn,ReadResourceResultSchema:()=>gn,RelatedTaskMetadataSchema:()=>Kr,RequestIdSchema:()=>ye,RequestMetaSchema:()=>go,RequestSchema:()=>J,ResourceContentsSchema:()=>xo,ResourceLinkSchema:()=>At,ResourceListChangedNotificationSchema:()=>Sn,ResourceRequestParamsSchema:()=>It,ResourceSchema:()=>ko,ResourceTemplateReferenceSchema:()=>gs,ResourceTemplateSchema:()=>ln,ResourceUpdatedNotificationParamsSchema:()=>kn,ResourceUpdatedNotificationSchema:()=>En,ResultMetaObjectSchema:()=>So,ResultSchema:()=>B,RoleSchema:()=>je,RootSchema:()=>zs,RootsListChangedNotificationSchema:()=>ws,SamplingContentSchema:()=>ts,SamplingMessageContentBlockSchema:()=>Qe,SamplingMessageSchema:()=>os,ServerCapabilitiesSchema:()=>zo,ServerNotificationSchema:()=>oa,ServerRequestSchema:()=>ta,ServerResultSchema:()=>ra,ServerTasksCapabilitySchema:()=>ji,SetLevelRequestParamsSchema:()=>Bn,SetLevelRequestSchema:()=>Wn,SingleSelectEnumSchemaSchema:()=>as,StringSchemaSchema:()=>jt,SubscribeRequestParamsSchema:()=>_n,SubscribeRequestSchema:()=>bn,SubscriptionFilterSchema:()=>Eo,SubscriptionsAcknowledgedNotificationParamsSchema:()=>wn,SubscriptionsAcknowledgedNotificationSchema:()=>xn,SubscriptionsListenRequestParamsSchema:()=>vn,SubscriptionsListenRequestSchema:()=>Rn,SubscriptionsListenResultMetaSchema:()=>Pn,SubscriptionsListenResultSchema:()=>Tn,TaskAugmentedRequestParamsSchema:()=>et,TaskCreationParamsSchema:()=>Zi,TaskMetadataSchema:()=>Gr,TaskSchema:()=>Le,TaskStatusNotificationParamsSchema:()=>Ps,TaskStatusNotificationSchema:()=>Vi,TaskStatusSchema:()=>xs,TextContentSchema:()=>Ot,TextResourceContentsSchema:()=>Po,TitledMultiSelectEnumSchemaSchema:()=>qo,TitledSingleSelectEnumSchemaSchema:()=>Oo,ToolAnnotationsSchema:()=>Un,ToolChoiceSchema:()=>Xn,ToolExecutionSchema:()=>Zn,ToolListChangedNotificationSchema:()=>Jn,ToolResultContentSchema:()=>es,ToolSchema:()=>ot,ToolUseContentSchema:()=>qn,UnsubscribeRequestParamsSchema:()=>yn,UnsubscribeRequestSchema:()=>zn,UntitledMultiSelectEnumSchemaSchema:()=>Mo,UntitledSingleSelectEnumSchemaSchema:()=>Io});var Ah=(e)=>_o.safeParse(e).success,jh=(e)=>bo.safeParse(e).success,Oc=(e)=>Et.safeParse(e).success,Lh=(e)=>$t.safeParse(e).success;var Ls=-32020,py=[{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:[O.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:[Ls,O.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:[O.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:[O.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:[O.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:[Ls],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half — including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[O.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:[Ls],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."}],hy={[O.ParseError]:400,[O.InvalidRequest]:400,[O.MethodNotFound]:404,[O.UnsupportedProtocolVersion]:400,[O.MissingRequiredClientCapability]:400,[Ls]:400};function Vc(e,t){return Pi(e,t)}function As(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function Nc(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 dh=!1,Mc="draft-2020-12";function Eg(e,t="input"){let o=e["~standard"],r;if(o.jsonSchema)r=o.jsonSchema[t]({target:Mc});else if(o.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(!dh)dh=!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.");r=wi(e,{target:Mc,io:t})}else throw Error(`Schema library "${o.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output"){if(r.type!==void 0)return r;return Uh(r)?{type:"object",...r}:r}if(r.type!==void 0&&r.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...r}}function Uh(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let o=e[t];if(Array.isArray(o)&&o.length>0)return o.every((r)=>r!==null&&typeof r==="object"&&(r.type==="object"||Uh(r)))}return!1}function $g(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 Ec(e,t){let o=await e["~standard"].validate(t);if(o.issues&&o.issues.length>0)return{success:!1,error:o.issues.map((r)=>$g(r)).join(", ")};return{success:!0,data:o.value}}function Cg(e){let t=wi(e,{target:Mc,io:"input"});return typeof t.pattern==="string"?t.pattern:void 0}var Ig=/\\\.\\d\{(\d+)\}/;function Og(e){let t=Ig.exec(e),o=[void 0,-1,0];if(t)o.push(Number(t[1]));return[!1,!0].flatMap((r)=>[!1,!0].flatMap((n)=>o.map((i)=>lo({local:r,offset:n,precision:i}))))}function Ng(e,t){let o;switch(e){case"email":o=[jp()];break;case"uri":o=[ki()];break;case"date":o=[bc()];break;case"date-time":o=Og(t);break}return new Set(o.map((r)=>Cg(r)).filter((r)=>r!==void 0))}function Mg(e,t,o){if(o!=="zod")return!0;return Ng(e,t).has(t)}function Zs(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function qg(e){try{return Eg(e,"input")}catch(t){let o=t instanceof Error?t.message:String(t);throw new oe(O.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${o}`)}}var Ag=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Hc(e){return Ag.has(e)||e.startsWith("x-")}var jg=new Set(["$schema",...Object.keys(Ut.shape.requestedSchema.shape)]),ph={string:As([jt,Io,Oo,No]),number:As([Lt]),integer:As([Lt]),boolean:As([Co]),array:As([Mo,qo])},Lg=new Set(jt.shape.format.unwrap().options);function Ug(e,t,o,r){if(!Zs(e))return e;let n=typeof e.type==="string"&&Object.hasOwn(ph,e.type)?ph[e.type]:void 0;if(n===void 0)return e;let i={};for(let[a,c]of Object.entries(e))if(n.has(a)||Hc(a))i[a]=c;else if(a==="pattern"&&e.type==="string"&&typeof e.format==="string"){if(!Lg.has(e.format))i[a]=c;else if(typeof c!=="string"||!Mg(e.format,c,o))r.push(`${t}.${a}`)}else r.push(`${t}.${a}`);return i}function Zg(e,t){let o={},r=[];for(let[n,i]of Object.entries(e))if(n==="properties"&&Zs(i))o[n]=Object.fromEntries(Object.entries(i).map(([a,c])=>[a,Ug(c,`properties.${a}`,t,r)]));else if(jg.has(n))o[n]=i;else if(!Hc(n))r.push(n);if(r.length>0)throw new oe(O.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(", ")}`);return o}function Dg(e,t){if(!Zs(e.properties))return t;let o=Object.entries(e.properties).filter(([,r])=>!Vc(Ao,r).success).map(([r])=>`properties.${r}`);return o.length>0?o.join(", "):t}function qc(e,t,o=""){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((r,n)=>qc(r,t[n],`${o}[${n}]`));if(!Zs(e)||!Zs(t))return[];return Object.entries(e).flatMap(([r,n])=>{let i=o?`${o}.${r}`:r;if(!Object.prototype.hasOwnProperty.call(t,r))return Hc(r)?[]:[i];return qc(n,t[r],i)})}function Vg(e){if(!Nc(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,o=Zg(qg(e.requestedSchema),t),r=Vc(Ut.shape.requestedSchema,o);if(!r.success)throw new oe(O.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Dg(o,r.error.message)}`);let n=qc(o,r.data);if(n.length>0)throw new oe(O.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let i=(r.data.required??[]).filter((a)=>!Object.prototype.hasOwnProperty.call(r.data.properties,a));if(i.length>0)throw new oe(O.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${i.join(", ")}`);return{...e,mode:"form",requestedSchema:r.data}}function Hg(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,o=typeof e.requestState==="string";if(!t&&!o)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 my=Object.assign(Hg,{elicit(e){try{return{method:"elicitation/create",params:Vg(e)}}catch(t){throw t instanceof oe?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 Fg=["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"],Jg={IdJagTokenExchangeResponseSchema:Cs,OAuthClientInformationFullSchema:Ms,OAuthClientInformationSchema:Ns,OAuthClientMetadataSchema:Os,OAuthClientRegistrationErrorSchema:na,OAuthErrorResponseSchema:Is,OAuthMetadataSchema:jo,OAuthProtectedResourceMetadataSchema:Ts,OAuthTokenRevocationRequestSchema:sa,OAuthTokensSchema:$s,OpenIdProviderDiscoveryMetadataSchema:Es,OpenIdProviderMetadataSchema:ks},Zh={},Dh={};function Vh(e,t){let o=e.slice(0,-6);Zh[o]=t,Dh[o]=(r)=>t.safeParse(r).success}for(let e of Fg)Vh(e,kg[e]);for(let[e,t]of Object.entries(Jg))Vh(e,t);var Bg=Object.freeze(Zh),Wg=Object.freeze(Dh);function Gg(e){switch(e){case"initialize":case"notifications/initialized":return Us(void 0);case"server/discover":return Us(Dc);default:return}}var Hh=60000,Kg=[Pt,po,Tt,ho],Yg=["inputResponses","requestState"];function hh(e,t){let o=e.params;if(!$c(o))return{message:e,lifted:{}};let r=o._meta,n=$c(r)?Kg.filter((p)=>(p in r)):[],i=t==="request"?Yg.filter((p)=>(p in o)):[];if(n.length===0&&i.length===0)return{message:e,lifted:{}};let a={},c={...o};if(n.length>0&&$c(r)){let p={},d={...r};for(let f of n)p[f]=r[f],delete d[f];if(a.envelope=p,Object.keys(d).length>0)c._meta=d;else delete c._meta}for(let p of i){if(p==="inputResponses")a.inputResponses=c[p];if(p==="requestState")a.requestState=c[p];delete c[p]}return{message:{...e,params:c},lifted:a}}function mh(e,t){let o=e.validateResult(t,void 0);if(!o.ok&&o.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(r){let n=e.validateResult(t,r);if(n.ok)return{value:n.value};return{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function Fh(e){return()=>e}var Qg=Fh(void 0),Xg,Fc=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{Xg=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Ii,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 o=e.params??{};return{...e,params:{...o,_meta:{...t,...o._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new G(te.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===void 0)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,o,r,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:o,resetTimeoutOnProgress:n,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let o=Date.now()-t.startTime;if(t.maxTotalTimeout&&o>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new G(te.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:o});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 o=this.transport?.onerror;this._transport.onerror=(n)=>{o?.(n),this._onerror(n)};let r=this._transport?.onmessage;this._transport.onmessage=(n,i)=>{if(r?.(n,i),Oc(n)||Lh(n))this._onresponse(n);else if(Ah(n))this._onrequest(n,i);else if(jh(n))this._onnotification(n,i);else this._onerror(Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let r of this._timeoutInfo.values())clearTimeout(r.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let o=new G(te.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let r of e.values())r(o);for(let r of t.values())r.abort(o)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:o}=hh(e,"notification"),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let a=lh(t.classification);if(a!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${o.method}': classified as ${a} but this instance serves ${r.era}`));return}}if(kc(o.method)&&!r.hasNotificationMethod(o.method))return;let n=this._notificationHandlers.get(o.method),i=this.fallbackNotificationHandler;if(n===void 0&&i===void 0)return;Promise.resolve().then(()=>n===void 0?i(o):n(o,r)).catch((a)=>this._onerror(Error(`Uncaught error in notification handler: ${a}`)))}_onrequest(e,t){let{message:o,lifted:r}=hh(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let i=this._transport,a=(k,E,I)=>{let D={jsonrpc:"2.0",id:o.id,error:{code:k,message:E,...I!==void 0&&{data:I}}};i?.send(D).catch((M)=>this._onerror(Error(`Failed to send an error response: ${M}`)))};if(t?.classification!==void 0){let k=lh(t.classification);if(k!==n.era){this._onerror(Error(`Era mismatch on inbound request '${o.method}': classified as ${k} but this instance serves ${n.era}`));let E=t.classification.revision??k;a(O.UnsupportedProtocolVersion,`Unsupported protocol version: ${E}`,{supported:this._supportedProtocolVersions,requested:E});return}}if(Tc(o.method)&&!n.hasRequestMethod(o.method)&&!(uh(o.method)&&this._customSchemaRequestMethods.has(o.method))){a(O.MethodNotFound,"Method not found");return}let c=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(c===void 0){a(O.MethodNotFound,"Method not found");return}let p=n.checkInboundEnvelope(r);if(p!==void 0){a(O.InvalidParams,p);return}let d=(k,E)=>this._notificationViaCodec(this._resolveOutboundCodec(k.method),k,{...E,relatedRequestId:o.id}),f=(k,E,I)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(k.method),k,E,{...I,relatedRequestId:o.id}),S=new AbortController;this._requestHandlerAbortControllers.set(o.id,S);let _=r.inputResponses===void 0?void 0:eS(r.inputResponses),b={sessionId:i?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},..._!==void 0&&{inputResponses:_.accepted},..._!==void 0&&_.droppedKeys.length>0&&{droppedInputResponseKeys:_.droppedKeys},requestState:r.requestState===void 0?Qg:Fh(r.requestState),signal:S.signal,send:(k,E,I)=>{let D=this._resolveOutboundCodec(k.method);if(this._assertOutboundRequestInEra(D,k.method),Nc(E))return f(k,E,I);let M=mh(D,k.method);if(M===void 0)throw TypeError(`'${k.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return f(k,M,E)},notify:d},http:t?.authInfo?{authInfo:t.authInfo}:void 0},P=this.buildContext(b,t);Promise.resolve().then(()=>c(o,P)).then(async(k)=>{if(S.signal.aborted)return;let E;try{E=n.encodeResult(o.method,k,this._outboundServerInfo())}catch(D){this._onerror(Error(`Failed to encode result for ${o.method}: ${D}`)),a(O.InternalError,"Internal error");return}let I={result:E,jsonrpc:"2.0",id:o.id};await i?.send(I)},async(k)=>{if(S.signal.aborted)return;let E=Number.isSafeInteger(k.code)?k.code:O.InternalError,I={jsonrpc:"2.0",id:o.id,error:{code:n.encodeErrorCode(E),message:k.message??"Internal error",...k.data!==void 0&&{data:k.data}}};await i?.send(I)}).catch((k)=>this._onerror(Error(`Failed to send response: ${k}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(o.id)===S)this._requestHandlerAbortControllers.delete(o.id)})}_onprogress(e){let{progressToken:t,...o}=e.params,r=Number(t),n=this._progressHandlers.get(r);if(!n){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(r),a=this._timeoutInfo.get(r);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(c){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),i(c);return}n(o)}_onresponse(e){let t=Number(e.id),o=this._responseHandlers.get(t);if(o===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),Oc(e))o(e);else o(oe.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,o){let r=this._resolveOutboundCodec(e.method);if(Nc(t)){if(!uh(e.method))this._assertOutboundRequestInEra(r,e.method);return this._requestWithSchemaViaCodec(r,e,t,o)}this._assertOutboundRequestInEra(r,e.method);let n=mh(r,e.method);if(n===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,n,t)}_negotiatedWireCodec(){return Us(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Gg(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Tc(t)&&!e.hasRequestMethod(t))throw new G(te.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,o){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,o)}_requestWithSchemaViaCodec(e,t,o,r){let{relatedRequestId:n,resumptionToken:i,onresumptiontoken:a,headers:c}=r??{},p=Date.now(),d,f;return new Promise((S,_)=>{let b=(U)=>{_(U)};if(!this._transport){b(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(U){b(U);return}if(r?.signal?.aborted){let U=r.signal.reason;throw U instanceof G?U:new G(te.RequestTimeout,String(U))}let P=e.era===Dc&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,k=this._requestMessageId++;f=k;let E={...t,jsonrpc:"2.0",id:k};if(r?.onprogress)this._progressHandlers.set(k,r.onprogress),E.params={...t.params,_meta:{...t.params?._meta,progressToken:k}};let I=this._envelopeOutbound(E),D=!1,M=(U)=>{if(D)return;if(this._progressHandlers.delete(k),P===void 0){if(t.method!=="initialize")this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:k,reason:String(U)}}),{relatedRequestId:n,resumptionToken:i,onresumptiontoken:a}).catch((K)=>this._onerror(Error(`Failed to send cancellation: ${K}`)))}else P.abort();_(U instanceof G?U:new G(te.RequestTimeout,String(U)))};this._responseHandlers.set(k,(U)=>{if(r?.signal?.aborted)return;if(D=!0,U instanceof Error)return _(U);let K;try{K=e.decodeResult(t.method,U.result)}catch(ie){return _(ie instanceof Error?ie:Error(String(ie)))}if(K.kind==="invalid")return _(K.error);if(K.kind==="input_required"){if(r?.allowInputRequired===!0)return S(tS(K));let ie={codec:e,request:t,resultSchema:o,options:r,flowStartedAt:p,retry:(Ue,it)=>this._requestWithSchemaViaCodec(e,Ue===void 0?{method:t.method}:{method:t.method,params:Ue},o,it)};return S(this._resolveNonCompleteResult(K,ie))}let Ee=K.result;Ec(o,Ee).then((ie)=>{if(ie.success)S(ie.data);else _(new G(te.InvalidResult,`Invalid result for ${t.method}: ${ie.error}`))},_)}),d=()=>M(r?.signal?.reason),r?.signal?.addEventListener("abort",d,{once:!0});let q=r?.timeout??Hh,V=()=>M(new G(te.RequestTimeout,"Request timed out",{timeout:q}));this._setupTimeout(k,q,r?.maxTotalTimeout,V,r?.resetTimeoutOnProgress??!1),this._transport.send(I,{relatedRequestId:n,resumptionToken:i,onresumptiontoken:a,headers:c,requestSignal:P?.signal}).catch((U)=>{this._progressHandlers.delete(k),_(U)})}).finally(()=>{if(d)r?.signal?.removeEventListener("abort",d);if(f!==void 0)this._responseHandlers.delete(f),this._cleanupTimeout(f)})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,o){if(!this._transport)throw new G(te.NotConnected,"Not connected");if(kc(t.method)&&!e.hasNotificationMethod(t.method))throw new G(te.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 r=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&o?.relatedRequestId===void 0){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(r,o).catch((n)=>this._onerror(n))});return}await this._transport.send(r,o)}setRequestHandler(e,t,o){this.assertRequestHandlerCapability(e);let r;if(typeof t==="function"){if(!Tc(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,i)=>{let a=this._negotiatedWireCodec(),c=a.validateRequest(e,n);if(!c.ok&&c.reason==="not-in-era")c=a.validateInputRequest(e,n);if(!c.ok){if(c.reason==="not-in-era")throw new oe(O.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(c.message)}return Promise.resolve(t(c.value,i))}}else if(o)r=async(n,i)=>{let a=await Ec(t.params,{...n.params});if(!a.success)throw new oe(O.InvalidParams,`Invalid params for ${e}: ${a.error}`);return o(a.data,i)};else throw TypeError("setRequestHandler: handler is required");if(typeof t==="function")this._customSchemaRequestMethods.delete(e);else this._customSchemaRequestMethods.add(e);this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.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,o){if(typeof t==="function"){if(!kc(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(r,n)=>{let i=n.validateNotification(e,r);if(!i.ok){if(i.reason==="not-in-era")throw new oe(O.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(i.message)}return Promise.resolve(t(i.value))});return}if(!o)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async(r)=>{let n=await Ec(t.params,{...r.params});if(!n.success)throw new oe(O.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await o(n.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function $c(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function fh(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function eS(e){let t={},o=[];if(!fh(e))return{accepted:t,droppedKeys:o};for(let[r,n]of Object.entries(e)){if(!fh(n)||"method"in n||"result"in n){o.push(r);continue}t[r]=n}return{accepted:t,droppedKeys:o}}function tS(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}/*!
66
65
  * content-type
67
66
  * Copyright(c) 2015 Douglas Christopher Wilson
68
67
  * MIT Licensed
69
- */var xE=G5((Q)=>{var H=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,W=/\\([\u000b\u0020-\u00ff])/g,Y=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;Q.parse=J;function J(X){if(!X)throw TypeError("argument string is required");var D=typeof X==="object"?G(X):X;if(typeof D!=="string")throw TypeError("argument string is required to be a string");var E=D.indexOf(";"),w=E!==-1?D.slice(0,E).trim():D.trim();if(!Y.test(w))throw TypeError("invalid media type");var q=new N(w.toLowerCase());if(E!==-1){var O,_,I;H.lastIndex=E;while(_=H.exec(D)){if(_.index!==E)throw TypeError("invalid parameter format");if(E+=_[0].length,O=_[1].toLowerCase(),I=_[2],I.charCodeAt(0)===34){if(I=I.slice(1,-1),I.indexOf("\\")!==-1)I=I.replace(W,"$1")}q.parameters[O]=I}if(E!==D.length)throw TypeError("invalid parameter format")}return q}function G(X){var D;if(typeof X.getHeader==="function")D=X.getHeader("content-type");else if(typeof X.headers==="object")D=X.headers&&X.headers["content-type"];if(typeof D!=="string")throw TypeError("content-type header is missing from object");return D}function N(X){this.parameters=Object.create(null),this.type=X}}),oV=B5(xE(),1);var Jw=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");var vE=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,yE=[0,31,28,31,30,31,30,31,31,30,31,30,31],hE=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,fE=/^(?=.{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,uE=/^(?:[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,lE=/^(?:(?:[^\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,mE=/^(?:(?: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,cE=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,pE=/^(?:\/(?:[^~/]|~0|~1)*)*$/,dE=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,iE=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,oE=(Q)=>{if(Q[0]==='"')return!1;let[H,W,...Y]=Q.split("@");if(!H||!W||Y.length!==0||H.length>64||W.length>253)return!1;if(H[0]==="."||H.endsWith(".")||H.includes(".."))return!1;if(!/^[a-z0-9.-]+$/i.test(W)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(H))return!1;return W.split(".").every((J)=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(J))},nE=/^(?:(?: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,tE=(Q)=>Q.length>1&&Q.length<80&&(/^P\d+([.,]\d+)?W$/.test(Q)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(Q)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(Q));function iQ(Q){return Q.test.bind(Q)}var Gw={date:sX,time:aX.bind(void 0,!1),"date-time":eE,duration:tE,uri:WM,"uri-reference":iQ(uE),"uri-template":iQ(lE),url:iQ(mE),email:oE,hostname:iQ(fE),ipv4:iQ(nE),ipv6:iQ(rE),regex:JM,uuid:iQ(cE),"json-pointer":iQ(pE),"json-pointer-uri-fragment":iQ(dE),"relative-json-pointer":iQ(iE)};function sE(Q){return Q%4===0&&(Q%100!==0||Q%400===0)}function sX(Q){let H=Q.match(vE);if(!H)return!1;let W=+H[1],Y=+H[2],J=+H[3];return Y>=1&&Y<=12&&J>=1&&J<=(Y==2&&sE(W)?29:yE[Y])}function aX(Q,H){let W=H.match(hE);if(!W)return!1;let Y=+W[1],J=+W[2],G=+W[3],N=!!W[5];return(Y<=23&&J<=59&&G<=59||Y==23&&J==59&&G==60)&&(!Q||N)}var aE=/t|\s/i;function eE(Q){let H=Q.split(aE);return H.length==2&&sX(H[0])&&aX(!0,H[1])}var QM=/\/|:/,HM=/^(?:[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 WM(Q){return QM.test(Q)&&HM.test(Q)}var YM=/[^\\]\\Z/;function JM(Q){if(YM.test(Q))return!1;try{return new RegExp(Q,"u"),!0}catch(H){return!1}}var NM;NM=globalThis.crypto;var G6=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](Q){return IQ(this,Q)}static isInstance(Q){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 IQ(this,Q)}constructor(Q){super(Q);this.name=new.target.name,O0(this,new.target)}},QA=class extends G6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.IssuerMismatchError"})}kind;expected;received;constructor(Q,H,W){super(`Issuer mismatch in ${Q==="metadata"?"authorization server metadata (RFC 8414 §3.3)":"authorization response (RFC 9207)"}: expected ${JSON.stringify(H)}, received ${JSON.stringify(W)}`);this.kind=Q,this.expected=H,this.received=W}},HA=class extends G6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.RegistrationRejectedError"})}status;body;submittedMetadata;constructor(Q){super(`Dynamic Client Registration rejected (HTTP ${Q.status}): ${Q.body}`);this.status=Q.status,this.body=Q.body,this.submittedMetadata=Q.submittedMetadata}},WA=class extends G6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsecureTokenEndpointError"})}tokenEndpoint;constructor(Q){super(`Refusing to send credentials to non-https token endpoint '${Q}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`);this.tokenEndpoint=Q}},YA=class extends G6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.AuthorizationServerMismatchError"})}constructor(Q,H){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(Q)} but this call resolved ${JSON.stringify(H)}; refusing to present them to a different authorization server`);this.recordedIssuer=Q,this.currentIssuer=H}},JA=class extends G6{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsufficientScopeError"})}requiredScope;resourceMetadataUrl;errorDescription;constructor(Q){super(`Insufficient scope${Q.requiredScope?`: required "${Q.requiredScope}"`:""}`);this.requiredScope=Q.requiredScope,this.resourceMetadataUrl=Q.resourceMetadataUrl,this.errorDescription=Q.errorDescription}};var GA=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](Q){return IQ(this,Q)}static isInstance(Q){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 IQ(this,Q)}constructor(Q){super(Q??"Unauthorized");this.name="UnauthorizedError",O0(this,new.target)}};var NA=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](Q){return IQ(this,Q)}static isInstance(Q){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 IQ(this,Q)}constructor(Q,H,W){super(`SSE error: ${H}`);this.code=Q,this.event=W,O0(this,new.target)}};class JD{_eventSlots=new Map;setHandler(Q,H){let W=this._ensureEventSlot(Q);if(W.onHandler&&H)console.warn(`[MCP Apps] on${String(Q)} handler replaced. Use addEventListener("${String(Q)}", …) to add multiple listeners without replacing.`);W.onHandler=H}getHandler(Q){return this._eventSlots.get(Q)?.onHandler}addEventListener(Q,H){this._ensureEventSlot(Q).listeners.push(H)}removeEventListener(Q,H){let W=this._eventSlots.get(Q);if(!W)return;let Y=W.listeners.indexOf(H);if(Y!==-1)W.listeners.splice(Y,1)}dispatch(Q,H){let W=this._eventSlots.get(Q);if(!W)return;W.onHandler?.(H);for(let Y of[...W.listeners])Y(H)}_ensureEventSlot(Q){let H=this._eventSlots.get(Q);if(!H)H={listeners:[]},this._eventSlots.set(Q,H);return H}}class GD{_methods=new Set;claim(Q,H){if(this._methods.has(Q))throw Error(`Handler for "${Q}" already registered (via ${H}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(Q)}replace(Q){this._methods.add(Q)}release(Q){this._methods.delete(Q)}has(Q){return this._methods.has(Q)}}var eX=new Set;function QD(Q,H){let[W,Y]=H,J=W?.shape;if(typeof J?.method?.value!=="string")return;let G=J.method.value,N=Q==="request"?"setRequestHandler":"setNotificationHandler";if(!eX.has(N))eX.add(N),console.warn(`[ext-apps] ${N}(Schema, handler) is deprecated; use ${N}("${G}", { params: Schema.shape.params }, handler).`);let X=Y;return[G,{params:J.params},Q==="request"?(D,E)=>X({method:G,params:D},BM(E)):(D)=>X({method:G,params:D})]}function BM(Q){return{signal:Q.mcpReq.signal,requestId:Q.mcpReq.id,sessionId:Q.sessionId,_meta:Q.mcpReq._meta,sendRequest:Q.mcpReq.send,sendNotification:Q.mcpReq.notify,authInfo:Q.http?.authInfo}}var XM="2026-01-26";var DM="ui/notifications/tool-input-partial";class ND{eventTarget;eventSource;messageListener;constructor(Q=window.parent,H){this.eventTarget=Q,this.eventSource=H,this.messageListener=(W)=>{if(H&&W.source!==this.eventSource){console.debug("Ignoring message from unknown source",W);return}let Y=X0.safeParse(W.data);if(Y.success)console.debug("Parsed message",Y.data),this.onmessage?.(Y.data);else if(W.data?.jsonrpc!=="2.0")console.debug("Ignoring non-JSON-RPC message",Y.error.message,W);else console.error("Failed to parse message",Y.error.message,W),this.onerror?.(Error("Invalid JSON-RPC message received: "+Y.error.message))}}async start(){window.addEventListener("message",this.messageListener)}async send(Q,H){if(Q.method!==DM)console.debug("Sending message",Q);this.eventTarget.postMessage(Q,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var KM=K.union([K.literal("light"),K.literal("dark")]).describe("Color theme preference for the host environment."),N6=K.union([K.literal("inline"),K.literal("fullscreen"),K.literal("pip")]).describe("Display mode for UI presentation."),EM=K.union([K.literal("--color-background-primary"),K.literal("--color-background-secondary"),K.literal("--color-background-tertiary"),K.literal("--color-background-inverse"),K.literal("--color-background-ghost"),K.literal("--color-background-info"),K.literal("--color-background-danger"),K.literal("--color-background-success"),K.literal("--color-background-warning"),K.literal("--color-background-disabled"),K.literal("--color-text-primary"),K.literal("--color-text-secondary"),K.literal("--color-text-tertiary"),K.literal("--color-text-inverse"),K.literal("--color-text-ghost"),K.literal("--color-text-info"),K.literal("--color-text-danger"),K.literal("--color-text-success"),K.literal("--color-text-warning"),K.literal("--color-text-disabled"),K.literal("--color-border-primary"),K.literal("--color-border-secondary"),K.literal("--color-border-tertiary"),K.literal("--color-border-inverse"),K.literal("--color-border-ghost"),K.literal("--color-border-info"),K.literal("--color-border-danger"),K.literal("--color-border-success"),K.literal("--color-border-warning"),K.literal("--color-border-disabled"),K.literal("--color-ring-primary"),K.literal("--color-ring-secondary"),K.literal("--color-ring-inverse"),K.literal("--color-ring-info"),K.literal("--color-ring-danger"),K.literal("--color-ring-success"),K.literal("--color-ring-warning"),K.literal("--font-sans"),K.literal("--font-mono"),K.literal("--font-weight-normal"),K.literal("--font-weight-medium"),K.literal("--font-weight-semibold"),K.literal("--font-weight-bold"),K.literal("--font-text-xs-size"),K.literal("--font-text-sm-size"),K.literal("--font-text-md-size"),K.literal("--font-text-lg-size"),K.literal("--font-heading-xs-size"),K.literal("--font-heading-sm-size"),K.literal("--font-heading-md-size"),K.literal("--font-heading-lg-size"),K.literal("--font-heading-xl-size"),K.literal("--font-heading-2xl-size"),K.literal("--font-heading-3xl-size"),K.literal("--font-text-xs-line-height"),K.literal("--font-text-sm-line-height"),K.literal("--font-text-md-line-height"),K.literal("--font-text-lg-line-height"),K.literal("--font-heading-xs-line-height"),K.literal("--font-heading-sm-line-height"),K.literal("--font-heading-md-line-height"),K.literal("--font-heading-lg-line-height"),K.literal("--font-heading-xl-line-height"),K.literal("--font-heading-2xl-line-height"),K.literal("--font-heading-3xl-line-height"),K.literal("--border-radius-xs"),K.literal("--border-radius-sm"),K.literal("--border-radius-md"),K.literal("--border-radius-lg"),K.literal("--border-radius-xl"),K.literal("--border-radius-full"),K.literal("--border-width-regular"),K.literal("--shadow-hairline"),K.literal("--shadow-sm"),K.literal("--shadow-md"),K.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),MM=K.record(EM.describe(`Style variables for theming MCP apps.
68
+ */var oS=Gc((e)=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,o=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(c){if(!c)throw TypeError("argument string is required");var p=typeof c==="object"?i(c):c;if(typeof p!=="string")throw TypeError("argument string is required to be a string");var d=p.indexOf(";"),f=d!==-1?p.slice(0,d).trim():p.trim();if(!r.test(f))throw TypeError("invalid media type");var S=new a(f.toLowerCase());if(d!==-1){var _,b,P;t.lastIndex=d;while(b=t.exec(p)){if(b.index!==d)throw TypeError("invalid parameter format");if(d+=b[0].length,_=b[1].toLowerCase(),P=b[2],P.charCodeAt(0)===34){if(P=P.slice(1,-1),P.indexOf("\\")!==-1)P=P.replace(o,"$1")}S.parameters[_]=P}if(d!==p.length)throw TypeError("invalid parameter format")}return S}function i(c){var p;if(typeof c.getHeader==="function")p=c.getHeader("content-type");else if(typeof c.headers==="object")p=c.headers&&c.headers["content-type"];if(typeof p!=="string")throw TypeError("content-type header is missing from object");return p}function a(c){this.parameters=Object.create(null),this.type=c}}),fy=Yc(oS(),1);var Py=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");var rS=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,nS=[0,31,28,31,30,31,30,31,31,30,31,30,31],sS=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,iS=/^(?=.{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,aS=/^(?:[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,cS=/^(?:(?:[^\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,lS=/^(?:(?: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,uS=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,dS=/^(?:\/(?:[^~/]|~0|~1)*)*$/,pS=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,hS=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,mS=(e)=>{if(e[0]==='"')return!1;let[t,o,...r]=e.split("@");if(!t||!o||r.length!==0||t.length>64||o.length>253)return!1;if(t[0]==="."||t.endsWith(".")||t.includes(".."))return!1;if(!/^[a-z0-9.-]+$/i.test(o)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t))return!1;return o.split(".").every((n)=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(n))},fS=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,gS=/^((([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,SS=(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 ke(e){return e.test.bind(e)}var Ty={date:Jh,time:Bh.bind(void 0,!1),"date-time":yS,duration:SS,uri:RS,"uri-reference":ke(aS),"uri-template":ke(cS),url:ke(lS),email:mS,hostname:ke(iS),ipv4:ke(fS),ipv6:ke(gS),regex:xS,uuid:ke(uS),"json-pointer":ke(dS),"json-pointer-uri-fragment":ke(pS),"relative-json-pointer":ke(hS)};function _S(e){return e%4===0&&(e%100!==0||e%400===0)}function Jh(e){let t=e.match(rS);if(!t)return!1;let o=+t[1],r=+t[2],n=+t[3];return r>=1&&r<=12&&n>=1&&n<=(r==2&&_S(o)?29:nS[r])}function Bh(e,t){let o=t.match(sS);if(!o)return!1;let r=+o[1],n=+o[2],i=+o[3],a=!!o[5];return(r<=23&&n<=59&&i<=59||r==23&&n==59&&i==60)&&(!e||a)}var bS=/t|\s/i;function yS(e){let t=e.split(bS);return t.length==2&&Jh(t[0])&&Bh(!0,t[1])}var zS=/\/|:/,vS=/^(?:[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 RS(e){return zS.test(e)&&vS.test(e)}var wS=/[^\\]\\Z/;function xS(e){if(wS.test(e))return!1;try{return new RegExp(e,"u"),!0}catch(t){return!1}}var TS;TS=globalThis.crypto;var Ds=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthClientFlowError"})}static[Symbol.hasInstance](e){return me(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 me(this,e)}constructor(e){super(e);this.name=new.target.name,Zt(this,new.target)}},vz=class extends Ds{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.IssuerMismatchError"})}kind;expected;received;constructor(e,t,o){super(`Issuer mismatch in ${e==="metadata"?"authorization server metadata (RFC 8414 §3.3)":"authorization response (RFC 9207)"}: expected ${JSON.stringify(t)}, received ${JSON.stringify(o)}`);this.kind=e,this.expected=t,this.received=o}},Rz=class extends Ds{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.RegistrationRejectedError"})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`);this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},wz=class extends Ds{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsecureTokenEndpointError"})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`);this.tokenEndpoint=e}},xz=class extends Ds{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.AuthorizationServerMismatchError"})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`);this.recordedIssuer=e,this.currentIssuer=t}},Pz=class extends Ds{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.InsufficientScopeError"})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:""}`);this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};var Tz=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnauthorizedError"})}static[Symbol.hasInstance](e){return me(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 me(this,e)}constructor(e){super(e??"Unauthorized");this.name="UnauthorizedError",Zt(this,new.target)}};var kz=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SseError"})}static[Symbol.hasInstance](e){return me(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 me(this,e)}constructor(e,t,o){super(`SSE error: ${t}`);this.code=e,this.event=o,Zt(this,new.target)}};class Xh{_eventSlots=new Map;setHandler(e,t){let o=this._ensureEventSlot(e);if(o.onHandler&&t)console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`);o.onHandler=t}getHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let o=this._eventSlots.get(e);if(!o)return;let r=o.listeners.indexOf(t);if(r!==-1)o.listeners.splice(r,1)}dispatch(e,t){let o=this._eventSlots.get(e);if(!o)return;o.onHandler?.(t);for(let r of[...o.listeners])r(t)}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t)t={listeners:[]},this._eventSlots.set(e,t);return t}}class em{_methods=new Set;claim(e,t){if(this._methods.has(e))throw Error(`Handler for "${e}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(e)}replace(e){this._methods.add(e)}release(e){this._methods.delete(e)}has(e){return this._methods.has(e)}}var Wh=new Set;function Gh(e,t){let[o,r]=t,n=o?.shape;if(typeof n?.method?.value!=="string")return;let i=n.method.value,a=e==="request"?"setRequestHandler":"setNotificationHandler";if(!Wh.has(a))Wh.add(a),console.warn(`[ext-apps] ${a}(Schema, handler) is deprecated; use ${a}("${i}", { params: Schema.shape.params }, handler).`);let c=r;return[i,{params:n.params},e==="request"?(p,d)=>c({method:i,params:p},kS(d)):(p)=>c({method:i,params:p})]}function kS(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var ES="2026-01-26";var $S="ui/notifications/tool-input-partial";class tm{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=(o)=>{if(t&&o.source!==this.eventSource){console.debug("Ignoring message from unknown source",o);return}let r=Ct.safeParse(o.data);if(r.success)console.debug("Parsed message",r.data),this.onmessage?.(r.data);else if(o.data?.jsonrpc!=="2.0")console.debug("Ignoring non-JSON-RPC message",r.error.message,o);else console.error("Failed to parse message",r.error.message,o),this.onerror?.(Error("Invalid JSON-RPC message received: "+r.error.message))}}async start(){window.addEventListener("message",this.messageListener)}async send(e,t){if(e.method!==$S)console.debug("Sending message",e);this.eventTarget.postMessage(e,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var CS=z([u("light"),u("dark")]).describe("Color theme preference for the host environment."),Vs=z([u("inline"),u("fullscreen"),u("pip")]).describe("Display mode for UI presentation."),IS=z([u("--color-background-primary"),u("--color-background-secondary"),u("--color-background-tertiary"),u("--color-background-inverse"),u("--color-background-ghost"),u("--color-background-info"),u("--color-background-danger"),u("--color-background-success"),u("--color-background-warning"),u("--color-background-disabled"),u("--color-text-primary"),u("--color-text-secondary"),u("--color-text-tertiary"),u("--color-text-inverse"),u("--color-text-ghost"),u("--color-text-info"),u("--color-text-danger"),u("--color-text-success"),u("--color-text-warning"),u("--color-text-disabled"),u("--color-border-primary"),u("--color-border-secondary"),u("--color-border-tertiary"),u("--color-border-inverse"),u("--color-border-ghost"),u("--color-border-info"),u("--color-border-danger"),u("--color-border-success"),u("--color-border-warning"),u("--color-border-disabled"),u("--color-ring-primary"),u("--color-ring-secondary"),u("--color-ring-inverse"),u("--color-ring-info"),u("--color-ring-danger"),u("--color-ring-success"),u("--color-ring-warning"),u("--font-sans"),u("--font-mono"),u("--font-weight-normal"),u("--font-weight-medium"),u("--font-weight-semibold"),u("--font-weight-bold"),u("--font-text-xs-size"),u("--font-text-sm-size"),u("--font-text-md-size"),u("--font-text-lg-size"),u("--font-heading-xs-size"),u("--font-heading-sm-size"),u("--font-heading-md-size"),u("--font-heading-lg-size"),u("--font-heading-xl-size"),u("--font-heading-2xl-size"),u("--font-heading-3xl-size"),u("--font-text-xs-line-height"),u("--font-text-sm-line-height"),u("--font-text-md-line-height"),u("--font-text-lg-line-height"),u("--font-heading-xs-line-height"),u("--font-heading-sm-line-height"),u("--font-heading-md-line-height"),u("--font-heading-lg-line-height"),u("--font-heading-xl-line-height"),u("--font-heading-2xl-line-height"),u("--font-heading-3xl-line-height"),u("--border-radius-xs"),u("--border-radius-sm"),u("--border-radius-md"),u("--border-radius-lg"),u("--border-radius-xl"),u("--border-radius-full"),u("--border-width-regular"),u("--shadow-hairline"),u("--shadow-sm"),u("--shadow-md"),u("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),OS=y(IS.describe(`Style variables for theming MCP apps.
70
69
 
71
70
  Individual style keys are optional - hosts may provide any subset of these values.
72
71
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
73
72
 
74
73
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
75
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),K.union([K.string(),K.undefined()]).describe(`Style variables for theming MCP apps.
74
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),z([s(),zc()]).describe(`Style variables for theming MCP apps.
76
75
 
77
76
  Individual style keys are optional - hosts may provide any subset of these values.
78
77
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
@@ -84,10 +83,10 @@ Individual style keys are optional - hosts may provide any subset of these value
84
83
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
85
84
 
86
85
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
87
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),PA=K.object({method:K.literal("ui/open-link"),params:K.object({url:K.string().describe("URL to open in the host's browser")})}),VM=K.object({isError:K.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),wM=K.object({isError:K.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),AM=K.object({isError:K.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),ZA=K.object({method:K.literal("ui/notifications/sandbox-proxy-ready"),params:K.object({})}),W5=K.object({connectDomains:K.array(K.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
86
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Fz=l({method:u("ui/open-link"),params:l({url:s().describe("URL to open in the host's browser")})}),NS=l({isError:v().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),MS=l({isError:v().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),qS=l({isError:v().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),Jz=l({method:u("ui/notifications/sandbox-proxy-ready"),params:l({})}),Jc=l({connectDomains:h(s()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
88
87
 
89
88
  - Maps to CSP \`connect-src\` directive
90
- - Empty or omitted → no network connections (secure default)`),resourceDomains:K.array(K.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:K.array(K.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:K.array(K.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),Y5=K.object({camera:K.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:K.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:K.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:K.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),$A=K.object({method:K.literal("ui/notifications/size-changed"),params:K.object({width:K.number().optional().describe("New width in pixels."),height:K.number().optional().describe("New height in pixels.")})}),FM=K.object({method:K.literal("ui/notifications/tool-input"),params:K.object({arguments:K.record(K.string(),K.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),qM=K.object({method:K.literal("ui/notifications/tool-input-partial"),params:K.object({arguments:K.record(K.string(),K.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),OM=K.object({method:K.literal("ui/notifications/tool-cancelled"),params:K.object({reason:K.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),_M=K.object({fonts:K.string().optional()}),UM=K.object({variables:MM.optional().describe("CSS variables for theming the app."),css:_M.optional().describe("CSS blocks that apps can inject.")}),zM=K.object({method:K.literal("ui/resource-teardown"),params:K.object({})}),bM=K.record(K.string(),K.unknown()),HD=K.object({text:K.object({}).optional().describe("Host supports text content blocks."),image:K.object({}).optional().describe("Host supports image content blocks."),audio:K.object({}).optional().describe("Host supports audio content blocks."),resource:K.object({}).optional().describe("Host supports resource content blocks."),resourceLink:K.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:K.object({}).optional().describe("Host supports structured content.")}),IA=K.object({method:K.literal("ui/notifications/request-teardown"),params:K.object({}).optional()}),PM=K.object({experimental:K.record(K.string(),K.record(K.string(),K.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:K.object({}).optional().describe("Host supports opening external URLs."),downloadFile:K.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:K.object({listChanged:K.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:K.object({listChanged:K.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:K.object({}).optional().describe("Host accepts log messages."),sandbox:K.object({permissions:Y5.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:W5.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:HD.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:HD.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:K.object({tools:K.object({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),ZM=K.object({experimental:K.record(K.string(),K.record(K.string(),K.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),tools:K.object({listChanged:K.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:K.array(N6).optional().describe("Display modes the app supports.")}),LA=K.object({method:K.literal("ui/notifications/initialized"),params:K.object({}).optional()}),TA=K.object({csp:W5.optional().describe("Content Security Policy configuration for UI resources."),permissions:Y5.optional().describe("Sandbox permissions requested by the UI resource."),domain:K.string().optional().describe(`Dedicated origin for view sandbox.
89
+ - Empty or omitted → no network connections (secure default)`),resourceDomains:h(s()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:h(s()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:h(s()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),Bc=l({camera:l({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:l({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:l({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:l({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),Bz=l({method:u("ui/notifications/size-changed"),params:l({width:g().optional().describe("New width in pixels."),height:g().optional().describe("New height in pixels.")})}),AS=l({method:u("ui/notifications/tool-input"),params:l({arguments:y(s(),R().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),jS=l({method:u("ui/notifications/tool-input-partial"),params:l({arguments:y(s(),R().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),LS=l({method:u("ui/notifications/tool-cancelled"),params:l({reason:s().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),US=l({fonts:s().optional()}),ZS=l({variables:OS.optional().describe("CSS variables for theming the app."),css:US.optional().describe("CSS blocks that apps can inject.")}),DS=l({method:u("ui/resource-teardown"),params:l({})}),VS=y(s(),R()),Kh=l({text:l({}).optional().describe("Host supports text content blocks."),image:l({}).optional().describe("Host supports image content blocks."),audio:l({}).optional().describe("Host supports audio content blocks."),resource:l({}).optional().describe("Host supports resource content blocks."),resourceLink:l({}).optional().describe("Host supports resource link content blocks."),structuredContent:l({}).optional().describe("Host supports structured content.")}),Wz=l({method:u("ui/notifications/request-teardown"),params:l({}).optional()}),HS=l({experimental:y(s(),y(s(),$i()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:l({}).optional().describe("Host supports opening external URLs."),downloadFile:l({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:l({listChanged:v().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:l({listChanged:v().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:l({}).optional().describe("Host accepts log messages."),sandbox:l({permissions:Bc.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:Jc.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:Kh.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:Kh.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:l({tools:l({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),FS=l({experimental:y(s(),y(s(),$i()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),tools:l({listChanged:v().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:h(Vs).optional().describe("Display modes the app supports.")}),Gz=l({method:u("ui/notifications/initialized"),params:l({}).optional()}),Kz=l({csp:Jc.optional().describe("Content Security Policy configuration for UI resources."),permissions:Bc.optional().describe("Sandbox permissions requested by the UI resource."),domain:s().optional().describe(`Dedicated origin for view sandbox.
91
90
 
92
91
  Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
93
92
 
@@ -95,18 +94,18 @@ Useful when views need stable, dedicated origins for OAuth callbacks, CORS polic
95
94
  - Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
96
95
  - URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
97
96
 
98
- If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:K.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.
97
+ If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:v().optional().describe(`Visual boundary preference - true if view prefers a visible border.
99
98
 
100
99
  Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
101
100
 
102
101
  - \`true\`: request visible border + background
103
102
  - \`false\`: request no visible border + background
104
- - omitted: host decides border`)}),jA=K.object({method:K.literal("ui/request-display-mode"),params:K.object({mode:N6.describe("The display mode being requested.")})}),$M=K.object({mode:N6.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),IM=K.union([K.literal("model"),K.literal("app")]).describe("Tool visibility scope - who can access the tool."),RA=K.object({resourceUri:K.string().optional(),visibility:K.array(IM).optional().describe(`Who can access this tool. Default: ["model", "app"]
103
+ - omitted: host decides border`)}),Yz=l({method:u("ui/request-display-mode"),params:l({mode:Vs.describe("The display mode being requested.")})}),JS=l({mode:Vs.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),BS=z([u("model"),u("app")]).describe("Tool visibility scope - who can access the tool."),Qz=l({resourceUri:s().optional(),visibility:h(BS).optional().describe(`Who can access this tool. Default: ["model", "app"]
105
104
  - "model": Tool visible to and callable by the agent
106
- - "app": Tool callable by the app from this server only`),csp:K.never().optional(),permissions:K.never().optional()}),CA=K.object({mimeTypes:K.array(K.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),SA=K.object({method:K.literal("ui/download-file"),params:K.object({contents:K.array(K.union([V0,w0])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),kA=K.object({method:K.literal("ui/message"),params:K.object({role:K.literal("user").describe('Message role, currently only "user" is supported.'),content:K.array(dQ).describe("Message content blocks (text, image, etc.).")})}),gA=K.object({method:K.literal("ui/notifications/sandbox-resource-ready"),params:K.object({html:K.string().describe("HTML content to load into the inner iframe."),sandbox:K.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:W5.optional().describe("CSP configuration from resource metadata."),permissions:Y5.optional().describe("Sandbox permissions from resource metadata.")})}),LM=K.object({method:K.literal("ui/notifications/tool-result"),params:RH.describe("Standard MCP tool execution result.")}),BD=K.object({toolInfo:K.object({id:kQ.optional().describe("JSON-RPC id of the tools/call request."),tool:jH.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:KM.optional().describe("Current color theme preference."),styles:UM.optional().describe("Style configuration for theming the app."),displayMode:N6.optional().describe("How the UI is currently displayed."),availableDisplayModes:K.array(N6).optional().describe("Display modes the host supports."),containerDimensions:K.union([K.object({height:K.number().describe("Fixed container height in pixels.")}),K.object({maxHeight:K.union([K.number(),K.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(K.union([K.object({width:K.number().describe("Fixed container width in pixels.")}),K.object({maxWidth:K.union([K.number(),K.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
107
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:K.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:K.string().optional().describe("User's timezone in IANA format."),userAgent:K.string().optional().describe("Host application identifier."),platform:K.union([K.literal("web"),K.literal("desktop"),K.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:K.object({touch:K.boolean().optional().describe("Whether the device supports touch input."),hover:K.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:K.object({top:K.number().describe("Top safe area inset in pixels."),right:K.number().describe("Right safe area inset in pixels."),bottom:K.number().describe("Bottom safe area inset in pixels."),left:K.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),TM=K.object({method:K.literal("ui/notifications/host-context-changed"),params:BD.describe("Partial context update containing only changed fields.")}),xA=K.object({method:K.literal("ui/update-model-context"),params:K.object({content:K.array(dQ).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:K.record(K.string(),K.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),vA=K.object({method:K.literal("ui/initialize"),params:K.object({appInfo:cQ.describe("App identification (name and version)."),appCapabilities:ZM.describe("Features and capabilities this app provides."),protocolVersion:K.string().describe("Protocol version this app supports.")})}),jM=K.object({protocolVersion:K.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:cQ.describe("Host application identification and version."),hostCapabilities:PM.describe("Features and capabilities provided by the host."),hostContext:BD.describe("Rich context about the host environment.")}).passthrough(),RM={target:"draft-2020-12"};async function WD(Q,H){let W=Q["~standard"];if(W.jsonSchema)return W.jsonSchema[H](RM);throw Error(`Schema (vendor: ${W.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function YD(Q,H,W=""){let Y=await Q["~standard"].validate(H);if(Y.issues){let J=Y.issues.map((G)=>{let N=G.path?.map((X)=>typeof X==="object"?X.key:X).join(".");return N?`${N}: ${G.message}`:G.message}).join("; ");throw Error(W+J)}return Y.value}function CM(Q,H){let W={...Q,...H};if(H.experimental!==void 0)W.experimental={...Q.experimental,...H.experimental};if(H.tools!==void 0)W.tools={...Q.tools,...H.tools};return W}class v8 extends H5{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new JD;_methods=new GD;setRequestHandler=(...Q)=>{let[H,...W]=QD("request",Q)??Q;this._methods.claim(H,"setRequestHandler"),super.setRequestHandler.call(this,H,...W)};setNotificationHandler=(...Q)=>{let[H,...W]=QD("notification",Q)??Q;this._methods.claim(H,"setNotificationHandler"),super.setNotificationHandler.call(this,H,...W)};removeRequestHandler=(Q)=>{this._methods.release(Q),super.removeRequestHandler(Q)};removeNotificationHandler=(Q)=>{this._methods.release(Q),super.removeNotificationHandler(Q)};replaceRequestHandler=(Q,...H)=>{this._methods.replace(Q),super.setRequestHandler.call(this,Q,...H)};_assertInitialized(Q){if(this._initializedSent)return;let H=`[ext-apps] App.${Q}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(H);console.warn(`${H}. This will throw in a future release.`)}eventSchemas={toolinput:FM,toolinputpartial:qM,toolresult:LM,toolcancelled:OM,hostcontextchanged:TM};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(Q){if(!v8.ONE_SHOT_EVENTS.has(Q)||this._everHadListener.has(Q))return;if(this._everHadListener.add(Q),!this._initializedSent)return;let H=`[ext-apps] "${String(Q)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(H);console.warn(H)}setEventHandler(Q,H){if(H)this._assertHandlerTiming(Q);this._ensureEventSlot(Q),this._events.setHandler(Q,H)}addEventListener(Q,H){this._assertHandlerTiming(Q),this._ensureEventSlot(Q),this._events.addEventListener(Q,H)}removeEventListener(Q,H){this._events.removeEventListener(Q,H)}_ensureEventSlot(Q){if(this._registeredEvents.has(Q))return;let H=this.eventSchemas[Q];if(!H)throw Error(`Unknown event: ${String(Q)}`);this.setNotificationHandler(H.shape.method.value,{params:H.shape.params},(W)=>{let Y=W;if(Q==="hostcontextchanged")this._hostContext={...this._hostContext,...Y};this._events.dispatch(Q,Y)}),this._registeredEvents.add(Q)}getEventHandler(Q){return this._events.getHandler(Q)}warnIfRequestHandlerReplaced(Q,H,W){if(H&&W)console.warn(`[MCP Apps] ${Q} handler replaced. Previous handler will no longer be called.`)}constructor(Q,H={},W={autoResize:!0}){super(W);if(this._appInfo=Q,this._appCapabilities=H,this.options=W,this._methods.replace("notifications/cancelled"),this._methods.replace("notifications/progress"),!W.allowUnsafeEval)K.config({jitless:!0});this.replaceRequestHandler("ping",(Y)=>{return console.log("Received ping:",Y.params),{}}),this.setEventHandler("hostcontextchanged",void 0)}buildContext(Q){return Q}registerAppCapabilities(Q){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._appCapabilities=CM(this._appCapabilities,Q)}registerTool(Q,H,W){if(this._registeredTools[Q])throw Error(`Tool ${Q} is already registered`);let Y=this,J=()=>{if(Y._initializedSent&&Y._appCapabilities.tools?.listChanged)Y.sendToolListChanged()},G=H.inputSchema!==void 0,N={title:H.title,description:H.description,inputSchema:H.inputSchema,outputSchema:H.outputSchema,annotations:H.annotations,_meta:H._meta,enabled:!0,enable(){this.enabled=!0,J()},disable(){this.enabled=!1,J()},update(X){Object.assign(this,X),J()},remove(){if(Y._registeredTools[Q]!==N)return;delete Y._registeredTools[Q],J()},handler:async(X,D)=>{if(!N.enabled)throw Error(`Tool ${Q} is disabled`);let E;if(G){let w=N.inputSchema,q=w?await YD(w,X??{},`Invalid input for tool ${Q}: `):X??{};E=await W(q,D)}else E=await W(D);if(N.outputSchema&&!E.isError)E.structuredContent=await YD(N.outputSchema,E.structuredContent,`Invalid output for tool ${Q}: `);return E}};if(this._registeredTools[Q]=N,!this._appCapabilities.tools&&!this.transport)this.registerAppCapabilities({tools:{listChanged:!0}});return this.ensureToolHandlersInitialized(),J(),N}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){if(this._toolHandlersInitialized)return;this._toolHandlersInitialized=!0,this.oncalltool=async(Q,H)=>{let W=this._registeredTools[Q.name];if(!W)throw Error(`Tool ${Q.name} not found`);return W.handler(Q.arguments,H)},this.onlisttools=async(Q,H)=>{return{tools:await Promise.all(Object.entries(this._registeredTools).filter(([W,Y])=>Y.enabled).map(async([W,Y])=>{let J={name:W,title:Y.title,description:Y.description,inputSchema:Y.inputSchema?await WD(Y.inputSchema,"input"):{type:"object",properties:{}}};if(Y.outputSchema)J.outputSchema=await WD(Y.outputSchema,"output");if(Y.annotations)J.annotations=Y.annotations;if(Y._meta)J._meta=Y._meta;return J}))}}}async sendToolListChanged(Q={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:Q})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(Q){this.setEventHandler("toolinput",Q)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(Q){this.setEventHandler("toolinputpartial",Q)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(Q){this.setEventHandler("toolresult",Q)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(Q){this.setEventHandler("toolcancelled",Q)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(Q){this.setEventHandler("hostcontextchanged",Q)}_onteardown;get onteardown(){return this._onteardown}set onteardown(Q){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,Q),this._onteardown=Q,this.replaceRequestHandler("ui/resource-teardown",{params:zM.shape.params,result:bM},(H,W)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(H,W)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(Q){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,Q),this._oncalltool=Q,this.replaceRequestHandler("tools/call",(H,W)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(H.params,W)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(Q){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,Q),this._onlisttools=Q,this.replaceRequestHandler("tools/list",(H,W)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(H.params,W)})}assertCapabilityForMethod(Q){switch(Q){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${Q})`);break}}assertRequestHandlerCapability(Q){switch(Q){case"tools/call":case"tools/list":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${Q})`);return;default:return}}assertNotificationCapability(Q){}async callServerTool(Q,H){if(this._assertInitialized("callServerTool"),typeof Q==="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${Q}"). Did you mean: callServerTool({ name: "${Q}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:Q},{onprogress:()=>{},resetTimeoutOnProgress:!0,...H})}async readServerResource(Q,H){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:Q},H)}async listServerResources(Q,H){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:Q},H)}async createSamplingMessage(Q,H){return this._assertInitialized("createSamplingMessage"),await this.request({method:"sampling/createMessage",params:Q},H)}sendMessage(Q,H){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:Q},AM,H)}sendLog(Q){return this.notification({method:"notifications/message",params:Q})}updateModelContext(Q,H){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:Q},TH,H)}openLink(Q,H){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:Q},VM,H)}sendOpenLink=this.openLink;downloadFile(Q,H){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:Q},wM,H)}requestTeardown(Q={}){return this.notification({method:"ui/notifications/request-teardown",params:Q})}requestDisplayMode(Q,H){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:Q},$M,H)}sendSizeChanged(Q){return this.notification({method:"ui/notifications/size-changed",params:Q})}setupSizeChangedNotifications(){let Q=!1,H=0,W=0,Y=()=>{if(Q)return;Q=!0,requestAnimationFrame(()=>{Q=!1;let G=document.documentElement,N=G.style.height;G.style.height="max-content";let X=Math.ceil(G.getBoundingClientRect().height);G.style.height=N;let D=Math.ceil(window.innerWidth);if(D!==H||X!==W)H=D,W=X,this.sendSizeChanged({width:D,height:X})})};Y();let J=new ResizeObserver(Y);return J.observe(document.documentElement),J.observe(document.body),()=>J.disconnect()}async connect(Q=new ND(window.parent,window.parent),H){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1;try{await super.connect(Q);let W=await this.request({method:"ui/initialize",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:XM}},jM,H);if(W===void 0)throw Error(`Server sent invalid initialize result: ${W}`);if(this._hostCapabilities=W.hostCapabilities,this._hostInfo=W.hostInfo,this._hostContext=W.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize)this.setupSizeChangedNotifications()}catch(W){throw this.close(),W}}}function XD(Q){return Array.isArray(Q)&&Q.length>0&&Q.every((H)=>H&&typeof H==="object"&&typeof H.token==="string"&&/^--[\w-]+$/.test(H.token)&&typeof H.property==="string"&&/^-?[a-z][a-z0-9-]*$/.test(H.property)&&typeof H.probe==="string"&&H.probe.trim().length>0)&&new Set(Q.map((H)=>`${H.token}:${H.property}`)).size===Q.length}function DD(Q,H){let W=H.getComputedStyle(Q),Y=Q.getBoundingClientRect();if(W.display==="none"||W.visibility!=="visible"||!Q.getClientRects().length||!(Y.width||Y.height))return!1;for(let J=Q;J;J=J.parentElement)if(Number(H.getComputedStyle(J).opacity)===0)return!1;return!0}function KD(Q,H){if(!XD(H))return{ok:!1,diagnostics:["Token preview needs explicit { token, property, probe } samples from the project fixture. Rebuild with the current compiler."]};let W=Q.ownerDocument,Y=W.defaultView,J=W.documentElement,G=[],N=[],X=[...Q.querySelectorAll("[data-ads-token], [data-ads-property]")],D=new Set(H.map((E)=>`${E.token}:${E.property}`));for(let E of X)if(!D.has(`${E.dataset.adsToken}:${E.dataset.adsProperty}`))G.push(`Undeclared rendered token sample ${E.dataset.adsToken}:${E.dataset.adsProperty}.`);for(let E of H){if(!Y.CSS.supports(E.property,E.probe)){G.push(`${E.token}: the fixture probe is invalid for ${E.property}.`);continue}let w=Y.getComputedStyle(J).getPropertyValue(E.token).trim();if(!w||!Y.CSS.supports(E.property,w)){G.push(`${E.token}: its current value is invalid for the fixture's ${E.property} binding.`);continue}let q=X.filter((_)=>_.dataset.adsToken===E.token&&_.dataset.adsProperty===E.property);if(!q.length){G.push(`${E.token} needs a rendered ${E.property} sample, not only a name/value label.`);continue}let O=!1;for(let _ of q){let I=[];for(let v=_.parentElement;v&&v!==Q;v=v.parentElement)if(v.tagName==="DETAILS"&&!v.open)v.open=!0,I.push(v);let j=J.getAttribute("style"),C=_.getAttribute("style");try{if(!/^(?:-[a-z]+-)?transition(?:-|$)/.test(E.property))_.style.setProperty("transition","none","important");let v=Y.getComputedStyle(_).getPropertyValue(E.property),i=DD(_,Y);J.style.setProperty(E.token,E.probe,"important");let f=Y.getComputedStyle(_).getPropertyValue(E.property);O=Boolean(f&&f!==v&&(i||DD(_,Y)))}finally{if(j===null)J.removeAttribute("style");else J.setAttribute("style",j);if(C===null)_.removeAttribute("style");else _.setAttribute("style",C);for(let v of I)v.open=!1}if(O)break}if(O)N.push(E);else G.push(`${E.token} has no visible ${E.property} sample that responds to its value. Hardcoded copies do not satisfy coverage.`)}return{ok:!G.length,verified:N,diagnostics:G}}var SH=new v8({name:"ADS preview",version:"1.0.0"},{},{autoResize:!0}),ED=document.getElementById("ads-preview-seed"),VD;function MD(Q,H){let W=document.createElement(Q);return W.textContent=H,W}function wD(Q){if(Q==="light"||Q==="dark")document.documentElement.dataset.theme=Q}SH.onhostcontextchanged=(Q)=>wD(Q.theme);if(ED){let J=function(X){let D="";if(!X||X.state==="unreported")D="Preview freshness is unverified. Check the build status before reviewing.";else if(X.state==="error"){let E=X.diagnostics?.[0];if(D=`Build failed. Showing ${Q.revision===null?"an earlier preview":`build ${Q.revision}`}.`,E)D+=`
108
- ${E.file??""}${E.line?`:${E.line}`:""}${E.file?": ":""}${E.message}`}else if(["building","idle"].includes(X.state))D="Rebuilding. This view is the previous preview.";else if(X.revision!==Q.revision||X.session!==Q.session)D=`Build ${X.revision} is ready. Reopen this preview to load it.`;H.textContent=[D,Y].filter(Boolean).join(`
109
- `),H.hidden=!H.textContent},Q=JSON.parse(ED.textContent),H=MD("aside","");H.id="ads-preview-build",H.setAttribute("role","status"),H.setAttribute("aria-live","polite");let W=MD("style","#ads-preview-build{position:fixed;inset:12px 12px auto;z-index:2147483647;padding:10px 14px;border:1px solid GrayText;border-radius:6px;background:Canvas;color:CanvasText;font:13px system-ui;white-space:pre-wrap;overflow-wrap:anywhere;max-height:30vh;overflow:auto}#ads-preview-build[hidden]{display:none}");document.head.append(W),document.body.append(H);let Y="";if(J(Q),Q.kind==="tokens")(async()=>{await new Promise((D)=>requestAnimationFrame(()=>requestAnimationFrame(D))),await document.fonts.ready;let X=KD(document.body,Q.samples);if(!X.ok){Y=`Token preview verification failed:
110
- ${X.diagnostics.slice(0,20).join(`
111
- `)}`,H.setAttribute("role","alert"),J(Q);try{if(SH.getHostCapabilities()?.logging)await SH.sendLog({level:"error",logger:"ads-preview",data:{state:"error",id:Q.id,message:Y}})}catch{}}})();let G=!1,N;SH.onteardown=async()=>{return clearInterval(N),{}},window.addEventListener("pagehide",()=>clearInterval(N),{once:!0}),VD=()=>{if(!SH.getHostCapabilities()?.serverResources)return;async function X(){if(G||document.visibilityState==="hidden")return;G=!0;try{let D=await SH.readServerResource({uri:"ads://project/build"},{timeout:5000}),E=JSON.parse(D.contents.find((w)=>("text"in w)).text);J(E.previews.find((w)=>w.id===Q.id))}catch{H.textContent=["Build status unavailable. Reopen the preview to verify it.",Y].filter(Boolean).join(`
112
- `),H.hidden=!1}finally{G=!1}}X(),N=setInterval(()=>{X()},2000)}}try{await SH.connect(),VD?.(),wD(SH.getHostContext()?.theme)}catch{}
105
+ - "app": Tool callable by the app from this server only`),csp:vc().optional(),permissions:vc().optional()}),Xz=l({mimeTypes:h(s()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),ev=l({method:u("ui/download-file"),params:l({contents:h(z([qt,At])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),tv=l({method:u("ui/message"),params:l({role:u("user").describe('Message role, currently only "user" is supported.'),content:h(Te).describe("Message content blocks (text, image, etc.).")})}),ov=l({method:u("ui/notifications/sandbox-resource-ready"),params:l({html:s().describe("HTML content to load into the inner iframe."),sandbox:s().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:Jc.optional().describe("CSP configuration from resource metadata."),permissions:Bc.optional().describe("Sandbox permissions from resource metadata.")})}),WS=l({method:u("ui/notifications/tool-result"),params:rt.describe("Standard MCP tool execution result.")}),om=l({toolInfo:l({id:ye.optional().describe("JSON-RPC id of the tools/call request."),tool:ot.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:CS.optional().describe("Current color theme preference."),styles:ZS.optional().describe("Style configuration for theming the app."),displayMode:Vs.optional().describe("How the UI is currently displayed."),availableDisplayModes:h(Vs).optional().describe("Display modes the host supports."),containerDimensions:z([l({height:g().describe("Fixed container height in pixels.")}),l({maxHeight:z([g(),zc()]).optional().describe("Maximum container height in pixels.")})]).and(z([l({width:g().describe("Fixed container width in pixels.")}),l({maxWidth:z([g(),zc()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
106
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:s().optional().describe("User's language and region preference in BCP 47 format."),timeZone:s().optional().describe("User's timezone in IANA format."),userAgent:s().optional().describe("Host application identifier."),platform:z([u("web"),u("desktop"),u("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:l({touch:v().optional().describe("Whether the device supports touch input."),hover:v().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:l({top:g().describe("Top safe area inset in pixels."),right:g().describe("Right safe area inset in pixels."),bottom:g().describe("Bottom safe area inset in pixels."),left:g().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),GS=l({method:u("ui/notifications/host-context-changed"),params:om.describe("Partial context update containing only changed fields.")}),rv=l({method:u("ui/update-model-context"),params:l({content:h(Te).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:y(s(),R().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),nv=l({method:u("ui/initialize"),params:l({appInfo:xe.describe("App identification (name and version)."),appCapabilities:FS.describe("Features and capabilities this app provides."),protocolVersion:s().describe("Protocol version this app supports.")})}),KS=l({protocolVersion:s().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:xe.describe("Host application identification and version."),hostCapabilities:HS.describe("Features and capabilities provided by the host."),hostContext:om.describe("Rich context about the host environment.")}).passthrough(),YS={target:"draft-2020-12"};async function Yh(e,t){let o=e["~standard"];if(o.jsonSchema)return o.jsonSchema[t](YS);throw Error(`Schema (vendor: ${o.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Qh(e,t,o=""){let r=await e["~standard"].validate(t);if(r.issues){let n=r.issues.map((i)=>{let a=i.path?.map((c)=>typeof c==="object"?c.key:c).join(".");return a?`${a}: ${i.message}`:i.message}).join("; ");throw Error(o+n)}return r.value}function QS(e,t){let o={...e,...t};if(t.experimental!==void 0)o.experimental={...e.experimental,...t.experimental};if(t.tools!==void 0)o.tools={...e.tools,...t.tools};return o}class ua extends Fc{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new Xh;_methods=new em;setRequestHandler=(...e)=>{let[t,...o]=Gh("request",e)??e;this._methods.claim(t,"setRequestHandler"),super.setRequestHandler.call(this,t,...o)};setNotificationHandler=(...e)=>{let[t,...o]=Gh("notification",e)??e;this._methods.claim(t,"setNotificationHandler"),super.setNotificationHandler.call(this,t,...o)};removeRequestHandler=(e)=>{this._methods.release(e),super.removeRequestHandler(e)};removeNotificationHandler=(e)=>{this._methods.release(e),super.removeNotificationHandler(e)};replaceRequestHandler=(e,...t)=>{this._methods.replace(e),super.setRequestHandler.call(this,e,...t)};_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:AS,toolinputpartial:jS,toolresult:WS,toolcancelled:LS,hostcontextchanged:GS};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(e){if(!ua.ONE_SHOT_EVENTS.has(e)||this._everHadListener.has(e))return;if(this._everHadListener.add(e),!this._initializedSent)return;let t=`[ext-apps] "${String(e)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(t);console.warn(t)}setEventHandler(e,t){if(t)this._assertHandlerTiming(e);this._ensureEventSlot(e),this._events.setHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.addEventListener(e,t)}removeEventListener(e,t){this._events.removeEventListener(e,t)}_ensureEventSlot(e){if(this._registeredEvents.has(e))return;let t=this.eventSchemas[e];if(!t)throw Error(`Unknown event: ${String(e)}`);this.setNotificationHandler(t.shape.method.value,{params:t.shape.params},(o)=>{let r=o;if(e==="hostcontextchanged")this._hostContext={...this._hostContext,...r};this._events.dispatch(e,r)}),this._registeredEvents.add(e)}getEventHandler(e){return this._events.getHandler(e)}warnIfRequestHandlerReplaced(e,t,o){if(t&&o)console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}constructor(e,t={},o={autoResize:!0}){super(o);if(this._appInfo=e,this._appCapabilities=t,this.options=o,this._methods.replace("notifications/cancelled"),this._methods.replace("notifications/progress"),!o.allowUnsafeEval)ce({jitless:!0});this.replaceRequestHandler("ping",(r)=>(console.log("Received ping:",r.params),{})),this.setEventHandler("hostcontextchanged",void 0)}buildContext(e){return e}registerAppCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._appCapabilities=QS(this._appCapabilities,e)}registerTool(e,t,o){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,n=()=>{if(r._initializedSent&&r._appCapabilities.tools?.listChanged)r.sendToolListChanged()},i=t.inputSchema!==void 0,a={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,n()},disable(){this.enabled=!1,n()},update(c){Object.assign(this,c),n()},remove(){if(r._registeredTools[e]!==a)return;delete r._registeredTools[e],n()},handler:async(c,p)=>{if(!a.enabled)throw Error(`Tool ${e} is disabled`);let d;if(i){let f=a.inputSchema,S=f?await Qh(f,c??{},`Invalid input for tool ${e}: `):c??{};d=await o(S,p)}else d=await o(p);if(a.outputSchema&&!d.isError)d.structuredContent=await Qh(a.outputSchema,d.structuredContent,`Invalid output for tool ${e}: `);return d}};if(this._registeredTools[e]=a,!this._appCapabilities.tools&&!this.transport)this.registerAppCapabilities({tools:{listChanged:!0}});return this.ensureToolHandlersInitialized(),n(),a}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){if(this._toolHandlersInitialized)return;this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let o=this._registeredTools[e.name];if(!o)throw Error(`Tool ${e.name} not found`);return o.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([o,r])=>r.enabled).map(async([o,r])=>{let n={name:o,title:r.title,description:r.description,inputSchema:r.inputSchema?await Yh(r.inputSchema,"input"):{type:"object",properties:{}}};if(r.outputSchema)n.outputSchema=await Yh(r.outputSchema,"output");if(r.annotations)n.annotations=r.annotations;if(r._meta)n._meta=r._meta;return n}))})}async sendToolListChanged(e={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(e){this.setEventHandler("toolinput",e)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(e){this.setEventHandler("toolinputpartial",e)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(e){this.setEventHandler("toolresult",e)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(e){this.setEventHandler("toolcancelled",e)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(e){this.setEventHandler("hostcontextchanged",e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,e),this._onteardown=e,this.replaceRequestHandler("ui/resource-teardown",{params:DS.shape.params,result:VS},(t,o)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(t,o)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler("tools/call",(t,o)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(t.params,o)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler("tools/list",(t,o)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(t.params,o)})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`);break}}assertRequestHandlerCapability(e){switch(e){case"tools/call":case"tools/list":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;default:return}}assertNotificationCapability(e){}async callServerTool(e,t){if(this._assertInitialized("callServerTool"),typeof e==="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:e},{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:e},t)}async listServerResources(e,t){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:e},t)}async createSamplingMessage(e,t){return this._assertInitialized("createSamplingMessage"),await this.request({method:"sampling/createMessage",params:e},t)}sendMessage(e,t){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:e},qS,t)}sendLog(e){return this.notification({method:"notifications/message",params:e})}updateModelContext(e,t){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:e},tt,t)}openLink(e,t){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:e},NS,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:e},MS,t)}requestTeardown(e={}){return this.notification({method:"ui/notifications/request-teardown",params:e})}requestDisplayMode(e,t){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:e},JS,t)}sendSizeChanged(e){return this.notification({method:"ui/notifications/size-changed",params:e})}setupSizeChangedNotifications(){let e=!1,t=0,o=0,r=()=>{if(e)return;e=!0,requestAnimationFrame(()=>{e=!1;let i=document.documentElement,a=i.style.height;i.style.height="max-content";let c=Math.ceil(i.getBoundingClientRect().height);i.style.height=a;let p=Math.ceil(window.innerWidth);if(p!==t||c!==o)t=p,o=c,this.sendSizeChanged({width:p,height:c})})};r();let n=new ResizeObserver(r);return n.observe(document.documentElement),n.observe(document.body),()=>n.disconnect()}async connect(e=new tm(window.parent,window.parent),t){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1;try{await super.connect(e);let o=await this.request({method:"ui/initialize",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:ES}},KS,t);if(o===void 0)throw Error(`Server sent invalid initialize result: ${o}`);if(this._hostCapabilities=o.hostCapabilities,this._hostInfo=o.hostInfo,this._hostContext=o.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize)this.setupSizeChangedNotifications()}catch(o){throw this.close(),o}}}function rm(e){return Array.isArray(e)&&e.length>0&&e.every((t)=>t&&typeof t==="object"&&typeof t.token==="string"&&/^--[\w-]+$/.test(t.token)&&typeof t.property==="string"&&/^-?[a-z][a-z0-9-]*$/.test(t.property)&&typeof t.probe==="string"&&t.probe.trim().length>0)&&new Set(e.map((t)=>`${t.token}:${t.property}`)).size===e.length}function nm(e,t){let o=t.getComputedStyle(e),r=e.getBoundingClientRect();if(o.display==="none"||o.visibility!=="visible"||!e.getClientRects().length||!(r.width||r.height))return!1;for(let n=e;n;n=n.parentElement)if(Number(t.getComputedStyle(n).opacity)===0)return!1;return!0}function sm(e,t){if(!rm(t))return{ok:!1,diagnostics:["Token preview needs explicit { token, property, probe } samples from the project fixture. Rebuild with the current compiler."]};let o=e.ownerDocument,{defaultView:r,documentElement:n}=o,i=[],a=[],c=[...e.querySelectorAll("[data-ads-token], [data-ads-property]")],p=new Set(t.map((d)=>`${d.token}:${d.property}`));for(let d of c)if(!p.has(`${d.dataset.adsToken}:${d.dataset.adsProperty}`))i.push(`Undeclared rendered token sample ${d.dataset.adsToken}:${d.dataset.adsProperty}.`);for(let d of t){if(!r.CSS.supports(d.property,d.probe)){i.push(`${d.token}: the fixture probe is invalid for ${d.property}.`);continue}let f=r.getComputedStyle(n).getPropertyValue(d.token).trim();if(!f||!r.CSS.supports(d.property,f)){i.push(`${d.token}: its current value is invalid for the fixture's ${d.property} binding.`);continue}let S=c.filter((b)=>b.dataset.adsToken===d.token&&b.dataset.adsProperty===d.property);if(!S.length){i.push(`${d.token} needs a rendered ${d.property} sample, not only a name/value label.`);continue}let _=!1;for(let b of S){let P=[];for(let I=b.parentElement;I&&I!==e;I=I.parentElement)if(I.tagName==="DETAILS"&&!I.open)I.open=!0,P.push(I);let k=n.getAttribute("style"),E=b.getAttribute("style");try{if(!/^(?:-[a-z]+-)?transition(?:-|$)/.test(d.property))b.style.setProperty("transition","none","important");let I=r.getComputedStyle(b).getPropertyValue(d.property),D=nm(b,r);n.style.setProperty(d.token,d.probe,"important");let M=r.getComputedStyle(b).getPropertyValue(d.property);_=Boolean(M&&M!==I&&(D||nm(b,r)))}finally{if(k===null)n.removeAttribute("style");else n.setAttribute("style",k);if(E===null)b.removeAttribute("style");else b.setAttribute("style",E);for(let I of P)I.open=!1}if(_)break}if(_)a.push(d);else i.push(`${d.token} has no visible ${d.property} sample that responds to its value. Hardcoded copies do not satisfy coverage.`)}return{ok:!i.length,verified:a,diagnostics:i}}var st=new ua({name:"ADS preview",version:"1.0.0"},{},{autoResize:!0}),im=document.getElementById("ads-preview-seed"),cm;function am(e,t){let o=document.createElement(e);return o.textContent=t,o}function lm(e){if(e==="light"||e==="dark")document.documentElement.dataset.theme=e}st.onhostcontextchanged=(e)=>lm(e.theme);if(im){let n=function(c){let p="";if(!c||c.state==="unreported")p="Preview freshness is unverified. Check the build status before reviewing.";else if(c.state==="error"){let d=c.diagnostics?.[0];if(p=`Build failed. Showing ${e.revision===null?"an earlier preview":`build ${e.revision}`}.`,d)p+=`
107
+ ${d.file??""}${d.line?`:${d.line}`:""}${d.file?": ":""}${d.message}`}else if(["building","idle"].includes(c.state))p="Rebuilding. This view is the previous preview.";else if(c.revision!==e.revision||c.session!==e.session)p=`Build ${c.revision} is ready. Reopen this preview to load it.`;t.textContent=[p,r].filter(Boolean).join(`
108
+ `),t.hidden=!t.textContent},e=JSON.parse(im.textContent),t=am("aside","");t.id="ads-preview-build",t.setAttribute("role","status"),t.setAttribute("aria-live","polite");let o=am("style","#ads-preview-build{position:fixed;inset:12px 12px auto;z-index:2147483647;padding:10px 14px;border:1px solid GrayText;border-radius:6px;background:Canvas;color:CanvasText;font:13px system-ui;white-space:pre-wrap;overflow-wrap:anywhere;max-height:30vh;overflow:auto}#ads-preview-build[hidden]{display:none}");document.head.append(o),document.body.append(t);let r="";if(n(e),e.kind==="tokens")(async()=>{await new Promise((p)=>requestAnimationFrame(()=>requestAnimationFrame(p))),await document.fonts.ready;let c=sm(document.body,e.samples);if(!c.ok){r=`Token preview verification failed:
109
+ ${c.diagnostics.slice(0,20).join(`
110
+ `)}`,t.setAttribute("role","alert"),n(e);try{if(st.getHostCapabilities()?.logging)await st.sendLog({level:"error",logger:"ads-preview",data:{state:"error",id:e.id,message:r}})}catch{}}})();let i=!1,a;st.onteardown=async()=>(clearInterval(a),{}),window.addEventListener("pagehide",()=>clearInterval(a),{once:!0}),cm=()=>{if(!st.getHostCapabilities()?.serverResources)return;async function c(){if(i||document.visibilityState==="hidden")return;i=!0;try{let p=await st.readServerResource({uri:"ads://project/build"},{timeout:5000}),d=JSON.parse(p.contents.find((f)=>("text"in f)).text);n(d.previews.find((f)=>f.id===e.id))}catch{t.textContent=["Build status unavailable. Reopen the preview to verify it.",r].filter(Boolean).join(`
111
+ `),t.hidden=!1}finally{i=!1}}c(),a=setInterval(()=>{c()},2000)}}try{await st.connect(),cm?.(),lm(st.getHostContext()?.theme)}catch{}