@weppy/roblox-mcp 2.15.0 → 2.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dashboard/dist/assets/{AssetsPage-D3-InAlf.js → AssetsPage-DX9x9SC-.js} +1 -1
- package/dashboard/dist/assets/{ChangelogDetailPage-fmLGEZVO.js → ChangelogDetailPage-BAdkFH4m.js} +1 -1
- package/dashboard/dist/assets/{ChangelogPage-6KtWInS5.js → ChangelogPage-DVa66CAx.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-DJp4ax33.js → ConfirmModal-Cx4qxCjl.js} +1 -1
- package/dashboard/dist/assets/{ConnectionPage-D375gmxK.js → ConnectionPage-DD8NfK5Z.js} +1 -1
- package/dashboard/dist/assets/{ControlsPage-C7zSLjWc.js → ControlsPage-o8R5xChG.js} +1 -1
- package/dashboard/dist/assets/{CurrentPlaceScope-DrtUw6py.js → CurrentPlaceScope-B2YvP18E.js} +1 -1
- package/dashboard/dist/assets/{GameChangeDetail-Bd5Hg2ZD.js → GameChangeDetail-CANQ7TH0.js} +1 -1
- package/dashboard/dist/assets/{InfoLabel-HLPMIIL4.js → InfoLabel-D2VbqMgH.js} +1 -1
- package/dashboard/dist/assets/{OverviewPage-Bmem2hyc.js → OverviewPage-BszeTJIo.js} +1 -1
- package/dashboard/dist/assets/{PageHeader-Cvi0LO4r.js → PageHeader-BgyqIJ0Z.js} +1 -1
- package/dashboard/dist/assets/{PlaytestPage-ChFkixWj.js → PlaytestPage-_4RJNxRW.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-v3EWZSAn.js → SettingsPage-BAA3Fxdm.js} +1 -1
- package/dashboard/dist/assets/{StatusBadge-Cf1Ncow3.js → StatusBadge-Cq69Lfvg.js} +1 -1
- package/dashboard/dist/assets/{SyncPage-BG7u00IT.js → SyncPage-C99qM5zE.js} +1 -1
- package/dashboard/dist/assets/{Tabs-2QEkInbt.js → Tabs-3VHO8Be_.js} +1 -1
- package/dashboard/dist/assets/{ToolsPage-DbtQxCAM.js → ToolsPage-BgbHb62d.js} +1 -1
- package/dashboard/dist/assets/{TooltipText-1fJvqtMt.js → TooltipText-D25g5AsX.js} +1 -1
- package/dashboard/dist/assets/{UiPrimitive-CsV5QE01.js → UiPrimitive-CjC02gTX.js} +1 -1
- package/dashboard/dist/assets/{UiStudioPage-ZLA3xIIN.js → UiStudioPage-9yMweHNP.js} +1 -1
- package/dashboard/dist/assets/{WhatsNewPage-S4qEx4iN.js → WhatsNewPage-DljMthtl.js} +1 -1
- package/dashboard/dist/assets/{copy-d0x3Roiq.js → copy-DHFJbo01.js} +1 -1
- package/dashboard/dist/assets/{index-C_exRd2o.js → index-BZHTEq5I.js} +55 -55
- package/dashboard/dist/assets/{sample-requests-BRAniRWZ.js → sample-requests-iDE7PC0n.js} +1 -1
- package/dashboard/dist/assets/{useLiveUptime-D0TQTjV7.js → useLiveUptime-Cz8E27FS.js} +1 -1
- package/dashboard/dist/assets/{useSettings-DlZqZGnP.js → useSettings-C3cj-P0g.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
package/dist/index.js
CHANGED
|
@@ -242,7 +242,7 @@ run().catch(() => {
|
|
|
242
242
|
|
|
243
243
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let s=o[1];if(e===o[0]){a(o);continue}if(t.external){let l=t.external.registry.get(o[0])?.id;if(e!==o[0]&&l){a(o);continue}}if(t.metadataRegistry.get(o[0])?.id){a(o);continue}if(s.cycle){a(o);continue}if(s.count>1&&t.reused==="ref"){a(o);continue}}}function io(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=o=>{let s=t.seen.get(o);if(s.ref===null)return;let c=s.def??s.schema,l={...c},u=s.ref;if(s.ref=null,u){n(u);let p=t.seen.get(u),m=p.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,l),o._zod.parent===u)for(let g in c)g==="$ref"||g==="allOf"||g in l||delete c[g];if(m.$ref&&p.def)for(let g in c)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(c[g])===JSON.stringify(p.def[g])&&delete c[g]}let d=o._zod.parent;if(d&&d!==u){n(d);let p=t.seen.get(d);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(let m in c)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(c[m])===JSON.stringify(p.def[m])&&delete c[m]}t.override({zodSchema:o,jsonSchema:c,path:s.path??[]})};for(let o of[...t.seen.entries()].reverse())n(o[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let o=t.external.registry.get(e)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(o)}Object.assign(i,r.def??r.schema);let a=t.external?.defs??{};for(let o of t.seen.entries()){let s=o[1];s.def&&s.defId&&(a[s.defId]=s.def)}t.external||Object.keys(a).length>0&&(t.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{let o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...e["~standard"],jsonSchema:{input:cl(e,"input",t.processors),output:cl(e,"output",t.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function br(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return br(n.element,r);if(n.type==="set")return br(n.valueType,r);if(n.type==="lazy")return br(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return br(n.innerType,r);if(n.type==="intersection")return br(n.left,r)||br(n.right,r);if(n.type==="record"||n.type==="map")return br(n.keyType,r)||br(n.valueType,r);if(n.type==="pipe")return br(n.in,r)||br(n.out,r);if(n.type==="object"){for(let i in n.shape)if(br(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(br(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(br(i,r))return!0;return!!(n.rest&&br(n.rest,r))}return!1}var hC=(t,e={})=>r=>{let n=ro({...r,processors:e});return Ce(t,n),no(n,t),io(n,t)},cl=(t,e,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=ro({...i??{},target:a,io:e,processors:r});return Ce(t,o),no(o,t),io(o,t)};var tee={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},yC=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),s&&(i.format=tee[s]??s,i.format===""&&delete i.format,s==="time"&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},vC=(t,e,r,n)=>{let i=r,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=t._zod.bag;typeof s=="string"&&s.includes("int")?i.type="integer":i.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a=="number"&&(i.minimum=a,typeof u=="number"&&e.target!=="draft-04"&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o=="number"&&(i.maximum=o,typeof l=="number"&&e.target!=="draft-04"&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},bC=(t,e,r,n)=>{r.type="boolean"},_C=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},xC=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},SC=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},wC=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},IC=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},PC=(t,e,r,n)=>{r.not={}},CC=(t,e,r,n)=>{},kC=(t,e,r,n)=>{},RC=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},EC=(t,e,r,n)=>{let i=t._zod.def,a=Md(i.entries);a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),r.enum=a},AC=(t,e,r,n)=>{let i=t._zod.def,a=[];for(let o of i.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let o=a[0];r.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[o]:r.const=o}else a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),a.every(o=>typeof o=="boolean")&&(r.type="boolean"),a.every(o=>o===null)&&(r.type="null"),r.enum=a},TC=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},OC=(t,e,r,n)=>{let i=r,a=t._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=a.source},DC=(t,e,r,n)=>{let i=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:s,mime:c}=t._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(i,a)},$C=(t,e,r,n)=>{r.type="boolean"},NC=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},jC=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},MC=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},LC=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},zC=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},UC=(t,e,r,n)=>{let i=r,a=t._zod.def,{minimum:o,maximum:s}=t._zod.bag;typeof o=="number"&&(i.minItems=o),typeof s=="number"&&(i.maxItems=s),i.type="array",i.items=Ce(a.element,e,{...n,path:[...n.path,"items"]})},FC=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object",i.properties={};let o=a.shape;for(let l in o)i.properties[l]=Ce(o[l],e,{...n,path:[...n.path,"properties",l]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(l=>{let u=a.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Ce(a.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},Av=(t,e,r,n)=>{let i=t._zod.def,a=i.inclusive===!1,o=i.options.map((s,c)=>Ce(s,e,{...n,path:[...n.path,a?"oneOf":"anyOf",c]}));a?r.oneOf=o:r.anyOf=o},qC=(t,e,r,n)=>{let i=t._zod.def,a=Ce(i.left,e,{...n,path:[...n.path,"allOf",0]}),o=Ce(i.right,e,{...n,path:[...n.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];r.allOf=c},BC=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="array";let o=e.target==="draft-2020-12"?"prefixItems":"items",s=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=a.items.map((p,m)=>Ce(p,e,{...n,path:[...n.path,o,m]})),l=a.rest?Ce(a.rest,e,{...n,path:[...n.path,s,...e.target==="openapi-3.0"?[a.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=c,l&&(i.items=l)):e.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(i.minItems=u),typeof d=="number"&&(i.maxItems=d)},VC=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object";let o=a.keyType,c=o._zod.bag?.patterns;if(a.mode==="loose"&&c&&c.size>0){let u=Ce(a.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let d of c)i.patternProperties[d.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Ce(a.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=Ce(a.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let l=o._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(i.required=u)}},WC=(t,e,r,n)=>{let i=t._zod.def,a=Ce(i.innerType,e,n),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},HC=(t,e,r,n)=>{let i=t._zod.def;Ce(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},ZC=(t,e,r,n)=>{let i=t._zod.def;Ce(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},GC=(t,e,r,n)=>{let i=t._zod.def;Ce(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},KC=(t,e,r,n)=>{let i=t._zod.def;Ce(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=o},JC=(t,e,r,n)=>{let i=t._zod.def,a=e.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Ce(a,e,n);let o=e.seen.get(t);o.ref=a},YC=(t,e,r,n)=>{let i=t._zod.def;Ce(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.readOnly=!0},XC=(t,e,r,n)=>{let i=t._zod.def;Ce(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},Tv=(t,e,r,n)=>{let i=t._zod.def;Ce(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},QC=(t,e,r,n)=>{let i=t._zod.innerType;Ce(i,e,n);let a=e.seen.get(t);a.ref=i},Ev={string:yC,number:vC,boolean:bC,bigint:_C,symbol:xC,null:SC,undefined:wC,void:IC,never:PC,any:CC,unknown:kC,date:RC,enum:EC,literal:AC,nan:TC,template_literal:OC,file:DC,success:$C,custom:NC,function:jC,transform:MC,map:LC,set:zC,array:UC,object:FC,union:Av,intersection:qC,tuple:BC,record:VC,nullable:WC,nonoptional:HC,default:ZC,prefault:GC,catch:KC,pipe:JC,readonly:YC,promise:XC,optional:Tv,lazy:QC};function ll(t,e){if("_idmap"in t){let n=t,i=ro({...e,processors:Ev}),a={};for(let c of n._idmap.entries()){let[l,u]=c;Ce(u,i)}let o={},s={registry:n,uri:e?.uri,defs:a};i.external=s;for(let c of n._idmap.entries()){let[l,u]=c;no(i,u),o[l]=io(i,u)}if(Object.keys(a).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[c]:a}}return{schemas:o}}let r=ro({...e,processors:Ev});return Ce(t,r),no(r,t),io(r,t)}var Ov=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=ro({processors:Ev,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return Ce(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),no(this.ctx,e);let n=io(this.ctx,e),{"~standard":i,...a}=n;return a}};var rM={};var wp={};hr(wp,{ZodAny:()=>_0,ZodArray:()=>I0,ZodBase64:()=>Xv,ZodBase64URL:()=>Qv,ZodBigInt:()=>gl,ZodBigIntFormat:()=>rb,ZodBoolean:()=>fl,ZodCIDRv4:()=>Jv,ZodCIDRv6:()=>Yv,ZodCUID:()=>Bv,ZodCUID2:()=>Vv,ZodCatch:()=>V0,ZodCodec:()=>cb,ZodCustom:()=>Dp,ZodCustomStringFormat:()=>pl,ZodDate:()=>Rp,ZodDefault:()=>L0,ZodDiscriminatedUnion:()=>C0,ZodE164:()=>eb,ZodEmail:()=>Uv,ZodEmoji:()=>Fv,ZodEnum:()=>ul,ZodExactOptional:()=>N0,ZodFile:()=>D0,ZodFunction:()=>Q0,ZodGUID:()=>Ip,ZodIPv4:()=>Gv,ZodIPv6:()=>Kv,ZodIntersection:()=>k0,ZodJWT:()=>tb,ZodKSUID:()=>Zv,ZodLazy:()=>J0,ZodLiteral:()=>O0,ZodMAC:()=>h0,ZodMap:()=>A0,ZodNaN:()=>H0,ZodNanoID:()=>qv,ZodNever:()=>S0,ZodNonOptional:()=>ob,ZodNull:()=>b0,ZodNullable:()=>M0,ZodNumber:()=>ml,ZodNumberFormat:()=>ws,ZodObject:()=>Ep,ZodOptional:()=>ab,ZodPipe:()=>sb,ZodPrefault:()=>U0,ZodPromise:()=>X0,ZodReadonly:()=>Z0,ZodRecord:()=>Op,ZodSet:()=>T0,ZodString:()=>dl,ZodStringFormat:()=>$e,ZodSuccess:()=>B0,ZodSymbol:()=>y0,ZodTemplateLiteral:()=>K0,ZodTransform:()=>$0,ZodTuple:()=>R0,ZodType:()=>Q,ZodULID:()=>Wv,ZodURL:()=>kp,ZodUUID:()=>mi,ZodUndefined:()=>v0,ZodUnion:()=>Ap,ZodUnknown:()=>x0,ZodVoid:()=>w0,ZodXID:()=>Hv,ZodXor:()=>P0,_ZodString:()=>zv,_default:()=>z0,_function:()=>aL,any:()=>FM,array:()=>ae,base64:()=>IM,base64url:()=>PM,bigint:()=>jM,boolean:()=>gt,catch:()=>W0,check:()=>oL,cidrv4:()=>SM,cidrv6:()=>wM,codec:()=>rL,cuid:()=>fM,cuid2:()=>gM,custom:()=>lb,date:()=>BM,describe:()=>sL,discriminatedUnion:()=>Tp,e164:()=>CM,email:()=>iM,emoji:()=>pM,enum:()=>Gt,exactOptional:()=>j0,file:()=>XM,float32:()=>OM,float64:()=>DM,function:()=>aL,guid:()=>aM,hash:()=>TM,hex:()=>AM,hostname:()=>EM,httpUrl:()=>dM,instanceof:()=>lL,int:()=>Lv,int32:()=>$M,int64:()=>MM,intersection:()=>yl,ipv4:()=>bM,ipv6:()=>xM,json:()=>dL,jwt:()=>kM,keyof:()=>VM,ksuid:()=>vM,lazy:()=>Y0,literal:()=>B,looseObject:()=>Zt,looseRecord:()=>GM,mac:()=>_M,map:()=>KM,meta:()=>cL,nan:()=>tL,nanoid:()=>mM,nativeEnum:()=>YM,never:()=>nb,nonoptional:()=>q0,null:()=>hl,nullable:()=>Pp,nullish:()=>QM,number:()=>Se,object:()=>U,optional:()=>We,partialRecord:()=>ZM,pipe:()=>Cp,prefault:()=>F0,preprocess:()=>$p,promise:()=>iL,readonly:()=>G0,record:()=>Fe,refine:()=>ek,set:()=>JM,strictObject:()=>WM,string:()=>P,stringFormat:()=>RM,stringbool:()=>uL,success:()=>eL,superRefine:()=>tk,symbol:()=>zM,templateLiteral:()=>nL,transform:()=>ib,tuple:()=>E0,uint32:()=>NM,uint64:()=>LM,ulid:()=>hM,undefined:()=>UM,union:()=>Ae,unknown:()=>Ne,url:()=>uM,uuid:()=>oM,uuidv4:()=>sM,uuidv6:()=>cM,uuidv7:()=>lM,void:()=>qM,xid:()=>yM,xor:()=>HM});var Dv={};hr(Dv,{endsWith:()=>hs,gt:()=>Ln,gte:()=>Ht,includes:()=>fs,length:()=>to,lowercase:()=>ps,lt:()=>Mn,lte:()=>vr,maxLength:()=>eo,maxSize:()=>na,mime:()=>ys,minLength:()=>pi,minSize:()=>zn,multipleOf:()=>ra,negative:()=>bp,nonnegative:()=>xp,nonpositive:()=>_p,normalize:()=>vs,overwrite:()=>fn,positive:()=>vp,property:()=>Sp,regex:()=>ds,size:()=>Qa,slugify:()=>sl,startsWith:()=>gs,toLowerCase:()=>_s,toUpperCase:()=>xs,trim:()=>bs,uppercase:()=>ms});var ao={};hr(ao,{ZodISODate:()=>Nv,ZodISODateTime:()=>$v,ZodISODuration:()=>Mv,ZodISOTime:()=>jv,date:()=>t0,datetime:()=>e0,duration:()=>n0,time:()=>r0});var $v=S("ZodISODateTime",(t,e)=>{Bh.init(t,e),$e.init(t,e)});function e0(t){return Ky($v,t)}var Nv=S("ZodISODate",(t,e)=>{Vh.init(t,e),$e.init(t,e)});function t0(t){return Jy(Nv,t)}var jv=S("ZodISOTime",(t,e)=>{Wh.init(t,e),$e.init(t,e)});function r0(t){return Yy(jv,t)}var Mv=S("ZodISODuration",(t,e)=>{Hh.init(t,e),$e.init(t,e)});function n0(t){return Xy(Mv,t)}var nM=(t,e)=>{qd.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>Wc(t,r)},flatten:{value:r=>Vc(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Fc,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Fc,2)}},isEmpty:{get(){return t.issues.length===0}}})},nee=S("ZodError",nM),Dr=S("ZodError",nM,{Parent:Error});var i0=Hc(Dr),a0=Gc(Dr),o0=Jc(Dr),s0=Yc(Dr),c0=gh(Dr),l0=hh(Dr),u0=yh(Dr),d0=vh(Dr),p0=bh(Dr),m0=_h(Dr),f0=xh(Dr),g0=Sh(Dr);var Q=S("ZodType",(t,e)=>(K.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:cl(t,"input"),output:cl(t,"output")}}),t.toJSONSchema=hC(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone(A.mergeDefs(e,{checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),t.with=t.check,t.clone=(r,n)=>Wt(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>i0(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>o0(t,r,n),t.parseAsync=async(r,n)=>a0(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>s0(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>c0(t,r,n),t.decode=(r,n)=>l0(t,r,n),t.encodeAsync=async(r,n)=>u0(t,r,n),t.decodeAsync=async(r,n)=>d0(t,r,n),t.safeEncode=(r,n)=>p0(t,r,n),t.safeDecode=(r,n)=>m0(t,r,n),t.safeEncodeAsync=async(r,n)=>f0(t,r,n),t.safeDecodeAsync=async(r,n)=>g0(t,r,n),t.refine=(r,n)=>t.check(ek(r,n)),t.superRefine=r=>t.check(tk(r)),t.overwrite=r=>t.check(fn(r)),t.optional=()=>We(t),t.exactOptional=()=>j0(t),t.nullable=()=>Pp(t),t.nullish=()=>We(Pp(t)),t.nonoptional=r=>q0(t,r),t.array=()=>ae(t),t.or=r=>Ae([t,r]),t.and=r=>yl(t,r),t.transform=r=>Cp(t,ib(r)),t.default=r=>z0(t,r),t.prefault=r=>F0(t,r),t.catch=r=>W0(t,r),t.pipe=r=>Cp(t,r),t.readonly=()=>G0(t),t.describe=r=>{let n=t.clone();return Tt.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return Tt.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return Tt.get(t);let n=t.clone();return Tt.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=r=>r(t),t)),zv=S("_ZodString",(t,e)=>{Xa.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(n,i,a)=>yC(t,n,i,a);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(ds(...n)),t.includes=(...n)=>t.check(fs(...n)),t.startsWith=(...n)=>t.check(gs(...n)),t.endsWith=(...n)=>t.check(hs(...n)),t.min=(...n)=>t.check(pi(...n)),t.max=(...n)=>t.check(eo(...n)),t.length=(...n)=>t.check(to(...n)),t.nonempty=(...n)=>t.check(pi(1,...n)),t.lowercase=n=>t.check(ps(n)),t.uppercase=n=>t.check(ms(n)),t.trim=()=>t.check(bs()),t.normalize=(...n)=>t.check(vs(...n)),t.toLowerCase=()=>t.check(_s()),t.toUpperCase=()=>t.check(xs()),t.slugify=()=>t.check(sl())}),dl=S("ZodString",(t,e)=>{Xa.init(t,e),zv.init(t,e),t.email=r=>t.check(Xd(Uv,r)),t.url=r=>t.check(ol(kp,r)),t.jwt=r=>t.check(yp(tb,r)),t.emoji=r=>t.check(np(Fv,r)),t.guid=r=>t.check(al(Ip,r)),t.uuid=r=>t.check(Qd(mi,r)),t.uuidv4=r=>t.check(ep(mi,r)),t.uuidv6=r=>t.check(tp(mi,r)),t.uuidv7=r=>t.check(rp(mi,r)),t.nanoid=r=>t.check(ip(qv,r)),t.guid=r=>t.check(al(Ip,r)),t.cuid=r=>t.check(ap(Bv,r)),t.cuid2=r=>t.check(op(Vv,r)),t.ulid=r=>t.check(sp(Wv,r)),t.base64=r=>t.check(fp(Xv,r)),t.base64url=r=>t.check(gp(Qv,r)),t.xid=r=>t.check(cp(Hv,r)),t.ksuid=r=>t.check(lp(Zv,r)),t.ipv4=r=>t.check(up(Gv,r)),t.ipv6=r=>t.check(dp(Kv,r)),t.cidrv4=r=>t.check(pp(Jv,r)),t.cidrv6=r=>t.check(mp(Yv,r)),t.e164=r=>t.check(hp(eb,r)),t.datetime=r=>t.check(e0(r)),t.date=r=>t.check(t0(r)),t.time=r=>t.check(r0(r)),t.duration=r=>t.check(n0(r))});function P(t){return Wy(dl,t)}var $e=S("ZodStringFormat",(t,e)=>{Ee.init(t,e),zv.init(t,e)}),Uv=S("ZodEmail",(t,e)=>{$h.init(t,e),$e.init(t,e)});function iM(t){return Xd(Uv,t)}var Ip=S("ZodGUID",(t,e)=>{Oh.init(t,e),$e.init(t,e)});function aM(t){return al(Ip,t)}var mi=S("ZodUUID",(t,e)=>{Dh.init(t,e),$e.init(t,e)});function oM(t){return Qd(mi,t)}function sM(t){return ep(mi,t)}function cM(t){return tp(mi,t)}function lM(t){return rp(mi,t)}var kp=S("ZodURL",(t,e)=>{Nh.init(t,e),$e.init(t,e)});function uM(t){return ol(kp,t)}function dM(t){return ol(kp,{protocol:/^https?$/,hostname:Or.domain,...A.normalizeParams(t)})}var Fv=S("ZodEmoji",(t,e)=>{jh.init(t,e),$e.init(t,e)});function pM(t){return np(Fv,t)}var qv=S("ZodNanoID",(t,e)=>{Mh.init(t,e),$e.init(t,e)});function mM(t){return ip(qv,t)}var Bv=S("ZodCUID",(t,e)=>{Lh.init(t,e),$e.init(t,e)});function fM(t){return ap(Bv,t)}var Vv=S("ZodCUID2",(t,e)=>{zh.init(t,e),$e.init(t,e)});function gM(t){return op(Vv,t)}var Wv=S("ZodULID",(t,e)=>{Uh.init(t,e),$e.init(t,e)});function hM(t){return sp(Wv,t)}var Hv=S("ZodXID",(t,e)=>{Fh.init(t,e),$e.init(t,e)});function yM(t){return cp(Hv,t)}var Zv=S("ZodKSUID",(t,e)=>{qh.init(t,e),$e.init(t,e)});function vM(t){return lp(Zv,t)}var Gv=S("ZodIPv4",(t,e)=>{Zh.init(t,e),$e.init(t,e)});function bM(t){return up(Gv,t)}var h0=S("ZodMAC",(t,e)=>{Kh.init(t,e),$e.init(t,e)});function _M(t){return Zy(h0,t)}var Kv=S("ZodIPv6",(t,e)=>{Gh.init(t,e),$e.init(t,e)});function xM(t){return dp(Kv,t)}var Jv=S("ZodCIDRv4",(t,e)=>{Jh.init(t,e),$e.init(t,e)});function SM(t){return pp(Jv,t)}var Yv=S("ZodCIDRv6",(t,e)=>{Yh.init(t,e),$e.init(t,e)});function wM(t){return mp(Yv,t)}var Xv=S("ZodBase64",(t,e)=>{Xh.init(t,e),$e.init(t,e)});function IM(t){return fp(Xv,t)}var Qv=S("ZodBase64URL",(t,e)=>{Qh.init(t,e),$e.init(t,e)});function PM(t){return gp(Qv,t)}var eb=S("ZodE164",(t,e)=>{ey.init(t,e),$e.init(t,e)});function CM(t){return hp(eb,t)}var tb=S("ZodJWT",(t,e)=>{ty.init(t,e),$e.init(t,e)});function kM(t){return yp(tb,t)}var pl=S("ZodCustomStringFormat",(t,e)=>{ry.init(t,e),$e.init(t,e)});function RM(t,e,r={}){return Ss(pl,t,e,r)}function EM(t){return Ss(pl,"hostname",Or.hostname,t)}function AM(t){return Ss(pl,"hex",Or.hex,t)}function TM(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Or[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Ss(pl,n,i,e)}var ml=S("ZodNumber",(t,e)=>{Hd.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(n,i,a)=>vC(t,n,i,a),t.gt=(n,i)=>t.check(Ln(n,i)),t.gte=(n,i)=>t.check(Ht(n,i)),t.min=(n,i)=>t.check(Ht(n,i)),t.lt=(n,i)=>t.check(Mn(n,i)),t.lte=(n,i)=>t.check(vr(n,i)),t.max=(n,i)=>t.check(vr(n,i)),t.int=n=>t.check(Lv(n)),t.safe=n=>t.check(Lv(n)),t.positive=n=>t.check(Ln(0,n)),t.nonnegative=n=>t.check(Ht(0,n)),t.negative=n=>t.check(Mn(0,n)),t.nonpositive=n=>t.check(vr(0,n)),t.multipleOf=(n,i)=>t.check(ra(n,i)),t.step=(n,i)=>t.check(ra(n,i)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function Se(t){return Qy(ml,t)}var ws=S("ZodNumberFormat",(t,e)=>{ny.init(t,e),ml.init(t,e)});function Lv(t){return tv(ws,t)}function OM(t){return rv(ws,t)}function DM(t){return nv(ws,t)}function $M(t){return iv(ws,t)}function NM(t){return av(ws,t)}var fl=S("ZodBoolean",(t,e)=>{el.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bC(t,r,n,i)});function gt(t){return ov(fl,t)}var gl=S("ZodBigInt",(t,e)=>{Zd.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(n,i,a)=>_C(t,n,i,a),t.gte=(n,i)=>t.check(Ht(n,i)),t.min=(n,i)=>t.check(Ht(n,i)),t.gt=(n,i)=>t.check(Ln(n,i)),t.gte=(n,i)=>t.check(Ht(n,i)),t.min=(n,i)=>t.check(Ht(n,i)),t.lt=(n,i)=>t.check(Mn(n,i)),t.lte=(n,i)=>t.check(vr(n,i)),t.max=(n,i)=>t.check(vr(n,i)),t.positive=n=>t.check(Ln(BigInt(0),n)),t.negative=n=>t.check(Mn(BigInt(0),n)),t.nonpositive=n=>t.check(vr(BigInt(0),n)),t.nonnegative=n=>t.check(Ht(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(ra(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function jM(t){return cv(gl,t)}var rb=S("ZodBigIntFormat",(t,e)=>{iy.init(t,e),gl.init(t,e)});function MM(t){return uv(rb,t)}function LM(t){return dv(rb,t)}var y0=S("ZodSymbol",(t,e)=>{ay.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xC(t,r,n,i)});function zM(t){return pv(y0,t)}var v0=S("ZodUndefined",(t,e)=>{oy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wC(t,r,n,i)});function UM(t){return mv(v0,t)}var b0=S("ZodNull",(t,e)=>{sy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>SC(t,r,n,i)});function hl(t){return fv(b0,t)}var _0=S("ZodAny",(t,e)=>{cy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>CC(t,r,n,i)});function FM(){return gv(_0)}var x0=S("ZodUnknown",(t,e)=>{ly.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kC(t,r,n,i)});function Ne(){return hv(x0)}var S0=S("ZodNever",(t,e)=>{uy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>PC(t,r,n,i)});function nb(t){return yv(S0,t)}var w0=S("ZodVoid",(t,e)=>{dy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>IC(t,r,n,i)});function qM(t){return vv(w0,t)}var Rp=S("ZodDate",(t,e)=>{py.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(n,i,a)=>RC(t,n,i,a),t.min=(n,i)=>t.check(Ht(n,i)),t.max=(n,i)=>t.check(vr(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function BM(t){return bv(Rp,t)}var I0=S("ZodArray",(t,e)=>{my.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>UC(t,r,n,i),t.element=e.element,t.min=(r,n)=>t.check(pi(r,n)),t.nonempty=r=>t.check(pi(1,r)),t.max=(r,n)=>t.check(eo(r,n)),t.length=(r,n)=>t.check(to(r,n)),t.unwrap=()=>t.element});function ae(t,e){return gC(I0,t,e)}function VM(t){let e=t._zod.def.shape;return Gt(Object.keys(e))}var Ep=S("ZodObject",(t,e)=>{fC.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>FC(t,r,n,i),A.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>Gt(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Ne()}),t.loose=()=>t.clone({...t._zod.def,catchall:Ne()}),t.strict=()=>t.clone({...t._zod.def,catchall:nb()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>A.extend(t,r),t.safeExtend=r=>A.safeExtend(t,r),t.merge=r=>A.merge(t,r),t.pick=r=>A.pick(t,r),t.omit=r=>A.omit(t,r),t.partial=(...r)=>A.partial(ab,t,r[0]),t.required=(...r)=>A.required(ob,t,r[0])});function U(t,e){let r={type:"object",shape:t??{},...A.normalizeParams(e)};return new Ep(r)}function WM(t,e){return new Ep({type:"object",shape:t,catchall:nb(),...A.normalizeParams(e)})}function Zt(t,e){return new Ep({type:"object",shape:t,catchall:Ne(),...A.normalizeParams(e)})}var Ap=S("ZodUnion",(t,e)=>{tl.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Av(t,r,n,i),t.options=e.options});function Ae(t,e){return new Ap({type:"union",options:t,...A.normalizeParams(e)})}var P0=S("ZodXor",(t,e)=>{Ap.init(t,e),fy.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Av(t,r,n,i),t.options=e.options});function HM(t,e){return new P0({type:"union",options:t,inclusive:!1,...A.normalizeParams(e)})}var C0=S("ZodDiscriminatedUnion",(t,e)=>{Ap.init(t,e),gy.init(t,e)});function Tp(t,e,r){return new C0({type:"union",options:e,discriminator:t,...A.normalizeParams(r)})}var k0=S("ZodIntersection",(t,e)=>{hy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>qC(t,r,n,i)});function yl(t,e){return new k0({type:"intersection",left:t,right:e})}var R0=S("ZodTuple",(t,e)=>{Gd.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>BC(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function E0(t,e,r){let n=e instanceof K,i=n?r:e,a=n?e:null;return new R0({type:"tuple",items:t,rest:a,...A.normalizeParams(i)})}var Op=S("ZodRecord",(t,e)=>{yy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>VC(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function Fe(t,e,r){return new Op({type:"record",keyType:t,valueType:e,...A.normalizeParams(r)})}function ZM(t,e,r){let n=Wt(t);return n._zod.values=void 0,new Op({type:"record",keyType:n,valueType:e,...A.normalizeParams(r)})}function GM(t,e,r){return new Op({type:"record",keyType:t,valueType:e,mode:"loose",...A.normalizeParams(r)})}var A0=S("ZodMap",(t,e)=>{vy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>LC(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(zn(...r)),t.nonempty=r=>t.check(zn(1,r)),t.max=(...r)=>t.check(na(...r)),t.size=(...r)=>t.check(Qa(...r))});function KM(t,e,r){return new A0({type:"map",keyType:t,valueType:e,...A.normalizeParams(r)})}var T0=S("ZodSet",(t,e)=>{by.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zC(t,r,n,i),t.min=(...r)=>t.check(zn(...r)),t.nonempty=r=>t.check(zn(1,r)),t.max=(...r)=>t.check(na(...r)),t.size=(...r)=>t.check(Qa(...r))});function JM(t,e){return new T0({type:"set",valueType:t,...A.normalizeParams(e)})}var ul=S("ZodEnum",(t,e)=>{_y.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(n,i,a)=>EC(t,n,i,a),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let a={};for(let o of n)if(r.has(o))a[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new ul({...e,checks:[],...A.normalizeParams(i),entries:a})},t.exclude=(n,i)=>{let a={...e.entries};for(let o of n)if(r.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new ul({...e,checks:[],...A.normalizeParams(i),entries:a})}});function Gt(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new ul({type:"enum",entries:r,...A.normalizeParams(e)})}function YM(t,e){return new ul({type:"enum",entries:t,...A.normalizeParams(e)})}var O0=S("ZodLiteral",(t,e)=>{xy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>AC(t,r,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function B(t,e){return new O0({type:"literal",values:Array.isArray(t)?t:[t],...A.normalizeParams(e)})}var D0=S("ZodFile",(t,e)=>{Sy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>DC(t,r,n,i),t.min=(r,n)=>t.check(zn(r,n)),t.max=(r,n)=>t.check(na(r,n)),t.mime=(r,n)=>t.check(ys(Array.isArray(r)?r:[r],n))});function XM(t){return Sv(D0,t)}var $0=S("ZodTransform",(t,e)=>{wy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>MC(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Za(t.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(A.issue(a,r.value,e));else{let o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),r.issues.push(A.issue(o))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r)):(r.value=i,r)}});function ib(t){return new $0({type:"transform",transform:t})}var ab=S("ZodOptional",(t,e)=>{Kd.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Tv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function We(t){return new ab({type:"optional",innerType:t})}var N0=S("ZodExactOptional",(t,e)=>{Iy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Tv(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function j0(t){return new N0({type:"optional",innerType:t})}var M0=S("ZodNullable",(t,e)=>{Py.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>WC(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Pp(t){return new M0({type:"nullable",innerType:t})}function QM(t){return We(Pp(t))}var L0=S("ZodDefault",(t,e)=>{Cy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ZC(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function z0(t,e){return new L0({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():A.shallowClone(e)}})}var U0=S("ZodPrefault",(t,e)=>{ky.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>GC(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function F0(t,e){return new U0({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():A.shallowClone(e)}})}var ob=S("ZodNonOptional",(t,e)=>{Ry.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>HC(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function q0(t,e){return new ob({type:"nonoptional",innerType:t,...A.normalizeParams(e)})}var B0=S("ZodSuccess",(t,e)=>{Ey.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$C(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function eL(t){return new B0({type:"success",innerType:t})}var V0=S("ZodCatch",(t,e)=>{Ay.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KC(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function W0(t,e){return new V0({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var H0=S("ZodNaN",(t,e)=>{Ty.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>TC(t,r,n,i)});function tL(t){return xv(H0,t)}var sb=S("ZodPipe",(t,e)=>{Oy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>JC(t,r,n,i),t.in=e.in,t.out=e.out});function Cp(t,e){return new sb({type:"pipe",in:t,out:e})}var cb=S("ZodCodec",(t,e)=>{sb.init(t,e),rl.init(t,e)});function rL(t,e,r){return new cb({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}var Z0=S("ZodReadonly",(t,e)=>{Dy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>YC(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function G0(t){return new Z0({type:"readonly",innerType:t})}var K0=S("ZodTemplateLiteral",(t,e)=>{$y.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OC(t,r,n,i)});function nL(t,e){return new K0({type:"template_literal",parts:t,...A.normalizeParams(e)})}var J0=S("ZodLazy",(t,e)=>{My.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>QC(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});function Y0(t){return new J0({type:"lazy",getter:t})}var X0=S("ZodPromise",(t,e)=>{jy.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>XC(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function iL(t){return new X0({type:"promise",innerType:t})}var Q0=S("ZodFunction",(t,e)=>{Ny.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>jC(t,r,n,i)});function aL(t){return new Q0({type:"function",input:Array.isArray(t?.input)?E0(t?.input):t?.input??ae(Ne()),output:t?.output??Ne()})}var Dp=S("ZodCustom",(t,e)=>{Ly.init(t,e),Q.init(t,e),t._zod.processJSONSchema=(r,n,i)=>NC(t,r,n,i)});function oL(t){let e=new De({check:"custom"});return e._zod.check=t,e}function lb(t,e){return wv(Dp,t??(()=>!0),e)}function ek(t,e={}){return Iv(Dp,t,e)}function tk(t){return Pv(t)}var sL=Cv,cL=kv;function lL(t,e={}){let r=new Dp({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...A.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var uL=(...t)=>Rv({Codec:cb,Boolean:fl,String:dl},...t);function dL(t){let e=Y0(()=>Ae([P(t),Se(),gt(),hl(),ae(e),Fe(P(),e)]));return e}function $p(t,e){return Cp(ib(t),e)}var aee={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 oee(t){st({customError:t})}function see(){return st().customError}var rk;rk||(rk={});var j={...wp,...Dv,iso:ao},cee=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 lee(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function uee(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${t}`);return e.defs[i]}throw new Error(`Reference not found: ${t}`)}function pL(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return j.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let i=t.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return j.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let a=uee(i,e),o=ir(a,e);return e.refs.set(i,o),e.processing.delete(i),o}if(t.enum!==void 0){let i=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&i.length===1&&i[0]===null)return j.null();if(i.length===0)return j.never();if(i.length===1)return j.literal(i[0]);if(i.every(o=>typeof o=="string"))return j.enum(i);let a=i.map(o=>j.literal(o));return a.length<2?a[0]:j.union([a[0],a[1],...a.slice(2)])}if(t.const!==void 0)return j.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(a=>{let o={...t,type:a};return pL(o,e)});return i.length===0?j.never():i.length===1?i[0]:j.union(i)}if(!r)return j.any();let n;switch(r){case"string":{let i=j.string();if(t.format){let a=t.format;a==="email"?i=i.check(j.email()):a==="uri"||a==="uri-reference"?i=i.check(j.url()):a==="uuid"||a==="guid"?i=i.check(j.uuid()):a==="date-time"?i=i.check(j.iso.datetime()):a==="date"?i=i.check(j.iso.date()):a==="time"?i=i.check(j.iso.time()):a==="duration"?i=i.check(j.iso.duration()):a==="ipv4"?i=i.check(j.ipv4()):a==="ipv6"?i=i.check(j.ipv6()):a==="mac"?i=i.check(j.mac()):a==="cidr"?i=i.check(j.cidrv4()):a==="cidr-v6"?i=i.check(j.cidrv6()):a==="base64"?i=i.check(j.base64()):a==="base64url"?i=i.check(j.base64url()):a==="e164"?i=i.check(j.e164()):a==="jwt"?i=i.check(j.jwt()):a==="emoji"?i=i.check(j.emoji()):a==="nanoid"?i=i.check(j.nanoid()):a==="cuid"?i=i.check(j.cuid()):a==="cuid2"?i=i.check(j.cuid2()):a==="ulid"?i=i.check(j.ulid()):a==="xid"?i=i.check(j.xid()):a==="ksuid"&&(i=i.check(j.ksuid()))}typeof t.minLength=="number"&&(i=i.min(t.minLength)),typeof t.maxLength=="number"&&(i=i.max(t.maxLength)),t.pattern&&(i=i.regex(new RegExp(t.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?j.number().int():j.number();typeof t.minimum=="number"&&(i=i.min(t.minimum)),typeof t.maximum=="number"&&(i=i.max(t.maximum)),typeof t.exclusiveMinimum=="number"?i=i.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(i=i.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?i=i.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(i=i.lt(t.maximum)),typeof t.multipleOf=="number"&&(i=i.multipleOf(t.multipleOf)),n=i;break}case"boolean":{n=j.boolean();break}case"null":{n=j.null();break}case"object":{let i={},a=t.properties||{},o=new Set(t.required||[]);for(let[c,l]of Object.entries(a)){let u=ir(l,e);i[c]=o.has(c)?u:u.optional()}if(t.propertyNames){let c=ir(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?ir(t.additionalProperties,e):j.any();if(Object.keys(i).length===0){n=j.record(c,l);break}let u=j.object(i).passthrough(),d=j.looseRecord(c,l);n=j.intersection(u,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),u=[];for(let p of l){let m=ir(c[p],e),f=j.string().regex(new RegExp(p));u.push(j.looseRecord(f,m))}let d=[];if(Object.keys(i).length>0&&d.push(j.object(i).passthrough()),d.push(...u),d.length===0)n=j.object({}).passthrough();else if(d.length===1)n=d[0];else{let p=j.intersection(d[0],d[1]);for(let m=2;m<d.length;m++)p=j.intersection(p,d[m]);n=p}break}let s=j.object(i);t.additionalProperties===!1?n=s.strict():typeof t.additionalProperties=="object"?n=s.catchall(ir(t.additionalProperties,e)):n=s.passthrough();break}case"array":{let i=t.prefixItems,a=t.items;if(i&&Array.isArray(i)){let o=i.map(c=>ir(c,e)),s=a&&typeof a=="object"&&!Array.isArray(a)?ir(a,e):void 0;s?n=j.tuple(o).rest(s):n=j.tuple(o),typeof t.minItems=="number"&&(n=n.check(j.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(j.maxLength(t.maxItems)))}else if(Array.isArray(a)){let o=a.map(c=>ir(c,e)),s=t.additionalItems&&typeof t.additionalItems=="object"?ir(t.additionalItems,e):void 0;s?n=j.tuple(o).rest(s):n=j.tuple(o),typeof t.minItems=="number"&&(n=n.check(j.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(j.maxLength(t.maxItems)))}else if(a!==void 0){let o=ir(a,e),s=j.array(o);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),n=s}else n=j.array(j.any());break}default:throw new Error(`Unsupported type: ${r}`)}return t.description&&(n=n.describe(t.description)),t.default!==void 0&&(n=n.default(t.default)),n}function ir(t,e){if(typeof t=="boolean")return t?j.any():j.never();let r=pL(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let s=t.anyOf.map(l=>ir(l,e)),c=j.union(s);r=n?j.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(l=>ir(l,e)),c=j.xor(s);r=n?j.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:j.any();else{let s=n?r:ir(t.allOf[0],e),c=n?0:1;for(let l=c;l<t.allOf.length;l++)s=j.intersection(s,ir(t.allOf[l],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=j.nullable(r)),t.readOnly===!0&&(r=j.readonly(r));let i={},a=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of a)s in t&&(i[s]=t[s]);let o=["contentEncoding","contentMediaType","contentSchema"];for(let s of o)s in t&&(i[s]=t[s]);for(let s of Object.keys(t))cee.has(s)||(i[s]=t[s]);return Object.keys(i).length>0&&e.registry.add(r,i),r}function mL(t,e){if(typeof t=="boolean")return t?j.any():j.never();let r=lee(t,e?.defaultTarget),n=t.$defs||t.definitions||{},i={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:t,registry:e?.registry??Tt};return ir(t,i)}var nk={};hr(nk,{bigint:()=>fee,boolean:()=>mee,date:()=>gee,number:()=>pee,string:()=>dee});function dee(t){return Hy(dl,t)}function pee(t){return ev(ml,t)}function mee(t){return sv(fl,t)}function fee(t){return lv(gl,t)}function gee(t){return _v(Rp,t)}st(zy());var ak="2025-11-25";var fL=[ak,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],oo="io.modelcontextprotocol/related-task",db="2.0",Kt=lb(t=>t!==null&&(typeof t=="object"||typeof t=="function")),gL=Ae([P(),Se().int()]),hL=P(),wje=Zt({ttl:Ae([Se(),hl()]).optional(),pollInterval:Se().optional()}),yee=U({ttl:Se().optional()}),vee=U({taskId:P()}),ok=Zt({progressToken:gL.optional(),[oo]:vee.optional()}),en=U({_meta:ok.optional()}),Np=en.extend({task:yee.optional()}),yL=t=>Np.safeParse(t).success,Jt=U({method:P(),params:en.loose().optional()}),gn=U({_meta:ok.optional()}),hn=U({method:P(),params:gn.loose().optional()}),Yt=Zt({_meta:ok.optional()}),pb=Ae([P(),Se().int()]),vL=U({jsonrpc:B(db),id:pb,...Jt.shape}).strict(),sk=t=>vL.safeParse(t).success,bL=U({jsonrpc:B(db),...hn.shape}).strict(),_L=t=>bL.safeParse(t).success,ck=U({jsonrpc:B(db),id:pb,result:Yt}).strict(),jp=t=>ck.safeParse(t).success;var me;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(me||(me={}));var lk=U({jsonrpc:B(db),id:pb.optional(),error:U({code:Se().int(),message:P(),data:Ne().optional()})}).strict();var xL=t=>lk.safeParse(t).success;var SL=Ae([vL,bL,ck,lk]),Ije=Ae([ck,lk]),mb=Yt.strict(),bee=gn.extend({requestId:pb.optional(),reason:P().optional()}),fb=hn.extend({method:B("notifications/cancelled"),params:bee}),_ee=U({src:P(),mimeType:P().optional(),sizes:ae(P()).optional(),theme:Gt(["light","dark"]).optional()}),Mp=U({icons:ae(_ee).optional()}),vl=U({name:P(),title:P().optional()}),wL=vl.extend({...vl.shape,...Mp.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),xee=yl(U({applyDefaults:gt().optional()}),Fe(P(),Ne())),See=$p(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,yl(U({form:xee.optional(),url:Kt.optional()}),Fe(P(),Ne()).optional())),wee=Zt({list:Kt.optional(),cancel:Kt.optional(),requests:Zt({sampling:Zt({createMessage:Kt.optional()}).optional(),elicitation:Zt({create:Kt.optional()}).optional()}).optional()}),Iee=Zt({list:Kt.optional(),cancel:Kt.optional(),requests:Zt({tools:Zt({call:Kt.optional()}).optional()}).optional()}),Pee=U({experimental:Fe(P(),Kt).optional(),sampling:U({context:Kt.optional(),tools:Kt.optional()}).optional(),elicitation:See.optional(),roots:U({listChanged:gt().optional()}).optional(),tasks:wee.optional()}),Cee=en.extend({protocolVersion:P(),capabilities:Pee,clientInfo:wL}),uk=Jt.extend({method:B("initialize"),params:Cee});var kee=U({experimental:Fe(P(),Kt).optional(),logging:Kt.optional(),completions:Kt.optional(),prompts:U({listChanged:gt().optional()}).optional(),resources:U({subscribe:gt().optional(),listChanged:gt().optional()}).optional(),tools:U({listChanged:gt().optional()}).optional(),tasks:Iee.optional()}),Ree=Yt.extend({protocolVersion:P(),capabilities:kee,serverInfo:wL,instructions:P().optional()}),dk=hn.extend({method:B("notifications/initialized"),params:gn.optional()});var gb=Jt.extend({method:B("ping"),params:en.optional()}),Eee=U({progress:Se(),total:We(Se()),message:We(P())}),Aee=U({...gn.shape,...Eee.shape,progressToken:gL}),hb=hn.extend({method:B("notifications/progress"),params:Aee}),Tee=en.extend({cursor:hL.optional()}),Lp=Jt.extend({params:Tee.optional()}),zp=Yt.extend({nextCursor:hL.optional()}),Oee=Gt(["working","input_required","completed","failed","cancelled"]),Up=U({taskId:P(),status:Oee,ttl:Ae([Se(),hl()]),createdAt:P(),lastUpdatedAt:P(),pollInterval:We(Se()),statusMessage:We(P())}),bl=Yt.extend({task:Up}),Dee=gn.merge(Up),Fp=hn.extend({method:B("notifications/tasks/status"),params:Dee}),yb=Jt.extend({method:B("tasks/get"),params:en.extend({taskId:P()})}),vb=Yt.merge(Up),bb=Jt.extend({method:B("tasks/result"),params:en.extend({taskId:P()})}),Pje=Yt.loose(),_b=Lp.extend({method:B("tasks/list")}),xb=zp.extend({tasks:ae(Up)}),Sb=Jt.extend({method:B("tasks/cancel"),params:en.extend({taskId:P()})}),IL=Yt.merge(Up),PL=U({uri:P(),mimeType:We(P()),_meta:Fe(P(),Ne()).optional()}),CL=PL.extend({text:P()}),pk=P().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),kL=PL.extend({blob:pk}),qp=Gt(["user","assistant"]),_l=U({audience:ae(qp).optional(),priority:Se().min(0).max(1).optional(),lastModified:ao.datetime({offset:!0}).optional()}),RL=U({...vl.shape,...Mp.shape,uri:P(),description:We(P()),mimeType:We(P()),annotations:_l.optional(),_meta:We(Zt({}))}),$ee=U({...vl.shape,...Mp.shape,uriTemplate:P(),description:We(P()),mimeType:We(P()),annotations:_l.optional(),_meta:We(Zt({}))}),mk=Lp.extend({method:B("resources/list")}),Nee=zp.extend({resources:ae(RL)}),jee=Lp.extend({method:B("resources/templates/list")}),Mee=zp.extend({resourceTemplates:ae($ee)}),fk=en.extend({uri:P()}),Lee=fk,gk=Jt.extend({method:B("resources/read"),params:Lee}),zee=Yt.extend({contents:ae(Ae([CL,kL]))}),Uee=hn.extend({method:B("notifications/resources/list_changed"),params:gn.optional()}),Fee=fk,qee=Jt.extend({method:B("resources/subscribe"),params:Fee}),Bee=fk,Vee=Jt.extend({method:B("resources/unsubscribe"),params:Bee}),Wee=gn.extend({uri:P()}),Hee=hn.extend({method:B("notifications/resources/updated"),params:Wee}),Zee=U({name:P(),description:We(P()),required:We(gt())}),Gee=U({...vl.shape,...Mp.shape,description:We(P()),arguments:We(ae(Zee)),_meta:We(Zt({}))}),Kee=Lp.extend({method:B("prompts/list")}),Jee=zp.extend({prompts:ae(Gee)}),Yee=en.extend({name:P(),arguments:Fe(P(),P()).optional()}),Xee=Jt.extend({method:B("prompts/get"),params:Yee}),hk=U({type:B("text"),text:P(),annotations:_l.optional(),_meta:Fe(P(),Ne()).optional()}),yk=U({type:B("image"),data:pk,mimeType:P(),annotations:_l.optional(),_meta:Fe(P(),Ne()).optional()}),vk=U({type:B("audio"),data:pk,mimeType:P(),annotations:_l.optional(),_meta:Fe(P(),Ne()).optional()}),Qee=U({type:B("tool_use"),name:P(),id:P(),input:Fe(P(),Ne()),_meta:Fe(P(),Ne()).optional()}),ete=U({type:B("resource"),resource:Ae([CL,kL]),annotations:_l.optional(),_meta:Fe(P(),Ne()).optional()}),tte=RL.extend({type:B("resource_link")}),bk=Ae([hk,yk,vk,tte,ete]),rte=U({role:qp,content:bk}),nte=Yt.extend({description:P().optional(),messages:ae(rte)}),ite=hn.extend({method:B("notifications/prompts/list_changed"),params:gn.optional()}),ate=U({title:P().optional(),readOnlyHint:gt().optional(),destructiveHint:gt().optional(),idempotentHint:gt().optional(),openWorldHint:gt().optional()}),ote=U({taskSupport:Gt(["required","optional","forbidden"]).optional()}),EL=U({...vl.shape,...Mp.shape,description:P().optional(),inputSchema:U({type:B("object"),properties:Fe(P(),Kt).optional(),required:ae(P()).optional()}).catchall(Ne()),outputSchema:U({type:B("object"),properties:Fe(P(),Kt).optional(),required:ae(P()).optional()}).catchall(Ne()).optional(),annotations:ate.optional(),execution:ote.optional(),_meta:Fe(P(),Ne()).optional()}),_k=Lp.extend({method:B("tools/list")}),ste=zp.extend({tools:ae(EL)}),wb=Yt.extend({content:ae(bk).default([]),structuredContent:Fe(P(),Ne()).optional(),isError:gt().optional()}),Cje=wb.or(Yt.extend({toolResult:Ne()})),cte=Np.extend({name:P(),arguments:Fe(P(),Ne()).optional()}),Bp=Jt.extend({method:B("tools/call"),params:cte}),lte=hn.extend({method:B("notifications/tools/list_changed"),params:gn.optional()}),kje=U({autoRefresh:gt().default(!0),debounceMs:Se().int().nonnegative().default(300)}),Vp=Gt(["debug","info","notice","warning","error","critical","alert","emergency"]),ute=en.extend({level:Vp}),xk=Jt.extend({method:B("logging/setLevel"),params:ute}),dte=gn.extend({level:Vp,logger:P().optional(),data:Ne()}),pte=hn.extend({method:B("notifications/message"),params:dte}),mte=U({name:P().optional()}),fte=U({hints:ae(mte).optional(),costPriority:Se().min(0).max(1).optional(),speedPriority:Se().min(0).max(1).optional(),intelligencePriority:Se().min(0).max(1).optional()}),gte=U({mode:Gt(["auto","required","none"]).optional()}),hte=U({type:B("tool_result"),toolUseId:P().describe("The unique identifier for the corresponding tool call."),content:ae(bk).default([]),structuredContent:U({}).loose().optional(),isError:gt().optional(),_meta:Fe(P(),Ne()).optional()}),yte=Tp("type",[hk,yk,vk]),ub=Tp("type",[hk,yk,vk,Qee,hte]),vte=U({role:qp,content:Ae([ub,ae(ub)]),_meta:Fe(P(),Ne()).optional()}),bte=Np.extend({messages:ae(vte),modelPreferences:fte.optional(),systemPrompt:P().optional(),includeContext:Gt(["none","thisServer","allServers"]).optional(),temperature:Se().optional(),maxTokens:Se().int(),stopSequences:ae(P()).optional(),metadata:Kt.optional(),tools:ae(EL).optional(),toolChoice:gte.optional()}),_te=Jt.extend({method:B("sampling/createMessage"),params:bte}),Sk=Yt.extend({model:P(),stopReason:We(Gt(["endTurn","stopSequence","maxTokens"]).or(P())),role:qp,content:yte}),wk=Yt.extend({model:P(),stopReason:We(Gt(["endTurn","stopSequence","maxTokens","toolUse"]).or(P())),role:qp,content:Ae([ub,ae(ub)])}),xte=U({type:B("boolean"),title:P().optional(),description:P().optional(),default:gt().optional()}),Ste=U({type:B("string"),title:P().optional(),description:P().optional(),minLength:Se().optional(),maxLength:Se().optional(),format:Gt(["email","uri","date","date-time"]).optional(),default:P().optional()}),wte=U({type:Gt(["number","integer"]),title:P().optional(),description:P().optional(),minimum:Se().optional(),maximum:Se().optional(),default:Se().optional()}),Ite=U({type:B("string"),title:P().optional(),description:P().optional(),enum:ae(P()),default:P().optional()}),Pte=U({type:B("string"),title:P().optional(),description:P().optional(),oneOf:ae(U({const:P(),title:P()})),default:P().optional()}),Cte=U({type:B("string"),title:P().optional(),description:P().optional(),enum:ae(P()),enumNames:ae(P()).optional(),default:P().optional()}),kte=Ae([Ite,Pte]),Rte=U({type:B("array"),title:P().optional(),description:P().optional(),minItems:Se().optional(),maxItems:Se().optional(),items:U({type:B("string"),enum:ae(P())}),default:ae(P()).optional()}),Ete=U({type:B("array"),title:P().optional(),description:P().optional(),minItems:Se().optional(),maxItems:Se().optional(),items:U({anyOf:ae(U({const:P(),title:P()}))}),default:ae(P()).optional()}),Ate=Ae([Rte,Ete]),Tte=Ae([Cte,kte,Ate]),Ote=Ae([Tte,xte,Ste,wte]),Dte=Np.extend({mode:B("form").optional(),message:P(),requestedSchema:U({type:B("object"),properties:Fe(P(),Ote),required:ae(P()).optional()})}),$te=Np.extend({mode:B("url"),message:P(),elicitationId:P(),url:P().url()}),Nte=Ae([Dte,$te]),jte=Jt.extend({method:B("elicitation/create"),params:Nte}),Mte=gn.extend({elicitationId:P()}),Lte=hn.extend({method:B("notifications/elicitation/complete"),params:Mte}),Ib=Yt.extend({action:Gt(["accept","decline","cancel"]),content:$p(t=>t===null?void 0:t,Fe(P(),Ae([P(),Se(),gt(),ae(P())])).optional())}),zte=U({type:B("ref/resource"),uri:P()});var Ute=U({type:B("ref/prompt"),name:P()}),Fte=en.extend({ref:Ae([Ute,zte]),argument:U({name:P(),value:P()}),context:U({arguments:Fe(P(),P()).optional()}).optional()}),qte=Jt.extend({method:B("completion/complete"),params:Fte});var Bte=Yt.extend({completion:Zt({values:ae(P()).max(100),total:We(Se().int()),hasMore:We(gt())})}),Vte=U({uri:P().startsWith("file://"),name:P().optional(),_meta:Fe(P(),Ne()).optional()}),Wte=Jt.extend({method:B("roots/list"),params:en.optional()}),Ik=Yt.extend({roots:ae(Vte)}),Hte=hn.extend({method:B("notifications/roots/list_changed"),params:gn.optional()}),Rje=Ae([gb,uk,qte,xk,Xee,Kee,mk,jee,gk,qee,Vee,Bp,_k,yb,bb,_b,Sb]),Eje=Ae([fb,hb,dk,Hte,Fp]),Aje=Ae([mb,Sk,wk,Ib,Ik,vb,xb,bl]),Tje=Ae([gb,_te,jte,Wte,yb,bb,_b,Sb]),Oje=Ae([fb,hb,pte,Hee,Uee,lte,ite,Fp,Lte]),Dje=Ae([mb,Ree,Bte,nte,Jee,Nee,Mee,zee,wb,ste,vb,xb,bl]),ne=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===me.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new ik(i.elicitations,r)}return new t(e,r,n)}},ik=class extends ne{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(me.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var Pb=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
244
244
|
`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),Zte(r)}clear(){this._buffer=void 0}};function Zte(t){return SL.parse(JSON.parse(t))}function AL(t){return JSON.stringify(t)+`
|
|
245
|
-
`}var Cb=class{constructor(e=TL.stdin,r=TL.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new Pb,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(r=>{let n=AL(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var kb=class{startPromise=null;stopPromise=null;start(e){return this.startPromise??=e(),this.startPromise}stop(e){return this.stopPromise??=(async()=>{this.startPromise&&await this.startPromise.catch(()=>{}),await e()})(),this.stopPromise}};var pe;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let a={};for(let o of i)a[o]=o;return a},t.getValidEnumValues=i=>{let a=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(let s of a)o[s]=i[s];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},t.find=(i,a)=>{for(let o of i)if(a(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(pe||(pe={}));var OL;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(OL||(OL={}));var F=pe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ia=t=>{switch(typeof t){case"undefined":return F.undefined;case"string":return F.string;case"number":return Number.isNaN(t)?F.nan:F.number;case"boolean":return F.boolean;case"function":return F.function;case"bigint":return F.bigint;case"symbol":return F.symbol;case"object":return Array.isArray(t)?F.array:t===null?F.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?F.promise:typeof Map<"u"&&t instanceof Map?F.map:typeof Set<"u"&&t instanceof Set?F.set:typeof Date<"u"&&t instanceof Date?F.date:F.object;default:return F.unknown}};var T=pe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var tn=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(a){return a.message},n={_errors:[]},i=a=>{for(let o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,c=0;for(;c<o.path.length;){let l=o.path[c];c===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(r(o))):s[l]=s[l]||{_errors:[]},s=s[l],c++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,pe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r=Object.create(null),n=[];for(let i of this.issues)if(i.path.length>0){let a=i.path[0];r[a]=r[a]||[],r[a].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};tn.create=t=>new tn(t);var Gte=(t,e)=>{let r;switch(t.code){case T.invalid_type:t.received===F.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case T.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,pe.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:r=`Unrecognized key(s) in object: ${pe.joinValues(t.keys,", ")}`;break;case T.invalid_union:r="Invalid input";break;case T.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${pe.joinValues(t.options)}`;break;case T.invalid_enum_value:r=`Invalid enum value. Expected ${pe.joinValues(t.options)}, received '${t.received}'`;break;case T.invalid_arguments:r="Invalid function arguments";break;case T.invalid_return_type:r="Invalid function return type";break;case T.invalid_date:r="Invalid date";break;case T.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:pe.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case T.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case T.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case T.custom:r="Invalid input";break;case T.invalid_intersection_types:r="Intersection results could not be merged";break;case T.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case T.not_finite:r="Number must be finite";break;default:r=e.defaultError,pe.assertNever(t)}return{message:r}},so=Gte;var Kte=so;function Wp(){return Kte}var Rb=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="",c=n.filter(l=>!!l).slice().reverse();for(let l of c)s=l(o,{data:e,defaultError:s}).message;return{...i,path:a,message:s}};function M(t,e){let r=Wp(),n=Rb({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===so?void 0:so].filter(i=>!!i)});t.common.issues.push(n)}var ar=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return G;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let a=await i.key,o=await i.value;n.push({key:a,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return G;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:e.value,value:n}}},G=Object.freeze({status:"aborted"}),xl=t=>({status:"dirty",value:t}),_r=t=>({status:"valid",value:t}),Pk=t=>t.status==="aborted",Ck=t=>t.status==="dirty",Is=t=>t.status==="valid",Hp=t=>typeof Promise<"u"&&t instanceof Promise;var q;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(q||(q={}));var yn=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},DL=(t,e)=>{if(Is(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new tn(t.common.issues);return this._error=r,this._error}}};function ee(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,s)=>{let{message:c}=t;return o.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:i}}var oe=class{get description(){return this._def.description}_getType(e){return ia(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ia(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ar,ctx:{common:e.parent.common,data:e.data,parsedType:ia(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Hp(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ia(e)},i=this._parseSync({data:e,path:n.path,parent:n});return DL(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ia(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Is(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Is(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ia(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(Hp(i)?i:Promise.resolve(i));return DL(n,a)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{let o=e(i),s=()=>a.addIssue({code:T.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Fn({schema:this,typeName:H.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Un.create(this,this._def)}nullable(){return sa.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return lo.create(this)}promise(){return Ps.create(this,this._def)}or(e){return Cl.create([this,e],this._def)}and(e){return kl.create(this,e,this._def)}transform(e){return new Fn({...ee(this._def),schema:this,typeName:H.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ol({...ee(this._def),innerType:this,defaultValue:r,typeName:H.ZodDefault})}brand(){return new Eb({typeName:H.ZodBranded,type:this,...ee(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Dl({...ee(this._def),innerType:this,catchValue:r,typeName:H.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ab.create(this,e)}readonly(){return $l.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Jte=/^c[^\s-]{8,}$/i,Yte=/^[0-9a-z]+$/,Xte=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qte=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ere=/^[a-z0-9_-]{21}$/i,tre=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rre=/^[-+]?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)?)??$/,nre=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ire="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",kk,are=/^(?:(?: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])$/,ore=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,sre=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,cre=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lre=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ure=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$L="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dre=new RegExp(`^${$L}$`);function NL(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function pre(t){return new RegExp(`^${NL(t)}$`)}function mre(t){let e=`${$L}T${NL(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function fre(t,e){return!!((e==="v4"||!e)&&are.test(t)||(e==="v6"||!e)&&sre.test(t))}function gre(t,e){if(!tre.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function hre(t,e){return!!((e==="v4"||!e)&&ore.test(t)||(e==="v6"||!e)&&cre.test(t))}var wl=class t extends oe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==F.string){let a=this._getOrReturnCtx(e);return M(a,{code:T.invalid_type,expected:F.string,received:a.parsedType}),G}let n=new ar,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),M(i,{code:T.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),M(i,{code:T.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let o=e.data.length>a.value,s=e.data.length<a.value;(o||s)&&(i=this._getOrReturnCtx(e,i),o?M(i,{code:T.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&M(i,{code:T.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")nre.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"email",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")kk||(kk=new RegExp(ire,"u")),kk.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"emoji",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Qte.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"uuid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")ere.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"nanoid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Jte.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"cuid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Yte.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"cuid2",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Xte.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"ulid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),M(i,{validation:"url",code:T.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"regex",code:T.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),M(i,{code:T.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),M(i,{code:T.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),M(i,{code:T.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?mre(a).test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{code:T.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?dre.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{code:T.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?pre(a).test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{code:T.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?rre.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"duration",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?fre(e.data,a.version)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"ip",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?gre(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"jwt",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?hre(e.data,a.version)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"cidr",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?lre.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"base64",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?ure.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"base64url",code:T.invalid_string,message:a.message}),n.dirty()):pe.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:T.invalid_string,...q.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...q.errToObj(e)})}url(e){return this._addCheck({kind:"url",...q.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...q.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...q.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...q.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...q.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...q.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...q.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...q.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...q.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...q.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...q.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...q.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...q.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...q.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...q.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...q.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...q.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...q.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...q.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...q.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...q.errToObj(r)})}nonempty(e){return this.min(1,q.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};wl.create=t=>new wl({checks:[],typeName:H.ZodString,coerce:t?.coerce??!1,...ee(t)});function yre(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return a%o/10**i}var Zp=class t extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==F.number){let a=this._getOrReturnCtx(e);return M(a,{code:T.invalid_type,expected:F.number,received:a.parsedType}),G}let n,i=new ar;for(let a of this._def.checks)a.kind==="int"?pe.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),M(n,{code:T.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),M(n,{code:T.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),M(n,{code:T.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?yre(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),M(n,{code:T.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),M(n,{code:T.not_finite,message:a.message}),i.dirty()):pe.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:q.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:q.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:q.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:q.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:q.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&pe.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Zp.create=t=>new Zp({checks:[],typeName:H.ZodNumber,coerce:t?.coerce||!1,...ee(t)});var Gp=class t extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==F.bigint)return this._getInvalidInput(e);let n,i=new ar;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),M(n,{code:T.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),M(n,{code:T.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),M(n,{code:T.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):pe.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return M(r,{code:T.invalid_type,expected:F.bigint,received:r.parsedType}),G}gte(e,r){return this.setLimit("min",e,!0,q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:q.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Gp.create=t=>new Gp({checks:[],typeName:H.ZodBigInt,coerce:t?.coerce??!1,...ee(t)});var Kp=class extends oe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==F.boolean){let n=this._getOrReturnCtx(e);return M(n,{code:T.invalid_type,expected:F.boolean,received:n.parsedType}),G}return _r(e.data)}};Kp.create=t=>new Kp({typeName:H.ZodBoolean,coerce:t?.coerce||!1,...ee(t)});var Jp=class t extends oe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==F.date){let a=this._getOrReturnCtx(e);return M(a,{code:T.invalid_type,expected:F.date,received:a.parsedType}),G}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return M(a,{code:T.invalid_date}),G}let n=new ar,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),M(i,{code:T.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),M(i,{code:T.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):pe.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:q.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:q.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Jp.create=t=>new Jp({checks:[],coerce:t?.coerce||!1,typeName:H.ZodDate,...ee(t)});var Yp=class extends oe{_parse(e){if(this._getType(e)!==F.symbol){let n=this._getOrReturnCtx(e);return M(n,{code:T.invalid_type,expected:F.symbol,received:n.parsedType}),G}return _r(e.data)}};Yp.create=t=>new Yp({typeName:H.ZodSymbol,...ee(t)});var Il=class extends oe{_parse(e){if(this._getType(e)!==F.undefined){let n=this._getOrReturnCtx(e);return M(n,{code:T.invalid_type,expected:F.undefined,received:n.parsedType}),G}return _r(e.data)}};Il.create=t=>new Il({typeName:H.ZodUndefined,...ee(t)});var Pl=class extends oe{_parse(e){if(this._getType(e)!==F.null){let n=this._getOrReturnCtx(e);return M(n,{code:T.invalid_type,expected:F.null,received:n.parsedType}),G}return _r(e.data)}};Pl.create=t=>new Pl({typeName:H.ZodNull,...ee(t)});var Xp=class extends oe{constructor(){super(...arguments),this._any=!0}_parse(e){return _r(e.data)}};Xp.create=t=>new Xp({typeName:H.ZodAny,...ee(t)});var co=class extends oe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _r(e.data)}};co.create=t=>new co({typeName:H.ZodUnknown,...ee(t)});var fi=class extends oe{_parse(e){let r=this._getOrReturnCtx(e);return M(r,{code:T.invalid_type,expected:F.never,received:r.parsedType}),G}};fi.create=t=>new fi({typeName:H.ZodNever,...ee(t)});var Qp=class extends oe{_parse(e){if(this._getType(e)!==F.undefined){let n=this._getOrReturnCtx(e);return M(n,{code:T.invalid_type,expected:F.void,received:n.parsedType}),G}return _r(e.data)}};Qp.create=t=>new Qp({typeName:H.ZodVoid,...ee(t)});var lo=class t extends oe{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==F.array)return M(r,{code:T.invalid_type,expected:F.array,received:r.parsedType}),G;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(o||s)&&(M(r,{code:o?T.too_big:T.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(M(r,{code:T.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(M(r,{code:T.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>i.type._parseAsync(new yn(r,o,r.path,s)))).then(o=>ar.mergeArray(n,o));let a=[...r.data].map((o,s)=>i.type._parseSync(new yn(r,o,r.path,s)));return ar.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:q.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:q.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:q.toString(r)}})}nonempty(e){return this.min(1,e)}};lo.create=(t,e)=>new lo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:H.ZodArray,...ee(e)});function Sl(t){if(t instanceof rn){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Un.create(Sl(n))}return new rn({...t._def,shape:()=>e})}else return t instanceof lo?new lo({...t._def,type:Sl(t.element)}):t instanceof Un?Un.create(Sl(t.unwrap())):t instanceof sa?sa.create(Sl(t.unwrap())):t instanceof oa?oa.create(t.items.map(e=>Sl(e))):t}var rn=class t extends oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=pe.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==F.object){let l=this._getOrReturnCtx(e);return M(l,{code:T.invalid_type,expected:F.object,received:l.parsedType}),G}let{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof fi&&this._def.unknownKeys==="strip"))for(let l in i.data)o.includes(l)||s.push(l);let c=[];for(let l of o){let u=a[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new yn(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof fi){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of s)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")s.length>0&&(M(i,{code:T.unrecognized_keys,keys:s}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of s){let d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new yn(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,p=await u.value;l.push({key:d,value:p,alwaysSet:u.alwaysSet})}return l}).then(l=>ar.mergeObjectSync(n,l)):ar.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return q.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:q.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:H.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of pe.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of pe.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Sl(this)}partial(e){let r={};for(let n of pe.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of pe.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Un;)a=a._def.innerType;r[n]=a}return new t({...this._def,shape:()=>r})}keyof(){return jL(pe.objectKeys(this.shape))}};rn.create=(t,e)=>new rn({shape:()=>t,unknownKeys:"strip",catchall:fi.create(),typeName:H.ZodObject,...ee(e)});rn.strictCreate=(t,e)=>new rn({shape:()=>t,unknownKeys:"strict",catchall:fi.create(),typeName:H.ZodObject,...ee(e)});rn.lazycreate=(t,e)=>new rn({shape:t,unknownKeys:"strip",catchall:fi.create(),typeName:H.ZodObject,...ee(e)});var Cl=class extends oe{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(a){for(let s of a)if(s.result.status==="valid")return s.result;for(let s of a)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let o=a.map(s=>new tn(s.ctx.common.issues));return M(r,{code:T.invalid_union,unionErrors:o}),G}if(r.common.async)return Promise.all(n.map(async a=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a,o=[];for(let c of n){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(c=>new tn(c));return M(r,{code:T.invalid_union,unionErrors:s}),G}}get options(){return this._def.options}};Cl.create=(t,e)=>new Cl({options:t,typeName:H.ZodUnion,...ee(e)});var aa=t=>t instanceof Rl?aa(t.schema):t instanceof Fn?aa(t.innerType()):t instanceof El?[t.value]:t instanceof Al?t.options:t instanceof Tl?pe.objectValues(t.enum):t instanceof Ol?aa(t._def.innerType):t instanceof Il?[void 0]:t instanceof Pl?[null]:t instanceof Un?[void 0,...aa(t.unwrap())]:t instanceof sa?[null,...aa(t.unwrap())]:t instanceof Eb||t instanceof $l?aa(t.unwrap()):t instanceof Dl?aa(t._def.innerType):[],Rk=class t extends oe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==F.object)return M(r,{code:T.invalid_type,expected:F.object,received:r.parsedType}),G;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(M(r,{code:T.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),G)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let a of r){let o=aa(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of o){if(i.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);i.set(s,a)}}return new t({typeName:H.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...ee(n)})}};function Ek(t,e){let r=ia(t),n=ia(e);if(t===e)return{valid:!0,data:t};if(r===F.object&&n===F.object){let i=pe.objectKeys(e),a=pe.objectKeys(t).filter(s=>i.indexOf(s)!==-1),o={...t,...e};for(let s of a){let c=Ek(t[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(r===F.array&&n===F.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<t.length;a++){let o=t[a],s=e[a],c=Ek(o,s);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===F.date&&n===F.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var kl=class extends oe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(a,o)=>{if(Pk(a)||Pk(o))return G;let s=Ek(a.value,o.value);return s.valid?((Ck(a)||Ck(o))&&r.dirty(),{status:r.value,value:s.data}):(M(n,{code:T.invalid_intersection_types}),G)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};kl.create=(t,e,r)=>new kl({left:t,right:e,typeName:H.ZodIntersection,...ee(r)});var oa=class t extends oe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.array)return M(n,{code:T.invalid_type,expected:F.array,received:n.parsedType}),G;if(n.data.length<this._def.items.length)return M(n,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G;!this._def.rest&&n.data.length>this._def.items.length&&(M(n,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((o,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new yn(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>ar.mergeArray(r,o)):ar.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};oa.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new oa({items:t,typeName:H.ZodTuple,rest:null,...ee(e)})};var Ak=class t extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.object)return M(n,{code:T.invalid_type,expected:F.object,received:n.parsedType}),G;let i=[],a=this._def.keyType,o=this._def.valueType;for(let s in n.data)i.push({key:a._parse(new yn(n,s,n.path,s)),value:o._parse(new yn(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?ar.mergeObjectAsync(r,i):ar.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof oe?new t({keyType:e,valueType:r,typeName:H.ZodRecord,...ee(n)}):new t({keyType:wl.create(),valueType:e,typeName:H.ZodRecord,...ee(r)})}},em=class extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.map)return M(n,{code:T.invalid_type,expected:F.map,received:n.parsedType}),G;let i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,c],l)=>({key:i._parse(new yn(n,s,n.path,[l,"key"])),value:a._parse(new yn(n,c,n.path,[l,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let c of o){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return G;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let c of o){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return G;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}}}};em.create=(t,e,r)=>new em({valueType:e,keyType:t,typeName:H.ZodMap,...ee(r)});var tm=class t extends oe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.set)return M(n,{code:T.invalid_type,expected:F.set,received:n.parsedType}),G;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(M(n,{code:T.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(M(n,{code:T.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function o(c){let l=new Set;for(let u of c){if(u.status==="aborted")return G;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let s=[...n.data.values()].map((c,l)=>a._parse(new yn(n,c,n.path,l)));return n.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(e,r){return new t({...this._def,minSize:{value:e,message:q.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:q.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};tm.create=(t,e)=>new tm({valueType:t,minSize:null,maxSize:null,typeName:H.ZodSet,...ee(e)});var Tk=class t extends oe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==F.function)return M(r,{code:T.invalid_type,expected:F.function,received:r.parsedType}),G;function n(s,c){return Rb({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Wp(),so].filter(l=>!!l),issueData:{code:T.invalid_arguments,argumentsError:c}})}function i(s,c){return Rb({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Wp(),so].filter(l=>!!l),issueData:{code:T.invalid_return_type,returnTypeError:c}})}let a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Ps){let s=this;return _r(async function(...c){let l=new tn([]),u=await s._def.args.parseAsync(c,a).catch(m=>{throw l.addIssue(n(c,m)),l}),d=await Reflect.apply(o,this,u);return await s._def.returns._def.type.parseAsync(d,a).catch(m=>{throw l.addIssue(i(d,m)),l})})}else{let s=this;return _r(function(...c){let l=s._def.args.safeParse(c,a);if(!l.success)throw new tn([n(c,l.error)]);let u=Reflect.apply(o,this,l.data),d=s._def.returns.safeParse(u,a);if(!d.success)throw new tn([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:oa.create(e).rest(co.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||oa.create([]).rest(co.create()),returns:r||co.create(),typeName:H.ZodFunction,...ee(n)})}},Rl=class extends oe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Rl.create=(t,e)=>new Rl({getter:t,typeName:H.ZodLazy,...ee(e)});var El=class extends oe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return M(r,{received:r.data,code:T.invalid_literal,expected:this._def.value}),G}return{status:"valid",value:e.data}}get value(){return this._def.value}};El.create=(t,e)=>new El({value:t,typeName:H.ZodLiteral,...ee(e)});function jL(t,e){return new Al({values:t,typeName:H.ZodEnum,...ee(e)})}var Al=class t extends oe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return M(r,{expected:pe.joinValues(n),received:r.parsedType,code:T.invalid_type}),G}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return M(r,{received:r.data,code:T.invalid_enum_value,options:n}),G}return _r(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};Al.create=jL;var Tl=class extends oe{_parse(e){let r=pe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==F.string&&n.parsedType!==F.number){let i=pe.objectValues(r);return M(n,{expected:pe.joinValues(i),received:n.parsedType,code:T.invalid_type}),G}if(this._cache||(this._cache=new Set(pe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=pe.objectValues(r);return M(n,{received:n.data,code:T.invalid_enum_value,options:i}),G}return _r(e.data)}get enum(){return this._def.values}};Tl.create=(t,e)=>new Tl({values:t,typeName:H.ZodNativeEnum,...ee(e)});var Ps=class extends oe{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==F.promise&&r.common.async===!1)return M(r,{code:T.invalid_type,expected:F.promise,received:r.parsedType}),G;let n=r.parsedType===F.promise?r.data:Promise.resolve(r.data);return _r(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ps.create=(t,e)=>new Ps({type:t,typeName:H.ZodPromise,...ee(e)});var Fn=class extends oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:o=>{M(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let o=i.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return G;let c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?G:c.status==="dirty"?xl(c.value):r.value==="dirty"?xl(c.value):c});{if(r.value==="aborted")return G;let s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?G:s.status==="dirty"?xl(s.value):r.value==="dirty"?xl(s.value):s}}if(i.type==="refinement"){let o=s=>{let c=i.refinement(s,a);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?G:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?G:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Is(o))return G;let s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Is(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):G);pe.assertNever(i)}};Fn.create=(t,e,r)=>new Fn({schema:t,typeName:H.ZodEffects,effect:e,...ee(r)});Fn.createWithPreprocess=(t,e,r)=>new Fn({schema:e,effect:{type:"preprocess",transform:t},typeName:H.ZodEffects,...ee(r)});var Un=class extends oe{_parse(e){return this._getType(e)===F.undefined?_r(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Un.create=(t,e)=>new Un({innerType:t,typeName:H.ZodOptional,...ee(e)});var sa=class extends oe{_parse(e){return this._getType(e)===F.null?_r(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};sa.create=(t,e)=>new sa({innerType:t,typeName:H.ZodNullable,...ee(e)});var Ol=class extends oe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===F.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ol.create=(t,e)=>new Ol({innerType:t,typeName:H.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ee(e)});var Dl=class extends oe{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Hp(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new tn(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new tn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Dl.create=(t,e)=>new Dl({innerType:t,typeName:H.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ee(e)});var rm=class extends oe{_parse(e){if(this._getType(e)!==F.nan){let n=this._getOrReturnCtx(e);return M(n,{code:T.invalid_type,expected:F.nan,received:n.parsedType}),G}return{status:"valid",value:e.data}}};rm.create=t=>new rm({typeName:H.ZodNaN,...ee(t)});var iMe=Symbol("zod_brand"),Eb=class extends oe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Ab=class t extends oe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?G:a.status==="dirty"?(r.dirty(),xl(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?G:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:H.ZodPipeline})}},$l=class extends oe{_parse(e){let r=this._def.innerType._parse(e),n=i=>(Is(i)&&(i.value=Object.freeze(i.value)),i);return Hp(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};$l.create=(t,e)=>new $l({innerType:t,typeName:H.ZodReadonly,...ee(e)});var aMe={object:rn.lazycreate},H;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(H||(H={}));var oMe=wl.create,sMe=Zp.create,cMe=rm.create,lMe=Gp.create,uMe=Kp.create,dMe=Jp.create,pMe=Yp.create,mMe=Il.create,fMe=Pl.create,gMe=Xp.create,hMe=co.create,yMe=fi.create,vMe=Qp.create,bMe=lo.create,vre=rn.create,_Me=rn.strictCreate,xMe=Cl.create,SMe=Rk.create,wMe=kl.create,IMe=oa.create,PMe=Ak.create,CMe=em.create,kMe=tm.create,RMe=Tk.create,EMe=Rl.create,AMe=El.create,TMe=Al.create,OMe=Tl.create,DMe=Ps.create,$Me=Fn.create,NMe=Un.create,jMe=sa.create,MMe=Fn.createWithPreprocess,LMe=Ab.create;function Nl(t){return!!t._zod}function uo(t,e){return Nl(t)?ls(t,e):t.safeParse(e)}function Tb(t){if(!t)return;let e;if(Nl(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function zL(t){if(Nl(t)){let a=t._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}function po(t){return t==="completed"||t==="failed"||t==="cancelled"}var Pre=Symbol("Let zodToJsonSchema decide on which parser to use");var ZLe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Ok(t){let r=Tb(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=zL(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function Dk(t,e){let r=uo(t,e);if(!r.success)throw r.error;return r.data}var Tre=6e4,Ob=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(fb,r=>{this._oncancel(r)}),this.setNotificationHandler(hb,r=>{this._onprogress(r)}),this.setRequestHandler(gb,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(yb,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ne(me.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(bb,async(r,n)=>{let i=async()=>{let a=r.params.taskId;if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(a,n.sessionId);){if(s.type==="response"||s.type==="error"){let c=s.message,l=c.id,u=this._requestResolvers.get(l);if(u)if(this._requestResolvers.delete(l),s.type==="response")u(c);else{let d=c,p=new ne(d.error.code,d.error.message,d.error.data);u(p)}else{let d=s.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(s.message,{relatedRequestId:n.requestId})}}let o=await this._taskStore.getTask(a,n.sessionId);if(!o)throw new ne(me.InvalidParams,`Task not found: ${a}`);if(!po(o.status))return await this._waitForTaskUpdate(a,n.signal),await i();if(po(o.status)){let s=await this._taskStore.getTaskResult(a,n.sessionId);return this._clearTaskQueue(a),{...s,_meta:{...s._meta,[oo]:{taskId:a}}}}return await i()};return await i()}),this.setRequestHandler(_b,async(r,n)=>{try{let{tasks:i,nextCursor:a}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:a,_meta:{}}}catch(i){throw new ne(me.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(Sb,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ne(me.InvalidParams,`Task not found: ${r.params.taskId}`);if(po(i.status))throw new ne(me.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let a=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!a)throw new ne(me.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...a}}catch(i){throw i instanceof ne?i:new ne(me.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,i,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:a,onTimeout:i})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),ne.fromError(me.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=a=>{n?.(a),this._onerror(a)};let i=this._transport?.onmessage;this._transport.onmessage=(a,o)=>{i?.(a,o),jp(a)||xL(a)?this._onresponse(a):sk(a)?this._onrequest(a,o):_L(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();let r=ne.fromError(me.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,a=e.params?._meta?.[oo]?.taskId;if(n===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:me.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:u,timestamp:Date.now()},i?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):i?.send(u).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);let s=yL(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,l={signal:o.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{let d={relatedRequestId:e.id};a&&(d.relatedTask={taskId:a}),await this.notification(u,d)},sendRequest:async(u,d,p)=>{let m={...p,relatedRequestId:e.id};a&&!m.relatedTask&&(m.relatedTask={taskId:a});let f=m.relatedTask?.taskId??a;return f&&c&&await c.updateTaskStatus(f,"input_required"),await this.request(u,d,m)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:a,taskStore:c,taskRequestedTtl:s?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{s&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,l)).then(async u=>{if(o.signal.aborted)return;let d={result:u,jsonrpc:"2.0",id:e.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)},async u=>{if(o.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:me.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,i=Number(r),a=this._progressHandlers.get(i);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let o=this._responseHandlers.get(i),s=this._timeoutInfo.get(i);if(s&&o&&s.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),o(c);return}a(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),jp(e))n(e);else{let o=new ne(e.error.code,e.error.message,e.error.data);n(o)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let a=!1;if(jp(e)&&e.result&&typeof e.result=="object"){let o=e.result;if(o.task&&typeof o.task=="object"){let s=o.task;typeof s.taskId=="string"&&(a=!0,this._taskProgressTokens.set(s.taskId,r))}}if(a||this._progressHandlers.delete(r),jp(e))i(e);else{let o=ne.fromError(e.error.code,e.error.message,e.error.data);i(o)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(e,r,n)}}catch(o){yield{type:"error",error:o instanceof ne?o:new ne(me.InternalError,String(o))}}return}let a;try{let o=await this.request(e,bl,n);if(o.task)a=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new ne(me.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:a},n);if(yield{type:"taskStatus",task:s},po(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)}:s.status==="failed"?yield{type:"error",error:new ne(me.InternalError,`Task ${a} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new ne(me.InternalError,`Task ${a} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)};return}let c=s.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,c)),n?.signal?.throwIfAborted()}}catch(o){yield{type:"error",error:o instanceof ne?o:new ne(me.InternalError,String(o))}}}request(e,r,n){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,task:s,relatedTask:c}=n??{};return new Promise((l,u)=>{let d=b=>{u(b)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),s&&this.assertTaskCapability(e.method)}catch(b){d(b);return}n?.signal?.throwIfAborted();let p=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:p};n?.onprogress&&(this._progressHandlers.set(p,n.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),s&&(m.params={...m.params,task:s}),c&&(m.params={...m.params,_meta:{...m.params?._meta||{},[oo]:c}});let f=b=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(b)}},{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(C=>this._onerror(new Error(`Failed to send cancellation: ${C}`)));let x=b instanceof ne?b:new ne(me.RequestTimeout,String(b));u(x)};this._responseHandlers.set(p,b=>{if(!n?.signal?.aborted){if(b instanceof Error)return u(b);try{let x=uo(r,b.result);x.success?l(x.data):u(x.error)}catch(x){u(x)}}}),n?.signal?.addEventListener("abort",()=>{f(n?.signal?.reason)});let g=n?.timeout??Tre,h=()=>f(ne.fromError(me.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(p,g,n?.maxTotalTimeout,h,n?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let b=x=>{let C=this._responseHandlers.get(p);C?C(x):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,b),this._enqueueTaskMessage(v,{type:"request",message:m,timestamp:Date.now()}).catch(x=>{this._cleanupTimeout(p),u(x)})}else this._transport.send(m,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(b=>{this._cleanupTimeout(p),u(b)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},vb,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},xb,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},IL,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[oo]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[oo]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[oo]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=Ok(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,a)=>{let o=Dk(e,i);return Promise.resolve(r(o,a))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=Ok(e);this._notificationHandlers.set(n,i=>{let a=Dk(e,i);return Promise.resolve(r(a))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,i)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let i of n)if(i.type==="request"&&sk(i.message)){let a=i.message.id,o=this._requestResolvers.get(a);o?(o(new ne(me.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(e);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,a)=>{if(r.aborted){a(new ne(me.InvalidRequest,"Request cancelled"));return}let o=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(o),a(new ne(me.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!e)throw new Error("No request provided");return await n.createTask(i,e.id,{method:e.method,params:e.params},r)},getTask:async i=>{let a=await n.getTask(i,r);if(!a)throw new ne(me.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(i,a,o)=>{await n.storeTaskResult(i,a,o,r);let s=await n.getTask(i,r);if(s){let c=Fp.parse({method:"notifications/tasks/status",params:s});await this.notification(c),po(s.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,a,o)=>{let s=await n.getTask(i,r);if(!s)throw new ne(me.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(po(s.status))throw new ne(me.InvalidParams,`Cannot update task "${i}" from terminal status "${s.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,a,o,r);let c=await n.getTask(i,r);if(c){let l=Fp.parse({method:"notifications/tasks/status",params:c});await this.notification(l),po(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}};function UL(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function FL(t,e){let r={...t};for(let n in e){let i=n,a=e[i];if(a===void 0)continue;let o=r[i];UL(o)&&UL(a)?r[i]={...o,...a}:r[i]=a}return r}var kU=At(vE(),1),RU=At(CU(),1);function xce(){let t=new kU.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,RU.default)(t),t}var g_=class{constructor(e){this._ajv=e??xce()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var h_=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};function EU(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function AU(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var y_=class extends Ob{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Vp.options.map((n,i)=>[n,i])),this.isMessageIgnored=(n,i)=>{let a=this._loggingLevels.get(i);return a?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(a):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new g_,this.setRequestHandler(uk,n=>this._oninitialize(n)),this.setNotificationHandler(dk,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(xk,async(n,i)=>{let a=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:o}=n.params,s=Vp.safeParse(o);return s.success&&this._loggingLevels.set(a,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new h_(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=FL(this._capabilities,e)}setRequestHandler(e,r){let i=Tb(e)?.method;if(!i)throw new Error("Schema is missing a method literal");let a;if(Nl(i)){let s=i;a=s._zod?.def?.value??s.value}else{let s=i;a=s._def?.value??s.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");if(a==="tools/call"){let s=async(c,l)=>{let u=uo(Bp,c);if(!u.success){let f=u.error instanceof Error?u.error.message:String(u.error);throw new ne(me.InvalidParams,`Invalid tools/call request: ${f}`)}let{params:d}=u.data,p=await Promise.resolve(r(c,l));if(d.task){let f=uo(bl,p);if(!f.success){let g=f.error instanceof Error?f.error.message:String(f.error);throw new ne(me.InvalidParams,`Invalid task creation result: ${g}`)}return f.data}let m=uo(wb,p);if(!m.success){let f=m.error instanceof Error?m.error.message:String(m.error);throw new ne(me.InvalidParams,`Invalid tools/call result: ${f}`)}return m.data};return super.setRequestHandler(e,s)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){AU(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&EU(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:fL.includes(r)?r:ak,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},mb)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],i=Array.isArray(n.content)?n.content:[n.content],a=i.some(l=>l.type==="tool_result"),o=e.messages.length>1?e.messages[e.messages.length-2]:void 0,s=o?Array.isArray(o.content)?o.content:[o.content]:[],c=s.some(l=>l.type==="tool_use");if(a){if(i.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let l=new Set(s.filter(d=>d.type==="tool_use").map(d=>d.id)),u=new Set(i.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(l.size!==u.size||![...l].every(d=>u.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},wk,r):this.request({method:"sampling/createMessage",params:e},Sk,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let i=e;return this.request({method:"elicitation/create",params:i},Ib,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let i=e.mode==="form"?e:{...e,mode:"form"},a=await this.request({method:"elicitation/create",params:i},Ib,r);if(a.action==="accept"&&a.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(a.content);if(!s.valid)throw new ne(me.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(o){throw o instanceof ne?o:new ne(me.InternalError,`Error validating elicitation response: ${o instanceof Error?o.message:String(o)}`)}return a}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},Ik,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function Sce(){let t=process.env.WEPPY_ROBLOX_MCP_VERSION?.trim();return t||null}var Me=Sce()??"2.15.0";var CE={"claude-code":"Claude Code",claude:"Claude",cursor:"Cursor","codex-cli":"Codex CLI","openai-codex":"Codex CLI","gemini-cli":"Gemini CLI",windsurf:"Windsurf",cline:"Cline",continue:"Continue",zed:"Zed",vscode:"VS Code"};function TU(t){let e=t.toLowerCase();if(CE[e])return CE[e];for(let[r,n]of Object.entries(CE))if(e.includes(r))return n;return t}function OU(){return process.env.CLAUDECODE||process.env.CLAUDE_CODE_ENTRYPOINT?{name:"Claude Code",version:""}:process.env.CURSOR_EDITOR?{name:"Cursor",version:""}:process.env.WINDSURF_EDITOR?{name:"Windsurf",version:""}:process.env.CONTINUE_GLOBAL_DIR?{name:"Continue",version:""}:process.env.CLINE_CONTEXT?{name:"Cline",version:""}:null}var kE="weppy://ui-studio/guide",RE="weppy://ui-studio/tokens",EE="weppy://ui-studio/functional-rules",DU=`# UI Studio Guide
|
|
245
|
+
`}var Cb=class{constructor(e=TL.stdin,r=TL.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new Pb,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(r=>{let n=AL(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var kb=class{startPromise=null;stopPromise=null;start(e){return this.startPromise??=e(),this.startPromise}stop(e){return this.stopPromise??=(async()=>{this.startPromise&&await this.startPromise.catch(()=>{}),await e()})(),this.stopPromise}};var pe;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let a={};for(let o of i)a[o]=o;return a},t.getValidEnumValues=i=>{let a=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(let s of a)o[s]=i[s];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},t.find=(i,a)=>{for(let o of i)if(a(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(pe||(pe={}));var OL;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(OL||(OL={}));var F=pe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ia=t=>{switch(typeof t){case"undefined":return F.undefined;case"string":return F.string;case"number":return Number.isNaN(t)?F.nan:F.number;case"boolean":return F.boolean;case"function":return F.function;case"bigint":return F.bigint;case"symbol":return F.symbol;case"object":return Array.isArray(t)?F.array:t===null?F.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?F.promise:typeof Map<"u"&&t instanceof Map?F.map:typeof Set<"u"&&t instanceof Set?F.set:typeof Date<"u"&&t instanceof Date?F.date:F.object;default:return F.unknown}};var T=pe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var tn=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(a){return a.message},n={_errors:[]},i=a=>{for(let o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,c=0;for(;c<o.path.length;){let l=o.path[c];c===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(r(o))):s[l]=s[l]||{_errors:[]},s=s[l],c++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,pe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r=Object.create(null),n=[];for(let i of this.issues)if(i.path.length>0){let a=i.path[0];r[a]=r[a]||[],r[a].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};tn.create=t=>new tn(t);var Gte=(t,e)=>{let r;switch(t.code){case T.invalid_type:t.received===F.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case T.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,pe.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:r=`Unrecognized key(s) in object: ${pe.joinValues(t.keys,", ")}`;break;case T.invalid_union:r="Invalid input";break;case T.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${pe.joinValues(t.options)}`;break;case T.invalid_enum_value:r=`Invalid enum value. Expected ${pe.joinValues(t.options)}, received '${t.received}'`;break;case T.invalid_arguments:r="Invalid function arguments";break;case T.invalid_return_type:r="Invalid function return type";break;case T.invalid_date:r="Invalid date";break;case T.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:pe.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case T.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case T.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case T.custom:r="Invalid input";break;case T.invalid_intersection_types:r="Intersection results could not be merged";break;case T.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case T.not_finite:r="Number must be finite";break;default:r=e.defaultError,pe.assertNever(t)}return{message:r}},so=Gte;var Kte=so;function Wp(){return Kte}var Rb=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="",c=n.filter(l=>!!l).slice().reverse();for(let l of c)s=l(o,{data:e,defaultError:s}).message;return{...i,path:a,message:s}};function M(t,e){let r=Wp(),n=Rb({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===so?void 0:so].filter(i=>!!i)});t.common.issues.push(n)}var ar=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return G;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let a=await i.key,o=await i.value;n.push({key:a,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return G;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:e.value,value:n}}},G=Object.freeze({status:"aborted"}),xl=t=>({status:"dirty",value:t}),_r=t=>({status:"valid",value:t}),Pk=t=>t.status==="aborted",Ck=t=>t.status==="dirty",Is=t=>t.status==="valid",Hp=t=>typeof Promise<"u"&&t instanceof Promise;var q;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(q||(q={}));var yn=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},DL=(t,e)=>{if(Is(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new tn(t.common.issues);return this._error=r,this._error}}};function ee(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,s)=>{let{message:c}=t;return o.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:i}}var oe=class{get description(){return this._def.description}_getType(e){return ia(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ia(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ar,ctx:{common:e.parent.common,data:e.data,parsedType:ia(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Hp(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ia(e)},i=this._parseSync({data:e,path:n.path,parent:n});return DL(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ia(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Is(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Is(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ia(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(Hp(i)?i:Promise.resolve(i));return DL(n,a)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{let o=e(i),s=()=>a.addIssue({code:T.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Fn({schema:this,typeName:H.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Un.create(this,this._def)}nullable(){return sa.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return lo.create(this)}promise(){return Ps.create(this,this._def)}or(e){return Cl.create([this,e],this._def)}and(e){return kl.create(this,e,this._def)}transform(e){return new Fn({...ee(this._def),schema:this,typeName:H.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ol({...ee(this._def),innerType:this,defaultValue:r,typeName:H.ZodDefault})}brand(){return new Eb({typeName:H.ZodBranded,type:this,...ee(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Dl({...ee(this._def),innerType:this,catchValue:r,typeName:H.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ab.create(this,e)}readonly(){return $l.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Jte=/^c[^\s-]{8,}$/i,Yte=/^[0-9a-z]+$/,Xte=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qte=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ere=/^[a-z0-9_-]{21}$/i,tre=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rre=/^[-+]?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)?)??$/,nre=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ire="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",kk,are=/^(?:(?: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])$/,ore=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,sre=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,cre=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lre=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ure=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$L="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dre=new RegExp(`^${$L}$`);function NL(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function pre(t){return new RegExp(`^${NL(t)}$`)}function mre(t){let e=`${$L}T${NL(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function fre(t,e){return!!((e==="v4"||!e)&&are.test(t)||(e==="v6"||!e)&&sre.test(t))}function gre(t,e){if(!tre.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function hre(t,e){return!!((e==="v4"||!e)&&ore.test(t)||(e==="v6"||!e)&&cre.test(t))}var wl=class t extends oe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==F.string){let a=this._getOrReturnCtx(e);return M(a,{code:T.invalid_type,expected:F.string,received:a.parsedType}),G}let n=new ar,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),M(i,{code:T.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),M(i,{code:T.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let o=e.data.length>a.value,s=e.data.length<a.value;(o||s)&&(i=this._getOrReturnCtx(e,i),o?M(i,{code:T.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&M(i,{code:T.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")nre.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"email",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")kk||(kk=new RegExp(ire,"u")),kk.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"emoji",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Qte.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"uuid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")ere.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"nanoid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Jte.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"cuid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Yte.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"cuid2",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Xte.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"ulid",code:T.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),M(i,{validation:"url",code:T.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"regex",code:T.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),M(i,{code:T.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),M(i,{code:T.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),M(i,{code:T.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?mre(a).test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{code:T.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?dre.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{code:T.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?pre(a).test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{code:T.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?rre.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"duration",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?fre(e.data,a.version)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"ip",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?gre(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"jwt",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?hre(e.data,a.version)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"cidr",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?lre.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"base64",code:T.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?ure.test(e.data)||(i=this._getOrReturnCtx(e,i),M(i,{validation:"base64url",code:T.invalid_string,message:a.message}),n.dirty()):pe.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:T.invalid_string,...q.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...q.errToObj(e)})}url(e){return this._addCheck({kind:"url",...q.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...q.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...q.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...q.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...q.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...q.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...q.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...q.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...q.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...q.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...q.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...q.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...q.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...q.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...q.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...q.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...q.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...q.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...q.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...q.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...q.errToObj(r)})}nonempty(e){return this.min(1,q.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};wl.create=t=>new wl({checks:[],typeName:H.ZodString,coerce:t?.coerce??!1,...ee(t)});function yre(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return a%o/10**i}var Zp=class t extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==F.number){let a=this._getOrReturnCtx(e);return M(a,{code:T.invalid_type,expected:F.number,received:a.parsedType}),G}let n,i=new ar;for(let a of this._def.checks)a.kind==="int"?pe.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),M(n,{code:T.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),M(n,{code:T.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),M(n,{code:T.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?yre(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),M(n,{code:T.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),M(n,{code:T.not_finite,message:a.message}),i.dirty()):pe.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:q.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:q.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:q.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:q.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:q.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&pe.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Zp.create=t=>new Zp({checks:[],typeName:H.ZodNumber,coerce:t?.coerce||!1,...ee(t)});var Gp=class t extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==F.bigint)return this._getInvalidInput(e);let n,i=new ar;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),M(n,{code:T.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),M(n,{code:T.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),M(n,{code:T.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):pe.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return M(r,{code:T.invalid_type,expected:F.bigint,received:r.parsedType}),G}gte(e,r){return this.setLimit("min",e,!0,q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:q.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Gp.create=t=>new Gp({checks:[],typeName:H.ZodBigInt,coerce:t?.coerce??!1,...ee(t)});var Kp=class extends oe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==F.boolean){let n=this._getOrReturnCtx(e);return M(n,{code:T.invalid_type,expected:F.boolean,received:n.parsedType}),G}return _r(e.data)}};Kp.create=t=>new Kp({typeName:H.ZodBoolean,coerce:t?.coerce||!1,...ee(t)});var Jp=class t extends oe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==F.date){let a=this._getOrReturnCtx(e);return M(a,{code:T.invalid_type,expected:F.date,received:a.parsedType}),G}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return M(a,{code:T.invalid_date}),G}let n=new ar,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),M(i,{code:T.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),M(i,{code:T.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):pe.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:q.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:q.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Jp.create=t=>new Jp({checks:[],coerce:t?.coerce||!1,typeName:H.ZodDate,...ee(t)});var Yp=class extends oe{_parse(e){if(this._getType(e)!==F.symbol){let n=this._getOrReturnCtx(e);return M(n,{code:T.invalid_type,expected:F.symbol,received:n.parsedType}),G}return _r(e.data)}};Yp.create=t=>new Yp({typeName:H.ZodSymbol,...ee(t)});var Il=class extends oe{_parse(e){if(this._getType(e)!==F.undefined){let n=this._getOrReturnCtx(e);return M(n,{code:T.invalid_type,expected:F.undefined,received:n.parsedType}),G}return _r(e.data)}};Il.create=t=>new Il({typeName:H.ZodUndefined,...ee(t)});var Pl=class extends oe{_parse(e){if(this._getType(e)!==F.null){let n=this._getOrReturnCtx(e);return M(n,{code:T.invalid_type,expected:F.null,received:n.parsedType}),G}return _r(e.data)}};Pl.create=t=>new Pl({typeName:H.ZodNull,...ee(t)});var Xp=class extends oe{constructor(){super(...arguments),this._any=!0}_parse(e){return _r(e.data)}};Xp.create=t=>new Xp({typeName:H.ZodAny,...ee(t)});var co=class extends oe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _r(e.data)}};co.create=t=>new co({typeName:H.ZodUnknown,...ee(t)});var fi=class extends oe{_parse(e){let r=this._getOrReturnCtx(e);return M(r,{code:T.invalid_type,expected:F.never,received:r.parsedType}),G}};fi.create=t=>new fi({typeName:H.ZodNever,...ee(t)});var Qp=class extends oe{_parse(e){if(this._getType(e)!==F.undefined){let n=this._getOrReturnCtx(e);return M(n,{code:T.invalid_type,expected:F.void,received:n.parsedType}),G}return _r(e.data)}};Qp.create=t=>new Qp({typeName:H.ZodVoid,...ee(t)});var lo=class t extends oe{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==F.array)return M(r,{code:T.invalid_type,expected:F.array,received:r.parsedType}),G;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(o||s)&&(M(r,{code:o?T.too_big:T.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(M(r,{code:T.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(M(r,{code:T.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>i.type._parseAsync(new yn(r,o,r.path,s)))).then(o=>ar.mergeArray(n,o));let a=[...r.data].map((o,s)=>i.type._parseSync(new yn(r,o,r.path,s)));return ar.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:q.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:q.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:q.toString(r)}})}nonempty(e){return this.min(1,e)}};lo.create=(t,e)=>new lo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:H.ZodArray,...ee(e)});function Sl(t){if(t instanceof rn){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Un.create(Sl(n))}return new rn({...t._def,shape:()=>e})}else return t instanceof lo?new lo({...t._def,type:Sl(t.element)}):t instanceof Un?Un.create(Sl(t.unwrap())):t instanceof sa?sa.create(Sl(t.unwrap())):t instanceof oa?oa.create(t.items.map(e=>Sl(e))):t}var rn=class t extends oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=pe.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==F.object){let l=this._getOrReturnCtx(e);return M(l,{code:T.invalid_type,expected:F.object,received:l.parsedType}),G}let{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof fi&&this._def.unknownKeys==="strip"))for(let l in i.data)o.includes(l)||s.push(l);let c=[];for(let l of o){let u=a[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new yn(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof fi){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of s)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")s.length>0&&(M(i,{code:T.unrecognized_keys,keys:s}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of s){let d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new yn(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,p=await u.value;l.push({key:d,value:p,alwaysSet:u.alwaysSet})}return l}).then(l=>ar.mergeObjectSync(n,l)):ar.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return q.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:q.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:H.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of pe.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of pe.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Sl(this)}partial(e){let r={};for(let n of pe.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of pe.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Un;)a=a._def.innerType;r[n]=a}return new t({...this._def,shape:()=>r})}keyof(){return jL(pe.objectKeys(this.shape))}};rn.create=(t,e)=>new rn({shape:()=>t,unknownKeys:"strip",catchall:fi.create(),typeName:H.ZodObject,...ee(e)});rn.strictCreate=(t,e)=>new rn({shape:()=>t,unknownKeys:"strict",catchall:fi.create(),typeName:H.ZodObject,...ee(e)});rn.lazycreate=(t,e)=>new rn({shape:t,unknownKeys:"strip",catchall:fi.create(),typeName:H.ZodObject,...ee(e)});var Cl=class extends oe{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(a){for(let s of a)if(s.result.status==="valid")return s.result;for(let s of a)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let o=a.map(s=>new tn(s.ctx.common.issues));return M(r,{code:T.invalid_union,unionErrors:o}),G}if(r.common.async)return Promise.all(n.map(async a=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a,o=[];for(let c of n){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(c=>new tn(c));return M(r,{code:T.invalid_union,unionErrors:s}),G}}get options(){return this._def.options}};Cl.create=(t,e)=>new Cl({options:t,typeName:H.ZodUnion,...ee(e)});var aa=t=>t instanceof Rl?aa(t.schema):t instanceof Fn?aa(t.innerType()):t instanceof El?[t.value]:t instanceof Al?t.options:t instanceof Tl?pe.objectValues(t.enum):t instanceof Ol?aa(t._def.innerType):t instanceof Il?[void 0]:t instanceof Pl?[null]:t instanceof Un?[void 0,...aa(t.unwrap())]:t instanceof sa?[null,...aa(t.unwrap())]:t instanceof Eb||t instanceof $l?aa(t.unwrap()):t instanceof Dl?aa(t._def.innerType):[],Rk=class t extends oe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==F.object)return M(r,{code:T.invalid_type,expected:F.object,received:r.parsedType}),G;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(M(r,{code:T.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),G)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let a of r){let o=aa(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of o){if(i.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);i.set(s,a)}}return new t({typeName:H.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...ee(n)})}};function Ek(t,e){let r=ia(t),n=ia(e);if(t===e)return{valid:!0,data:t};if(r===F.object&&n===F.object){let i=pe.objectKeys(e),a=pe.objectKeys(t).filter(s=>i.indexOf(s)!==-1),o={...t,...e};for(let s of a){let c=Ek(t[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(r===F.array&&n===F.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<t.length;a++){let o=t[a],s=e[a],c=Ek(o,s);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===F.date&&n===F.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var kl=class extends oe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(a,o)=>{if(Pk(a)||Pk(o))return G;let s=Ek(a.value,o.value);return s.valid?((Ck(a)||Ck(o))&&r.dirty(),{status:r.value,value:s.data}):(M(n,{code:T.invalid_intersection_types}),G)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};kl.create=(t,e,r)=>new kl({left:t,right:e,typeName:H.ZodIntersection,...ee(r)});var oa=class t extends oe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.array)return M(n,{code:T.invalid_type,expected:F.array,received:n.parsedType}),G;if(n.data.length<this._def.items.length)return M(n,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G;!this._def.rest&&n.data.length>this._def.items.length&&(M(n,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((o,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new yn(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>ar.mergeArray(r,o)):ar.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};oa.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new oa({items:t,typeName:H.ZodTuple,rest:null,...ee(e)})};var Ak=class t extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.object)return M(n,{code:T.invalid_type,expected:F.object,received:n.parsedType}),G;let i=[],a=this._def.keyType,o=this._def.valueType;for(let s in n.data)i.push({key:a._parse(new yn(n,s,n.path,s)),value:o._parse(new yn(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?ar.mergeObjectAsync(r,i):ar.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof oe?new t({keyType:e,valueType:r,typeName:H.ZodRecord,...ee(n)}):new t({keyType:wl.create(),valueType:e,typeName:H.ZodRecord,...ee(r)})}},em=class extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.map)return M(n,{code:T.invalid_type,expected:F.map,received:n.parsedType}),G;let i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,c],l)=>({key:i._parse(new yn(n,s,n.path,[l,"key"])),value:a._parse(new yn(n,c,n.path,[l,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let c of o){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return G;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let c of o){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return G;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}}}};em.create=(t,e,r)=>new em({valueType:e,keyType:t,typeName:H.ZodMap,...ee(r)});var tm=class t extends oe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.set)return M(n,{code:T.invalid_type,expected:F.set,received:n.parsedType}),G;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(M(n,{code:T.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(M(n,{code:T.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function o(c){let l=new Set;for(let u of c){if(u.status==="aborted")return G;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let s=[...n.data.values()].map((c,l)=>a._parse(new yn(n,c,n.path,l)));return n.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(e,r){return new t({...this._def,minSize:{value:e,message:q.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:q.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};tm.create=(t,e)=>new tm({valueType:t,minSize:null,maxSize:null,typeName:H.ZodSet,...ee(e)});var Tk=class t extends oe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==F.function)return M(r,{code:T.invalid_type,expected:F.function,received:r.parsedType}),G;function n(s,c){return Rb({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Wp(),so].filter(l=>!!l),issueData:{code:T.invalid_arguments,argumentsError:c}})}function i(s,c){return Rb({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Wp(),so].filter(l=>!!l),issueData:{code:T.invalid_return_type,returnTypeError:c}})}let a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Ps){let s=this;return _r(async function(...c){let l=new tn([]),u=await s._def.args.parseAsync(c,a).catch(m=>{throw l.addIssue(n(c,m)),l}),d=await Reflect.apply(o,this,u);return await s._def.returns._def.type.parseAsync(d,a).catch(m=>{throw l.addIssue(i(d,m)),l})})}else{let s=this;return _r(function(...c){let l=s._def.args.safeParse(c,a);if(!l.success)throw new tn([n(c,l.error)]);let u=Reflect.apply(o,this,l.data),d=s._def.returns.safeParse(u,a);if(!d.success)throw new tn([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:oa.create(e).rest(co.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||oa.create([]).rest(co.create()),returns:r||co.create(),typeName:H.ZodFunction,...ee(n)})}},Rl=class extends oe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Rl.create=(t,e)=>new Rl({getter:t,typeName:H.ZodLazy,...ee(e)});var El=class extends oe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return M(r,{received:r.data,code:T.invalid_literal,expected:this._def.value}),G}return{status:"valid",value:e.data}}get value(){return this._def.value}};El.create=(t,e)=>new El({value:t,typeName:H.ZodLiteral,...ee(e)});function jL(t,e){return new Al({values:t,typeName:H.ZodEnum,...ee(e)})}var Al=class t extends oe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return M(r,{expected:pe.joinValues(n),received:r.parsedType,code:T.invalid_type}),G}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return M(r,{received:r.data,code:T.invalid_enum_value,options:n}),G}return _r(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};Al.create=jL;var Tl=class extends oe{_parse(e){let r=pe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==F.string&&n.parsedType!==F.number){let i=pe.objectValues(r);return M(n,{expected:pe.joinValues(i),received:n.parsedType,code:T.invalid_type}),G}if(this._cache||(this._cache=new Set(pe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=pe.objectValues(r);return M(n,{received:n.data,code:T.invalid_enum_value,options:i}),G}return _r(e.data)}get enum(){return this._def.values}};Tl.create=(t,e)=>new Tl({values:t,typeName:H.ZodNativeEnum,...ee(e)});var Ps=class extends oe{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==F.promise&&r.common.async===!1)return M(r,{code:T.invalid_type,expected:F.promise,received:r.parsedType}),G;let n=r.parsedType===F.promise?r.data:Promise.resolve(r.data);return _r(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ps.create=(t,e)=>new Ps({type:t,typeName:H.ZodPromise,...ee(e)});var Fn=class extends oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:o=>{M(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let o=i.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return G;let c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?G:c.status==="dirty"?xl(c.value):r.value==="dirty"?xl(c.value):c});{if(r.value==="aborted")return G;let s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?G:s.status==="dirty"?xl(s.value):r.value==="dirty"?xl(s.value):s}}if(i.type==="refinement"){let o=s=>{let c=i.refinement(s,a);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?G:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?G:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Is(o))return G;let s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Is(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):G);pe.assertNever(i)}};Fn.create=(t,e,r)=>new Fn({schema:t,typeName:H.ZodEffects,effect:e,...ee(r)});Fn.createWithPreprocess=(t,e,r)=>new Fn({schema:e,effect:{type:"preprocess",transform:t},typeName:H.ZodEffects,...ee(r)});var Un=class extends oe{_parse(e){return this._getType(e)===F.undefined?_r(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Un.create=(t,e)=>new Un({innerType:t,typeName:H.ZodOptional,...ee(e)});var sa=class extends oe{_parse(e){return this._getType(e)===F.null?_r(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};sa.create=(t,e)=>new sa({innerType:t,typeName:H.ZodNullable,...ee(e)});var Ol=class extends oe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===F.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ol.create=(t,e)=>new Ol({innerType:t,typeName:H.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ee(e)});var Dl=class extends oe{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Hp(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new tn(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new tn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Dl.create=(t,e)=>new Dl({innerType:t,typeName:H.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ee(e)});var rm=class extends oe{_parse(e){if(this._getType(e)!==F.nan){let n=this._getOrReturnCtx(e);return M(n,{code:T.invalid_type,expected:F.nan,received:n.parsedType}),G}return{status:"valid",value:e.data}}};rm.create=t=>new rm({typeName:H.ZodNaN,...ee(t)});var iMe=Symbol("zod_brand"),Eb=class extends oe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Ab=class t extends oe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?G:a.status==="dirty"?(r.dirty(),xl(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?G:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:H.ZodPipeline})}},$l=class extends oe{_parse(e){let r=this._def.innerType._parse(e),n=i=>(Is(i)&&(i.value=Object.freeze(i.value)),i);return Hp(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};$l.create=(t,e)=>new $l({innerType:t,typeName:H.ZodReadonly,...ee(e)});var aMe={object:rn.lazycreate},H;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(H||(H={}));var oMe=wl.create,sMe=Zp.create,cMe=rm.create,lMe=Gp.create,uMe=Kp.create,dMe=Jp.create,pMe=Yp.create,mMe=Il.create,fMe=Pl.create,gMe=Xp.create,hMe=co.create,yMe=fi.create,vMe=Qp.create,bMe=lo.create,vre=rn.create,_Me=rn.strictCreate,xMe=Cl.create,SMe=Rk.create,wMe=kl.create,IMe=oa.create,PMe=Ak.create,CMe=em.create,kMe=tm.create,RMe=Tk.create,EMe=Rl.create,AMe=El.create,TMe=Al.create,OMe=Tl.create,DMe=Ps.create,$Me=Fn.create,NMe=Un.create,jMe=sa.create,MMe=Fn.createWithPreprocess,LMe=Ab.create;function Nl(t){return!!t._zod}function uo(t,e){return Nl(t)?ls(t,e):t.safeParse(e)}function Tb(t){if(!t)return;let e;if(Nl(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function zL(t){if(Nl(t)){let a=t._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}function po(t){return t==="completed"||t==="failed"||t==="cancelled"}var Pre=Symbol("Let zodToJsonSchema decide on which parser to use");var ZLe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Ok(t){let r=Tb(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=zL(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function Dk(t,e){let r=uo(t,e);if(!r.success)throw r.error;return r.data}var Tre=6e4,Ob=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(fb,r=>{this._oncancel(r)}),this.setNotificationHandler(hb,r=>{this._onprogress(r)}),this.setRequestHandler(gb,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(yb,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ne(me.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(bb,async(r,n)=>{let i=async()=>{let a=r.params.taskId;if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(a,n.sessionId);){if(s.type==="response"||s.type==="error"){let c=s.message,l=c.id,u=this._requestResolvers.get(l);if(u)if(this._requestResolvers.delete(l),s.type==="response")u(c);else{let d=c,p=new ne(d.error.code,d.error.message,d.error.data);u(p)}else{let d=s.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(s.message,{relatedRequestId:n.requestId})}}let o=await this._taskStore.getTask(a,n.sessionId);if(!o)throw new ne(me.InvalidParams,`Task not found: ${a}`);if(!po(o.status))return await this._waitForTaskUpdate(a,n.signal),await i();if(po(o.status)){let s=await this._taskStore.getTaskResult(a,n.sessionId);return this._clearTaskQueue(a),{...s,_meta:{...s._meta,[oo]:{taskId:a}}}}return await i()};return await i()}),this.setRequestHandler(_b,async(r,n)=>{try{let{tasks:i,nextCursor:a}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:a,_meta:{}}}catch(i){throw new ne(me.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(Sb,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ne(me.InvalidParams,`Task not found: ${r.params.taskId}`);if(po(i.status))throw new ne(me.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let a=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!a)throw new ne(me.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...a}}catch(i){throw i instanceof ne?i:new ne(me.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,i,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:a,onTimeout:i})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),ne.fromError(me.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=a=>{n?.(a),this._onerror(a)};let i=this._transport?.onmessage;this._transport.onmessage=(a,o)=>{i?.(a,o),jp(a)||xL(a)?this._onresponse(a):sk(a)?this._onrequest(a,o):_L(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();let r=ne.fromError(me.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,a=e.params?._meta?.[oo]?.taskId;if(n===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:me.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:u,timestamp:Date.now()},i?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):i?.send(u).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);let s=yL(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,l={signal:o.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{let d={relatedRequestId:e.id};a&&(d.relatedTask={taskId:a}),await this.notification(u,d)},sendRequest:async(u,d,p)=>{let m={...p,relatedRequestId:e.id};a&&!m.relatedTask&&(m.relatedTask={taskId:a});let f=m.relatedTask?.taskId??a;return f&&c&&await c.updateTaskStatus(f,"input_required"),await this.request(u,d,m)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:a,taskStore:c,taskRequestedTtl:s?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{s&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,l)).then(async u=>{if(o.signal.aborted)return;let d={result:u,jsonrpc:"2.0",id:e.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)},async u=>{if(o.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:me.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,i=Number(r),a=this._progressHandlers.get(i);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let o=this._responseHandlers.get(i),s=this._timeoutInfo.get(i);if(s&&o&&s.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),o(c);return}a(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),jp(e))n(e);else{let o=new ne(e.error.code,e.error.message,e.error.data);n(o)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let a=!1;if(jp(e)&&e.result&&typeof e.result=="object"){let o=e.result;if(o.task&&typeof o.task=="object"){let s=o.task;typeof s.taskId=="string"&&(a=!0,this._taskProgressTokens.set(s.taskId,r))}}if(a||this._progressHandlers.delete(r),jp(e))i(e);else{let o=ne.fromError(e.error.code,e.error.message,e.error.data);i(o)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(e,r,n)}}catch(o){yield{type:"error",error:o instanceof ne?o:new ne(me.InternalError,String(o))}}return}let a;try{let o=await this.request(e,bl,n);if(o.task)a=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new ne(me.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:a},n);if(yield{type:"taskStatus",task:s},po(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)}:s.status==="failed"?yield{type:"error",error:new ne(me.InternalError,`Task ${a} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new ne(me.InternalError,`Task ${a} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)};return}let c=s.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,c)),n?.signal?.throwIfAborted()}}catch(o){yield{type:"error",error:o instanceof ne?o:new ne(me.InternalError,String(o))}}}request(e,r,n){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,task:s,relatedTask:c}=n??{};return new Promise((l,u)=>{let d=b=>{u(b)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),s&&this.assertTaskCapability(e.method)}catch(b){d(b);return}n?.signal?.throwIfAborted();let p=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:p};n?.onprogress&&(this._progressHandlers.set(p,n.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),s&&(m.params={...m.params,task:s}),c&&(m.params={...m.params,_meta:{...m.params?._meta||{},[oo]:c}});let f=b=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(b)}},{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(C=>this._onerror(new Error(`Failed to send cancellation: ${C}`)));let x=b instanceof ne?b:new ne(me.RequestTimeout,String(b));u(x)};this._responseHandlers.set(p,b=>{if(!n?.signal?.aborted){if(b instanceof Error)return u(b);try{let x=uo(r,b.result);x.success?l(x.data):u(x.error)}catch(x){u(x)}}}),n?.signal?.addEventListener("abort",()=>{f(n?.signal?.reason)});let g=n?.timeout??Tre,h=()=>f(ne.fromError(me.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(p,g,n?.maxTotalTimeout,h,n?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let b=x=>{let C=this._responseHandlers.get(p);C?C(x):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,b),this._enqueueTaskMessage(v,{type:"request",message:m,timestamp:Date.now()}).catch(x=>{this._cleanupTimeout(p),u(x)})}else this._transport.send(m,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(b=>{this._cleanupTimeout(p),u(b)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},vb,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},xb,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},IL,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[oo]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[oo]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[oo]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=Ok(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,a)=>{let o=Dk(e,i);return Promise.resolve(r(o,a))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=Ok(e);this._notificationHandlers.set(n,i=>{let a=Dk(e,i);return Promise.resolve(r(a))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,i)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let i of n)if(i.type==="request"&&sk(i.message)){let a=i.message.id,o=this._requestResolvers.get(a);o?(o(new ne(me.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(e);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,a)=>{if(r.aborted){a(new ne(me.InvalidRequest,"Request cancelled"));return}let o=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(o),a(new ne(me.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!e)throw new Error("No request provided");return await n.createTask(i,e.id,{method:e.method,params:e.params},r)},getTask:async i=>{let a=await n.getTask(i,r);if(!a)throw new ne(me.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(i,a,o)=>{await n.storeTaskResult(i,a,o,r);let s=await n.getTask(i,r);if(s){let c=Fp.parse({method:"notifications/tasks/status",params:s});await this.notification(c),po(s.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,a,o)=>{let s=await n.getTask(i,r);if(!s)throw new ne(me.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(po(s.status))throw new ne(me.InvalidParams,`Cannot update task "${i}" from terminal status "${s.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,a,o,r);let c=await n.getTask(i,r);if(c){let l=Fp.parse({method:"notifications/tasks/status",params:c});await this.notification(l),po(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}};function UL(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function FL(t,e){let r={...t};for(let n in e){let i=n,a=e[i];if(a===void 0)continue;let o=r[i];UL(o)&&UL(a)?r[i]={...o,...a}:r[i]=a}return r}var kU=At(vE(),1),RU=At(CU(),1);function xce(){let t=new kU.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,RU.default)(t),t}var g_=class{constructor(e){this._ajv=e??xce()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var h_=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};function EU(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function AU(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var y_=class extends Ob{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Vp.options.map((n,i)=>[n,i])),this.isMessageIgnored=(n,i)=>{let a=this._loggingLevels.get(i);return a?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(a):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new g_,this.setRequestHandler(uk,n=>this._oninitialize(n)),this.setNotificationHandler(dk,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(xk,async(n,i)=>{let a=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:o}=n.params,s=Vp.safeParse(o);return s.success&&this._loggingLevels.set(a,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new h_(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=FL(this._capabilities,e)}setRequestHandler(e,r){let i=Tb(e)?.method;if(!i)throw new Error("Schema is missing a method literal");let a;if(Nl(i)){let s=i;a=s._zod?.def?.value??s.value}else{let s=i;a=s._def?.value??s.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");if(a==="tools/call"){let s=async(c,l)=>{let u=uo(Bp,c);if(!u.success){let f=u.error instanceof Error?u.error.message:String(u.error);throw new ne(me.InvalidParams,`Invalid tools/call request: ${f}`)}let{params:d}=u.data,p=await Promise.resolve(r(c,l));if(d.task){let f=uo(bl,p);if(!f.success){let g=f.error instanceof Error?f.error.message:String(f.error);throw new ne(me.InvalidParams,`Invalid task creation result: ${g}`)}return f.data}let m=uo(wb,p);if(!m.success){let f=m.error instanceof Error?m.error.message:String(m.error);throw new ne(me.InvalidParams,`Invalid tools/call result: ${f}`)}return m.data};return super.setRequestHandler(e,s)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){AU(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&EU(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:fL.includes(r)?r:ak,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},mb)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],i=Array.isArray(n.content)?n.content:[n.content],a=i.some(l=>l.type==="tool_result"),o=e.messages.length>1?e.messages[e.messages.length-2]:void 0,s=o?Array.isArray(o.content)?o.content:[o.content]:[],c=s.some(l=>l.type==="tool_use");if(a){if(i.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let l=new Set(s.filter(d=>d.type==="tool_use").map(d=>d.id)),u=new Set(i.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(l.size!==u.size||![...l].every(d=>u.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},wk,r):this.request({method:"sampling/createMessage",params:e},Sk,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let i=e;return this.request({method:"elicitation/create",params:i},Ib,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let i=e.mode==="form"?e:{...e,mode:"form"},a=await this.request({method:"elicitation/create",params:i},Ib,r);if(a.action==="accept"&&a.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(a.content);if(!s.valid)throw new ne(me.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(o){throw o instanceof ne?o:new ne(me.InternalError,`Error validating elicitation response: ${o instanceof Error?o.message:String(o)}`)}return a}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},Ik,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function Sce(){let t=process.env.WEPPY_ROBLOX_MCP_VERSION?.trim();return t||null}var Me=Sce()??"2.15.1";var CE={"claude-code":"Claude Code",claude:"Claude",cursor:"Cursor","codex-cli":"Codex CLI","openai-codex":"Codex CLI","gemini-cli":"Gemini CLI",windsurf:"Windsurf",cline:"Cline",continue:"Continue",zed:"Zed",vscode:"VS Code"};function TU(t){let e=t.toLowerCase();if(CE[e])return CE[e];for(let[r,n]of Object.entries(CE))if(e.includes(r))return n;return t}function OU(){return process.env.CLAUDECODE||process.env.CLAUDE_CODE_ENTRYPOINT?{name:"Claude Code",version:""}:process.env.CURSOR_EDITOR?{name:"Cursor",version:""}:process.env.WINDSURF_EDITOR?{name:"Windsurf",version:""}:process.env.CONTINUE_GLOBAL_DIR?{name:"Continue",version:""}:process.env.CLINE_CONTEXT?{name:"Cline",version:""}:null}var kE="weppy://ui-studio/guide",RE="weppy://ui-studio/tokens",EE="weppy://ui-studio/functional-rules",DU=`# UI Studio Guide
|
|
246
246
|
|
|
247
247
|
**Audience:** AI agents and developers building Roblox interfaces through UI Studio.
|
|
248
248
|
**Resource:** \`weppy://ui-studio/guide\`
|