← Files pen.devARCHIVED FILE
bin/editor.html
263 KB · Nov 4, 2026 · 06:12 UTC
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="pen-editor-url" content="__PEN_EDITOR_URL__" />
<meta name="pen-install-id" content="__PEN_INSTALL_ID__" />
<meta name="pen-analytics-consent" content="__PEN_ANALYTICS_CONSENT__" />
<title>pen.dev</title>
<style>
:root {
--bg: #ffffff;
--fg: #18181b;
--muted: #71717a;
--track: #e4e4e7;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--bg: #18181b;
--fg: #fafafa;
--muted: #a1a1aa;
--track: #3f3f46;
}
}
[data-theme="dark"] {
--bg: #18181b;
--fg: #fafafa;
--muted: #a1a1aa;
--track: #3f3f46;
}
html,
body {
margin: 0;
height: 100%;
font-family: var(--font-sans, system-ui, sans-serif);
}
#app {
position: relative;
height: 640px;
}
body.fullscreen #app {
height: 100vh;
}
#editor {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
border: 0;
}
#app::after {
content: "";
position: absolute;
inset: 0;
z-index: 1;
pointer-events: none;
box-shadow:
inset 0 0 0 1px rgb(96 125 255 / 0.5),
inset 0 0 36px 4px rgb(96 125 255 / 0.55);
opacity: 0;
}
#app.flashing::after {
animation: flash 1400ms ease-in-out;
}
@keyframes flash {
35% {
opacity: 1;
}
}
#status {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 20px;
padding: 24px;
text-align: center;
background: var(--color-background-primary, var(--bg));
color: var(--color-text-primary, var(--fg));
}
#status[hidden] {
display: none;
}
.logo {
display: block;
height: 28px;
width: auto;
}
.logo-dark {
display: none;
}
:root[data-theme="dark"] .logo-light {
display: none;
}
:root[data-theme="dark"] .logo-dark {
display: block;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .logo-light {
display: none;
}
:root:not([data-theme="light"]) .logo-dark {
display: block;
}
}
#spinner {
width: 20px;
height: 20px;
border-radius: 50%;
border: 2px solid var(--track);
border-top-color: var(--color-text-primary, var(--fg));
animation: spin 0.8s linear infinite;
}
#status.message #spinner {
display: none;
}
#status-text {
margin: 0;
max-width: 360px;
font-size: 13px;
line-height: 1.5;
color: var(--color-text-secondary, var(--muted));
}
#take-over,
#retry {
padding: 6px 14px;
border: 1px solid var(--track);
border-radius: 8px;
background: transparent;
color: var(--color-text-primary, var(--fg));
font: inherit;
font-size: 13px;
cursor: pointer;
}
#take-over[hidden],
#retry[hidden] {
display: none;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: reduce) {
#spinner {
animation-duration: 3s;
}
}
</style>
<script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const r of a.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function o(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=o(s);fetch(s.href,a)}})();function Kl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ns={exports:{}},Pi;function Yl(){return Pi||(Pi=1,(function(e){var t=Object.prototype.hasOwnProperty,o="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(o=!1));function s(u,d,h){this.fn=u,this.context=d,this.once=h||!1}function a(u,d,h,S,v){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new s(h,S||u,v),R=o?o+d:d;return u._events[R]?u._events[R].fn?u._events[R]=[u._events[R],f]:u._events[R].push(f):(u._events[R]=f,u._eventsCount++),u}function r(u,d){--u._eventsCount===0?u._events=new n:delete u._events[d]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],h,S;if(this._eventsCount===0)return d;for(S in h=this._events)t.call(h,S)&&d.push(o?S.slice(1):S);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(h)):d},c.prototype.listeners=function(d){var h=o?o+d:d,S=this._events[h];if(!S)return[];if(S.fn)return[S.fn];for(var v=0,f=S.length,R=new Array(f);v<f;v++)R[v]=S[v].fn;return R},c.prototype.listenerCount=function(d){var h=o?o+d:d,S=this._events[h];return S?S.fn?1:S.length:0},c.prototype.emit=function(d,h,S,v,f,R){var P=o?o+d:d;if(!this._events[P])return!1;var b=this._events[P],A=arguments.length,j,x;if(b.fn){switch(b.once&&this.removeListener(d,b.fn,void 0,!0),A){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,h),!0;case 3:return b.fn.call(b.context,h,S),!0;case 4:return b.fn.call(b.context,h,S,v),!0;case 5:return b.fn.call(b.context,h,S,v,f),!0;case 6:return b.fn.call(b.context,h,S,v,f,R),!0}for(x=1,j=new Array(A-1);x<A;x++)j[x-1]=arguments[x];b.fn.apply(b.context,j)}else{var N=b.length,$;for(x=0;x<N;x++)switch(b[x].once&&this.removeListener(d,b[x].fn,void 0,!0),A){case 1:b[x].fn.call(b[x].context);break;case 2:b[x].fn.call(b[x].context,h);break;case 3:b[x].fn.call(b[x].context,h,S);break;case 4:b[x].fn.call(b[x].context,h,S,v);break;default:if(!j)for($=1,j=new Array(A-1);$<A;$++)j[$-1]=arguments[$];b[x].fn.apply(b[x].context,j)}}return!0},c.prototype.on=function(d,h,S){return a(this,d,h,S,!1)},c.prototype.once=function(d,h,S){return a(this,d,h,S,!0)},c.prototype.removeListener=function(d,h,S,v){var f=o?o+d:d;if(!this._events[f])return this;if(!h)return r(this,f),this;var R=this._events[f];if(R.fn)R.fn===h&&(!v||R.once)&&(!S||R.context===S)&&r(this,f);else{for(var P=0,b=[],A=R.length;P<A;P++)(R[P].fn!==h||v&&!R[P].once||S&&R[P].context!==S)&&b.push(R[P]);b.length?this._events[f]=b.length===1?b[0]:b:r(this,f)}return this},c.prototype.removeAllListeners=function(d){var h;return d?(h=o?o+d:d,this._events[h]&&r(this,h)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=o,c.EventEmitter=c,e.exports=c})(ns)),ns.exports}Yl();var ss={exports:{}},Ci;function Ql(){return Ci||(Ci=1,(function(e){var t=(()=>{var o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,u=(N,$,O)=>$ in N?o(N,$,{enumerable:!0,configurable:!0,writable:!0,value:O}):N[$]=O,d=(N,$)=>{for(var O in $||($={}))r.call($,O)&&u(N,O,$[O]);if(a)for(var O of a($))c.call($,O)&&u(N,O,$[O]);return N},h=(N,$)=>{for(var O in $)o(N,O,{get:$[O],enumerable:!0})},S=(N,$,O,G)=>{if($&&typeof $=="object"||typeof $=="function")for(let se of s($))!r.call(N,se)&&se!==O&&o(N,se,{get:()=>$[se],enumerable:!(G=n($,se))||G.enumerable});return N},v=N=>S(o({},"__esModule",{value:!0}),N),f=(N,$,O)=>u(N,typeof $!="symbol"?$+"":$,O),R={};h(R,{DEFAULT_OPTIONS:()=>A,DEFAULT_UUID_LENGTH:()=>b,default:()=>x});var P="5.3.2",b=6,A={dictionary:"alphanum",shuffle:!0,debug:!1,length:b,counter:0},j=class{constructor($={}){f(this,"counter"),f(this,"debug"),f(this,"dict"),f(this,"version"),f(this,"dictIndex",0),f(this,"dictRange",[]),f(this,"lowerBound",0),f(this,"upperBound",0),f(this,"dictLength",0),f(this,"uuidLength"),f(this,"_digit_first_ascii",48),f(this,"_digit_last_ascii",58),f(this,"_alpha_lower_first_ascii",97),f(this,"_alpha_lower_last_ascii",123),f(this,"_hex_last_ascii",103),f(this,"_alpha_upper_first_ascii",65),f(this,"_alpha_upper_last_ascii",91),f(this,"_number_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii]}),f(this,"_alpha_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),f(this,"_alpha_lower_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),f(this,"_alpha_upper_dict_ranges",{upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),f(this,"_alphanum_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),f(this,"_alphanum_lower_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),f(this,"_alphanum_upper_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),f(this,"_hex_dict_ranges",{decDigits:[this._digit_first_ascii,this._digit_last_ascii],alphaDigits:[this._alpha_lower_first_ascii,this._hex_last_ascii]}),f(this,"_dict_ranges",{_number_dict_ranges:this._number_dict_ranges,_alpha_dict_ranges:this._alpha_dict_ranges,_alpha_lower_dict_ranges:this._alpha_lower_dict_ranges,_alpha_upper_dict_ranges:this._alpha_upper_dict_ranges,_alphanum_dict_ranges:this._alphanum_dict_ranges,_alphanum_lower_dict_ranges:this._alphanum_lower_dict_ranges,_alphanum_upper_dict_ranges:this._alphanum_upper_dict_ranges,_hex_dict_ranges:this._hex_dict_ranges}),f(this,"log",(...q)=>{const L=[...q];if(L[0]="[short-unique-id] ".concat(q[0]),this.debug===!0&&typeof console<"u"&&console!==null){console.log(...L);return}}),f(this,"_normalizeDictionary",(q,L)=>{let M;if(q&&Array.isArray(q)&&q.length>1)M=q;else{M=[],this.dictIndex=0;const F="_".concat(q,"_dict_ranges"),Z=this._dict_ranges[F];let H=0;for(const[,fe]of Object.entries(Z)){const[ce,ge]=fe;H+=Math.abs(ge-ce)}M=new Array(H);let Y=0;for(const[,fe]of Object.entries(Z)){this.dictRange=fe,this.lowerBound=this.dictRange[0],this.upperBound=this.dictRange[1];const ce=this.lowerBound<=this.upperBound,ge=this.lowerBound,Te=this.upperBound;if(ce)for(let le=ge;le<Te;le++)M[Y++]=String.fromCharCode(le),this.dictIndex=le;else for(let le=ge;le>Te;le--)M[Y++]=String.fromCharCode(le),this.dictIndex=le}M.length=Y}if(L){const F=M.length;for(let Z=F-1;Z>0;Z--){const H=Math.floor(Math.random()*(Z+1));[M[Z],M[H]]=[M[H],M[Z]]}}return M}),f(this,"setDictionary",(q,L)=>{this.dict=this._normalizeDictionary(q,L),this.dictLength=this.dict.length,this.setCounter(0)}),f(this,"seq",()=>this.sequentialUUID()),f(this,"sequentialUUID",()=>{const q=this.dictLength,L=this.dict;let M=this.counter;const F=[];do{const H=M%q;M=Math.trunc(M/q),F.push(L[H])}while(M!==0);const Z=F.join("");return this.counter+=1,Z}),f(this,"rnd",(q=this.uuidLength||b)=>this.randomUUID(q)),f(this,"randomUUID",(q=this.uuidLength||b)=>{if(q===null||typeof q>"u"||q<1)throw new Error("Invalid UUID Length Provided");const L=new Array(q),M=this.dictLength,F=this.dict;for(let Z=0;Z<q;Z++){const H=Math.floor(Math.random()*M);L[Z]=F[H]}return L.join("")}),f(this,"fmt",(q,L)=>this.formattedUUID(q,L)),f(this,"formattedUUID",(q,L)=>{const M={$r:this.randomUUID,$s:this.sequentialUUID,$t:this.stamp};return q.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,Z=>{const H=Z.slice(0,2),Y=Number.parseInt(Z.slice(2),10);return H==="$s"?M[H]().padStart(Y,"0"):H==="$t"&&L?M[H](Y,L):M[H](Y)})}),f(this,"availableUUIDs",(q=this.uuidLength)=>Number.parseFloat(([...new Set(this.dict)].length**q).toFixed(0))),f(this,"_collisionCache",new Map),f(this,"approxMaxBeforeCollision",(q=this.availableUUIDs(this.uuidLength))=>{const L=q,M=this._collisionCache.get(L);if(M!==void 0)return M;const F=Number.parseFloat(Math.sqrt(Math.PI/2*q).toFixed(20));return this._collisionCache.set(L,F),F}),f(this,"collisionProbability",(q=this.availableUUIDs(this.uuidLength),L=this.uuidLength)=>Number.parseFloat((this.approxMaxBeforeCollision(q)/this.availableUUIDs(L)).toFixed(20))),f(this,"uniqueness",(q=this.availableUUIDs(this.uuidLength))=>{const L=Number.parseFloat((1-this.approxMaxBeforeCollision(q)/q).toFixed(20));return L>1?1:L<0?0:L}),f(this,"getVersion",()=>this.version),f(this,"stamp",(q,L)=>{const M=Math.floor(+(L||new Date)/1e3).toString(16);if(typeof q=="number"&&q===0)return M;if(typeof q!="number"||q<10)throw new Error(["Param finalLength must be a number greater than or equal to 10,","or 0 if you want the raw hexadecimal timestamp"].join(`
`));const F=q-9,Z=Math.round(Math.random()*(F>15?15:F)),H=this.randomUUID(F);return"".concat(H.substring(0,Z)).concat(M).concat(H.substring(Z)).concat(Z.toString(16))}),f(this,"parseStamp",(q,L)=>{if(L&&!/t0|t[1-9]\d{1,}/.test(L))throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");const M=L?L.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,Z=>{const H={$r:ce=>[...Array(ce)].map(()=>"r").join(""),$s:ce=>[...Array(ce)].map(()=>"s").join(""),$t:ce=>[...Array(ce)].map(()=>"t").join("")},Y=Z.slice(0,2),fe=Number.parseInt(Z.slice(2),10);return H[Y](fe)}).replace(/^(.*?)(t{8,})(.*)$/g,(Z,H,Y)=>q.substring(H.length,H.length+Y.length)):q;if(M.length===8)return new Date(Number.parseInt(M,16)*1e3);if(M.length<10)throw new Error("Stamp length invalid");const F=Number.parseInt(M.substring(M.length-1),16);return new Date(Number.parseInt(M.substring(F,F+8),16)*1e3)}),f(this,"setCounter",q=>{this.counter=q}),f(this,"validate",(q,L)=>{const M=L?this._normalizeDictionary(L):this.dict;return q.split("").every(F=>M.includes(F))});const O=d(d({},A),$);this.counter=0,this.debug=!1,this.dict=[],this.version=P;const{dictionary:G,shuffle:se,length:ie,counter:qe}=O;this.uuidLength=ie,this.setDictionary(G,se),this.setCounter(qe),this.debug=O.debug,this.log(this.dict),this.log("Generator instantiated with Dictionary Size ".concat(this.dictLength," and counter set to ").concat(this.counter)),this.log=this.log.bind(this),this.setDictionary=this.setDictionary.bind(this),this.setCounter=this.setCounter.bind(this),this.seq=this.seq.bind(this),this.sequentialUUID=this.sequentialUUID.bind(this),this.rnd=this.rnd.bind(this),this.randomUUID=this.randomUUID.bind(this),this.fmt=this.fmt.bind(this),this.formattedUUID=this.formattedUUID.bind(this),this.availableUUIDs=this.availableUUIDs.bind(this),this.approxMaxBeforeCollision=this.approxMaxBeforeCollision.bind(this),this.collisionProbability=this.collisionProbability.bind(this),this.uniqueness=this.uniqueness.bind(this),this.getVersion=this.getVersion.bind(this),this.stamp=this.stamp.bind(this),this.parseStamp=this.parseStamp.bind(this)}};f(j,"default",j);var x=j;return v(R)})();e.exports=t.default,typeof window<"u"&&(t=t.default)})(ss)),ss.exports}var Xl=Ql();const _r=Kl(Xl),eu=[{fileName:"pencil-shadcn.pen",title:"shadcn/ui",description:"shadcn/ui component kit",thumbnail:"design-kit-shadcn"},{fileName:"pencil-heroui.pen",title:"HeroUI",description:"HeroUI component kit",thumbnail:"design-kit-heroui"},{fileName:"pencil-halo.pen",title:"Halo",description:"Halo design system",thumbnail:"design-kit-halo"},{fileName:"pencil-lunaris.pen",title:"Lunaris",description:"Lunaris design system",thumbnail:"design-kit-lunaris"},{fileName:"pencil-nitro.pen",title:"Nitro",description:"Nitro design system",thumbnail:"design-kit-nitro"}];function tu(e){for(const t of eu)if(t.fileName===e)return t}function tt(e){const t=`ftyp${e}`,o=new Uint8Array(12),n=new Uint8Array(12);for(let s=0;s<t.length;s++)o[s+4]=t.charCodeAt(s),n[s+4]=255;return{magic:o,mask:n}}new Uint8Array([137,80,78,71,13,10,26,10]),new Uint8Array([71,73,70,56,55,97]),new Uint8Array([71,73,70,56,57,97]),new Uint8Array([255,216,255]),new Uint8Array([82,73,70,70,0,0,0,0,87,69,66,80]),new Uint8Array([255,255,255,255,0,0,0,0,255,255,255,255]),{...tt("avif")},{...tt("avis")},{...tt("heic")},{...tt("heix")},{...tt("hevc")},{...tt("mif1")},{...tt("msf1")},new Uint8Array([0,0,1,0]),new Uint8Array([37,80,68,70,45]),new Uint8Array([66,77]);let Ao=(function(e){return e[e.Saved=0]="Saved",e[e.NothingToSave=1]="NothingToSave",e[e.Cancelled=2]="Cancelled",e[e.DiskFull=3]="DiskFull",e[e.NotPermitted=4]="NotPermitted",e[e.ReadOnlyDisk=5]="ReadOnlyDisk",e[e.FolderMissing=6]="FolderMissing",e[e.FileInUse=7]="FileInUse",e[e.DocumentUnreadable=8]="DocumentUnreadable",e[e.WriteFailed=9]="WriteFailed",e})({}),Ei=(function(e){return e[e.File=0]="File",e[e.Managed=1]="Managed",e[e.Bundled=2]="Bundled",e})({}),ou=(function(e){return e[e.None=0]="None",e[e.Snapshot=1]="Snapshot",e[e.Artwork=2]="Artwork",e})({}),vr=(function(e){return e[e.FromRecents=0]="FromRecents",e[e.Delete=1]="Delete",e})({});const nu={3:{cause:"The disk is full.",advice:"Free up space and try again."},4:{cause:"You don't have permission to save here.",advice:"Use File > Save As to pick another location."},5:{cause:"This disk is read only.",advice:"Use File > Save As to pick another location."},6:{cause:"This folder no longer exists.",advice:"Use File > Save As to pick another location."},7:{cause:"Another program is using this file.",advice:"Close that program and try again."},8:{cause:"Something went wrong while preparing your document.",advice:"Try saving again."},9:{cause:"Something went wrong while writing the file.",advice:"Try saving again."},0:{cause:"Something went wrong while writing the file.",advice:"Try saving again."},2:{cause:"Something went wrong while writing the file.",advice:"Try saving again."},1:{cause:"Something went wrong while writing the file.",advice:"Try saving again."}};function su(e){return nu[e].cause}function iu(e,t){switch(t){case 2:{const o=tu(e);return o!=null?o.title:e}case 1:case 0:return e;default:throw new Error(`Unhandled document kind: ${t}`)}}const{randomUUID:p_}=new _r({length:5}),{randomUUID:d_}=new _r({length:1,dictionary:"alpha"});var ru=Object.create,$s=Object.defineProperty,au=Object.getOwnPropertyDescriptor,cu=Object.getOwnPropertyNames,lu=Object.getPrototypeOf,uu=Object.prototype.hasOwnProperty,pu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),du=(e,t)=>{let o={};for(var n in e)$s(o,n,{get:e[n],enumerable:!0});return o},mu=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=cu(t),a=0,r=s.length,c;a<r;a++)c=s[a],!uu.call(e,c)&&c!==o&&$s(e,c,{get:(u=>t[u]).bind(null,c),enumerable:!(n=au(t,c))||n.enumerable});return e},hu=(e,t,o)=>(o=e!=null?ru(lu(e)):{},mu($s(o,"default",{value:e,enumerable:!0}),e));const fu=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function gu(e){return typeof e=="string"&&fu.has(e.replace(/#$/,""))}var ki;const Su=Object.freeze({status:"aborted"});function g(e,t,o){function n(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:r,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);const d=r.prototype,h=Object.keys(d);for(let S=0;S<h.length;S++){const v=h[S];v in c||(c[v]=d[v].bind(c))}}const s=o?.Parent??Object;class a extends s{}Object.defineProperty(a,"name",{value:e});function r(c){var u;const d=o?.Parent?new a:this;n(d,c),(u=d._zod).deferred??(u.deferred=[]);for(const h of d._zod.deferred)h();return d}return Object.defineProperty(r,"init",{value:n}),Object.defineProperty(r,Symbol.hasInstance,{value:c=>o?.Parent&&c instanceof o.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class Tt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class br extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(ki=globalThis).__zod_globalConfig??(ki.__zod_globalConfig={});const Rn=globalThis.__zod_globalConfig;function xe(e){return e&&Object.assign(Rn,e),Rn}function yr(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function fs(e,t){return typeof t=="bigint"?t.toString():t}function Ln(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function qs(e){return e==null}function Is(e){const t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function _u(e,t){const o=e/t,n=Math.round(o),s=Number.EPSILON*Math.max(Math.abs(o),1);return Math.abs(o-n)<s?0:o-n}const $i=Symbol("evaluating");function D(e,t,o){let n;Object.defineProperty(e,t,{get(){if(n!==$i)return n===void 0&&(n=$i,n=o()),n},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function it(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function Ze(...e){const t={};for(const o of e){const n=Object.getOwnPropertyDescriptors(o);Object.assign(t,n)}return Object.defineProperties({},t)}function qi(e){return JSON.stringify(e)}function vu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Rr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Uo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const bu=Ln(()=>{if(Rn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Pt(e){if(Uo(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const o=t.prototype;return!(Uo(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function wr(e){return Pt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const yu=new Set(["string","number","symbol"]);function Ct(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function De(e,t,o){const n=new e._zod.constr(t??e._zod.def);return(!t||o?.parent)&&(n._zod.parent=e),n}function E(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ru(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const wu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Tu(e,t){const o=e._zod.def,n=o.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=Ze(e._zod.def,{get shape(){const r={};for(const c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(r[c]=o.shape[c])}return it(this,"shape",r),r},checks:[]});return De(e,a)}function Pu(e,t){const o=e._zod.def,n=o.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=Ze(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete r[c]}return it(this,"shape",r),r},checks:[]});return De(e,a)}function Cu(e,t){if(!Pt(t))throw new Error("Invalid input to extend: expected a plain object");const o=e._zod.def.checks;if(o&&o.length>0){const a=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(a,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Ze(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return it(this,"shape",a),a}});return De(e,s)}function Eu(e,t){if(!Pt(t))throw new Error("Invalid input to safeExtend: expected a plain object");const o=Ze(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return it(this,"shape",n),n}});return De(e,o)}function ku(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const o=Ze(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return it(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return De(e,o)}function $u(e,t,o){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=Ze(t._zod.def,{get shape(){const c=t._zod.def.shape,u={...c};if(o)for(const d in o){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);o[d]&&(u[d]=e?new e({type:"optional",innerType:c[d]}):c[d])}else for(const d in c)u[d]=e?new e({type:"optional",innerType:c[d]}):c[d];return it(this,"shape",u),u},checks:[]});return De(t,r)}function qu(e,t,o){const n=Ze(t._zod.def,{get shape(){const s=t._zod.def.shape,a={...s};if(o)for(const r in o){if(!(r in a))throw new Error(`Unrecognized key: "${r}"`);o[r]&&(a[r]=new e({type:"nonoptional",innerType:s[r]}))}else for(const r in s)a[r]=new e({type:"nonoptional",innerType:s[r]});return it(this,"shape",a),a}});return De(t,n)}function Rt(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function Iu(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue===!1)return!0;return!1}function wt(e,t){return t.map(o=>{var n;return(n=o).path??(n.path=[]),o.path.unshift(e),o})}function fn(e){return typeof e=="string"?e:e?.message}function Oe(e,t,o){const n=e.message?e.message:fn(e.inst?._zod.def?.error?.(e))??fn(t?.error?.(e))??fn(o.customError?.(e))??fn(o.localeError?.(e))??"Invalid input",{inst:s,continue:a,input:r,...c}=e;return c.path??(c.path=[]),c.message=n,t?.reportInput&&(c.input=r),c}function Ns(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function jo(...e){const[t,o,n]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:n}:{...t}}const Tr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,fs,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Pr=g("$ZodError",Tr),Cr=g("$ZodError",Tr,{Parent:Error});function Nu(e,t=o=>o.message){const o={},n=[];for(const s of e.issues)s.path.length>0?(o[s.path[0]]=o[s.path[0]]||[],o[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:o}}function xu(e,t=o=>o.message){const o={_errors:[]},n=(s,a=[])=>{for(const r of s.issues)if(r.code==="invalid_union"&&r.errors.length)r.errors.map(c=>n({issues:c},[...a,...r.path]));else if(r.code==="invalid_key")n({issues:r.issues},[...a,...r.path]);else if(r.code==="invalid_element")n({issues:r.issues},[...a,...r.path]);else{const c=[...a,...r.path];if(c.length===0)o._errors.push(t(r));else{let u=o,d=0;for(;d<c.length;){const h=c[d];d===c.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(r))):u[h]=u[h]||{_errors:[]},u=u[h],d++}}}};return n(e),o}const xs=e=>(t,o,n,s)=>{const a=n?{...n,async:!1}:{async:!1},r=t._zod.run({value:o,issues:[]},a);if(r instanceof Promise)throw new Tt;if(r.issues.length){const c=new(s?.Err??e)(r.issues.map(u=>Oe(u,a,xe())));throw Rr(c,s?.callee),c}return r.value},Os=e=>async(t,o,n,s)=>{const a=n?{...n,async:!0}:{async:!0};let r=t._zod.run({value:o,issues:[]},a);if(r instanceof Promise&&(r=await r),r.issues.length){const c=new(s?.Err??e)(r.issues.map(u=>Oe(u,a,xe())));throw Rr(c,s?.callee),c}return r.value},An=e=>(t,o,n)=>{const s=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:o,issues:[]},s);if(a instanceof Promise)throw new Tt;return a.issues.length?{success:!1,error:new(e??Pr)(a.issues.map(r=>Oe(r,s,xe())))}:{success:!0,data:a.value}},Ou=An(Cr),Un=e=>async(t,o,n)=>{const s=n?{...n,async:!0}:{async:!0};let a=t._zod.run({value:o,issues:[]},s);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(r=>Oe(r,s,xe())))}:{success:!0,data:a.value}},zu=Un(Cr),Mu=e=>(t,o,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return xs(e)(t,o,s)},Lu=e=>(t,o,n)=>xs(e)(t,o,n),Au=e=>async(t,o,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return Os(e)(t,o,s)},Uu=e=>async(t,o,n)=>Os(e)(t,o,n),ju=e=>(t,o,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return An(e)(t,o,s)},Zu=e=>(t,o,n)=>An(e)(t,o,n),Du=e=>async(t,o,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return Un(e)(t,o,s)},Hu=e=>async(t,o,n)=>Un(e)(t,o,n),Fu=/^[cC][0-9a-z]{6,}$/,Ju=/^[0-9a-z]+$/,Vu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Bu=/^[0-9a-vA-V]{20}$/,Wu=/^[A-Za-z0-9]{27}$/,Gu=/^[a-zA-Z0-9_-]{21}$/,Ku=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Yu=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ii=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Qu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ep(){return new RegExp(Xu,"u")}const tp=/^(?:(?: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])$/,op=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,np=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,sp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ip=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Er=/^[A-Za-z0-9_-]*$/,rp=/^https?$/,ap=/^\+[1-9]\d{6,14}$/,kr="(?:(?:\\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])))",cp=new RegExp(`^${kr}$`);function $r(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function lp(e){return new RegExp(`^${$r(e)}$`)}function up(e){const t=$r({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${o.join("|")})`;return new RegExp(`^${kr}T(?:${n})$`)}const pp=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},dp=/^-?\d+$/,qr=/^-?\d+(?:\.\d+)?$/,mp=/^(?:true|false)$/i,hp=/^null$/i,fp=/^undefined$/i,gp=/^[^A-Z]*$/,Sp=/^[^a-z]*$/,ve=g("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Ir={number:"number",bigint:"bigint",object:"date"},Nr=g("$ZodCheckLessThan",(e,t)=>{ve.init(e,t);const o=Ir[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,a=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:o,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xr=g("$ZodCheckGreaterThan",(e,t)=>{ve.init(e,t);const o=Ir[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,a=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:o,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_p=g("$ZodCheckMultipleOf",(e,t)=>{ve.init(e,t),e._zod.onattach.push(o=>{var n;(n=o._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=o=>{if(typeof o.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof o.value=="bigint"?o.value%t.value===BigInt(0):_u(o.value,t.value)===0)||o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:t.value,input:o.value,inst:e,continue:!t.abort})}}),vp=g("$ZodCheckNumberFormat",(e,t)=>{ve.init(e,t),t.format=t.format||"float64";const o=t.format?.includes("int"),n=o?"int":"number",[s,a]=wu[t.format];e._zod.onattach.push(r=>{const c=r._zod.bag;c.format=t.format,c.minimum=s,c.maximum=a,o&&(c.pattern=dp)}),e._zod.check=r=>{const c=r.value;if(o){if(!Number.isInteger(c)){r.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?r.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):r.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}c<s&&r.issues.push({origin:"number",input:c,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),c>a&&r.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),bp=g("$ZodCheckMaxLength",(e,t)=>{var o;ve.init(e,t),(o=e._zod.def).when??(o.when=n=>{const s=n.value;return!qs(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const s=n.value;if(s.length<=t.maximum)return;const r=Ns(s);n.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),yp=g("$ZodCheckMinLength",(e,t)=>{var o;ve.init(e,t),(o=e._zod.def).when??(o.when=n=>{const s=n.value;return!qs(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const s=n.value;if(s.length>=t.minimum)return;const r=Ns(s);n.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Rp=g("$ZodCheckLengthEquals",(e,t)=>{var o;ve.init(e,t),(o=e._zod.def).when??(o.when=n=>{const s=n.value;return!qs(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=n=>{const s=n.value,a=s.length;if(a===t.length)return;const r=Ns(s),c=a>t.length;n.issues.push({origin:r,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),jn=g("$ZodCheckStringFormat",(e,t)=>{var o,n;ve.init(e,t),e._zod.onattach.push(s=>{const a=s._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(o=e._zod).check??(o.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),wp=g("$ZodCheckRegex",(e,t)=>{jn.init(e,t),e._zod.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Tp=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=gp),jn.init(e,t)}),Pp=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Sp),jn.init(e,t)}),Cp=g("$ZodCheckIncludes",(e,t)=>{ve.init(e,t);const o=Ct(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${o}`:o);t.pattern=n,e._zod.onattach.push(s=>{const a=s._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),Ep=g("$ZodCheckStartsWith",(e,t)=>{ve.init(e,t);const o=new RegExp(`^${Ct(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),kp=g("$ZodCheckEndsWith",(e,t)=>{ve.init(e,t);const o=new RegExp(`.*${Ct(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),$p=g("$ZodCheckOverwrite",(e,t)=>{ve.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});class qp{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
`).filter(r=>r),s=Math.min(...n.map(r=>r.length-r.trimStart().length)),a=n.map(r=>r.slice(s)).map(r=>" ".repeat(this.indent*2)+r);for(const r of a)this.content.push(r)}compile(){const t=Function,o=this?.args,s=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...o,s.join(`
`))}}const Ip={major:4,minor:4,patch:3},J=g("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ip;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const a of s._zod.onattach)a(e);if(n.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(r,c,u)=>{let d=Rt(r),h;for(const S of c){if(S._zod.def.when){if(Iu(r)||!S._zod.def.when(r))continue}else if(d)continue;const v=r.issues.length,f=S._zod.check(r);if(f instanceof Promise&&u?.async===!1)throw new Tt;if(h||f instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await f,r.issues.length!==v&&(d||(d=Rt(r,v)))});else{if(r.issues.length===v)continue;d||(d=Rt(r,v))}}return h?h.then(()=>r):r},a=(r,c,u)=>{if(Rt(r))return r.aborted=!0,r;const d=s(c,n,u);if(d instanceof Promise){if(u.async===!1)throw new Tt;return d.then(h=>e._zod.parse(h,u))}return e._zod.parse(d,u)};e._zod.run=(r,c)=>{if(c.skipChecks)return e._zod.parse(r,c);if(c.direction==="backward"){const d=e._zod.parse({value:r.value,issues:[]},{...c,skipChecks:!0});return d instanceof Promise?d.then(h=>a(h,r,c)):a(d,r,c)}const u=e._zod.parse(r,c);if(u instanceof Promise){if(c.async===!1)throw new Tt;return u.then(d=>s(d,n,c))}return s(u,n,c)}}D(e,"~standard",()=>({validate:s=>{try{const a=Ou(e,s);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return zu(e,s).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),zs=g("$ZodString",(e,t)=>{J.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??pp(e._zod.bag),e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),W=g("$ZodStringFormat",(e,t)=>{jn.init(e,t),zs.init(e,t)}),Np=g("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Yu),W.init(e,t)}),xp=g("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ii(n))}else t.pattern??(t.pattern=Ii());W.init(e,t)}),Op=g("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Qu),W.init(e,t)}),zp=g("$ZodURL",(e,t)=>{W.init(e,t),e._zod.check=o=>{try{const n=o.value.trim();if(!t.normalize&&t.protocol?.source===rp.source&&!/^https?:\/\//i.test(n)){o.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:o.value,inst:e,continue:!t.abort});return}const s=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:o.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:o.value,inst:e,continue:!t.abort})),t.normalize?o.value=s.href:o.value=n;return}catch{o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!t.abort})}}}),Mp=g("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ep()),W.init(e,t)}),Lp=g("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Gu),W.init(e,t)}),Ap=g("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Fu),W.init(e,t)}),Up=g("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ju),W.init(e,t)}),jp=g("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Vu),W.init(e,t)}),Zp=g("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Bu),W.init(e,t)}),Dp=g("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Wu),W.init(e,t)}),Hp=g("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=up(t)),W.init(e,t)}),Fp=g("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=cp),W.init(e,t)}),Jp=g("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=lp(t)),W.init(e,t)}),Vp=g("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ku),W.init(e,t)}),Bp=g("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tp),W.init(e,t),e._zod.bag.format="ipv4"}),Wp=g("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=op),W.init(e,t),e._zod.bag.format="ipv6",e._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}}),Gp=g("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=np),W.init(e,t)}),Kp=g("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=sp),W.init(e,t),e._zod.check=o=>{const n=o.value.split("/");try{if(n.length!==2)throw new Error;const[s,a]=n;if(!a)throw new Error;const r=Number(a);if(`${r}`!==a)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${s}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});function Or(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Yp=g("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ip),W.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=o=>{Or(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function Qp(e){if(!Er.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return Or(o)}const Xp=g("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Er),W.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=o=>{Qp(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),ed=g("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ap),W.init(e,t)});function td(e,t=null){try{const o=e.split(".");if(o.length!==3)return!1;const[n]=o;if(!n)return!1;const s=JSON.parse(atob(n));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const od=g("$ZodJWT",(e,t)=>{W.init(e,t),e._zod.check=o=>{td(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),zr=g("$ZodNumber",(e,t)=>{J.init(e,t),e._zod.pattern=e._zod.bag.pattern??qr,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=Number(o.value)}catch{}const s=o.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return o;const a=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return o.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...a?{received:a}:{}}),o}}),nd=g("$ZodNumberFormat",(e,t)=>{vp.init(e,t),zr.init(e,t)}),sd=g("$ZodBoolean",(e,t)=>{J.init(e,t),e._zod.pattern=mp,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=!!o.value}catch{}const s=o.value;return typeof s=="boolean"||o.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),o}}),id=g("$ZodUndefined",(e,t)=>{J.init(e,t),e._zod.pattern=fp,e._zod.values=new Set([void 0]),e._zod.parse=(o,n)=>{const s=o.value;return typeof s>"u"||o.issues.push({expected:"undefined",code:"invalid_type",input:s,inst:e}),o}}),rd=g("$ZodNull",(e,t)=>{J.init(e,t),e._zod.pattern=hp,e._zod.values=new Set([null]),e._zod.parse=(o,n)=>{const s=o.value;return s===null||o.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),o}}),ad=g("$ZodAny",(e,t)=>{J.init(e,t),e._zod.parse=o=>o}),cd=g("$ZodUnknown",(e,t)=>{J.init(e,t),e._zod.parse=o=>o}),ld=g("$ZodNever",(e,t)=>{J.init(e,t),e._zod.parse=(o,n)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)});function Ni(e,t,o){e.issues.length&&t.issues.push(...wt(o,e.issues)),t.value[o]=e.value}const ud=g("$ZodArray",(e,t)=>{J.init(e,t),e._zod.parse=(o,n)=>{const s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=Array(s.length);const a=[];for(let r=0;r<s.length;r++){const c=s[r],u=t.element._zod.run({value:c,issues:[]},n);u instanceof Promise?a.push(u.then(d=>Ni(d,o,r))):Ni(u,o,r)}return a.length?Promise.all(a).then(()=>o):o}});function wn(e,t,o,n,s,a){const r=o in n;if(e.issues.length){if(s&&a&&!r)return;t.issues.push(...wt(o,e.issues))}if(!r&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[o]});return}e.value===void 0?r&&(t.value[o]=void 0):t.value[o]=e.value}function Mr(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const o=Ru(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function Lr(e,t,o,n,s,a){const r=[],c=s.keySet,u=s.catchall._zod,d=u.def.type,h=u.optin==="optional",S=u.optout==="optional";for(const v in t){if(v==="__proto__"||c.has(v))continue;if(d==="never"){r.push(v);continue}const f=u.run({value:t[v],issues:[]},n);f instanceof Promise?e.push(f.then(R=>wn(R,o,v,t,h,S))):wn(f,o,v,t,h,S)}return r.length&&o.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:a}),e.length?Promise.all(e).then(()=>o):o}const pd=g("$ZodObject",(e,t)=>{if(J.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const u={...c};return Object.defineProperty(t,"shape",{value:u}),u}})}const n=Ln(()=>Mr(t));D(e._zod,"propValues",()=>{const c=t.shape,u={};for(const d in c){const h=c[d]._zod;if(h.values){u[d]??(u[d]=new Set);for(const S of h.values)u[d].add(S)}}return u});const s=Uo,a=t.catchall;let r;e._zod.parse=(c,u)=>{r??(r=n.value);const d=c.value;if(!s(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c;c.value={};const h=[],S=r.shape;for(const v of r.keys){const f=S[v],R=f._zod.optin==="optional",P=f._zod.optout==="optional",b=f._zod.run({value:d[v],issues:[]},u);b instanceof Promise?h.push(b.then(A=>wn(A,c,v,d,R,P))):wn(b,c,v,d,R,P)}return a?Lr(h,d,c,u,n.value,e):h.length?Promise.all(h).then(()=>c):c}}),dd=g("$ZodObjectJIT",(e,t)=>{pd.init(e,t);const o=e._zod.parse,n=Ln(()=>Mr(t)),s=v=>{const f=new qp(["shape","payload","ctx"]),R=n.value,P=x=>{const N=qi(x);return`shape[${N}]._zod.run({ value: input[${N}], issues: [] }, ctx)`};f.write("const input = payload.value;");const b=Object.create(null);let A=0;for(const x of R.keys)b[x]=`key_${A++}`;f.write("const newResult = {};");for(const x of R.keys){const N=b[x],$=qi(x),O=v[x],G=O?._zod?.optin==="optional",se=O?._zod?.optout==="optional";f.write(`const ${N} = ${P(x)};`),G&&se?f.write(`
if (${N}.issues.length) {
if (${$} in input) {
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
...iss,
path: iss.path ? [${$}, ...iss.path] : [${$}]
})));
}
}
if (${N}.value === undefined) {
if (${$} in input) {
newResult[${$}] = undefined;
}
} else {
newResult[${$}] = ${N}.value;
}
`):G?f.write(`
if (${N}.issues.length) {
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
...iss,
path: iss.path ? [${$}, ...iss.path] : [${$}]
})));
}
if (${N}.value === undefined) {
if (${$} in input) {
newResult[${$}] = undefined;
}
} else {
newResult[${$}] = ${N}.value;
}
`):f.write(`
const ${N}_present = ${$} in input;
if (${N}.issues.length) {
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
...iss,
path: iss.path ? [${$}, ...iss.path] : [${$}]
})));
}
if (!${N}_present && !${N}.issues.length) {
payload.issues.push({
code: "invalid_type",
expected: "nonoptional",
input: undefined,
path: [${$}]
});
}
if (${N}_present) {
if (${N}.value === undefined) {
newResult[${$}] = undefined;
} else {
newResult[${$}] = ${N}.value;
}
}
`)}f.write("payload.value = newResult;"),f.write("return payload;");const j=f.compile();return(x,N)=>j(v,x,N)};let a;const r=Uo,c=!Rn.jitless,d=c&&bu.value,h=t.catchall;let S;e._zod.parse=(v,f)=>{S??(S=n.value);const R=v.value;return r(R)?c&&d&&f?.async===!1&&f.jitless!==!0?(a||(a=s(t.shape)),v=a(v,f),h?Lr([],R,v,f,S,e):v):o(v,f):(v.issues.push({expected:"object",code:"invalid_type",input:R,inst:e}),v)}});function xi(e,t,o,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const s=e.filter(a=>!Rt(a));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(a=>a.issues.map(r=>Oe(r,n,xe())))}),t)}const Ar=g("$ZodUnion",(e,t)=>{J.init(e,t),D(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),D(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),D(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),D(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${n.map(s=>Is(s.source)).join("|")})$`)}});const o=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,s)=>{if(o)return o(n,s);let a=!1;const r=[];for(const c of t.options){const u=c._zod.run({value:n.value,issues:[]},s);if(u instanceof Promise)r.push(u),a=!0;else{if(u.issues.length===0)return u;r.push(u)}}return a?Promise.all(r).then(c=>xi(c,n,e,s)):xi(r,n,e,s)}}),md=g("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ar.init(e,t);const o=e._zod.parse;D(e._zod,"propValues",()=>{const s={};for(const a of t.options){const r=a._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const[c,u]of Object.entries(r)){s[c]||(s[c]=new Set);for(const d of u)s[c].add(d)}}return s});const n=Ln(()=>{const s=t.options,a=new Map;for(const r of s){const c=r._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const u of c){if(a.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);a.set(u,r)}}return a});e._zod.parse=(s,a)=>{const r=s.value;if(!Uo(r))return s.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),s;const c=n.value.get(r?.[t.discriminator]);return c?c._zod.run(s,a):t.unionFallback||a.direction==="backward"?o(s,a):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()),input:r,path:[t.discriminator],inst:e}),s)}}),hd=g("$ZodIntersection",(e,t)=>{J.init(e,t),e._zod.parse=(o,n)=>{const s=o.value,a=t.left._zod.run({value:s,issues:[]},n),r=t.right._zod.run({value:s,issues:[]},n);return a instanceof Promise||r instanceof Promise?Promise.all([a,r]).then(([u,d])=>Oi(o,u,d)):Oi(o,a,r)}});function gs(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Pt(e)&&Pt(t)){const o=Object.keys(t),n=Object.keys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(const a of n){const r=gs(e[a],t[a]);if(!r.valid)return{valid:!1,mergeErrorPath:[a,...r.mergeErrorPath]};s[a]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const o=[];for(let n=0;n<e.length;n++){const s=e[n],a=t[n],r=gs(s,a);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o.push(r.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function Oi(e,t,o){const n=new Map;let s;for(const c of t.issues)if(c.code==="unrecognized_keys"){s??(s=c);for(const u of c.keys)n.has(u)||n.set(u,{}),n.get(u).l=!0}else e.issues.push(c);for(const c of o.issues)if(c.code==="unrecognized_keys")for(const u of c.keys)n.has(u)||n.set(u,{}),n.get(u).r=!0;else e.issues.push(c);const a=[...n].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(a.length&&s&&e.issues.push({...s,keys:a}),Rt(e))return e;const r=gs(t.value,o.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const fd=g("$ZodRecord",(e,t)=>{J.init(e,t),e._zod.parse=(o,n)=>{const s=o.value;if(!Pt(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;const a=[],r=t.keyType._zod.values;if(r){o.value={};const c=new Set;for(const d of r)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){c.add(typeof d=="number"?d.toString():d);const h=t.keyType._zod.run({value:d,issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(f=>Oe(f,n,xe())),input:d,path:[d],inst:e});continue}const S=h.value,v=t.valueType._zod.run({value:s[d],issues:[]},n);v instanceof Promise?a.push(v.then(f=>{f.issues.length&&o.issues.push(...wt(d,f.issues)),o.value[S]=f.value})):(v.issues.length&&o.issues.push(...wt(d,v.issues)),o.value[S]=v.value)}let u;for(const d in s)c.has(d)||(u=u??[],u.push(d));u&&u.length>0&&o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u})}else{o.value={};for(const c of Reflect.ownKeys(s)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,c))continue;let u=t.keyType._zod.run({value:c,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&qr.test(c)&&u.issues.length){const S=t.keyType._zod.run({value:Number(c),issues:[]},n);if(S instanceof Promise)throw new Error("Async schemas not supported in object keys currently");S.issues.length===0&&(u=S)}if(u.issues.length){t.mode==="loose"?o.value[c]=s[c]:o.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(S=>Oe(S,n,xe())),input:c,path:[c],inst:e});continue}const h=t.valueType._zod.run({value:s[c],issues:[]},n);h instanceof Promise?a.push(h.then(S=>{S.issues.length&&o.issues.push(...wt(c,S.issues)),o.value[u.value]=S.value})):(h.issues.length&&o.issues.push(...wt(c,h.issues)),o.value[u.value]=h.value)}}return a.length?Promise.all(a).then(()=>o):o}}),gd=g("$ZodEnum",(e,t)=>{J.init(e,t);const o=yr(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter(s=>yu.has(typeof s)).map(s=>typeof s=="string"?Ct(s):s.toString()).join("|")})$`),e._zod.parse=(s,a)=>{const r=s.value;return n.has(r)||s.issues.push({code:"invalid_value",values:o,input:r,inst:e}),s}}),Sd=g("$ZodLiteral",(e,t)=>{if(J.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const o=new Set(t.values);e._zod.values=o,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ct(n):n?Ct(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,s)=>{const a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}}),_d=g("$ZodTransform",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new br(e.constructor.name);const s=t.transform(o.value,o);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(r=>(o.value=r,o.fallback=!0,o));if(s instanceof Promise)throw new Tt;return o.value=s,o.fallback=!0,o}});function zi(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Ur=g("$ZodOptional",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.optout="optional",D(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),D(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Is(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>{if(t.innerType._zod.optin==="optional"){const s=o.value,a=t.innerType._zod.run(o,n);return a instanceof Promise?a.then(r=>zi(r,s)):zi(a,s)}return o.value===void 0?o:t.innerType._zod.run(o,n)}}),vd=g("$ZodExactOptional",(e,t)=>{Ur.init(e,t),D(e._zod,"values",()=>t.innerType._zod.values),D(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(o,n)=>t.innerType._zod.run(o,n)}),bd=g("$ZodNullable",(e,t)=>{J.init(e,t),D(e._zod,"optin",()=>t.innerType._zod.optin),D(e._zod,"optout",()=>t.innerType._zod.optout),D(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Is(o.source)}|null)$`):void 0}),D(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,n)=>o.value===null?o:t.innerType._zod.run(o,n)}),yd=g("$ZodDefault",(e,t)=>{J.init(e,t),e._zod.optin="optional",D(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)return o.value=t.defaultValue,o;const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(a=>Mi(a,t)):Mi(s,t)}});function Mi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Rd=g("$ZodPrefault",(e,t)=>{J.init(e,t),e._zod.optin="optional",D(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>(n.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,n))}),wd=g("$ZodNonOptional",(e,t)=>{J.init(e,t),D(e._zod,"values",()=>{const o=t.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(o,n)=>{const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(a=>Li(a,e)):Li(s,e)}});function Li(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Td=g("$ZodCatch",(e,t)=>{J.init(e,t),e._zod.optin="optional",D(e._zod,"optout",()=>t.innerType._zod.optout),D(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(a=>(o.value=a.value,a.issues.length&&(o.value=t.catchValue({...o,error:{issues:a.issues.map(r=>Oe(r,n,xe()))},input:o.value}),o.issues=[],o.fallback=!0),o)):(o.value=s.value,s.issues.length&&(o.value=t.catchValue({...o,error:{issues:s.issues.map(a=>Oe(a,n,xe()))},input:o.value}),o.issues=[],o.fallback=!0),o)}}),jr=g("$ZodPipe",(e,t)=>{J.init(e,t),D(e._zod,"values",()=>t.in._zod.values),D(e._zod,"optin",()=>t.in._zod.optin),D(e._zod,"optout",()=>t.out._zod.optout),D(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(r=>gn(r,t.in,n)):gn(a,t.in,n)}const s=t.in._zod.run(o,n);return s instanceof Promise?s.then(a=>gn(a,t.out,n)):gn(s,t.out,n)}});function gn(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},o)}const Pd=g("$ZodPreprocess",(e,t)=>{jr.init(e,t)}),Cd=g("$ZodReadonly",(e,t)=>{J.init(e,t),D(e._zod,"propValues",()=>t.innerType._zod.propValues),D(e._zod,"values",()=>t.innerType._zod.values),D(e._zod,"optin",()=>t.innerType?._zod?.optin),D(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(Ai):Ai(s)}});function Ai(e){return e.value=Object.freeze(e.value),e}const Ed=g("$ZodLazy",(e,t)=>{J.init(e,t),D(e._zod,"innerType",()=>{const o=t;return o._cachedInner||(o._cachedInner=t.getter()),o._cachedInner}),D(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),D(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),D(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),D(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(o,n)=>e._zod.innerType._zod.run(o,n)}),kd=g("$ZodCustom",(e,t)=>{ve.init(e,t),J.init(e,t),e._zod.parse=(o,n)=>o,e._zod.check=o=>{const n=o.value,s=t.fn(n);if(s instanceof Promise)return s.then(a=>Ui(a,o,n,e));Ui(s,o,n,e)}});function Ui(e,t,o,n){if(!e){const s={code:"custom",input:o,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(jo(s))}}var ji;class $d{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){const n=o[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){const o=t._zod.parent;if(o){const n={...this.get(o)??{}};delete n.id;const s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function qd(){return new $d}(ji=globalThis).__zod_globalRegistry??(ji.__zod_globalRegistry=qd());const xo=globalThis.__zod_globalRegistry;function Id(e,t){return new e({type:"string",...E(t)})}function Zr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...E(t)})}function Zi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...E(t)})}function Nd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...E(t)})}function xd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(t)})}function Od(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(t)})}function zd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(t)})}function Dr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...E(t)})}function Md(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...E(t)})}function Ld(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(t)})}function Ad(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...E(t)})}function Ud(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(t)})}function jd(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...E(t)})}function Zd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...E(t)})}function Dd(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(t)})}function Hd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(t)})}function Fd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(t)})}function Jd(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(t)})}function Vd(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(t)})}function Bd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...E(t)})}function Wd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...E(t)})}function Gd(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...E(t)})}function Kd(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...E(t)})}function Yd(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(t)})}function Qd(e,t){return new e({type:"string",format:"date",check:"string_format",...E(t)})}function Xd(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...E(t)})}function em(e,t){return new e({type:"string",format:"duration",check:"string_format",...E(t)})}function tm(e,t){return new e({type:"number",checks:[],...E(t)})}function om(e,t){return new e({type:"number",coerce:!0,checks:[],...E(t)})}function nm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...E(t)})}function sm(e,t){return new e({type:"boolean",...E(t)})}function im(e,t){return new e({type:"undefined",...E(t)})}function rm(e,t){return new e({type:"null",...E(t)})}function am(e){return new e({type:"any"})}function cm(e){return new e({type:"unknown"})}function lm(e,t){return new e({type:"never",...E(t)})}function Di(e,t){return new Nr({check:"less_than",...E(t),value:e,inclusive:!1})}function is(e,t){return new Nr({check:"less_than",...E(t),value:e,inclusive:!0})}function Hi(e,t){return new xr({check:"greater_than",...E(t),value:e,inclusive:!1})}function rs(e,t){return new xr({check:"greater_than",...E(t),value:e,inclusive:!0})}function Fi(e,t){return new _p({check:"multiple_of",...E(t),value:e})}function Hr(e,t){return new bp({check:"max_length",...E(t),maximum:e})}function Tn(e,t){return new yp({check:"min_length",...E(t),minimum:e})}function Fr(e,t){return new Rp({check:"length_equals",...E(t),length:e})}function um(e,t){return new wp({check:"string_format",format:"regex",...E(t),pattern:e})}function pm(e){return new Tp({check:"string_format",format:"lowercase",...E(e)})}function dm(e){return new Pp({check:"string_format",format:"uppercase",...E(e)})}function mm(e,t){return new Cp({check:"string_format",format:"includes",...E(t),includes:e})}function hm(e,t){return new Ep({check:"string_format",format:"starts_with",...E(t),prefix:e})}function fm(e,t){return new kp({check:"string_format",format:"ends_with",...E(t),suffix:e})}function qt(e){return new $p({check:"overwrite",tx:e})}function gm(e){return qt(t=>t.normalize(e))}function Sm(){return qt(e=>e.trim())}function _m(){return qt(e=>e.toLowerCase())}function vm(){return qt(e=>e.toUpperCase())}function bm(){return qt(e=>vu(e))}function ym(e,t,o){return new e({type:"array",element:t,...E(o)})}function Rm(e,t,o){return new e({type:"custom",check:"custom",fn:t,...E(o)})}function wm(e,t){const o=Tm(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(jo(s,n.value,o._zod.def));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=o),a.continue??(a.continue=!o._zod.def.abort),n.issues.push(jo(a))}},e(n.value,n)),t);return o}function Tm(e,t){const o=new ve({check:"custom",...E(t)});return o._zod.check=e,o}function Pn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??xo,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function B(e,t,o={path:[],schemaPath:[]}){var n;const s=e._zod.def,a=t.seen.get(e);if(a)return a.count++,o.schemaPath.includes(e)&&(a.cycle=o.path),a.schema;const r={schema:{},count:1,cycle:void 0,path:o.path};t.seen.set(e,r);const c=e._zod.toJSONSchema?.();if(c)r.schema=c;else{const h={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,h);else{const v=r.schema,f=t.processors[s.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);f(e,t,v,h)}const S=e._zod.parent;S&&(r.ref||(r.ref=S),B(S,t,h),t.seen.get(S).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(r.schema,u),t.io==="input"&&he(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&"_prefault"in r.schema&&((n=r.schema).default??(n.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function Cn(e,t){const o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const r of e.seen.entries()){const c=e.metadataRegistry.get(r[0])?.id;if(c){const u=n.get(c);if(u&&u!==r[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,r[0])}}const s=r=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const S=e.external.registry.get(r[0])?.id,v=e.external.uri??(R=>R);if(S)return{ref:v(S)};const f=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=f,{defId:f,ref:`${v("__shared")}#/${c}/${f}`}}if(r[1]===o)return{ref:"#"};const d=`#/${c}/`,h=r[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:d+h}},a=r=>{if(r[1].schema.$ref)return;const c=r[1],{ref:u,defId:d}=s(r);c.def={...c.schema},d&&(c.defId=d);const h=c.schema;for(const S in h)delete h[S];h.$ref=u};if(e.cycles==="throw")for(const r of e.seen.entries()){const c=r[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const c=r[1];if(t===r[0]){a(r);continue}if(e.external){const d=e.external.registry.get(r[0])?.id;if(t!==r[0]&&d){a(r);continue}}if(e.metadataRegistry.get(r[0])?.id){a(r);continue}if(c.cycle){a(r);continue}if(c.count>1&&e.reused==="ref"){a(r);continue}}}function En(e,t){const o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=c=>{const u=e.seen.get(c);if(u.ref===null)return;const d=u.def??u.schema,h={...d},S=u.ref;if(u.ref=null,S){n(S);const f=e.seen.get(S),R=f.schema;if(R.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(R)):Object.assign(d,R),Object.assign(d,h),c._zod.parent===S)for(const b in d)b==="$ref"||b==="allOf"||b in h||delete d[b];if(R.$ref&&f.def)for(const b in d)b==="$ref"||b==="allOf"||b in f.def&&JSON.stringify(d[b])===JSON.stringify(f.def[b])&&delete d[b]}const v=c._zod.parent;if(v&&v!==S){n(v);const f=e.seen.get(v);if(f?.schema.$ref&&(d.$ref=f.schema.$ref,f.def))for(const R in d)R==="$ref"||R==="allOf"||R in f.def&&JSON.stringify(d[R])===JSON.stringify(f.def[R])&&delete d[R]}e.override({zodSchema:c,jsonSchema:d,path:u.path??[]})};for(const c of[...e.seen.entries()].reverse())n(c[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(c)}Object.assign(s,o.def??o.schema);const a=e.metadataRegistry.get(t)?.id;a!==void 0&&s.id===a&&delete s.id;const r=e.external?.defs??{};for(const c of e.seen.entries()){const u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,r[u.defId]=u.def)}e.external||Object.keys(r).length>0&&(e.target==="draft-2020-12"?s.$defs=r:s.definitions=r);try{const c=JSON.parse(JSON.stringify(s));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:kn(t,"input",e.processors),output:kn(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function he(e,t){const o=t??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return he(n.element,o);if(n.type==="set")return he(n.valueType,o);if(n.type==="lazy")return he(n.getter(),o);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return he(n.innerType,o);if(n.type==="intersection")return he(n.left,o)||he(n.right,o);if(n.type==="record"||n.type==="map")return he(n.keyType,o)||he(n.valueType,o);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:he(n.in,o)||he(n.out,o);if(n.type==="object"){for(const s in n.shape)if(he(n.shape[s],o))return!0;return!1}if(n.type==="union"){for(const s of n.options)if(he(s,o))return!0;return!1}if(n.type==="tuple"){for(const s of n.items)if(he(s,o))return!0;return!!(n.rest&&he(n.rest,o))}return!1}const Pm=(e,t={})=>o=>{const n=Pn({...o,processors:t});return B(e,n),Cn(n,e),En(n,e)},kn=(e,t,o={})=>n=>{const{libraryOptions:s,target:a}=n??{},r=Pn({...s??{},target:a,io:t,processors:o});return B(e,r),Cn(r,e),En(r,e)},Cm={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Jr=(e,t,o,n)=>{const s=o;s.type="string";const{minimum:a,maximum:r,format:c,patterns:u,contentEncoding:d}=e._zod.bag;if(typeof a=="number"&&(s.minLength=a),typeof r=="number"&&(s.maxLength=r),c&&(s.format=Cm[c]??c,s.format===""&&delete s.format,c==="time"&&delete s.format),d&&(s.contentEncoding=d),u&&u.size>0){const h=[...u];h.length===1?s.pattern=h[0].source:h.length>1&&(s.allOf=[...h.map(S=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))])}},Vr=(e,t,o,n)=>{const s=o,{minimum:a,maximum:r,format:c,multipleOf:u,exclusiveMaximum:d,exclusiveMinimum:h}=e._zod.bag;typeof c=="string"&&c.includes("int")?s.type="integer":s.type="number";const S=typeof h=="number"&&h>=(a??Number.NEGATIVE_INFINITY),v=typeof d=="number"&&d<=(r??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";S?f?(s.minimum=h,s.exclusiveMinimum=!0):s.exclusiveMinimum=h:typeof a=="number"&&(s.minimum=a),v?f?(s.maximum=d,s.exclusiveMaximum=!0):s.exclusiveMaximum=d:typeof r=="number"&&(s.maximum=r),typeof u=="number"&&(s.multipleOf=u)},Br=(e,t,o,n)=>{o.type="boolean"},Em=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},km=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Wr=(e,t,o,n)=>{t.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},Gr=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},$m=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Kr=(e,t,o,n)=>{o.not={}},Yr=(e,t,o,n)=>{},Qr=(e,t,o,n)=>{},qm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Xr=(e,t,o,n)=>{const s=e._zod.def,a=yr(s.entries);a.every(r=>typeof r=="number")&&(o.type="number"),a.every(r=>typeof r=="string")&&(o.type="string"),o.enum=a},ea=(e,t,o,n)=>{const s=e._zod.def,a=[];for(const r of s.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(r))}else a.push(r);if(a.length!==0)if(a.length===1){const r=a[0];o.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?o.enum=[r]:o.const=r}else a.every(r=>typeof r=="number")&&(o.type="number"),a.every(r=>typeof r=="string")&&(o.type="string"),a.every(r=>typeof r=="boolean")&&(o.type="boolean"),a.every(r=>r===null)&&(o.type="null"),o.enum=a},Im=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Nm=(e,t,o,n)=>{const s=o,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=a.source},xm=(e,t,o,n)=>{const s=o,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:r,maximum:c,mime:u}=e._zod.bag;r!==void 0&&(a.minLength=r),c!==void 0&&(a.maxLength=c),u?u.length===1?(a.contentMediaType=u[0],Object.assign(s,a)):(Object.assign(s,a),s.anyOf=u.map(d=>({contentMediaType:d}))):Object.assign(s,a)},Om=(e,t,o,n)=>{o.type="boolean"},ta=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},zm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},oa=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Mm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Lm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},na=(e,t,o,n)=>{const s=o,a=e._zod.def,{minimum:r,maximum:c}=e._zod.bag;typeof r=="number"&&(s.minItems=r),typeof c=="number"&&(s.maxItems=c),s.type="array",s.items=B(a.element,t,{...n,path:[...n.path,"items"]})},sa=(e,t,o,n)=>{const s=o,a=e._zod.def;s.type="object",s.properties={};const r=a.shape;for(const d in r)s.properties[d]=B(r[d],t,{...n,path:[...n.path,"properties",d]});const c=new Set(Object.keys(r)),u=new Set([...c].filter(d=>{const h=a.shape[d]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));u.size>0&&(s.required=Array.from(u)),a.catchall?._zod.def.type==="never"?s.additionalProperties=!1:a.catchall?a.catchall&&(s.additionalProperties=B(a.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},ia=(e,t,o,n)=>{const s=e._zod.def,a=s.inclusive===!1,r=s.options.map((c,u)=>B(c,t,{...n,path:[...n.path,a?"oneOf":"anyOf",u]}));a?o.oneOf=r:o.anyOf=r},ra=(e,t,o,n)=>{const s=e._zod.def,a=B(s.left,t,{...n,path:[...n.path,"allOf",0]}),r=B(s.right,t,{...n,path:[...n.path,"allOf",1]}),c=d=>"allOf"in d&&Object.keys(d).length===1,u=[...c(a)?a.allOf:[a],...c(r)?r.allOf:[r]];o.allOf=u},Am=(e,t,o,n)=>{const s=o,a=e._zod.def;s.type="array";const r=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=a.items.map((v,f)=>B(v,t,{...n,path:[...n.path,r,f]})),d=a.rest?B(a.rest,t,{...n,path:[...n.path,c,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(s.prefixItems=u,d&&(s.items=d)):t.target==="openapi-3.0"?(s.items={anyOf:u},d&&s.items.anyOf.push(d),s.minItems=u.length,d||(s.maxItems=u.length)):(s.items=u,d&&(s.additionalItems=d));const{minimum:h,maximum:S}=e._zod.bag;typeof h=="number"&&(s.minItems=h),typeof S=="number"&&(s.maxItems=S)},aa=(e,t,o,n)=>{const s=o,a=e._zod.def;s.type="object";const r=a.keyType,u=r._zod.bag?.patterns;if(a.mode==="loose"&&u&&u.size>0){const h=B(a.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});s.patternProperties={};for(const S of u)s.patternProperties[S.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=B(a.keyType,t,{...n,path:[...n.path,"propertyNames"]})),s.additionalProperties=B(a.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const d=r._zod.values;if(d){const h=[...d].filter(S=>typeof S=="string"||typeof S=="number");h.length>0&&(s.required=h)}},ca=(e,t,o,n)=>{const s=e._zod.def,a=B(s.innerType,t,n),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=s.innerType,o.nullable=!0):o.anyOf=[a,{type:"null"}]},la=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType},ua=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType,o.default=JSON.parse(JSON.stringify(s.defaultValue))},pa=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType,t.io==="input"&&(o._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},da=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType;let r;try{r=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}o.default=r},ma=(e,t,o,n)=>{const s=e._zod.def,a=s.in._zod.traits.has("$ZodTransform"),r=t.io==="input"?a?s.out:s.in:s.out;B(r,t,n);const c=t.seen.get(e);c.ref=r},ha=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType,o.readOnly=!0},Um=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType},Ms=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType},fa=(e,t,o,n)=>{const s=e._zod.innerType;B(s,t,n);const a=t.seen.get(e);a.ref=s},Ji={string:Jr,number:Vr,boolean:Br,bigint:Em,symbol:km,null:Wr,undefined:Gr,void:$m,never:Kr,any:Yr,unknown:Qr,date:qm,enum:Xr,literal:ea,nan:Im,template_literal:Nm,file:xm,success:Om,custom:ta,function:zm,transform:oa,map:Mm,set:Lm,array:na,object:sa,union:ia,intersection:ra,tuple:Am,record:aa,nullable:ca,nonoptional:la,default:ua,prefault:pa,catch:da,pipe:ma,readonly:ha,promise:Um,optional:Ms,lazy:fa};function ga(e,t){if("_idmap"in e){const n=e,s=Pn({...t,processors:Ji}),a={};for(const u of n._idmap.entries()){const[d,h]=u;B(h,s)}const r={},c={registry:n,uri:t?.uri,defs:a};s.external=c;for(const u of n._idmap.entries()){const[d,h]=u;Cn(s,h),r[d]=En(s,h)}if(Object.keys(a).length>0){const u=s.target==="draft-2020-12"?"$defs":"definitions";r.__shared={[u]:a}}return{schemas:r}}const o=Pn({...t,processors:Ji});return B(e,o),Cn(o,e),En(o,e)}const jm=g("ZodISODateTime",(e,t)=>{Hp.init(e,t),K.init(e,t)});function Bo(e){return Yd(jm,e)}const Zm=g("ZodISODate",(e,t)=>{Fp.init(e,t),K.init(e,t)});function Sa(e){return Qd(Zm,e)}const Dm=g("ZodISOTime",(e,t)=>{Jp.init(e,t),K.init(e,t)});function Hm(e){return Xd(Dm,e)}const Fm=g("ZodISODuration",(e,t)=>{Vp.init(e,t),K.init(e,t)});function Jm(e){return em(Fm,e)}const Vm=(e,t)=>{Pr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>xu(e,o)},flatten:{value:o=>Nu(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,fs,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,fs,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ce=g("ZodError",Vm,{Parent:Error}),Bm=xs(Ce),Wm=Os(Ce),_a=An(Ce),Gm=Un(Ce),Km=Mu(Ce),Ym=Lu(Ce),Qm=Au(Ce),Xm=Uu(Ce),eh=ju(Ce),th=Zu(Ce),oh=Du(Ce),nh=Hu(Ce),Vi=new WeakMap;function Wo(e,t,o){const n=Object.getPrototypeOf(e);let s=Vi.get(n);if(s||(s=new Set,Vi.set(n,s)),!s.has(t)){s.add(t);for(const a in o){const r=o[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){const c=r.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}const V=g("ZodType",(e,t)=>(J.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:kn(e,"input"),output:kn(e,"output")}}),e.toJSONSchema=Pm(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,n)=>Bm(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>_a(e,o,n),e.parseAsync=async(o,n)=>Wm(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>Gm(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>Km(e,o,n),e.decode=(o,n)=>Ym(e,o,n),e.encodeAsync=async(o,n)=>Qm(e,o,n),e.decodeAsync=async(o,n)=>Xm(e,o,n),e.safeEncode=(o,n)=>eh(e,o,n),e.safeDecode=(o,n)=>th(e,o,n),e.safeEncodeAsync=async(o,n)=>oh(e,o,n),e.safeDecodeAsync=async(o,n)=>nh(e,o,n),Wo(e,"ZodType",{check(...o){const n=this.def;return this.clone(Ze(n,{checks:[...n.checks??[],...o.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...o){return this.check(...o)},clone(o,n){return De(this,o,n)},brand(){return this},register(o,n){return o.add(this,n),this},refine(o,n){return this.check(Wh(o,n))},superRefine(o,n){return this.check(Gh(o,n))},overwrite(o){return this.check(qt(o))},optional(){return k(this)},exactOptional(){return Oh(this)},nullable(){return Ki(this)},nullish(){return k(Ki(this))},nonoptional(o){return jh(this,o)},array(){return m(this)},or(o){return w([this,o])},and(o){return ot(this,o)},transform(o){return Yi(this,Ta(o))},default(o){return Lh(this,o)},prefault(o){return Uh(this,o)},catch(o){return Dh(this,o)},pipe(o){return Yi(this,o)},readonly(){return Jh(this)},describe(o){const n=this.clone();return xo.add(n,{description:o}),n},meta(...o){if(o.length===0)return xo.get(this);const n=this.clone();return xo.add(n,o[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(o){return o(this)}}),Object.defineProperty(e,"description",{get(){return xo.get(e)?.description},configurable:!0}),e)),va=g("_ZodString",(e,t)=>{zs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,s,a)=>Jr(e,n,s);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,Wo(e,"_ZodString",{regex(...n){return this.check(um(...n))},includes(...n){return this.check(mm(...n))},startsWith(...n){return this.check(hm(...n))},endsWith(...n){return this.check(fm(...n))},min(...n){return this.check(Tn(...n))},max(...n){return this.check(Hr(...n))},length(...n){return this.check(Fr(...n))},nonempty(...n){return this.check(Tn(1,...n))},lowercase(n){return this.check(pm(n))},uppercase(n){return this.check(dm(n))},trim(){return this.check(Sm())},normalize(...n){return this.check(gm(...n))},toLowerCase(){return this.check(_m())},toUpperCase(){return this.check(vm())},slugify(){return this.check(bm())}})}),sh=g("ZodString",(e,t)=>{zs.init(e,t),va.init(e,t),e.email=o=>e.check(Zr(ba,o)),e.url=o=>e.check(Dr(ya,o)),e.jwt=o=>e.check(Kd(bh,o)),e.emoji=o=>e.check(Md(rh,o)),e.guid=o=>e.check(Zi(Bi,o)),e.uuid=o=>e.check(Nd(Sn,o)),e.uuidv4=o=>e.check(xd(Sn,o)),e.uuidv6=o=>e.check(Od(Sn,o)),e.uuidv7=o=>e.check(zd(Sn,o)),e.nanoid=o=>e.check(Ld(ah,o)),e.guid=o=>e.check(Zi(Bi,o)),e.cuid=o=>e.check(Ad(ch,o)),e.cuid2=o=>e.check(Ud(lh,o)),e.ulid=o=>e.check(jd(uh,o)),e.base64=o=>e.check(Bd(Sh,o)),e.base64url=o=>e.check(Wd(_h,o)),e.xid=o=>e.check(Zd(ph,o)),e.ksuid=o=>e.check(Dd(dh,o)),e.ipv4=o=>e.check(Hd(mh,o)),e.ipv6=o=>e.check(Fd(hh,o)),e.cidrv4=o=>e.check(Jd(fh,o)),e.cidrv6=o=>e.check(Vd(gh,o)),e.e164=o=>e.check(Gd(vh,o)),e.datetime=o=>e.check(Bo(o)),e.date=o=>e.check(Sa(o)),e.time=o=>e.check(Hm(o)),e.duration=o=>e.check(Jm(o))});function i(e){return Id(sh,e)}const K=g("ZodStringFormat",(e,t)=>{W.init(e,t),va.init(e,t)}),ba=g("ZodEmail",(e,t)=>{Op.init(e,t),K.init(e,t)});function ih(e){return Zr(ba,e)}const Bi=g("ZodGUID",(e,t)=>{Np.init(e,t),K.init(e,t)}),Sn=g("ZodUUID",(e,t)=>{xp.init(e,t),K.init(e,t)}),ya=g("ZodURL",(e,t)=>{zp.init(e,t),K.init(e,t)});function Ls(e){return Dr(ya,e)}const rh=g("ZodEmoji",(e,t)=>{Mp.init(e,t),K.init(e,t)}),ah=g("ZodNanoID",(e,t)=>{Lp.init(e,t),K.init(e,t)}),ch=g("ZodCUID",(e,t)=>{Ap.init(e,t),K.init(e,t)}),lh=g("ZodCUID2",(e,t)=>{Up.init(e,t),K.init(e,t)}),uh=g("ZodULID",(e,t)=>{jp.init(e,t),K.init(e,t)}),ph=g("ZodXID",(e,t)=>{Zp.init(e,t),K.init(e,t)}),dh=g("ZodKSUID",(e,t)=>{Dp.init(e,t),K.init(e,t)}),mh=g("ZodIPv4",(e,t)=>{Bp.init(e,t),K.init(e,t)}),hh=g("ZodIPv6",(e,t)=>{Wp.init(e,t),K.init(e,t)}),fh=g("ZodCIDRv4",(e,t)=>{Gp.init(e,t),K.init(e,t)}),gh=g("ZodCIDRv6",(e,t)=>{Kp.init(e,t),K.init(e,t)}),Sh=g("ZodBase64",(e,t)=>{Yp.init(e,t),K.init(e,t)}),_h=g("ZodBase64URL",(e,t)=>{Xp.init(e,t),K.init(e,t)}),vh=g("ZodE164",(e,t)=>{ed.init(e,t),K.init(e,t)}),bh=g("ZodJWT",(e,t)=>{od.init(e,t),K.init(e,t)}),As=g("ZodNumber",(e,t)=>{zr.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,s,a)=>Vr(e,n,s),Wo(e,"ZodNumber",{gt(n,s){return this.check(Hi(n,s))},gte(n,s){return this.check(rs(n,s))},min(n,s){return this.check(rs(n,s))},lt(n,s){return this.check(Di(n,s))},lte(n,s){return this.check(is(n,s))},max(n,s){return this.check(is(n,s))},int(n){return this.check(Wi(n))},safe(n){return this.check(Wi(n))},positive(n){return this.check(Hi(0,n))},nonnegative(n){return this.check(rs(0,n))},negative(n){return this.check(Di(0,n))},nonpositive(n){return this.check(is(0,n))},multipleOf(n,s){return this.check(Fi(n,s))},step(n,s){return this.check(Fi(n,s))},finite(){return this}});const o=e._zod.bag;e.minValue=Math.max(o.minimum??Number.NEGATIVE_INFINITY,o.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(o.maximum??Number.POSITIVE_INFINITY,o.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(o.format??"").includes("int")||Number.isSafeInteger(o.multipleOf??.5),e.isFinite=!0,e.format=o.format??null});function _(e){return tm(As,e)}const yh=g("ZodNumberFormat",(e,t)=>{nd.init(e,t),As.init(e,t)});function Wi(e){return nm(yh,e)}const Rh=g("ZodBoolean",(e,t)=>{sd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Br(e,o,n)});function T(e){return sm(Rh,e)}const wh=g("ZodUndefined",(e,t)=>{id.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Gr(e,o)});function Ss(e){return im(wh,e)}const Th=g("ZodNull",(e,t)=>{rd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Wr(e,o,n)});function Zo(e){return rm(Th,e)}const Ph=g("ZodAny",(e,t)=>{ad.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Yr()});function Us(){return am(Ph)}const Ch=g("ZodUnknown",(e,t)=>{cd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Qr()});function C(){return cm(Ch)}const Eh=g("ZodNever",(e,t)=>{ld.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Kr(e,o,n)});function _s(e){return lm(Eh,e)}const kh=g("ZodArray",(e,t)=>{ud.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>na(e,o,n,s),e.element=t.element,Wo(e,"ZodArray",{min(o,n){return this.check(Tn(o,n))},nonempty(o){return this.check(Tn(1,o))},max(o,n){return this.check(Hr(o,n))},length(o,n){return this.check(Fr(o,n))},unwrap(){return this.element}})});function m(e,t){return ym(kh,e,t)}const Ra=g("ZodObject",(e,t)=>{dd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>sa(e,o,n,s),D(e,"shape",()=>t.shape),Wo(e,"ZodObject",{keyof(){return z(Object.keys(this._zod.def.shape))},catchall(o){return this.clone({...this._zod.def,catchall:o})},passthrough(){return this.clone({...this._zod.def,catchall:C()})},loose(){return this.clone({...this._zod.def,catchall:C()})},strict(){return this.clone({...this._zod.def,catchall:_s()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(o){return Cu(this,o)},safeExtend(o){return Eu(this,o)},merge(o){return ku(this,o)},pick(o){return Tu(this,o)},omit(o){return Pu(this,o)},partial(...o){return $u(Pa,this,o[0])},required(...o){return qu(Ca,this,o[0])}})});function l(e,t){const o={type:"object",shape:e??{},...E(t)};return new Ra(o)}function I(e,t){return new Ra({type:"object",shape:e,catchall:C(),...E(t)})}const wa=g("ZodUnion",(e,t)=>{Ar.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ia(e,o,n,s),e.options=t.options});function w(e,t){return new wa({type:"union",options:e,...E(t)})}const $h=g("ZodDiscriminatedUnion",(e,t)=>{wa.init(e,t),md.init(e,t)});function $n(e,t,o){return new $h({type:"union",options:t,discriminator:e,...E(o)})}const qh=g("ZodIntersection",(e,t)=>{hd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ra(e,o,n,s)});function ot(e,t){return new qh({type:"intersection",left:e,right:t})}const Gi=g("ZodRecord",(e,t)=>{fd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>aa(e,o,n,s),e.keyType=t.keyType,e.valueType=t.valueType});function y(e,t,o){return!t||!t._zod?new Gi({type:"record",keyType:i(),valueType:e,...E(t)}):new Gi({type:"record",keyType:e,valueType:t,...E(o)})}const vs=g("ZodEnum",(e,t)=>{gd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,s,a)=>Xr(e,n,s),e.enum=t.entries,e.options=Object.values(t.entries);const o=new Set(Object.keys(t.entries));e.extract=(n,s)=>{const a={};for(const r of n)if(o.has(r))a[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new vs({...t,checks:[],...E(s),entries:a})},e.exclude=(n,s)=>{const a={...t.entries};for(const r of n)if(o.has(r))delete a[r];else throw new Error(`Key ${r} not found in enum`);return new vs({...t,checks:[],...E(s),entries:a})}});function z(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new vs({type:"enum",entries:o,...E(t)})}const Ih=g("ZodLiteral",(e,t)=>{Sd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ea(e,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function p(e,t){return new Ih({type:"literal",values:Array.isArray(e)?e:[e],...E(t)})}const Nh=g("ZodTransform",(e,t)=>{_d.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>oa(e,o),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new br(e.constructor.name);o.addIssue=a=>{if(typeof a=="string")o.issues.push(jo(a,o.value,t));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=e),o.issues.push(jo(r))}};const s=t.transform(o.value,o);return s instanceof Promise?s.then(a=>(o.value=a,o.fallback=!0,o)):(o.value=s,o.fallback=!0,o)}});function Ta(e){return new Nh({type:"transform",transform:e})}const Pa=g("ZodOptional",(e,t)=>{Ur.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Ms(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function k(e){return new Pa({type:"optional",innerType:e})}const xh=g("ZodExactOptional",(e,t)=>{vd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Ms(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function Oh(e){return new xh({type:"optional",innerType:e})}const zh=g("ZodNullable",(e,t)=>{bd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ca(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function Ki(e){return new zh({type:"nullable",innerType:e})}const Mh=g("ZodDefault",(e,t)=>{yd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ua(e,o,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Lh(e,t){return new Mh({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():wr(t)}})}const Ah=g("ZodPrefault",(e,t)=>{Rd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>pa(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function Uh(e,t){return new Ah({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():wr(t)}})}const Ca=g("ZodNonOptional",(e,t)=>{wd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>la(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function jh(e,t){return new Ca({type:"nonoptional",innerType:e,...E(t)})}const Zh=g("ZodCatch",(e,t)=>{Td.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>da(e,o,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Dh(e,t){return new Zh({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ea=g("ZodPipe",(e,t)=>{jr.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ma(e,o,n,s),e.in=t.in,e.out=t.out});function Yi(e,t){return new Ea({type:"pipe",in:e,out:t})}const Hh=g("ZodPreprocess",(e,t)=>{Ea.init(e,t),Pd.init(e,t)}),Fh=g("ZodReadonly",(e,t)=>{Cd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ha(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function Jh(e){return new Fh({type:"readonly",innerType:e})}const Vh=g("ZodLazy",(e,t)=>{Ed.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>fa(e,o,n,s),e.unwrap=()=>e._zod.def.getter()});function js(e){return new Vh({type:"lazy",getter:e})}const Bh=g("ZodCustom",(e,t)=>{kd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ta(e,o)});function Wh(e,t={}){return Rm(Bh,e,t)}function Gh(e,t){return wm(e,t)}function Do(e,t){return new Hh({type:"pipe",in:Ta(e),out:t})}const Kh={custom:"custom"};function Yh(e){return om(As,e)}const Qh="2025-11-25",Xh=[Qh,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ef="io.modelcontextprotocol/related-task",Zn="io.modelcontextprotocol/protocolVersion",Zs="io.modelcontextprotocol/clientInfo",Oo="io.modelcontextprotocol/serverInfo",Dn="io.modelcontextprotocol/clientCapabilities",tf="io.modelcontextprotocol/subscriptionId",Ds="io.modelcontextprotocol/logLevel",Hn="2.0",of=-32600,Et=js(()=>w([i(),_(),T(),Zo(),y(i(),Et),m(Et)])),ee=y(i(),Et),nf=m(Et),Hs=w([i(),_().int()]),Fs=i(),ka=l({ttl:_().optional()}),$a=l({taskId:i()}),Js=I({progressToken:Hs.optional(),[ef]:$a.optional()}),me=l({_meta:Js.optional()}),Go=me.extend({task:ka.optional()}),te=l({method:i(),params:me.loose().optional()}),be=l({_meta:Js.optional()}),ye=l({method:i(),params:be.loose().optional()}),Vs=I({get[Oo](){return Nt.optional().catch(void 0)}}),oe=I({_meta:Vs.optional()}),rt=w([i(),_().int()]),Bs=l({jsonrpc:p(Hn),id:rt,...te.shape}).strict(),Ws=l({jsonrpc:p(Hn),...ye.shape}).strict(),Fn=l({jsonrpc:p(Hn),id:rt,result:oe}).strict(),Jn=l({jsonrpc:p(Hn),id:rt.optional(),error:l({code:_().int(),message:i(),data:C().optional()})}).strict(),qa=w([Bs,Ws,Fn,Jn]),sf=w([Fn,Jn]),Vn=oe.strict(),Ia=be.extend({requestId:rt.optional(),reason:i().optional()}),Gs=ye.extend({method:p("notifications/cancelled"),params:Ia}),Na=l({src:i(),mimeType:i().optional(),sizes:m(i()).optional(),theme:z(["light","dark"]).optional()}),It=l({icons:m(Na).optional()}),nt=l({name:i(),title:i().optional()}),Nt=nt.extend({...nt.shape,...It.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),rf=ot(l({applyDefaults:T().optional()}),ee),af=Do(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ot(l({form:rf.optional(),url:ee.optional()}),ee.optional())),xa=I({list:ee.optional(),cancel:ee.optional(),requests:I({sampling:I({createMessage:ee.optional()}).optional(),elicitation:I({create:ee.optional()}).optional()}).optional()}),Oa=I({list:ee.optional(),cancel:ee.optional(),requests:I({tools:I({call:ee.optional()}).optional()}).optional()}),za=l({experimental:y(i(),ee).optional(),sampling:l({context:ee.optional(),tools:ee.optional()}).optional(),elicitation:af.optional(),roots:l({listChanged:T().optional()}).optional(),tasks:xa.optional(),extensions:y(i(),ee).optional()}),Ma=me.extend({protocolVersion:i(),capabilities:za,clientInfo:Nt}),La=te.extend({method:p("initialize"),params:Ma}),Ks=l({experimental:y(i(),ee).optional(),logging:ee.optional(),completions:ee.optional(),prompts:l({listChanged:T().optional()}).optional(),resources:l({subscribe:T().optional(),listChanged:T().optional()}).optional(),tools:l({listChanged:T().optional()}).optional(),tasks:Oa.optional(),extensions:y(i(),ee).optional()}),Aa=oe.extend({protocolVersion:i(),capabilities:Ks,serverInfo:Nt,instructions:i().optional()}),Ua=ye.extend({method:p("notifications/initialized"),params:be.optional()}),ja=te.extend({method:p("server/discover"),params:me.optional()}),Za=oe.extend({supportedVersions:m(i()),capabilities:Ks,instructions:i().optional()}),Ys=te.extend({method:p("ping"),params:me.optional()}),Da=l({progress:_(),total:k(_()),message:k(i())}),Ha=l({...be.shape,...Da.shape,progressToken:Hs}),Qs=ye.extend({method:p("notifications/progress"),params:Ha}),Fa=me.extend({cursor:Fs.optional()}),xt=te.extend({params:Fa.optional()}),Ot=oe.extend({nextCursor:Fs.optional()}),Xs=l({uri:i(),mimeType:k(i()),_meta:y(i(),C()).optional()}),ei=Xs.extend({text:i()}),ti=i().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),oi=Xs.extend({blob:ti}),zt=z(["user","assistant"]),at=l({audience:m(zt).optional(),priority:_().min(0).max(1).optional(),lastModified:Bo({offset:!0}).optional()}),ni=l({...nt.shape,...It.shape,uri:i(),description:k(i()),mimeType:k(i()),size:k(_()),annotations:at.optional(),_meta:k(I({}))}),Ja=l({...nt.shape,...It.shape,uriTemplate:i(),description:k(i()),mimeType:k(i()),annotations:at.optional(),_meta:k(I({}))}),Va=xt.extend({method:p("resources/list")}),Ba=Ot.extend({resources:m(ni)}),Wa=xt.extend({method:p("resources/templates/list")}),Ga=Ot.extend({resourceTemplates:m(Ja)}),Bn=me.extend({uri:i()}),Ka=Bn,Ya=te.extend({method:p("resources/read"),params:Ka}),Qa=oe.extend({contents:m(w([ei,oi]))}),Xa=ye.extend({method:p("notifications/resources/list_changed"),params:be.optional()}),ec=Bn,tc=te.extend({method:p("resources/subscribe"),params:ec}),oc=Bn,nc=te.extend({method:p("resources/unsubscribe"),params:oc}),si=l({toolsListChanged:T().optional(),promptsListChanged:T().optional(),resourcesListChanged:T().optional(),resourceSubscriptions:m(i()).optional()}),sc=me.extend({notifications:si}),ic=te.extend({method:p("subscriptions/listen"),params:sc}),rc=be.extend({notifications:si}),ac=ye.extend({method:p("notifications/subscriptions/acknowledged"),params:rc}),cc=Vs.extend({[tf]:rt}),lc=oe.extend({_meta:cc}),uc=be.extend({uri:i()}),pc=ye.extend({method:p("notifications/resources/updated"),params:uc}),dc=l({name:i(),description:k(i()),required:k(T())}),mc=l({...nt.shape,...It.shape,description:k(i()),arguments:k(m(dc)),_meta:k(I({}))}),hc=xt.extend({method:p("prompts/list")}),fc=Ot.extend({prompts:m(mc)}),gc=me.extend({name:i(),arguments:y(i(),i()).optional()}),Sc=te.extend({method:p("prompts/get"),params:gc}),Wn=l({type:p("text"),text:i(),annotations:at.optional(),_meta:y(i(),C()).optional()}),Gn=l({type:p("image"),data:ti,mimeType:i(),annotations:at.optional(),_meta:y(i(),C()).optional()}),Kn=l({type:p("audio"),data:ti,mimeType:i(),annotations:at.optional(),_meta:y(i(),C()).optional()}),_c=l({type:p("tool_use"),name:i(),id:i(),input:y(i(),C()),_meta:y(i(),C()).optional()}),ii=l({type:p("resource"),resource:w([ei,oi]),annotations:at.optional(),_meta:y(i(),C()).optional()}),ri=ni.extend({type:p("resource_link")}),Mt=w([Wn,Gn,Kn,ri,ii]),vc=l({role:zt,content:Mt}),bc=oe.extend({description:i().optional(),messages:m(vc)}),yc=ye.extend({method:p("notifications/prompts/list_changed"),params:be.optional()}),Rc=l({title:i().optional(),readOnlyHint:T().optional(),destructiveHint:T().optional(),idempotentHint:T().optional(),openWorldHint:T().optional()}),wc=l({taskSupport:z(["required","optional","forbidden"]).optional()}),Yn=l({...nt.shape,...It.shape,description:i().optional(),inputSchema:l({type:p("object"),properties:y(i(),Et).optional(),required:m(i()).optional()}).catchall(C()),outputSchema:I({$schema:i().optional()}).optional(),annotations:Rc.optional(),execution:wc.optional(),_meta:y(i(),C()).optional()}),Tc=xt.extend({method:p("tools/list")}),Pc=Ot.extend({tools:m(Yn)}),Qn=oe.extend({content:m(Mt).default([]),structuredContent:C().optional(),isError:T().optional()}),cf=Qn.or(oe.extend({toolResult:C()})),Cc=Go.extend({name:i(),arguments:y(i(),C()).optional()}),Ec=te.extend({method:p("tools/call"),params:Cc}),kc=ye.extend({method:p("notifications/tools/list_changed"),params:be.optional()}),lf=l({autoRefresh:T().default(!0),debounceMs:_().int().nonnegative().default(300)}),ai=z(["debug","info","notice","warning","error","critical","alert","emergency"]),$c=me.extend({level:ai}),qc=te.extend({method:p("logging/setLevel"),params:$c}),Ic=be.extend({level:ai,logger:i().optional(),data:C()}),Nc=ye.extend({method:p("notifications/message"),params:Ic}),xc=l({name:i().optional()}),Oc=l({hints:m(xc).optional(),costPriority:_().min(0).max(1).optional(),speedPriority:_().min(0).max(1).optional(),intelligencePriority:_().min(0).max(1).optional()}),zc=l({mode:z(["auto","required","none"]).optional()}),Mc=l({type:p("tool_result"),toolUseId:i().describe("The unique identifier for the corresponding tool call."),content:m(Mt),structuredContent:C().optional(),isError:T().optional(),_meta:y(i(),C()).optional()}),Lc=$n("type",[Wn,Gn,Kn]),Ho=$n("type",[Wn,Gn,Kn,_c,Mc]),Ac=l({role:zt,content:w([Ho,m(Ho)]),_meta:y(i(),C()).optional()}),Uc=Go.extend({messages:m(Ac),modelPreferences:Oc.optional(),systemPrompt:i().optional(),includeContext:z(["none","thisServer","allServers"]).optional(),temperature:_().optional(),maxTokens:_().int(),stopSequences:m(i()).optional(),metadata:ee.optional(),tools:m(Yn).optional(),toolChoice:zc.optional()}),jc=te.extend({method:p("sampling/createMessage"),params:Uc}),Zc=oe.extend({model:i(),stopReason:k(z(["endTurn","stopSequence","maxTokens"]).or(i())),role:zt,content:Lc}),Dc=oe.extend({model:i(),stopReason:k(z(["endTurn","stopSequence","maxTokens","toolUse"]).or(i())),role:zt,content:w([Ho,m(Ho)])}),ci=l({type:p("boolean"),title:i().optional(),description:i().optional(),default:T().optional()}),Xn=l({type:p("string"),title:i().optional(),description:i().optional(),minLength:_().optional(),maxLength:_().optional(),format:z(["email","uri","date","date-time"]).optional(),default:i().optional()}),qn=l({type:z(["number","integer"]),title:i().optional(),description:i().optional(),minimum:_().optional(),maximum:_().optional(),default:_().optional()}),li=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),default:i().optional()}),ui=l({type:p("string"),title:i().optional(),description:i().optional(),oneOf:m(l({const:i(),title:i()})),default:i().optional()}),pi=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),enumNames:m(i()).optional(),default:i().optional()}),Hc=w([li,ui]),di=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({type:p("string"),enum:m(i())}),default:m(i()).optional()}),mi=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({anyOf:m(l({const:i(),title:i()}))}),default:m(i()).optional()}),Fc=w([di,mi]),Jc=w([pi,Hc,Fc]),hi=w([Jc,ci,Xn,qn]),es=Go.extend({mode:p("form").optional(),message:i(),requestedSchema:l({type:p("object"),properties:y(i(),hi),required:m(i()).optional()}).catchall(C())}),Vc=Go.extend({mode:p("url"),message:i(),elicitationId:i(),url:i().url()}),Bc=w([es,Vc]),Wc=te.extend({method:p("elicitation/create"),params:Bc}),Gc=be.extend({elicitationId:i()}),Kc=ye.extend({method:p("notifications/elicitation/complete"),params:Gc}),Yc=oe.extend({action:z(["accept","decline","cancel"]),content:Do(e=>e===null?void 0:e,y(i(),w([i(),_(),T(),m(i())])).optional())}),Qc=l({type:p("ref/resource"),uri:i()}),Xc=l({type:p("ref/prompt"),name:i()}),el=me.extend({ref:w([Xc,Qc]),argument:l({name:i(),value:i()}),context:l({arguments:y(i(),i()).optional()}).optional()}),tl=te.extend({method:p("completion/complete"),params:el}),ol=oe.extend({completion:I({values:m(i()).max(100),total:k(_().int()),hasMore:k(T())})}),nl=l({uri:i().startsWith("file://"),name:i().optional(),_meta:y(i(),C()).optional()}),sl=te.extend({method:p("roots/list"),params:me.optional()}),il=oe.extend({roots:m(nl)}),rl=ye.extend({method:p("notifications/roots/list_changed"),params:be.optional()}),uf=I({ttl:_().optional(),pollInterval:_().optional()}),al=z(["working","input_required","completed","failed","cancelled"]),Lt=l({taskId:i(),status:al,ttl:w([_(),Zo()]),createdAt:i(),lastUpdatedAt:i(),pollInterval:k(_()),statusMessage:k(i())}),pf=oe.extend({task:Lt}),cl=be.merge(Lt),df=ye.extend({method:p("notifications/tasks/status"),params:cl}),mf=te.extend({method:p("tasks/get"),params:me.extend({taskId:i()})}),hf=oe.merge(Lt),ff=te.extend({method:p("tasks/result"),params:me.extend({taskId:i()})}),gf=oe.loose(),Sf=xt.extend({method:p("tasks/list")}),_f=Ot.extend({tasks:m(Lt)}),vf=te.extend({method:p("tasks/cancel"),params:me.extend({taskId:i()})}),bf=oe.merge(Lt),yf=w([Ys,La,ja,tl,qc,Sc,hc,Va,Wa,Ya,tc,nc,ic,Ec,Tc]),Rf=w([Gs,Qs,Ua,rl]),wf=w([Vn,Zc,Dc,Yc,il]),Tf=w([Ys,jc,Wc,sl]),Pf=w([Gs,Qs,Nc,pc,Xa,kc,yc,ac,Kc]),Cf=w([Vn,Aa,Za,ol,bc,fc,Ba,Ga,Qa,Qn,Pc,lc]),re=Ls().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Kh.custom,message:"URL must be parseable",fatal:!0}),Su}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Ef=I({resource:i().url(),authorization_servers:m(re).optional(),jwks_uri:i().url().optional(),scopes_supported:m(i()).optional(),bearer_methods_supported:m(i()).optional(),resource_signing_alg_values_supported:m(i()).optional(),resource_name:i().optional(),resource_documentation:i().optional(),resource_policy_uri:i().url().optional(),resource_tos_uri:i().url().optional(),tls_client_certificate_bound_access_tokens:T().optional(),authorization_details_types_supported:m(i()).optional(),dpop_signing_alg_values_supported:m(i()).optional(),dpop_bound_access_tokens_required:T().optional()}),ll=I({issuer:i(),authorization_endpoint:re,token_endpoint:re,registration_endpoint:re.optional(),scopes_supported:m(i()).optional(),response_types_supported:m(i()),response_modes_supported:m(i()).optional(),grant_types_supported:m(i()).optional(),token_endpoint_auth_methods_supported:m(i()).optional(),token_endpoint_auth_signing_alg_values_supported:m(i()).optional(),service_documentation:re.optional(),revocation_endpoint:re.optional(),revocation_endpoint_auth_methods_supported:m(i()).optional(),revocation_endpoint_auth_signing_alg_values_supported:m(i()).optional(),introspection_endpoint:i().optional(),introspection_endpoint_auth_methods_supported:m(i()).optional(),introspection_endpoint_auth_signing_alg_values_supported:m(i()).optional(),code_challenge_methods_supported:m(i()).optional(),client_id_metadata_document_supported:T().optional(),authorization_response_iss_parameter_supported:T().optional().catch(void 0),dpop_signing_alg_values_supported:m(i()).optional()}),ul=I({issuer:i(),authorization_endpoint:re,token_endpoint:re,userinfo_endpoint:re.optional(),jwks_uri:re,registration_endpoint:re.optional(),scopes_supported:m(i()).optional(),response_types_supported:m(i()),response_modes_supported:m(i()).optional(),grant_types_supported:m(i()).optional(),acr_values_supported:m(i()).optional(),subject_types_supported:m(i()),id_token_signing_alg_values_supported:m(i()),id_token_encryption_alg_values_supported:m(i()).optional(),id_token_encryption_enc_values_supported:m(i()).optional(),userinfo_signing_alg_values_supported:m(i()).optional(),userinfo_encryption_alg_values_supported:m(i()).optional(),userinfo_encryption_enc_values_supported:m(i()).optional(),request_object_signing_alg_values_supported:m(i()).optional(),request_object_encryption_alg_values_supported:m(i()).optional(),request_object_encryption_enc_values_supported:m(i()).optional(),token_endpoint_auth_methods_supported:m(i()).optional(),token_endpoint_auth_signing_alg_values_supported:m(i()).optional(),display_values_supported:m(i()).optional(),claim_types_supported:m(i()).optional(),claims_supported:m(i()).optional(),service_documentation:i().optional(),claims_locales_supported:m(i()).optional(),ui_locales_supported:m(i()).optional(),claims_parameter_supported:T().optional(),request_parameter_supported:T().optional(),request_uri_parameter_supported:T().optional(),require_request_uri_registration:T().optional(),op_policy_uri:re.optional(),op_tos_uri:re.optional(),client_id_metadata_document_supported:T().optional(),authorization_response_iss_parameter_supported:T().optional().catch(void 0)}),kf=l({...ul.shape,...ll.pick({code_challenge_methods_supported:!0}).shape}),$f=l({access_token:i(),id_token:i().optional(),token_type:i(),expires_in:Yh().optional(),scope:i().optional(),refresh_token:i().optional()}).strip(),qf=l({issued_token_type:p("urn:ietf:params:oauth:token-type:id-jag"),access_token:i(),token_type:i().optional(),expires_in:_().optional(),scope:i().optional()}).strip(),If=l({error:i(),error_description:i().optional(),error_uri:i().optional()}),Qi=re.optional().or(p("").transform(()=>{})),pl=l({redirect_uris:m(re),token_endpoint_auth_method:i().optional(),grant_types:m(i()).optional(),response_types:m(i()).optional(),application_type:i().optional(),client_name:i().optional(),client_uri:re.optional(),logo_uri:Qi,scope:i().optional(),contacts:m(i()).optional(),tos_uri:Qi,policy_uri:i().optional(),jwks_uri:re.optional(),jwks:Us().optional(),software_id:i().optional(),software_version:i().optional(),software_statement:i().optional()}).strip(),dl=l({client_id:i(),client_secret:i().optional(),client_id_issued_at:_().optional(),client_secret_expires_at:_().optional()}).strip(),Nf=pl.merge(dl),xf=l({error:i(),error_description:i().optional()}).strip(),Of=l({token:i(),token_type_hint:i().optional()}).strip(),bs=Symbol.for("mcp.sdk.errorBrands");function ml(e,t){const o=new Set;let n=t;for(;typeof n=="function";){const s=n.mcpBrand;Object.prototype.hasOwnProperty.call(n,"mcpBrand")&&typeof s=="string"&&o.add(s),n=Object.getPrototypeOf(n)}o.size!==0&&Object.defineProperty(e,bs,{value:o,enumerable:!1,configurable:!0})}function In(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,bs)){const o=t[bs];if(o&&typeof o.has=="function"&&o.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}let de=(function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e})({});var ne=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return In(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return In(this,e)}constructor(e,t,o,n){super(t,n),this.code=e,this.data=o,this.name="SdkError",ml(this,new.target)}};const zf="2026-07-28";function Mf(e){return e>=zf}function hl(e){const t=e.structuredContent;return t===void 0||!(typeof t!="object"||t===null||Array.isArray(t))||(e.content?.some(o=>o.type==="text")??!1)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}const fl=["task","inputRequests","requestState"];function Lf(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||fl.some(t=>t in e)?e:{...e,content:[]}}function Af(){const e=js(()=>w([i(),_(),T(),Zo(),y(i(),e),m(e)])),t=y(i(),e),o=w([i(),_().int()]),n=i(),s=l({ttl:_().optional()}),a=l({taskId:i()}),r=I({progressToken:o.optional(),"io.modelcontextprotocol/related-task":a.optional()}),c=l({_meta:r.optional()}),u=c.extend({task:s.optional()}),d=l({method:i(),params:c.loose().optional()}),h=l({_meta:r.optional()}),S=l({method:i(),params:h.loose().optional()}),v=I({_meta:r.optional()}),f=w([i(),_().int()]),R=v.strict(),P=h.extend({requestId:f.optional(),reason:i().optional()}),b=S.extend({method:p("notifications/cancelled"),params:P}),A=l({src:i(),mimeType:i().optional(),sizes:m(i()).optional(),theme:z(["light","dark"]).optional()}),j=l({icons:m(A).optional()}),x=l({name:i(),title:i().optional()}),N=x.extend({...x.shape,...j.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),$=ot(l({applyDefaults:T().optional()}),t),O=Do(pe=>pe&&typeof pe=="object"&&!Array.isArray(pe)&&Object.keys(pe).length===0?{form:{}}:pe,ot(l({form:$.optional(),url:t.optional()}),t.optional())),G=I({list:t.optional(),cancel:t.optional(),requests:I({sampling:I({createMessage:t.optional()}).optional(),elicitation:I({create:t.optional()}).optional()}).optional()}),se=I({list:t.optional(),cancel:t.optional(),requests:I({tools:I({call:t.optional()}).optional()}).optional()}),ie=l({experimental:y(i(),t).optional(),sampling:l({context:t.optional(),tools:t.optional()}).optional(),elicitation:O.optional(),roots:l({listChanged:T().optional()}).optional(),tasks:G.optional(),extensions:y(i(),t).optional()}),qe=c.extend({protocolVersion:i(),capabilities:ie,clientInfo:N}),q=d.extend({method:p("initialize"),params:qe}),L=l({experimental:y(i(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:l({listChanged:T().optional()}).optional(),resources:l({subscribe:T().optional(),listChanged:T().optional()}).optional(),tools:l({listChanged:T().optional()}).optional(),tasks:se.optional(),extensions:y(i(),t).optional()}),M=v.extend({protocolVersion:i(),capabilities:L,serverInfo:N,instructions:i().optional()}),F=S.extend({method:p("notifications/initialized"),params:h.optional()}),Z=d.extend({method:p("ping"),params:c.optional()}),H=l({progress:_(),total:k(_()),message:k(i())}),Y=l({...h.shape,...H.shape,progressToken:o}),fe=S.extend({method:p("notifications/progress"),params:Y}),ce=c.extend({cursor:n.optional()}),ge=d.extend({params:ce.optional()}),Te=v.extend({nextCursor:n.optional()}),le=l({uri:i(),mimeType:k(i()),_meta:y(i(),C()).optional()}),ct=le.extend({text:i()}),He=i().refine(pe=>{try{return atob(pe),!0}catch{return!1}},{message:"Invalid Base64 string"}),lt=le.extend({blob:He}),Ie=z(["user","assistant"]),Ee=l({audience:m(Ie).optional(),priority:_().min(0).max(1).optional(),lastModified:Bo({offset:!0}).optional()}),Fe=l({...x.shape,...j.shape,uri:i(),description:k(i()),mimeType:k(i()),size:k(_()),annotations:Ee.optional(),_meta:k(I({}))}),At=l({...x.shape,...j.shape,uriTemplate:i(),description:k(i()),mimeType:k(i()),annotations:Ee.optional(),_meta:k(I({}))}),Ut=ge.extend({method:p("resources/list")}),jt=Te.extend({resources:m(Fe)}),ze=ge.extend({method:p("resources/templates/list")}),ut=Te.extend({resourceTemplates:m(At)}),Je=c.extend({uri:i()}),Zt=Je,Dt=d.extend({method:p("resources/read"),params:Zt}),Ht=v.extend({contents:m(w([ct,lt]))}),Ft=S.extend({method:p("notifications/resources/list_changed"),params:h.optional()}),Jt=Je,Vt=d.extend({method:p("resources/subscribe"),params:Jt}),Bt=Je,Wt=d.extend({method:p("resources/unsubscribe"),params:Bt}),Gt=h.extend({uri:i()}),Kt=S.extend({method:p("notifications/resources/updated"),params:Gt}),Yt=l({name:i(),description:k(i()),required:k(T())}),Qt=l({...x.shape,...j.shape,description:k(i()),arguments:k(m(Yt)),_meta:k(I({}))}),Xt=ge.extend({method:p("prompts/list")}),eo=Te.extend({prompts:m(Qt)}),to=c.extend({name:i(),arguments:y(i(),i()).optional()}),oo=d.extend({method:p("prompts/get"),params:to}),Ve=l({type:p("text"),text:i(),annotations:Ee.optional(),_meta:y(i(),C()).optional()}),Be=l({type:p("image"),data:He,mimeType:i(),annotations:Ee.optional(),_meta:y(i(),C()).optional()}),We=l({type:p("audio"),data:He,mimeType:i(),annotations:Ee.optional(),_meta:y(i(),C()).optional()}),no=l({type:p("tool_use"),name:i(),id:i(),input:y(i(),C()),_meta:y(i(),C()).optional()}),Me=l({type:p("resource"),resource:w([ct,lt]),annotations:Ee.optional(),_meta:y(i(),C()).optional()}),so=Fe.extend({type:p("resource_link")}),Pe=w([Ve,Be,We,so,Me]),pt=l({role:Ie,content:Pe}),dt=v.extend({description:i().optional(),messages:m(pt)}),Ge=S.extend({method:p("notifications/prompts/list_changed"),params:h.optional()}),io=l({title:i().optional(),readOnlyHint:T().optional(),destructiveHint:T().optional(),idempotentHint:T().optional(),openWorldHint:T().optional()}),mt=l({taskSupport:z(["required","optional","forbidden"]).optional()}),Ke=l({...x.shape,...j.shape,description:i().optional(),inputSchema:l({type:p("object"),properties:y(i(),e).optional(),required:m(i()).optional()}).catchall(C()),outputSchema:l({type:p("object"),properties:y(i(),e).optional(),required:m(i()).optional()}).catchall(C()).optional(),annotations:io.optional(),execution:mt.optional(),_meta:y(i(),C()).optional()}),ht=ge.extend({method:p("tools/list")}),ft=Te.extend({tools:m(Ke)}),gt=v.extend({content:m(Pe),structuredContent:y(i(),C()).optional(),isError:T().optional()}),ue=u.extend({name:i(),arguments:y(i(),C()).optional()}),ro=d.extend({method:p("tools/call"),params:ue}),Yo=S.extend({method:p("notifications/tools/list_changed"),params:h.optional()}),St=z(["debug","info","notice","warning","error","critical","alert","emergency"]),ao=c.extend({level:St}),co=d.extend({method:p("logging/setLevel"),params:ao}),lo=h.extend({level:St,logger:i().optional(),data:C()}),uo=S.extend({method:p("notifications/message"),params:lo}),po=l({name:i().optional()}),mo=l({hints:m(po).optional(),costPriority:_().min(0).max(1).optional(),speedPriority:_().min(0).max(1).optional(),intelligencePriority:_().min(0).max(1).optional()}),ho=l({mode:z(["auto","required","none"]).optional()}),Qo=l({type:p("tool_result"),toolUseId:i().describe("The unique identifier for the corresponding tool call."),content:m(Pe),structuredContent:l({}).loose().optional(),isError:T().optional(),_meta:y(i(),C()).optional()}),fo=$n("type",[Ve,Be,We]),Le=$n("type",[Ve,Be,We,no,Qo]),go=l({role:Ie,content:w([Le,m(Le)]),_meta:y(i(),C()).optional()}),So=u.extend({messages:m(go),modelPreferences:mo.optional(),systemPrompt:i().optional(),includeContext:z(["none","thisServer","allServers"]).optional(),temperature:_().optional(),maxTokens:_().int(),stopSequences:m(i()).optional(),metadata:t.optional(),tools:m(Ke).optional(),toolChoice:ho.optional()}),_o=d.extend({method:p("sampling/createMessage"),params:So}),vo=v.extend({model:i(),stopReason:k(z(["endTurn","stopSequence","maxTokens"]).or(i())),role:Ie,content:fo}),bo=v.extend({model:i(),stopReason:k(z(["endTurn","stopSequence","maxTokens","toolUse"]).or(i())),role:Ie,content:w([Le,m(Le)])}),yo=l({type:p("boolean"),title:i().optional(),description:i().optional(),default:T().optional()}),Ro=l({type:p("string"),title:i().optional(),description:i().optional(),minLength:_().optional(),maxLength:_().optional(),format:z(["email","uri","date","date-time"]).optional(),default:i().optional()}),wo=l({type:z(["number","integer"]),title:i().optional(),description:i().optional(),minimum:_().optional(),maximum:_().optional(),default:_().optional()}),To=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),default:i().optional()}),Po=l({type:p("string"),title:i().optional(),description:i().optional(),oneOf:m(l({const:i(),title:i()})),default:i().optional()}),Co=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),enumNames:m(i()).optional(),default:i().optional()}),Eo=w([To,Po]),Ye=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({type:p("string"),enum:m(i())}),default:m(i()).optional()}),Qe=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({anyOf:m(l({const:i(),title:i()}))}),default:m(i()).optional()}),Xo=w([Ye,Qe]),en=w([Co,Eo,Xo]),Re=w([en,yo,Ro,wo]),we=u.extend({mode:p("form").optional(),message:i(),requestedSchema:l({type:p("object"),properties:y(i(),Re),required:m(i()).optional()}).catchall(C())}),ko=u.extend({mode:p("url"),message:i(),elicitationId:i(),url:i().url()}),ke=w([we,ko]),tn=d.extend({method:p("elicitation/create"),params:ke}),on=h.extend({elicitationId:i()}),nn=S.extend({method:p("notifications/elicitation/complete"),params:on}),sn=v.extend({action:z(["accept","decline","cancel"]),content:Do(pe=>pe===null?void 0:pe,y(i(),w([i(),_(),T(),m(i())])).optional())}),rn=l({type:p("ref/resource"),uri:i()}),an=l({type:p("ref/prompt"),name:i()}),cn=c.extend({ref:w([an,rn]),argument:l({name:i(),value:i()}),context:l({arguments:y(i(),i()).optional()}).optional()}),$o=d.extend({method:p("completion/complete"),params:cn}),ln=v.extend({completion:I({values:m(i()).max(100),total:k(_().int()),hasMore:k(T())})}),un=l({uri:i().startsWith("file://"),name:i().optional(),_meta:y(i(),C()).optional()}),_t=d.extend({method:p("roots/list"),params:c.optional()}),qo=v.extend({roots:m(un)}),pn=S.extend({method:p("notifications/roots/list_changed"),params:h.optional()}),dn=I({ttl:_().optional(),pollInterval:_().optional()}),mn=z(["working","input_required","completed","failed","cancelled"]),Ae=l({taskId:i(),status:mn,ttl:w([_(),Zo()]),createdAt:i(),lastUpdatedAt:i(),pollInterval:k(_()),statusMessage:k(i())}),Se=v.extend({task:Ae}),hn=h.merge(Ae),Xe=S.extend({method:p("notifications/tasks/status"),params:hn}),vt=d.extend({method:p("tasks/get"),params:c.extend({taskId:i()})}),bt=v.merge(Ae),yt=d.extend({method:p("tasks/result"),params:c.extend({taskId:i()})}),os=v.loose(),_e=ge.extend({method:p("tasks/list")}),Q=Te.extend({tasks:m(Ae)}),et=d.extend({method:p("tasks/cancel"),params:c.extend({taskId:i()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:n,TaskMetadataSchema:s,RelatedTaskMetadataSchema:a,RequestMetaSchema:r,BaseRequestParamsSchema:c,TaskAugmentedRequestParamsSchema:u,RequestSchema:d,NotificationsParamsSchema:h,NotificationSchema:S,ResultSchema:v,RequestIdSchema:f,EmptyResultSchema:R,CancelledNotificationParamsSchema:P,CancelledNotificationSchema:b,IconSchema:A,IconsSchema:j,BaseMetadataSchema:x,ImplementationSchema:N,ClientTasksCapabilitySchema:G,ServerTasksCapabilitySchema:se,ClientCapabilitiesSchema:ie,InitializeRequestParamsSchema:qe,InitializeRequestSchema:q,ServerCapabilitiesSchema:L,InitializeResultSchema:M,InitializedNotificationSchema:F,PingRequestSchema:Z,ProgressSchema:H,ProgressNotificationParamsSchema:Y,ProgressNotificationSchema:fe,PaginatedRequestParamsSchema:ce,PaginatedRequestSchema:ge,PaginatedResultSchema:Te,ResourceContentsSchema:le,TextResourceContentsSchema:ct,BlobResourceContentsSchema:lt,RoleSchema:Ie,AnnotationsSchema:Ee,ResourceSchema:Fe,ResourceTemplateSchema:At,ListResourcesRequestSchema:Ut,ListResourcesResultSchema:jt,ListResourceTemplatesRequestSchema:ze,ListResourceTemplatesResultSchema:ut,ResourceRequestParamsSchema:Je,ReadResourceRequestParamsSchema:Zt,ReadResourceRequestSchema:Dt,ReadResourceResultSchema:Ht,ResourceListChangedNotificationSchema:Ft,SubscribeRequestParamsSchema:Jt,SubscribeRequestSchema:Vt,UnsubscribeRequestParamsSchema:Bt,UnsubscribeRequestSchema:Wt,ResourceUpdatedNotificationParamsSchema:Gt,ResourceUpdatedNotificationSchema:Kt,PromptArgumentSchema:Yt,PromptSchema:Qt,ListPromptsRequestSchema:Xt,ListPromptsResultSchema:eo,GetPromptRequestParamsSchema:to,GetPromptRequestSchema:oo,TextContentSchema:Ve,ImageContentSchema:Be,AudioContentSchema:We,ToolUseContentSchema:no,EmbeddedResourceSchema:Me,ResourceLinkSchema:so,ContentBlockSchema:Pe,PromptMessageSchema:pt,GetPromptResultSchema:dt,PromptListChangedNotificationSchema:Ge,ToolAnnotationsSchema:io,ToolExecutionSchema:mt,ToolSchema:Ke,ListToolsRequestSchema:ht,ListToolsResultSchema:ft,CallToolResultSchema:gt,CallToolRequestParamsSchema:ue,CallToolRequestSchema:ro,ToolListChangedNotificationSchema:Yo,LoggingLevelSchema:St,SetLevelRequestParamsSchema:ao,SetLevelRequestSchema:co,LoggingMessageNotificationParamsSchema:lo,LoggingMessageNotificationSchema:uo,ModelHintSchema:po,ModelPreferencesSchema:mo,ToolChoiceSchema:ho,ToolResultContentSchema:Qo,SamplingContentSchema:fo,SamplingMessageContentBlockSchema:Le,SamplingMessageSchema:go,CreateMessageRequestParamsSchema:So,CreateMessageRequestSchema:_o,CreateMessageResultSchema:vo,CreateMessageResultWithToolsSchema:bo,BooleanSchemaSchema:yo,StringSchemaSchema:Ro,NumberSchemaSchema:wo,UntitledSingleSelectEnumSchemaSchema:To,TitledSingleSelectEnumSchemaSchema:Po,LegacyTitledEnumSchemaSchema:Co,SingleSelectEnumSchemaSchema:Eo,UntitledMultiSelectEnumSchemaSchema:Ye,TitledMultiSelectEnumSchemaSchema:Qe,MultiSelectEnumSchemaSchema:Xo,EnumSchemaSchema:en,PrimitiveSchemaDefinitionSchema:Re,ElicitRequestFormParamsSchema:we,ElicitRequestURLParamsSchema:ko,ElicitRequestParamsSchema:ke,ElicitRequestSchema:tn,ElicitationCompleteNotificationParamsSchema:on,ElicitationCompleteNotificationSchema:nn,ElicitResultSchema:sn,ResourceTemplateReferenceSchema:rn,PromptReferenceSchema:an,CompleteRequestParamsSchema:cn,CompleteRequestSchema:$o,CompleteResultSchema:ln,RootSchema:un,ListRootsRequestSchema:_t,ListRootsResultSchema:qo,RootsListChangedNotificationSchema:pn,TaskCreationParamsSchema:dn,TaskStatusSchema:mn,TaskSchema:Ae,CreateTaskResultSchema:Se,TaskStatusNotificationParamsSchema:hn,TaskStatusNotificationSchema:Xe,GetTaskRequestSchema:vt,GetTaskResultSchema:bt,GetTaskPayloadRequestSchema:yt,GetTaskPayloadResultSchema:os,ListTasksRequestSchema:_e,ListTasksResultSchema:Q,CancelTaskRequestSchema:et,CancelTaskResultSchema:v.merge(Ae),ClientRequestSchema:w([Z,q,$o,co,oo,Xt,Ut,ze,Dt,Vt,Wt,ro,ht,vt,yt,_e,et]),ClientNotificationSchema:w([b,fe,F,pn,Xe]),ClientResultSchema:w([R,vo,bo,sn,qo,bt,Q,Se]),ServerRequestSchema:w([Z,_o,tn,_t,vt,yt,_e,et]),ServerNotificationSchema:w([b,fe,uo,Kt,Ft,Yo,Ge,Xe,nn]),ServerResultSchema:w([R,M,ln,dt,eo,jt,ut,Ht,gt,ft,bt,Q,Se]),CallToolResultWireSchema:C().superRefine((pe,Gl)=>{if(!(typeof pe!="object"||pe===null||Array.isArray(pe)||pe.content!==void 0)){for(const Ti of fl)if(Ti in pe){Gl.addIssue({code:"custom",message:`content is required when the body carries '${Ti}' — another result family cannot default into an empty tools/call success`});return}}}).transform(Lf).pipe(gt)}}let Uf;function gl(){return Uf??=Af()}function Sl(e){return e.type!=="object"}const jf=new Set(["const","enum","default","examples"]),Zf=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Xi(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Df(e){const t=typeof e.$schema=="string"?e.$schema:void 0;if(Xi(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};const o=gu(e.$schema)&&e.$recursiveAnchor!==!0,n=(s,a)=>{if(Array.isArray(s))return s.map(u=>n(u,!1));if(s===null||typeof s!="object"||!a&&Xi(s.$id))return s;const r={};let c=!1;for(const[u,d]of Object.entries(s))a?r[u]=n(d,!1):(u==="$ref"||u==="$dynamicRef")&&typeof d=="string"?r[u]=d==="#"?"#/properties/result":d.startsWith("#/")?`#/properties/result${d.slice(1)}`:d:u==="$recursiveRef"&&d==="#"&&o?c=!0:jf.has(u)?r[u]=d:Zf.has(u)?r[u]=n(d,!0):r[u]=n(d,!1);return c&&("$ref"in r?r.allOf=[...Array.isArray(r.allOf)?r.allOf:[],{$ref:"#/properties/result"}]:r.$ref="#/properties/result"),r};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:n(e,!1)},required:["result"]}}const Hf={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ff={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Jf={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};let _n;function fi(){if(_n)return _n;const e=gl();return _n={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},_n}function _l(e){return Object.prototype.hasOwnProperty.call(Hf,e)}function vl(e){return Object.prototype.hasOwnProperty.call(Ff,e)}function Vf(e){return Object.prototype.hasOwnProperty.call(Jf,e)}function Bf(e){return Vf(e)?fi().resultSchemas[e]:void 0}function Wf(e){return _l(e)?fi().requestSchemas[e]:void 0}function Gf(e){return vl(e)?fi().notificationSchemas[e]:void 0}function ys(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function vn(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};const o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}const er={ok:!1,reason:"not-in-era"};function tr(e){return ys(e)&&ys(e.outputSchema)&&Sl(e.outputSchema)}const gi={era:"2025-11-25",hasRequestMethod:_l,hasNotificationMethod:vl,validateRequest:(e,t)=>vn(Wf(e),t),validateResult:(e,t)=>vn(Bf(e),t),validateNotification:(e,t)=>vn(Gf(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>er,validateInputResponse:()=>er,samplingResultVariant:((e,t)=>{const o=gl();return vn(e?o.CreateMessageResultWithToolsSchema:o.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){const o=hl(e),n=o.structuredContent;if(n===void 0)return o;const s=typeof n!="object"||n===null||Array.isArray(n),a=t!==void 0&&Sl(t);return!s&&!a?o:{...o,structuredContent:{result:n}}},decodeResult(e,t){if(ys(t)&&"resultType"in t){const o={...t};return delete o.resultType,{kind:"complete",result:o}}return{kind:"complete",result:t}},encodeResult(e,t){if(e!=="tools/list")return t;const o=t.tools;return!Array.isArray(o)||!o.some(n=>tr(n))?t:{...t,tools:o.map(n=>tr(n)?{...n,outputSchema:Df(n.outputSchema)}:n)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function Kf(){const e=js(()=>w([i(),_(),T(),Zo(),y(i(),e),m(e)])),t=y(i(),e),o=w([i(),_().int()]),n=i(),s=w([i(),_().int()]),a=z(["user","assistant"]),r=z(["debug","info","notice","warning","error","critical","alert","emergency"]),c=i().refine(Q=>{try{return atob(Q),!0}catch{return!1}},{message:"Invalid Base64 string"}),u=l({ttl:_().optional()}),d=l({taskId:i()}),h=I({progressToken:o.optional(),"io.modelcontextprotocol/related-task":d.optional()}),S=l({_meta:h.optional()}),v=S.extend({task:u.optional()}),f=l({_meta:h.optional()}),R=l({method:i(),params:f.loose().optional()}),P=l({src:i(),mimeType:i().optional(),sizes:m(i()).optional(),theme:z(["light","dark"]).optional()}),b=l({icons:m(P).optional()}),A=l({name:i(),title:i().optional()}),j=A.extend({...A.shape,...b.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),x=ot(l({applyDefaults:T().optional()}),t),N=Do(Q=>Q&&typeof Q=="object"&&!Array.isArray(Q)&&Object.keys(Q).length===0?{form:{}}:Q,ot(l({form:x.optional(),url:t.optional()}),t.optional())),$=I({list:t.optional(),cancel:t.optional(),requests:I({sampling:I({createMessage:t.optional()}).optional(),elicitation:I({create:t.optional()}).optional()}).optional()}),O=I({list:t.optional(),cancel:t.optional(),requests:I({tools:I({call:t.optional()}).optional()}).optional()}),G=l({experimental:y(i(),t).optional(),sampling:l({context:t.optional(),tools:t.optional()}).optional(),elicitation:N.optional(),roots:l({listChanged:T().optional()}).optional(),tasks:$.optional(),extensions:y(i(),t).optional()}),se=l({experimental:y(i(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:l({listChanged:T().optional()}).optional(),resources:l({subscribe:T().optional(),listChanged:T().optional()}).optional(),tools:l({listChanged:T().optional()}).optional(),tasks:O.optional(),extensions:y(i(),t).optional()}),ie=l({progress:_(),total:k(_()),message:k(i())}),qe=l({...f.shape,...ie.shape,progressToken:o}),q=R.extend({method:p("notifications/progress"),params:qe}),L=f.extend({level:r,logger:i().optional(),data:C()}),M=R.extend({method:p("notifications/message"),params:L}),F=l({uri:i(),mimeType:k(i()),_meta:y(i(),C()).optional()}),Z=F.extend({text:i()}),H=F.extend({blob:c}),Y=l({audience:m(a).optional(),priority:_().min(0).max(1).optional(),lastModified:Bo({offset:!0}).optional()}),fe=l({...A.shape,...b.shape,uri:i(),description:k(i()),mimeType:k(i()),size:k(_()),annotations:Y.optional(),_meta:k(I({}))}),ce=l({...A.shape,...b.shape,uriTemplate:i(),description:k(i()),mimeType:k(i()),annotations:Y.optional(),_meta:k(I({}))}),ge=R.extend({method:p("notifications/resources/list_changed"),params:f.optional()}),Te=f.extend({uri:i()}),le=R.extend({method:p("notifications/resources/updated"),params:Te}),ct=l({name:i(),description:k(i()),required:k(T())}),He=l({...A.shape,...b.shape,description:k(i()),arguments:k(m(ct)),_meta:k(I({}))}),lt=R.extend({method:p("notifications/prompts/list_changed"),params:f.optional()}),Ie=l({type:p("text"),text:i(),annotations:Y.optional(),_meta:y(i(),C()).optional()}),Ee=l({type:p("image"),data:c,mimeType:i(),annotations:Y.optional(),_meta:y(i(),C()).optional()}),Fe=l({type:p("audio"),data:c,mimeType:i(),annotations:Y.optional(),_meta:y(i(),C()).optional()}),At=l({type:p("tool_use"),name:i(),id:i(),input:y(i(),C()),_meta:y(i(),C()).optional()}),Ut=l({type:p("resource"),resource:w([Z,H]),annotations:Y.optional(),_meta:y(i(),C()).optional()}),jt=fe.extend({type:p("resource_link")}),ze=w([Ie,Ee,Fe,jt,Ut]),ut=l({role:a,content:ze}),Je=l({title:i().optional(),readOnlyHint:T().optional(),destructiveHint:T().optional(),idempotentHint:T().optional(),openWorldHint:T().optional()}),Zt=R.extend({method:p("notifications/tools/list_changed"),params:f.optional()}),Dt=l({name:i().optional()}),Ht=l({hints:m(Dt).optional(),costPriority:_().min(0).max(1).optional(),speedPriority:_().min(0).max(1).optional(),intelligencePriority:_().min(0).max(1).optional()}),Ft=l({mode:z(["auto","required","none"]).optional()}),Jt=l({type:p("boolean"),title:i().optional(),description:i().optional(),default:T().optional()}),Vt=l({type:p("string"),title:i().optional(),description:i().optional(),minLength:_().optional(),maxLength:_().optional(),format:z(["email","uri","date","date-time"]).optional(),default:i().optional()}),Bt=l({type:z(["number","integer"]),title:i().optional(),description:i().optional(),minimum:_().optional(),maximum:_().optional(),default:_().optional()}),Wt=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),default:i().optional()}),Gt=l({type:p("string"),title:i().optional(),description:i().optional(),oneOf:m(l({const:i(),title:i()})),default:i().optional()}),Kt=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),enumNames:m(i()).optional(),default:i().optional()}),Yt=w([Wt,Gt]),Qt=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({type:p("string"),enum:m(i())}),default:m(i()).optional()}),Xt=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({anyOf:m(l({const:i(),title:i()}))}),default:m(i()).optional()}),eo=w([Qt,Xt]),to=w([Kt,Yt,eo]),oo=w([to,Jt,Vt,Bt]),Ve=v.extend({mode:p("form").optional(),message:i(),requestedSchema:l({type:p("object"),properties:y(i(),oo),required:m(i()).optional()}).catchall(C())}),Be=l({type:p("ref/resource"),uri:i()}),We=l({type:p("ref/prompt"),name:i()}),no=l({uri:i().startsWith("file://"),name:i().optional(),_meta:y(i(),C()).optional()}),Me=G.shape,so=l({experimental:Me.experimental,sampling:Me.sampling,elicitation:Me.elicitation,roots:Me.roots,extensions:Me.extensions}),Pe=se.shape,pt=l({experimental:Pe.experimental,logging:Pe.logging,completions:Pe.completions,prompts:Pe.prompts,resources:Pe.resources,tools:Pe.tools,extensions:Pe.extensions}),dt=I({progressToken:o.optional(),[Zn]:i(),[Zs]:j.optional(),[Dn]:so,[Ds]:r.optional()}),Ge=l({...A.shape,...b.shape,description:i().optional(),inputSchema:I({$schema:i().optional(),type:p("object")}),outputSchema:I({$schema:i().optional()}).optional(),annotations:Je.optional(),_meta:y(i(),C()).optional()}),io=l({type:p("tool_result"),toolUseId:i(),content:m(ze),structuredContent:C().optional(),isError:T().optional(),_meta:y(i(),C()).optional()}),mt=w([Ie,Ee,Fe,At,io]),Ke=l({role:a,content:w([mt,m(mt)]),_meta:y(i(),C()).optional()}),ht=i(),ft=I({[Oo]:j.optional().catch(void 0)}),gt=ft.optional();function ue(Q){return I({_meta:gt,resultType:ht.default("complete"),...Q})}const ro=ue({}),Yo=ue({nextCursor:n.optional()}),St=ue({content:m(ze),structuredContent:C().optional(),isError:T().optional()}),ao=ue({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),tools:m(Ge),nextCursor:n.optional()}),co=ue({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),prompts:m(He),nextCursor:n.optional()}),lo=ue({description:i().optional(),messages:m(ut)}),uo=ue({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),resources:m(fe),nextCursor:n.optional()}),po=ue({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),resourceTemplates:m(ce),nextCursor:n.optional()}),mo=ue({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),contents:m(w([Z,H]))}),ho=ue({completion:l({values:m(i()).max(100),total:_().int().optional(),hasMore:T().optional()}).loose()}),Qo=ue({ttlMs:_().int().min(0),cacheScope:z(["public","private"])}),fo=ue({ttlMs:_().int().min(0).catch(0),cacheScope:z(["public","private"]).catch("private"),supportedVersions:m(i()),capabilities:pt,instructions:i().optional()}),Le=l({messages:m(Ke),modelPreferences:Ht.optional(),systemPrompt:i().optional(),includeContext:z(["none","thisServer","allServers"]).optional(),temperature:_().optional(),maxTokens:_().int(),stopSequences:m(i()).optional(),metadata:t.optional(),tools:m(Ge).optional(),toolChoice:Ft.optional()}),go=l({method:p("sampling/createMessage"),params:Le}),So=l({method:p("roots/list"),params:l({_meta:y(i(),C()).optional()}).optional()}),_o=l({...Ke.shape,model:i(),stopReason:i().optional()}),vo=l({roots:m(no)}),bo=l({action:z(["accept","decline","cancel"]),content:y(i(),w([i(),_(),T(),m(i())])).optional()}),yo=l({mode:p("url"),message:i(),url:i().url()}),Ro=w([Ve,yo]),wo=l({method:p("elicitation/create"),params:Ro}),To=w([go,So,wo]),Po=w([_o,vo,bo]),Co=y(i(),To),Eo=y(i(),Po),Ye=ue({inputRequests:Co.optional(),requestState:i().optional()}),Qe={inputResponses:Eo.optional(),requestState:i().optional()},Xo=l({_meta:dt,...Qe}),en=I({progressToken:o.optional()});function Re(Q,et){return l({method:p(Q),params:l({_meta:dt,...et})})}function we(Q,et){return l({method:p(Q),params:l({_meta:en.optional(),...et}).optional()})}const ko={name:i(),arguments:y(i(),C()).optional(),...Qe},ke={cursor:n.optional()},tn=Re("tools/call",ko),on=Re("tools/list",ke),nn=Re("prompts/list",ke),sn=Re("prompts/get",{name:i(),arguments:y(i(),i()).optional(),...Qe}),rn=Re("resources/list",ke),an=Re("resources/templates/list",ke),cn=Re("resources/read",{uri:i(),...Qe}),$o={ref:w([We,Be]),argument:l({name:i(),value:i()}),context:l({arguments:y(i(),i()).optional()}).optional()},ln=Re("completion/complete",$o),un=Re("server/discover",{}),_t=l({toolsListChanged:T().optional(),promptsListChanged:T().optional(),resourcesListChanged:T().optional(),resourceSubscriptions:m(i()).optional()}),qo={notifications:_t},pn=Re("subscriptions/listen",qo),dn=ft.extend({"io.modelcontextprotocol/subscriptionId":s}),mn=I({_meta:dn,resultType:ht.default("complete")}),Ae={"tools/call":we("tools/call",ko),"tools/list":we("tools/list",ke),"prompts/get":we("prompts/get",{name:i(),arguments:y(i(),i()).optional()}),"prompts/list":we("prompts/list",ke),"resources/list":we("resources/list",ke),"resources/templates/list":we("resources/templates/list",ke),"resources/read":we("resources/read",{uri:i()}),"completion/complete":we("completion/complete",$o),"server/discover":we("server/discover",{}),"subscriptions/listen":we("subscriptions/listen",qo)};function Se(Q){return I({_meta:gt,...Q})}const hn={"tools/call":Se({content:m(ze),structuredContent:C().optional(),isError:T().optional()}),"tools/list":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),tools:m(Ge),nextCursor:n.optional()}),"prompts/get":Se({description:i().optional(),messages:m(ut)}),"prompts/list":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),prompts:m(He),nextCursor:n.optional()}),"resources/list":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),resources:m(fe),nextCursor:n.optional()}),"resources/templates/list":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),resourceTemplates:m(ce),nextCursor:n.optional()}),"resources/read":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),contents:m(w([Z,H]))}),"completion/complete":Se({completion:l({values:m(i()).max(100),total:_().int().optional(),hasMore:T().optional()}).loose()}),"server/discover":Se({ttlMs:_().int().min(0).catch(0),cacheScope:z(["public","private"]).catch("private"),supportedVersions:m(i()),capabilities:pt,instructions:i().optional()}),"subscriptions/listen":Se({})},Xe=I({"io.modelcontextprotocol/subscriptionId":s.optional()}),vt=l({method:p("notifications/subscriptions/acknowledged"),params:l({_meta:Xe.optional(),notifications:_t})}),bt=l({_meta:Xe.optional(),requestId:s,reason:i().optional()}),yt=l({method:p("notifications/cancelled"),params:bt}),os={"notifications/cancelled":yt,"notifications/progress":q,"notifications/message":M,"notifications/resources/updated":le,"notifications/resources/list_changed":ge,"notifications/tools/list_changed":Zt,"notifications/prompts/list_changed":lt,"notifications/subscriptions/acknowledged":vt},_e=Q=>l({jsonrpc:p("2.0"),id:w([i(),_().int()]),result:Q}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:n,RequestIdSchema:s,RoleSchema:a,LoggingLevelSchema:r,TaskMetadataSchema:u,RelatedTaskMetadataSchema:d,RequestMetaSchema:h,BaseRequestParamsSchema:S,TaskAugmentedRequestParamsSchema:v,NotificationsParamsSchema:f,NotificationSchema:R,IconSchema:P,IconsSchema:b,BaseMetadataSchema:A,ImplementationSchema:j,ClientTasksCapabilitySchema:$,ServerTasksCapabilitySchema:O,ClientCapabilitiesSchema:G,ServerCapabilitiesSchema:se,ProgressSchema:ie,ProgressNotificationParamsSchema:qe,ProgressNotificationSchema:q,LoggingMessageNotificationParamsSchema:L,LoggingMessageNotificationSchema:M,ResourceContentsSchema:F,TextResourceContentsSchema:Z,BlobResourceContentsSchema:H,AnnotationsSchema:Y,ResourceSchema:fe,ResourceTemplateSchema:ce,ResourceListChangedNotificationSchema:ge,ResourceUpdatedNotificationParamsSchema:Te,ResourceUpdatedNotificationSchema:le,PromptArgumentSchema:ct,PromptSchema:He,PromptListChangedNotificationSchema:lt,TextContentSchema:Ie,ImageContentSchema:Ee,AudioContentSchema:Fe,ToolUseContentSchema:At,EmbeddedResourceSchema:Ut,ResourceLinkSchema:jt,ContentBlockSchema:ze,PromptMessageSchema:ut,ToolAnnotationsSchema:Je,ToolListChangedNotificationSchema:Zt,ModelHintSchema:Dt,ModelPreferencesSchema:Ht,ToolChoiceSchema:Ft,BooleanSchemaSchema:Jt,StringSchemaSchema:Vt,NumberSchemaSchema:Bt,UntitledSingleSelectEnumSchemaSchema:Wt,TitledSingleSelectEnumSchemaSchema:Gt,LegacyTitledEnumSchemaSchema:Kt,SingleSelectEnumSchemaSchema:Yt,UntitledMultiSelectEnumSchemaSchema:Qt,TitledMultiSelectEnumSchemaSchema:Xt,MultiSelectEnumSchemaSchema:eo,EnumSchemaSchema:to,PrimitiveSchemaDefinitionSchema:oo,ElicitRequestFormParamsSchema:Ve,ResourceTemplateReferenceSchema:Be,PromptReferenceSchema:We,RootSchema:no,ClientCapabilities2026Schema:so,ServerCapabilities2026Schema:pt,RequestMetaEnvelopeSchema:dt,ToolSchema:Ge,ToolResultContentSchema:io,SamplingMessageContentBlockSchema:mt,SamplingMessageSchema:Ke,ResultTypeSchema:ht,ResultMetaSchema:ft,ResultSchema:ro,PaginatedResultSchema:Yo,CallToolResultSchema:St,ListToolsResultSchema:ao,ListPromptsResultSchema:co,GetPromptResultSchema:lo,ListResourcesResultSchema:uo,ListResourceTemplatesResultSchema:po,ReadResourceResultSchema:mo,CompleteResultSchema:ho,CacheableResultSchema:Qo,DiscoverResultSchema:fo,CreateMessageRequestParamsSchema:Le,CreateMessageRequestSchema:go,ListRootsRequestSchema:So,CreateMessageResultSchema:_o,ListRootsResultSchema:vo,ElicitResultSchema:bo,ElicitRequestURLParamsSchema:yo,ElicitRequestParamsSchema:Ro,ElicitRequestSchema:wo,InputRequestSchema:To,InputResponseSchema:Po,InputRequestsSchema:Co,InputResponsesSchema:Eo,InputRequiredResultSchema:Ye,InputResponseRequestParamsSchema:Xo,CallToolRequestSchema:tn,ListToolsRequestSchema:on,ListPromptsRequestSchema:nn,GetPromptRequestSchema:sn,ListResourcesRequestSchema:rn,ListResourceTemplatesRequestSchema:an,ReadResourceRequestSchema:cn,CompleteRequestSchema:ln,DiscoverRequestSchema:un,SubscriptionFilterSchema:_t,SubscriptionsListenRequestSchema:pn,SubscriptionsListenResultMetaSchema:dn,SubscriptionsListenResultSchema:mn,dispatchRequestSchemas:Ae,dispatchResultSchemas:hn,NotificationMetaSchema:Xe,SubscriptionsAcknowledgedNotificationSchema:vt,CancelledNotificationParamsSchema:bt,CancelledNotificationSchema:yt,notificationSchemas2026:os,JSONRPCResultResponseSchema:_e(ro),CallToolResultResponseSchema:_e(w([St,Ye])),ListToolsResultResponseSchema:_e(ao),ListPromptsResultResponseSchema:_e(co),GetPromptResultResponseSchema:_e(w([lo,Ye])),ListResourcesResultResponseSchema:_e(uo),ListResourceTemplatesResultResponseSchema:_e(po),ReadResourceResultResponseSchema:_e(w([mo,Ye])),CompleteResultResponseSchema:_e(ho),DiscoverResultResponseSchema:_e(fo)}}let Yf;function st(){return Yf??=Kf()}const Qf=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Xf(e){return Qf.includes(e)}const Si=Symbol("modelcontextprotocol.resultCacheHintFallback");function eg(e){return e[Si]}function bl(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function yl(e){return e==="public"||e==="private"}let U=(function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e})({});var ae=class Rl extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return In(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return In(this,t)}constructor(t,o,n){super(o),this.code=t,this.data=n,this.name="ProtocolError",ml(this,new.target)}static fromError(t,o,n){if(t===U.UrlElicitationRequired&&n){const s=n;if(s.elicitations)return new og(s.elicitations,o)}if(t===U.UnsupportedProtocolVersion&&n){const s=n;if(Array.isArray(s.supported)&&typeof s.requested=="string")return new ng({supported:s.supported,requested:s.requested},o)}if(t===U.InvalidParams||t===U.ResourceNotFound){const s=n;if(typeof s?.uri=="string"&&(t===U.ResourceNotFound||Object.keys(s).length===1))return new tg(s.uri,o)}if(t===U.MissingRequiredClientCapability&&n){const s=n;if(s.requiredCapabilities!==null&&typeof s.requiredCapabilities=="object"&&!Array.isArray(s.requiredCapabilities))return new sg({requiredCapabilities:s.requiredCapabilities},o)}return new Rl(t,o,n)}},tg=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(U.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},og=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(U.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},ng=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(U.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},sg=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(U.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};const ig=0,rg="private",ag=["tools/call","prompts/get","resources/read"];function cg(e,t){const o=t.resultType;if(o===void 0)return{...t,resultType:"complete"};if(o==="complete"||ag.includes(e))return t;throw new ae(U.InternalError,`Handler for ${e} returned resultType '${String(o)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function lg(e,t){const o=eg(t);if(t.resultType!=="complete"||!Xf(e))return o===void 0?t:hg(t);const n=t,s=bl(n.ttlMs)?n.ttlMs:dg(o),a=yl(n.cacheScope)?n.cacheScope:mg(o),r={...n,ttlMs:s,cacheScope:a};return delete r[Si],r}function ug(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function pg(e,t){if(t===void 0)return e;const o=e._meta;return o===void 0?{...e,_meta:{[Oo]:t}}:!ug(o)||o[Oo]!==void 0?e:{...e,_meta:{...o,[Oo]:t}}}function dg(e){return e!==void 0&&bl(e.ttlMs)?e.ttlMs:ig}function mg(e){return e!==void 0&&yl(e.cacheScope)?e.cacheScope:rg}function hg(e){const t={...e};return delete t[Si],t}const fg=["elicitation/create","sampling/createMessage","roots/list"];let bn;function wl(){if(bn)return bn;const e=st();return bn={request:{"elicitation/create":l({method:p("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":l({method:p("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":l({method:p("roots/list"),params:I({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},bn}function Tl(e){return fg.includes(e)}function as(e){return Tl(e)?wl().request[e]:void 0}function gg(e){return Tl(e)?wl().response[e]:void 0}const Pl={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},Sg={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function Cl(e){return Object.prototype.hasOwnProperty.call(Pl,e)}function El(e){return Object.prototype.hasOwnProperty.call(Sg,e)}function _g(e){return Object.prototype.hasOwnProperty.call(Pl,e)}function vg(e){return Cl(e)?st().dispatchRequestSchemas[e]:void 0}function bg(e){return _g(e)?st().dispatchResultSchemas[e]:void 0}function yg(e){return El(e)?st().notificationSchemas2026[e]:void 0}function zo(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Io(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};const o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}const Rg={ok:!1,reason:"not-in-era"},wg=[Zn,Dn];function Tg(e,t){let o=t,n=!1;const s=()=>(n||(o={...o},n=!0),o),a=t.tools;e==="tools/list"&&Array.isArray(a)&&a.some(c=>zo(c)&&"execution"in c)&&(s().tools=a.map(c=>{if(!zo(c)||!("execution"in c))return c;const u={...c};return delete u.execution,u}));const r=t.capabilities;if(zo(r)&&"tasks"in r){const c={...r};delete c.tasks,s().capabilities=c}return o}const _i={era:"2026-07-28",hasRequestMethod:Cl,hasNotificationMethod:El,hasInputRequestMethod:e=>as(e)!==void 0,validateRequest:(e,t)=>Io(vg(e),t),validateResult:(e,t)=>Io(bg(e),t),validateNotification:(e,t)=>Io(yg(e),t),validateInputRequest:(e,t)=>Io(as(e),t),validateInputResponse:(e,t)=>Io(gg(e),t),samplingResultVariant:()=>Rg,outboundEnvelope(e){return{[Zn]:e.protocolVersion,[Zs]:e.clientInfo,[Dn]:e.clientCapabilities,...e.logLevel!==void 0&&{[Ds]:e.logLevel}}},validateEnvelopeMeta(e){const t=[];for(const n of wg)n in e||t.push({key:n,problem:"missing"});const o=st().RequestMetaEnvelopeSchema.safeParse(e);if(!o.success)for(const n of o.error.issues){const s=n.path.map(String),a=s.length>0?s.join("."):"_meta";s.length===1&&t.some(r=>r.key===a&&r.problem==="missing")||t.push({key:a,problem:n.message})}return t},projectCallToolResult:e=>hl(e),inputRequestSchema:as,decodeResult(e,t){if(!zo(t))return{kind:"invalid",error:new ne(de.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};const o=t.resultType;if(o===void 0)return{kind:"invalid",error:new ne(de.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof o!="string")return{kind:"invalid",error:new ne(de.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:o})};if(o==="input_required"){const r=t.inputRequests,c=zo(r)?r:{},u=t.requestState;return Object.keys(c).length===0&&typeof u!="string"?{kind:"invalid",error:new ne(de.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:c,...typeof u=="string"&&{requestState:u}}}if(o!=="complete")return{kind:"invalid",error:new ne(de.UnsupportedResultType,`Unsupported result type '${o}' for ${e}`,{resultType:o,method:e})};const n=Pg(),s=Object.hasOwn(n,e)?n[e]:void 0;if(s!==void 0){const r=s.safeParse(t);if(!r.success)return{kind:"invalid",error:new ne(de.InvalidResult,`Invalid result for ${e}: ${r.error}`,{method:e})}}const a={...t};return delete a.resultType,{kind:"complete",result:a}},encodeResult(e,t,o){return pg(lg(e,cg(e,Tg(e,t))),o)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";const t=st().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(o=>o.message).join("; ")}`}};let yn;function Pg(){if(yn)return yn;const e=st();return yn={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},yn}const kl="2026-07-28";function Nn(e){return e!==void 0&&Mf(e)?_i:gi}function or(e){return e.revision!==void 0?Nn(e.revision).era:e.era==="modern"?_i.era:gi.era}function cs(e){return $l.some(t=>t.hasRequestMethod(e))}function ls(e){return $l.some(t=>t.hasNotificationMethod(e))}const $l=[gi,_i];var Cg=du({AnnotationsSchema:()=>at,AudioContentSchema:()=>Kn,BaseMetadataSchema:()=>nt,BaseRequestParamsSchema:()=>me,BlobResourceContentsSchema:()=>oi,BooleanSchemaSchema:()=>ci,CallToolRequestParamsSchema:()=>Cc,CallToolRequestSchema:()=>Ec,CallToolResultSchema:()=>Qn,CancelTaskRequestSchema:()=>vf,CancelTaskResultSchema:()=>bf,CancelledNotificationParamsSchema:()=>Ia,CancelledNotificationSchema:()=>Gs,ClientCapabilitiesSchema:()=>za,ClientNotificationSchema:()=>Rf,ClientRequestSchema:()=>yf,ClientResultSchema:()=>wf,ClientTasksCapabilitySchema:()=>xa,CompatibilityCallToolResultSchema:()=>cf,CompleteRequestParamsSchema:()=>el,CompleteRequestSchema:()=>tl,CompleteResultSchema:()=>ol,ContentBlockSchema:()=>Mt,CreateMessageRequestParamsSchema:()=>Uc,CreateMessageRequestSchema:()=>jc,CreateMessageResultSchema:()=>Zc,CreateMessageResultWithToolsSchema:()=>Dc,CreateTaskResultSchema:()=>pf,CursorSchema:()=>Fs,DiscoverRequestSchema:()=>ja,DiscoverResultSchema:()=>Za,ElicitRequestFormParamsSchema:()=>es,ElicitRequestParamsSchema:()=>Bc,ElicitRequestSchema:()=>Wc,ElicitRequestURLParamsSchema:()=>Vc,ElicitResultSchema:()=>Yc,ElicitationCompleteNotificationParamsSchema:()=>Gc,ElicitationCompleteNotificationSchema:()=>Kc,EmbeddedResourceSchema:()=>ii,EmptyResultSchema:()=>Vn,EnumSchemaSchema:()=>Jc,GetPromptRequestParamsSchema:()=>gc,GetPromptRequestSchema:()=>Sc,GetPromptResultSchema:()=>bc,GetTaskPayloadRequestSchema:()=>ff,GetTaskPayloadResultSchema:()=>gf,GetTaskRequestSchema:()=>mf,GetTaskResultSchema:()=>hf,IconSchema:()=>Na,IconsSchema:()=>It,ImageContentSchema:()=>Gn,ImplementationSchema:()=>Nt,InitializeRequestParamsSchema:()=>Ma,InitializeRequestSchema:()=>La,InitializeResultSchema:()=>Aa,InitializedNotificationSchema:()=>Ua,JSONArraySchema:()=>nf,JSONObjectSchema:()=>ee,JSONRPCErrorResponseSchema:()=>Jn,JSONRPCMessageSchema:()=>qa,JSONRPCNotificationSchema:()=>Ws,JSONRPCRequestSchema:()=>Bs,JSONRPCResponseSchema:()=>sf,JSONRPCResultResponseSchema:()=>Fn,JSONValueSchema:()=>Et,LegacyTitledEnumSchemaSchema:()=>pi,ListChangedOptionsBaseSchema:()=>lf,ListPromptsRequestSchema:()=>hc,ListPromptsResultSchema:()=>fc,ListResourceTemplatesRequestSchema:()=>Wa,ListResourceTemplatesResultSchema:()=>Ga,ListResourcesRequestSchema:()=>Va,ListResourcesResultSchema:()=>Ba,ListRootsRequestSchema:()=>sl,ListRootsResultSchema:()=>il,ListTasksRequestSchema:()=>Sf,ListTasksResultSchema:()=>_f,ListToolsRequestSchema:()=>Tc,ListToolsResultSchema:()=>Pc,LoggingLevelSchema:()=>ai,LoggingMessageNotificationParamsSchema:()=>Ic,LoggingMessageNotificationSchema:()=>Nc,ModelHintSchema:()=>xc,ModelPreferencesSchema:()=>Oc,MultiSelectEnumSchemaSchema:()=>Fc,NotificationSchema:()=>ye,NotificationsParamsSchema:()=>be,NumberSchemaSchema:()=>qn,PaginatedRequestParamsSchema:()=>Fa,PaginatedRequestSchema:()=>xt,PaginatedResultSchema:()=>Ot,PingRequestSchema:()=>Ys,PrimitiveSchemaDefinitionSchema:()=>hi,ProgressNotificationParamsSchema:()=>Ha,ProgressNotificationSchema:()=>Qs,ProgressSchema:()=>Da,ProgressTokenSchema:()=>Hs,PromptArgumentSchema:()=>dc,PromptListChangedNotificationSchema:()=>yc,PromptMessageSchema:()=>vc,PromptReferenceSchema:()=>Xc,PromptSchema:()=>mc,ReadResourceRequestParamsSchema:()=>Ka,ReadResourceRequestSchema:()=>Ya,ReadResourceResultSchema:()=>Qa,RelatedTaskMetadataSchema:()=>$a,RequestIdSchema:()=>rt,RequestMetaSchema:()=>Js,RequestSchema:()=>te,ResourceContentsSchema:()=>Xs,ResourceLinkSchema:()=>ri,ResourceListChangedNotificationSchema:()=>Xa,ResourceRequestParamsSchema:()=>Bn,ResourceSchema:()=>ni,ResourceTemplateReferenceSchema:()=>Qc,ResourceTemplateSchema:()=>Ja,ResourceUpdatedNotificationParamsSchema:()=>uc,ResourceUpdatedNotificationSchema:()=>pc,ResultMetaObjectSchema:()=>Vs,ResultSchema:()=>oe,RoleSchema:()=>zt,RootSchema:()=>nl,RootsListChangedNotificationSchema:()=>rl,SamplingContentSchema:()=>Lc,SamplingMessageContentBlockSchema:()=>Ho,SamplingMessageSchema:()=>Ac,ServerCapabilitiesSchema:()=>Ks,ServerNotificationSchema:()=>Pf,ServerRequestSchema:()=>Tf,ServerResultSchema:()=>Cf,ServerTasksCapabilitySchema:()=>Oa,SetLevelRequestParamsSchema:()=>$c,SetLevelRequestSchema:()=>qc,SingleSelectEnumSchemaSchema:()=>Hc,StringSchemaSchema:()=>Xn,SubscribeRequestParamsSchema:()=>ec,SubscribeRequestSchema:()=>tc,SubscriptionFilterSchema:()=>si,SubscriptionsAcknowledgedNotificationParamsSchema:()=>rc,SubscriptionsAcknowledgedNotificationSchema:()=>ac,SubscriptionsListenRequestParamsSchema:()=>sc,SubscriptionsListenRequestSchema:()=>ic,SubscriptionsListenResultMetaSchema:()=>cc,SubscriptionsListenResultSchema:()=>lc,TaskAugmentedRequestParamsSchema:()=>Go,TaskCreationParamsSchema:()=>uf,TaskMetadataSchema:()=>ka,TaskSchema:()=>Lt,TaskStatusNotificationParamsSchema:()=>cl,TaskStatusNotificationSchema:()=>df,TaskStatusSchema:()=>al,TextContentSchema:()=>Wn,TextResourceContentsSchema:()=>ei,TitledMultiSelectEnumSchemaSchema:()=>mi,TitledSingleSelectEnumSchemaSchema:()=>ui,ToolAnnotationsSchema:()=>Rc,ToolChoiceSchema:()=>zc,ToolExecutionSchema:()=>wc,ToolListChangedNotificationSchema:()=>kc,ToolResultContentSchema:()=>Mc,ToolSchema:()=>Yn,ToolUseContentSchema:()=>_c,UnsubscribeRequestParamsSchema:()=>oc,UnsubscribeRequestSchema:()=>nc,UntitledMultiSelectEnumSchemaSchema:()=>di,UntitledSingleSelectEnumSchemaSchema:()=>li});const Eg=e=>Bs.safeParse(e).success,kg=e=>Ws.safeParse(e).success,nr=e=>Fn.safeParse(e).success,$g=e=>Jn.safeParse(e).success,us=-32020;U.InvalidRequest,U.UnsupportedProtocolVersion,U.InvalidParams,U.MethodNotFound,U.InvalidParams,U.MissingRequiredClientCapability;U.ParseError+"",U.InvalidRequest+"",U.MethodNotFound+"",U.UnsupportedProtocolVersion+"",U.MissingRequiredClientCapability+"";function ql(e,t){return _a(e,t)}function No(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function Rs(e){if(e==null)return!1;const t=typeof e;return t!=="object"&&t!=="function"||!("~standard"in e)?!1:typeof e["~standard"]?.validate=="function"}let sr=!1;const ws="draft-2020-12";function qg(e,t="input"){const o=e["~standard"];let n;if(o.jsonSchema)n=o.jsonSchema[t]({target:ws});else if(o.vendor==="zod"){if(!("_zod"in e))throw new Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");sr||(sr=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),n=ga(e,{target:ws,io:t})}else throw new Error(`Schema library "${o.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output")return n.type!==void 0?n:Il(n)?{type:"object",...n}:n;if(n.type!==void 0&&n.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(n.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...n}}function Il(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(const t of["oneOf","anyOf","allOf"]){const o=e[t];if(Array.isArray(o)&&o.length>0)return o.every(n=>n!==null&&typeof n=="object"&&(n.type==="object"||Il(n)))}return!1}function Ig(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function ps(e,t){const o=await e["~standard"].validate(t);return o.issues&&o.issues.length>0?{success:!1,error:o.issues.map(n=>Ig(n)).join(", ")}:{success:!0,data:o.value}}function Ng(e){const t=ga(e,{target:ws,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}const xg=/\\\.\\d\{(\d+)\}/;function Og(e){const t=xg.exec(e),o=[void 0,-1,0];return t&&o.push(Number(t[1])),[!1,!0].flatMap(n=>[!1,!0].flatMap(s=>o.map(a=>Bo({local:n,offset:s,precision:a}))))}function zg(e,t){let o;switch(e){case"email":o=[ih()];break;case"uri":o=[Ls()];break;case"date":o=[Sa()];break;case"date-time":o=Og(t);break}return new Set(o.map(n=>Ng(n)).filter(n=>n!==void 0))}function Mg(e,t,o){return o!=="zod"?!0:zg(e,t).has(t)}function Fo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Lg(e){try{return qg(e,"input")}catch(t){const o=t instanceof Error?t.message:String(t);throw new ae(U.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${o}`)}}const Ag=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function vi(e){return Ag.has(e)||e.startsWith("x-")}const Ug=new Set(["$schema",...Object.keys(es.shape.requestedSchema.shape)]),ir={string:No([Xn,li,ui,pi]),number:No([qn]),integer:No([qn]),boolean:No([ci]),array:No([di,mi])},jg=new Set(Xn.shape.format.unwrap().options);function Zg(e,t,o,n){if(!Fo(e))return e;const s=typeof e.type=="string"&&Object.hasOwn(ir,e.type)?ir[e.type]:void 0;if(s===void 0)return e;const a={};for(const[r,c]of Object.entries(e))s.has(r)||vi(r)?a[r]=c:r==="pattern"&&e.type==="string"&&typeof e.format=="string"?jg.has(e.format)?(typeof c!="string"||!Mg(e.format,c,o))&&n.push(`${t}.${r}`):a[r]=c:n.push(`${t}.${r}`);return a}function Dg(e,t){const o={},n=[];for(const[s,a]of Object.entries(e))s==="properties"&&Fo(a)?o[s]=Object.fromEntries(Object.entries(a).map(([r,c])=>[r,Zg(c,`properties.${r}`,t,n)])):Ug.has(s)?o[s]=a:vi(s)||n.push(s);if(n.length>0)throw new ae(U.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);return o}function Hg(e,t){if(!Fo(e.properties))return t;const o=Object.entries(e.properties).filter(([,n])=>!ql(hi,n).success).map(([n])=>`properties.${n}`);return o.length>0?o.join(", "):t}function Ts(e,t,o=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((n,s)=>Ts(n,t[s],`${o}[${s}]`)):!Fo(e)||!Fo(t)?[]:Object.entries(e).flatMap(([n,s])=>{const a=o?`${o}.${n}`:n;return Object.prototype.hasOwnProperty.call(t,n)?Ts(s,t[n],a):vi(n)?[]:[a]})}function Fg(e){if(!Rs(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};const t=e.requestedSchema["~standard"].vendor,o=Dg(Lg(e.requestedSchema),t),n=ql(es.shape.requestedSchema,o);if(!n.success)throw new ae(U.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Hg(o,n.error.message)}`);const s=Ts(o,n.data);if(s.length>0)throw new ae(U.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${s.join(", ")}`);const a=(n.data.required??[]).filter(r=>!Object.prototype.hasOwnProperty.call(n.data.properties,r));if(a.length>0)throw new ae(U.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(", ")}`);return{...e,mode:"form",requestedSchema:n.data}}function Jg(e){const t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,o=typeof e.requestState=="string";if(!t&&!o)throw new TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Jg,{elicit(e){try{return{method:"elicitation/create",params:Fg(e)}}catch(t){throw t instanceof ae?new TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});const Vg=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],Bg={IdJagTokenExchangeResponseSchema:qf,OAuthClientInformationFullSchema:Nf,OAuthClientInformationSchema:dl,OAuthClientMetadataSchema:pl,OAuthClientRegistrationErrorSchema:xf,OAuthErrorResponseSchema:If,OAuthMetadataSchema:ll,OAuthProtectedResourceMetadataSchema:Ef,OAuthTokenRevocationRequestSchema:Of,OAuthTokensSchema:$f,OpenIdProviderDiscoveryMetadataSchema:kf,OpenIdProviderMetadataSchema:ul},Nl={},xl={};function Ol(e,t){const o=e.slice(0,-6);Nl[o]=t,xl[o]=n=>t.safeParse(n).success}for(const e of Vg)Ol(e,Cg[e]);for(const[e,t]of Object.entries(Bg))Ol(e,t);Object.freeze(Nl);Object.freeze(xl);function Wg(e){switch(e){case"initialize":case"notifications/initialized":return Nn(void 0);case"server/discover":return Nn(kl);default:return}}const Gg=6e4,Kg=[Zn,Zs,Dn,Ds],Yg=["inputResponses","requestState"];function rr(e,t){const o=e.params;if(!ds(o))return{message:e,lifted:{}};const n=o._meta,s=ds(n)?Kg.filter(u=>u in n):[],a=t==="request"?Yg.filter(u=>u in o):[];if(s.length===0&&a.length===0)return{message:e,lifted:{}};const r={},c={...o};if(s.length>0&&ds(n)){const u={},d={...n};for(const h of s)u[h]=n[h],delete d[h];r.envelope=u,Object.keys(d).length>0?c._meta=d:delete c._meta}for(const u of a)u==="inputResponses"&&(r.inputResponses=c[u]),u==="requestState"&&(r.requestState=c[u]),delete c[u];return{message:{...e,params:c},lifted:r}}function ar(e,t){const o=e.validateResult(t,void 0);if(!(!o.ok&&o.reason==="not-in-era"))return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(n){const s=e.validateResult(t,n);return s.ok?{value:s.value}:{issues:[{message:s.reason==="invalid"?s.message:`not-in-era: ${t}`}]}}}}}function zl(e){return()=>e}const Qg=zl(void 0);var Xg=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Xh,this.setNotificationHandler("notifications/cancelled",t=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",t=>{this._onprogress(t)}),this.setRequestHandler("ping",t=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){const t=this._outboundMetaEnvelope();if(t===void 0)return e;const o=e.params??{};return{...e,params:{...o,_meta:{...t,...o._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new ne(de.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,o,n,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,t),startTime:Date.now(),timeout:t,maxTotalTimeout:o,resetTimeoutOnProgress:s,onTimeout:n})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const o=Date.now()-t.startTime;if(t.maxTotalTimeout&&o>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ne(de.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:o});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};const o=this.transport?.onerror;this._transport.onerror=s=>{o?.(s),this._onerror(s)};const n=this._transport?.onmessage;this._transport.onmessage=(s,a)=>{n?.(s,a),nr(s)||$g(s)?this._onresponse(s):Eg(s)?this._onrequest(s,a):kg(s)?this._onnotification(s,a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(const n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();const t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;const o=new ne(de.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(const n of e.values())n(o);for(const n of t.values())n.abort(o)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){const{message:o}=rr(e,"notification"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){const r=or(t.classification);if(r!==n.era){this._onerror(new Error(`Era mismatch on inbound notification '${o.method}': classified as ${r} but this instance serves ${n.era}`));return}}if(ls(o.method)&&!n.hasNotificationMethod(o.method))return;const s=this._notificationHandlers.get(o.method),a=this.fallbackNotificationHandler;s===void 0&&a===void 0||Promise.resolve().then(()=>s===void 0?a(o):s(o,n)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){const{message:o,lifted:n}=rr(e,"request"),s=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(new Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}const a=this._transport,r=(P,b,A)=>{const j={jsonrpc:"2.0",id:o.id,error:{code:P,message:b,...A!==void 0&&{data:A}}};a?.send(j).catch(x=>this._onerror(new Error(`Failed to send an error response: ${x}`)))};if(t?.classification!==void 0){const P=or(t.classification);if(P!==s.era){this._onerror(new Error(`Era mismatch on inbound request '${o.method}': classified as ${P} but this instance serves ${s.era}`));const b=t.classification.revision??P;r(U.UnsupportedProtocolVersion,`Unsupported protocol version: ${b}`,{supported:this._supportedProtocolVersions,requested:b});return}}if(cs(o.method)&&!s.hasRequestMethod(o.method)){r(U.MethodNotFound,"Method not found");return}const c=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(c===void 0){r(U.MethodNotFound,"Method not found");return}const u=s.checkInboundEnvelope(n);if(u!==void 0){r(U.InvalidParams,u);return}const d=(P,b)=>this._notificationViaCodec(this._resolveOutboundCodec(P.method),P,{...b,relatedRequestId:o.id}),h=(P,b,A)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(P.method),P,b,{...A,relatedRequestId:o.id}),S=new AbortController;this._requestHandlerAbortControllers.set(o.id,S);const v=n.inputResponses===void 0?void 0:eS(n.inputResponses),f={sessionId:a?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...n.envelope!==void 0&&{envelope:n.envelope},...v!==void 0&&{inputResponses:v.accepted},...v!==void 0&&v.droppedKeys.length>0&&{droppedInputResponseKeys:v.droppedKeys},requestState:n.requestState===void 0?Qg:zl(n.requestState),signal:S.signal,send:((P,b,A)=>{const j=this._resolveOutboundCodec(P.method);if(this._assertOutboundRequestInEra(j,P.method),Rs(b))return h(P,b,A);const x=ar(j,P.method);if(x===void 0)throw new TypeError(`'${P.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return h(P,x,b)}),notify:d},http:t?.authInfo?{authInfo:t.authInfo}:void 0},R=this.buildContext(f,t);Promise.resolve().then(()=>c(o,R)).then(async P=>{if(S.signal.aborted)return;let b;try{b=s.encodeResult(o.method,P,this._outboundServerInfo())}catch(j){this._onerror(new Error(`Failed to encode result for ${o.method}: ${j}`)),r(U.InternalError,"Internal error");return}const A={result:b,jsonrpc:"2.0",id:o.id};await a?.send(A)},async P=>{if(S.signal.aborted)return;const b=Number.isSafeInteger(P.code)?P.code:U.InternalError,A={jsonrpc:"2.0",id:o.id,error:{code:s.encodeErrorCode(b),message:P.message??"Internal error",...P.data!==void 0&&{data:P.data}}};await a?.send(A)}).catch(P=>this._onerror(new Error(`Failed to send response: ${P}`))).finally(()=>{this._requestHandlerAbortControllers.get(o.id)===S&&this._requestHandlerAbortControllers.delete(o.id)})}_onprogress(e){const{progressToken:t,...o}=e.params,n=Number(t),s=this._progressHandlers.get(n);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const a=this._responseHandlers.get(n),r=this._timeoutInfo.get(n);if(r&&a&&r.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),a(c);return}s(o)}_onresponse(e){const t=Number(e.id),o=this._responseHandlers.get(t);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),nr(e)?o(e):o(ae.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,o){const n=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(n,e.method),Rs(t))return this._requestWithSchemaViaCodec(n,e,t,o);const s=ar(n,e.method);if(s===void 0)throw new TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(n,e,s,t)}_negotiatedWireCodec(){return Nn(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){const t=Wg(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(cs(t)&&!e.hasRequestMethod(t))throw new ne(de.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,o){const n=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(n,e.method),this._requestWithSchemaViaCodec(n,e,t,o)}_requestWithSchemaViaCodec(e,t,o,n){const{relatedRequestId:s,resumptionToken:a,onresumptiontoken:r,headers:c}=n??{},u=Date.now();let d,h;return new Promise((S,v)=>{const f=O=>{v(O)};if(!this._transport){f(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(O){f(O);return}if(n?.signal?.aborted){const O=n.signal.reason;throw O instanceof ne?O:new ne(de.RequestTimeout,String(O))}const R=e.era===kl&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,P=this._requestMessageId++;h=P;const b={...t,jsonrpc:"2.0",id:P};n?.onprogress&&(this._progressHandlers.set(P,n.onprogress),b.params={...t.params,_meta:{...t.params?._meta,progressToken:P}});const A=this._envelopeOutbound(b);let j=!1;const x=O=>{j||(this._progressHandlers.delete(P),R===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:P,reason:String(O)}}),{relatedRequestId:s,resumptionToken:a,onresumptiontoken:r}).catch(G=>this._onerror(new Error(`Failed to send cancellation: ${G}`))):R.abort(),v(O instanceof ne?O:new ne(de.RequestTimeout,String(O))))};this._responseHandlers.set(P,O=>{if(n?.signal?.aborted)return;if(j=!0,O instanceof Error)return v(O);let G;try{G=e.decodeResult(t.method,O.result)}catch(ie){return v(ie instanceof Error?ie:new Error(String(ie)))}if(G.kind==="invalid")return v(G.error);if(G.kind==="input_required"){if(n?.allowInputRequired===!0)return S(tS(G));const ie={codec:e,request:t,resultSchema:o,options:n,flowStartedAt:u,retry:(qe,q)=>this._requestWithSchemaViaCodec(e,qe===void 0?{method:t.method}:{method:t.method,params:qe},o,q)};return S(this._resolveNonCompleteResult(G,ie))}const se=G.result;ps(o,se).then(ie=>{ie.success?S(ie.data):v(new ne(de.InvalidResult,`Invalid result for ${t.method}: ${ie.error}`))},v)}),d=()=>x(n?.signal?.reason),n?.signal?.addEventListener("abort",d,{once:!0});const N=n?.timeout??Gg,$=()=>x(new ne(de.RequestTimeout,"Request timed out",{timeout:N}));this._setupTimeout(P,N,n?.maxTotalTimeout,$,n?.resetTimeoutOnProgress??!1),this._transport.send(A,{relatedRequestId:s,resumptionToken:a,onresumptiontoken:r,headers:c,requestSignal:R?.signal}).catch(O=>{this._progressHandlers.delete(P),v(O)})}).finally(()=>{d&&n?.signal?.removeEventListener("abort",d),h!==void 0&&(this._responseHandlers.delete(h),this._cleanupTimeout(h))})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,o){if(!this._transport)throw new ne(de.NotConnected,"Not connected");if(ls(t.method)&&!e.hasNotificationMethod(t.method))throw new ne(de.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);const n=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&o?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(n,o).catch(s=>this._onerror(s))});return}await this._transport.send(n,o)}setRequestHandler(e,t,o){this.assertRequestHandlerCapability(e);let n;if(typeof t=="function"){if(!cs(e))throw new TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);n=(s,a)=>{const r=this._negotiatedWireCodec();let c=r.validateRequest(e,s);if(!c.ok&&c.reason==="not-in-era"&&(c=r.validateInputRequest(e,s)),!c.ok)throw c.reason==="not-in-era"?new ae(U.InternalError,`No wire schema for ${e} in the resolved era`):new Error(c.message);return Promise.resolve(t(c.value,a))}}else if(o)n=async(s,a)=>{const r=await ps(t.params,{...s.params});if(!r.success)throw new ae(U.InvalidParams,`Invalid params for ${e}: ${r.error}`);return o(r.data,a)};else throw new TypeError("setRequestHandler: handler is required");this._requestHandlers.set(e,this._wrapHandler(e,n))}_wrapHandler(e,t){return t}_outboundServerInfo(){}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,t,o){if(typeof t=="function"){if(!ls(e))throw new TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,s)=>{const a=s.validateNotification(e,n);if(!a.ok)throw a.reason==="not-in-era"?new ae(U.InternalError,`No wire schema for ${e} in the resolved era`):new Error(a.message);return Promise.resolve(t(a.value))});return}if(!o)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async n=>{const s=await ps(t.params,{...n.params});if(!s.success)throw new ae(U.InvalidParams,`Invalid params for notification ${e}: ${s.error}`);await o(s.data,n)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function ds(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function eS(e){const t={},o=[];if(!cr(e))return{accepted:t,droppedKeys:o};for(const[n,s]of Object.entries(e)){if(!cr(s)||"method"in s||"result"in s){o.push(n);continue}t[n]=s}return{accepted:t,droppedKeys:o}}function tS(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}/*!
* content-type
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/var oS=pu((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,o=/\\([\u000b\u0020-\u00ff])/g,n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=s;function s(c){if(!c)throw new TypeError("argument string is required");var u=typeof c=="object"?a(c):c;if(typeof u!="string")throw new TypeError("argument string is required to be a string");var d=u.indexOf(";"),h=d!==-1?u.slice(0,d).trim():u.trim();if(!n.test(h))throw new TypeError("invalid media type");var S=new r(h.toLowerCase());if(d!==-1){var v,f,R;for(t.lastIndex=d;f=t.exec(u);){if(f.index!==d)throw new TypeError("invalid parameter format");d+=f[0].length,v=f[1].toLowerCase(),R=f[2],R.charCodeAt(0)===34&&(R=R.slice(1,-1),R.indexOf("\\")!==-1&&(R=R.replace(o,"$1"))),S.parameters[v]=R}if(d!==u.length)throw new TypeError("invalid parameter format")}return S}function a(c){var u;if(typeof c.getHeader=="function"?u=c.getHeader("content-type"):typeof c.headers=="object"&&(u=c.headers&&c.headers["content-type"]),typeof u!="string")throw new TypeError("content-type header is missing from object");return u}function r(c){this.parameters=Object.create(null),this.type=c}}));oS();typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");const nS=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,sS=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,iS=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[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25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;function Ne(e){return e.test.bind(e)}hS.bind(void 0,!1),Ne(iS),Ne(rS),Ne(aS),Ne(sS),Ne(dS),Ne(mS),Ne(cS),Ne(lS),Ne(uS),Ne(pS);function hS(e,t){const o=t.match(nS);if(!o)return!1;const n=+o[1],s=+o[2],a=+o[3],r=!!o[5];return(n<=23&&s<=59&&a<=59||n==23&&s==59&&a==60)&&(!e||r)}class fS{_eventSlots=new Map;setHandler(t,o){let n=this._ensureEventSlot(t);n.onHandler&&o&&console.warn(`[MCP Apps] on${String(t)} handler replaced. Use addEventListener("${String(t)}", …) to add multiple listeners without replacing.`),n.onHandler=o}getHandler(t){return this._eventSlots.get(t)?.onHandler}addEventListener(t,o){this._ensureEventSlot(t).listeners.push(o)}removeEventListener(t,o){let n=this._eventSlots.get(t);if(!n)return;let s=n.listeners.indexOf(o);s!==-1&&n.listeners.splice(s,1)}dispatch(t,o){let n=this._eventSlots.get(t);if(n){n.onHandler?.(o);for(let s of[...n.listeners])s(o)}}_ensureEventSlot(t){let o=this._eventSlots.get(t);return o||(o={listeners:[]},this._eventSlots.set(t,o)),o}}class gS{_methods=new Set;claim(t,o){if(this._methods.has(t))throw Error(`Handler for "${t}" already registered (via ${o}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(t)}replace(t){this._methods.add(t)}release(t){this._methods.delete(t)}has(t){return this._methods.has(t)}}var lr=new Set;function ur(e,t){let[o,n]=t,s=o?.shape;if(typeof s?.method?.value!="string")return;let a=s.method.value,r=e==="request"?"setRequestHandler":"setNotificationHandler";lr.has(r)||(lr.add(r),console.warn(`[ext-apps] ${r}(Schema, handler) is deprecated; use ${r}("${a}", { params: Schema.shape.params }, handler).`));let c=n;return[a,{params:s.params},e==="request"?(u,d)=>c({method:a,params:u},SS(d)):u=>c({method:a,params:u})]}function SS(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var _S="2026-01-26",vS="ui/notifications/tool-input-partial";class bS{eventTarget;eventSource;messageListener;constructor(t=window.parent,o){this.eventTarget=t,this.eventSource=o,this.messageListener=n=>{if(o&&n.source!==this.eventSource){console.debug("Ignoring message from unknown source",n);return}let s=qa.safeParse(n.data);s.success?(console.debug("Parsed message",s.data),this.onmessage?.(s.data)):n.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",s.error.message,n):(console.error("Failed to parse message",s.error.message,n),this.onerror?.(Error("Invalid JSON-RPC message received: "+s.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,o){t.method!==vS&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var yS=w([p("light"),p("dark")]).describe("Color theme preference for the host environment."),Jo=w([p("inline"),p("fullscreen"),p("pip")]).describe("Display mode for UI presentation."),RS=w([p("--color-background-primary"),p("--color-background-secondary"),p("--color-background-tertiary"),p("--color-background-inverse"),p("--color-background-ghost"),p("--color-background-info"),p("--color-background-danger"),p("--color-background-success"),p("--color-background-warning"),p("--color-background-disabled"),p("--color-text-primary"),p("--color-text-secondary"),p("--color-text-tertiary"),p("--color-text-inverse"),p("--color-text-ghost"),p("--color-text-info"),p("--color-text-danger"),p("--color-text-success"),p("--color-text-warning"),p("--color-text-disabled"),p("--color-border-primary"),p("--color-border-secondary"),p("--color-border-tertiary"),p("--color-border-inverse"),p("--color-border-ghost"),p("--color-border-info"),p("--color-border-danger"),p("--color-border-success"),p("--color-border-warning"),p("--color-border-disabled"),p("--color-ring-primary"),p("--color-ring-secondary"),p("--color-ring-inverse"),p("--color-ring-info"),p("--color-ring-danger"),p("--color-ring-success"),p("--color-ring-warning"),p("--font-sans"),p("--font-mono"),p("--font-weight-normal"),p("--font-weight-medium"),p("--font-weight-semibold"),p("--font-weight-bold"),p("--font-text-xs-size"),p("--font-text-sm-size"),p("--font-text-md-size"),p("--font-text-lg-size"),p("--font-heading-xs-size"),p("--font-heading-sm-size"),p("--font-heading-md-size"),p("--font-heading-lg-size"),p("--font-heading-xl-size"),p("--font-heading-2xl-size"),p("--font-heading-3xl-size"),p("--font-text-xs-line-height"),p("--font-text-sm-line-height"),p("--font-text-md-line-height"),p("--font-text-lg-line-height"),p("--font-heading-xs-line-height"),p("--font-heading-sm-line-height"),p("--font-heading-md-line-height"),p("--font-heading-lg-line-height"),p("--font-heading-xl-line-height"),p("--font-heading-2xl-line-height"),p("--font-heading-3xl-line-height"),p("--border-radius-xs"),p("--border-radius-sm"),p("--border-radius-md"),p("--border-radius-lg"),p("--border-radius-xl"),p("--border-radius-full"),p("--border-width-regular"),p("--shadow-hairline"),p("--shadow-sm"),p("--shadow-md"),p("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),wS=y(RS.describe(`Style variables for theming MCP apps.
Individual style keys are optional - hosts may provide any subset of these values.
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),w([i(),Ss()]).describe(`Style variables for theming MCP apps.
Individual style keys are optional - hosts may provide any subset of these values.
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
Individual style keys are optional - hosts may provide any subset of these values.
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);l({method:p("ui/open-link"),params:l({url:i().describe("URL to open in the host's browser")})});var TS=l({isError:T().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),PS=l({isError:T().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),CS=l({isError:T().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();l({method:p("ui/notifications/sandbox-proxy-ready"),params:l({})});var bi=l({connectDomains:m(i()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
- Maps to CSP \`connect-src\` directive
- Empty or omitted → no network connections (secure default)`),resourceDomains:m(i()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:m(i()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:m(i()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),yi=l({camera:l({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:l({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:l({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:l({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")});l({method:p("ui/notifications/size-changed"),params:l({width:_().optional().describe("New width in pixels."),height:_().optional().describe("New height in pixels.")})});var ES=l({method:p("ui/notifications/tool-input"),params:l({arguments:y(i(),C().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),kS=l({method:p("ui/notifications/tool-input-partial"),params:l({arguments:y(i(),C().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),$S=l({method:p("ui/notifications/tool-cancelled"),params:l({reason:i().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),qS=l({fonts:i().optional()}),IS=l({variables:wS.optional().describe("CSS variables for theming the app."),css:qS.optional().describe("CSS blocks that apps can inject.")}),NS=l({method:p("ui/resource-teardown"),params:l({})}),xS=y(i(),C()),pr=l({text:l({}).optional().describe("Host supports text content blocks."),image:l({}).optional().describe("Host supports image content blocks."),audio:l({}).optional().describe("Host supports audio content blocks."),resource:l({}).optional().describe("Host supports resource content blocks."),resourceLink:l({}).optional().describe("Host supports resource link content blocks."),structuredContent:l({}).optional().describe("Host supports structured content.")});l({method:p("ui/notifications/request-teardown"),params:l({}).optional()});var OS=l({experimental:y(i(),y(i(),Us()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:l({}).optional().describe("Host supports opening external URLs."),downloadFile:l({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:l({listChanged:T().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:l({listChanged:T().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:l({}).optional().describe("Host accepts log messages."),sandbox:l({permissions:yi.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:bi.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:pr.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:pr.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:l({tools:l({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),zS=l({experimental:y(i(),y(i(),Us()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),tools:l({listChanged:T().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:m(Jo).optional().describe("Display modes the app supports.")});l({method:p("ui/notifications/initialized"),params:l({}).optional()});l({csp:bi.optional().describe("Content Security Policy configuration for UI resources."),permissions:yi.optional().describe("Sandbox permissions requested by the UI resource."),domain:i().optional().describe(`Dedicated origin for view sandbox.
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:
- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:T().optional().describe(`Visual boundary preference - true if view prefers a visible border.
Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
- \`true\`: request visible border + background
- \`false\`: request no visible border + background
- omitted: host decides border`)});l({method:p("ui/request-display-mode"),params:l({mode:Jo.describe("The display mode being requested.")})});var MS=l({mode:Jo.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),LS=w([p("model"),p("app")]).describe("Tool visibility scope - who can access the tool.");l({resourceUri:i().optional(),visibility:m(LS).optional().describe(`Who can access this tool. Default: ["model", "app"]
- "model": Tool visible to and callable by the agent
- "app": Tool callable by the app from this server only`),csp:_s().optional(),permissions:_s().optional()});l({mimeTypes:m(i()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});l({method:p("ui/download-file"),params:l({contents:m(w([ii,ri])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});l({method:p("ui/message"),params:l({role:p("user").describe('Message role, currently only "user" is supported.'),content:m(Mt).describe("Message content blocks (text, image, etc.).")})});l({method:p("ui/notifications/sandbox-resource-ready"),params:l({html:i().describe("HTML content to load into the inner iframe."),sandbox:i().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:bi.optional().describe("CSP configuration from resource metadata."),permissions:yi.optional().describe("Sandbox permissions from resource metadata.")})});var AS=l({method:p("ui/notifications/tool-result"),params:Qn.describe("Standard MCP tool execution result.")}),Ml=l({toolInfo:l({id:rt.optional().describe("JSON-RPC id of the tools/call request."),tool:Yn.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:yS.optional().describe("Current color theme preference."),styles:IS.optional().describe("Style configuration for theming the app."),displayMode:Jo.optional().describe("How the UI is currently displayed."),availableDisplayModes:m(Jo).optional().describe("Display modes the host supports."),containerDimensions:w([l({height:_().describe("Fixed container height in pixels.")}),l({maxHeight:w([_(),Ss()]).optional().describe("Maximum container height in pixels.")})]).and(w([l({width:_().describe("Fixed container width in pixels.")}),l({maxWidth:w([_(),Ss()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:i().optional().describe("User's language and region preference in BCP 47 format."),timeZone:i().optional().describe("User's timezone in IANA format."),userAgent:i().optional().describe("Host application identifier."),platform:w([p("web"),p("desktop"),p("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:l({touch:T().optional().describe("Whether the device supports touch input."),hover:T().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:l({top:_().describe("Top safe area inset in pixels."),right:_().describe("Right safe area inset in pixels."),bottom:_().describe("Bottom safe area inset in pixels."),left:_().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),US=l({method:p("ui/notifications/host-context-changed"),params:Ml.describe("Partial context update containing only changed fields.")});l({method:p("ui/update-model-context"),params:l({content:m(Mt).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:y(i(),C().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});l({method:p("ui/initialize"),params:l({appInfo:Nt.describe("App identification (name and version)."),appCapabilities:zS.describe("Features and capabilities this app provides."),protocolVersion:i().describe("Protocol version this app supports.")})});var jS=l({protocolVersion:i().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Nt.describe("Host application identification and version."),hostCapabilities:OS.describe("Features and capabilities provided by the host."),hostContext:Ml.describe("Rich context about the host environment.")}).passthrough(),ZS={target:"draft-2020-12"};async function dr(e,t){let o=e["~standard"];if(o.jsonSchema)return o.jsonSchema[t](ZS);throw Error(`Schema (vendor: ${o.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function mr(e,t,o=""){let n=await e["~standard"].validate(t);if(n.issues){let s=n.issues.map(a=>{let r=a.path?.map(c=>typeof c=="object"?c.key:c).join(".");return r?`${r}: ${a.message}`:a.message}).join("; ");throw Error(o+s)}return n.value}function DS(e){let t=document.documentElement;t.setAttribute("data-theme",e),t.style.colorScheme=e}function HS(e,t=document.documentElement){for(let[o,n]of Object.entries(e))n!==void 0&&t.style.setProperty(o,n)}function FS(e,t){let o={...e,...t};return t.experimental!==void 0&&(o.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(o.tools={...e.tools,...t.tools}),o}class Ri extends Xg{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new fS;_methods=new gS;setRequestHandler=(...t)=>{let[o,...n]=ur("request",t)??t;this._methods.claim(o,"setRequestHandler"),super.setRequestHandler.call(this,o,...n)};setNotificationHandler=(...t)=>{let[o,...n]=ur("notification",t)??t;this._methods.claim(o,"setNotificationHandler"),super.setNotificationHandler.call(this,o,...n)};removeRequestHandler=t=>{this._methods.release(t),super.removeRequestHandler(t)};removeNotificationHandler=t=>{this._methods.release(t),super.removeNotificationHandler(t)};replaceRequestHandler=(t,...o)=>{this._methods.replace(t),super.setRequestHandler.call(this,t,...o)};_assertInitialized(t){if(this._initializedSent)return;let o=`[ext-apps] App.${t}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(o);console.warn(`${o}. This will throw in a future release.`)}eventSchemas={toolinput:ES,toolinputpartial:kS,toolresult:AS,toolcancelled:$S,hostcontextchanged:US};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(t){if(!Ri.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let o=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(o);console.warn(o)}setEventHandler(t,o){o&&this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.setHandler(t,o)}addEventListener(t,o){this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.addEventListener(t,o)}removeEventListener(t,o){this._events.removeEventListener(t,o)}_ensureEventSlot(t){if(this._registeredEvents.has(t))return;let o=this.eventSchemas[t];if(!o)throw Error(`Unknown event: ${String(t)}`);this.setNotificationHandler(o.shape.method.value,{params:o.shape.params},n=>{let s=n;t==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...s}),this._events.dispatch(t,s)}),this._registeredEvents.add(t)}getEventHandler(t){return this._events.getHandler(t)}warnIfRequestHandlerReplaced(t,o,n){o&&n&&console.warn(`[MCP Apps] ${t} handler replaced. Previous handler will no longer be called.`)}constructor(t,o={},n={autoResize:!0}){super(n),this._appInfo=t,this._appCapabilities=o,this.options=n,this._methods.replace("notifications/cancelled"),this._methods.replace("notifications/progress"),!n.allowUnsafeEval&&xe({jitless:!0}),this.replaceRequestHandler("ping",s=>(console.log("Received ping:",s.params),{})),this.setEventHandler("hostcontextchanged",void 0)}buildContext(t){return t}registerAppCapabilities(t){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._appCapabilities=FS(this._appCapabilities,t)}registerTool(t,o,n){if(this._registeredTools[t])throw Error(`Tool ${t} is already registered`);let s=this,a=()=>{s._initializedSent&&s._appCapabilities.tools?.listChanged&&s.sendToolListChanged()},r=o.inputSchema!==void 0,c={title:o.title,description:o.description,inputSchema:o.inputSchema,outputSchema:o.outputSchema,annotations:o.annotations,_meta:o._meta,enabled:!0,enable(){this.enabled=!0,a()},disable(){this.enabled=!1,a()},update(u){Object.assign(this,u),a()},remove(){s._registeredTools[t]===c&&(delete s._registeredTools[t],a())},handler:async(u,d)=>{if(!c.enabled)throw Error(`Tool ${t} is disabled`);let h;if(r){let S=c.inputSchema,v=S?await mr(S,u??{},`Invalid input for tool ${t}: `):u??{};h=await n(v,d)}else h=await n(d);return c.outputSchema&&!h.isError&&(h.structuredContent=await mr(c.outputSchema,h.structuredContent,`Invalid output for tool ${t}: `)),h}};return this._registeredTools[t]=c,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),a(),c}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(t,o)=>{let n=this._registeredTools[t.name];if(!n)throw Error(`Tool ${t.name} not found`);return n.handler(t.arguments,o)},this.onlisttools=async(t,o)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([n,s])=>s.enabled).map(async([n,s])=>{let a={name:n,title:s.title,description:s.description,inputSchema:s.inputSchema?await dr(s.inputSchema,"input"):{type:"object",properties:{}}};return s.outputSchema&&(a.outputSchema=await dr(s.outputSchema,"output")),s.annotations&&(a.annotations=s.annotations),s._meta&&(a._meta=s._meta),a}))}))}async sendToolListChanged(t={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:t})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(t){this.setEventHandler("toolinput",t)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(t){this.setEventHandler("toolinputpartial",t)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(t){this.setEventHandler("toolresult",t)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(t){this.setEventHandler("toolcancelled",t)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(t){this.setEventHandler("hostcontextchanged",t)}_onteardown;get onteardown(){return this._onteardown}set onteardown(t){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,t),this._onteardown=t,this.replaceRequestHandler("ui/resource-teardown",{params:NS.shape.params,result:xS},(o,n)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(o,n)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(t){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,t),this._oncalltool=t,this.replaceRequestHandler("tools/call",(o,n)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(o.params,n)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(t){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,t),this._onlisttools=t,this.replaceRequestHandler("tools/list",(o,n)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(o.params,n)})}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${t})`);break}}assertRequestHandlerCapability(t){switch(t){case"tools/call":case"tools/list":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;default:return}}assertNotificationCapability(t){}async callServerTool(t,o){if(this._assertInitialized("callServerTool"),typeof t=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${t}"). Did you mean: callServerTool({ name: "${t}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:t},{onprogress:()=>{},resetTimeoutOnProgress:!0,...o})}async readServerResource(t,o){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:t},o)}async listServerResources(t,o){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:t},o)}async createSamplingMessage(t,o){return this._assertInitialized("createSamplingMessage"),await this.request({method:"sampling/createMessage",params:t},o)}sendMessage(t,o){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:t},CS,o)}sendLog(t){return this.notification({method:"notifications/message",params:t})}updateModelContext(t,o){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:t},Vn,o)}openLink(t,o){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},TS,o)}sendOpenLink=this.openLink;downloadFile(t,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},PS,o)}requestTeardown(t={}){return this.notification({method:"ui/notifications/request-teardown",params:t})}requestDisplayMode(t,o){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:t},MS,o)}sendSizeChanged(t){return this.notification({method:"ui/notifications/size-changed",params:t})}setupSizeChangedNotifications(){let t=!1,o=0,n=0,s=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let r=document.documentElement,c=r.style.height;r.style.height="max-content";let u=Math.ceil(r.getBoundingClientRect().height);r.style.height=c;let d=Math.ceil(window.innerWidth);(d!==o||u!==n)&&(o=d,n=u,this.sendSizeChanged({width:d,height:u}))}))};s();let a=new ResizeObserver(s);return a.observe(document.documentElement),a.observe(document.body),()=>a.disconnect()}async connect(t=new bS(window.parent,window.parent),o){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1;try{await super.connect(t);let n=await this.request({method:"ui/initialize",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:_S}},jS,o);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);this._hostCapabilities=n.hostCapabilities,this._hostInfo=n.hostInfo,this._hostContext=n.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(n){throw this.close(),n}}}const Ll="0.1.3",Al=z(["accepted","declined"]),ms=document.getElementById("app"),je=document.getElementById("status"),Ps=document.getElementById("status-text"),Mo=document.getElementById("take-over"),xn=document.getElementById("retry"),On=document.getElementById("editor"),JS=document.querySelector('meta[name="pen-editor-url"]').content,VS=document.querySelector('meta[name="pen-install-id"]').content;let Ul=Al.safeParse(document.querySelector('meta[name="pen-analytics-consent"]').content).data;const X=new Ri({name:"pen.dev",version:Ll});let $e,hr,Cs=!1,Ue,zn,wi,Lo,hs=!1,Vo=!1,fr,Es=!1,Mn;X.ontoolresult=({structuredContent:e,isError:t,content:o})=>{if(!($e||Cs)){if(t){kt(BS(o)||"pen.dev couldn't open the editor.");return}if(e){if(e.mode==="dashboard"){Cs=!0,$t(void 0);return}$e=e,$t($e)}}};X.onhostcontextchanged=()=>{Dl();const e=X.getHostContext()?.theme;e&&e!==Lo&&(Lo=e,wi?.("color-theme-changed",{theme:Lo}))};Mo.addEventListener("click",()=>{WS()});xn.addEventListener("click",()=>{($e!=null||Cs)&&$t($e)});X.onteardown=async()=>(Vo=!0,{});await X.connect();Lo=X.getHostContext()?.theme;Dl();X.getHostContext()?.availableDisplayModes?.includes("fullscreen")&&X.requestDisplayMode({mode:"fullscreen"}).catch(()=>{});function kt(e){Ps.textContent=e,je.classList.add("message"),je.hidden=!1}function BS(e){return(e??[]).map(t=>t.type==="text"?t.text:"").join(" ").trim()}function Ko(e){return e.filePath.split(/[\\/]/).pop()}function jl(e){return`${Ko(e)} is open in another editor in this chat.`}function Zl(e,t){Vo=!0,On.src="about:blank",kt(e),Mo.hidden=!t}async function WS(){const e=$e;if(e!=null){Mo.disabled=!0;try{if((await X.callServerTool({name:"editor_take_over",arguments:{viewId:e.viewId,filePath:e.filePath}})).isError){kt(`The other editor couldn't save its changes, so ${Ko(e)} stays open there.`);return}}catch{kt("Couldn't reach pen.dev. Try again.");return}finally{Mo.disabled=!1}Vo=!1,Mo.hidden=!0,je.classList.remove("message"),$t(e)}}function GS(){ms.classList.remove("flashing"),ms.offsetWidth,ms.classList.add("flashing")}function Dl(){const e=X.getHostContext();document.body.classList.toggle("fullscreen",e?.displayMode==="fullscreen"),e?.theme&&DS(e.theme),e?.styles?.variables&&HS(e.styles.variables)}function $t(e){const t=new URL(JS);t.searchParams.set("embed",""),e==null&&t.searchParams.set("dashboard",""),Ps.textContent=e!=null?`Opening ${Ko(e)}…`:"Opening pen.dev…",xn.hidden=!0,clearTimeout(hr),hr=setTimeout(()=>{!je.hidden&&!je.classList.contains("message")&&(Ps.textContent="This is taking longer than usual…",xn.hidden=!1)},2e4);const o=n=>{n.source===On.contentWindow&&n.data?.type==="pen:ready"&&QS(t.origin,e)};fr?.(),window.addEventListener("message",o),fr=()=>window.removeEventListener("message",o),zn?.(),zn=void 0,Ue=void 0,wi=void 0,On.src=t.href}function KS(e){$e=e,je.classList.remove("message"),je.hidden=!1,$t(e)}function YS(e){Es=!1,X.updateModelContext({content:[{type:"text",text:`A pen.dev editor is open in this conversation with ${e.filePath}`,_meta:{"openai/title":Ko(e)}}]}).catch(()=>{})}function QS(e,t){const o=new MessageChannel,n=new Map;let s=0;zn?.(),zn=()=>{for(const a of n.values())a.reject(new Error("The editor reloaded."));n.clear(),o.port1.close()},o.port1.onmessage=({data:a})=>{switch(a?.kind){case"ready":je.hidden=!0,xn.hidden=!0,t!=null&&YS(t),XS();break;case"error":kt(a.message);break;case"request":t_(o.port1,a,t);break;case"response":{const r=n.get(a.id);n.delete(a.id),a.error?r?.reject(new Error(a.error.message)):r?.resolve(a.payload);break}case"notification":a.method==="selection-changed"&&t!=null&&l_(t,a.payload);break}},wi=(a,r)=>o.port1.postMessage({kind:"notification",method:a,payload:r}),Ue=(a,r)=>new Promise((c,u)=>{const d=`app-${++s}`;n.set(d,{resolve:c,reject:u}),o.port1.postMessage({kind:"request",id:d,method:a,payload:r})}),On.contentWindow?.postMessage({type:"pen:connect",fileURI:t?.fileURI,theme:Lo,clientName:"ChatGPT",cursorColor:[44/255,103/255,197/255],capabilities:["open-link"],embedder:{name:"pen-dev-mcp-app",version:Ll,host:X.getHostVersion()?.name,installId:VS,analyticsConsent:Ul}},e,[o.port2])}async function XS(){if(!hs){for(hs=!0;!Vo&&$e&&Ue;){const e=$e,t={viewId:e.viewId,filePath:e.filePath};let o;try{o=(await X.callServerTool({name:"next_command",arguments:t})).structuredContent}catch(n){if(n instanceof ae&&n.code===of){Vo=!0,kt("This editor is no longer connected to Codex.");break}await new Promise(s=>setTimeout(s,1e3));continue}if(e!==$e||e===Mn){o.kind==="command"&&await X.callServerTool({name:"command_result",arguments:{...t,commandId:o.command.id,result:ks(e===Mn?`The pen.dev editor is switching away from ${e.filePath}.`:`The pen.dev editor now shows ${$e?.filePath}.`)}}).catch(()=>{});continue}switch(o.kind){case"replaced":Zl(jl(e),!0);break;case"command":o.command.name==="get_app_state"&&GS(),await X.callServerTool({name:"command_result",arguments:{...t,commandId:o.command.id,result:await e_(o.command)}}).catch(()=>{});break}}hs=!1}}async function e_(e){try{if(!Ue)throw new Error("The editor is not connected.");if(e.name==="save"){const t=Vl(await Ue("save",void 0));return t?ks(t):{content:[]}}return await Ue("mcp-tool-call",{name:e.name,arguments:e.arguments})}catch(t){return ks(t instanceof Error?t.message:String(t))}}function ks(e){return{isError:!0,content:[{type:"text",text:e}]}}async function t_(e,{id:t,method:o,payload:n},s){try{e.postMessage({kind:"response",id:t,payload:await o_(o,n,s)})}catch(a){e.postMessage({kind:"response",id:t,error:{code:"REQUEST_FAILED",message:a instanceof Error?a.message:String(a)}})}}async function o_(e,t,o){const n=e;switch(n){case"storage-load":case"storage-write":case"storage-read-asset":case"storage-write-asset":case"storage-has-asset":if(o==null)throw new Error("The dashboard has no document to load or save.");return i_(n,t,o);case"documents-list":case"documents-open":case"documents-new":case"documents-previews":case"documents-save-preview":case"documents-remove":return o!=null?a_(n,t,o):r_(n,t);case"analytics-consent-save":return n_(t);case"open-link":return s_(t);default:{const s=n;throw new Error(`Unsupported editor request: ${s}`)}}}async function n_(e){const t=l({answer:Al}).safeParse(e);if(!t.success)throw new Error("analytics-consent-save needs an answer");const{answer:o}=t.data,n=await X.callServerTool({name:"editor_analytics_consent",arguments:{answer:o}});if(n.isError)throw new Error(JSON.stringify(n.content));Ul=o}async function s_(e){const t=l({url:Ls()}).safeParse(e);if(!t.success)throw new Error("open-link needs a url");const{isError:o}=await X.openLink({url:t.data.url});if(o)throw new Error(`The host didn't open ${t.data.url}`)}async function i_(e,t,o){const n=async c=>{const u=await X.callServerTool({name:"editor_storage",arguments:{viewId:o.viewId,filePath:o.filePath,request:c}});if(u.isError){if(c.method==="storage-load"){const d=u.structuredContent?.kind==="replaced";Zl(d?jl(o):`pen.dev couldn't read ${Ko(o)}.`,d)}throw new Error(JSON.stringify(u.content))}return u.structuredContent},{content:s,path:a,data:r}=t??{};switch(e){case"storage-load":return n({method:e});case"storage-write":{const{saved:c}=await n({method:e,content:s??""});return c?Ao.Saved:Ao.WriteFailed}case"storage-read-asset":{const c=await n({method:e,path:a??""});return typeof c.data=="string"?Wl(c.data):void 0}case"storage-write-asset":await n({method:e,path:a??"",data:Bl(r??new Uint8Array)});return;case"storage-has-asset":return(await n({method:e,path:a??""})).exists;default:{const c=e;throw new Error(`Unsupported editor request: ${c}`)}}}async function ts(e){const t=await X.callServerTool({name:"editor_documents",arguments:{request:e}});if(t.isError)throw new Error(JSON.stringify(t.content));return t.structuredContent}async function Hl(){const{documents:e}=await ts({method:"documents-list"});return e.map(c_)}async function Fl(e){const{uris:t}=e,{previews:o}=await ts({method:"documents-previews",uris:t});return Object.fromEntries(Object.entries(o).map(([n,s])=>[n,Wl(s)]))}async function Jl(e){const{uris:t}=await ts({method:"documents-remove",uris:e.uris,removal:e.removal===vr.Delete?"delete":"recents"});return t}async function r_(e,t){switch(e){case"documents-list":return Hl();case"documents-previews":return Fl(t);case"documents-remove":return Jl(t);case"documents-open":{const{uri:o}=t,n=decodeURIComponent(new URL(o).pathname).split("/").pop();await gr(`Open ${n} in pen.dev.`,{type:"resource_link",uri:o,name:n??o});return}case"documents-new":await gr("Start a new design in pen.dev.");return;case"documents-save-preview":return;default:{const o=e;throw new Error(`Unsupported editor request: ${o}`)}}}async function gr(e,t){const o=[{type:"text",text:e}];t!=null&&o.push(t);const n={role:"user",content:o,_meta:{"openai/message":{target:"new"}}},{isError:s}=await X.sendMessage(n);if(s)throw new Error("Codex didn't start a conversation for it.")}async function a_(e,t,o){const n=ts,s=async r=>{Mn=o;try{await Sr(),await a(await r())}finally{Mn=void 0}},a=async r=>{KS(r),await n({method:"documents-release",viewId:o.viewId,filePath:o.filePath})};switch(e){case"documents-list":return Hl();case"documents-previews":return Fl(t);case"documents-open":{const{uri:r}=t;if(r===o.fileURI){await Sr(),$t(o);return}await s(()=>n({method:"documents-open",uri:r}));return}case"documents-new":await s(()=>n({method:"documents-new"}));return;case"documents-save-preview":{const{image:r}=t;await n({method:"documents-save-preview",uri:o.fileURI,data:Bl(r)});return}case"documents-remove":{const r=t,c=await Jl(r);return r.removal===vr.Delete&&c.includes(o.fileURI)&&await a(await n({method:"documents-new"})),c}default:{const r=e;throw new Error(`Unsupported editor request: ${r}`)}}}async function Sr(){if(!Ue)return;const e=Vl(await Ue("save",void 0).catch(()=>Ao.WriteFailed));if(e)throw new Error(`${e} The document stays open so its changes aren't lost.`)}function Vl(e){return e===Ao.Saved||e===Ao.NothingToSave?void 0:su(e)}function c_(e){const t=e.draft?Ei.Managed:Ei.File;return{uri:e.uri,kind:t,name:iu(e.fileName,t),folderName:e.folderName,preview:{kind:ou.None},timestamps:{createdAt:e.createdAt,lastEditedAt:e.lastEditedAt,lastOpenedAt:e.lastOpenedAt}}}function Bl(e){let t="";for(const o of e)t+=String.fromCharCode(o);return btoa(t)}function Wl(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}function l_(e,{nodes:t}){t.length===0&&!Es||(Es=t.length>0,X.updateModelContext({content:t.map(o=>({type:"text",text:`pen.dev selected node id: ${o.id}${o.name?`, name: ${o.name}`:""}, type: ${o.type}, file: ${e.filePath}`,_meta:{"openai/title":o.name??o.id}}))}).catch(()=>{}))}</script>
</head>
<body>
<div id="app">
<iframe
id="editor"
title="pen.dev editor"
allow="clipboard-read; clipboard-write"
></iframe>
<div id="status" role="status">
<img
class="logo logo-light"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAABYCAYAAADbc6GhAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAKNFJREFUeAHtnQu0JFV57/9V3efR55xh5swDRAj08BCQJCJRvOYKNIK8si4MXhVcAqeB4CMxEYg3XhJcNOCDGw2CcrOueO+dYzCPtbKiGIxEYDg9goIhwAEUIwgUUYfX4MzAPM/pUzv1VdWuvXdVddfu7uo+fYb9m6nT3VW7qqu6qr7//r5v710WgML69euHjn3b22aef/6F4+b27MHIyKhlWbAajQbm5+f9ac/uXdizZw7z3jzXdWHZNvxCFrzJhu29sf15wefg1Qom+mfbbvDR8svCXweMtlOwvTm2zfzXAEbb8grRf0ZvLPpjB9vysaJ3YIz5b12X+at4M8LZjP6A4++3ZYXr0C4F+0ffNTQ0hNFSCZMrVjBv3kOf+cxnKrfeeuser2gDBoPBYEhQ9KaFlavWNK699rpGdWrKfumll/D/16/HU08+CXdhAUPDw1i5eg0Oe9ObcOhhb8Ib938Dli9fjrGxMYyOjmDEWz5ULHoGuIhicQjFQsF7LXhG2XsteCJRIIEokLW2yWDbgWD4y0kwbK98gcoFIuKJCr2nt/y9HRh6EidvZwNhQfQ5+BCKkooyg4sJnxa8Y6Op4U3zc3PYsWMHNm3ahL/7+7+3du3ceey11167vVAolKanp42AGAyLS0WjzKw3bYWhrxSvueaay//gD//AfebpnxeHvVr4jTfdhB/dfz8mJyd94++ZXr92PjJSAnkkL3oCs2XLFgwPD3nTsC8gw76IeOJ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3/3u87CqYil6XwNDAwMDNqJvAkE4Sn4kSs++Ndvfds7P7F4UZ9d2VFx+wf6PfeVPDeWvwoPICRg2RYcPHiI7JyYsBcuOfaPV69619dZ2V0wMDAwMJgTtINAEMgE9uXv/2//5/0f+Mj6gjttj1d2BCSCcCVR5euFOKvukSnyyCM/sJYfX/rzNee++2tw9JEHfr9hRcKyDgwMDAw6CO0iEAQqfHvl775jy+VXXjt65PVf2xVKIgMLaEzEdb2xIIREvVGEBkju/d6/WCecfPrnzy+/5wtwFFoe7JvM1aQFDAwMDDoI7SQQhEciq1e+a9MVV1335Zd+VbXHx3eQBQsWUBLxBQib5p14kyPa5G/+Zpu16r2X3nbhmlU3gnFbGRgYGHQM2k0gCI9ELljznv9x5bqPff1nP5mwxnc8SEmkX4wDcQn09PSQb9z+dfjvH7z6m+88+9Q/AkMeBgYGBgYMHnl9++7vfuvcc1e6mz5/izszM0M+/od/TH7+3PPkmmvWuQ8/OvGPsqyBgYGBgQGHRwwPPfLYd8444zT3V7t3kxs+O0quvfYa96FHHv9nJlMAAwMDA4OOgwVzDySI2b/6v2N/9/wzP73ilVdeJe9eWf7bT1x79ZX8GBgYGBgYGNSBR2SXXHLNgi/cdtsSts+4rQwMDAw6GP8J7L9HA8tugoEAAAAASUVORK5CYII="
alt="pen.dev"
/>
<div id="spinner"></div>
<p id="status-text">Opening the editor…</p>
<button id="take-over" type="button" hidden>Open here</button>
<button id="retry" type="button" hidden>Try again</button>
</div>
</div>
</body>
</html>
SHA-256: c097a8007b79b8b4d425e2949d3880e1e84191cc06e3310e150ee3671693c245