1(()=>{"use strict";var e,t,s,n,a,r,i;(function(e){e.POST_MESSAGE="postMessage"})(e||(e={})),function(e){e.POST_MESSAGE="postMessage"}(t||(t={})),function(e){e.STREAMABLE_HTTP="streamableHttp",e.SSE="sse"}(s||(s={})),function(e){e.LOCAL="local",e.REMOTE="remote"}(n||(n={})),function(e){e.SDK_ANGIE_READY_PING="sdk-angie-ready-ping",e.SDK_ANGIE_REFRESH_PING="sdk-angie-refresh-ping",e.SDK_REQUEST_CLIENT_CREATION="sdk-request-client-creation",e.SDK_REQUEST_INIT_SERVER="sdk-request-init-server"}(a||(a={}));class o{isAngieReady=!1;readyPromise;readyResolve;constructor(){if(this.readyPromise=new Promise(e=>{this.readyResolve=e}),"undefined"==typeof window)return;let e=0;const t=()=>{if(this.isAngieReady||e>=500)return void(!this.isAngieReady&&e>=500&&this.handleDetectionTimeout());const s=new MessageChannel;s.port1.onmessage=e=>{this.handleAngieReady(e.data),s.port1.close(),s.port2.close()};const n={type:a.SDK_ANGIE_READY_PING,timestamp:Date.now()};window.postMessage(n,window.location.origin,[s.port2]),e++,setTimeout(t,500)};t()}handleAngieReady(e){this.isAngieReady=!0;const t={isReady:!0,version:e.version,capabilities:e.capabilities};this.readyResolve&&this.readyResolve(t)}handleDetectionTimeout(){this.readyResolve&&this.readyResolve({isReady:!1}),console.warn("AngieMcpSdk: AngieDetector: Detection timeout - Angie may
1not be available")}isReady(){return this.isAngieReady}async waitForReady(){return this.readyPromise}}class d{queue=[];isProcessing=!1;add(e){const t={id:this.generateId(e),config:e,timestamp:Date.now(),status:"pending"};return this.queue.push(t),console.log(`RegistrationQueue: Added server "${e.name}" to queue`),t}getAll(){return[...this.queue]}getPending(){return this.queue.filter(e=>"pending"===e.status)}updateStatus(e,t,s){const n=this.queue.find(t=>t.id===e);n&&(n.status=t,s?n.error=s:"pending"!==t&&"registered"!==t||delete n.error,console.log(`RegistrationQueue: Updated server ${e} status to ${t}`))}async processQueue(e){if(this.isProcessing)return void console.log("RegistrationQueue: Already processing queue");this.isProcessing=!0;const t=this.getPending();console.log(`RegistrationQueue: Processing ${t.length} pending registrations`);try{for(const s of t)try{await e(s),this.updateStatus(s.id,"registered")}catch(e){const t=e instanceof Error?e.message:String(e);this.updateStatus(s.id,"failed",t),console.error(`RegistrationQueue: Failed to process registration ${s.id}:`,t)}}finally{this.isProcessing=!1}}clear(){this.queue=[],console.log("RegistrationQueue: Cleared all registrations")}resetAllToPending(){if(this.isProcessing)return console.log("RegistrationQueue: Cannot reset to pending - processing in progress"),!1;const e=this.queue.filter(e=>"registered"===e.status).length,t=this.queue.filter(e=>"failed"===e.status).length;return this.queue.forEach(e=>{"pending"!==e.status&&(e.status="pending",delete e.error)}),console.log(`RegistrationQueue: Reset ${e+t} registrations to pending`),!0}remove(e){const t=this.queue.findIndex(t=>t.id===e);return-1!==t&&(this.queue.splice(t,1),console.log(`RegistrationQueue: Removed registration ${e}`),!0)}generateId(e){return`reg_${e.name}_${e.version}_${Date.now()}`}}class c{async requestClientCreation(e){const{config:s}=e,n={serverId:e.id,serverName:s.name,serverVersion:s.version,description:s.description,transport:s.transport||t.POST_MESSAGE,capabilities:s.capabilities,instanceId:e.instanceId};return"type"in s&&"remote"===s.type&&(n.remote={url:s.url}),new Promise((e,t)=>{const s=new MessageChannel,r=setTimeout(()=>{t(new Error("Client creation request timed out after 15000ms"))},15e3);s.port1.onmessage=t=>{clearTimeout(r),e(t.data)};const i={type:a.SDK_REQUEST_CLIENT_CREATION,payload:n,timestamp:Date.now()};window.postMessage(i,window.location.origin,[s.port2])})}}!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const s of e)t[s]=s;return t},e.getValidEnumValues=t=>{const s=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(const e of s)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.push(s);return t},e.find=(e,t)=>{for(const s of e)if(t(s))return s},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(r||(r={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(i||(i={}));const u=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),l=e=>{switch(typeof e){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(e)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(e)?u.array:null===e?u.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?u.promise:"undefined"!=typeof Map&&e instanceof Map?u.map:"undefined"!=typeof Set&&e instanceof Set?u.set:"undefined"!=typeof Date&&e instanceof Date?u.date:u.object;default:return u.unknown}}
vendor: 37,675 bytes, line 1
1,h=r.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"]);class p extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},s={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(n);else if("invalid_return_type"===a.code)n(a.returnTypeError);else if("invalid_arguments"===a.code)n(a.argumentsError);else if(0===a.path.length)s._errors.push(t(a));else{let e=s,n=0;for(;n<a.path.length;){const s=a.path[n];n===a.path.length-1?(e[s]=e[s]||{_errors:[]},e[s]._errors.push(t(a))):e[s]=e[s]||{_errors:[]},e=e[s],n++}}};return n(this),s}static assert(e){if(!(e instanceof p))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},s=[];for(const n of this.issues)if(n.path.length>0){const s=n.path[0];t[s]=t[s]||[],t[s].push(e(n))}else s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}p.create=e=>new p(e);const m=(e,t)=>{let s;switch(e.code){case h.invalid_type:s=e.received===u.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case h.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,r.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:s=`Unrecognized key(s) in object: ${r.joinValues(e.keys,", ")}`;break;case h.invalid_union:s="Invalid input";break;case h.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${r.joinValues(e.options)}`;break;case h.invalid_enum_value:s=`Invalid enum value. Expected ${r.joinValues(e.options)}, received '${e.received}'`;break;case h.invalid_arguments:s="Invalid function arguments";break;case h.invalid_return_type:s="Invalid function return type";break;case h.invalid_date:s="Invalid date";break;case h.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:r.assertNever(e.validation):s="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case h.too_small:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case h.too_big:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case h.custom:s="Invalid input";break;case h.invalid_intersection_types:s="Intersection results could not be merged";break;case h.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case h.not_finite:s="Number must be finite";break;default:s=t.defaultError,r.assertNever(e)}return{message:s}};let g=m;var f;function y(e,t){const s=g,n=(e=>{const{data:t,path:s,errorMaps:n,issueData:a}=e,r=[...s,...a.path||[]],i={...a,path:r};if(void 0!==a.message)return{...a,path:r,message:a.message};let o="";const d=n.filter(e=>!!e).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...a,path:r,message:o}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,s,s===m?void 0:m].filter(e=>!!e)});e.common.issues.push(n)}!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(f||(f={}));class _{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if("aborted"===n.status)return v;"dirty"===n.status&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const e of t){const t=await e.key,n=await e.value;s.push({key:t,value:n})}return _.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:t,value:a}=n;if("aborted"===t.status)return v;if("aborted"===a.status)return v;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!n.alwaysSet||(s[t.value]=a.value)}return{status:e.value,value:s}}}const v=Object.freeze({status:"aborted"}),x=e=>({status:"dirty",value:e}),k=e=>({status:"valid",value:e}),b=e=>"aborted"===e.status,w=e=>"dirty"===e.status,S=e=>"valid"===e.status,I=e=>"undefined"!=typeof Promise&&e instanceof Promise;class A{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}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}}const T=(e,t)=>{if(S(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new p(e.common.issues);return this._error=t,this._error}}};function R(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:n,description:a}=e;if(t&&(s||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:a}:{errorMap:(t,a)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??a.defaultError}:void 0===a.data?{message:r??n??a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:r??s??a.defaultError}},description:a}}class C{get description(){return this._def.description}_getType(e){return l(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new _,ctx:{common:e.parent.common,data:e.data,parsedType:l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(I(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},n=this._parseSync({data:e,path:s.path,parent:s});return T(s,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return S(s)?{value:s.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>S(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:l(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(I(n)?n:Promise.resolve(n));return T(s,a)}refine(e,t){const s=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{const a=e(t),r=()=>n.addIssue({code:h.custom,...s(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then(e=>!!e||(r(),!1)):!!a||(r(),!1)})}refinement(e,t){return this._refinement((s,n)=>!!e(s)||(n.addIssue("function"==typeof t?t(s,n):t),!1))}_refinement(e){return new Ee({schema:this,typeName:qe.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:e=>this["~validate"](e)}}optional(){return Oe.create(this,this._def)}nullable(){return Ze.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return he.create(this)}promise(){return Ce.create(this,this._def)}or(e){return ge.create([this,e],this._def)}and(e){return ve.create(this,e,this._def)}transform(e){return new Ee({...R(this._def),schema:this,typeName:qe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new $e({...R(this._def),innerType:this,defaultValue:t,typeName:qe.ZodDefault})}brand(){return new je({typeName:qe.ZodBranded,type:this,...R(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ne({...R(this._def),innerType:this,catchValue:t,typeName:qe.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Me.create(this,e)}readonly(){return De.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const E=/^c[^\s-]{8,}$/i,O=/^[0-9a-z]+$/,Z=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$=/^[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,N=/^[a-z0-9_-]{21}$/i,P=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,j=/^[-+]?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)?)??$/,M=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let D;const q=/^(?:(?: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])$/,F=/^(?:(?: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])$/,L=/^(([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]))$/,z=/^(([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])$/,V=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,K=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,U="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Q=new RegExp(`^${U}$`);function B(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function H(e){return new RegExp(`^${B(e)}$`)}function W(e){let t=`${U}T${B(e)}`;const s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function G(e,t){return!("v4"!==t&&t||!q.test(e))||!("v6"!==t&&t||!L.test(e))}function J(e,t){if(!P.test(e))return!1;try{const[s]=e.split(".");if(!s)return!1;const n=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),a=JSON.parse(atob(n));return!("object"!=typeof a||null===a||"typ"in a&&"JWT"!==a?.typ||!a.alg||t&&a.alg!==t)}catch{return!1}}function Y(e,t){return!("v4"!==t&&t||!F.test(e))||!("v6"!==t&&t||!z.test(e))}class X extends C{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:u.string,received:t.parsedType}),v}const t=new _;let s;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(s=this._getOrReturnCtx(e,s),y(s,{code:h.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(s=this._getOrReturnCtx(e,s),y(s,{code:h.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const a=e.data.length>n.value,r=e.data.length<n.value;(a||r)&&(s=this._getOrReturnCtx(e,s),a?y(s,{code:h.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):r&&y(s,{code:h.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)M.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"email",code:h.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)D||(D=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),D.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"emoji",code:h.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)$.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"uuid",code:h.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)N.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"nanoid",code:h.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)E.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"cuid",code:h.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)O.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"cuid2",code:h.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)Z.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"ulid",code:h.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),y(s,{validation:"url",code:h.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"regex",code:h.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(e,s),y(s,{code:h.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(s=this._getOrReturnCtx(e,s),y(s,{code:h.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(s=this._getOrReturnCtx(e,s),y(s,{code:h.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?W(n).test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{code:h.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?Q.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{code:h.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?H(n).test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{code:h.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?j.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"duration",code:h.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?G(e.data,n.version)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"ip",code:h.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?J(e.data,n.alg)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"jwt",code:h.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?Y(e.data,n.version)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"cidr",code:h.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?V.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"base64",code:h.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?K.test(e.data)||(s=this._getOrReturnCtx(e,s),y(s,{validation:"base64url",code:h.invalid_string,message:n.message}),t.dirty()):r.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,s){return this.refinement(t=>e.test(t),{validation:t,code:h.invalid_string,...f.errToObj(s)})}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...f.errToObj(e)})}url(e){return this._addCheck({kind:"url",...f.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...f.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...f.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...f.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...f.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...f.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...f.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...f.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...f.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...f.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...f.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...f.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...f.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...f.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...f.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...f.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...f.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...f.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...f.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...f.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...f.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...f.errToObj(t)})}nonempty(e){return this.min(1,f.errToObj(e))}trim(){return new X({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new X({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new X({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function ee(e,t){const s=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=s>n?s:n;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}X.create=e=>new X({checks:[],typeName:qe.ZodString,coerce:e?.coerce??!1,...R(e)});class te extends C{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)!==u.number){const t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:u.number,received:t.parsedType}),v}let t;const s=new _;for(const n of this._def.checks)"int"===n.kind?r.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:h.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:h.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:h.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):"multipleOf"===n.kind?0!==ee(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:h.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:h.not_finite,message:n.message}),s.dirty()):r.assertNever(n);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,f.toString(t))}gt(e,t){return this.setLimit("min",e,!1,f.toString(t))}lte(e,t){return this.setLimit("max",e,!0,f.toString(t))}lt(e,t){return this.setLimit("max",e,!1,f.toString(t))}setLimit(e,t,s,n){return new te({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:f.toString(n)}]})}_addCheck(e){return new te({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:f.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:f.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:f.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:f.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:f.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:f.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:f.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:f.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:f.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&r.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}te.create=e=>new te({checks:[],typeName:qe.ZodNumber,coerce:e?.coerce||!1,...R(e)});class se extends C{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)!==u.bigint)return this._getInvalidInput(e);let t;const s=new _;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:h.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:h.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),y(t,{code:h.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):r.assertNever(n);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:u.bigint,received:t.parsedType}),v}gte(e,t){return this.setLimit("min",e,!0,f.toString(t))}gt(e,t){return this.setLimit("min",e,!1,f.toString(t))}lte(e,t){return this.setLimit("max",e,!0,f.toString(t))}lt(e,t){return this.setLimit("max",e,!1,f.toString(t))}setLimit(e,t,s,n){return new se({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:f.toString(n)}]})}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:f.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:f.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:f.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:f.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:f.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}se.create=e=>new se({checks:[],typeName:qe.ZodBigInt,coerce:e?.coerce??!1,...R(e)});class ne extends C{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==u.boolean){const t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:u.boolean,received:t.parsedType}),v}return k(e.data)}}ne.create=e=>new ne({typeName:qe.ZodBoolean,coerce:e?.coerce||!1,...R(e)});class ae extends C{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:u.date,received:t.parsedType}),v}if(Number.isNaN(e.data.getTime()))return y(this._getOrReturnCtx(e),{code:h.invalid_date}),v;const t=new _;let s;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(s=this._getOrReturnCtx(e,s),y(s,{code:h.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(s=this._getOrReturnCtx(e,s),y(s,{code:h.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):r.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ae({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:f.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:f.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ae.create=e=>new ae({checks:[],coerce:e?.coerce||!1,typeName:qe.ZodDate,...R(e)});class re extends C{_parse(e){if(this._getType(e)!==u.symbol){const t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:u.symbol,received:t.parsedType}),v}return k(e.data)}}re.create=e=>new re({typeName:qe.ZodSymbol,...R(e)});class ie extends C{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:u.undefined,received:t.parsedType}),v}return k(e.data)}}ie.create=e=>new ie({typeName:qe.ZodUndefined,...R(e)});class oe extends C{_parse(e){if(this._getType(e)!==u.null){const t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:u.null,received:t.parsedType}),v}return k(e.data)}}oe.create=e=>new oe({typeName:qe.ZodNull,...R(e)});class de extends C{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}}de.create=e=>new de({typeName:qe.ZodAny,...R(e)});class ce extends C{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}}ce.create=e=>new ce({typeName:qe.ZodUnknown,...R(e)});class ue extends C{_parse(e){const t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:u.never,received:t.parsedType}),v}}ue.create=e=>new ue({typeName:qe.ZodNever,...R(e)});class le extends C{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:u.void,received:t.parsedType}),v}return k(e.data)}}le.create=e=>new le({typeName:qe.ZodVoid,...R(e)});class he extends C{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.array)return y(t,{code:h.invalid_type,expected:u.array,received:t.parsedType}),v;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,a=t.data.length<n.exactLength.value;(e||a)&&(y(t,{code:e?h.too_big:h.too_small,minimum:a?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(y(t,{code:h.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(y(t,{code:h.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((e,s)=>n.type._parseAsync(new A(t,e,t.path,s)))).then(e=>_.mergeArray(s,e));const a=[...t.data].map((e,s)=>n.type._parseSync(new A(t,e,t.path,s)));return _.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new he({...this._def,minLength:{value:e,message:f.toString(t)}})}max(e,t){return new he({...this._def,maxLength:{value:e,message:f.toString(t)}})}length(e,t){return new he({...this._def,exactLength:{value:e,message:f.toString(t)}})}nonempty(e){return this.min(1,e)}}function pe(e){if(e instanceof me){const t={};for(const s in e.shape){const n=e.shape[s];t[s]=Oe.create(pe(n))}return new me({...e._def,shape:()=>t})}return e instanceof he?new he({...e._def,type:pe(e.element)}):e instanceof Oe?Oe.create(pe(e.unwrap())):e instanceof Ze?Ze.create(pe(e.unwrap())):e instanceof xe?xe.create(e.items.map(e=>pe(e))):e}he.create=(e,t)=>new he({type:e,minLength:null,maxLength:null,exactLength:null,typeName:qe.ZodArray,...R(t)});class me extends C{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=r.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:u.object,received:t.parsedType}),v}const{status:t,ctx:s}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),r=[];if(!(this._def.catchall instanceof ue&&"strip"===this._def.unknownKeys))for(const e in s.data)a.includes(e)||r.push(e);const i=[];for(const e of a){const t=n[e],a=s.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new A(s,a,s.path,e)),alwaysSet:e in s.data})}if(this._def.catchall instanceof ue){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of r)i.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)r.length>0&&(y(s,{code:h.unrecognized_keys,keys:r}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of r){const n=s.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new A(s,n,s.path,t)),alwaysSet:t in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of i){const s=await t.key,n=await t.value;e.push({key:s,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>_.mergeObjectSync(t,e)):_.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return f.errToObj,new me({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,s)=>{const n=this._def.errorMap?.(t,s).message??s.defaultError;return"unrecognized_keys"===t.code?{message:f.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new me({...this._def,unknownKeys:"strip"})}passthrough(){return new me({...this._def,unknownKeys:"passthrough"})}extend(e){return new me({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new me({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:qe.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new me({...this._def,catchall:e})}pick(e){const t={};for(const s of r.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new me({...this._def,shape:()=>t})}omit(e){const t={};for(const s of r.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new me({...this._def,shape:()=>t})}deepPartial(){return pe(this)}partial(e){const t={};for(const s of r.objectKeys(this.shape)){const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}return new me({...this._def,shape:()=>t})}required(e){const t={};for(const s of r.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof Oe;)e=e._def.innerType;t[s]=e}return new me({...this._def,shape:()=>t})}keyof(){return Ae(r.objectKeys(this.shape))}}me.create=(e,t)=>new me({shape:()=>e,unknownKeys:"strip",catchall:ue.create(),typeName:qe.ZodObject,...R(t)}),me.strictCreate=(e,t)=>new me({shape:()=>e,unknownKeys:"strict",catchall:ue.create(),typeName:qe.ZodObject,...R(t)}),me.lazycreate=(e,t)=>new me({shape:e,unknownKeys:"strip",catchall:ue.create(),typeName:qe.ZodObject,...R(t)});class ge extends C{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;if(t.common.async)return Promise.all(s.map(async e=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const s of e)if("dirty"===s.result.status)return t.common.issues.push(...s.ctx.common.issues),s.result;const s=e.map(e=>new p(e.ctx.common.issues));return y(t,{code:h.invalid_union,unionErrors:s}
vendor: 4,647 bytes, line 1
1),v});{let e;const n=[];for(const a of s){const s={...t,common:{...t.common,issues:[]},parent:null},r=a._parseSync({data:t.data,path:t.path,parent:s});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:s}),s.common.issues.length&&n.push(s.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=n.map(e=>new p(e));return y(t,{code:h.invalid_union,unionErrors:a}),v}}get options(){return this._def.options}}ge.create=(e,t)=>new ge({options:e,typeName:qe.ZodUnion,...R(t)});const fe=e=>e instanceof Se?fe(e.schema):e instanceof Ee?fe(e.innerType()):e instanceof Ie?[e.value]:e instanceof Te?e.options:e instanceof Re?r.objectValues(e.enum):e instanceof $e?fe(e._def.innerType):e instanceof ie?[void 0]:e instanceof oe?[null]:e instanceof Oe?[void 0,...fe(e.unwrap())]:e instanceof Ze?[null,...fe(e.unwrap())]:e instanceof je||e instanceof De?fe(e.unwrap()):e instanceof Ne?fe(e._def.innerType):[];class ye extends C{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return y(t,{code:h.invalid_type,expected:u.object,received:t.parsedType}),v;const s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),v)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const n=new Map;for(const s of t){const t=fe(s.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of t){if(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,s)}}return new ye({typeName:qe.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...R(s)})}}function _e(e,t){const s=l(e),n=l(t);if(e===t)return{valid:!0,data:e};if(s===u.object&&n===u.object){const s=r.objectKeys(t),n=r.objectKeys(e).filter(e=>-1!==s.indexOf(e)),a={...e,...t};for(const s of n){const n=_e(e[s],t[s]);if(!n.valid)return{valid:!1};a[s]=n.data}return{valid:!0,data:a}}if(s===u.array&&n===u.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let n=0;n<e.length;n++){const a=_e(e[n],t[n]);if(!a.valid)return{valid:!1};s.push(a.data)}return{valid:!0,data:s}}return s===u.date&&n===u.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class ve extends C{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=(e,n)=>{if(b(e)||b(n))return v;const a=_e(e.value,n.value);return a.valid?((w(e)||w(n))&&t.dirty(),{status:t.value,value:a.data}):(y(s,{code:h.invalid_intersection_types}),v)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ve.create=(e,t,s)=>new ve({left:e,right:t,typeName:qe.ZodIntersection,...R(s)});class xe extends C{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.array)return y(s,{code:h.invalid_type,expected:u.array,received:s.parsedType}),v;if(s.data.length<this._def.items.length)return y(s,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v;!this._def.rest&&s.data.length>this._def.items.length&&(y(s,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...s.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new A(s,e,s.path,t)):null}).filter(e=>!!e);return s.common.async?Promise.all(n).then(e=>_.mergeArray(t,e)):_.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new xe({...this._def,rest:e})}}xe.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xe({items:e,typeName:qe.ZodTuple,rest:null,...R(t)})};class ke extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.object)return y(s,{code:h.invalid_type,expected:u.object,received:s.parsedType}),v;const n=[],a=this._def.keyType,r=this._def.valueType;for(const e in s.data)n.push({key:a._parse(new A(s,e,s.path,e)),value:r._parse(new A(s,s.data[e],s.path,e)),alwaysSet:e in s.data});return s.common.async?_.mergeObjectAsync(t,n):_.mergeObjectSync(t,n)}
1get element(){return this._def.valueType}static create(e,t,s){return new ke(t instanceof C?{keyType:e,valueType:t,typeName:qe.ZodRecord,...R(s)}:{keyType:X.create(),valueType:e,typeName:qe.ZodRecord,...R(t)})}}class be extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.map)return y(s,{code:h.invalid_type,expected:u.map,received:s.parsedType}),v;const n=this._def.keyType,a=this._def.valueType,r=[...s.data.entries()].map(([e,t],r)=>({key:n._parse(new A(s,e,s.path,[r,"key"])),value:a._parse(new A(s,t,s.path,[r,"value"]))}));if(s.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const s of r){const n=await s.key,a=await s.value;if("aborted"===n.status||"aborted"===a.status)return v;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}})}{const e=new Map;for(const s of r){const n=s.key,a=s.value;if("aborted"===n.status||"aborted"===a.status)return v;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}}}be.create=(e,t,s)=>new be({valueType:t,keyType:e,typeName:qe.ZodMap,...R(s)});class we extends C{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.set)return y(s,{code:h.invalid_type,expected:u.set,received:s.parsedType}),v;const n=this._def;null!==n.minSize&&s.data.size<n.minSize.value&&(y(s,{code:h.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&s.data.size>n.maxSize.value&&(y(s,{code:h.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function r(e){const s=new Set;for(const n of e){if("aborted"===n.status)return v;"dirty"===n.status&&t.dirty(),s.add(n.value)}return{status:t.value,value:s}}const i=[...s.data.values()].map((e,t)=>a._parse(new A(s,e,s.path,t)));return s.common.async?Promise.all(i).then(e=>r(e)):r(i)}min(e,t){return new we({...this._def,minSize:{value:e,message:f.toString(t)}})}max(e,t){return new we({...this._def,maxSize:{value:e,message:f.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}we.create=(e,t)=>new we({valueType:e,minSize:null,maxSize:null,typeName:qe.ZodSet,...R(t)});class Se extends C{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Se.create=(e,t)=>new Se({getter:e,typeName:qe.ZodLazy,...R(t)});class Ie extends C{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),v}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ae(e,t){return new Te({values:e,typeName:qe.ZodEnum,...R(t)})}Ie.create=(e,t)=>new Ie({value:e,typeName:qe.ZodLiteral,...R(t)});class Te extends C{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),s=this._def.values;return y(t,{expected:r.joinValues(s),received:t.parsedType,code:h.invalid_type}),v}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return y(t,{received:t.data,code:h.invalid_enum_value,options:s}),v}return k(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Te.create(e,{...this._def,...t})}exclude(e,t=this._def){return Te.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}Te.create=Ae;class Re extends C{_parse(e){const t=r.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==u.string&&s.parsedType!==u.number){const e=r.objectValues(t);return y(s,{expected:r.joinValues(e),received:s.parsedType,code:h.invalid_type}),v}if(this._cache||(this._cache=new Set(r.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=r.objectValues(t);return y(s,{received:s.data,code:h.invalid_enum_value,options:e}),v}return k(e.data)}get enum(){return this._def.values}}Re.create=(e,t)=>
1new Re({values:e,typeName:qe.ZodNativeEnum,...R(t)});class Ce extends C{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&!1===t.common.async)return y(t,{code:h.invalid_type,expected:u.promise,received:t.parsedType}),v;const s=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return k(s.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Ce.create=(e,t)=>new Ce({type:e,typeName:qe.ZodPromise,...R(t)});class Ee extends C{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===qe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:e=>{y(s,e),e.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===n.type){const e=n.transform(s.data,a);if(s.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return v;const n=await this._def.schema._parseAsync({data:e,path:s.path,parent:s});return"aborted"===n.status?v:"dirty"===n.status||"dirty"===t.value?x(n.value):n});{if("aborted"===t.value)return v;const n=this._def.schema._parseSync({data:e,path:s.path,parent:s});return"aborted"===n.status?v:"dirty"===n.status||"dirty"===t.value?x(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,a);if(s.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===s.common.async){const n=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===n.status?v:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(s=>"aborted"===s.status?v:("dirty"===s.status&&t.dirty(),e(s.value).then(()=>({status:t.value,value:s.value}))))}if("transform"===n.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!S(e))return v;const r=n.transform(e.value,a);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(e=>S(e)?Promise.resolve(n.transform(e.value,a)).then(e=>({status:t.value,value:e})):v)}r.assertNever(n)}}Ee.create=(e,t,s)=>new Ee({schema:e,typeName:qe.ZodEffects,effect:t,...R(s)}),Ee.createWithPreprocess=(e,t,s)=>new Ee({schema:t,effect:{type:"preprocess",transform:e},typeName:qe.ZodEffects,...R(s)});class Oe extends C{_parse(e){return this._getType(e)===u.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Oe.create=(e,t)=>new Oe({innerType:e,typeName:qe.ZodOptional,...R(t)});class Ze extends C{_parse(e){return this._getType(e)===u.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:qe.ZodNullable,...R(t)});class $e extends C{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===u.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}$e.create=(e,t)=>new $e({innerType:e,typeName:qe.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...R(t)});class Ne extends C{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return I(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new p(s.common.issues)},input:s.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new p(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Ne.create=(e,t)=>new Ne({innerType:e,typeName:qe.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...R(t)});class Pe extends C{_parse(e){if(this._getType(e)!==u.nan){const t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:u.nan,received:t.parsedType}),v}
vendor: 2,283 bytes, line 1
1return{status:"valid",value:e.data}}}Pe.create=e=>new Pe({typeName:qe.ZodNaN,...R(e)}),Symbol("zod_brand");class je extends C{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class Me extends C{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?v:"dirty"===e.status?(t.dirty(),x(e.value)):this._def.out._parseAsync({data:e.value,path:s.path,parent:s})})();{const e=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?v:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:s.path,parent:s})}}static create(e,t){return new Me({in:e,out:t,typeName:qe.ZodPipeline})}}class De extends C{_parse(e){const t=this._def.innerType._parse(e),s=e=>(S(e)&&(e.value=Object.freeze(e.value)),e);return I(t)?t.then(e=>s(e)):s(t)}unwrap(){return this._def.innerType}}var qe;De.create=(e,t)=>new De({innerType:e,typeName:qe.ZodReadonly,...R(t)}),me.lazycreate,function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(qe||(qe={}));const Fe=X.create,Le=te.create,ze=(Pe.create,se.create,ne.create),Ve=(ae.create,re.create,ie.create,oe.create,de.create,ce.create),Ke=(ue.create,le.create,he.create),Ue=me.create,Qe=(me.
1strictCreate,ge.create),Be=ye.create,He=(ve.create,xe.create,ke.create),We=(be.create,we.create,Se.create,Ie.create),Ge=Te.create,Je=(Re.create,Ce.create,Ee.create,Oe.create),Ye=(Ze.create,Ee.createWithPreprocess,Me.create,"2.0"),Xe=Qe([Fe(),Le().int()]),et=Fe(),tt=Ue({progressToken:Je(Xe)}).passthrough(),st=Ue({_meta:Je(tt)}).passthrough(),nt=Ue({method:Fe(),params:Je(st)}),at=Ue({_meta:Je(Ue({}).passthrough())}).passthrough(),rt=Ue({method:Fe(),params:Je(at)}),it=Ue({_meta:Je(Ue({}).passthrough())}).passthrough(),ot=Qe([Fe(),Le().int()]),dt=Ue({jsonrpc:We(Ye),id:ot}).merge(nt).strict(),ct=Ue({jsonrpc:We(Ye)}).merge(rt).strict(),ut=Ue({jsonrpc:We(Ye),id:ot,result:it}).strict();var lt;!function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"}(lt||(lt={}));const ht=Qe([dt,ct,ut,Ue({jsonrpc:We(Ye),id:ot,error:Ue({code:Le().int(),message:Fe(),data:Je(Ve())})}).strict()]),pt=it.strict(),mt=rt.extend({method:We("notifications/cancelled"),params:at.extend({requestId:ot,reason:Fe().optional()})}),gt=Ue({name:Fe(),title:Je(Fe())}).passthrough(),ft=gt.extend({version:Fe()}),yt=Ue({experimental:Je(Ue({}).passthrough()),sampling:Je(Ue({}).passthrough()),elicitation:Je(Ue({}).passthrough()),roots:Je(Ue({listChanged:Je(ze())}).passthrough())}).passthrough(),_t=nt.extend({method:We("initialize"),params:st.extend({protocolVersion:Fe(),capabilities:yt,clientInfo:ft})}),vt=Ue({experimental:Je(Ue({}).passthrough()),logging:Je(Ue({}).passthrough()),completions:Je(Ue({}).passthrough()),prompts:Je(Ue({listChanged:Je(ze())}).passthrough()),resources:Je(Ue({subscribe:Je(ze()),listChanged:Je(ze())}).passthrough()),tools:Je(Ue({listChanged:Je(ze())}).passthrough())}).passthrough(),xt=it.extend({protocolVersion:Fe(),capabilities:vt,serverInfo:ft,instructions:Je(Fe())}),kt=rt.extend({method:We("notifications/initialized")}),bt=nt.extend({method:We("ping")}),wt=Ue({progress:Le(),total:Je(Le()),message:Je(Fe())}).passthrough(),St=rt.extend({method:We("notifications/progress"),params:at.merge(wt).extend({progressToken:Xe})}),It=nt.extend({params:st.extend({cursor:Je(et)}).optional()}),At=it.extend({nextCursor:Je(et)}),Tt=Ue({uri:Fe(),mimeType:Je(Fe()),_meta:Je(Ue({}).passthrough())}).passthrough(),Rt=Tt.extend({text:Fe()}),Ct=Fe().refine(e=>{try{return atob(e),!0}catch(e){return!1}},{message:"Invalid Base64 string"}),Et=Tt.extend({blob:Ct}),Ot=gt.extend({uri:Fe(),description:Je(Fe()),mimeType:Je(Fe()),_meta:Je(Ue({}).passthrough())}),Zt=gt.extend({uriTemplate:Fe(),description:Je(Fe()),mimeType:Je(Fe()),_meta:Je(Ue({}).passthrough())}),$t=It.extend({method:We("resources/list")}),Nt=At.extend({resources:Ke(Ot)}),Pt=It.extend({method:We("resources/templates/list")}),jt=At.extend({resourceTemplates:Ke(Zt)}),Mt=nt.extend({method:We("resources/read"),params:st.extend({uri:Fe()})}),Dt=it.extend({contents:Ke(Qe([Rt,Et]))}),qt=rt.extend({method:We("notifications/resources/list_changed")}),Ft=nt.extend({method:We("resources/subscribe"),params:st.extend({uri:Fe()})}),Lt=nt.extend({method:We("resources/unsubscribe"),params:st.extend({uri:Fe()})}),zt=rt.extend({method:We("notifications/resources/updated"),params:at.extend({uri:Fe()})}),Vt=Ue({name:Fe(),description:Je(Fe()),required:Je(ze())}).passthrough(),Kt=gt.extend({description:Je(Fe()),arguments:Je(Ke(Vt)),_meta:Je(Ue({}).passthrough())}),Ut=It.extend({method:We("prompts/list")}),Qt=At.extend({prompts:Ke(Kt)}),Bt=nt.extend({method:We("prompts/get"),params:st.extend({name:Fe(),arguments:Je(He(Fe()))})}),Ht=Ue({type:We("text"),text:Fe(),_meta:Je(Ue({}).passthrough())}).passthrough(),Wt=Ue({type:We("image"),data:Ct,mimeType:Fe(),_meta:Je(Ue({}).passthrough())}).passthrough(),Gt=Ue({type:We("audio"),data:Ct,mimeType:Fe(),_meta:Je(Ue({}).passthrough())}).passthrough(),Jt=Ue({type:We("resource"),resource:Qe([Rt,Et]),_meta:Je(Ue({}).passthrough())}).passthrough(),Yt=Qe([Ht,Wt,Gt,Ot.extend({type:We("resource_link")}),Jt]),Xt=Ue({role:Ge(["user","assistant"]),content:Yt}).passthrough(),es=it.extend({description:Je(Fe()),messages:Ke(Xt)}),ts=rt.extend({method:We("notifications/prompts/list_changed")}),ss=Ue({title:Je(Fe()),readOnlyHint:Je(ze()),destructiveHint:Je(ze()),idempotentHint:Je(ze()),openWorldHint:Je(ze())}).passthrough(),ns=gt.extend({description:Je(Fe()),inputSchema:Ue({type:We("object"),properties:Je(Ue({}).passthrough()),required:Je(Ke(Fe()))}
1).passthrough(),outputSchema:Je(Ue({type:We("object"),properties:Je(Ue({}).passthrough()),required:Je(Ke(Fe()))}).passthrough()),annotations:Je(ss),_meta:Je(Ue({}).passthrough())}),as=It.extend({method:We("tools/list")}),rs=At.extend({tools:Ke(ns)}),is=it.extend({content:Ke(Yt).default([]),structuredContent:Ue({}).passthrough().optional(),isError:Je(ze())}),os=(is.or(it.extend({toolResult:Ve()})),nt.extend({method:We("tools/call"),params:st.extend({name:Fe(),arguments:Je(He(Ve()))})})),ds=rt.extend({method:We("notifications/tools/list_changed")}),cs=Ge(["debug","info","notice","warning","error","critical","alert","emergency"]),us=nt.extend({method:We("logging/setLevel"),params:st.extend({level:cs})}),ls=rt.extend({method:We("notifications/message"),params:at.extend({level:cs,logger:Je(Fe()),data:Ve()})}),hs=Ue({name:Fe().optional()}).passthrough(),ps=Ue({hints:Je(Ke(hs)),costPriority:Je(Le().min(0).max(1)),speedPriority:Je(Le().min(0).max(1)),intelligencePriority:Je(Le().min(0).max(1))}).passthrough(),ms=Ue({role:Ge(["user","assistant"]),content:Qe([Ht,Wt,Gt])}).passthrough(),gs=nt.extend({method:We("sampling/createMessage"),params:st.extend({messages:Ke(ms),systemPrompt:Je(Fe()),includeContext:Je(Ge(["none","thisServer","allServers"])),temperature:Je(Le()),maxTokens:Le().int(),stopSequences:Je(Ke(Fe())),metadata:Je(Ue({}).passthrough()),modelPreferences:Je(ps)})}),fs=it.extend({model:Fe(),stopReason:Je(Ge(["endTurn","stopSequence","maxTokens"]).or(Fe())),role:Ge(["user","assistant"]),content:Be("type",[Ht,Wt,Gt])}),ys=Qe([Ue({type:We("boolean"),title:Je(Fe()),description:Je(Fe()),default:Je(ze())}).passthrough(),Ue({type:We("string"),title:Je(Fe()),description:Je(Fe()),minLength:Je(Le()),maxLength:Je(Le()),format:Je(Ge(["email","uri","date","date-time"]))}).passthrough(),Ue({type:Ge(["number","integer"]),title:Je(Fe()),description:Je(Fe()),minimum:Je(Le()),maximum:Je(Le())}).passthrough(),Ue({type:We("string"),title:Je(Fe()),description:Je(Fe()),enum:Ke(Fe()),enumNames:Je(Ke(Fe()))}).passthrough()]),_s=nt.extend({method:We("elicitation/create"),params:st.extend({message:Fe(),requestedSchema:Ue({type:We("object"),properties:He(Fe(),ys),required:Je(Ke(Fe()))}).passthrough()})}),vs=it.extend({action:Ge(["accept","decline","cancel"]),content:Je(He(Fe(),Ve()))}),xs=Ue({type:We("ref/resource"),uri:Fe()}).passthrough(),ks=Ue({type:We("ref/prompt"),name:Fe()}).passthrough(),bs=nt.extend({method:We("completion/complete"),params:st.extend({ref:Qe([ks,xs]),argument:Ue({name:Fe(),value:Fe()}).passthrough(),context:Je(Ue({arguments:Je(He(Fe(),Fe()))}))})}),ws=it.extend({completion:Ue({values:Ke(Fe()).max(100),total:Je(Le().int()),hasMore:Je(ze())}).passthrough()}),Ss=Ue({uri:Fe().startsWith("file://"),name:Je(Fe()),_meta:Je(Ue({}).passthrough())}).passthrough(),Is=nt.extend({method:We("roots/list")}),As=it.extend({roots:Ke(Ss)}),Ts=rt.extend({method:We("notifications/roots/list_changed")});Qe([bt,_t,bs,us,Bt,Ut,$t,Pt,Mt,Ft,Lt,os,as]),Qe([mt,St,kt,Ts]),Qe([pt,fs,vs,As]),Qe([bt,gs,_s,Is]),Qe([mt,St,ls,zt,qt,ds,ts]),Qe([pt,xt,ws,es,Qt,Nt,jt,Dt,is,rs]),Error;class Rs{sessionId;onmessage;onerror;onclose;_port;_started=!1;_closed=!1;constructor(e,t){if(!e)throw new Error("MessagePort is required");this._port=e,this.sessionId=t||this.generateId(),this._port.onmessage=e=>{try{const t=ht.parse(e.data);this.onmessage?.(t)}catch(e){const t=new Error(`Failed to parse message: ${e}`);this.onerror?.(t)}},this._port.onmessageerror=e=>{const t=new Error(`MessagePort error: ${JSON.stringify(e)}`);this.onerror?.(t)}}static generateSessionId(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,10)}`}async start(){if(this._started)throw new Error("BrowserContextTransport already started! If using Client or Server class, note that connect() calls start() automatically.");if(this._closed)throw new Error("Cannot start a closed BrowserContextTransport");this._started=!0,this._port.start()}async send(e){if(this._closed)throw new Error("Cannot send on a closed BrowserContextTransport");return new Promise((t,s)=>{try{this._port.postMessage(e),t()}catch(e){const t=e instanceof Error?e:new Error(String(e));this.onerror?.(t),s(t)}})}async close(){this._closed||(this._closed=!0,this._port.close(),this.onclose?.())}generateId(){return Rs.generateSessionId()}}class Cs{angieDetector;registrationQueue;clientManager;isInitialized=!1;instanceId;constructor(){this.instanceId=Math.random().toString(36).substring(2,8),console.log(`AngieMcpSdk: Constructor called - initializing SDK (Instance: ${this.instanceId})`),this.angieDetector=new o,this.registrationQueue=new d,this.clientManager=new c,console.log(`AngieMcpSdk: Setting up event handlers (Instance: ${this.instanceId})`),this.setupAngieReadyHandler(),this.setupServerInitHandler(),this.setupReRegistrationHandler(),console.log(`AngieMcpSdk: SDK initialization complete (Instance: ${this.instanceId})`)}setupReRegistrationHandler(){window.addEventListener("message",e=>
1{if(e.data?.type===a.SDK_ANGIE_REFRESH_PING)if(console.log(`AngieMcpSdk: Angie refresh ping received (Instance: ${this.instanceId})`),this.registrationQueue.resetAllToPending()){const e=this.registrationQueue.getPending().length;console.log(`AngieMcpSdk: Successfully reset ${e} registrations, processing queue (Instance: ${this.instanceId})`),this.handleAngieReady()}else console.log(`AngieMcpSdk: Skipping queue reset - processing already in progress (Instance: ${this.instanceId})`)})}setupAngieReadyHandler(){this.angieDetector.waitForReady().then(e=>{e.isReady?this.handleAngieReady():console.warn("AngieMcpSdk: Angie not detected - servers will remain queued")}).catch(e=>{console.error("AngieMcpSdk: Error waiting for Angie:",e)})}async handleAngieReady(){console.log(`AngieMcpSdk: Angie is ready, processing queued registrations (Instance: ${this.instanceId})`);try{await this.registrationQueue.processQueue(async e=>{console.log(`AngieMcpSdk: processQueue callback called for "${e.config.name}" (Instance: ${this.instanceId})`),await this.processRegistration(e)}),this.isInitialized=!0,console.log(`AngieMcpSdk: Initialization complete (Instance: ${this.instanceId})`)}catch(e){console.error(`AngieMcpSdk: Error processing registration queue (Instance: ${this.instanceId}):`,e)}}async processRegistration(e){console.log(`AngieMcpSdk: Processing registration for server "${e.config.name}" (ID: ${e.id}) (Instance: ${this.instanceId})`);try{console.log(`AngieMcpSdk: Calling clientManager.requestClientCreation for "${e.config.name}" (Instance: ${this.instanceId})`);const t={...e,instanceId:this.instanceId};await this.clientManager.requestClientCreation(t),console.log(`AngieMcpSdk: Successfully registered server "${e.config.name}" (Instance: ${this.instanceId})`)}catch(t){throw console.error(`AngieMcpSdk: Failed to register server "${e.config.name}" (Instance: ${this.instanceId}):`,t),t}}registerLocalServer(e){return e.type=n.LOCAL,e.transport=t.POST_MESSAGE,this.registerServer(e)}registerRemoteServer(e){return e.type=n.REMOTE,this.registerServer(e)}async registerServer(e){if(!e.type)return console.warn("AngieMcpSdk: for a local server, please use registerLocalServer instead of registerServer"),void this.registerLocalServer(e);if(console.log(`AngieMcpSdk: registerServer called for "${e.name}" (Instance: ${this.instanceId})`),!e.name)throw new Error("Server name is required");if(!e.description)throw new Error("Server description is required");if("type"in e&&"local"===e.type&&!e.server||!("type"in e)&&!e.server)throw new Error("Server instance is required");console.log(`AngieMcpSdk: Registering server "${e.name}" (Instance: ${this.instanceId})`);const t=this.registrationQueue.add(e);if(console.log(`AngieMcpSdk: Added registration to queue: ${t.id} (Instance: ${this.instanceId})`),this.angieDetector.isReady())try{await this.processRegistration(t),this.registrationQueue.updateStatus(t.id,"registered"),console.log(`AngieMcpSdk: Server "${e.name}" registered successfully (Instance: ${this.instanceId})`)}catch(e){const s=e instanceof Error?e.message:String(e);throw this.registrationQueue.updateStatus(t.id,"failed",s),e}else console.log(`AngieMcpSdk: Server "${e.name}" queued until Angie is ready (Instance: ${this.instanceId})`)}getRegistrations(){return this.registrationQueue.getAll()}getPendingRegistrations(){return this.registrationQueue.getPending()}isAngieReady(){return this.angieDetector.isReady()}isReady(){return this.isInitialized}async waitForReady(){if(!(await this.angieDetector.waitForReady()).isReady)throw new Error("Angie is not available");for(;!this.isInitialized;)await new Promise(e=>setTimeout(e,100))}destroy(){this.registrationQueue.clear(),console.log(`AngieMcpSdk: SDK destroyed (Instance: ${this.instanceId})`)}setupServerInitHandler(){window.addEventListener("message",e=>{e.data?.type===a.SDK_REQUEST_INIT_SERVER&&(console.log(`AngieMcpSdk: Server init request received (Instance: ${this.instanceId})`),this.handleServerInitRequest(e))})}handleServerInitRequest(e){const{clientId:t,serverId:s,instanceId:n}=e.data.payload||{};if(t&&s)if(console.log(`AngieMcpSdk: Server init request received - Request instanceId: ${n}, This instanceId: ${this.instanceId} (Instance: ${this.instanceId})`),n&&n!==this.instanceId)console.log(`AngieMcpSdk: Ignoring server init request for different instance. Request instanceId: ${n}, this instanceId: ${this.instanceId}`);else{console.log(`AngieMcpSdk: Handling server init request for clientId: ${t}, serverId: ${s} (Instance: ${this.instanceId})`);try{const t=this.registrationQueue.getAll().find(e=>e.id===s);if(!t)return void console.error(`AngieMcpSdk: No registration found for serverId: ${s} (Instance: ${this.instanceId})`);
1if("type"in t.config&&"remote"===t.config.type)return void console.log(`AngieMcpSdk: Remote server registration detected; skipping local connect (Instance: ${this.instanceId})`);const n=e.ports[0];if(!n)return void console.error(`AngieMcpSdk: No port provided in server init request (Instance: ${this.instanceId})`);const a=t.config.server,r=new Rs(n);a.connect(r),console.log(`AngieMcpSdk: Server "${t.config.name}" initialized successfully (Instance: ${this.instanceId})`)}catch(e){console.error(`AngieMcpSdk: Error initializing server for clientId ${t} (Instance: ${this.instanceId}):`,e)}}else console.error(`AngieMcpSdk: Invalid server init request - missing clientId or serverId (Instance: ${this.instanceId})`)}}(async()=>{try{const e=new Cs;await e.registerRemoteServer({name:"hosting-mcp",version:"1.0.0",description:"Do anything with your Elementor Hosting",url:"https://my.elementor.com/hosting/api/v4/hosting-mcp/mcp",transport:s.STREAMABLE_HTTP})}catch(e){console.error("Failed to register Hosting MCP with Angie:",e)}})()})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.