@weppy/roblox-mcp 2.17.4 → 2.17.5

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 CHANGED
@@ -50,6 +50,13 @@ All notable changes to this project will be documented in this file.
50
50
 
51
51
 
52
52
 
53
+
54
+
55
+ ## [2.17.5] - 2026-09-18
56
+
57
+ ### Bug Fixes
58
+
59
+ - **Playtest status now follows Studio after pause and resume** — The Dashboard no longer remains stuck on Paused when Studio is running after a missed Pause request or a manual Resume. Test Actions become available again when Studio reports the newer running state, while delayed status messages cannot undo a pause that is still starting.
53
60
 
54
61
  ## [2.17.4] - 2026-09-16
55
62
 
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 No(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:Ul(e,"input",t.processors),output:Ul(e,"output",t.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function Dr(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 Dr(n.element,r);if(n.type==="set")return Dr(n.valueType,r);if(n.type==="lazy")return Dr(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 Dr(n.innerType,r);if(n.type==="intersection")return Dr(n.left,r)||Dr(n.right,r);if(n.type==="record"||n.type==="map")return Dr(n.keyType,r)||Dr(n.valueType,r);if(n.type==="pipe")return Dr(n.in,r)||Dr(n.out,r);if(n.type==="object"){for(let i in n.shape)if(Dr(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(Dr(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(Dr(i,r))return!0;return!!(n.rest&&Dr(n.rest,r))}return!1}var B0=(t,e={})=>r=>{let n=$o({...r,processors:e});return $e(t,n),Do(n,t),No(n,t)},Ul=(t,e,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=$o({...i??{},target:a,io:e,processors:r});return $e(t,o),Do(o,t),No(o,t)};var Sne={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},V0=(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=Sne[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}))])}},W0=(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)},H0=(t,e,r,n)=>{r.type="boolean"},Z0=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},G0=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},J0=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},K0=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Y0=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},X0=(t,e,r,n)=>{r.not={}},Q0=(t,e,r,n)=>{},ek=(t,e,r,n)=>{},tk=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},rk=(t,e,r,n)=>{let i=t._zod.def,a=Rp(i.entries);a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),r.enum=a},nk=(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},ik=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},ak=(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},ok=(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)},sk=(t,e,r,n)=>{r.type="boolean"},ck=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},lk=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},uk=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},dk=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},pk=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},mk=(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=$e(a.element,e,{...n,path:[...n.path,"items"]})},fk=(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]=$e(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=$e(a.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},$b=(t,e,r,n)=>{let i=t._zod.def,a=i.inclusive===!1,o=i.options.map((s,c)=>$e(s,e,{...n,path:[...n.path,a?"oneOf":"anyOf",c]}));a?r.oneOf=o:r.anyOf=o},gk=(t,e,r,n)=>{let i=t._zod.def,a=$e(i.left,e,{...n,path:[...n.path,"allOf",0]}),o=$e(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},hk=(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)=>$e(p,e,{...n,path:[...n.path,o,m]})),l=a.rest?$e(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)},yk=(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=$e(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=$e(a.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=$e(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)}},vk=(t,e,r,n)=>{let i=t._zod.def,a=$e(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"}]},bk=(t,e,r,n)=>{let i=t._zod.def;$e(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},_k=(t,e,r,n)=>{let i=t._zod.def;$e(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},xk=(t,e,r,n)=>{let i=t._zod.def;$e(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)))},Sk=(t,e,r,n)=>{let i=t._zod.def;$e(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},wk=(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;$e(a,e,n);let o=e.seen.get(t);o.ref=a},Ik=(t,e,r,n)=>{let i=t._zod.def;$e(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.readOnly=!0},Pk=(t,e,r,n)=>{let i=t._zod.def;$e(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},Db=(t,e,r,n)=>{let i=t._zod.def;$e(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},Ck=(t,e,r,n)=>{let i=t._zod.innerType;$e(i,e,n);let a=e.seen.get(t);a.ref=i},Ob={string:V0,number:W0,boolean:H0,bigint:Z0,symbol:G0,null:J0,undefined:K0,void:Y0,never:X0,any:Q0,unknown:ek,date:tk,enum:rk,literal:nk,nan:ik,template_literal:ak,file:ok,success:sk,custom:ck,function:lk,transform:uk,map:dk,set:pk,array:mk,object:fk,union:$b,intersection:gk,tuple:hk,record:yk,nullable:vk,nonoptional:bk,default:_k,prefault:xk,catch:Sk,pipe:wk,readonly:Ik,promise:Pk,optional:Db,lazy:Ck};function zl(t,e){if("_idmap"in t){let n=t,i=$o({...e,processors:Ob}),a={};for(let c of n._idmap.entries()){let[l,u]=c;$e(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;Do(i,u),o[l]=No(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=$o({...e,processors:Ob});return $e(t,r),Do(r,t),No(r,t)}var Nb=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=$o({processors:Ob,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 $e(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)),Do(this.ctx,e);let n=No(this.ctx,e),{"~standard":i,...a}=n;return a}};var l4={};var fm={};br(fm,{ZodAny:()=>Zk,ZodArray:()=>Yk,ZodBase64:()=>t_,ZodBase64URL:()=>r_,ZodBigInt:()=>Hl,ZodBigIntFormat:()=>a_,ZodBoolean:()=>Wl,ZodCIDRv4:()=>Qb,ZodCIDRv6:()=>e_,ZodCUID:()=>Hb,ZodCUID2:()=>Zb,ZodCatch:()=>yR,ZodCodec:()=>d_,ZodCustom:()=>Im,ZodCustomStringFormat:()=>Bl,ZodDate:()=>bm,ZodDefault:()=>dR,ZodDiscriminatedUnion:()=>Qk,ZodE164:()=>n_,ZodEmail:()=>Bb,ZodEmoji:()=>Vb,ZodEnum:()=>Fl,ZodExactOptional:()=>cR,ZodFile:()=>oR,ZodFunction:()=>CR,ZodGUID:()=>gm,ZodIPv4:()=>Yb,ZodIPv6:()=>Xb,ZodIntersection:()=>eR,ZodJWT:()=>i_,ZodKSUID:()=>Kb,ZodLazy:()=>wR,ZodLiteral:()=>aR,ZodMAC:()=>Bk,ZodMap:()=>nR,ZodNaN:()=>bR,ZodNanoID:()=>Wb,ZodNever:()=>Jk,ZodNonOptional:()=>l_,ZodNull:()=>Hk,ZodNullable:()=>uR,ZodNumber:()=>Vl,ZodNumberFormat:()=>Ys,ZodObject:()=>_m,ZodOptional:()=>c_,ZodPipe:()=>u_,ZodPrefault:()=>mR,ZodPromise:()=>PR,ZodReadonly:()=>_R,ZodRecord:()=>wm,ZodSet:()=>iR,ZodString:()=>ql,ZodStringFormat:()=>qe,ZodSuccess:()=>hR,ZodSymbol:()=>Vk,ZodTemplateLiteral:()=>SR,ZodTransform:()=>sR,ZodTuple:()=>tR,ZodType:()=>ae,ZodULID:()=>Gb,ZodURL:()=>vm,ZodUUID:()=>zi,ZodUndefined:()=>Wk,ZodUnion:()=>xm,ZodUnknown:()=>Gk,ZodVoid:()=>Kk,ZodXID:()=>Jb,ZodXor:()=>Xk,_ZodString:()=>qb,_default:()=>pR,_function:()=>pU,any:()=>G4,array:()=>pe,base64:()=>T4,base64url:()=>O4,bigint:()=>B4,boolean:()=>kt,catch:()=>vR,check:()=>mU,cidrv4:()=>E4,cidrv6:()=>A4,codec:()=>lU,cuid:()=>x4,cuid2:()=>S4,custom:()=>p_,date:()=>K4,describe:()=>fU,discriminatedUnion:()=>Sm,e164:()=>$4,email:()=>d4,emoji:()=>b4,enum:()=>cr,exactOptional:()=>lR,file:()=>aU,float32:()=>U4,float64:()=>z4,function:()=>pU,guid:()=>p4,hash:()=>L4,hex:()=>j4,hostname:()=>M4,httpUrl:()=>v4,instanceof:()=>hU,int:()=>Fb,int32:()=>F4,int64:()=>V4,intersection:()=>Gl,ipv4:()=>C4,ipv6:()=>R4,json:()=>vU,jwt:()=>D4,keyof:()=>Y4,ksuid:()=>P4,lazy:()=>IR,literal:()=>W,looseObject:()=>sr,looseRecord:()=>tU,mac:()=>k4,map:()=>rU,meta:()=>gU,nan:()=>cU,nanoid:()=>_4,nativeEnum:()=>iU,never:()=>o_,nonoptional:()=>gR,null:()=>Zl,nullable:()=>hm,nullish:()=>oU,number:()=>Ee,object:()=>F,optional:()=>et,partialRecord:()=>eU,pipe:()=>ym,prefault:()=>fR,preprocess:()=>Pm,promise:()=>dU,readonly:()=>xR,record:()=>Je,refine:()=>kR,set:()=>nU,strictObject:()=>X4,string:()=>R,stringFormat:()=>N4,stringbool:()=>yU,success:()=>sU,superRefine:()=>RR,symbol:()=>H4,templateLiteral:()=>uU,transform:()=>s_,tuple:()=>rR,uint32:()=>q4,uint64:()=>W4,ulid:()=>w4,undefined:()=>Z4,union:()=>je,unknown:()=>Be,url:()=>y4,uuid:()=>m4,uuidv4:()=>f4,uuidv6:()=>g4,uuidv7:()=>h4,void:()=>J4,xid:()=>I4,xor:()=>Q4});var Mb={};br(Mb,{endsWith:()=>Vs,gt:()=>li,gte:()=>or,includes:()=>qs,length:()=>Oo,lowercase:()=>zs,lt:()=>ci,lte:()=>$r,maxLength:()=>To,maxSize:()=>Ta,mime:()=>Ws,minLength:()=>Ui,minSize:()=>ui,multipleOf:()=>Aa,negative:()=>um,nonnegative:()=>pm,nonpositive:()=>dm,normalize:()=>Hs,overwrite:()=>jn,positive:()=>lm,property:()=>mm,regex:()=>Us,size:()=>Ao,slugify:()=>Ll,startsWith:()=>Bs,toLowerCase:()=>Gs,toUpperCase:()=>Js,trim:()=>Zs,uppercase:()=>Fs});var Mo={};br(Mo,{ZodISODate:()=>Lb,ZodISODateTime:()=>jb,ZodISODuration:()=>zb,ZodISOTime:()=>Ub,date:()=>Rk,datetime:()=>kk,duration:()=>Ak,time:()=>Ek});var jb=S("ZodISODateTime",(t,e)=>{Hy.init(t,e),qe.init(t,e)});function kk(t){return Xv(jb,t)}var Lb=S("ZodISODate",(t,e)=>{Zy.init(t,e),qe.init(t,e)});function Rk(t){return Qv(Lb,t)}var Ub=S("ZodISOTime",(t,e)=>{Gy.init(t,e),qe.init(t,e)});function Ek(t){return eb(Ub,t)}var zb=S("ZodISODuration",(t,e)=>{Jy.init(t,e),qe.init(t,e)});function Ak(t){return tb(zb,t)}var u4=(t,e)=>{$p.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>Sl(t,r)},flatten:{value:r=>xl(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,vl,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,vl,2)}},isEmpty:{get(){return t.issues.length===0}}})},Ine=S("ZodError",u4),Kr=S("ZodError",u4,{Parent:Error});var Tk=wl(Kr),Ok=Pl(Kr),$k=kl(Kr),Dk=Rl(Kr),Nk=vy(Kr),Mk=by(Kr),jk=_y(Kr),Lk=xy(Kr),Uk=Sy(Kr),zk=wy(Kr),Fk=Iy(Kr),qk=Py(Kr);var ae=S("ZodType",(t,e)=>(Q.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Ul(t,"input"),output:Ul(t,"output")}}),t.toJSONSchema=B0(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone(O.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)=>ar(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>Tk(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>$k(t,r,n),t.parseAsync=async(r,n)=>Ok(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Dk(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>Nk(t,r,n),t.decode=(r,n)=>Mk(t,r,n),t.encodeAsync=async(r,n)=>jk(t,r,n),t.decodeAsync=async(r,n)=>Lk(t,r,n),t.safeEncode=(r,n)=>Uk(t,r,n),t.safeDecode=(r,n)=>zk(t,r,n),t.safeEncodeAsync=async(r,n)=>Fk(t,r,n),t.safeDecodeAsync=async(r,n)=>qk(t,r,n),t.refine=(r,n)=>t.check(kR(r,n)),t.superRefine=r=>t.check(RR(r)),t.overwrite=r=>t.check(jn(r)),t.optional=()=>et(t),t.exactOptional=()=>lR(t),t.nullable=()=>hm(t),t.nullish=()=>et(hm(t)),t.nonoptional=r=>gR(t,r),t.array=()=>pe(t),t.or=r=>je([t,r]),t.and=r=>Gl(t,r),t.transform=r=>ym(t,s_(r)),t.default=r=>pR(t,r),t.prefault=r=>fR(t,r),t.catch=r=>vR(t,r),t.pipe=r=>ym(t,r),t.readonly=()=>xR(t),t.describe=r=>{let n=t.clone();return Vt.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return Vt.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return Vt.get(t);let n=t.clone();return Vt.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=r=>r(t),t)),qb=S("_ZodString",(t,e)=>{Eo.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(n,i,a)=>V0(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(Us(...n)),t.includes=(...n)=>t.check(qs(...n)),t.startsWith=(...n)=>t.check(Bs(...n)),t.endsWith=(...n)=>t.check(Vs(...n)),t.min=(...n)=>t.check(Ui(...n)),t.max=(...n)=>t.check(To(...n)),t.length=(...n)=>t.check(Oo(...n)),t.nonempty=(...n)=>t.check(Ui(1,...n)),t.lowercase=n=>t.check(zs(n)),t.uppercase=n=>t.check(Fs(n)),t.trim=()=>t.check(Zs()),t.normalize=(...n)=>t.check(Hs(...n)),t.toLowerCase=()=>t.check(Gs()),t.toUpperCase=()=>t.check(Js()),t.slugify=()=>t.check(Ll())}),ql=S("ZodString",(t,e)=>{Eo.init(t,e),qb.init(t,e),t.email=r=>t.check(Bp(Bb,r)),t.url=r=>t.check(jl(vm,r)),t.jwt=r=>t.check(cm(i_,r)),t.emoji=r=>t.check(Gp(Vb,r)),t.guid=r=>t.check(Ml(gm,r)),t.uuid=r=>t.check(Vp(zi,r)),t.uuidv4=r=>t.check(Wp(zi,r)),t.uuidv6=r=>t.check(Hp(zi,r)),t.uuidv7=r=>t.check(Zp(zi,r)),t.nanoid=r=>t.check(Jp(Wb,r)),t.guid=r=>t.check(Ml(gm,r)),t.cuid=r=>t.check(Kp(Hb,r)),t.cuid2=r=>t.check(Yp(Zb,r)),t.ulid=r=>t.check(Xp(Gb,r)),t.base64=r=>t.check(am(t_,r)),t.base64url=r=>t.check(om(r_,r)),t.xid=r=>t.check(Qp(Jb,r)),t.ksuid=r=>t.check(em(Kb,r)),t.ipv4=r=>t.check(tm(Yb,r)),t.ipv6=r=>t.check(rm(Xb,r)),t.cidrv4=r=>t.check(nm(Qb,r)),t.cidrv6=r=>t.check(im(e_,r)),t.e164=r=>t.check(sm(n_,r)),t.datetime=r=>t.check(kk(r)),t.date=r=>t.check(Rk(r)),t.time=r=>t.check(Ek(r)),t.duration=r=>t.check(Ak(r))});function R(t){return Gv(ql,t)}var qe=S("ZodStringFormat",(t,e)=>{Me.init(t,e),qb.init(t,e)}),Bb=S("ZodEmail",(t,e)=>{jy.init(t,e),qe.init(t,e)});function d4(t){return Bp(Bb,t)}var gm=S("ZodGUID",(t,e)=>{Ny.init(t,e),qe.init(t,e)});function p4(t){return Ml(gm,t)}var zi=S("ZodUUID",(t,e)=>{My.init(t,e),qe.init(t,e)});function m4(t){return Vp(zi,t)}function f4(t){return Wp(zi,t)}function g4(t){return Hp(zi,t)}function h4(t){return Zp(zi,t)}var vm=S("ZodURL",(t,e)=>{Ly.init(t,e),qe.init(t,e)});function y4(t){return jl(vm,t)}function v4(t){return jl(vm,{protocol:/^https?$/,hostname:Jr.domain,...O.normalizeParams(t)})}var Vb=S("ZodEmoji",(t,e)=>{Uy.init(t,e),qe.init(t,e)});function b4(t){return Gp(Vb,t)}var Wb=S("ZodNanoID",(t,e)=>{zy.init(t,e),qe.init(t,e)});function _4(t){return Jp(Wb,t)}var Hb=S("ZodCUID",(t,e)=>{Fy.init(t,e),qe.init(t,e)});function x4(t){return Kp(Hb,t)}var Zb=S("ZodCUID2",(t,e)=>{qy.init(t,e),qe.init(t,e)});function S4(t){return Yp(Zb,t)}var Gb=S("ZodULID",(t,e)=>{By.init(t,e),qe.init(t,e)});function w4(t){return Xp(Gb,t)}var Jb=S("ZodXID",(t,e)=>{Vy.init(t,e),qe.init(t,e)});function I4(t){return Qp(Jb,t)}var Kb=S("ZodKSUID",(t,e)=>{Wy.init(t,e),qe.init(t,e)});function P4(t){return em(Kb,t)}var Yb=S("ZodIPv4",(t,e)=>{Ky.init(t,e),qe.init(t,e)});function C4(t){return tm(Yb,t)}var Bk=S("ZodMAC",(t,e)=>{Xy.init(t,e),qe.init(t,e)});function k4(t){return Kv(Bk,t)}var Xb=S("ZodIPv6",(t,e)=>{Yy.init(t,e),qe.init(t,e)});function R4(t){return rm(Xb,t)}var Qb=S("ZodCIDRv4",(t,e)=>{Qy.init(t,e),qe.init(t,e)});function E4(t){return nm(Qb,t)}var e_=S("ZodCIDRv6",(t,e)=>{ev.init(t,e),qe.init(t,e)});function A4(t){return im(e_,t)}var t_=S("ZodBase64",(t,e)=>{tv.init(t,e),qe.init(t,e)});function T4(t){return am(t_,t)}var r_=S("ZodBase64URL",(t,e)=>{rv.init(t,e),qe.init(t,e)});function O4(t){return om(r_,t)}var n_=S("ZodE164",(t,e)=>{nv.init(t,e),qe.init(t,e)});function $4(t){return sm(n_,t)}var i_=S("ZodJWT",(t,e)=>{iv.init(t,e),qe.init(t,e)});function D4(t){return cm(i_,t)}var Bl=S("ZodCustomStringFormat",(t,e)=>{av.init(t,e),qe.init(t,e)});function N4(t,e,r={}){return Ks(Bl,t,e,r)}function M4(t){return Ks(Bl,"hostname",Jr.hostname,t)}function j4(t){return Ks(Bl,"hex",Jr.hex,t)}function L4(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Jr[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Ks(Bl,n,i,e)}var Vl=S("ZodNumber",(t,e)=>{jp.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(n,i,a)=>W0(t,n,i,a),t.gt=(n,i)=>t.check(li(n,i)),t.gte=(n,i)=>t.check(or(n,i)),t.min=(n,i)=>t.check(or(n,i)),t.lt=(n,i)=>t.check(ci(n,i)),t.lte=(n,i)=>t.check($r(n,i)),t.max=(n,i)=>t.check($r(n,i)),t.int=n=>t.check(Fb(n)),t.safe=n=>t.check(Fb(n)),t.positive=n=>t.check(li(0,n)),t.nonnegative=n=>t.check(or(0,n)),t.negative=n=>t.check(ci(0,n)),t.nonpositive=n=>t.check($r(0,n)),t.multipleOf=(n,i)=>t.check(Aa(n,i)),t.step=(n,i)=>t.check(Aa(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 Ee(t){return rb(Vl,t)}var Ys=S("ZodNumberFormat",(t,e)=>{ov.init(t,e),Vl.init(t,e)});function Fb(t){return ib(Ys,t)}function U4(t){return ab(Ys,t)}function z4(t){return ob(Ys,t)}function F4(t){return sb(Ys,t)}function q4(t){return cb(Ys,t)}var Wl=S("ZodBoolean",(t,e)=>{Tl.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>H0(t,r,n,i)});function kt(t){return lb(Wl,t)}var Hl=S("ZodBigInt",(t,e)=>{Lp.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(n,i,a)=>Z0(t,n,i,a),t.gte=(n,i)=>t.check(or(n,i)),t.min=(n,i)=>t.check(or(n,i)),t.gt=(n,i)=>t.check(li(n,i)),t.gte=(n,i)=>t.check(or(n,i)),t.min=(n,i)=>t.check(or(n,i)),t.lt=(n,i)=>t.check(ci(n,i)),t.lte=(n,i)=>t.check($r(n,i)),t.max=(n,i)=>t.check($r(n,i)),t.positive=n=>t.check(li(BigInt(0),n)),t.negative=n=>t.check(ci(BigInt(0),n)),t.nonpositive=n=>t.check($r(BigInt(0),n)),t.nonnegative=n=>t.check(or(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(Aa(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function B4(t){return db(Hl,t)}var a_=S("ZodBigIntFormat",(t,e)=>{sv.init(t,e),Hl.init(t,e)});function V4(t){return mb(a_,t)}function W4(t){return fb(a_,t)}var Vk=S("ZodSymbol",(t,e)=>{cv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>G0(t,r,n,i)});function H4(t){return gb(Vk,t)}var Wk=S("ZodUndefined",(t,e)=>{lv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>K0(t,r,n,i)});function Z4(t){return hb(Wk,t)}var Hk=S("ZodNull",(t,e)=>{uv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>J0(t,r,n,i)});function Zl(t){return yb(Hk,t)}var Zk=S("ZodAny",(t,e)=>{dv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Q0(t,r,n,i)});function G4(){return vb(Zk)}var Gk=S("ZodUnknown",(t,e)=>{pv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ek(t,r,n,i)});function Be(){return bb(Gk)}var Jk=S("ZodNever",(t,e)=>{mv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>X0(t,r,n,i)});function o_(t){return _b(Jk,t)}var Kk=S("ZodVoid",(t,e)=>{fv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Y0(t,r,n,i)});function J4(t){return xb(Kk,t)}var bm=S("ZodDate",(t,e)=>{gv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(n,i,a)=>tk(t,n,i,a),t.min=(n,i)=>t.check(or(n,i)),t.max=(n,i)=>t.check($r(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 K4(t){return Sb(bm,t)}var Yk=S("ZodArray",(t,e)=>{hv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mk(t,r,n,i),t.element=e.element,t.min=(r,n)=>t.check(Ui(r,n)),t.nonempty=r=>t.check(Ui(1,r)),t.max=(r,n)=>t.check(To(r,n)),t.length=(r,n)=>t.check(Oo(r,n)),t.unwrap=()=>t.element});function pe(t,e){return q0(Yk,t,e)}function Y4(t){let e=t._zod.def.shape;return cr(Object.keys(e))}var _m=S("ZodObject",(t,e)=>{F0.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fk(t,r,n,i),O.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>cr(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Be()}),t.loose=()=>t.clone({...t._zod.def,catchall:Be()}),t.strict=()=>t.clone({...t._zod.def,catchall:o_()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>O.extend(t,r),t.safeExtend=r=>O.safeExtend(t,r),t.merge=r=>O.merge(t,r),t.pick=r=>O.pick(t,r),t.omit=r=>O.omit(t,r),t.partial=(...r)=>O.partial(c_,t,r[0]),t.required=(...r)=>O.required(l_,t,r[0])});function F(t,e){let r={type:"object",shape:t??{},...O.normalizeParams(e)};return new _m(r)}function X4(t,e){return new _m({type:"object",shape:t,catchall:o_(),...O.normalizeParams(e)})}function sr(t,e){return new _m({type:"object",shape:t,catchall:Be(),...O.normalizeParams(e)})}var xm=S("ZodUnion",(t,e)=>{Ol.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$b(t,r,n,i),t.options=e.options});function je(t,e){return new xm({type:"union",options:t,...O.normalizeParams(e)})}var Xk=S("ZodXor",(t,e)=>{xm.init(t,e),yv.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$b(t,r,n,i),t.options=e.options});function Q4(t,e){return new Xk({type:"union",options:t,inclusive:!1,...O.normalizeParams(e)})}var Qk=S("ZodDiscriminatedUnion",(t,e)=>{xm.init(t,e),vv.init(t,e)});function Sm(t,e,r){return new Qk({type:"union",options:e,discriminator:t,...O.normalizeParams(r)})}var eR=S("ZodIntersection",(t,e)=>{bv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gk(t,r,n,i)});function Gl(t,e){return new eR({type:"intersection",left:t,right:e})}var tR=S("ZodTuple",(t,e)=>{Up.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hk(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function rR(t,e,r){let n=e instanceof Q,i=n?r:e,a=n?e:null;return new tR({type:"tuple",items:t,rest:a,...O.normalizeParams(i)})}var wm=S("ZodRecord",(t,e)=>{_v.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yk(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function Je(t,e,r){return new wm({type:"record",keyType:t,valueType:e,...O.normalizeParams(r)})}function eU(t,e,r){let n=ar(t);return n._zod.values=void 0,new wm({type:"record",keyType:n,valueType:e,...O.normalizeParams(r)})}function tU(t,e,r){return new wm({type:"record",keyType:t,valueType:e,mode:"loose",...O.normalizeParams(r)})}var nR=S("ZodMap",(t,e)=>{xv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dk(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(ui(...r)),t.nonempty=r=>t.check(ui(1,r)),t.max=(...r)=>t.check(Ta(...r)),t.size=(...r)=>t.check(Ao(...r))});function rU(t,e,r){return new nR({type:"map",keyType:t,valueType:e,...O.normalizeParams(r)})}var iR=S("ZodSet",(t,e)=>{Sv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pk(t,r,n,i),t.min=(...r)=>t.check(ui(...r)),t.nonempty=r=>t.check(ui(1,r)),t.max=(...r)=>t.check(Ta(...r)),t.size=(...r)=>t.check(Ao(...r))});function nU(t,e){return new iR({type:"set",valueType:t,...O.normalizeParams(e)})}var Fl=S("ZodEnum",(t,e)=>{wv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(n,i,a)=>rk(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 Fl({...e,checks:[],...O.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 Fl({...e,checks:[],...O.normalizeParams(i),entries:a})}});function cr(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Fl({type:"enum",entries:r,...O.normalizeParams(e)})}function iU(t,e){return new Fl({type:"enum",entries:t,...O.normalizeParams(e)})}var aR=S("ZodLiteral",(t,e)=>{Iv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nk(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 W(t,e){return new aR({type:"literal",values:Array.isArray(t)?t:[t],...O.normalizeParams(e)})}var oR=S("ZodFile",(t,e)=>{Pv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ok(t,r,n,i),t.min=(r,n)=>t.check(ui(r,n)),t.max=(r,n)=>t.check(Ta(r,n)),t.mime=(r,n)=>t.check(Ws(Array.isArray(r)?r:[r],n))});function aU(t){return Pb(oR,t)}var sR=S("ZodTransform",(t,e)=>{Cv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uk(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Io(t.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(O.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(O.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 s_(t){return new sR({type:"transform",transform:t})}var c_=S("ZodOptional",(t,e)=>{zp.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Db(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function et(t){return new c_({type:"optional",innerType:t})}var cR=S("ZodExactOptional",(t,e)=>{kv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Db(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function lR(t){return new cR({type:"optional",innerType:t})}var uR=S("ZodNullable",(t,e)=>{Rv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function hm(t){return new uR({type:"nullable",innerType:t})}function oU(t){return et(hm(t))}var dR=S("ZodDefault",(t,e)=>{Ev.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_k(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function pR(t,e){return new dR({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():O.shallowClone(e)}})}var mR=S("ZodPrefault",(t,e)=>{Av.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function fR(t,e){return new mR({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():O.shallowClone(e)}})}var l_=S("ZodNonOptional",(t,e)=>{Tv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function gR(t,e){return new l_({type:"nonoptional",innerType:t,...O.normalizeParams(e)})}var hR=S("ZodSuccess",(t,e)=>{Ov.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function sU(t){return new hR({type:"success",innerType:t})}var yR=S("ZodCatch",(t,e)=>{$v.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Sk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function vR(t,e){return new yR({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var bR=S("ZodNaN",(t,e)=>{Dv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ik(t,r,n,i)});function cU(t){return Ib(bR,t)}var u_=S("ZodPipe",(t,e)=>{Nv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wk(t,r,n,i),t.in=e.in,t.out=e.out});function ym(t,e){return new u_({type:"pipe",in:t,out:e})}var d_=S("ZodCodec",(t,e)=>{u_.init(t,e),$l.init(t,e)});function lU(t,e,r){return new d_({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}var _R=S("ZodReadonly",(t,e)=>{Mv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Ik(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function xR(t){return new _R({type:"readonly",innerType:t})}var SR=S("ZodTemplateLiteral",(t,e)=>{jv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ak(t,r,n,i)});function uU(t,e){return new SR({type:"template_literal",parts:t,...O.normalizeParams(e)})}var wR=S("ZodLazy",(t,e)=>{zv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Ck(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});function IR(t){return new wR({type:"lazy",getter:t})}var PR=S("ZodPromise",(t,e)=>{Uv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Pk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function dU(t){return new PR({type:"promise",innerType:t})}var CR=S("ZodFunction",(t,e)=>{Lv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lk(t,r,n,i)});function pU(t){return new CR({type:"function",input:Array.isArray(t?.input)?rR(t?.input):t?.input??pe(Be()),output:t?.output??Be()})}var Im=S("ZodCustom",(t,e)=>{Fv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ck(t,r,n,i)});function mU(t){let e=new Fe({check:"custom"});return e._zod.check=t,e}function p_(t,e){return Cb(Im,t??(()=>!0),e)}function kR(t,e={}){return kb(Im,t,e)}function RR(t){return Rb(t)}var fU=Eb,gU=Ab;function hU(t,e={}){let r=new Im({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...O.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 yU=(...t)=>Tb({Codec:d_,Boolean:Wl,String:ql},...t);function vU(t){let e=IR(()=>je([R(t),Ee(),kt(),Zl(),pe(e),Je(R(),e)]));return e}function Pm(t,e){return ym(s_(t),e)}var Cne={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 kne(t){gt({customError:t})}function Rne(){return gt().customError}var ER;ER||(ER={});var L={...fm,...Mb,iso:Mo},Ene=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 Ane(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 Tne(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 bU(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return L.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 L.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=Tne(i,e),o=xr(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 L.null();if(i.length===0)return L.never();if(i.length===1)return L.literal(i[0]);if(i.every(o=>typeof o=="string"))return L.enum(i);let a=i.map(o=>L.literal(o));return a.length<2?a[0]:L.union([a[0],a[1],...a.slice(2)])}if(t.const!==void 0)return L.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(a=>{let o={...t,type:a};return bU(o,e)});return i.length===0?L.never():i.length===1?i[0]:L.union(i)}if(!r)return L.any();let n;switch(r){case"string":{let i=L.string();if(t.format){let a=t.format;a==="email"?i=i.check(L.email()):a==="uri"||a==="uri-reference"?i=i.check(L.url()):a==="uuid"||a==="guid"?i=i.check(L.uuid()):a==="date-time"?i=i.check(L.iso.datetime()):a==="date"?i=i.check(L.iso.date()):a==="time"?i=i.check(L.iso.time()):a==="duration"?i=i.check(L.iso.duration()):a==="ipv4"?i=i.check(L.ipv4()):a==="ipv6"?i=i.check(L.ipv6()):a==="mac"?i=i.check(L.mac()):a==="cidr"?i=i.check(L.cidrv4()):a==="cidr-v6"?i=i.check(L.cidrv6()):a==="base64"?i=i.check(L.base64()):a==="base64url"?i=i.check(L.base64url()):a==="e164"?i=i.check(L.e164()):a==="jwt"?i=i.check(L.jwt()):a==="emoji"?i=i.check(L.emoji()):a==="nanoid"?i=i.check(L.nanoid()):a==="cuid"?i=i.check(L.cuid()):a==="cuid2"?i=i.check(L.cuid2()):a==="ulid"?i=i.check(L.ulid()):a==="xid"?i=i.check(L.xid()):a==="ksuid"&&(i=i.check(L.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"?L.number().int():L.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=L.boolean();break}case"null":{n=L.null();break}case"object":{let i={},a=t.properties||{},o=new Set(t.required||[]);for(let[c,l]of Object.entries(a)){let u=xr(l,e);i[c]=o.has(c)?u:u.optional()}if(t.propertyNames){let c=xr(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?xr(t.additionalProperties,e):L.any();if(Object.keys(i).length===0){n=L.record(c,l);break}let u=L.object(i).passthrough(),d=L.looseRecord(c,l);n=L.intersection(u,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),u=[];for(let p of l){let m=xr(c[p],e),f=L.string().regex(new RegExp(p));u.push(L.looseRecord(f,m))}let d=[];if(Object.keys(i).length>0&&d.push(L.object(i).passthrough()),d.push(...u),d.length===0)n=L.object({}).passthrough();else if(d.length===1)n=d[0];else{let p=L.intersection(d[0],d[1]);for(let m=2;m<d.length;m++)p=L.intersection(p,d[m]);n=p}break}let s=L.object(i);t.additionalProperties===!1?n=s.strict():typeof t.additionalProperties=="object"?n=s.catchall(xr(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=>xr(c,e)),s=a&&typeof a=="object"&&!Array.isArray(a)?xr(a,e):void 0;s?n=L.tuple(o).rest(s):n=L.tuple(o),typeof t.minItems=="number"&&(n=n.check(L.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(L.maxLength(t.maxItems)))}else if(Array.isArray(a)){let o=a.map(c=>xr(c,e)),s=t.additionalItems&&typeof t.additionalItems=="object"?xr(t.additionalItems,e):void 0;s?n=L.tuple(o).rest(s):n=L.tuple(o),typeof t.minItems=="number"&&(n=n.check(L.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(L.maxLength(t.maxItems)))}else if(a!==void 0){let o=xr(a,e),s=L.array(o);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),n=s}else n=L.array(L.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 xr(t,e){if(typeof t=="boolean")return t?L.any():L.never();let r=bU(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=>xr(l,e)),c=L.union(s);r=n?L.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(l=>xr(l,e)),c=L.xor(s);r=n?L.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:L.any();else{let s=n?r:xr(t.allOf[0],e),c=n?0:1;for(let l=c;l<t.allOf.length;l++)s=L.intersection(s,xr(t.allOf[l],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=L.nullable(r)),t.readOnly===!0&&(r=L.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))Ene.has(s)||(i[s]=t[s]);return Object.keys(i).length>0&&e.registry.add(r,i),r}function _U(t,e){if(typeof t=="boolean")return t?L.any():L.never();let r=Ane(t,e?.defaultTarget),n=t.$defs||t.definitions||{},i={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:t,registry:e?.registry??Vt};return xr(t,i)}var AR={};br(AR,{bigint:()=>Nne,boolean:()=>Dne,date:()=>Mne,number:()=>$ne,string:()=>One});function One(t){return Jv(ql,t)}function $ne(t){return nb(Vl,t)}function Dne(t){return ub(Wl,t)}function Nne(t){return pb(Hl,t)}function Mne(t){return wb(bm,t)}gt(qv());var OR="2025-11-25";var xU=[OR,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],jo="io.modelcontextprotocol/related-task",f_="2.0",lr=p_(t=>t!==null&&(typeof t=="object"||typeof t=="function")),SU=je([R(),Ee().int()]),wU=R(),fFe=sr({ttl:je([Ee(),Zl()]).optional(),pollInterval:Ee().optional()}),Lne=F({ttl:Ee().optional()}),Une=F({taskId:R()}),$R=sr({progressToken:SU.optional(),[jo]:Une.optional()}),bn=F({_meta:$R.optional()}),Cm=bn.extend({task:Lne.optional()}),IU=t=>Cm.safeParse(t).success,ur=F({method:R(),params:bn.loose().optional()}),Ln=F({_meta:$R.optional()}),Un=F({method:R(),params:Ln.loose().optional()}),dr=sr({_meta:$R.optional()}),g_=je([R(),Ee().int()]),PU=F({jsonrpc:W(f_),id:g_,...ur.shape}).strict(),DR=t=>PU.safeParse(t).success,CU=F({jsonrpc:W(f_),...Un.shape}).strict(),kU=t=>CU.safeParse(t).success,NR=F({jsonrpc:W(f_),id:g_,result:dr}).strict(),km=t=>NR.safeParse(t).success;var xe;(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"})(xe||(xe={}));var MR=F({jsonrpc:W(f_),id:g_.optional(),error:F({code:Ee().int(),message:R(),data:Be().optional()})}).strict();var RU=t=>MR.safeParse(t).success;var EU=je([PU,CU,NR,MR]),gFe=je([NR,MR]),h_=dr.strict(),zne=Ln.extend({requestId:g_.optional(),reason:R().optional()}),y_=Un.extend({method:W("notifications/cancelled"),params:zne}),Fne=F({src:R(),mimeType:R().optional(),sizes:pe(R()).optional(),theme:cr(["light","dark"]).optional()}),Rm=F({icons:pe(Fne).optional()}),Jl=F({name:R(),title:R().optional()}),AU=Jl.extend({...Jl.shape,...Rm.shape,version:R(),websiteUrl:R().optional(),description:R().optional()}),qne=Gl(F({applyDefaults:kt().optional()}),Je(R(),Be())),Bne=Pm(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Gl(F({form:qne.optional(),url:lr.optional()}),Je(R(),Be()).optional())),Vne=sr({list:lr.optional(),cancel:lr.optional(),requests:sr({sampling:sr({createMessage:lr.optional()}).optional(),elicitation:sr({create:lr.optional()}).optional()}).optional()}),Wne=sr({list:lr.optional(),cancel:lr.optional(),requests:sr({tools:sr({call:lr.optional()}).optional()}).optional()}),Hne=F({experimental:Je(R(),lr).optional(),sampling:F({context:lr.optional(),tools:lr.optional()}).optional(),elicitation:Bne.optional(),roots:F({listChanged:kt().optional()}).optional(),tasks:Vne.optional()}),Zne=bn.extend({protocolVersion:R(),capabilities:Hne,clientInfo:AU}),jR=ur.extend({method:W("initialize"),params:Zne});var Gne=F({experimental:Je(R(),lr).optional(),logging:lr.optional(),completions:lr.optional(),prompts:F({listChanged:kt().optional()}).optional(),resources:F({subscribe:kt().optional(),listChanged:kt().optional()}).optional(),tools:F({listChanged:kt().optional()}).optional(),tasks:Wne.optional()}),Jne=dr.extend({protocolVersion:R(),capabilities:Gne,serverInfo:AU,instructions:R().optional()}),LR=Un.extend({method:W("notifications/initialized"),params:Ln.optional()});var v_=ur.extend({method:W("ping"),params:bn.optional()}),Kne=F({progress:Ee(),total:et(Ee()),message:et(R())}),Yne=F({...Ln.shape,...Kne.shape,progressToken:SU}),b_=Un.extend({method:W("notifications/progress"),params:Yne}),Xne=bn.extend({cursor:wU.optional()}),Em=ur.extend({params:Xne.optional()}),Am=dr.extend({nextCursor:wU.optional()}),Qne=cr(["working","input_required","completed","failed","cancelled"]),Tm=F({taskId:R(),status:Qne,ttl:je([Ee(),Zl()]),createdAt:R(),lastUpdatedAt:R(),pollInterval:et(Ee()),statusMessage:et(R())}),Kl=dr.extend({task:Tm}),eie=Ln.merge(Tm),Om=Un.extend({method:W("notifications/tasks/status"),params:eie}),__=ur.extend({method:W("tasks/get"),params:bn.extend({taskId:R()})}),x_=dr.merge(Tm),S_=ur.extend({method:W("tasks/result"),params:bn.extend({taskId:R()})}),hFe=dr.loose(),w_=Em.extend({method:W("tasks/list")}),I_=Am.extend({tasks:pe(Tm)}),P_=ur.extend({method:W("tasks/cancel"),params:bn.extend({taskId:R()})}),TU=dr.merge(Tm),OU=F({uri:R(),mimeType:et(R()),_meta:Je(R(),Be()).optional()}),$U=OU.extend({text:R()}),UR=R().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),DU=OU.extend({blob:UR}),$m=cr(["user","assistant"]),Yl=F({audience:pe($m).optional(),priority:Ee().min(0).max(1).optional(),lastModified:Mo.datetime({offset:!0}).optional()}),NU=F({...Jl.shape,...Rm.shape,uri:R(),description:et(R()),mimeType:et(R()),annotations:Yl.optional(),_meta:et(sr({}))}),tie=F({...Jl.shape,...Rm.shape,uriTemplate:R(),description:et(R()),mimeType:et(R()),annotations:Yl.optional(),_meta:et(sr({}))}),zR=Em.extend({method:W("resources/list")}),rie=Am.extend({resources:pe(NU)}),nie=Em.extend({method:W("resources/templates/list")}),iie=Am.extend({resourceTemplates:pe(tie)}),FR=bn.extend({uri:R()}),aie=FR,qR=ur.extend({method:W("resources/read"),params:aie}),oie=dr.extend({contents:pe(je([$U,DU]))}),sie=Un.extend({method:W("notifications/resources/list_changed"),params:Ln.optional()}),cie=FR,lie=ur.extend({method:W("resources/subscribe"),params:cie}),uie=FR,die=ur.extend({method:W("resources/unsubscribe"),params:uie}),pie=Ln.extend({uri:R()}),mie=Un.extend({method:W("notifications/resources/updated"),params:pie}),fie=F({name:R(),description:et(R()),required:et(kt())}),gie=F({...Jl.shape,...Rm.shape,description:et(R()),arguments:et(pe(fie)),_meta:et(sr({}))}),hie=Em.extend({method:W("prompts/list")}),yie=Am.extend({prompts:pe(gie)}),vie=bn.extend({name:R(),arguments:Je(R(),R()).optional()}),bie=ur.extend({method:W("prompts/get"),params:vie}),BR=F({type:W("text"),text:R(),annotations:Yl.optional(),_meta:Je(R(),Be()).optional()}),VR=F({type:W("image"),data:UR,mimeType:R(),annotations:Yl.optional(),_meta:Je(R(),Be()).optional()}),WR=F({type:W("audio"),data:UR,mimeType:R(),annotations:Yl.optional(),_meta:Je(R(),Be()).optional()}),_ie=F({type:W("tool_use"),name:R(),id:R(),input:Je(R(),Be()),_meta:Je(R(),Be()).optional()}),xie=F({type:W("resource"),resource:je([$U,DU]),annotations:Yl.optional(),_meta:Je(R(),Be()).optional()}),Sie=NU.extend({type:W("resource_link")}),HR=je([BR,VR,WR,Sie,xie]),wie=F({role:$m,content:HR}),Iie=dr.extend({description:R().optional(),messages:pe(wie)}),Pie=Un.extend({method:W("notifications/prompts/list_changed"),params:Ln.optional()}),Cie=F({title:R().optional(),readOnlyHint:kt().optional(),destructiveHint:kt().optional(),idempotentHint:kt().optional(),openWorldHint:kt().optional()}),kie=F({taskSupport:cr(["required","optional","forbidden"]).optional()}),MU=F({...Jl.shape,...Rm.shape,description:R().optional(),inputSchema:F({type:W("object"),properties:Je(R(),lr).optional(),required:pe(R()).optional()}).catchall(Be()),outputSchema:F({type:W("object"),properties:Je(R(),lr).optional(),required:pe(R()).optional()}).catchall(Be()).optional(),annotations:Cie.optional(),execution:kie.optional(),_meta:Je(R(),Be()).optional()}),ZR=Em.extend({method:W("tools/list")}),Rie=Am.extend({tools:pe(MU)}),C_=dr.extend({content:pe(HR).default([]),structuredContent:Je(R(),Be()).optional(),isError:kt().optional()}),yFe=C_.or(dr.extend({toolResult:Be()})),Eie=Cm.extend({name:R(),arguments:Je(R(),Be()).optional()}),Dm=ur.extend({method:W("tools/call"),params:Eie}),Aie=Un.extend({method:W("notifications/tools/list_changed"),params:Ln.optional()}),vFe=F({autoRefresh:kt().default(!0),debounceMs:Ee().int().nonnegative().default(300)}),Nm=cr(["debug","info","notice","warning","error","critical","alert","emergency"]),Tie=bn.extend({level:Nm}),GR=ur.extend({method:W("logging/setLevel"),params:Tie}),Oie=Ln.extend({level:Nm,logger:R().optional(),data:Be()}),$ie=Un.extend({method:W("notifications/message"),params:Oie}),Die=F({name:R().optional()}),Nie=F({hints:pe(Die).optional(),costPriority:Ee().min(0).max(1).optional(),speedPriority:Ee().min(0).max(1).optional(),intelligencePriority:Ee().min(0).max(1).optional()}),Mie=F({mode:cr(["auto","required","none"]).optional()}),jie=F({type:W("tool_result"),toolUseId:R().describe("The unique identifier for the corresponding tool call."),content:pe(HR).default([]),structuredContent:F({}).loose().optional(),isError:kt().optional(),_meta:Je(R(),Be()).optional()}),Lie=Sm("type",[BR,VR,WR]),m_=Sm("type",[BR,VR,WR,_ie,jie]),Uie=F({role:$m,content:je([m_,pe(m_)]),_meta:Je(R(),Be()).optional()}),zie=Cm.extend({messages:pe(Uie),modelPreferences:Nie.optional(),systemPrompt:R().optional(),includeContext:cr(["none","thisServer","allServers"]).optional(),temperature:Ee().optional(),maxTokens:Ee().int(),stopSequences:pe(R()).optional(),metadata:lr.optional(),tools:pe(MU).optional(),toolChoice:Mie.optional()}),Fie=ur.extend({method:W("sampling/createMessage"),params:zie}),JR=dr.extend({model:R(),stopReason:et(cr(["endTurn","stopSequence","maxTokens"]).or(R())),role:$m,content:Lie}),KR=dr.extend({model:R(),stopReason:et(cr(["endTurn","stopSequence","maxTokens","toolUse"]).or(R())),role:$m,content:je([m_,pe(m_)])}),qie=F({type:W("boolean"),title:R().optional(),description:R().optional(),default:kt().optional()}),Bie=F({type:W("string"),title:R().optional(),description:R().optional(),minLength:Ee().optional(),maxLength:Ee().optional(),format:cr(["email","uri","date","date-time"]).optional(),default:R().optional()}),Vie=F({type:cr(["number","integer"]),title:R().optional(),description:R().optional(),minimum:Ee().optional(),maximum:Ee().optional(),default:Ee().optional()}),Wie=F({type:W("string"),title:R().optional(),description:R().optional(),enum:pe(R()),default:R().optional()}),Hie=F({type:W("string"),title:R().optional(),description:R().optional(),oneOf:pe(F({const:R(),title:R()})),default:R().optional()}),Zie=F({type:W("string"),title:R().optional(),description:R().optional(),enum:pe(R()),enumNames:pe(R()).optional(),default:R().optional()}),Gie=je([Wie,Hie]),Jie=F({type:W("array"),title:R().optional(),description:R().optional(),minItems:Ee().optional(),maxItems:Ee().optional(),items:F({type:W("string"),enum:pe(R())}),default:pe(R()).optional()}),Kie=F({type:W("array"),title:R().optional(),description:R().optional(),minItems:Ee().optional(),maxItems:Ee().optional(),items:F({anyOf:pe(F({const:R(),title:R()}))}),default:pe(R()).optional()}),Yie=je([Jie,Kie]),Xie=je([Zie,Gie,Yie]),Qie=je([Xie,qie,Bie,Vie]),eae=Cm.extend({mode:W("form").optional(),message:R(),requestedSchema:F({type:W("object"),properties:Je(R(),Qie),required:pe(R()).optional()})}),tae=Cm.extend({mode:W("url"),message:R(),elicitationId:R(),url:R().url()}),rae=je([eae,tae]),nae=ur.extend({method:W("elicitation/create"),params:rae}),iae=Ln.extend({elicitationId:R()}),aae=Un.extend({method:W("notifications/elicitation/complete"),params:iae}),k_=dr.extend({action:cr(["accept","decline","cancel"]),content:Pm(t=>t===null?void 0:t,Je(R(),je([R(),Ee(),kt(),pe(R())])).optional())}),oae=F({type:W("ref/resource"),uri:R()});var sae=F({type:W("ref/prompt"),name:R()}),cae=bn.extend({ref:je([sae,oae]),argument:F({name:R(),value:R()}),context:F({arguments:Je(R(),R()).optional()}).optional()}),lae=ur.extend({method:W("completion/complete"),params:cae});var uae=dr.extend({completion:sr({values:pe(R()).max(100),total:et(Ee().int()),hasMore:et(kt())})}),dae=F({uri:R().startsWith("file://"),name:R().optional(),_meta:Je(R(),Be()).optional()}),pae=ur.extend({method:W("roots/list"),params:bn.optional()}),YR=dr.extend({roots:pe(dae)}),mae=Un.extend({method:W("notifications/roots/list_changed"),params:Ln.optional()}),bFe=je([v_,jR,lae,GR,bie,hie,zR,nie,qR,lie,die,Dm,ZR,__,S_,w_,P_]),_Fe=je([y_,b_,LR,mae,Om]),xFe=je([h_,JR,KR,k_,YR,x_,I_,Kl]),SFe=je([v_,Fie,nae,pae,__,S_,w_,P_]),wFe=je([y_,b_,$ie,mie,sie,Aie,Pie,Om,aae]),IFe=je([h_,Jne,uae,Iie,yie,rie,iie,oie,C_,Rie,x_,I_,Kl]),ue=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===xe.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new TR(i.elicitations,r)}return new t(e,r,n)}},TR=class extends ue{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(xe.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var R_=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),fae(r)}clear(){this._buffer=void 0}};function fae(t){return EU.parse(JSON.parse(t))}function jU(t){return JSON.stringify(t)+`
245
- `}var E_=class{constructor(e=LU.stdin,r=LU.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new R_,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=jU(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var A_=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 be;(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})(be||(be={}));var UU;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(UU||(UU={}));var q=be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oa=t=>{switch(typeof t){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN(t)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":return Array.isArray(t)?q.array:t===null?q.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?q.promise:typeof Map<"u"&&t instanceof Map?q.map:typeof Set<"u"&&t instanceof Set?q.set:typeof Date<"u"&&t instanceof Date?q.date:q.object;default:return q.unknown}};var $=be.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 _n=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,be.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()}};_n.create=t=>new _n(t);var gae=(t,e)=>{let r;switch(t.code){case $.invalid_type:t.received===q.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case $.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,be.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:r=`Unrecognized key(s) in object: ${be.joinValues(t.keys,", ")}`;break;case $.invalid_union:r="Invalid input";break;case $.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${be.joinValues(t.options)}`;break;case $.invalid_enum_value:r=`Invalid enum value. Expected ${be.joinValues(t.options)}, received '${t.received}'`;break;case $.invalid_arguments:r="Invalid function arguments";break;case $.invalid_return_type:r="Invalid function return type";break;case $.invalid_date:r="Invalid date";break;case $.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}"`:be.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case $.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 $.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 $.custom:r="Invalid input";break;case $.invalid_intersection_types:r="Intersection results could not be merged";break;case $.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case $.not_finite:r="Number must be finite";break;default:r=e.defaultError,be.assertNever(t)}return{message:r}},Lo=gae;var hae=Lo;function Mm(){return hae}var T_=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 U(t,e){let r=Mm(),n=T_({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Lo?void 0:Lo].filter(i=>!!i)});t.common.issues.push(n)}var Sr=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 Y;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 Y;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}}},Y=Object.freeze({status:"aborted"}),Xl=t=>({status:"dirty",value:t}),Nr=t=>({status:"valid",value:t}),XR=t=>t.status==="aborted",QR=t=>t.status==="dirty",Xs=t=>t.status==="valid",jm=t=>typeof Promise<"u"&&t instanceof Promise;var V;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(V||(V={}));var zn=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}},zU=(t,e)=>{if(Xs(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 _n(t.common.issues);return this._error=r,this._error}}};function oe(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 me=class{get description(){return this._def.description}_getType(e){return Oa(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Oa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Sr,ctx:{common:e.parent.common,data:e.data,parsedType:Oa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(jm(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:Oa(e)},i=this._parseSync({data:e,path:n.path,parent:n});return zU(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Oa(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Xs(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=>Xs(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:Oa(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(jm(i)?i:Promise.resolve(i));return zU(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:$.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 pi({schema:this,typeName:J.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 di.create(this,this._def)}nullable(){return Na.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zo.create(this)}promise(){return Qs.create(this,this._def)}or(e){return nu.create([this,e],this._def)}and(e){return iu.create(this,e,this._def)}transform(e){return new pi({...oe(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new lu({...oe(this._def),innerType:this,defaultValue:r,typeName:J.ZodDefault})}brand(){return new O_({typeName:J.ZodBranded,type:this,...oe(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new uu({...oe(this._def),innerType:this,catchValue:r,typeName:J.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return $_.create(this,e)}readonly(){return du.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},yae=/^c[^\s-]{8,}$/i,vae=/^[0-9a-z]+$/,bae=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_ae=/^[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,xae=/^[a-z0-9_-]{21}$/i,Sae=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,wae=/^[-+]?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)?)??$/,Iae=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Pae="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",eE,Cae=/^(?:(?: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])$/,kae=/^(?:(?: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])$/,Rae=/^(([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]))$/,Eae=/^(([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])$/,Aae=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Tae=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,FU="((\\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])))",Oae=new RegExp(`^${FU}$`);function qU(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 $ae(t){return new RegExp(`^${qU(t)}$`)}function Dae(t){let e=`${FU}T${qU(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 Nae(t,e){return!!((e==="v4"||!e)&&Cae.test(t)||(e==="v6"||!e)&&Rae.test(t))}function Mae(t,e){if(!Sae.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 jae(t,e){return!!((e==="v4"||!e)&&kae.test(t)||(e==="v6"||!e)&&Eae.test(t))}var eu=class t extends me{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==q.string){let a=this._getOrReturnCtx(e);return U(a,{code:$.invalid_type,expected:q.string,received:a.parsedType}),Y}let n=new Sr,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:$.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),U(i,{code:$.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?U(i,{code:$.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&U(i,{code:$.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Iae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"email",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")eE||(eE=new RegExp(Pae,"u")),eE.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"emoji",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")_ae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"uuid",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")xae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"nanoid",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")yae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")vae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid2",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")bae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ulid",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),U(i,{validation:"url",code:$.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),U(i,{validation:"regex",code:$.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),U(i,{code:$.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),U(i,{code:$.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:$.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Dae(a).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:$.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Oae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:$.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?$ae(a).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:$.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?wae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"duration",code:$.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Nae(e.data,a.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ip",code:$.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?Mae(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"jwt",code:$.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?jae(e.data,a.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cidr",code:$.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Aae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64",code:$.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Tae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64url",code:$.invalid_string,message:a.message}),n.dirty()):be.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:$.invalid_string,...V.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...V.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...V.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...V.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,...V.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,...V.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...V.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...V.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...V.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...V.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...V.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...V.errToObj(r)})}nonempty(e){return this.min(1,V.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}};eu.create=t=>new eu({checks:[],typeName:J.ZodString,coerce:t?.coerce??!1,...oe(t)});function Lae(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 Lm=class t extends me{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)!==q.number){let a=this._getOrReturnCtx(e);return U(a,{code:$.invalid_type,expected:q.number,received:a.parsedType}),Y}let n,i=new Sr;for(let a of this._def.checks)a.kind==="int"?be.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:$.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),U(n,{code:$.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),U(n,{code:$.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Lae(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),U(n,{code:$.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:$.not_finite,message:a.message}),i.dirty()):be.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:V.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.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"&&be.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)}};Lm.create=t=>new Lm({checks:[],typeName:J.ZodNumber,coerce:t?.coerce||!1,...oe(t)});var Um=class t extends me{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)!==q.bigint)return this._getInvalidInput(e);let n,i=new Sr;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),U(n,{code:$.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),U(n,{code:$.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),U(n,{code:$.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):be.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return U(r,{code:$.invalid_type,expected:q.bigint,received:r.parsedType}),Y}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:V.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:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.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}};Um.create=t=>new Um({checks:[],typeName:J.ZodBigInt,coerce:t?.coerce??!1,...oe(t)});var zm=class extends me{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==q.boolean){let n=this._getOrReturnCtx(e);return U(n,{code:$.invalid_type,expected:q.boolean,received:n.parsedType}),Y}return Nr(e.data)}};zm.create=t=>new zm({typeName:J.ZodBoolean,coerce:t?.coerce||!1,...oe(t)});var Fm=class t extends me{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==q.date){let a=this._getOrReturnCtx(e);return U(a,{code:$.invalid_type,expected:q.date,received:a.parsedType}),Y}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return U(a,{code:$.invalid_date}),Y}let n=new Sr,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:$.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),U(i,{code:$.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):be.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:V.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:V.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}};Fm.create=t=>new Fm({checks:[],coerce:t?.coerce||!1,typeName:J.ZodDate,...oe(t)});var qm=class extends me{_parse(e){if(this._getType(e)!==q.symbol){let n=this._getOrReturnCtx(e);return U(n,{code:$.invalid_type,expected:q.symbol,received:n.parsedType}),Y}return Nr(e.data)}};qm.create=t=>new qm({typeName:J.ZodSymbol,...oe(t)});var tu=class extends me{_parse(e){if(this._getType(e)!==q.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:$.invalid_type,expected:q.undefined,received:n.parsedType}),Y}return Nr(e.data)}};tu.create=t=>new tu({typeName:J.ZodUndefined,...oe(t)});var ru=class extends me{_parse(e){if(this._getType(e)!==q.null){let n=this._getOrReturnCtx(e);return U(n,{code:$.invalid_type,expected:q.null,received:n.parsedType}),Y}return Nr(e.data)}};ru.create=t=>new ru({typeName:J.ZodNull,...oe(t)});var Bm=class extends me{constructor(){super(...arguments),this._any=!0}_parse(e){return Nr(e.data)}};Bm.create=t=>new Bm({typeName:J.ZodAny,...oe(t)});var Uo=class extends me{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Nr(e.data)}};Uo.create=t=>new Uo({typeName:J.ZodUnknown,...oe(t)});var Fi=class extends me{_parse(e){let r=this._getOrReturnCtx(e);return U(r,{code:$.invalid_type,expected:q.never,received:r.parsedType}),Y}};Fi.create=t=>new Fi({typeName:J.ZodNever,...oe(t)});var Vm=class extends me{_parse(e){if(this._getType(e)!==q.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:$.invalid_type,expected:q.void,received:n.parsedType}),Y}return Nr(e.data)}};Vm.create=t=>new Vm({typeName:J.ZodVoid,...oe(t)});var zo=class t extends me{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==q.array)return U(r,{code:$.invalid_type,expected:q.array,received:r.parsedType}),Y;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(o||s)&&(U(r,{code:o?$.too_big:$.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&&(U(r,{code:$.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&&(U(r,{code:$.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 zn(r,o,r.path,s)))).then(o=>Sr.mergeArray(n,o));let a=[...r.data].map((o,s)=>i.type._parseSync(new zn(r,o,r.path,s)));return Sr.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:V.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:V.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:V.toString(r)}})}nonempty(e){return this.min(1,e)}};zo.create=(t,e)=>new zo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...oe(e)});function Ql(t){if(t instanceof xn){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=di.create(Ql(n))}return new xn({...t._def,shape:()=>e})}else return t instanceof zo?new zo({...t._def,type:Ql(t.element)}):t instanceof di?di.create(Ql(t.unwrap())):t instanceof Na?Na.create(Ql(t.unwrap())):t instanceof Da?Da.create(t.items.map(e=>Ql(e))):t}var xn=class t extends me{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=be.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==q.object){let l=this._getOrReturnCtx(e);return U(l,{code:$.invalid_type,expected:q.object,received:l.parsedType}),Y}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 zn(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&&(U(i,{code:$.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 zn(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=>Sr.mergeObjectSync(n,l)):Sr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return V.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:V.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:J.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 be.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 be.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Ql(this)}partial(e){let r={};for(let n of be.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 be.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof di;)a=a._def.innerType;r[n]=a}return new t({...this._def,shape:()=>r})}keyof(){return BU(be.objectKeys(this.shape))}};xn.create=(t,e)=>new xn({shape:()=>t,unknownKeys:"strip",catchall:Fi.create(),typeName:J.ZodObject,...oe(e)});xn.strictCreate=(t,e)=>new xn({shape:()=>t,unknownKeys:"strict",catchall:Fi.create(),typeName:J.ZodObject,...oe(e)});xn.lazycreate=(t,e)=>new xn({shape:t,unknownKeys:"strip",catchall:Fi.create(),typeName:J.ZodObject,...oe(e)});var nu=class extends me{_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 _n(s.ctx.common.issues));return U(r,{code:$.invalid_union,unionErrors:o}),Y}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 _n(c));return U(r,{code:$.invalid_union,unionErrors:s}),Y}}get options(){return this._def.options}};nu.create=(t,e)=>new nu({options:t,typeName:J.ZodUnion,...oe(e)});var $a=t=>t instanceof au?$a(t.schema):t instanceof pi?$a(t.innerType()):t instanceof ou?[t.value]:t instanceof su?t.options:t instanceof cu?be.objectValues(t.enum):t instanceof lu?$a(t._def.innerType):t instanceof tu?[void 0]:t instanceof ru?[null]:t instanceof di?[void 0,...$a(t.unwrap())]:t instanceof Na?[null,...$a(t.unwrap())]:t instanceof O_||t instanceof du?$a(t.unwrap()):t instanceof uu?$a(t._def.innerType):[],tE=class t extends me{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.object)return U(r,{code:$.invalid_type,expected:q.object,received:r.parsedType}),Y;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}):(U(r,{code:$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Y)}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=$a(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:J.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...oe(n)})}};function rE(t,e){let r=Oa(t),n=Oa(e);if(t===e)return{valid:!0,data:t};if(r===q.object&&n===q.object){let i=be.objectKeys(e),a=be.objectKeys(t).filter(s=>i.indexOf(s)!==-1),o={...t,...e};for(let s of a){let c=rE(t[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(r===q.array&&n===q.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=rE(o,s);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===q.date&&n===q.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var iu=class extends me{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(a,o)=>{if(XR(a)||XR(o))return Y;let s=rE(a.value,o.value);return s.valid?((QR(a)||QR(o))&&r.dirty(),{status:r.value,value:s.data}):(U(n,{code:$.invalid_intersection_types}),Y)};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}))}};iu.create=(t,e,r)=>new iu({left:t,right:e,typeName:J.ZodIntersection,...oe(r)});var Da=class t extends me{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.array)return U(n,{code:$.invalid_type,expected:q.array,received:n.parsedType}),Y;if(n.data.length<this._def.items.length)return U(n,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Y;!this._def.rest&&n.data.length>this._def.items.length&&(U(n,{code:$.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 zn(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>Sr.mergeArray(r,o)):Sr.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Da.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Da({items:t,typeName:J.ZodTuple,rest:null,...oe(e)})};var nE=class t extends me{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!==q.object)return U(n,{code:$.invalid_type,expected:q.object,received:n.parsedType}),Y;let i=[],a=this._def.keyType,o=this._def.valueType;for(let s in n.data)i.push({key:a._parse(new zn(n,s,n.path,s)),value:o._parse(new zn(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?Sr.mergeObjectAsync(r,i):Sr.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof me?new t({keyType:e,valueType:r,typeName:J.ZodRecord,...oe(n)}):new t({keyType:eu.create(),valueType:e,typeName:J.ZodRecord,...oe(r)})}},Wm=class extends me{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!==q.map)return U(n,{code:$.invalid_type,expected:q.map,received:n.parsedType}),Y;let i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,c],l)=>({key:i._parse(new zn(n,s,n.path,[l,"key"])),value:a._parse(new zn(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 Y;(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 Y;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}}}};Wm.create=(t,e,r)=>new Wm({valueType:e,keyType:t,typeName:J.ZodMap,...oe(r)});var Hm=class t extends me{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.set)return U(n,{code:$.invalid_type,expected:q.set,received:n.parsedType}),Y;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(U(n,{code:$.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&&(U(n,{code:$.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 Y;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 zn(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:V.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:V.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Hm.create=(t,e)=>new Hm({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...oe(e)});var iE=class t extends me{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.function)return U(r,{code:$.invalid_type,expected:q.function,received:r.parsedType}),Y;function n(s,c){return T_({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Mm(),Lo].filter(l=>!!l),issueData:{code:$.invalid_arguments,argumentsError:c}})}function i(s,c){return T_({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Mm(),Lo].filter(l=>!!l),issueData:{code:$.invalid_return_type,returnTypeError:c}})}let a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Qs){let s=this;return Nr(async function(...c){let l=new _n([]),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 Nr(function(...c){let l=s._def.args.safeParse(c,a);if(!l.success)throw new _n([n(c,l.error)]);let u=Reflect.apply(o,this,l.data),d=s._def.returns.safeParse(u,a);if(!d.success)throw new _n([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:Da.create(e).rest(Uo.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||Da.create([]).rest(Uo.create()),returns:r||Uo.create(),typeName:J.ZodFunction,...oe(n)})}},au=class extends me{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})}};au.create=(t,e)=>new au({getter:t,typeName:J.ZodLazy,...oe(e)});var ou=class extends me{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return U(r,{received:r.data,code:$.invalid_literal,expected:this._def.value}),Y}return{status:"valid",value:e.data}}get value(){return this._def.value}};ou.create=(t,e)=>new ou({value:t,typeName:J.ZodLiteral,...oe(e)});function BU(t,e){return new su({values:t,typeName:J.ZodEnum,...oe(e)})}var su=class t extends me{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{expected:be.joinValues(n),received:r.parsedType,code:$.invalid_type}),Y}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 U(r,{received:r.data,code:$.invalid_enum_value,options:n}),Y}return Nr(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})}};su.create=BU;var cu=class extends me{_parse(e){let r=be.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==q.string&&n.parsedType!==q.number){let i=be.objectValues(r);return U(n,{expected:be.joinValues(i),received:n.parsedType,code:$.invalid_type}),Y}if(this._cache||(this._cache=new Set(be.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=be.objectValues(r);return U(n,{received:n.data,code:$.invalid_enum_value,options:i}),Y}return Nr(e.data)}get enum(){return this._def.values}};cu.create=(t,e)=>new cu({values:t,typeName:J.ZodNativeEnum,...oe(e)});var Qs=class extends me{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.promise&&r.common.async===!1)return U(r,{code:$.invalid_type,expected:q.promise,received:r.parsedType}),Y;let n=r.parsedType===q.promise?r.data:Promise.resolve(r.data);return Nr(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Qs.create=(t,e)=>new Qs({type:t,typeName:J.ZodPromise,...oe(e)});var pi=class extends me{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.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=>{U(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 Y;let c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?Y:c.status==="dirty"?Xl(c.value):r.value==="dirty"?Xl(c.value):c});{if(r.value==="aborted")return Y;let s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?Y: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"?Y:(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"?Y:(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(!Xs(o))return Y;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=>Xs(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):Y);be.assertNever(i)}};pi.create=(t,e,r)=>new pi({schema:t,typeName:J.ZodEffects,effect:e,...oe(r)});pi.createWithPreprocess=(t,e,r)=>new pi({schema:e,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...oe(r)});var di=class extends me{_parse(e){return this._getType(e)===q.undefined?Nr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};di.create=(t,e)=>new di({innerType:t,typeName:J.ZodOptional,...oe(e)});var Na=class extends me{_parse(e){return this._getType(e)===q.null?Nr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Na.create=(t,e)=>new Na({innerType:t,typeName:J.ZodNullable,...oe(e)});var lu=class extends me{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===q.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};lu.create=(t,e)=>new lu({innerType:t,typeName:J.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...oe(e)});var uu=class extends me{_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 jm(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new _n(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new _n(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};uu.create=(t,e)=>new uu({innerType:t,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...oe(e)});var Zm=class extends me{_parse(e){if(this._getType(e)!==q.nan){let n=this._getOrReturnCtx(e);return U(n,{code:$.invalid_type,expected:q.nan,received:n.parsedType}),Y}return{status:"valid",value:e.data}}};Zm.create=t=>new Zm({typeName:J.ZodNaN,...oe(t)});var JFe=Symbol("zod_brand"),O_=class extends me{_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}},$_=class t extends me{_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"?Y: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"?Y: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:J.ZodPipeline})}},du=class extends me{_parse(e){let r=this._def.innerType._parse(e),n=i=>(Xs(i)&&(i.value=Object.freeze(i.value)),i);return jm(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};du.create=(t,e)=>new du({innerType:t,typeName:J.ZodReadonly,...oe(e)});var KFe={object:xn.lazycreate},J;(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"})(J||(J={}));var YFe=eu.create,XFe=Lm.create,QFe=Zm.create,eqe=Um.create,tqe=zm.create,rqe=Fm.create,nqe=qm.create,iqe=tu.create,aqe=ru.create,oqe=Bm.create,sqe=Uo.create,cqe=Fi.create,lqe=Vm.create,uqe=zo.create,Uae=xn.create,dqe=xn.strictCreate,pqe=nu.create,mqe=tE.create,fqe=iu.create,gqe=Da.create,hqe=nE.create,yqe=Wm.create,vqe=Hm.create,bqe=iE.create,_qe=au.create,xqe=ou.create,Sqe=su.create,wqe=cu.create,Iqe=Qs.create,Pqe=pi.create,Cqe=di.create,kqe=Na.create,Rqe=pi.createWithPreprocess,Eqe=$_.create;function pu(t){return!!t._zod}function Fo(t,e){return pu(t)?js(t,e):t.safeParse(e)}function D_(t){if(!t)return;let e;if(pu(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function HU(t){if(pu(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 qo(t){return t==="completed"||t==="failed"||t==="cancelled"}var Hae=Symbol("Let zodToJsonSchema decide on which parser to use");var LBe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function aE(t){let r=D_(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=HU(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function oE(t,e){let r=Fo(t,e);if(!r.success)throw r.error;return r.data}var Xae=6e4,N_=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(y_,r=>{this._oncancel(r)}),this.setNotificationHandler(b_,r=>{this._onprogress(r)}),this.setRequestHandler(v_,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(__,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ue(xe.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(S_,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 ue(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 ue(xe.InvalidParams,`Task not found: ${a}`);if(!qo(o.status))return await this._waitForTaskUpdate(a,n.signal),await i();if(qo(o.status)){let s=await this._taskStore.getTaskResult(a,n.sessionId);return this._clearTaskQueue(a),{...s,_meta:{...s._meta,[jo]:{taskId:a}}}}return await i()};return await i()}),this.setRequestHandler(w_,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 ue(xe.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(P_,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ue(xe.InvalidParams,`Task not found: ${r.params.taskId}`);if(qo(i.status))throw new ue(xe.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 ue(xe.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...a}}catch(i){throw i instanceof ue?i:new ue(xe.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),ue.fromError(xe.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),km(a)||RU(a)?this._onresponse(a):DR(a)?this._onrequest(a,o):kU(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=ue.fromError(xe.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?.[jo]?.taskId;if(n===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:xe.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=IU(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:xe.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),km(e))n(e);else{let o=new ue(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(km(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),km(e))i(e);else{let o=ue.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 ue?o:new ue(xe.InternalError,String(o))}}return}let a;try{let o=await this.request(e,Kl,n);if(o.task)a=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new ue(xe.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:a},n);if(yield{type:"taskStatus",task:s},qo(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)}:s.status==="failed"?yield{type:"error",error:new ue(xe.InternalError,`Task ${a} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new ue(xe.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 ue?o:new ue(xe.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||{},[jo]: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(w=>this._onerror(new Error(`Failed to send cancellation: ${w}`)));let _=b instanceof ue?b:new ue(xe.RequestTimeout,String(b));u(_)};this._responseHandlers.set(p,b=>{if(!n?.signal?.aborted){if(b instanceof Error)return u(b);try{let _=Fo(r,b.result);_.success?l(_.data):u(_.error)}catch(_){u(_)}}}),n?.signal?.addEventListener("abort",()=>{f(n?.signal?.reason)});let g=n?.timeout??Xae,h=()=>f(ue.fromError(xe.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(p,g,n?.maxTotalTimeout,h,n?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let b=_=>{let w=this._responseHandlers.get(p);w?w(_):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(_=>{this._cleanupTimeout(p),u(_)})}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},x_,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},I_,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},TU,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||{},[jo]: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||{},[jo]: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||{},[jo]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=aE(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,a)=>{let o=oE(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=aE(e);this._notificationHandlers.set(n,i=>{let a=oE(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"&&DR(i.message)){let a=i.message.id,o=this._requestResolvers.get(a);o?(o(new ue(xe.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 ue(xe.InvalidRequest,"Request cancelled"));return}let o=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(o),a(new ue(xe.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 ue(xe.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=Om.parse({method:"notifications/tasks/status",params:s});await this.notification(c),qo(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 ue(xe.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(qo(s.status))throw new ue(xe.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=Om.parse({method:"notifications/tasks/status",params:c});await this.notification(l),qo(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}};function ZU(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function GU(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];ZU(o)&&ZU(a)?r[i]={...o,...a}:r[i]=a}return r}var Dq=Bt(WA(),1),Nq=Bt($q(),1);function qde(){let t=new Dq.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Nq.default)(t),t}var vx=class{constructor(e){this._ajv=e??qde()}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 bx=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 Mq(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 jq(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 _x=class extends N_{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Nm.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 vx,this.setRequestHandler(jR,n=>this._oninitialize(n)),this.setNotificationHandler(LR,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(GR,async(n,i)=>{let a=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:o}=n.params,s=Nm.safeParse(o);return s.success&&this._loggingLevels.set(a,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new bx(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=GU(this._capabilities,e)}setRequestHandler(e,r){let i=D_(e)?.method;if(!i)throw new Error("Schema is missing a method literal");let a;if(pu(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=Fo(Dm,c);if(!u.success){let f=u.error instanceof Error?u.error.message:String(u.error);throw new ue(xe.InvalidParams,`Invalid tools/call request: ${f}`)}let{params:d}=u.data,p=await Promise.resolve(r(c,l));if(d.task){let f=Fo(Kl,p);if(!f.success){let g=f.error instanceof Error?f.error.message:String(f.error);throw new ue(xe.InvalidParams,`Invalid task creation result: ${g}`)}return f.data}let m=Fo(C_,p);if(!m.success){let f=m.error instanceof Error?m.error.message:String(m.error);throw new ue(xe.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){jq(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&Mq(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:xU.includes(r)?r:OR,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"},h_)}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},KR,r):this.request({method:"sampling/createMessage",params:e},JR,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},k_,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},k_,r);if(a.action==="accept"&&a.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(a.content);if(!s.valid)throw new ue(xe.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(o){throw o instanceof ue?o:new ue(xe.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},YR,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 Bde(){let t=process.env.WEPPY_ROBLOX_MCP_VERSION?.trim();return t||null}var We=Bde()??"2.17.4";var Vde={antigravity:"Antigravity","antigravity cli":"Antigravity","antigravity-cli":"Antigravity","antigravity ide":"Antigravity","antigravity-ide":"Antigravity",claude:"Claude","claude code":"Claude Code","claude-code":"Claude Code",cline:"Cline",codex:"Codex CLI","codex cli":"Codex CLI","codex-cli":"Codex CLI",continue:"Continue",cursor:"Cursor","cursor-editor":"Cursor","gemini cli":"Gemini CLI","gemini-cli":"Gemini CLI","openai codex":"Codex CLI","openai-codex":"Codex CLI","vs code":"VS Code",vscode:"VS Code",windsurf:"Windsurf","windsurf-editor":"Windsurf",zed:"Zed"};function xx(t){let e=t?.trim().toLowerCase();return e?Vde[e]:void 0}function Lq(t){return xx(t)??t}function Uq(){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 QA="weppy://ui-studio/guide",eT="weppy://ui-studio/tokens",tT="weppy://ui-studio/functional-rules",zq='# UI Studio Guide\n\n**Audience:** AI agents and developers building Roblox interfaces through UI Studio.\n**Resource:** `weppy://ui-studio/guide`\n**Policy:** Design Check quality findings are advisory. Schema errors, unsupported properties, forbidden paths, destructive-action boundaries, and external upload approval remain enforceable safety rules.\n\n## How to use this guide\n\nBuild from project evidence, not from a built-in game subject or genre preset. The guide has three layers:\n\n1. The advisory usability floor covers observable interaction and readability risks.\n2. The visual vocabulary offers optional directions, not a checklist or score.\n3. The review workflow separates verified functional evidence from visual judgment.\n\nVisual quality is contextual. Do not turn token values, shape counts, image counts, ornament counts, occupancy, or family counts into pass conditions.\n\n### Context-first brief gate\n\nFor an ambiguous request, call `manage_ui.design_brief` with an omitted or partial brief. Inspect Studio and project evidence before asking the user for information.\n\n- An empty `StarterGui` proves only that no Edit UI root was observed. For an existing-UI review, return `runtime_not_reviewed` until a Play Client `PlayerGui` observation is available. Treat it as new-interface evidence only when the user explicitly asks to create new UI.\n- Existing `ScreenGui` roots support a redesign or targeted-update interpretation.\n- A selected GUI object is strong target evidence unless the user names a broader scope.\n- Explicit `projectContext` and user choices outrank existing Studio patterns.\n- Existing Studio patterns may inform continuity, but they never create a reusable subject preset.\n- An explicit user placement, grouping, surface, flow, or backdrop choice outranks project evidence, existing UI, and WEPPY fallback in that order.\n\nAsk one focused question at a time. Include a current-state summary, a recommended choice with evidence, useful alternatives, and a free-form escape hatch. Return an exact `brief_patch` for an accepted recommendation.\n\n### Asset recommendation gate\n\nAsset evidence is considered in this order:\n\n1. user-provided `brief.reference_assets`\n2. approved `projectContext.approved_assets`\n3. relevant images already used by the selected project UI\n4. `manage_assets.search` only when `projectContext.asset_search_intent` is explicit and user-approved\n5. an assetless fallback\n\nDo not synthesize a subject search query from names, labels, hierarchy text, or Workspace content. Do not use a recommended asset until the user accepts it. Never invent an `rbxassetid://...` value.\n\n### Calling-agent capability and image generation gate\n\nInspect the calling agent\'s actual callable image capability and local output channel. Do not infer capability from a model or client name, and never record provider credentials.\n\n- Generation and Roblox upload require separate approval.\n- `image_review` means the calling agent can review an output; it does not authorize generation or upload.\n- If generation or local output is unavailable or unknown, continue with approved assets or an assetless fallback.\n\nAfter local generation, show the output for selection. Run upload preflight only after selection, and request separate approval naming the files, count, and destination.\n\n### Project Design Contract gate\n\nPass relevant repository evidence in `projectContext` instead of asking the Studio plugin to guess it:\n\n- `screen_job`, `primary_action`, `content_hierarchy`, recommended `required_states`, and explicitly blocking `required_state_ids`\n- `visual_thesis`, `signature_motif`, and `forbidden_defaults`\n- `presentation_mode` and `focal_region`\n- neutral `surface_roles` and `shape_language`\n- role-specific `layout_preferences` with their decision source\n- `target_profiles` and `platform_distribution`\n- project-owned tokens and approved assets with evidence paths\n\nKeep the returned `design_contract` and `brief_id` together. `create_tree` and `update` require an accepted brief. Candidate directions should differ materially in composition, hierarchy, or interaction behavior; palette swaps alone are not meaningful alternatives.\n\n### Role-based game layout contract\n\nWEPPY supplies style-neutral structure. The calling agent owns visual direction from explicit user intent plus game and project evidence. A WEPPY fallback must not choose the palette, font, imagery treatment, ornament, semantic shape, or numeric opacity for the project.\n\nFor an underspecified `non_modal_overlay`, translate neutral roles into these advisory constraints:\n\n- `persistent_status`: top-left compact individual chrome, growing inward from the edge;\n- `resource_display`: top-right compact chips in a row;\n- `navigation`: side rail or top edge, using individual controls instead of one large shared panel;\n- `slot_action`: bottom-center single-row flow only when the content has real slot semantics;\n- `contextual_action`: transient lower-center or target-relative action, normally one or a few controls;\n- `objective_tracker`: side-edge bounded group that can condense or collapse.\n\nUse a transparent group root for non-modal HUD regions. Opaque paint may remain inside the local bounds of a button, status chip, tracker, or other readable content surface. A contract-backed `modal_overlay`, `fullscreen_navigation`, or `diegetic` presentation may use a backdrop.\n\nOn touch profiles, keep a semantic slot bar between the touch-left and touch-right reserved regions and clear of the top inset. Prefer condense, paginate, collapse, or contextual disclosure over wrapping generic actions into a multi-row bottom-center grid.\n\nEach region can preserve `placement_band`, `flow_axis`, `surface_mode`, `avoid_regions`, `wrap_policy`, `decision_source`, and an optional numeric `max_edge_gap_px`. These are advisory composition constraints, not exact coordinates or a hard tree preset. When the explicit user or approved project evidence requests a different result, preserve it and report only observed functional risk. An explicit user placement without a numeric maximum does not inherit a WEPPY edge-gap limit.\n\n### Design Check coverage gate\n\n`manage_ui.check` reports findings and coverage independently.\n\n- `structural_only` means deterministic Studio checks ran without a calling-agent visual review.\n- `structural_and_visual` means a calling agent reviewed the referenced saved preview and submitted `visualReview` evidence.\n- `visual_status = "not_requested" | "skipped"` must remain visible even when deterministic findings are empty.\n\nUse `visualReview` and its `reviewContext` only for evidence actually reviewed. If interaction states or representative primary-view context are absent, preserve `interaction_states_not_reviewed` or `gameplay_context_unavailable`. WEPPY does not call an external AI service for visual review.\n\nFor UI created only at runtime, run a structured Play session with one client, wait for the UI, and use `snapshot_gui` on `{root:"PlayerGui",segments:[]}`. Pass the saved `{recordId,stepId}` as `runtimeEvidenceRef` and use `observationMode="runtime"` for `manage_ui.check`. The Bridge validates Place, session, client, step status, and PlayerGui origin; never submit a copied tree as runtime evidence. A truncated tree remains partial coverage.\n\nKeep semantic runtime evidence and screenshot evidence separate. Play-mode screenshot capture is unavailable in this build, so a PlayerGui snapshot can complete runtime structure coverage but cannot complete visual review by itself. Preserve `play_screenshot_unsupported`, `background_unverified`, state gaps, and other limitations.\n\n## A. Advisory usability and interaction floor\n\nThese are configurable recommendations. A `priority_high` finding indicates urgency, not a mutation block.\n\n### A.1 Hit, focus, and painted surfaces\n\nEvaluate the resolved `AbsoluteSize` of the interactive hit and focus area. The painted visual surface may be smaller or differently shaped when the larger invisible area does not overlap another action or hide content.\n\nUse target-profile recommendations for touch and focus reachability. Treat them as defaults that projects may adjust with evidence. Always verify that actions remain distinguishable and reachable for every declared input mode.\n\n### A.2 Safe areas and readable text\n\nUse `ScreenInsets`, device simulation, and the declared target profile where available. Review critical actions and information against the actual safe area rather than assuming one global inset.\n\nFor an edge-bound semantic region, compare both the container bounds and the actual painted descendant union with the declared safe boundary. The painted union includes visible background, text, image, and `UIStroke` geometry after `ClipsDescendants`. A transparent parent can therefore be attached while its visible controls remain detached. Report this as one `edge_detached` finding with container, visible, and internal gap evidence. AnchorPoint mismatch alone is diagnostic evidence, not a finding.\n\nEvaluate text against the resolved background, including composable transparency. When an image, gradient, transparent game view, or complex overlay prevents a deterministic background result, return `background_unverified` instead of assuming a dark fallback. Check `TextFits`, `TextBounds`, clipping, long localized strings, and maximum numeric content. Contrast and text-size values are accessibility recommendations, not visual-style quotas. If `TextScaled` is used, constrain it with `UITextSizeConstraint` and verify representative locales.\n\nInspect visible text, images, actions, and painted progress indicators even when semantic metadata is absent. Compare direct siblings and meaningful surfaces across enabled ScreenGui roots. Exclude parent-child paint, progress fill/background composition, hidden roots, and contract-backed intentional overlap. Treat public inset and Core UI state as observed evidence; if expanded chat, player list, or touch-control geometry cannot be observed, report it as estimated or unavailable.\n\n### A.3 Input disclosure and state access\n\nA readable embedded action text can be the visible label when it remains legible across declared targets and locales. Do not duplicate it with a second adjacent label.\n\nUnfamiliar controls need an input-appropriate explanation path:\n\n- pointer and keyboard can use hover or focus labels;\n- gamepad needs a focus-visible action label and current binding;\n- touch needs a persistent label, a labelled disclosure control, or another touch-visible hint.\n\nEvery declared input mode should expose the action meaning and relevant resting, focus, pressed, selected, and disabled states. Pointer hover alone does not establish all-input discoverability.\n\n### A.4 Primary-view protection\n\nFor `non_modal_overlay`, keep the Design Contract focal region visually available. If UI and the primary view compete, consider edge placement, reflow, condensation, collapse, or contextual disclosure. Do not enforce a fixed screen-occupancy ratio.\n\nModal, fullscreen navigation, and diegetic presentation may intentionally use a backdrop when the contract supports it. A full-screen opaque surface is not automatically wrong; its presentation role decides.\n\n### A.5 Supported Roblox UI components\n\nUI Studio tree encoding supports `UIScale`, `UIFlexItem`, `UIShadow`, `UIPageLayout`, `UITableLayout`, `CanvasGroup`, `UIDragDetector`, `UIAspectRatioConstraint`, `UISizeConstraint`, and `UITextSizeConstraint` where listed by the public schema.\n\nNo class is a quality guarantee. Likewise, a `Frame`, `Offset`, sharp edge, or absent image is not a failure by itself. Report observable bounds, text-fit, reachability, focus-path, safe-area, aspect, or interaction evidence.\n\n## B. Visual vocabulary\n\nThis vocabulary is exploratory. Combine, omit, or extend options when project evidence supports the result. Consistency should be explained through roles and relationships, not through rigid family counts.\n\n### B.1 neutral surface roles\n\nAssign visible surfaces a neutral surface role before styling:\n\n- `primary_action`\n- `secondary_action`\n- `navigation`\n- `persistent_status`\n- `transient_status`\n- `resource_display`\n- `contextual_information`\n- `identity`\n- `spatial_information`\n- `slot_action`\n- `contextual_action`\n- `objective_tracker`\n- `decoration`\n\nProjects may add opaque roles. WEPPY must not reuse their subject meaning as another project\'s default.\n\nAn interaction family describes how controls reveal affordance and state. It may be framed, tactile, diegetic, tab-like, ornamented, or an intentional flat control. Gradient, shadow, bevel, rounding, and imagery are optional.\n\n### B.2 Container edge language and semantic shape\n\nPlan container edge language separately from semantic shape.\n\n- Container edge language can be sharp, softly rounded, strongly rounded, cut-corner, asymmetric, organic, or project-defined.\n- Semantic shapes can include a circle, ring, pill, rounded marker, directional wedge, segmented track, organic silhouette, or another project-defined form.\n- A compact status marker may use a ring while a nearby action uses a pill and its containing panel uses a sharp edge language.\n- Mixed semantic shapes supported by role evidence are not a style failure.\n\nUse circles and rings where radial reading, identity, progress, direction, or compact status makes them clearer. Use pills where a short label and bounded interactive state benefit from that silhouette. Use rounded containers when softness or touch affordance supports the thesis. Preserve sharp or cut edges when they better support the project.\n\nDo not require every surface to share one radius. Avoid arbitrary inconsistency, but explain meaningful differences through role, interaction state, hierarchy, or the signature motif.\n\n### B.3 Layout, anchor, and pivot strategy\n\nChoose layout from content hierarchy, parent relationship, focal region, and target profiles.\n\n- Edge placement protects the primary view for persistent non-modal information.\n- Centered hierarchy supports intentionally modal or focused flows.\n- Split, asymmetric, radial, layered, and flow layouts are valid when they clarify relationships.\n- Repeated rectangles are not a default composition. Use bounded panels only where grouping, backdrop, scrolling, or interaction requires them.\n\nTreat `AnchorPoint` as the element\'s positional pivot:\n\n- left/top pivots suit content growing inward from those edges;\n- center pivots suit centered or symmetric relationships;\n- right/bottom pivots suit content growing inward from those edges;\n- project-specific pivots may support a spatial or animated relationship.\n\nWhen using `create_tree`, add optional `layoutMetadata` to meaningful region roots so preview metadata can preserve `surfaceRole`, `placementBand`, `surfaceMode`, and `decisionSource` for review.\n\nScale and Offset are tools, not pass/fail signals. Use Scale for proportional relationships, Offset for stable local dimensions, and combine them deliberately. Add `UIScale`, `UISizeConstraint`, `UIAspectRatioConstraint`, `UITextSizeConstraint`, layout components, Style Query, or project scripts when the target behavior needs them. Verify the resolved result in declared profiles.\n\n### B.4 Imagery strategy\n\nChoose imagery based on explicit role evidence:\n\n- `symbol_set`: consistent compact signs or glyphs\n- `content_thumbnail`: a visual representation of selectable or referenced content\n- `identity_visual`: a visual used primarily for identity or recognition\n- `illustrative_backdrop`: non-interactive atmosphere or framing art\n- `diegetic_surface`: a surface visually integrated with the project world\n- `no_imagery`: an intentional text-and-shape direction\n\nDifferent roles may justify different imagery families on one screen. Coherence comes from treatment, hierarchy, and evidence\u2014not a family quota. If no approved asset exists, use a labelled geometric marker, project-approved glyph, clear placeholder, or `no_imagery`.\n\n### B.5 Depth, ornament, type, colour, and motion\n\nTokens under `weppy://ui-studio/tokens` are examples. They can suggest palette, typography, edge, motion, depth, and composition directions, but they are never mandatory values or quality scores.\n\n- Flatness can be intentional when hierarchy and state remain clear.\n- Depth may use stroke, tonal separation, overlap, shadow, or project imagery.\n- Ornament should reinforce hierarchy or a signature motif rather than fill empty space.\n- Motion should explain state or relationship and respect reduced-motion evidence.\n- Intentional silence\u2014no imagery, no ornament, or no motion\u2014is valid when the contract explains it.\n\n### B.6 Composition and distinctiveness\n\nProtect a clear reading order without forcing a single focal-area percentage. Important relationships may be expressed through scale, placement, colour, typography, motion, negative space, or semantic shape.\n\nBefore applying generic equal-weight rectangles, ask whether the roles call for edge markers, radial indicators, layered surfaces, labelled controls, a bounded content region, or contextual disclosure. If two projects differ only by palette, revisit their evidence and layout plan.\n\n## C. Review workflow\n\n### C.1 Primary visual builder and critic loop\n\nUse **Builder \u2192 Preview \u2192 Critic \u2192 Update** as the primary quality loop:\n\n1. **Builder:** compose from the accepted Design Contract, role relationships, reference evidence, and imagery strategy.\n2. **Preview:** capture the representative primary view after each meaningful create or update pass.\n3. **Critic:** compare the screenshot with the contract and references, then return `recompose`, `refine`, or `approved` with a concise summary and path-backed findings.\n4. **Update:** recompose when the layout or presentation model is wrong; refine when the direction is sound but hierarchy, geometry, imagery, or state treatment needs another pass.\n\nDo not treat schema success or an empty deterministic result as visual approval. `approved` requires representative primary-view evidence, no unresolved `priority_high` functional risk, and a resolved imagery strategy. When required imagery still has only a placeholder or fallback, keep primary visual approval ineligible and propose the separately approved generation or asset path.\n\n### C.2 Visual review\n\nReview qualitative decisions against the Design Contract:\n\n- Is the screen job evident?\n- Does hierarchy match `content_hierarchy`?\n- Are action and information roles distinguishable?\n- Does the container edge language support the visual thesis?\n- Do semantic shapes have role evidence?\n- Is imagery intentional, approved, or intentionally absent?\n- Does the composition protect the focal region?\n- Are required interaction states discoverable for declared inputs?\n\nDo not add visual elements merely to reduce finding counts. Do not issue a failure because a surface is rectangular, circular, sharp, rounded, flat, or image-free.\n\n### C.3 Responsive review\n\nReview the primary target first, then secondary and compatibility targets. User-selected targets and Experience analytics outrank a generic platform default. Excluded targets are recorded but not evaluated as required coverage.\n\nFor each reviewed profile, inspect:\n\n- critical bounds and overlap\n- text fit and localization pressure\n- anchor/pivot behavior during resize and orientation change\n- safe-area placement\n- action reachability and focus path\n- whether reflow, collapse, or contextual disclosure preserves outcomes\n\nIf device simulation is unavailable, report responsive coverage as skipped. Static arithmetic alone does not prove Roblox layout behavior.\n\n### C.4 Coverage language\n\nZero findings means no finding was observed in the checks that ran. It does not mean all quality dimensions passed. Keep structure, visual, interaction, primary-view context, and responsive viewport coverage independent.\n\n## D. Tree encoding\n\n`create_tree` and `update.changes.properties` accept constrained JSON values:\n\n| Roblox type | JSON shape |\n|---|---|\n| `UDim2` | `{xScale, xOffset, yScale, yOffset}` |\n| `UDim` | `{scale, offset}` |\n| `Color3` | `{r, g, b}` |\n| `Vector2` | `{x, y}` |\n| `Vector3` | `{x, y, z}` |\n| `NumberSequence` | `number` or keypoint array |\n| `ColorSequence` | colour keypoint array |\n| `Font` | enum string or `{family, weight, style}` |\n| Enum property | item-name string |\n\nUse a JSON newline escape for multiline text and set `TextWrapped` when appropriate, or use separate `TextLabel` children with a layout component. Do not double-escape a newline into visible backslash text.\n\nKeep `Size` and `Position` in UDim2 object form. Keep colour channel conventions consistent within a tree. Preserve clear instance paths so later updates can target approved placeholders or assets.\n\n---\n\nThis tracked source is embedded into the generated server resource. Run `npm run codegen` after editing it.\n',Fq=`{
245
+ `}var E_=class{constructor(e=LU.stdin,r=LU.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new R_,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=jU(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var A_=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 be;(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})(be||(be={}));var UU;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(UU||(UU={}));var q=be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oa=t=>{switch(typeof t){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN(t)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":return Array.isArray(t)?q.array:t===null?q.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?q.promise:typeof Map<"u"&&t instanceof Map?q.map:typeof Set<"u"&&t instanceof Set?q.set:typeof Date<"u"&&t instanceof Date?q.date:q.object;default:return q.unknown}};var $=be.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 _n=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,be.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()}};_n.create=t=>new _n(t);var gae=(t,e)=>{let r;switch(t.code){case $.invalid_type:t.received===q.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case $.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,be.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:r=`Unrecognized key(s) in object: ${be.joinValues(t.keys,", ")}`;break;case $.invalid_union:r="Invalid input";break;case $.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${be.joinValues(t.options)}`;break;case $.invalid_enum_value:r=`Invalid enum value. Expected ${be.joinValues(t.options)}, received '${t.received}'`;break;case $.invalid_arguments:r="Invalid function arguments";break;case $.invalid_return_type:r="Invalid function return type";break;case $.invalid_date:r="Invalid date";break;case $.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}"`:be.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case $.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 $.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 $.custom:r="Invalid input";break;case $.invalid_intersection_types:r="Intersection results could not be merged";break;case $.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case $.not_finite:r="Number must be finite";break;default:r=e.defaultError,be.assertNever(t)}return{message:r}},Lo=gae;var hae=Lo;function Mm(){return hae}var T_=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 U(t,e){let r=Mm(),n=T_({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Lo?void 0:Lo].filter(i=>!!i)});t.common.issues.push(n)}var Sr=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 Y;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 Y;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}}},Y=Object.freeze({status:"aborted"}),Xl=t=>({status:"dirty",value:t}),Nr=t=>({status:"valid",value:t}),XR=t=>t.status==="aborted",QR=t=>t.status==="dirty",Xs=t=>t.status==="valid",jm=t=>typeof Promise<"u"&&t instanceof Promise;var V;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(V||(V={}));var zn=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}},zU=(t,e)=>{if(Xs(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 _n(t.common.issues);return this._error=r,this._error}}};function oe(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 me=class{get description(){return this._def.description}_getType(e){return Oa(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Oa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Sr,ctx:{common:e.parent.common,data:e.data,parsedType:Oa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(jm(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:Oa(e)},i=this._parseSync({data:e,path:n.path,parent:n});return zU(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Oa(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Xs(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=>Xs(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:Oa(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(jm(i)?i:Promise.resolve(i));return zU(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:$.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 pi({schema:this,typeName:J.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 di.create(this,this._def)}nullable(){return Na.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zo.create(this)}promise(){return Qs.create(this,this._def)}or(e){return nu.create([this,e],this._def)}and(e){return iu.create(this,e,this._def)}transform(e){return new pi({...oe(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new lu({...oe(this._def),innerType:this,defaultValue:r,typeName:J.ZodDefault})}brand(){return new O_({typeName:J.ZodBranded,type:this,...oe(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new uu({...oe(this._def),innerType:this,catchValue:r,typeName:J.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return $_.create(this,e)}readonly(){return du.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},yae=/^c[^\s-]{8,}$/i,vae=/^[0-9a-z]+$/,bae=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_ae=/^[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,xae=/^[a-z0-9_-]{21}$/i,Sae=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,wae=/^[-+]?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)?)??$/,Iae=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Pae="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",eE,Cae=/^(?:(?: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])$/,kae=/^(?:(?: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])$/,Rae=/^(([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]))$/,Eae=/^(([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])$/,Aae=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Tae=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,FU="((\\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])))",Oae=new RegExp(`^${FU}$`);function qU(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 $ae(t){return new RegExp(`^${qU(t)}$`)}function Dae(t){let e=`${FU}T${qU(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 Nae(t,e){return!!((e==="v4"||!e)&&Cae.test(t)||(e==="v6"||!e)&&Rae.test(t))}function Mae(t,e){if(!Sae.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 jae(t,e){return!!((e==="v4"||!e)&&kae.test(t)||(e==="v6"||!e)&&Eae.test(t))}var eu=class t extends me{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==q.string){let a=this._getOrReturnCtx(e);return U(a,{code:$.invalid_type,expected:q.string,received:a.parsedType}),Y}let n=new Sr,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:$.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),U(i,{code:$.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?U(i,{code:$.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&U(i,{code:$.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Iae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"email",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")eE||(eE=new RegExp(Pae,"u")),eE.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"emoji",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")_ae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"uuid",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")xae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"nanoid",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")yae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")vae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid2",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")bae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ulid",code:$.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),U(i,{validation:"url",code:$.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),U(i,{validation:"regex",code:$.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),U(i,{code:$.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),U(i,{code:$.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:$.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Dae(a).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:$.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Oae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:$.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?$ae(a).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:$.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?wae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"duration",code:$.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Nae(e.data,a.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ip",code:$.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?Mae(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"jwt",code:$.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?jae(e.data,a.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cidr",code:$.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Aae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64",code:$.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Tae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64url",code:$.invalid_string,message:a.message}),n.dirty()):be.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:$.invalid_string,...V.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...V.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...V.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...V.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,...V.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,...V.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...V.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...V.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...V.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...V.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...V.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...V.errToObj(r)})}nonempty(e){return this.min(1,V.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}};eu.create=t=>new eu({checks:[],typeName:J.ZodString,coerce:t?.coerce??!1,...oe(t)});function Lae(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 Lm=class t extends me{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)!==q.number){let a=this._getOrReturnCtx(e);return U(a,{code:$.invalid_type,expected:q.number,received:a.parsedType}),Y}let n,i=new Sr;for(let a of this._def.checks)a.kind==="int"?be.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:$.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),U(n,{code:$.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),U(n,{code:$.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Lae(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),U(n,{code:$.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:$.not_finite,message:a.message}),i.dirty()):be.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:V.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.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"&&be.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)}};Lm.create=t=>new Lm({checks:[],typeName:J.ZodNumber,coerce:t?.coerce||!1,...oe(t)});var Um=class t extends me{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)!==q.bigint)return this._getInvalidInput(e);let n,i=new Sr;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),U(n,{code:$.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),U(n,{code:$.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),U(n,{code:$.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):be.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return U(r,{code:$.invalid_type,expected:q.bigint,received:r.parsedType}),Y}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:V.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:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.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}};Um.create=t=>new Um({checks:[],typeName:J.ZodBigInt,coerce:t?.coerce??!1,...oe(t)});var zm=class extends me{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==q.boolean){let n=this._getOrReturnCtx(e);return U(n,{code:$.invalid_type,expected:q.boolean,received:n.parsedType}),Y}return Nr(e.data)}};zm.create=t=>new zm({typeName:J.ZodBoolean,coerce:t?.coerce||!1,...oe(t)});var Fm=class t extends me{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==q.date){let a=this._getOrReturnCtx(e);return U(a,{code:$.invalid_type,expected:q.date,received:a.parsedType}),Y}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return U(a,{code:$.invalid_date}),Y}let n=new Sr,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:$.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),U(i,{code:$.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):be.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:V.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:V.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}};Fm.create=t=>new Fm({checks:[],coerce:t?.coerce||!1,typeName:J.ZodDate,...oe(t)});var qm=class extends me{_parse(e){if(this._getType(e)!==q.symbol){let n=this._getOrReturnCtx(e);return U(n,{code:$.invalid_type,expected:q.symbol,received:n.parsedType}),Y}return Nr(e.data)}};qm.create=t=>new qm({typeName:J.ZodSymbol,...oe(t)});var tu=class extends me{_parse(e){if(this._getType(e)!==q.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:$.invalid_type,expected:q.undefined,received:n.parsedType}),Y}return Nr(e.data)}};tu.create=t=>new tu({typeName:J.ZodUndefined,...oe(t)});var ru=class extends me{_parse(e){if(this._getType(e)!==q.null){let n=this._getOrReturnCtx(e);return U(n,{code:$.invalid_type,expected:q.null,received:n.parsedType}),Y}return Nr(e.data)}};ru.create=t=>new ru({typeName:J.ZodNull,...oe(t)});var Bm=class extends me{constructor(){super(...arguments),this._any=!0}_parse(e){return Nr(e.data)}};Bm.create=t=>new Bm({typeName:J.ZodAny,...oe(t)});var Uo=class extends me{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Nr(e.data)}};Uo.create=t=>new Uo({typeName:J.ZodUnknown,...oe(t)});var Fi=class extends me{_parse(e){let r=this._getOrReturnCtx(e);return U(r,{code:$.invalid_type,expected:q.never,received:r.parsedType}),Y}};Fi.create=t=>new Fi({typeName:J.ZodNever,...oe(t)});var Vm=class extends me{_parse(e){if(this._getType(e)!==q.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:$.invalid_type,expected:q.void,received:n.parsedType}),Y}return Nr(e.data)}};Vm.create=t=>new Vm({typeName:J.ZodVoid,...oe(t)});var zo=class t extends me{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==q.array)return U(r,{code:$.invalid_type,expected:q.array,received:r.parsedType}),Y;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(o||s)&&(U(r,{code:o?$.too_big:$.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&&(U(r,{code:$.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&&(U(r,{code:$.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 zn(r,o,r.path,s)))).then(o=>Sr.mergeArray(n,o));let a=[...r.data].map((o,s)=>i.type._parseSync(new zn(r,o,r.path,s)));return Sr.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:V.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:V.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:V.toString(r)}})}nonempty(e){return this.min(1,e)}};zo.create=(t,e)=>new zo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...oe(e)});function Ql(t){if(t instanceof xn){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=di.create(Ql(n))}return new xn({...t._def,shape:()=>e})}else return t instanceof zo?new zo({...t._def,type:Ql(t.element)}):t instanceof di?di.create(Ql(t.unwrap())):t instanceof Na?Na.create(Ql(t.unwrap())):t instanceof Da?Da.create(t.items.map(e=>Ql(e))):t}var xn=class t extends me{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=be.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==q.object){let l=this._getOrReturnCtx(e);return U(l,{code:$.invalid_type,expected:q.object,received:l.parsedType}),Y}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 zn(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&&(U(i,{code:$.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 zn(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=>Sr.mergeObjectSync(n,l)):Sr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return V.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:V.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:J.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 be.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 be.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Ql(this)}partial(e){let r={};for(let n of be.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 be.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof di;)a=a._def.innerType;r[n]=a}return new t({...this._def,shape:()=>r})}keyof(){return BU(be.objectKeys(this.shape))}};xn.create=(t,e)=>new xn({shape:()=>t,unknownKeys:"strip",catchall:Fi.create(),typeName:J.ZodObject,...oe(e)});xn.strictCreate=(t,e)=>new xn({shape:()=>t,unknownKeys:"strict",catchall:Fi.create(),typeName:J.ZodObject,...oe(e)});xn.lazycreate=(t,e)=>new xn({shape:t,unknownKeys:"strip",catchall:Fi.create(),typeName:J.ZodObject,...oe(e)});var nu=class extends me{_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 _n(s.ctx.common.issues));return U(r,{code:$.invalid_union,unionErrors:o}),Y}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 _n(c));return U(r,{code:$.invalid_union,unionErrors:s}),Y}}get options(){return this._def.options}};nu.create=(t,e)=>new nu({options:t,typeName:J.ZodUnion,...oe(e)});var $a=t=>t instanceof au?$a(t.schema):t instanceof pi?$a(t.innerType()):t instanceof ou?[t.value]:t instanceof su?t.options:t instanceof cu?be.objectValues(t.enum):t instanceof lu?$a(t._def.innerType):t instanceof tu?[void 0]:t instanceof ru?[null]:t instanceof di?[void 0,...$a(t.unwrap())]:t instanceof Na?[null,...$a(t.unwrap())]:t instanceof O_||t instanceof du?$a(t.unwrap()):t instanceof uu?$a(t._def.innerType):[],tE=class t extends me{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.object)return U(r,{code:$.invalid_type,expected:q.object,received:r.parsedType}),Y;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}):(U(r,{code:$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Y)}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=$a(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:J.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...oe(n)})}};function rE(t,e){let r=Oa(t),n=Oa(e);if(t===e)return{valid:!0,data:t};if(r===q.object&&n===q.object){let i=be.objectKeys(e),a=be.objectKeys(t).filter(s=>i.indexOf(s)!==-1),o={...t,...e};for(let s of a){let c=rE(t[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(r===q.array&&n===q.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=rE(o,s);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===q.date&&n===q.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var iu=class extends me{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(a,o)=>{if(XR(a)||XR(o))return Y;let s=rE(a.value,o.value);return s.valid?((QR(a)||QR(o))&&r.dirty(),{status:r.value,value:s.data}):(U(n,{code:$.invalid_intersection_types}),Y)};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}))}};iu.create=(t,e,r)=>new iu({left:t,right:e,typeName:J.ZodIntersection,...oe(r)});var Da=class t extends me{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.array)return U(n,{code:$.invalid_type,expected:q.array,received:n.parsedType}),Y;if(n.data.length<this._def.items.length)return U(n,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Y;!this._def.rest&&n.data.length>this._def.items.length&&(U(n,{code:$.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 zn(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>Sr.mergeArray(r,o)):Sr.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Da.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Da({items:t,typeName:J.ZodTuple,rest:null,...oe(e)})};var nE=class t extends me{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!==q.object)return U(n,{code:$.invalid_type,expected:q.object,received:n.parsedType}),Y;let i=[],a=this._def.keyType,o=this._def.valueType;for(let s in n.data)i.push({key:a._parse(new zn(n,s,n.path,s)),value:o._parse(new zn(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?Sr.mergeObjectAsync(r,i):Sr.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof me?new t({keyType:e,valueType:r,typeName:J.ZodRecord,...oe(n)}):new t({keyType:eu.create(),valueType:e,typeName:J.ZodRecord,...oe(r)})}},Wm=class extends me{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!==q.map)return U(n,{code:$.invalid_type,expected:q.map,received:n.parsedType}),Y;let i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,c],l)=>({key:i._parse(new zn(n,s,n.path,[l,"key"])),value:a._parse(new zn(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 Y;(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 Y;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}}}};Wm.create=(t,e,r)=>new Wm({valueType:e,keyType:t,typeName:J.ZodMap,...oe(r)});var Hm=class t extends me{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.set)return U(n,{code:$.invalid_type,expected:q.set,received:n.parsedType}),Y;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(U(n,{code:$.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&&(U(n,{code:$.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 Y;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 zn(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:V.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:V.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Hm.create=(t,e)=>new Hm({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...oe(e)});var iE=class t extends me{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.function)return U(r,{code:$.invalid_type,expected:q.function,received:r.parsedType}),Y;function n(s,c){return T_({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Mm(),Lo].filter(l=>!!l),issueData:{code:$.invalid_arguments,argumentsError:c}})}function i(s,c){return T_({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Mm(),Lo].filter(l=>!!l),issueData:{code:$.invalid_return_type,returnTypeError:c}})}let a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Qs){let s=this;return Nr(async function(...c){let l=new _n([]),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 Nr(function(...c){let l=s._def.args.safeParse(c,a);if(!l.success)throw new _n([n(c,l.error)]);let u=Reflect.apply(o,this,l.data),d=s._def.returns.safeParse(u,a);if(!d.success)throw new _n([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:Da.create(e).rest(Uo.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||Da.create([]).rest(Uo.create()),returns:r||Uo.create(),typeName:J.ZodFunction,...oe(n)})}},au=class extends me{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})}};au.create=(t,e)=>new au({getter:t,typeName:J.ZodLazy,...oe(e)});var ou=class extends me{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return U(r,{received:r.data,code:$.invalid_literal,expected:this._def.value}),Y}return{status:"valid",value:e.data}}get value(){return this._def.value}};ou.create=(t,e)=>new ou({value:t,typeName:J.ZodLiteral,...oe(e)});function BU(t,e){return new su({values:t,typeName:J.ZodEnum,...oe(e)})}var su=class t extends me{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{expected:be.joinValues(n),received:r.parsedType,code:$.invalid_type}),Y}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 U(r,{received:r.data,code:$.invalid_enum_value,options:n}),Y}return Nr(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})}};su.create=BU;var cu=class extends me{_parse(e){let r=be.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==q.string&&n.parsedType!==q.number){let i=be.objectValues(r);return U(n,{expected:be.joinValues(i),received:n.parsedType,code:$.invalid_type}),Y}if(this._cache||(this._cache=new Set(be.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=be.objectValues(r);return U(n,{received:n.data,code:$.invalid_enum_value,options:i}),Y}return Nr(e.data)}get enum(){return this._def.values}};cu.create=(t,e)=>new cu({values:t,typeName:J.ZodNativeEnum,...oe(e)});var Qs=class extends me{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.promise&&r.common.async===!1)return U(r,{code:$.invalid_type,expected:q.promise,received:r.parsedType}),Y;let n=r.parsedType===q.promise?r.data:Promise.resolve(r.data);return Nr(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Qs.create=(t,e)=>new Qs({type:t,typeName:J.ZodPromise,...oe(e)});var pi=class extends me{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.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=>{U(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 Y;let c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?Y:c.status==="dirty"?Xl(c.value):r.value==="dirty"?Xl(c.value):c});{if(r.value==="aborted")return Y;let s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?Y: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"?Y:(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"?Y:(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(!Xs(o))return Y;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=>Xs(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):Y);be.assertNever(i)}};pi.create=(t,e,r)=>new pi({schema:t,typeName:J.ZodEffects,effect:e,...oe(r)});pi.createWithPreprocess=(t,e,r)=>new pi({schema:e,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...oe(r)});var di=class extends me{_parse(e){return this._getType(e)===q.undefined?Nr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};di.create=(t,e)=>new di({innerType:t,typeName:J.ZodOptional,...oe(e)});var Na=class extends me{_parse(e){return this._getType(e)===q.null?Nr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Na.create=(t,e)=>new Na({innerType:t,typeName:J.ZodNullable,...oe(e)});var lu=class extends me{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===q.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};lu.create=(t,e)=>new lu({innerType:t,typeName:J.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...oe(e)});var uu=class extends me{_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 jm(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new _n(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new _n(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};uu.create=(t,e)=>new uu({innerType:t,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...oe(e)});var Zm=class extends me{_parse(e){if(this._getType(e)!==q.nan){let n=this._getOrReturnCtx(e);return U(n,{code:$.invalid_type,expected:q.nan,received:n.parsedType}),Y}return{status:"valid",value:e.data}}};Zm.create=t=>new Zm({typeName:J.ZodNaN,...oe(t)});var JFe=Symbol("zod_brand"),O_=class extends me{_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}},$_=class t extends me{_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"?Y: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"?Y: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:J.ZodPipeline})}},du=class extends me{_parse(e){let r=this._def.innerType._parse(e),n=i=>(Xs(i)&&(i.value=Object.freeze(i.value)),i);return jm(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};du.create=(t,e)=>new du({innerType:t,typeName:J.ZodReadonly,...oe(e)});var KFe={object:xn.lazycreate},J;(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"})(J||(J={}));var YFe=eu.create,XFe=Lm.create,QFe=Zm.create,eqe=Um.create,tqe=zm.create,rqe=Fm.create,nqe=qm.create,iqe=tu.create,aqe=ru.create,oqe=Bm.create,sqe=Uo.create,cqe=Fi.create,lqe=Vm.create,uqe=zo.create,Uae=xn.create,dqe=xn.strictCreate,pqe=nu.create,mqe=tE.create,fqe=iu.create,gqe=Da.create,hqe=nE.create,yqe=Wm.create,vqe=Hm.create,bqe=iE.create,_qe=au.create,xqe=ou.create,Sqe=su.create,wqe=cu.create,Iqe=Qs.create,Pqe=pi.create,Cqe=di.create,kqe=Na.create,Rqe=pi.createWithPreprocess,Eqe=$_.create;function pu(t){return!!t._zod}function Fo(t,e){return pu(t)?js(t,e):t.safeParse(e)}function D_(t){if(!t)return;let e;if(pu(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function HU(t){if(pu(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 qo(t){return t==="completed"||t==="failed"||t==="cancelled"}var Hae=Symbol("Let zodToJsonSchema decide on which parser to use");var LBe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function aE(t){let r=D_(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=HU(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function oE(t,e){let r=Fo(t,e);if(!r.success)throw r.error;return r.data}var Xae=6e4,N_=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(y_,r=>{this._oncancel(r)}),this.setNotificationHandler(b_,r=>{this._onprogress(r)}),this.setRequestHandler(v_,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(__,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ue(xe.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(S_,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 ue(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 ue(xe.InvalidParams,`Task not found: ${a}`);if(!qo(o.status))return await this._waitForTaskUpdate(a,n.signal),await i();if(qo(o.status)){let s=await this._taskStore.getTaskResult(a,n.sessionId);return this._clearTaskQueue(a),{...s,_meta:{...s._meta,[jo]:{taskId:a}}}}return await i()};return await i()}),this.setRequestHandler(w_,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 ue(xe.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(P_,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ue(xe.InvalidParams,`Task not found: ${r.params.taskId}`);if(qo(i.status))throw new ue(xe.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 ue(xe.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...a}}catch(i){throw i instanceof ue?i:new ue(xe.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),ue.fromError(xe.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),km(a)||RU(a)?this._onresponse(a):DR(a)?this._onrequest(a,o):kU(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=ue.fromError(xe.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?.[jo]?.taskId;if(n===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:xe.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=IU(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:xe.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),km(e))n(e);else{let o=new ue(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(km(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),km(e))i(e);else{let o=ue.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 ue?o:new ue(xe.InternalError,String(o))}}return}let a;try{let o=await this.request(e,Kl,n);if(o.task)a=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new ue(xe.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:a},n);if(yield{type:"taskStatus",task:s},qo(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)}:s.status==="failed"?yield{type:"error",error:new ue(xe.InternalError,`Task ${a} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new ue(xe.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 ue?o:new ue(xe.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||{},[jo]: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(w=>this._onerror(new Error(`Failed to send cancellation: ${w}`)));let _=b instanceof ue?b:new ue(xe.RequestTimeout,String(b));u(_)};this._responseHandlers.set(p,b=>{if(!n?.signal?.aborted){if(b instanceof Error)return u(b);try{let _=Fo(r,b.result);_.success?l(_.data):u(_.error)}catch(_){u(_)}}}),n?.signal?.addEventListener("abort",()=>{f(n?.signal?.reason)});let g=n?.timeout??Xae,h=()=>f(ue.fromError(xe.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(p,g,n?.maxTotalTimeout,h,n?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let b=_=>{let w=this._responseHandlers.get(p);w?w(_):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(_=>{this._cleanupTimeout(p),u(_)})}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},x_,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},I_,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},TU,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||{},[jo]: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||{},[jo]: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||{},[jo]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=aE(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,a)=>{let o=oE(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=aE(e);this._notificationHandlers.set(n,i=>{let a=oE(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"&&DR(i.message)){let a=i.message.id,o=this._requestResolvers.get(a);o?(o(new ue(xe.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 ue(xe.InvalidRequest,"Request cancelled"));return}let o=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(o),a(new ue(xe.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 ue(xe.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=Om.parse({method:"notifications/tasks/status",params:s});await this.notification(c),qo(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 ue(xe.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(qo(s.status))throw new ue(xe.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=Om.parse({method:"notifications/tasks/status",params:c});await this.notification(l),qo(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}};function ZU(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function GU(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];ZU(o)&&ZU(a)?r[i]={...o,...a}:r[i]=a}return r}var Dq=Bt(WA(),1),Nq=Bt($q(),1);function qde(){let t=new Dq.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Nq.default)(t),t}var vx=class{constructor(e){this._ajv=e??qde()}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 bx=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 Mq(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 jq(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 _x=class extends N_{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Nm.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 vx,this.setRequestHandler(jR,n=>this._oninitialize(n)),this.setNotificationHandler(LR,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(GR,async(n,i)=>{let a=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:o}=n.params,s=Nm.safeParse(o);return s.success&&this._loggingLevels.set(a,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new bx(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=GU(this._capabilities,e)}setRequestHandler(e,r){let i=D_(e)?.method;if(!i)throw new Error("Schema is missing a method literal");let a;if(pu(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=Fo(Dm,c);if(!u.success){let f=u.error instanceof Error?u.error.message:String(u.error);throw new ue(xe.InvalidParams,`Invalid tools/call request: ${f}`)}let{params:d}=u.data,p=await Promise.resolve(r(c,l));if(d.task){let f=Fo(Kl,p);if(!f.success){let g=f.error instanceof Error?f.error.message:String(f.error);throw new ue(xe.InvalidParams,`Invalid task creation result: ${g}`)}return f.data}let m=Fo(C_,p);if(!m.success){let f=m.error instanceof Error?m.error.message:String(m.error);throw new ue(xe.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){jq(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&Mq(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:xU.includes(r)?r:OR,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"},h_)}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},KR,r):this.request({method:"sampling/createMessage",params:e},JR,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},k_,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},k_,r);if(a.action==="accept"&&a.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(a.content);if(!s.valid)throw new ue(xe.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(o){throw o instanceof ue?o:new ue(xe.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},YR,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 Bde(){let t=process.env.WEPPY_ROBLOX_MCP_VERSION?.trim();return t||null}var We=Bde()??"2.17.5";var Vde={antigravity:"Antigravity","antigravity cli":"Antigravity","antigravity-cli":"Antigravity","antigravity ide":"Antigravity","antigravity-ide":"Antigravity",claude:"Claude","claude code":"Claude Code","claude-code":"Claude Code",cline:"Cline",codex:"Codex CLI","codex cli":"Codex CLI","codex-cli":"Codex CLI",continue:"Continue",cursor:"Cursor","cursor-editor":"Cursor","gemini cli":"Gemini CLI","gemini-cli":"Gemini CLI","openai codex":"Codex CLI","openai-codex":"Codex CLI","vs code":"VS Code",vscode:"VS Code",windsurf:"Windsurf","windsurf-editor":"Windsurf",zed:"Zed"};function xx(t){let e=t?.trim().toLowerCase();return e?Vde[e]:void 0}function Lq(t){return xx(t)??t}function Uq(){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 QA="weppy://ui-studio/guide",eT="weppy://ui-studio/tokens",tT="weppy://ui-studio/functional-rules",zq='# UI Studio Guide\n\n**Audience:** AI agents and developers building Roblox interfaces through UI Studio.\n**Resource:** `weppy://ui-studio/guide`\n**Policy:** Design Check quality findings are advisory. Schema errors, unsupported properties, forbidden paths, destructive-action boundaries, and external upload approval remain enforceable safety rules.\n\n## How to use this guide\n\nBuild from project evidence, not from a built-in game subject or genre preset. The guide has three layers:\n\n1. The advisory usability floor covers observable interaction and readability risks.\n2. The visual vocabulary offers optional directions, not a checklist or score.\n3. The review workflow separates verified functional evidence from visual judgment.\n\nVisual quality is contextual. Do not turn token values, shape counts, image counts, ornament counts, occupancy, or family counts into pass conditions.\n\n### Context-first brief gate\n\nFor an ambiguous request, call `manage_ui.design_brief` with an omitted or partial brief. Inspect Studio and project evidence before asking the user for information.\n\n- An empty `StarterGui` proves only that no Edit UI root was observed. For an existing-UI review, return `runtime_not_reviewed` until a Play Client `PlayerGui` observation is available. Treat it as new-interface evidence only when the user explicitly asks to create new UI.\n- Existing `ScreenGui` roots support a redesign or targeted-update interpretation.\n- A selected GUI object is strong target evidence unless the user names a broader scope.\n- Explicit `projectContext` and user choices outrank existing Studio patterns.\n- Existing Studio patterns may inform continuity, but they never create a reusable subject preset.\n- An explicit user placement, grouping, surface, flow, or backdrop choice outranks project evidence, existing UI, and WEPPY fallback in that order.\n\nAsk one focused question at a time. Include a current-state summary, a recommended choice with evidence, useful alternatives, and a free-form escape hatch. Return an exact `brief_patch` for an accepted recommendation.\n\n### Asset recommendation gate\n\nAsset evidence is considered in this order:\n\n1. user-provided `brief.reference_assets`\n2. approved `projectContext.approved_assets`\n3. relevant images already used by the selected project UI\n4. `manage_assets.search` only when `projectContext.asset_search_intent` is explicit and user-approved\n5. an assetless fallback\n\nDo not synthesize a subject search query from names, labels, hierarchy text, or Workspace content. Do not use a recommended asset until the user accepts it. Never invent an `rbxassetid://...` value.\n\n### Calling-agent capability and image generation gate\n\nInspect the calling agent\'s actual callable image capability and local output channel. Do not infer capability from a model or client name, and never record provider credentials.\n\n- Generation and Roblox upload require separate approval.\n- `image_review` means the calling agent can review an output; it does not authorize generation or upload.\n- If generation or local output is unavailable or unknown, continue with approved assets or an assetless fallback.\n\nAfter local generation, show the output for selection. Run upload preflight only after selection, and request separate approval naming the files, count, and destination.\n\n### Project Design Contract gate\n\nPass relevant repository evidence in `projectContext` instead of asking the Studio plugin to guess it:\n\n- `screen_job`, `primary_action`, `content_hierarchy`, recommended `required_states`, and explicitly blocking `required_state_ids`\n- `visual_thesis`, `signature_motif`, and `forbidden_defaults`\n- `presentation_mode` and `focal_region`\n- neutral `surface_roles` and `shape_language`\n- role-specific `layout_preferences` with their decision source\n- `target_profiles` and `platform_distribution`\n- project-owned tokens and approved assets with evidence paths\n\nKeep the returned `design_contract` and `brief_id` together. `create_tree` and `update` require an accepted brief. Candidate directions should differ materially in composition, hierarchy, or interaction behavior; palette swaps alone are not meaningful alternatives.\n\n### Role-based game layout contract\n\nWEPPY supplies style-neutral structure. The calling agent owns visual direction from explicit user intent plus game and project evidence. A WEPPY fallback must not choose the palette, font, imagery treatment, ornament, semantic shape, or numeric opacity for the project.\n\nFor an underspecified `non_modal_overlay`, translate neutral roles into these advisory constraints:\n\n- `persistent_status`: top-left compact individual chrome, growing inward from the edge;\n- `resource_display`: top-right compact chips in a row;\n- `navigation`: side rail or top edge, using individual controls instead of one large shared panel;\n- `slot_action`: bottom-center single-row flow only when the content has real slot semantics;\n- `contextual_action`: transient lower-center or target-relative action, normally one or a few controls;\n- `objective_tracker`: side-edge bounded group that can condense or collapse.\n\nUse a transparent group root for non-modal HUD regions. Opaque paint may remain inside the local bounds of a button, status chip, tracker, or other readable content surface. A contract-backed `modal_overlay`, `fullscreen_navigation`, or `diegetic` presentation may use a backdrop.\n\nOn touch profiles, keep a semantic slot bar between the touch-left and touch-right reserved regions and clear of the top inset. Prefer condense, paginate, collapse, or contextual disclosure over wrapping generic actions into a multi-row bottom-center grid.\n\nEach region can preserve `placement_band`, `flow_axis`, `surface_mode`, `avoid_regions`, `wrap_policy`, `decision_source`, and an optional numeric `max_edge_gap_px`. These are advisory composition constraints, not exact coordinates or a hard tree preset. When the explicit user or approved project evidence requests a different result, preserve it and report only observed functional risk. An explicit user placement without a numeric maximum does not inherit a WEPPY edge-gap limit.\n\n### Design Check coverage gate\n\n`manage_ui.check` reports findings and coverage independently.\n\n- `structural_only` means deterministic Studio checks ran without a calling-agent visual review.\n- `structural_and_visual` means a calling agent reviewed the referenced saved preview and submitted `visualReview` evidence.\n- `visual_status = "not_requested" | "skipped"` must remain visible even when deterministic findings are empty.\n\nUse `visualReview` and its `reviewContext` only for evidence actually reviewed. If interaction states or representative primary-view context are absent, preserve `interaction_states_not_reviewed` or `gameplay_context_unavailable`. WEPPY does not call an external AI service for visual review.\n\nFor UI created only at runtime, run a structured Play session with one client, wait for the UI, and use `snapshot_gui` on `{root:"PlayerGui",segments:[]}`. Pass the saved `{recordId,stepId}` as `runtimeEvidenceRef` and use `observationMode="runtime"` for `manage_ui.check`. The Bridge validates Place, session, client, step status, and PlayerGui origin; never submit a copied tree as runtime evidence. A truncated tree remains partial coverage.\n\nKeep semantic runtime evidence and screenshot evidence separate. Play-mode screenshot capture is unavailable in this build, so a PlayerGui snapshot can complete runtime structure coverage but cannot complete visual review by itself. Preserve `play_screenshot_unsupported`, `background_unverified`, state gaps, and other limitations.\n\n## A. Advisory usability and interaction floor\n\nThese are configurable recommendations. A `priority_high` finding indicates urgency, not a mutation block.\n\n### A.1 Hit, focus, and painted surfaces\n\nEvaluate the resolved `AbsoluteSize` of the interactive hit and focus area. The painted visual surface may be smaller or differently shaped when the larger invisible area does not overlap another action or hide content.\n\nUse target-profile recommendations for touch and focus reachability. Treat them as defaults that projects may adjust with evidence. Always verify that actions remain distinguishable and reachable for every declared input mode.\n\n### A.2 Safe areas and readable text\n\nUse `ScreenInsets`, device simulation, and the declared target profile where available. Review critical actions and information against the actual safe area rather than assuming one global inset.\n\nFor an edge-bound semantic region, compare both the container bounds and the actual painted descendant union with the declared safe boundary. The painted union includes visible background, text, image, and `UIStroke` geometry after `ClipsDescendants`. A transparent parent can therefore be attached while its visible controls remain detached. Report this as one `edge_detached` finding with container, visible, and internal gap evidence. AnchorPoint mismatch alone is diagnostic evidence, not a finding.\n\nEvaluate text against the resolved background, including composable transparency. When an image, gradient, transparent game view, or complex overlay prevents a deterministic background result, return `background_unverified` instead of assuming a dark fallback. Check `TextFits`, `TextBounds`, clipping, long localized strings, and maximum numeric content. Contrast and text-size values are accessibility recommendations, not visual-style quotas. If `TextScaled` is used, constrain it with `UITextSizeConstraint` and verify representative locales.\n\nInspect visible text, images, actions, and painted progress indicators even when semantic metadata is absent. Compare direct siblings and meaningful surfaces across enabled ScreenGui roots. Exclude parent-child paint, progress fill/background composition, hidden roots, and contract-backed intentional overlap. Treat public inset and Core UI state as observed evidence; if expanded chat, player list, or touch-control geometry cannot be observed, report it as estimated or unavailable.\n\n### A.3 Input disclosure and state access\n\nA readable embedded action text can be the visible label when it remains legible across declared targets and locales. Do not duplicate it with a second adjacent label.\n\nUnfamiliar controls need an input-appropriate explanation path:\n\n- pointer and keyboard can use hover or focus labels;\n- gamepad needs a focus-visible action label and current binding;\n- touch needs a persistent label, a labelled disclosure control, or another touch-visible hint.\n\nEvery declared input mode should expose the action meaning and relevant resting, focus, pressed, selected, and disabled states. Pointer hover alone does not establish all-input discoverability.\n\n### A.4 Primary-view protection\n\nFor `non_modal_overlay`, keep the Design Contract focal region visually available. If UI and the primary view compete, consider edge placement, reflow, condensation, collapse, or contextual disclosure. Do not enforce a fixed screen-occupancy ratio.\n\nModal, fullscreen navigation, and diegetic presentation may intentionally use a backdrop when the contract supports it. A full-screen opaque surface is not automatically wrong; its presentation role decides.\n\n### A.5 Supported Roblox UI components\n\nUI Studio tree encoding supports `UIScale`, `UIFlexItem`, `UIShadow`, `UIPageLayout`, `UITableLayout`, `CanvasGroup`, `UIDragDetector`, `UIAspectRatioConstraint`, `UISizeConstraint`, and `UITextSizeConstraint` where listed by the public schema.\n\nNo class is a quality guarantee. Likewise, a `Frame`, `Offset`, sharp edge, or absent image is not a failure by itself. Report observable bounds, text-fit, reachability, focus-path, safe-area, aspect, or interaction evidence.\n\n## B. Visual vocabulary\n\nThis vocabulary is exploratory. Combine, omit, or extend options when project evidence supports the result. Consistency should be explained through roles and relationships, not through rigid family counts.\n\n### B.1 neutral surface roles\n\nAssign visible surfaces a neutral surface role before styling:\n\n- `primary_action`\n- `secondary_action`\n- `navigation`\n- `persistent_status`\n- `transient_status`\n- `resource_display`\n- `contextual_information`\n- `identity`\n- `spatial_information`\n- `slot_action`\n- `contextual_action`\n- `objective_tracker`\n- `decoration`\n\nProjects may add opaque roles. WEPPY must not reuse their subject meaning as another project\'s default.\n\nAn interaction family describes how controls reveal affordance and state. It may be framed, tactile, diegetic, tab-like, ornamented, or an intentional flat control. Gradient, shadow, bevel, rounding, and imagery are optional.\n\n### B.2 Container edge language and semantic shape\n\nPlan container edge language separately from semantic shape.\n\n- Container edge language can be sharp, softly rounded, strongly rounded, cut-corner, asymmetric, organic, or project-defined.\n- Semantic shapes can include a circle, ring, pill, rounded marker, directional wedge, segmented track, organic silhouette, or another project-defined form.\n- A compact status marker may use a ring while a nearby action uses a pill and its containing panel uses a sharp edge language.\n- Mixed semantic shapes supported by role evidence are not a style failure.\n\nUse circles and rings where radial reading, identity, progress, direction, or compact status makes them clearer. Use pills where a short label and bounded interactive state benefit from that silhouette. Use rounded containers when softness or touch affordance supports the thesis. Preserve sharp or cut edges when they better support the project.\n\nDo not require every surface to share one radius. Avoid arbitrary inconsistency, but explain meaningful differences through role, interaction state, hierarchy, or the signature motif.\n\n### B.3 Layout, anchor, and pivot strategy\n\nChoose layout from content hierarchy, parent relationship, focal region, and target profiles.\n\n- Edge placement protects the primary view for persistent non-modal information.\n- Centered hierarchy supports intentionally modal or focused flows.\n- Split, asymmetric, radial, layered, and flow layouts are valid when they clarify relationships.\n- Repeated rectangles are not a default composition. Use bounded panels only where grouping, backdrop, scrolling, or interaction requires them.\n\nTreat `AnchorPoint` as the element\'s positional pivot:\n\n- left/top pivots suit content growing inward from those edges;\n- center pivots suit centered or symmetric relationships;\n- right/bottom pivots suit content growing inward from those edges;\n- project-specific pivots may support a spatial or animated relationship.\n\nWhen using `create_tree`, add optional `layoutMetadata` to meaningful region roots so preview metadata can preserve `surfaceRole`, `placementBand`, `surfaceMode`, and `decisionSource` for review.\n\nScale and Offset are tools, not pass/fail signals. Use Scale for proportional relationships, Offset for stable local dimensions, and combine them deliberately. Add `UIScale`, `UISizeConstraint`, `UIAspectRatioConstraint`, `UITextSizeConstraint`, layout components, Style Query, or project scripts when the target behavior needs them. Verify the resolved result in declared profiles.\n\n### B.4 Imagery strategy\n\nChoose imagery based on explicit role evidence:\n\n- `symbol_set`: consistent compact signs or glyphs\n- `content_thumbnail`: a visual representation of selectable or referenced content\n- `identity_visual`: a visual used primarily for identity or recognition\n- `illustrative_backdrop`: non-interactive atmosphere or framing art\n- `diegetic_surface`: a surface visually integrated with the project world\n- `no_imagery`: an intentional text-and-shape direction\n\nDifferent roles may justify different imagery families on one screen. Coherence comes from treatment, hierarchy, and evidence\u2014not a family quota. If no approved asset exists, use a labelled geometric marker, project-approved glyph, clear placeholder, or `no_imagery`.\n\n### B.5 Depth, ornament, type, colour, and motion\n\nTokens under `weppy://ui-studio/tokens` are examples. They can suggest palette, typography, edge, motion, depth, and composition directions, but they are never mandatory values or quality scores.\n\n- Flatness can be intentional when hierarchy and state remain clear.\n- Depth may use stroke, tonal separation, overlap, shadow, or project imagery.\n- Ornament should reinforce hierarchy or a signature motif rather than fill empty space.\n- Motion should explain state or relationship and respect reduced-motion evidence.\n- Intentional silence\u2014no imagery, no ornament, or no motion\u2014is valid when the contract explains it.\n\n### B.6 Composition and distinctiveness\n\nProtect a clear reading order without forcing a single focal-area percentage. Important relationships may be expressed through scale, placement, colour, typography, motion, negative space, or semantic shape.\n\nBefore applying generic equal-weight rectangles, ask whether the roles call for edge markers, radial indicators, layered surfaces, labelled controls, a bounded content region, or contextual disclosure. If two projects differ only by palette, revisit their evidence and layout plan.\n\n## C. Review workflow\n\n### C.1 Primary visual builder and critic loop\n\nUse **Builder \u2192 Preview \u2192 Critic \u2192 Update** as the primary quality loop:\n\n1. **Builder:** compose from the accepted Design Contract, role relationships, reference evidence, and imagery strategy.\n2. **Preview:** capture the representative primary view after each meaningful create or update pass.\n3. **Critic:** compare the screenshot with the contract and references, then return `recompose`, `refine`, or `approved` with a concise summary and path-backed findings.\n4. **Update:** recompose when the layout or presentation model is wrong; refine when the direction is sound but hierarchy, geometry, imagery, or state treatment needs another pass.\n\nDo not treat schema success or an empty deterministic result as visual approval. `approved` requires representative primary-view evidence, no unresolved `priority_high` functional risk, and a resolved imagery strategy. When required imagery still has only a placeholder or fallback, keep primary visual approval ineligible and propose the separately approved generation or asset path.\n\n### C.2 Visual review\n\nReview qualitative decisions against the Design Contract:\n\n- Is the screen job evident?\n- Does hierarchy match `content_hierarchy`?\n- Are action and information roles distinguishable?\n- Does the container edge language support the visual thesis?\n- Do semantic shapes have role evidence?\n- Is imagery intentional, approved, or intentionally absent?\n- Does the composition protect the focal region?\n- Are required interaction states discoverable for declared inputs?\n\nDo not add visual elements merely to reduce finding counts. Do not issue a failure because a surface is rectangular, circular, sharp, rounded, flat, or image-free.\n\n### C.3 Responsive review\n\nReview the primary target first, then secondary and compatibility targets. User-selected targets and Experience analytics outrank a generic platform default. Excluded targets are recorded but not evaluated as required coverage.\n\nFor each reviewed profile, inspect:\n\n- critical bounds and overlap\n- text fit and localization pressure\n- anchor/pivot behavior during resize and orientation change\n- safe-area placement\n- action reachability and focus path\n- whether reflow, collapse, or contextual disclosure preserves outcomes\n\nIf device simulation is unavailable, report responsive coverage as skipped. Static arithmetic alone does not prove Roblox layout behavior.\n\n### C.4 Coverage language\n\nZero findings means no finding was observed in the checks that ran. It does not mean all quality dimensions passed. Keep structure, visual, interaction, primary-view context, and responsive viewport coverage independent.\n\n## D. Tree encoding\n\n`create_tree` and `update.changes.properties` accept constrained JSON values:\n\n| Roblox type | JSON shape |\n|---|---|\n| `UDim2` | `{xScale, xOffset, yScale, yOffset}` |\n| `UDim` | `{scale, offset}` |\n| `Color3` | `{r, g, b}` |\n| `Vector2` | `{x, y}` |\n| `Vector3` | `{x, y, z}` |\n| `NumberSequence` | `number` or keypoint array |\n| `ColorSequence` | colour keypoint array |\n| `Font` | enum string or `{family, weight, style}` |\n| Enum property | item-name string |\n\nUse a JSON newline escape for multiline text and set `TextWrapped` when appropriate, or use separate `TextLabel` children with a layout component. Do not double-escape a newline into visible backslash text.\n\nKeep `Size` and `Position` in UDim2 object form. Keep colour channel conventions consistent within a tree. Preserve clear instance paths so later updates can target approved placeholders or assets.\n\n---\n\nThis tracked source is embedded into the generated server resource. Run `npm run codegen` after editing it.\n',Fq=`{
246
246
  "$schema": "./design-tokens.schema.json",
247
247
  "version": "2.0.0",
248
248
  "_notes": "palettes is a style-family menu, not a list of recommendations. Each entry carries mood/pairs_with/avoid_for to help match a design_brief. Adding new palettes is encouraged. See ui-studio-guide.md \xA7B.1 and \xA7C.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weppy/roblox-mcp",
3
- "version": "2.17.4",
3
+ "version": "2.17.5",
4
4
  "description": "MCP (Model Context Protocol) server for Roblox Studio integration - enables AI coding agents to interact with Roblox Studio in real-time",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
Binary file