context-doctor 0.46.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -4
- package/dist/ab.d.ts +51 -3
- package/dist/ab.js +71 -28
- package/dist/abclaude.d.ts +167 -0
- package/dist/abclaude.js +511 -0
- package/dist/abstore.d.ts +46 -0
- package/dist/abstore.js +58 -0
- package/dist/autopilot.js +9 -5
- package/dist/blob.js +66 -12
- package/dist/budget.d.ts +8 -2
- package/dist/budget.js +30 -7
- package/dist/ci.js +2 -1
- package/dist/claudeplugin.d.ts +97 -0
- package/dist/claudeplugin.js +142 -0
- package/dist/cli.js +128 -36
- package/dist/compactcost.d.ts +74 -0
- package/dist/compactcost.js +115 -0
- package/dist/cursor.js +2 -0
- package/dist/doctor.js +90 -18
- package/dist/extract.js +4 -3
- package/dist/fanout.d.ts +15 -0
- package/dist/fanout.js +30 -9
- package/dist/firstfix.d.ts +43 -0
- package/dist/firstfix.js +80 -0
- package/dist/fix.d.ts +53 -4
- package/dist/fix.js +101 -13
- package/dist/httpguard.d.ts +13 -0
- package/dist/httpguard.js +22 -0
- package/dist/install.d.ts +21 -9
- package/dist/install.js +213 -40
- package/dist/limits.d.ts +5 -0
- package/dist/limits.js +26 -2
- package/dist/mcp.d.ts +4 -0
- package/dist/mcp.js +142 -97
- package/dist/mcpclient.js +73 -42
- package/dist/missledger.js +5 -3
- package/dist/mod/api.d.ts +8 -2
- package/dist/mod/api.js +2 -2
- package/dist/mod/logic.d.ts +13 -1
- package/dist/mod/logic.js +24 -2
- package/dist/mod/register.d.ts +2 -0
- package/dist/mod/register.js +19 -5
- package/dist/modelids.d.ts +62 -3
- package/dist/modelids.js +156 -8
- package/dist/modelswitch.js +8 -4
- package/dist/modmeasure.js +13 -1
- package/dist/orgrates.d.ts +18 -0
- package/dist/orgrates.js +51 -2
- package/dist/pack.d.ts +13 -0
- package/dist/pack.js +38 -2
- package/dist/preferences.js +2 -1
- package/dist/pricing.d.ts +8 -0
- package/dist/pricing.js +30 -2
- package/dist/progresssummaries.d.ts +148 -0
- package/dist/progresssummaries.js +248 -0
- package/dist/proxy.d.ts +1 -1
- package/dist/proxy.js +1 -1
- package/dist/prune.d.ts +8 -0
- package/dist/prune.js +11 -1
- package/dist/spend.d.ts +34 -0
- package/dist/spend.js +48 -4
- package/dist/subagentmodel.d.ts +12 -0
- package/dist/subagentmodel.js +17 -4
- package/dist/subagentpay.d.ts +8 -0
- package/dist/subagentpay.js +8 -1
- package/dist/toolcwd.d.ts +14 -0
- package/dist/toolcwd.js +17 -0
- package/package.json +6 -3
package/dist/mcp.js
CHANGED
|
@@ -1,122 +1,167 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __cdRequire } from 'module'; const require = __cdRequire(import.meta.url);
|
|
3
|
-
var aw=Object.create;var pc=Object.defineProperty;var cw=Object.getOwnPropertyDescriptor;var uw=Object.getOwnPropertyNames;var lw=Object.getPrototypeOf,dw=Object.prototype.hasOwnProperty;var Q=(t,e)=>()=>(t&&(e=t(t=0)),e);var z=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),To=(t,e)=>{for(var r in e)pc(t,r,{get:e[r],enumerable:!0})},fw=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of uw(e))!dw.call(t,o)&&o!==r&&pc(t,o,{get:()=>e[o],enumerable:!(n=cw(e,o))||n.enumerable});return t};var mc=(t,e,r)=>(r=t!=null?aw(lw(t)):{},fw(e||!t||!t.__esModule?pc(r,"default",{value:t,enumerable:!0}):r,t));function w(t,e,r){function n(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(t),e(a,c);for(let l in i.prototype)l in a||Object.defineProperty(a,l,{value:i.prototype[l].bind(a)});a._zod.constr=i,a._zod.def=c}let o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:t});function i(a){var c;let u=r?.Parent?new s:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(i,"name",{value:t}),i}function at(t){return t&&Object.assign(Vs,t),Vs}var w$,$$,nr,Vs,Dn=Q(()=>{w$=Object.freeze({status:"aborted"});$$=Symbol("zod_brand"),nr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Vs={}});var re={};To(re,{BIGINT_FORMAT_RANGES:()=>wm,Class:()=>xc,NUMBER_FORMAT_RANGES:()=>Ec,aborted:()=>cn,allowsEval:()=>kc,assert:()=>z$,assertEqual:()=>k$,assertIs:()=>T$,assertNever:()=>E$,assertNotEqual:()=>S$,assignProp:()=>$c,cached:()=>Oo,captureStackTrace:()=>Ws,cleanEnum:()=>q$,cleanRegex:()=>Io,clone:()=>ct,createTransparentProxy:()=>I$,defineLazy:()=>me,esc:()=>an,escapeRegex:()=>xr,extend:()=>j$,finalizeIssue:()=>St,floatSafeRemainder:()=>wc,getElementAtPath:()=>R$,getEnumValues:()=>Co,getLengthableOrigin:()=>No,getParsedType:()=>A$,getSizableOrigin:()=>$m,isObject:()=>Ln,isPlainObject:()=>qn,issue:()=>zc,joinValues:()=>Js,jsonStringifyReplacer:()=>bc,merge:()=>Z$,normalizeParams:()=>q,nullish:()=>Ao,numKeys:()=>O$,omit:()=>M$,optionalKeys:()=>Tc,partial:()=>D$,pick:()=>N$,prefixIssues:()=>qt,primitiveTypes:()=>bm,promiseAllObject:()=>P$,propertyKeyTypes:()=>Sc,randomString:()=>C$,required:()=>L$,stringifyPrimitive:()=>Gs,unwrapMessage:()=>Po});function k$(t){return t}function S$(t){return t}function T$(t){}function E$(t){throw new Error}function z$(t){}function Co(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}function Js(t,e="|"){return t.map(r=>Gs(r)).join(e)}function bc(t,e){return typeof e=="bigint"?e.toString():e}function Oo(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Ao(t){return t==null}function Io(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function wc(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}function me(t,e,r){Object.defineProperty(t,e,{get(){{let o=r();return t[e]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}function $c(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function R$(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function P$(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<e.length;s++)o[e[s]]=n[s];return o})}function C$(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function an(t){return JSON.stringify(t)}function Ln(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function qn(t){if(Ln(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(Ln(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function O$(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}function xr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ct(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function q(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function I$(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}function Gs(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Tc(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function N$(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return ct(t,{...t._zod.def,shape:r,checks:[]})}function M$(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return ct(t,{...t._zod.def,shape:r,checks:[]})}function j$(t,e){if(!qn(e))throw new Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return $c(this,"shape",n),n},checks:[]};return ct(t,r)}function Z$(t,e){return ct(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return $c(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function D$(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t?new t({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return ct(e,{...e._zod.def,shape:o,checks:[]})}function L$(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return ct(e,{...e._zod.def,shape:o,checks:[]})}function cn(t,e=0){for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function qt(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function Po(t){return typeof t=="string"?t:t?.message}function St(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=Po(t.inst?._zod.def?.error?.(t))??Po(e?.error?.(t))??Po(r.customError?.(t))??Po(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function $m(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function No(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function zc(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function q$(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var Ws,kc,A$,Sc,bm,Ec,wm,xc,Ut=Q(()=>{Ws=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};kc=Oo(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});A$=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Sc=new Set(["string","number","symbol"]),bm=new Set(["string","number","bigint","boolean","symbol","undefined"]);Ec={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]},wm={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};xc=class{constructor(...e){}}});function Rc(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}function Pc(t,e){let r=e||function(s){return s.message},n={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(t),n}var km,Ks,Mo,Cc=Q(()=>{Dn();Ut();km=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,bc,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Ks=w("$ZodError",km),Mo=w("$ZodError",km,{Parent:Error})});var Oc,Ac,Ic,Nc,Mc,un,jc,ln,Zc=Q(()=>{Dn();Cc();Ut();Oc=t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new nr;if(i.issues.length){let a=new(o?.Err??t)(i.issues.map(c=>St(c,s,at())));throw Ws(a,o?.callee),a}return i.value},Ac=Oc(Mo),Ic=t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(o?.Err??t)(i.issues.map(c=>St(c,s,at())));throw Ws(a,o?.callee),a}return i.value},Nc=Ic(Mo),Mc=t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new nr;return s.issues.length?{success:!1,error:new(t??Ks)(s.issues.map(i=>St(i,o,at())))}:{success:!0,data:s.value}},un=Mc(Mo),jc=t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(i=>St(i,o,at())))}:{success:!0,data:s.value}},ln=jc(Mo)});function Im(){return new RegExp(F$,"u")}function Hm(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Bm(t){return new RegExp(`^${Hm(t)}$`)}function Vm(t){let e=Hm({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Um}T(?:${n})$`)}var Sm,Tm,Em,zm,Rm,Pm,Cm,Om,Dc,Am,F$,Nm,Mm,jm,Zm,Dm,Lc,Lm,qm,Um,Fm,Jm,Wm,Gm,Km,Xm,Ym,Qm,Ys=Q(()=>{Sm=/^[cC][^\s-]{8,}$/,Tm=/^[0-9a-z]+$/,Em=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zm=/^[0-9a-vA-V]{20}$/,Rm=/^[A-Za-z0-9]{27}$/,Pm=/^[a-zA-Z0-9_-]{21}$/,Cm=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Om=/^([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})$/,Dc=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,Am=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,F$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Nm=/^(?:(?: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])$/,Mm=/^(([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})$/,jm=/^((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])$/,Zm=/^(([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])$/,Dm=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Lc=/^[A-Za-z0-9_-]*$/,Lm=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,qm=/^\+(?:[0-9]){6,14}[0-9]$/,Um="(?:(?:\\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])))",Fm=new RegExp(`^${Um}$`);Jm=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Wm=/^\d+$/,Gm=/^-?\d+(?:\.\d+)?/i,Km=/true|false/i,Xm=/null/i,Ym=/^[^A-Z]*$/,Qm=/^[^a-z]*$/});var Ae,eh,qc,Uc,th,rh,nh,oh,sh,jo,ih,ah,ch,uh,lh,dh,fh,Qs=Q(()=>{Dn();Ys();Ut();Ae=w("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),eh={number:"number",bigint:"bigint",object:"date"},qc=w("$ZodCheckLessThan",(t,e)=>{Ae.init(t,e);let r=eh[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?o.maximum=e.value:o.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Uc=w("$ZodCheckGreaterThan",(t,e)=>{Ae.init(t,e);let r=eh[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),th=w("$ZodCheckMultipleOf",(t,e)=>{Ae.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):wc(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),rh=w("$ZodCheckNumberFormat",(t,e)=>{Ae.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=Ec[e.format];t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,a.minimum=o,a.maximum=s,r&&(a.pattern=Wm)}),t._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:e.format,code:"invalid_type",input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:t})}}),nh=w("$ZodCheckMaxLength",(t,e)=>{var r;Ae.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Ao(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<o&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let o=n.value;if(o.length<=e.maximum)return;let i=No(o);n.issues.push({origin:i,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),oh=w("$ZodCheckMinLength",(t,e)=>{var r;Ae.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Ao(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let i=No(o);n.issues.push({origin:i,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),sh=w("$ZodCheckLengthEquals",(t,e)=>{var r;Ae.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Ao(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,s=o.length;if(s===e.length)return;let i=No(o),a=s>e.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),jo=w("$ZodCheckStringFormat",(t,e)=>{var r,n;Ae.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),ih=w("$ZodCheckRegex",(t,e)=>{jo.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),ah=w("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Ym),jo.init(t,e)}),ch=w("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Qm),jo.init(t,e)}),uh=w("$ZodCheckIncludes",(t,e)=>{Ae.init(t,e);let r=xr(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),lh=w("$ZodCheckStartsWith",(t,e)=>{Ae.init(t,e);let r=new RegExp(`^${xr(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),dh=w("$ZodCheckEndsWith",(t,e)=>{Ae.init(t,e);let r=new RegExp(`.*${xr(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}}),fh=w("$ZodCheckOverwrite",(t,e)=>{Ae.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}})});var ei,Fc=Q(()=>{ei=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
|
|
4
|
-
`).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),s=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let e=Function,r=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...r,o.join(`
|
|
5
|
-
`)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (${x} in input) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
path: iss.path ? [${x}, ...iss.path] : [${x}],
|
|
16
|
-
}))
|
|
17
|
-
);
|
|
3
|
+
var EP=Object.defineProperty;var G=(e,t)=>()=>(e&&(t=e(e=0)),t);var an=(e,t)=>{for(var r in t)EP(e,r,{get:t[r],enumerable:!0})};var CP,Mc,OP,NP,jP,AP,W,Xb,MP,Dc,op=G(()=>{CP=Object.create,Mc=Object.defineProperty,OP=Object.getOwnPropertyDescriptor,NP=Object.getOwnPropertyNames,jP=Object.getPrototypeOf,AP=Object.prototype.hasOwnProperty,W=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Xb=(e,t)=>{let r={};for(var o in e)Mc(r,o,{get:e[o],enumerable:!0});return t&&Mc(r,Symbol.toStringTag,{value:"Module"}),r},MP=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=NP(t),i=0,a=n.length,s;i<a;i++)s=n[i],!AP.call(e,s)&&s!==r&&Mc(e,s,{get:(c=>t[c]).bind(null,s),enumerable:!(o=OP(t,s))||o.enumerable});return e},Dc=(e,t,r)=>(r=e!=null?CP(jP(e)):{},MP(t||!e||!e.__esModule?Mc(r,"default",{value:e,enumerable:!0}):r,e))});function Qb(e){return typeof e=="string"&&Yb.has(e.replace(/#$/,""))}function eS(e,t){if(!("$schema"in e)||typeof e.$schema!="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(DP.has(r))return"2020-12";if(Yb.has(r))return"2019-09";if(UP.has(r)||LP.has(r))return"draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var DP,Yb,UP,LP,ip=G(()=>{DP=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Yb=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),UP=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),LP=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"])});var Z={};an(Z,{BIGINT_FORMAT_RANGES:()=>Ra,CONSTANT_CATCH:()=>Vc,Class:()=>cp,NUMBER_FORMAT_RANGES:()=>za,aborted:()=>_t,allowsEval:()=>dp,assert:()=>BP,assertEqual:()=>qP,assertIs:()=>FP,assertNever:()=>ZP,assertNotEqual:()=>VP,assignProp:()=>lt,attachSchema:()=>Ia,base64ToUint8Array:()=>iS,base64urlToUint8Array:()=>uE,cached:()=>Co,captureStackTrace:()=>Lc,cleanEnum:()=>lE,cleanRegex:()=>Pn,clone:()=>Le,cloneDef:()=>KP,codePointLength:()=>Br,constantCatch:()=>gp,createTransparentProxy:()=>eE,defineLazy:()=>lp,defineLazyInternal:()=>Oe,derived:()=>pE,esc:()=>yt,escapeRegex:()=>Kt,explicitlyAborted:()=>pp,extend:()=>rE,finalizeIssue:()=>xt,floatSafeRemainder:()=>Sa,getElementAtPath:()=>GP,getEnumValues:()=>Po,getLengthableOrigin:()=>Ta,getParsedType:()=>QP,getSizableOrigin:()=>xa,hexToUint8Array:()=>mE,hide:()=>Pa,installLazyProp:()=>yE,isObject:()=>Zr,isPlainObject:()=>Jt,issue:()=>jo,joinValues:()=>M,jsonStringifyReplacer:()=>Eo,members:()=>hp,merge:()=>iE,mergeDefs:()=>sn,normalizeParams:()=>te,nullish:()=>Uc,numKeys:()=>YP,objectClone:()=>HP,omit:()=>nE,optionalKeys:()=>fp,own:()=>Yn,parsedType:()=>H,partial:()=>aE,pick:()=>tE,prefixIssues:()=>It,primitiveTypes:()=>mp,promiseAllObject:()=>WP,propertyKeyTypes:()=>ka,randomString:()=>XP,rawShape:()=>Oo,required:()=>sE,safeExtend:()=>oE,shallowClone:()=>wa,sizeCaps:()=>No,slugify:()=>up,stringifyPrimitive:()=>B,toZod:()=>ba,uint8ArrayToBase64:()=>aS,uint8ArrayToBase64url:()=>dE,uint8ArrayToHex:()=>fE,unwrapMessage:()=>To});function qP(e){return e}function VP(e){return e}function ba(){return e=>e}function FP(e){}function ZP(e){throw new Error("Unexpected value in exhaustive check")}function BP(e){}function Po(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function M(e,t="|"){return e.map(r=>B(r)).join(t)}function Eo(e,t){return typeof t=="bigint"?t.toString():t}function Co(e){return new sp(e)}function Uc(e){return e==null}function Pn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Sa(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}function lp(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==tS)return o===void 0&&(o=tS,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function HP(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function lt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Oo(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Tn(e){return Oo(e._zod.def)??e._zod.def.shape}function nS(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return lt(this,t,o),o},enumerable:!0,configurable:!0})}function rS(e,t,r){t in e?lt(e,t,r):e[t]=r}function Fr(e,t,r,o){let n=Tn(t);for(let i of r){let a=Object.getOwnPropertyDescriptor(n,i);a.enumerable&&(a.get?nS(e,i,()=>{let s=t._zod.def.shape[i];return o?o(s,i):s}):rS(e,i,o?o(a.value,i):a.value))}}function JP(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);o.enumerable&&(o.get?nS(e,r,()=>t[r]):rS(e,r,o.value))}}function sn(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function KP(e){return sn(e._zod.def)}function GP(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function WP(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function XP(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function yt(e){return JSON.stringify(e)}function up(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Zr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Jt(e){if(Zr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Zr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function wa(e){return Jt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function YP(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function Kt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Le(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function te(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw 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 eE(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function B(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function fp(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}function tE(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return Fr(i,e,qc(e,t)),Le(e,sn(r,{shape:i,checks:[]}))}function qc(e,t){let r=Tn(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw new Error(`Unrecognized key: "${String(n)}"`);t[n]&&o.push(n)}return o}function nE(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(qc(e,t)),a={};return Fr(a,e,Reflect.ownKeys(Tn(e)).filter(s=>!i.has(s))),Le(e,sn(r,{shape:a,checks:[]}))}function rE(e,t){if(!Jt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=Tn(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Le(e,sn(e._zod.def,{shape:oS(e,t)}))}function oS(e,t){let r={};return Fr(r,e,Reflect.ownKeys(Tn(e))),JP(r,t),r}function oE(e,t){if(!Jt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return Le(e,sn(e._zod.def,{shape:oS(e,t)}))}function iE(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Fr(r,e,Reflect.ownKeys(Tn(e))),Fr(r,t,Reflect.ownKeys(Tn(t)));let o=sn(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Le(e,o)}function aE(e,t,r,o="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);let s=r?new Set(qc(t,r)):void 0,c={};return Fr(c,t,Reflect.ownKeys(Tn(t)),e&&((l,u)=>s&&!s.has(u)?l:new e({type:"optional",innerType:l}))),Le(t,sn(t._zod.def,{shape:c,checks:[]}))}function sE(e,t,r){let o=r?new Set(qc(t,r)):void 0,n={};return Fr(n,t,Reflect.ownKeys(Tn(t)),(i,a)=>o&&!o.has(a)?i:new e({type:"nonoptional",innerType:i})),Le(t,sn(t._zod.def,{shape:n}))}function _t(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function pp(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function It(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function To(e){return typeof e=="string"?e:e?.message}function No(e){let t=[];for(let r of e??[]){let o=r._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;let n=o.maximum??o.length??o.size;n>=0&&t.push([n,r])}return t}function Ia(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function xt(e,t,r){var o;let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?(o=e).schema??(o.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:To(e.inst?._zod.def?.error?.(e))??To(i?.(e))??To(t?.error?.(e))??To(r.customError?.(e))??To(r.localeError?.(e))??"Invalid input",s={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(s[c]=e[c]);return s.path??(s.path=[]),s.message=a,t?.reportInput&&(s.input=e.input),s}function xa(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Br(e){let t=e.length;if(!cE.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320&&(r--,o++);return r}function Ta(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function H(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function jo(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function lE(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function iS(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function aS(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function uE(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return iS(t+r)}function dE(e){return aS(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function mE(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function fE(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}function hp(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);o.get?Object.defineProperty(e,r,{...o,enumerable:!1}):hE(e,r,o.value)}}function Yn(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Pa(e,t,r){return Yn(e,t,r,!1)}function pE(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Yn(this,r,o(this))},set(n){Yn(this,r,n)}})}return t}function hE(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Yn(this,t,r.bind(this))},set(o){Yn(this,t,o)}})}function gE(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}function Oe(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&ap!==e._zod){ap=void 0;return}ap=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,vE);let n=Xn;Xn=!1;try{let i=r(this);return Xn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),Xn=Xn||n,i}catch(i){throw delete this[t],Xn=Xn||n,i}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function yE(e,t,r,o){let n=gE(e,t);n&&Object.defineProperty(n,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:i})}})}function gp(e){let t=()=>e;return t[Vc]=!0,t}var sp,tS,Lc,dp,QP,ka,mp,za,Ra,cE,cp,ap,Xn,vE,Vc,ie=G(()=>{Qn();sp=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};tS=Symbol("evaluating");Lc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};dp=Co(()=>{if(it.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});QP=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},ka=new Set(["string","number","symbol"]),mp=new Set(["string","number","bigint","boolean","symbol","undefined"]);za={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]},Ra={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};cE=/[\uD800-\uDBFF]/;cp=class{constructor(...t){}};Xn=!1,vE={configurable:!0,get(){Xn=!0}};Vc="~constantCatch"});function _E(e){let t=cS;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return cS=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function A(e,t,r,o){let n={};function i(m){this.def=m,this.constr=d,this.traits=new Set}i.prototype=n;let a=r,s=a&&new WeakSet;function c(m,f){if(m._zod){if(m._zod.traits.has(e))return}else{vp.value=new i(f);try{Object.defineProperty(m,"_zod",vp)}finally{vp.value=void 0}}if(m._zod.traits.add(e),t(m,f),s){let y=Object.getPrototypeOf(m),v=m._zod.constr.prototype,p=y;for(;p&&p!==v;)p=Object.getPrototypeOf(p);let b=p??y;s.has(b)||(s.add(b),hp(b,a))}let h=d.prototype;for(let y in h)Object.prototype.hasOwnProperty.call(h,y)&&(y in m||(m[y]=h[y].bind(m)))}let l=o?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(m){let f=o?.Parent?_E(u):this;c(f,m);let h=f._zod.deferred;if(h){for(let v of h)v();f._zod.deferred=void 0}let y=globalThis.__zod_globalConfig?.postProcessor;return y&&y(f),f}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:m=>o?.Parent&&m instanceof o.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}function We(e){return e&&Object.assign(it,e),it}var sS,Ea,vp,cS,yp,Tt,er,it,Qn=G(()=>{ie();Ea=Object.freeze({status:"aborted"}),vp={value:void 0,enumerable:!1},cS="captureStackTrace"in Error?Error:null;yp=Symbol("zod_brand"),Tt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},er=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(sS=globalThis).__zod_globalConfig??(sS.__zod_globalConfig={});it=globalThis.__zod_globalConfig});function $E(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Eo,2)),e.message}function bE(e){this._zod.message=e}function wE(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Ca(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?wE(r,n.path[0],()=>[]).push(t(n)):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Oa(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let c=r,l=0;for(;l<s.length;){let u=s[l],d=l===s.length-1;if(u==="_errors"){d&&c._errors.push(t(a)),l++;continue}Object.prototype.hasOwnProperty.call(c,u)||Object.defineProperty(c,u,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=c[u];d&&m._errors.push(t(a)),c=m,l++}}}};return o(e),r}function Sp(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a;for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>o({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0){r.errors.push(t(s));continue}let l=r,u=0;for(;u<c.length;){let d=c[u],m=u===c.length-1;typeof d=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,d)||Object.defineProperty(l.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[d]):(l.items??(l.items=[]),(a=l.items)[d]??(a[d]={errors:[]}),l=l.items[d]),m&&l.errors.push(t(s)),u++}}};return o(e),r}function dS(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function wp(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${dS(o.path)}`);return t.join(`
|
|
4
|
+
`)}var SE,$p,lS,uS,bp,Pt,kp=G(()=>{Qn();ie();SE={get:$E,set:bE,enumerable:!0,configurable:!0},$p={value:void 0,enumerable:!1},lS=new WeakSet([Object.prototype,Error.prototype]),uS=(e,t)=>{e.name="$ZodError",$p.value=t,Object.defineProperty(e,"issues",$p),$p.value=void 0,Object.defineProperty(e,"message",SE);let r=Object.getPrototypeOf(e);lS.has(r)||(lS.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},bp=A("$ZodError",uS),Pt=A("$ZodError",uS,void 0,{Parent:Error})});function Fc(e,t){return{callee:t?.callee??e,Err:t?.Err}}function mS(e,t,r){let o;return{success:!1,get error(){return o||(o=new e(t.map(n=>xt(n,r,We()))),t=void 0,r=void 0),o},set error(n){o=n,t=void 0,r=void 0}}}function TE(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,i;if(n?(o[xE]=!0,i=n({value:t,issues:[]},o)):i=e._zod.run({value:t,issues:[]},o),i instanceof Promise)throw new Tt;return i.issues.length===0}var Ao,Zc,Mo,Bc,Do,zE,Uo,RE,IE,xE,Na,ja,Hc,PE,Jc,EE,Kc,CE,Gc,OE,Wc,NE,Xc,jE,Yc,AE,Qc,ME,zp=G(()=>{Qn();kp();ie();Ao=e=>{let t=(r,o,n,i)=>{let a=n?{...n,async:!1}:{async:!1},s=r._zod.run({value:o,issues:[]},a);if(s instanceof Promise)throw new Tt;if(s.issues.length){let c=new(i?.Err??e)(s.issues.map(l=>xt(l,a,We())));throw Lc(c,i?.callee??t),c}return s.value};return t},Zc=Ao(Pt),Mo=e=>{let t=async(r,o,n,i)=>{let a=n?{...n,async:!0}:{async:!0},s=r._zod.run({value:o,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(i?.Err??e)(s.issues.map(l=>xt(l,a,We())));throw Lc(c,i?.callee??t),c}return s.value};return t},Bc=Mo(Pt),Do=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Tt;return i.issues.length?mS(e,i.issues,n):{success:!0,data:i.value}},zE=Do(Pt);Uo=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?mS(e,i.issues,n):{success:!0,data:i.value}},RE=Uo(Pt),IE=Symbol.for("zod.compile.invalid"),xE=Symbol.for("zod.compile.fallback"),Na=((e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==IE)return!0;if(o.definite===!0&&r===void 0)return!1}return TE(e,t,r)});ja=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);return n instanceof Promise&&(n=await n),n.issues.length===0},Hc=e=>{let t=Ao(e),r=(o,n,i,a)=>{let s=i?{...i,direction:"backward"}:{direction:"backward"};return t(o,n,s,Fc(r,a))};return r},PE=Hc(Pt),Jc=e=>{let t=Ao(e),r=(o,n,i,a)=>t(o,n,i,Fc(r,a));return r},EE=Jc(Pt),Kc=e=>{let t=Mo(e),r=async(o,n,i,a)=>{let s=i?{...i,direction:"backward"}:{direction:"backward"};return await t(o,n,s,Fc(r,a))};return r},CE=Kc(Pt),Gc=e=>{let t=Mo(e),r=async(o,n,i,a)=>await t(o,n,i,Fc(r,a));return r},OE=Gc(Pt),Wc=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Do(e)(t,r,n)},NE=Wc(Pt),Xc=e=>(t,r,o)=>Do(e)(t,r,o),jE=Xc(Pt),Yc=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Uo(e)(t,r,n)},AE=Yc(Pt),Qc=e=>async(t,r,o)=>Uo(e)(t,r,o),ME=Qc(Pt)});var Gt={};an(Gt,{anyString:()=>Yp,base64:()=>Fp,base64url:()=>Zp,bigint:()=>eh,boolean:()=>th,browserEmail:()=>BE,cidrv4:()=>qp,cidrv6:()=>Vp,creditCard:()=>el,cuid:()=>Ip,cuid2:()=>xp,currencyCode:()=>Kp,date:()=>Gp,datetime:()=>Xp,domain:()=>Hp,duration:()=>Np,e164:()=>Jp,email:()=>Ap,emoji:()=>Mp,extendedDuration:()=>DE,guid:()=>jp,hex:()=>ah,hostname:()=>Bp,html5Email:()=>VE,httpProtocol:()=>Aa,iban:()=>tl,idnEmail:()=>ZE,integer:()=>Ma,ipv4:()=>Dp,ipv6:()=>Up,ksuid:()=>Ep,lowercase:()=>oh,mac:()=>Lp,md5_base64:()=>GE,md5_base64url:()=>WE,md5_hex:()=>KE,nanoid:()=>Cp,nanoidOfLength:()=>Op,null:()=>nh,number:()=>En,rfc5322Email:()=>FE,sha1_base64:()=>YE,sha1_base64url:()=>QE,sha1_hex:()=>XE,sha256_base64:()=>tC,sha256_base64url:()=>nC,sha256_hex:()=>eC,sha384_base64:()=>oC,sha384_base64url:()=>iC,sha384_hex:()=>rC,sha512_base64:()=>sC,sha512_base64url:()=>cC,sha512_hex:()=>aC,string:()=>Qp,time:()=>Wp,ulid:()=>Tp,undefined:()=>rh,unicodeEmail:()=>fS,uppercase:()=>ih,uuid:()=>Hr,uuid4:()=>UE,uuid6:()=>LE,uuid7:()=>qE,xid:()=>Pp});function Op(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}function Mp(){return new RegExp(HE,"u")}function JE(e){return new RegExp(`^${e}$`)}function Rp(e){let 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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Wp(e){return new RegExp(`^${Rp(e)}$`)}function Xp(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Rp({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Rp({precision:e.precision})}`:r;return new RegExp(`^${pS}T(?:${o})$`)}function Da(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Ua(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Ip,xp,Tp,Pp,Ep,Cp,Np,DE,jp,Hr,UE,LE,qE,Ap,VE,FE,fS,ZE,BE,HE,Dp,Up,Lp,qp,Vp,Fp,Zp,Bp,Hp,Aa,Jp,el,Kp,tl,pS,Gp,Yp,Qp,eh,Ma,En,th,nh,rh,oh,ih,ah,KE,GE,WE,XE,YE,QE,eC,tC,nC,rC,oC,iC,aC,sC,cC,Jr=G(()=>{ie();Ip=/^[cC][0-9a-z]{6,}$/,xp=/^[0-9a-z]+$/,Tp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Pp=/^[0-9a-vA-V]{20}$/,Ep=/^[A-Za-z0-9]{27}$/,Cp=/^[a-zA-Z0-9_-]{21}$/;Np=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,DE=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,jp=/^([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})$/,Hr=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)$/,UE=Hr(4),LE=Hr(6),qE=Hr(7),Ap=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,VE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,FE=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,fS=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ZE=fS,BE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,HE="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";Dp=/^(?:(?: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])$/,Up=/^(([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}|:))$/,Lp=e=>{let t=Kt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},qp=/^((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])$/,Vp=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Zp=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Bp=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Hp=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Aa=/^https?$/,Jp=/^\+[1-9]\d{6,14}$/,el=/^\d(?:[ -]?\d){11,18}$/,Kp=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,tl=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,pS="(?:(?:\\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])))";Gp=JE(pS);Yp=/^[\s\S]{0,}$/,Qp=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},eh=/^-?\d+n?$/,Ma=/^-?\d+$/,En=/^-?\d+(?:\.\d+)?$/,th=/^(?:true|false)$/i,nh=/^null$/i,rh=/^undefined$/i,oh=/^[^A-Z]*$/,ih=/^[^a-z]*$/,ah=/^[0-9a-fA-F]*$/;KE=/^[0-9a-fA-F]{32}$/,GE=Da(22,"=="),WE=Ua(22),XE=/^[0-9a-fA-F]{40}$/,YE=Da(27,"="),QE=Ua(27),eC=/^[0-9a-fA-F]{64}$/,tC=Da(43,"="),nC=Ua(43),rC=/^[0-9a-fA-F]{96}$/,oC=Da(64,""),iC=Ua(64),aC=/^[0-9a-fA-F]{128}$/,sC=Da(86,"=="),cC=Ua(86)});function rl(e,t,r){e.issues.length&&t.issues.push(...It(r,e.issues))}var Be,sh,ch,nl,ol,il,lh,uh,dh,mh,fh,ph,hh,gh,vh,Lo,yh,_h,$h,bh,Sh,wh,kh,zh,Rh,Ih,al=G(()=>{Qn();Jr();ie();Be=A("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),sh=e=>{let t=e.value;return!Uc(t)&&t.size!==void 0},ch=e=>{let t=e.value;return!Uc(t)&&t.length!==void 0},nl={number:"number",bigint:"bigint",object:"date"},ol=A("$ZodCheckLessThan",(e,t)=>{Be.init(e,t);let r=nl[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:nl[typeof o.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),il=A("$ZodCheckGreaterThan",(e,t)=>{Be.init(e,t);let r=nl[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:nl[typeof o.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),lh=A("$ZodCheckMultipleOf",(e,t)=>{Be.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):Sa(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),uh=A("$ZodCheckNumberFormat",(e,t)=>{Be.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=za[t.format];e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),dh=A("$ZodCheckBigIntFormat",(e,t)=>{Be.init(e,t);let[r,o]=Ra[t.format];e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),mh=A("$ZodCheckMaxSize",(e,t)=>{var r;Be.init(e,t),(r=e._zod.def).when??(r.when=sh),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:xa(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),fh=A("$ZodCheckMinSize",(e,t)=>{var r;Be.init(e,t),(r=e._zod.def).when??(r.when=sh),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:xa(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ph=A("$ZodCheckSizeEquals",(e,t)=>{var r;Be.init(e,t),(r=e._zod.def).when??(r.when=sh),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:xa(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),hh=A("$ZodCheckMaxLength",(e,t)=>{var r;Be.init(e,t),(r=e._zod.def).when??(r.when=ch),e._zod.check=o=>{let n=o.value,i=n.length;if((typeof n=="string"&&i>t.maximum?Br(n):i)<=t.maximum)return;let s=Ta(n);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),gh=A("$ZodCheckMinLength",(e,t)=>{var r;Be.init(e,t),(r=e._zod.def).when??(r.when=ch),e._zod.check=o=>{let n=o.value,i=n.length;if((typeof n=="string"&&i>=t.minimum&&i<t.minimum*2?Br(n):i)>=t.minimum)return;let s=Ta(n);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),vh=A("$ZodCheckLengthEquals",(e,t)=>{var r;Be.init(e,t),(r=e._zod.def).when??(r.when=ch),e._zod.check=o=>{let n=o.value,i=n.length,a=typeof n=="string"&&i>=t.length&&i<=t.length*2?Br(n):i;if(a===t.length)return;let s=Ta(n),c=a>t.length;o.issues.push({origin:s,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Lo=A("$ZodCheckStringFormat",(e,t)=>{var r,o;Be.init(e,t),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),yh=A("$ZodCheckRegex",(e,t)=>{Lo.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_h=A("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=oh),Lo.init(e,t)}),$h=A("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ih),Lo.init(e,t)}),bh=A("$ZodCheckIncludes",(e,t)=>{Be.init(e,t);let r=Kt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Sh=A("$ZodCheckStartsWith",(e,t)=>{Be.init(e,t);let r=new RegExp(`^${Kt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),wh=A("$ZodCheckEndsWith",(e,t)=>{Be.init(e,t);let r=new RegExp(`.*${Kt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});kh=A("$ZodCheckProperty",(e,t)=>{Be.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>rl(n,r,t.property));rl(o,r,t.property)}}),zh=A("$ZodCheckProperties",(e,t)=>{Be.init(e,t),Pa(e,Symbol.iterator,function*(){yield e});let r;e._zod.check=o=>{if(o.value==null){o.issues.push({expected:"object",code:"invalid_type",input:o.value,inst:e});return}r??(r=Reflect.ownKeys(t.shape).map(a=>[a,t.shape[a]]));let n=o.value,i;for(let[a,s]of r){let c=s._zod.run({value:n[a],issues:[]},{});c instanceof Promise?(i??(i=[]),i.push(c.then(l=>rl(l,o,a)))):rl(c,o,a)}if(i)return Promise.all(i).then(()=>{})}}),Rh=A("$ZodCheckMimeType",(e,t)=>{Be.init(e,t);let r=new Set(t.mime);e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Ih=A("$ZodCheckOverwrite",(e,t)=>{Be.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var Kr,sl=G(()=>{Kr=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
5
|
+
`).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
6
|
+
${r.join(`
|
|
7
|
+
`)}
|
|
8
|
+
};`)(...Object.values(this.closed))}}});var xh,Th=G(()=>{xh={major:4,minor:6,patch:7}});async function lC(e,t){let r={async:!0};return ES(await e._zod.run({value:t,issues:[]},r),r)}function ml(e){return{validate:t=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return ES(o,r)}catch{}return lC(e,t)},vendor:"zod",version:1}}function jh(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function fl(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?jh(e)||La:CS(e,t)}function CS(e,t){if(!t.normalize&&t.protocol?.source===Aa.source&&!/^https?:\/\//i.test(e))return Nh;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??La}return new URL(e)}catch{return La}}function qa(e){return e.replace(uC,"")}function pl(e,t){return t.lastIndex=0,t.test(e.hostname)}function hl(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}function Va(e){return dC.test(e)?jh(`http://[${e}]`):!1}function gl(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);return`${n}`!==o||n<0||n>128?!1:Va(r)}function Fa(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function yl(e){if(!Za.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Fa(r)}function fC(e){let t=e.length,r=1,o=0;for(;t;){let n=e.charCodeAt(--t)-48;r^=1,o+=r?[0,2,4,6,8,1,3,5,7,9][n]:n}return o%10===0}function _l(e){return el.test(e)?fC(e.replace(mC,"")):!1}function pC(e){let t=0,r=e.length;for(let o=4;o<r;o++){let n=e.charCodeAt(o);t=(n>=65?t*100+(n-55):t*10+(n-48))%97}for(let o=0;o<4;o++){let n=e.charCodeAt(o);t=(n>=65?t*100+(n-55):t*10+(n-48))%97}return t===1}function $l(e){return tl.test(e)?pC(e):!1}function bl(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}function gg(e,t){let r=No(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map(i=>i[0])),n=e._zod.parse;e._zod.parse=(i,a)=>{let s=t(i.value);if(s>o&&!a?.skipChecks&&a?.direction!=="backward"){for(let[c,l]of No(e._zod.def.checks))if(s>c&&l._zod.def.when(i)){let u=i.issues.length;return l._zod.check(i),i.issues[u].continue=!1,Ia(i.issues,u,e),i}}return n(i,a)}}function gS(e,t,r){e.issues.length&&t.issues.push(...It(r,e.issues)),t.value[r]=e.value}function dl(e,t,r,o,n,i){let a=r in o,s=i==="optional";if(!(!a&&s&&n==="optional")){if(e.issues.length){if(n!==void 0&&s&&!a)return;t.issues.push(...It(r,e.issues))}if(!a&&n===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(a||n==="defaulted"&&!s)&&(t.value[r]=void 0):t.value[r]=e.value}}function OS(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:yC,n=o.length?[...t,...o]:t;for(let a of n)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(a)}": expected a Zod schema`);let i=fp(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function NS(e,t,r,o,n,i,a){let s=[],c=n.keySet,l=n.catchall._zod,u=l.def.type,d=l.optin,m=l.optout,f=0;for(let h in t){if(a&&r.issues.length!==f){if(_t(r,f))break;f=r.issues.length}if(c.has(h))continue;if(h==="__proto__"){u==="never"&&s.push(h);continue}if(u==="never"){s.push(h);continue}let y=l.run({value:t[h],issues:[]},o);y instanceof Promise?e.push(y.then(v=>dl(v,r,h,t,d,m))):dl(y,r,h,t,d,m)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>r):r}function vS(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!_t(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>xt(a,o,We())))}),t)}function yS(e,t,r,o){let n=[];for(let i=0;i<e.length;i++)e[i].issues.length===0&&n.push(i);return n.length===1?(t.value=e[n[0]].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>xt(a,o,We())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1,matches:n}),t)}function $g(e,t){let r=e._zod,o=r.bag.optionsMap;o||(o=AS(r.def),r.bag.optionsMap=o);let n=o.get(t);if(n===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return n}function AS(e){let t=new Map;for(let r of e.options){let o=r._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let n of o)if(t.has(n)){if(n!==void 0)throw new Error(`Duplicate discriminator value "${String(n)}"`);t.set(n,null)}else t.set(n,r)}return t}function qo(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(Jt(e)&&Jt(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};Object.prototype.hasOwnProperty.call(n,"__proto__")&&delete n.__proto__;for(let i of o){if(i==="__proto__")continue;let a=qo(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=qo(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function _S(e,t,r){let o=new Map,n,i=new Map,a=(l,u)=>{let d;if(l.code==="unrecognized_keys"&&!l.path?.length)n??(n=l),d=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let m=String(l.path[0]);i.has(m)||i.set(m,l),d=[m]}else return!1;for(let m of d)o.has(m)||o.set(m,{}),o.get(m)[u]=!0;return!0};for(let l of t.issues)a(l,"l")||e.issues.push(l);for(let l of r.issues)a(l,"r")||e.issues.push(l);let s=[...o].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length){let l=n?s.filter(u=>n.keys.includes(u)):[];l.length&&e.issues.push({...n,keys:l});for(let u of s)!l.includes(u)&&i.has(u)&&e.issues.push(i.get(u))}let c=qo(t.value,r.value);if(!c.valid){if(_t(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}function $S(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function bS(e,t,r){e.issues.length&&t.issues.push(...It(r,e.issues)),t.value[r]=e.value}function SS(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(!s&&i>=n&&r[i]._zod.optin==="optional"){t.value.length=i;break}if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...It(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}function wS(e,t,r,o,n,i,a){e.issues.length&&(ka.has(typeof o)?r.issues.push(...It(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>xt(s,a,We()))})),t.issues.length&&(ka.has(typeof o)?r.issues.push(...It(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>xt(s,a,We()))})),r.value.set(e.value,t.value)}function kS(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function zS(e,t){return e.value=t.issues.length?void 0:t.value,e}function RS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function IS(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function xS(e,t,r,o){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(n=>xt(n,o,We()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}function cl(e,t,r){return e.issues.some(o=>o.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}function ll(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>ul(e,i,t.out,r)):ul(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>ul(e,i,t.in,r)):ul(e,n,t.in,r)}}function ul(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}function TS(e){return e.memo||(e.value=Object.freeze(e.value)),e}function _C(e){let t=e._zod.def,r=t.pattern,o=!!t.format?.includes("int"),n,i;for(let s of t.checks??[]){let c=s._zod.def;c.pattern&&(r=c.pattern),o||(o=!!c.format?.includes("int"));let l=c.minimum??c.length,u=c.maximum??c.length;l!==void 0&&(n===void 0||l>n)&&(n=l),u!==void 0&&(i===void 0||u<i)&&(i=u)}if(r)return r.source;if(n!==void 0&&i!==void 0&&n>i)return"(?!)";if(n!==void 0||i!==void 0)return Qp({minimum:n,maximum:i}).source;let a=e._zod.pattern;return(o&&a===En?Ma:a)?.source}function Ph(e){let t=e._zod.def,r=e._zod.pattern?.source,o=t.innerType??e._zod.innerType;if(o){let n=o._zod.pattern?.source,i=Ph(o);return r&&n&&i&&i!==n?r.replace(Pn(n),()=>Pn(i)):r}if(t.options){let n=t.options.map(Ph);if(n.every(Boolean))return`^(${n.map(i=>Pn(i)).join("|")})$`}return _C(e)}function PS(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(jo(n))}}var ze,ES,Gr,qe,Eh,Ch,Oh,Nh,La,uC,Ah,Mh,Dh,Uh,Lh,qh,Vh,Fh,Zh,Bh,Hh,Jh,Kh,dC,Gh,Wh,Xh,Yh,vl,Qh,Za,eg,tg,mC,ng,rg,og,ig,Sl,ag,Ba,wl,sg,cg,lg,ug,dg,mg,fg,pg,hg,hC,gC,vC,vg,yC,jS,yg,Ha,_g,bg,Sg,kl,wg,kg,zg,Rg,Ig,xg,Tg,zl,Pg,Eg,Cg,Og,Ng,jg,Ag,Mg,Rl,Ja,Dg,Ug,Lg,qg,Vg,Ka,Fg,Vo=G(()=>{al();Qn();sl();zp();Jr();ie();Th();ie();ze=A("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=xh;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let i of n)for(let a of i._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(s,c,l)=>{if(s.memo)return s;let u=_t(s),d;for(let m of c){if(m._zod.def.when){if(pp(s)||!m._zod.def.when(s))continue}else if(u)continue;let f=s.issues.length,h=m._zod.check(s);if(h instanceof Promise&&l?.async===!1)throw new Tt;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,s.issues.length!==f&&(Ia(s.issues,f,e),u||(u=_t(s,f)))});else{if(s.issues.length===f)continue;Ia(s.issues,f,e),u||(u=_t(s,f))}}return d?d.then(()=>s):s},a=(s,c,l)=>{if(_t(s))return s.aborted=!0,s;let u=i(c,n,l);if(u instanceof Promise){if(l.async===!1)throw new Tt;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(s,c)=>{if(c.skipChecks)return e._zod.parse(s,c);if(c.direction==="backward"){let u=e._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>a(d,s,c)):a(u,s,c)}let l=e._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new Tt;return l.then(u=>i(u,n,c))}return i(l,n,c)}}},{get"~standard"(){return Pa(this,"~standard",ml(this))},set"~standard"(e){Yn(this,"~standard",e)}}),ES=(e,t)=>e.issues.length?{issues:e.issues.map(r=>xt(r,t,We()))}:{value:e.value};Gr=A("$ZodString",(e,t)=>{ze.init(e,t),e._zod.pattern=t.pattern??Yp,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),qe=A("$ZodStringFormat",(e,t)=>{Lo.init(e,t),Gr.init(e,t)}),Eh=A("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=jp),qe.init(e,t)}),Ch=A("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Hr(o))}else t.pattern??(t.pattern=Hr());qe.init(e,t)}),Oh=A("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ap),qe.init(e,t)}),Nh=1,La=2;uC=/[\t\n\r]/g;Ah=A("$ZodURL",(e,t)=>{qe.init(e,t),e._zod.check=r=>{try{let o=r.value.trim(),n=fl(o,t);if(n===Nh){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===La){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=qa(o);return}t.hostname&&!pl(n,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!hl(n,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?n.href:qa(o);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Mh=A("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Mp()),qe.init(e,t)}),Dh=A("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Cp:Op(t.length)),qe.init(e,t)}),Uh=A("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ip),qe.init(e,t)}),Lh=A("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=xp),qe.init(e,t)}),qh=A("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Tp),qe.init(e,t)}),Vh=A("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Pp),qe.init(e,t)}),Fh=A("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ep),qe.init(e,t)}),Zh=A("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xp(t)),qe.init(e,t)}),Bh=A("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Gp),qe.init(e,t)}),Hh=A("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Wp(t)),qe.init(e,t)}),Jh=A("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Np),qe.init(e,t)}),Kh=A("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Dp),qe.init(e,t)}),dC=/^[0-9a-fA-F:.]+$/;Gh=A("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Up),qe.init(e,t),e._zod.check=r=>{Va(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),Wh=A("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Lp(t.delimiter)),qe.init(e,t)}),Xh=A("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=qp),qe.init(e,t)});Yh=A("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Vp),qe.init(e,t),e._zod.check=r=>{gl(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});vl=/^[0-9a-zA-Z+/]*={0,2}$/,Qh=A("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=vl),qe.init(e,t),e._zod.check=r=>{Fa(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Za=/^[A-Za-z0-9_-]*$/;eg=A("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Za),qe.init(e,t),e._zod.check=r=>{yl(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),tg=A("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Jp),qe.init(e,t)}),mC=/[- ]/g;ng=A("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=el),qe.init(e,t),e._zod.check=r=>{_l(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort})}});rg=A("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=tl),qe.init(e,t),e._zod.check=r=>{$l(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:e,continue:!t.abort})}});og=A("$ZodJWT",(e,t)=>{qe.init(e,t),e._zod.check=r=>{bl(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),ig=A("$ZodCustomStringFormat",(e,t)=>{qe.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Sl=A("$ZodNumber",(e,t)=>{ze.init(e,t),e._zod.pattern=En,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:String(n):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),ag=A("$ZodNumberFormat",(e,t)=>{uh.init(e,t),Sl.init(e,t)}),Ba=A("$ZodBoolean",(e,t)=>{ze.init(e,t),e._zod.pattern=th,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),wl=A("$ZodBigInt",(e,t)=>{ze.init(e,t),e._zod.pattern=eh,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),sg=A("$ZodBigIntFormat",(e,t)=>{dh.init(e,t),wl.init(e,t)}),cg=A("$ZodSymbol",(e,t)=>{ze.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),lg=A("$ZodUndefined",(e,t)=>{ze.init(e,t),e._zod.pattern=rh,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),ug=A("$ZodNull",(e,t)=>{ze.init(e,t),e._zod.pattern=nh,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),dg=A("$ZodAny",(e,t)=>{ze.init(e,t),e._zod.parse=r=>r}),mg=A("$ZodUnknown",(e,t)=>{ze.init(e,t),e._zod.parse=r=>r}),fg=A("$ZodNever",(e,t)=>{ze.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),pg=A("$ZodVoid",(e,t)=>{ze.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),hg=A("$ZodDate",(e,t)=>{ze.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});hC=e=>Array.isArray(e)?e.length:-1,gC=e=>e instanceof Map?e.size:-1,vC=e=>e instanceof Set?e.size:-1;vg=A("$ZodArray",(e,t)=>{ze.init(e,t);let r=it.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),o;o.value=r?r.alloc(e,o,Array(i.length),n):Array(i.length);let a=[],s=n?.abortEarly;for(let c=0;c<i.length;c++){let l=i[c],u=t.element._zod.run({value:l,issues:[]},n);if(u instanceof Promise)a.push(u.then(d=>gS(d,o,c)));else if(gS(u,o,c),s&&u.issues.length!==0&&_t(u))break}return a.length?Promise.all(a).then(()=>o):o},gg(e,hC)});yC=[];jS=A("$ZodObject",(e,t)=>{ze.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let l=()=>{let u={...o};return Object.defineProperty(t,"shape",{value:u}),l.raw=u,u};l.raw=o,Object.defineProperty(t,"shape",{get:l})}let n=Co(()=>OS(t));Oe(e,"propValues",l=>{let u=l.def.shape,d={};for(let m in u){let f=u[m]._zod;if(f.values){Object.prototype.hasOwnProperty.call(d,m)||lt(d,m,new Set);for(let h of f.values)d[m].add(h);f.optin!==void 0&&d[m].add(void 0)}}return d});let i=Zr,a=t.catchall,s,c=it.memoizer;c?.attach(e),e._zod.parse=(l,u)=>{s??(s=n.value);let d=l.value;if(!i(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l;l.value=c?c.alloc(e,l,{},u):{};let m=[],f=s.shape,h=u?.abortEarly,y=l.issues.length;for(let v of s.allKeys){if(h&&l.issues.length!==y){if(_t(l,y))break;y=l.issues.length}if(v==="__proto__")continue;let p=f[v],b=p._zod.optin,g=p._zod.optout,S=p._zod.run({value:d[v],issues:[]},u);S instanceof Promise?m.push(S.then(T=>dl(T,l,v,d,b,g))):dl(S,l,v,d,b,g)}return a?NS(m,d,l,u,n.value,e,h===!0):m.length?Promise.all(m).then(()=>l):l}}),yg=A("$ZodObjectJIT",(e,t)=>{jS.init(e,t);let r=e._zod.parse,o=Co(()=>OS(t)),n=it.memoizer,i=f=>{let h=o.value,y=h.symbolKeys,v=new Kr(["payload","ctx"],{shape:f,inst:e,memo:n,syms:y}),p=T=>`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`,b=(T,R)=>`
|
|
9
|
+
let ${T}_ab = false;
|
|
10
|
+
for (let i = 0; i < ${T}.issues.length; i++) {
|
|
11
|
+
const iss = ${T}.issues[i];
|
|
12
|
+
iss.path = iss.path ? [${R}, ...iss.path] : [${R}];
|
|
13
|
+
payload.issues.push(iss);
|
|
14
|
+
if (iss.continue !== true) ${T}_ab = true;
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
newResult[${
|
|
16
|
+
if (${T}_ab && ctx && ctx.abortEarly) {
|
|
17
|
+
payload.value = newResult;
|
|
18
|
+
return payload;
|
|
19
|
+
}`;v.write("const input = payload.value;");let g=Object.create(null),S=0;for(let T of h.allKeys)g[T]=`key_${S++}`;v.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let T of h.allKeys){if(T==="__proto__")continue;let R=g[T],w=typeof T=="symbol"?`syms[${y.indexOf(T)}]`:yt(T),z=`${w} in input`,P=f[T],U=P?._zod?.optin,O=U!==void 0,D=P?._zod?.optout==="optional";if(v.write(`const ${R} = ${p(w)};`),O&&D){let Y=U==="optional"?`${R}_present`:`${R}.value !== undefined || ${R}_present`;v.write(`
|
|
20
|
+
const ${R}_present = ${z};
|
|
21
|
+
if (!${R}.issues.length || ${R}_present) {
|
|
22
|
+
if (${R}.issues.length) {${b(R,w)}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (${Y}) {
|
|
26
|
+
newResult[${w}] = ${R}.value;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
`)}else O?(v.write(`
|
|
31
|
+
if (${R}.issues.length) {${b(R,w)}
|
|
32
|
+
}
|
|
33
|
+
`),U==="defaulted"?v.write(`newResult[${w}] = ${R}.value;`):v.write(`
|
|
34
|
+
if (${R}.value !== undefined || ${z}) {
|
|
35
|
+
newResult[${w}] = ${R}.value;
|
|
36
|
+
}
|
|
37
|
+
`)):v.write(`
|
|
38
|
+
const ${R}_present = ${z};
|
|
39
|
+
if (${R}.issues.length) {${b(R,w)}
|
|
40
|
+
}
|
|
41
|
+
if (!${R}_present && !${R}.issues.length) {
|
|
42
|
+
payload.issues.push({
|
|
43
|
+
code: "invalid_type",
|
|
44
|
+
expected: "nonoptional",
|
|
45
|
+
input: undefined,
|
|
46
|
+
path: [${w}]
|
|
47
|
+
});
|
|
48
|
+
if (ctx && ctx.abortEarly) {
|
|
49
|
+
payload.value = newResult;
|
|
50
|
+
return payload;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (${R}_present) {
|
|
55
|
+
newResult[${w}] = ${R}.value;
|
|
23
56
|
}
|
|
24
|
-
|
|
25
|
-
if (${y}.issues.length) payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
})));`),m.write(`newResult[${an(v)}] = ${y}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");let _=m.compile();return(v,y)=>_(d,v,y)},o,s=Ln,i=!Vs.jitless,c=i&&kc.value,u=e.catchall,l;t._zod.parse=(d,m)=>{l??(l=r.value);let p=d.value;if(!s(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),d;let f=[];if(i&&c&&m?.async===!1&&m.jitless!==!0)o||(o=n(e.shape)),d=o(d,m);else{d.value={};let y=l.shape;for(let x of l.keys){let $=y[x],I=$._zod.run({value:p[x],issues:[]},m),U=$._zod.optin==="optional"&&$._zod.optout==="optional";I instanceof Promise?f.push(I.then(H=>U?gh(H,d,x,p):ti(H,d,x))):U?gh(I,d,x,p):ti(I,d,x)}}if(!u)return f.length?Promise.all(f).then(()=>d):d;let h=[],g=l.keySet,_=u._zod,v=_.def.type;for(let y of Object.keys(p)){if(g.has(y))continue;if(v==="never"){h.push(y);continue}let x=_.run({value:p[y],issues:[]},m);x instanceof Promise?f.push(x.then($=>ti($,d,y))):ti(x,d,y)}return h.length&&d.issues.push({code:"unrecognized_keys",keys:h,input:p,inst:t}),f.length?Promise.all(f).then(()=>d):d}});oi=w("$ZodUnion",(t,e)=>{de.init(t,e),me(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),me(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),me(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),me(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>Io(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let o=!1,s=[];for(let i of e.options){let a=i._zod.run({value:r.value,issues:[]},n);if(a instanceof Promise)s.push(a),o=!0;else{if(a.issues.length===0)return a;s.push(a)}}return o?Promise.all(s).then(i=>yh(i,r,t,n)):yh(s,r,t,n)}}),yu=w("$ZodDiscriminatedUnion",(t,e)=>{oi.init(t,e);let r=t._zod.parse;me(t._zod,"propValues",()=>{let o={};for(let s of e.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[a,c]of Object.entries(i)){o[a]||(o[a]=new Set);for(let u of c)o[a].add(u)}}return o});let n=Oo(()=>{let o=e.options,s=new Map;for(let i of o){let a=i._zod.propValues[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});t._zod.parse=(o,s)=>{let i=o.value;if(!Ln(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:t}),o;let a=n.value.get(i?.[e.discriminator]);return a?a._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:i,path:[e.discriminator],inst:t}),o)}}),_u=w("$ZodIntersection",(t,e)=>{de.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),i=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>_h(r,c,u)):_h(r,s,i)}});vu=w("$ZodRecord",(t,e)=>{de.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!qn(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[];if(e.keyType._zod.values){let i=e.keyType._zod.values;r.value={};for(let c of i)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){let u=e.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(l=>{l.issues.length&&r.issues.push(...qt(c,l.issues)),r.value[c]=l.value})):(u.issues.length&&r.issues.push(...qt(c,u.issues)),r.value[c]=u.value)}let a;for(let c in o)i.has(c)||(a=a??[],a.push(c));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:a})}else{r.value={};for(let i of Reflect.ownKeys(o)){if(i==="__proto__")continue;let a=e.keyType._zod.run({value:i,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>St(u,n,at())),input:i,path:[i],inst:t}),r.value[a.value]=a.value;continue}let c=e.valueType._zod.run({value:o[i],issues:[]},n);c instanceof Promise?s.push(c.then(u=>{u.issues.length&&r.issues.push(...qt(i,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...qt(i,c.issues)),r.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>r):r}}),xu=w("$ZodEnum",(t,e)=>{de.init(t,e);let r=Co(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>Sc.has(typeof n)).map(n=>typeof n=="string"?xr(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return t._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),bu=w("$ZodLiteral",(t,e)=>{de.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?xr(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{let o=r.value;return t._zod.values.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),wu=w("$ZodTransform",(t,e)=>{de.init(t,e),t._zod.parse=(r,n)=>{let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r));if(o instanceof Promise)throw new nr;return r.value=o,r}}),$u=w("$ZodOptional",(t,e)=>{de.init(t,e),t._zod.optin="optional",t._zod.optout="optional",me(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),me(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Io(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n)}),ku=w("$ZodNullable",(t,e)=>{de.init(t,e),me(t._zod,"optin",()=>e.innerType._zod.optin),me(t._zod,"optout",()=>e.innerType._zod.optout),me(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Io(r.source)}|null)$`):void 0}),me(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),Su=w("$ZodDefault",(t,e)=>{de.init(t,e),t._zod.optin="optional",me(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>vh(s,e)):vh(o,e)}});Tu=w("$ZodPrefault",(t,e)=>{de.init(t,e),t._zod.optin="optional",me(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),Eu=w("$ZodNonOptional",(t,e)=>{de.init(t,e),me(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>xh(s,t)):xh(o,t)}});zu=w("$ZodCatch",(t,e)=>{de.init(t,e),t._zod.optin="optional",me(t._zod,"optout",()=>e.innerType._zod.optout),me(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(i=>St(i,n,at()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>St(s,n,at()))},input:r.value}),r.issues=[]),r)}}),Ru=w("$ZodPipe",(t,e)=>{de.init(t,e),me(t._zod,"values",()=>e.in._zod.values),me(t._zod,"optin",()=>e.in._zod.optin),me(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>bh(s,e,n)):bh(o,e,n)}});Pu=w("$ZodReadonly",(t,e)=>{de.init(t,e),me(t._zod,"propValues",()=>e.innerType._zod.propValues),me(t._zod,"values",()=>e.innerType._zod.values),me(t._zod,"optin",()=>e.innerType._zod.optin),me(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(wh):wh(o)}});Cu=w("$ZodCustom",(t,e)=>{Ae.init(t,e),de.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>$h(s,r,n,t));$h(o,r,n,t)}})});function Ph(){return{localeError:J$()}}var V$,J$,Ch=Q(()=>{Ut();V$=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},J$=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(n){return t[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${V$(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Gs(n.values[0])}`:`Invalid option: expected one of ${Js(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Js(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});var si=Q(()=>{});function Oh(){return new Do}var W$,G$,Do,br,Au=Q(()=>{W$=Symbol("ZodOutput"),G$=Symbol("ZodInput"),Do=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};br=Oh()});function Iu(t,e){return new t({type:"string",...q(e)})}function Nu(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...q(e)})}function ii(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...q(e)})}function Mu(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...q(e)})}function ju(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...q(e)})}function Zu(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...q(e)})}function Du(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...q(e)})}function Lu(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...q(e)})}function qu(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...q(e)})}function Uu(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...q(e)})}function Fu(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...q(e)})}function Hu(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...q(e)})}function Bu(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...q(e)})}function Vu(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...q(e)})}function Ju(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...q(e)})}function Wu(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...q(e)})}function Gu(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...q(e)})}function Ku(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...q(e)})}function Xu(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...q(e)})}function Yu(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...q(e)})}function Qu(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...q(e)})}function el(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...q(e)})}function tl(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...q(e)})}function Ah(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...q(e)})}function Ih(t,e){return new t({type:"string",format:"date",check:"string_format",...q(e)})}function Nh(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...q(e)})}function Mh(t,e){return new t({type:"string",format:"duration",check:"string_format",...q(e)})}function rl(t,e){return new t({type:"number",checks:[],...q(e)})}function nl(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...q(e)})}function ol(t,e){return new t({type:"boolean",...q(e)})}function sl(t,e){return new t({type:"null",...q(e)})}function il(t){return new t({type:"unknown"})}function al(t,e){return new t({type:"never",...q(e)})}function ai(t,e){return new qc({check:"less_than",...q(e),value:t,inclusive:!1})}function Lo(t,e){return new qc({check:"less_than",...q(e),value:t,inclusive:!0})}function ci(t,e){return new Uc({check:"greater_than",...q(e),value:t,inclusive:!1})}function qo(t,e){return new Uc({check:"greater_than",...q(e),value:t,inclusive:!0})}function ui(t,e){return new th({check:"multiple_of",...q(e),value:t})}function li(t,e){return new nh({check:"max_length",...q(e),maximum:t})}function Un(t,e){return new oh({check:"min_length",...q(e),minimum:t})}function di(t,e){return new sh({check:"length_equals",...q(e),length:t})}function cl(t,e){return new ih({check:"string_format",format:"regex",...q(e),pattern:t})}function ul(t){return new ah({check:"string_format",format:"lowercase",...q(t)})}function ll(t){return new ch({check:"string_format",format:"uppercase",...q(t)})}function dl(t,e){return new uh({check:"string_format",format:"includes",...q(e),includes:t})}function fl(t,e){return new lh({check:"string_format",format:"starts_with",...q(e),prefix:t})}function pl(t,e){return new dh({check:"string_format",format:"ends_with",...q(e),suffix:t})}function dn(t){return new fh({check:"overwrite",tx:t})}function ml(t){return dn(e=>e.normalize(t))}function hl(){return dn(t=>t.trim())}function gl(){return dn(t=>t.toLowerCase())}function yl(){return dn(t=>t.toUpperCase())}function jh(t,e,r){return new t({type:"array",element:e,...q(r)})}function _l(t,e,r){let n=q(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function vl(t,e,r){return new t({type:"custom",check:"custom",fn:e,...q(r)})}var Zh=Q(()=>{Qs();Ut()});var Dh=Q(()=>{});function xl(t,e){if(t instanceof Do){let n=new fi(e),o={};for(let a of t._idmap.entries()){let[c,u]=a;n.process(u)}let s={},i={registry:t,uri:e?.uri,defs:o};for(let a of t._idmap.entries()){let[c,u]=a;s[c]=n.emit(u,{...e,external:i})}if(Object.keys(o).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[a]:o}}return{schemas:s}}let r=new fi(e);return r.process(t),r.emit(t,e)}function Ee(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Ee(o.element,r);case"object":{for(let s in o.shape)if(Ee(o.shape[s],r))return!0;return!1}case"union":{for(let s of o.options)if(Ee(s,r))return!0;return!1}case"intersection":return Ee(o.left,r)||Ee(o.right,r);case"tuple":{for(let s of o.items)if(Ee(s,r))return!0;return!!(o.rest&&Ee(o.rest,r))}case"record":return Ee(o.keyType,r)||Ee(o.valueType,r);case"map":return Ee(o.keyType,r)||Ee(o.valueType,r);case"set":return Ee(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Ee(o.innerType,r);case"lazy":return Ee(o.getter(),r);case"default":return Ee(o.innerType,r);case"prefault":return Ee(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Ee(o.in,r)||Ee(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}var fi,Lh=Q(()=>{Au();Ut();fi=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??br,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},i=this.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,a);let c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path},m=e._zod.parent;if(m)a.ref=m,this.process(m,d),this.seen.get(m).isParent=!0;else{let p=a.schema;switch(o.type){case"string":{let f=p;f.type="string";let{minimum:h,maximum:g,format:_,patterns:v,contentEncoding:y}=e._zod.bag;if(typeof h=="number"&&(f.minLength=h),typeof g=="number"&&(f.maxLength=g),_&&(f.format=s[_]??_,f.format===""&&delete f.format),y&&(f.contentEncoding=y),v&&v.size>0){let x=[...v];x.length===1?f.pattern=x[0].source:x.length>1&&(a.schema.allOf=[...x.map($=>({...this.target==="draft-7"?{type:"string"}:{},pattern:$.source}))])}break}case"number":{let f=p,{minimum:h,maximum:g,format:_,multipleOf:v,exclusiveMaximum:y,exclusiveMinimum:x}=e._zod.bag;typeof _=="string"&&_.includes("int")?f.type="integer":f.type="number",typeof x=="number"&&(f.exclusiveMinimum=x),typeof h=="number"&&(f.minimum=h,typeof x=="number"&&(x>=h?delete f.minimum:delete f.exclusiveMinimum)),typeof y=="number"&&(f.exclusiveMaximum=y),typeof g=="number"&&(f.maximum=g,typeof y=="number"&&(y<=g?delete f.maximum:delete f.exclusiveMaximum)),typeof v=="number"&&(f.multipleOf=v);break}case"boolean":{let f=p;f.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{p.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{p.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let f=p,{minimum:h,maximum:g}=e._zod.bag;typeof h=="number"&&(f.minItems=h),typeof g=="number"&&(f.maxItems=g),f.type="array",f.items=this.process(o.element,{...d,path:[...d.path,"items"]});break}case"object":{let f=p;f.type="object",f.properties={};let h=o.shape;for(let v in h)f.properties[v]=this.process(h[v],{...d,path:[...d.path,"properties",v]});let g=new Set(Object.keys(h)),_=new Set([...g].filter(v=>{let y=o.shape[v]._zod;return this.io==="input"?y.optin===void 0:y.optout===void 0}));_.size>0&&(f.required=Array.from(_)),o.catchall?._zod.def.type==="never"?f.additionalProperties=!1:o.catchall?o.catchall&&(f.additionalProperties=this.process(o.catchall,{...d,path:[...d.path,"additionalProperties"]})):this.io==="output"&&(f.additionalProperties=!1);break}case"union":{let f=p;f.anyOf=o.options.map((h,g)=>this.process(h,{...d,path:[...d.path,"anyOf",g]}));break}case"intersection":{let f=p,h=this.process(o.left,{...d,path:[...d.path,"allOf",0]}),g=this.process(o.right,{...d,path:[...d.path,"allOf",1]}),_=y=>"allOf"in y&&Object.keys(y).length===1,v=[..._(h)?h.allOf:[h],..._(g)?g.allOf:[g]];f.allOf=v;break}case"tuple":{let f=p;f.type="array";let h=o.items.map((v,y)=>this.process(v,{...d,path:[...d.path,"prefixItems",y]}));if(this.target==="draft-2020-12"?f.prefixItems=h:f.items=h,o.rest){let v=this.process(o.rest,{...d,path:[...d.path,"items"]});this.target==="draft-2020-12"?f.items=v:f.additionalItems=v}o.rest&&(f.items=this.process(o.rest,{...d,path:[...d.path,"items"]}));let{minimum:g,maximum:_}=e._zod.bag;typeof g=="number"&&(f.minItems=g),typeof _=="number"&&(f.maxItems=_);break}case"record":{let f=p;f.type="object",f.propertyNames=this.process(o.keyType,{...d,path:[...d.path,"propertyNames"]}),f.additionalProperties=this.process(o.valueType,{...d,path:[...d.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let f=p,h=Co(o.entries);h.every(g=>typeof g=="number")&&(f.type="number"),h.every(g=>typeof g=="string")&&(f.type="string"),f.enum=h;break}case"literal":{let f=p,h=[];for(let g of o.values)if(g===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof g=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");h.push(Number(g))}else h.push(g);if(h.length!==0)if(h.length===1){let g=h[0];f.type=g===null?"null":typeof g,f.const=g}else h.every(g=>typeof g=="number")&&(f.type="number"),h.every(g=>typeof g=="string")&&(f.type="string"),h.every(g=>typeof g=="boolean")&&(f.type="string"),h.every(g=>g===null)&&(f.type="null"),f.enum=h;break}case"file":{let f=p,h={type:"string",format:"binary",contentEncoding:"binary"},{minimum:g,maximum:_,mime:v}=e._zod.bag;g!==void 0&&(h.minLength=g),_!==void 0&&(h.maxLength=_),v?v.length===1?(h.contentMediaType=v[0],Object.assign(f,h)):f.anyOf=v.map(y=>({...h,contentMediaType:y})):Object.assign(f,h);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let f=this.process(o.innerType,d);p.anyOf=[f,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,d),a.ref=o.innerType;break}case"success":{let f=p;f.type="boolean";break}case"default":{this.process(o.innerType,d),a.ref=o.innerType,p.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,d),a.ref=o.innerType,this.io==="input"&&(p._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,d),a.ref=o.innerType;let f;try{f=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}p.default=f;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let f=p,h=e._zod.pattern;if(!h)throw new Error("Pattern not found in template literal");f.type="string",f.pattern=h.source;break}case"pipe":{let f=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(f,d),a.ref=f;break}case"readonly":{this.process(o.innerType,d),a.ref=o.innerType,p.readOnly=!0;break}case"promise":{this.process(o.innerType,d),a.ref=o.innerType;break}case"optional":{this.process(o.innerType,d),a.ref=o.innerType;break}case"lazy":{let f=e._zod.innerType;this.process(f,d),a.ref=f;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let u=this.metadataRegistry.get(e);return u&&Object.assign(a.schema,u),this.io==="input"&&Ee(e)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let s=l=>{let d=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let h=n.external.registry.get(l[0])?.id,g=n.external.uri??(v=>v);if(h)return{ref:g(h)};let _=l[1].defId??l[1].schema.id??`schema${this.counter++}`;return l[1].defId=_,{defId:_,ref:`${g("__shared")}#/${d}/${_}`}}if(l[1]===o)return{ref:"#"};let p=`#/${d}/`,f=l[1].schema.id??`__schema${this.counter++}`;return{defId:f,ref:p+f}},i=l=>{if(l[1].schema.$ref)return;let d=l[1],{ref:m,defId:p}=s(l);d.def={...d.schema},p&&(d.defId=p);let f=d.schema;for(let h in f)delete f[h];f.$ref=m};if(n.cycles==="throw")for(let l of this.seen.entries()){let d=l[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
|
|
29
|
-
|
|
30
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let l of this.seen.entries()){let d=l[1];if(e===l[0]){i(l);continue}if(n.external){let p=n.external.registry.get(l[0])?.id;if(e!==l[0]&&p){i(l);continue}}if(this.metadataRegistry.get(l[0])?.id){i(l);continue}if(d.cycle){i(l);continue}if(d.count>1&&n.reused==="ref"){i(l);continue}}let a=(l,d)=>{let m=this.seen.get(l),p=m.def??m.schema,f={...p};if(m.ref===null)return;let h=m.ref;if(m.ref=null,h){a(h,d);let g=this.seen.get(h).schema;g.$ref&&d.target==="draft-7"?(p.allOf=p.allOf??[],p.allOf.push(g)):(Object.assign(p,g),Object.assign(p,f))}m.isParent||this.override({zodSchema:l,jsonSchema:p,path:m.path??[]})};for(let l of[...this.seen.entries()].reverse())a(l[0],{target:this.target});let c={};if(this.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?c.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let l=n.external.registry.get(e)?.id;if(!l)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(l)}Object.assign(c,o.def);let u=n.external?.defs??{};for(let l of this.seen.entries()){let d=l[1];d.def&&d.defId&&(u[d.defId]=d.def)}n.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}}});var qh=Q(()=>{});var He=Q(()=>{Dn();Zc();Cc();Rh();Qs();Hc();Ut();Ys();si();Au();Fc();Dh();Zh();Lh();qh()});var wl=Q(()=>{He()});var Uo={};To(Uo,{ZodISODate:()=>Bh,ZodISODateTime:()=>Hh,ZodISODuration:()=>Jh,ZodISOTime:()=>Vh,date:()=>kl,datetime:()=>$l,duration:()=>Tl,time:()=>Sl});function $l(t){return Ah(Hh,t)}function kl(t){return Ih(Bh,t)}function Sl(t){return Nh(Vh,t)}function Tl(t){return Mh(Jh,t)}var Hh,Bh,Vh,Jh,El=Q(()=>{He();zl();Hh=w("ZodISODateTime",(t,e)=>{kh.init(t,e),be.init(t,e)});Bh=w("ZodISODate",(t,e)=>{Sh.init(t,e),be.init(t,e)});Vh=w("ZodISOTime",(t,e)=>{Th.init(t,e),be.init(t,e)});Jh=w("ZodISODuration",(t,e)=>{Eh.init(t,e),be.init(t,e)})});var Wh,_Z,Fo,Rl=Q(()=>{He();He();Wh=(t,e)=>{Ks.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>Pc(t,r)},flatten:{value:r=>Rc(t,r)},addIssue:{value:r=>t.issues.push(r)},addIssues:{value:r=>t.issues.push(...r)},isEmpty:{get(){return t.issues.length===0}}})},_Z=w("ZodError",Wh),Fo=w("ZodError",Wh,{Parent:Error})});var Gh,Kh,Xh,Yh,Pl=Q(()=>{He();Rl();Gh=Oc(Fo),Kh=Ic(Fo),Xh=Mc(Fo),Yh=jc(Fo)});function b(t){return Iu(qk,t)}function le(t){return rl(ng,t)}function eg(t){return nl(sS,t)}function Pe(t){return ol(iS,t)}function og(t){return sl(aS,t)}function we(){return il(cS)}function lS(t){return al(uS,t)}function ne(t,e){return jh(dS,t,e)}function C(t,e){let r={type:"object",get shape(){return re.assignProp(this,"shape",{...t}),this.shape},...re.normalizeParams(e)};return new sg(r)}function Be(t,e){return new sg({type:"object",get shape(){return re.assignProp(this,"shape",{...t}),this.shape},catchall:we(),...re.normalizeParams(e)})}function ye(t,e){return new ig({type:"union",options:t,...re.normalizeParams(e)})}function Al(t,e,r){return new fS({type:"union",options:e,discriminator:t,...re.normalizeParams(r)})}function gi(t,e){return new pS({type:"intersection",left:t,right:e})}function ge(t,e,r){return new mS({type:"record",keyType:t,valueType:e,...re.normalizeParams(r)})}function et(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Cl({type:"enum",entries:r,...re.normalizeParams(e)})}function M(t,e){return new hS({type:"literal",values:Array.isArray(t)?t:[t],...re.normalizeParams(e)})}function ag(t){return new gS({type:"transform",transform:t})}function $e(t){return new cg({type:"optional",innerType:t})}function tg(t){return new yS({type:"nullable",innerType:t})}function vS(t,e){return new _S({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function bS(t,e){return new xS({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function wS(t,e){return new ug({type:"nonoptional",innerType:t,...re.normalizeParams(e)})}function kS(t,e){return new $S({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function Ol(t,e){return new SS({type:"pipe",in:t,out:e})}function ES(t){return new TS({type:"readonly",innerType:t})}function zS(t){let e=new Ae({check:"custom"});return e._zod.check=t,e}function dg(t,e){return _l(lg,t??(()=>!0),e)}function RS(t,e={}){return vl(lg,t,e)}function PS(t){let e=zS(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(re.issue(n,r.value,e._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),r.issues.push(re.issue(o))}},t(r.value,r)));return e}function Il(t,e){return Ol(ag(t),e)}var Se,rg,qk,be,Uk,Qh,hi,Fk,Hk,Bk,Vk,Jk,Wk,Gk,Kk,Xk,Yk,Qk,eS,tS,rS,nS,oS,ng,sS,iS,aS,cS,uS,dS,sg,ig,fS,pS,mS,Cl,hS,gS,cg,yS,_S,xS,ug,$S,SS,TS,lg,zl=Q(()=>{He();He();wl();El();Pl();Se=w("ZodType",(t,e)=>(de.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>ct(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>Gh(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Xh(t,r,n),t.parseAsync=async(r,n)=>Kh(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Yh(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(RS(r,n)),t.superRefine=r=>t.check(PS(r)),t.overwrite=r=>t.check(dn(r)),t.optional=()=>$e(t),t.nullable=()=>tg(t),t.nullish=()=>$e(tg(t)),t.nonoptional=r=>wS(t,r),t.array=()=>ne(t),t.or=r=>ye([t,r]),t.and=r=>gi(t,r),t.transform=r=>Ol(t,ag(r)),t.default=r=>vS(t,r),t.prefault=r=>bS(t,r),t.catch=r=>kS(t,r),t.pipe=r=>Ol(t,r),t.readonly=()=>ES(t),t.describe=r=>{let n=t.clone();return br.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return br.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return br.get(t);let n=t.clone();return br.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),rg=w("_ZodString",(t,e)=>{Zo.init(t,e),Se.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(cl(...n)),t.includes=(...n)=>t.check(dl(...n)),t.startsWith=(...n)=>t.check(fl(...n)),t.endsWith=(...n)=>t.check(pl(...n)),t.min=(...n)=>t.check(Un(...n)),t.max=(...n)=>t.check(li(...n)),t.length=(...n)=>t.check(di(...n)),t.nonempty=(...n)=>t.check(Un(1,...n)),t.lowercase=n=>t.check(ul(n)),t.uppercase=n=>t.check(ll(n)),t.trim=()=>t.check(hl()),t.normalize=(...n)=>t.check(ml(...n)),t.toLowerCase=()=>t.check(gl()),t.toUpperCase=()=>t.check(yl())}),qk=w("ZodString",(t,e)=>{Zo.init(t,e),rg.init(t,e),t.email=r=>t.check(Nu(Uk,r)),t.url=r=>t.check(Lu(Fk,r)),t.jwt=r=>t.check(tl(oS,r)),t.emoji=r=>t.check(qu(Hk,r)),t.guid=r=>t.check(ii(Qh,r)),t.uuid=r=>t.check(Mu(hi,r)),t.uuidv4=r=>t.check(ju(hi,r)),t.uuidv6=r=>t.check(Zu(hi,r)),t.uuidv7=r=>t.check(Du(hi,r)),t.nanoid=r=>t.check(Uu(Bk,r)),t.guid=r=>t.check(ii(Qh,r)),t.cuid=r=>t.check(Fu(Vk,r)),t.cuid2=r=>t.check(Hu(Jk,r)),t.ulid=r=>t.check(Bu(Wk,r)),t.base64=r=>t.check(Yu(tS,r)),t.base64url=r=>t.check(Qu(rS,r)),t.xid=r=>t.check(Vu(Gk,r)),t.ksuid=r=>t.check(Ju(Kk,r)),t.ipv4=r=>t.check(Wu(Xk,r)),t.ipv6=r=>t.check(Gu(Yk,r)),t.cidrv4=r=>t.check(Ku(Qk,r)),t.cidrv6=r=>t.check(Xu(eS,r)),t.e164=r=>t.check(el(nS,r)),t.datetime=r=>t.check($l(r)),t.date=r=>t.check(kl(r)),t.time=r=>t.check(Sl(r)),t.duration=r=>t.check(Tl(r))});be=w("ZodStringFormat",(t,e)=>{he.init(t,e),rg.init(t,e)}),Uk=w("ZodEmail",(t,e)=>{Wc.init(t,e),be.init(t,e)}),Qh=w("ZodGUID",(t,e)=>{Vc.init(t,e),be.init(t,e)}),hi=w("ZodUUID",(t,e)=>{Jc.init(t,e),be.init(t,e)}),Fk=w("ZodURL",(t,e)=>{Gc.init(t,e),be.init(t,e)}),Hk=w("ZodEmoji",(t,e)=>{Kc.init(t,e),be.init(t,e)}),Bk=w("ZodNanoID",(t,e)=>{Xc.init(t,e),be.init(t,e)}),Vk=w("ZodCUID",(t,e)=>{Yc.init(t,e),be.init(t,e)}),Jk=w("ZodCUID2",(t,e)=>{Qc.init(t,e),be.init(t,e)}),Wk=w("ZodULID",(t,e)=>{eu.init(t,e),be.init(t,e)}),Gk=w("ZodXID",(t,e)=>{tu.init(t,e),be.init(t,e)}),Kk=w("ZodKSUID",(t,e)=>{ru.init(t,e),be.init(t,e)}),Xk=w("ZodIPv4",(t,e)=>{nu.init(t,e),be.init(t,e)}),Yk=w("ZodIPv6",(t,e)=>{ou.init(t,e),be.init(t,e)}),Qk=w("ZodCIDRv4",(t,e)=>{su.init(t,e),be.init(t,e)}),eS=w("ZodCIDRv6",(t,e)=>{iu.init(t,e),be.init(t,e)}),tS=w("ZodBase64",(t,e)=>{au.init(t,e),be.init(t,e)}),rS=w("ZodBase64URL",(t,e)=>{cu.init(t,e),be.init(t,e)}),nS=w("ZodE164",(t,e)=>{uu.init(t,e),be.init(t,e)}),oS=w("ZodJWT",(t,e)=>{lu.init(t,e),be.init(t,e)}),ng=w("ZodNumber",(t,e)=>{ri.init(t,e),Se.init(t,e),t.gt=(n,o)=>t.check(ci(n,o)),t.gte=(n,o)=>t.check(qo(n,o)),t.min=(n,o)=>t.check(qo(n,o)),t.lt=(n,o)=>t.check(ai(n,o)),t.lte=(n,o)=>t.check(Lo(n,o)),t.max=(n,o)=>t.check(Lo(n,o)),t.int=n=>t.check(eg(n)),t.safe=n=>t.check(eg(n)),t.positive=n=>t.check(ci(0,n)),t.nonnegative=n=>t.check(qo(0,n)),t.negative=n=>t.check(ai(0,n)),t.nonpositive=n=>t.check(Lo(0,n)),t.multipleOf=(n,o)=>t.check(ui(n,o)),t.step=(n,o)=>t.check(ui(n,o)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});sS=w("ZodNumberFormat",(t,e)=>{du.init(t,e),ng.init(t,e)});iS=w("ZodBoolean",(t,e)=>{fu.init(t,e),Se.init(t,e)});aS=w("ZodNull",(t,e)=>{pu.init(t,e),Se.init(t,e)});cS=w("ZodUnknown",(t,e)=>{mu.init(t,e),Se.init(t,e)});uS=w("ZodNever",(t,e)=>{hu.init(t,e),Se.init(t,e)});dS=w("ZodArray",(t,e)=>{gu.init(t,e),Se.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(Un(r,n)),t.nonempty=r=>t.check(Un(1,r)),t.max=(r,n)=>t.check(li(r,n)),t.length=(r,n)=>t.check(di(r,n)),t.unwrap=()=>t.element});sg=w("ZodObject",(t,e)=>{ni.init(t,e),Se.init(t,e),re.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>et(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:we()}),t.loose=()=>t.clone({...t._zod.def,catchall:we()}),t.strict=()=>t.clone({...t._zod.def,catchall:lS()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>re.extend(t,r),t.merge=r=>re.merge(t,r),t.pick=r=>re.pick(t,r),t.omit=r=>re.omit(t,r),t.partial=(...r)=>re.partial(cg,t,r[0]),t.required=(...r)=>re.required(ug,t,r[0])});ig=w("ZodUnion",(t,e)=>{oi.init(t,e),Se.init(t,e),t.options=e.options});fS=w("ZodDiscriminatedUnion",(t,e)=>{ig.init(t,e),yu.init(t,e)});pS=w("ZodIntersection",(t,e)=>{_u.init(t,e),Se.init(t,e)});mS=w("ZodRecord",(t,e)=>{vu.init(t,e),Se.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});Cl=w("ZodEnum",(t,e)=>{xu.init(t,e),Se.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let i of n)if(r.has(i))s[i]=e.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Cl({...e,checks:[],...re.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Cl({...e,checks:[],...re.normalizeParams(o),entries:s})}});hS=w("ZodLiteral",(t,e)=>{bu.init(t,e),Se.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});gS=w("ZodTransform",(t,e)=>{wu.init(t,e),Se.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(re.issue(s,r.value,e));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=t),i.continue??(i.continue=!0),r.issues.push(re.issue(i))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});cg=w("ZodOptional",(t,e)=>{$u.init(t,e),Se.init(t,e),t.unwrap=()=>t._zod.def.innerType});yS=w("ZodNullable",(t,e)=>{ku.init(t,e),Se.init(t,e),t.unwrap=()=>t._zod.def.innerType});_S=w("ZodDefault",(t,e)=>{Su.init(t,e),Se.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});xS=w("ZodPrefault",(t,e)=>{Tu.init(t,e),Se.init(t,e),t.unwrap=()=>t._zod.def.innerType});ug=w("ZodNonOptional",(t,e)=>{Eu.init(t,e),Se.init(t,e),t.unwrap=()=>t._zod.def.innerType});$S=w("ZodCatch",(t,e)=>{zu.init(t,e),Se.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});SS=w("ZodPipe",(t,e)=>{Ru.init(t,e),Se.init(t,e),t.in=e.in,t.out=e.out});TS=w("ZodReadonly",(t,e)=>{Pu.init(t,e),Se.init(t,e)});lg=w("ZodCustom",(t,e)=>{Cu.init(t,e),Se.init(t,e)})});var fg=Q(()=>{});var pg=Q(()=>{});var mg=Q(()=>{He();zl();wl();Rl();Pl();fg();He();Ch();si();El();pg();at(Ph())});var hg=Q(()=>{mg()});var gg=Q(()=>{hg()});function Cg(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function Og(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var Ml,yg,Vn,kr,_i,ze,_g,vg,IZ,AS,IS,jl,ut,Ho,xg,Ie,pt,mt,Ne,vi,bg,or,wg,$g,Zl,sr,A,Dl,Jn,Bo,NZ,xi,NS,bi,MS,Vo,Bn,kg,jS,ZS,DS,LS,qS,US,wi,Ll,FS,HS,ql,$i,BS,VS,ki,JS,Jo,Wo,WS,Go,Wn,GS,Ko,Si,Ti,Ei,MZ,zi,Ri,Pi,Sg,Tg,Eg,Ul,zg,Xo,Gn,Rg,KS,Ci,XS,Oi,YS,Fl,QS,Ai,eT,tT,rT,nT,oT,sT,iT,aT,cT,uT,Ii,lT,dT,Ni,Hl,Bl,Vl,fT,pT,mT,Jl,hT,gT,yT,_T,vT,Pg,Mi,xT,ji,jZ,bT,Kn,wT,ZZ,Yo,$T,Wl,kT,ST,TT,ET,zT,RT,PT,yi,CT,OT,AT,Qo,Gl,IT,NT,MT,jT,ZT,DT,LT,qT,UT,FT,HT,BT,VT,JT,WT,GT,KT,XT,Xn,YT,QT,eE,Zi,tE,rE,nE,Kl,oE,DZ,LZ,qZ,UZ,FZ,HZ,O,Nl,Sr=Q(()=>{gg();Ml="2025-11-25",yg="2025-03-26",Vn=[Ml,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],kr="io.modelcontextprotocol/related-task",_i="2.0",ze=dg(t=>t!==null&&(typeof t=="object"||typeof t=="function")),_g=ye([b(),le().int()]),vg=b(),IZ=Be({ttl:le().optional(),pollInterval:le().optional()}),AS=C({ttl:le().optional()}),IS=C({taskId:b()}),jl=Be({progressToken:_g.optional(),[kr]:IS.optional()}),ut=C({_meta:jl.optional()}),Ho=ut.extend({task:AS.optional()}),xg=t=>Ho.safeParse(t).success,Ie=C({method:b(),params:ut.loose().optional()}),pt=C({_meta:jl.optional()}),mt=C({method:b(),params:pt.loose().optional()}),Ne=Be({_meta:jl.optional()}),vi=ye([b(),le().int()]),bg=C({jsonrpc:M(_i),id:vi,...Ie.shape}).strict(),or=t=>bg.safeParse(t).success,wg=C({jsonrpc:M(_i),...mt.shape}).strict(),$g=t=>wg.safeParse(t).success,Zl=C({jsonrpc:M(_i),id:vi,result:Ne}).strict(),sr=t=>Zl.safeParse(t).success;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(A||(A={}));Dl=C({jsonrpc:M(_i),id:vi.optional(),error:C({code:le().int(),message:b(),data:we().optional()})}).strict(),Jn=t=>Dl.safeParse(t).success,Bo=ye([bg,wg,Zl,Dl]),NZ=ye([Zl,Dl]),xi=Ne.strict(),NS=pt.extend({requestId:vi.optional(),reason:b().optional()}),bi=mt.extend({method:M("notifications/cancelled"),params:NS}),MS=C({src:b(),mimeType:b().optional(),sizes:ne(b()).optional(),theme:et(["light","dark"]).optional()}),Vo=C({icons:ne(MS).optional()}),Bn=C({name:b(),title:b().optional()}),kg=Bn.extend({...Bn.shape,...Vo.shape,version:b(),websiteUrl:b().optional(),description:b().optional()}),jS=gi(C({applyDefaults:Pe().optional()}),ge(b(),we())),ZS=Il(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,gi(C({form:jS.optional(),url:ze.optional()}),ge(b(),we()).optional())),DS=Be({list:ze.optional(),cancel:ze.optional(),requests:Be({sampling:Be({createMessage:ze.optional()}).optional(),elicitation:Be({create:ze.optional()}).optional()}).optional()}),LS=Be({list:ze.optional(),cancel:ze.optional(),requests:Be({tools:Be({call:ze.optional()}).optional()}).optional()}),qS=C({experimental:ge(b(),ze).optional(),sampling:C({context:ze.optional(),tools:ze.optional()}).optional(),elicitation:ZS.optional(),roots:C({listChanged:Pe().optional()}).optional(),tasks:DS.optional(),extensions:ge(b(),ze).optional()}),US=ut.extend({protocolVersion:b(),capabilities:qS,clientInfo:kg}),wi=Ie.extend({method:M("initialize"),params:US}),Ll=t=>wi.safeParse(t).success,FS=C({experimental:ge(b(),ze).optional(),logging:ze.optional(),completions:ze.optional(),prompts:C({listChanged:Pe().optional()}).optional(),resources:C({subscribe:Pe().optional(),listChanged:Pe().optional()}).optional(),tools:C({listChanged:Pe().optional()}).optional(),tasks:LS.optional(),extensions:ge(b(),ze).optional()}),HS=Ne.extend({protocolVersion:b(),capabilities:FS,serverInfo:kg,instructions:b().optional()}),ql=mt.extend({method:M("notifications/initialized"),params:pt.optional()}),$i=Ie.extend({method:M("ping"),params:ut.optional()}),BS=C({progress:le(),total:$e(le()),message:$e(b())}),VS=C({...pt.shape,...BS.shape,progressToken:_g}),ki=mt.extend({method:M("notifications/progress"),params:VS}),JS=ut.extend({cursor:vg.optional()}),Jo=Ie.extend({params:JS.optional()}),Wo=Ne.extend({nextCursor:vg.optional()}),WS=et(["working","input_required","completed","failed","cancelled"]),Go=C({taskId:b(),status:WS,ttl:ye([le(),og()]),createdAt:b(),lastUpdatedAt:b(),pollInterval:$e(le()),statusMessage:$e(b())}),Wn=Ne.extend({task:Go}),GS=pt.merge(Go),Ko=mt.extend({method:M("notifications/tasks/status"),params:GS}),Si=Ie.extend({method:M("tasks/get"),params:ut.extend({taskId:b()})}),Ti=Ne.merge(Go),Ei=Ie.extend({method:M("tasks/result"),params:ut.extend({taskId:b()})}),MZ=Ne.loose(),zi=Jo.extend({method:M("tasks/list")}),Ri=Wo.extend({tasks:ne(Go)}),Pi=Ie.extend({method:M("tasks/cancel"),params:ut.extend({taskId:b()})}),Sg=Ne.merge(Go),Tg=C({uri:b(),mimeType:$e(b()),_meta:ge(b(),we()).optional()}),Eg=Tg.extend({text:b()}),Ul=b().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),zg=Tg.extend({blob:Ul}),Xo=et(["user","assistant"]),Gn=C({audience:ne(Xo).optional(),priority:le().min(0).max(1).optional(),lastModified:Uo.datetime({offset:!0}).optional()}),Rg=C({...Bn.shape,...Vo.shape,uri:b(),description:$e(b()),mimeType:$e(b()),size:$e(le()),annotations:Gn.optional(),_meta:$e(Be({}))}),KS=C({...Bn.shape,...Vo.shape,uriTemplate:b(),description:$e(b()),mimeType:$e(b()),annotations:Gn.optional(),_meta:$e(Be({}))}),Ci=Jo.extend({method:M("resources/list")}),XS=Wo.extend({resources:ne(Rg)}),Oi=Jo.extend({method:M("resources/templates/list")}),YS=Wo.extend({resourceTemplates:ne(KS)}),Fl=ut.extend({uri:b()}),QS=Fl,Ai=Ie.extend({method:M("resources/read"),params:QS}),eT=Ne.extend({contents:ne(ye([Eg,zg]))}),tT=mt.extend({method:M("notifications/resources/list_changed"),params:pt.optional()}),rT=Fl,nT=Ie.extend({method:M("resources/subscribe"),params:rT}),oT=Fl,sT=Ie.extend({method:M("resources/unsubscribe"),params:oT}),iT=pt.extend({uri:b()}),aT=mt.extend({method:M("notifications/resources/updated"),params:iT}),cT=C({name:b(),description:$e(b()),required:$e(Pe())}),uT=C({...Bn.shape,...Vo.shape,description:$e(b()),arguments:$e(ne(cT)),_meta:$e(Be({}))}),Ii=Jo.extend({method:M("prompts/list")}),lT=Wo.extend({prompts:ne(uT)}),dT=ut.extend({name:b(),arguments:ge(b(),b()).optional()}),Ni=Ie.extend({method:M("prompts/get"),params:dT}),Hl=C({type:M("text"),text:b(),annotations:Gn.optional(),_meta:ge(b(),we()).optional()}),Bl=C({type:M("image"),data:Ul,mimeType:b(),annotations:Gn.optional(),_meta:ge(b(),we()).optional()}),Vl=C({type:M("audio"),data:Ul,mimeType:b(),annotations:Gn.optional(),_meta:ge(b(),we()).optional()}),fT=C({type:M("tool_use"),name:b(),id:b(),input:ge(b(),we()),_meta:ge(b(),we()).optional()}),pT=C({type:M("resource"),resource:ye([Eg,zg]),annotations:Gn.optional(),_meta:ge(b(),we()).optional()}),mT=Rg.extend({type:M("resource_link")}),Jl=ye([Hl,Bl,Vl,mT,pT]),hT=C({role:Xo,content:Jl}),gT=Ne.extend({description:b().optional(),messages:ne(hT)}),yT=mt.extend({method:M("notifications/prompts/list_changed"),params:pt.optional()}),_T=C({title:b().optional(),readOnlyHint:Pe().optional(),destructiveHint:Pe().optional(),idempotentHint:Pe().optional(),openWorldHint:Pe().optional()}),vT=C({taskSupport:et(["required","optional","forbidden"]).optional()}),Pg=C({...Bn.shape,...Vo.shape,description:b().optional(),inputSchema:C({type:M("object"),properties:ge(b(),ze).optional(),required:ne(b()).optional()}).catchall(we()),outputSchema:C({type:M("object"),properties:ge(b(),ze).optional(),required:ne(b()).optional()}).catchall(we()).optional(),annotations:_T.optional(),execution:vT.optional(),_meta:ge(b(),we()).optional()}),Mi=Jo.extend({method:M("tools/list")}),xT=Wo.extend({tools:ne(Pg)}),ji=Ne.extend({content:ne(Jl).default([]),structuredContent:ge(b(),we()).optional(),isError:Pe().optional()}),jZ=ji.or(Ne.extend({toolResult:we()})),bT=Ho.extend({name:b(),arguments:ge(b(),we()).optional()}),Kn=Ie.extend({method:M("tools/call"),params:bT}),wT=mt.extend({method:M("notifications/tools/list_changed"),params:pt.optional()}),ZZ=C({autoRefresh:Pe().default(!0),debounceMs:le().int().nonnegative().default(300)}),Yo=et(["debug","info","notice","warning","error","critical","alert","emergency"]),$T=ut.extend({level:Yo}),Wl=Ie.extend({method:M("logging/setLevel"),params:$T}),kT=pt.extend({level:Yo,logger:b().optional(),data:we()}),ST=mt.extend({method:M("notifications/message"),params:kT}),TT=C({name:b().optional()}),ET=C({hints:ne(TT).optional(),costPriority:le().min(0).max(1).optional(),speedPriority:le().min(0).max(1).optional(),intelligencePriority:le().min(0).max(1).optional()}),zT=C({mode:et(["auto","required","none"]).optional()}),RT=C({type:M("tool_result"),toolUseId:b().describe("The unique identifier for the corresponding tool call."),content:ne(Jl).default([]),structuredContent:C({}).loose().optional(),isError:Pe().optional(),_meta:ge(b(),we()).optional()}),PT=Al("type",[Hl,Bl,Vl]),yi=Al("type",[Hl,Bl,Vl,fT,RT]),CT=C({role:Xo,content:ye([yi,ne(yi)]),_meta:ge(b(),we()).optional()}),OT=Ho.extend({messages:ne(CT),modelPreferences:ET.optional(),systemPrompt:b().optional(),includeContext:et(["none","thisServer","allServers"]).optional(),temperature:le().optional(),maxTokens:le().int(),stopSequences:ne(b()).optional(),metadata:ze.optional(),tools:ne(Pg).optional(),toolChoice:zT.optional()}),AT=Ie.extend({method:M("sampling/createMessage"),params:OT}),Qo=Ne.extend({model:b(),stopReason:$e(et(["endTurn","stopSequence","maxTokens"]).or(b())),role:Xo,content:PT}),Gl=Ne.extend({model:b(),stopReason:$e(et(["endTurn","stopSequence","maxTokens","toolUse"]).or(b())),role:Xo,content:ye([yi,ne(yi)])}),IT=C({type:M("boolean"),title:b().optional(),description:b().optional(),default:Pe().optional()}),NT=C({type:M("string"),title:b().optional(),description:b().optional(),minLength:le().optional(),maxLength:le().optional(),format:et(["email","uri","date","date-time"]).optional(),default:b().optional()}),MT=C({type:et(["number","integer"]),title:b().optional(),description:b().optional(),minimum:le().optional(),maximum:le().optional(),default:le().optional()}),jT=C({type:M("string"),title:b().optional(),description:b().optional(),enum:ne(b()),default:b().optional()}),ZT=C({type:M("string"),title:b().optional(),description:b().optional(),oneOf:ne(C({const:b(),title:b()})),default:b().optional()}),DT=C({type:M("string"),title:b().optional(),description:b().optional(),enum:ne(b()),enumNames:ne(b()).optional(),default:b().optional()}),LT=ye([jT,ZT]),qT=C({type:M("array"),title:b().optional(),description:b().optional(),minItems:le().optional(),maxItems:le().optional(),items:C({type:M("string"),enum:ne(b())}),default:ne(b()).optional()}),UT=C({type:M("array"),title:b().optional(),description:b().optional(),minItems:le().optional(),maxItems:le().optional(),items:C({anyOf:ne(C({const:b(),title:b()}))}),default:ne(b()).optional()}),FT=ye([qT,UT]),HT=ye([DT,LT,FT]),BT=ye([HT,IT,NT,MT]),VT=Ho.extend({mode:M("form").optional(),message:b(),requestedSchema:C({type:M("object"),properties:ge(b(),BT),required:ne(b()).optional()})}),JT=Ho.extend({mode:M("url"),message:b(),elicitationId:b(),url:b().url()}),WT=ye([VT,JT]),GT=Ie.extend({method:M("elicitation/create"),params:WT}),KT=pt.extend({elicitationId:b()}),XT=mt.extend({method:M("notifications/elicitation/complete"),params:KT}),Xn=Ne.extend({action:et(["accept","decline","cancel"]),content:Il(t=>t===null?void 0:t,ge(b(),ye([b(),le(),Pe(),ne(b())])).optional())}),YT=C({type:M("ref/resource"),uri:b()}),QT=C({type:M("ref/prompt"),name:b()}),eE=ut.extend({ref:ye([QT,YT]),argument:C({name:b(),value:b()}),context:C({arguments:ge(b(),b()).optional()}).optional()}),Zi=Ie.extend({method:M("completion/complete"),params:eE});tE=Ne.extend({completion:Be({values:ne(b()).max(100),total:$e(le().int()),hasMore:$e(Pe())})}),rE=C({uri:b().startsWith("file://"),name:b().optional(),_meta:ge(b(),we()).optional()}),nE=Ie.extend({method:M("roots/list"),params:ut.optional()}),Kl=Ne.extend({roots:ne(rE)}),oE=mt.extend({method:M("notifications/roots/list_changed"),params:pt.optional()}),DZ=ye([$i,wi,Zi,Wl,Ni,Ii,Ci,Oi,Ai,nT,sT,Kn,Mi,Si,Ei,zi,Pi]),LZ=ye([bi,ki,ql,oE,Ko]),qZ=ye([xi,Qo,Gl,Xn,Kl,Ti,Ri,Wn]),UZ=ye([$i,AT,GT,nE,Si,Ei,zi,Pi]),FZ=ye([bi,ki,ST,aT,tT,wT,yT,Ko,XT]),HZ=ye([xi,HS,tE,gT,lT,XS,YS,eT,ji,xT,Ti,Ri,Wn]),O=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===A.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Nl(o.elicitations,r)}return new t(e,r,n)}},Nl=class extends O{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(A.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}});var ns=z(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.regexpCode=ue.getEsmExportName=ue.getProperty=ue.safeStringify=ue.stringify=ue.strConcat=ue.addCodeArg=ue.str=ue._=ue.nil=ue._Code=ue.Name=ue.IDENTIFIER=ue._CodeOrName=void 0;var ts=class{};ue._CodeOrName=ts;ue.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var mn=class extends ts{constructor(e){if(super(),!ue.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ue.Name=mn;var ht=class extends ts{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof mn&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ue._Code=ht;ue.nil=new ht("");function py(t,...e){let r=[t[0]],n=0;for(;n<e.length;)id(r,e[n]),r.push(t[++n]);return new ht(r)}ue._=py;var sd=new ht("+");function my(t,...e){let r=[rs(t[0])],n=0;for(;n<e.length;)r.push(sd),id(r,e[n]),r.push(sd,rs(t[++n]));return hE(r),new ht(r)}ue.str=my;function id(t,e){e instanceof ht?t.push(...e._items):e instanceof mn?t.push(e):t.push(_E(e))}ue.addCodeArg=id;function hE(t){let e=1;for(;e<t.length-1;){if(t[e]===sd){let r=gE(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function gE(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof mn||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof mn))return`"${t}${e.slice(1)}`}function yE(t,e){return e.emptyStr()?t:t.emptyStr()?e:my`${t}${e}`}ue.strConcat=yE;function _E(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:rs(Array.isArray(t)?t.join(","):t)}function vE(t){return new ht(rs(t))}ue.stringify=vE;function rs(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ue.safeStringify=rs;function xE(t){return typeof t=="string"&&ue.IDENTIFIER.test(t)?new ht(`.${t}`):py`[${t}]`}ue.getProperty=xE;function bE(t){if(typeof t=="string"&&ue.IDENTIFIER.test(t))return new ht(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ue.getEsmExportName=bE;function wE(t){return new ht(t.toString())}ue.regexpCode=wE});var ud=z(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.ValueScope=rt.ValueScopeName=rt.Scope=rt.varKinds=rt.UsedValueState=void 0;var tt=ns(),ad=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Hi;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Hi||(rt.UsedValueState=Hi={}));rt.varKinds={const:new tt.Name("const"),let:new tt.Name("let"),var:new tt.Name("var")};var Bi=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof tt.Name?e:this.name(e)}name(e){return new tt.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};rt.Scope=Bi;var Vi=class extends tt.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,tt._)`.${new tt.Name(r)}[${n}]`}};rt.ValueScopeName=Vi;var $E=(0,tt._)`\n`,cd=class extends Bi{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?$E:tt.nil}}get(){return this._scope}name(e){return new Vi(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let l=a.get(i);if(l)return l}else a=this._values[s]=new Map;a.set(i,o);let c=this._scope[s]||(this._scope[s]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:s,itemIndex:u}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,tt._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=tt.nil;for(let i in e){let a=e[i];if(!a)continue;let c=n[i]=n[i]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Hi.Started);let l=r(u);if(l){let d=this.opts.es5?rt.varKinds.var:rt.varKinds.const;s=(0,tt._)`${s}${d} ${u} = ${l};${this.opts._n}`}else if(l=o?.(u))s=(0,tt._)`${s}${l}${this.opts._n}`;else throw new ad(u);c.set(u,Hi.Completed)})}return s}};rt.ValueScope=cd});var G=z(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.or=X.and=X.not=X.CodeGen=X.operators=X.varKinds=X.ValueScopeName=X.ValueScope=X.Scope=X.Name=X.regexpCode=X.stringify=X.getProperty=X.nil=X.strConcat=X.str=X._=void 0;var se=ns(),zt=ud(),Er=ns();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return Er._}});Object.defineProperty(X,"str",{enumerable:!0,get:function(){return Er.str}});Object.defineProperty(X,"strConcat",{enumerable:!0,get:function(){return Er.strConcat}});Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return Er.nil}});Object.defineProperty(X,"getProperty",{enumerable:!0,get:function(){return Er.getProperty}});Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return Er.stringify}});Object.defineProperty(X,"regexpCode",{enumerable:!0,get:function(){return Er.regexpCode}});Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return Er.Name}});var Ki=ud();Object.defineProperty(X,"Scope",{enumerable:!0,get:function(){return Ki.Scope}});Object.defineProperty(X,"ValueScope",{enumerable:!0,get:function(){return Ki.ValueScope}});Object.defineProperty(X,"ValueScopeName",{enumerable:!0,get:function(){return Ki.ValueScopeName}});Object.defineProperty(X,"varKinds",{enumerable:!0,get:function(){return Ki.varKinds}});X.operators={GT:new se._Code(">"),GTE:new se._Code(">="),LT:new se._Code("<"),LTE:new se._Code("<="),EQ:new se._Code("==="),NEQ:new se._Code("!=="),NOT:new se._Code("!"),OR:new se._Code("||"),AND:new se._Code("&&"),ADD:new se._Code("+")};var ir=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},ld=class extends ir{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?zt.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Qn(this.rhs,e,r)),this}get names(){return this.rhs instanceof se._CodeOrName?this.rhs.names:{}}},Ji=class extends ir{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof se.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Qn(this.rhs,e,r),this}get names(){let e=this.lhs instanceof se.Name?{}:{...this.lhs.names};return Gi(e,this.rhs)}},dd=class extends Ji{constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},fd=class extends ir{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},pd=class extends ir{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},md=class extends ir{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},hd=class extends ir{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Qn(this.code,e,r),this}get names(){return this.code instanceof se._CodeOrName?this.code.names:{}}},os=class extends ir{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||(kE(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>yn(e,r.names),{})}},ar=class extends os{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},gd=class extends os{},Yn=class extends ar{};Yn.kind="else";var hn=class t extends ar{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Yn(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(hy(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Qn(this.condition,e,r),this}get names(){let e=super.names;return Gi(e,this.condition),this.else&&yn(e,this.else.names),e}};hn.kind="if";var gn=class extends ar{};gn.kind="for";var yd=class extends gn{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Qn(this.iteration,e,r),this}get names(){return yn(super.names,this.iteration.names)}},_d=class extends gn{constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?zt.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Gi(super.names,this.from);return Gi(e,this.to)}},Wi=class extends gn{constructor(e,r,n,o){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Qn(this.iterable,e,r),this}get names(){return yn(super.names,this.iterable.names)}},ss=class extends ar{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};ss.kind="func";var is=class extends os{render(e){return"return "+super.render(e)}};is.kind="return";var vd=class extends ar{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,o;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(o=this.finally)===null||o===void 0||o.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&yn(e,this.catch.names),this.finally&&yn(e,this.finally.names),e}},as=class extends ar{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};as.kind="catch";var cs=class extends ar{render(e){return"finally"+super.render(e)}};cs.kind="finally";var xd=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
31
|
-
`:""},this._extScope=e,this._scope=new zt.Scope({parent:e}),this._nodes=[new gd]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new ld(e,s,n)),s}const(e,r,n){return this._def(zt.varKinds.const,e,r,n)}let(e,r,n){return this._def(zt.varKinds.let,e,r,n)}var(e,r,n){return this._def(zt.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Ji(e,r,n))}add(e,r){return this._leafNode(new dd(e,X.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==se.nil&&this._leafNode(new hd(e)),this}object(...e){let r=["{"];for(let[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,se.addCodeArg)(r,o));return r.push("}"),new se._Code(r)}if(e,r,n){if(this._blockNode(new hn(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new hn(e))}else(){return this._elseNode(new Yn)}endIf(){return this._endBlockNode(hn,Yn)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new yd(e),r)}forRange(e,r,n,o,s=this.opts.es5?zt.varKinds.var:zt.varKinds.let){let i=this._scope.toName(e);return this._for(new _d(s,i,r,n),()=>o(i))}forOf(e,r,n,o=zt.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=r instanceof se.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,se._)`${i}.length`,a=>{this.var(s,(0,se._)`${i}[${a}]`),n(s)})}return this._for(new Wi("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?zt.varKinds.var:zt.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,se._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Wi("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(gn)}label(e){return this._leafNode(new fd(e))}break(e){return this._leafNode(new pd(e))}return(e){let r=new is;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(is)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new vd;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new as(s),r(s)}return n&&(this._currNode=o.finally=new cs,this.code(n)),this._endBlockNode(as,cs)}throw(e){return this._leafNode(new md(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=se.nil,n,o){return this._blockNode(new ss(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(ss)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof hn))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};X.CodeGen=xd;function yn(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Gi(t,e){return e instanceof se._CodeOrName?yn(t,e.names):t}function Qn(t,e,r){if(t instanceof se.Name)return n(t);if(!o(t))return t;return new se._Code(t._items.reduce((s,i)=>(i instanceof se.Name&&(i=n(i)),i instanceof se._Code?s.push(...i._items):s.push(i),s),[]));function n(s){let i=r[s.str];return i===void 0||e[s.str]!==1?s:(delete e[s.str],i)}function o(s){return s instanceof se._Code&&s._items.some(i=>i instanceof se.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function kE(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function hy(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,se._)`!${bd(t)}`}X.not=hy;var SE=gy(X.operators.AND);function TE(...t){return t.reduce(SE)}X.and=TE;var EE=gy(X.operators.OR);function zE(...t){return t.reduce(EE)}X.or=zE;function gy(t){return(e,r)=>e===se.nil?r:r===se.nil?e:(0,se._)`${bd(e)} ${t} ${bd(r)}`}function bd(t){return t instanceof se.Name?t:(0,se._)`(${t})`}});var ae=z(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.checkStrictMode=Y.getErrorPath=Y.Type=Y.useFunc=Y.setEvaluated=Y.evaluatedPropsToName=Y.mergeEvaluated=Y.eachItem=Y.unescapeJsonPointer=Y.escapeJsonPointer=Y.escapeFragment=Y.unescapeFragment=Y.schemaRefOrVal=Y.schemaHasRulesButRef=Y.schemaHasRules=Y.checkUnknownRules=Y.alwaysValidSchema=Y.toHash=void 0;var pe=G(),RE=ns();function PE(t){let e={};for(let r of t)e[r]=!0;return e}Y.toHash=PE;function CE(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(vy(t,e),!xy(e,t.self.RULES.all))}Y.alwaysValidSchema=CE;function vy(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let s in e)o[s]||$y(t,`unknown keyword: "${s}"`)}Y.checkUnknownRules=vy;function xy(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Y.schemaHasRules=xy;function OE(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Y.schemaHasRulesButRef=OE;function AE({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,pe._)`${r}`}return(0,pe._)`${t}${e}${(0,pe.getProperty)(n)}`}Y.schemaRefOrVal=AE;function IE(t){return by(decodeURIComponent(t))}Y.unescapeFragment=IE;function NE(t){return encodeURIComponent($d(t))}Y.escapeFragment=NE;function $d(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Y.escapeJsonPointer=$d;function by(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Y.unescapeJsonPointer=by;function ME(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Y.eachItem=ME;function yy({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof pe.Name?(s instanceof pe.Name?t(o,s,i):e(o,s,i),i):s instanceof pe.Name?(e(o,i,s),s):r(s,i);return a===pe.Name&&!(c instanceof pe.Name)?n(o,c):c}}Y.mergeEvaluated={props:yy({mergeNames:(t,e,r)=>t.if((0,pe._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,pe._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,pe._)`${r} || {}`).code((0,pe._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,pe._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,pe._)`${r} || {}`),kd(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:wy}),items:yy({mergeNames:(t,e,r)=>t.if((0,pe._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,pe._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,pe._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,pe._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function wy(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,pe._)`{}`);return e!==void 0&&kd(t,r,e),r}Y.evaluatedPropsToName=wy;function kd(t,e,r){Object.keys(r).forEach(n=>t.assign((0,pe._)`${e}${(0,pe.getProperty)(n)}`,!0))}Y.setEvaluated=kd;var _y={};function jE(t,e){return t.scopeValue("func",{ref:e,code:_y[e.code]||(_y[e.code]=new RE._Code(e.code))})}Y.useFunc=jE;var wd;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(wd||(Y.Type=wd={}));function ZE(t,e,r){if(t instanceof pe.Name){let n=e===wd.Num;return r?n?(0,pe._)`"[" + ${t} + "]"`:(0,pe._)`"['" + ${t} + "']"`:n?(0,pe._)`"/" + ${t}`:(0,pe._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,pe.getProperty)(t).toString():"/"+$d(t)}Y.getErrorPath=ZE;function $y(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Y.checkStrictMode=$y});var cr=z(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});var De=G(),DE={data:new De.Name("data"),valCxt:new De.Name("valCxt"),instancePath:new De.Name("instancePath"),parentData:new De.Name("parentData"),parentDataProperty:new De.Name("parentDataProperty"),rootData:new De.Name("rootData"),dynamicAnchors:new De.Name("dynamicAnchors"),vErrors:new De.Name("vErrors"),errors:new De.Name("errors"),this:new De.Name("this"),self:new De.Name("self"),scope:new De.Name("scope"),json:new De.Name("json"),jsonPos:new De.Name("jsonPos"),jsonLen:new De.Name("jsonLen"),jsonPart:new De.Name("jsonPart")};Sd.default=DE});var us=z(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.extendErrors=Le.resetErrorsCount=Le.reportExtraError=Le.reportError=Le.keyword$DataError=Le.keywordError=void 0;var ce=G(),Xi=ae(),Je=cr();Le.keywordError={message:({keyword:t})=>(0,ce.str)`must pass "${t}" keyword validation`};Le.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ce.str)`"${t}" keyword must be ${e} ($data)`:(0,ce.str)`"${t}" keyword is invalid ($data)`};function LE(t,e=Le.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:i,allErrors:a}=o,c=Ty(t,e,r);n??(i||a)?ky(s,c):Sy(o,(0,ce._)`[${c}]`)}Le.reportError=LE;function qE(t,e=Le.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:i}=n,a=Ty(t,e,r);ky(o,a),s||i||Sy(n,Je.default.vErrors)}Le.reportExtraError=qE;function UE(t,e){t.assign(Je.default.errors,e),t.if((0,ce._)`${Je.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ce._)`${Je.default.vErrors}.length`,e),()=>t.assign(Je.default.vErrors,null)))}Le.resetErrorsCount=UE;function FE({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",o,Je.default.errors,a=>{t.const(i,(0,ce._)`${Je.default.vErrors}[${a}]`),t.if((0,ce._)`${i}.instancePath === undefined`,()=>t.assign((0,ce._)`${i}.instancePath`,(0,ce.strConcat)(Je.default.instancePath,s.errorPath))),t.assign((0,ce._)`${i}.schemaPath`,(0,ce.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,ce._)`${i}.schema`,r),t.assign((0,ce._)`${i}.data`,n))})}Le.extendErrors=FE;function ky(t,e){let r=t.const("err",e);t.if((0,ce._)`${Je.default.vErrors} === null`,()=>t.assign(Je.default.vErrors,(0,ce._)`[${r}]`),(0,ce._)`${Je.default.vErrors}.push(${r})`),t.code((0,ce._)`${Je.default.errors}++`)}function Sy(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,ce._)`new ${t.ValidationError}(${e})`):(r.assign((0,ce._)`${n}.errors`,e),r.return(!1))}var _n={keyword:new ce.Name("keyword"),schemaPath:new ce.Name("schemaPath"),params:new ce.Name("params"),propertyName:new ce.Name("propertyName"),message:new ce.Name("message"),schema:new ce.Name("schema"),parentSchema:new ce.Name("parentSchema")};function Ty(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,ce._)`{}`:HE(t,e,r)}function HE(t,e,r={}){let{gen:n,it:o}=t,s=[BE(o,r),VE(t,r)];return JE(t,e,s),n.object(...s)}function BE({errorPath:t},{instancePath:e}){let r=e?(0,ce.str)`${t}${(0,Xi.getErrorPath)(e,Xi.Type.Str)}`:t;return[Je.default.instancePath,(0,ce.strConcat)(Je.default.instancePath,r)]}function VE({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,ce.str)`${e}/${t}`;return r&&(o=(0,ce.str)`${o}${(0,Xi.getErrorPath)(r,Xi.Type.Str)}`),[_n.schemaPath,o]}function JE(t,{params:e,message:r},n){let{keyword:o,data:s,schemaValue:i,it:a}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;n.push([_n.keyword,o],[_n.params,typeof e=="function"?e(t):e||(0,ce._)`{}`]),c.messages&&n.push([_n.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([_n.schema,i],[_n.parentSchema,(0,ce._)`${l}${d}`],[Je.default.data,s]),u&&n.push([_n.propertyName,u])}});var zy=z(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.boolOrEmptySchema=eo.topBoolOrEmptySchema=void 0;var WE=us(),GE=G(),KE=cr(),XE={message:"boolean schema is false"};function YE(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Ey(t,!1):typeof r=="object"&&r.$async===!0?e.return(KE.default.data):(e.assign((0,GE._)`${n}.errors`,null),e.return(!0))}eo.topBoolOrEmptySchema=YE;function QE(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Ey(t)):r.var(e,!0)}eo.boolOrEmptySchema=QE;function Ey(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,WE.reportError)(o,XE,void 0,e)}});var Td=z(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.getRules=to.isJSONType=void 0;var ez=["string","number","integer","boolean","null","object","array"],tz=new Set(ez);function rz(t){return typeof t=="string"&&tz.has(t)}to.isJSONType=rz;function nz(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}to.getRules=nz});var Ed=z(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.shouldUseRule=zr.shouldUseGroup=zr.schemaHasRulesForType=void 0;function oz({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Ry(t,n)}zr.schemaHasRulesForType=oz;function Ry(t,e){return e.rules.some(r=>Py(t,r))}zr.shouldUseGroup=Ry;function Py(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}zr.shouldUseRule=Py});var ls=z(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.reportTypeError=qe.checkDataTypes=qe.checkDataType=qe.coerceAndCheckDataType=qe.getJSONTypes=qe.getSchemaTypes=qe.DataType=void 0;var sz=Td(),iz=Ed(),az=us(),J=G(),Cy=ae(),ro;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ro||(qe.DataType=ro={}));function cz(t){let e=Oy(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}qe.getSchemaTypes=cz;function Oy(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(sz.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}qe.getJSONTypes=Oy;function uz(t,e){let{gen:r,data:n,opts:o}=t,s=lz(e,o.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&(0,iz.schemaHasRulesForType)(t,e[0]));if(i){let a=Rd(e,n,o.strictNumbers,ro.Wrong);r.if(a,()=>{s.length?dz(t,e,s):Pd(t)})}return i}qe.coerceAndCheckDataType=uz;var Ay=new Set(["string","number","integer","boolean","null"]);function lz(t,e){return e?t.filter(r=>Ay.has(r)||e==="array"&&r==="array"):[]}function dz(t,e,r){let{gen:n,data:o,opts:s}=t,i=n.let("dataType",(0,J._)`typeof ${o}`),a=n.let("coerced",(0,J._)`undefined`);s.coerceTypes==="array"&&n.if((0,J._)`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,J._)`${o}[0]`).assign(i,(0,J._)`typeof ${o}`).if(Rd(e,o,s.strictNumbers),()=>n.assign(a,o))),n.if((0,J._)`${a} !== undefined`);for(let u of r)(Ay.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);n.else(),Pd(t),n.endIf(),n.if((0,J._)`${a} !== undefined`,()=>{n.assign(o,a),fz(t,a)});function c(u){switch(u){case"string":n.elseIf((0,J._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,J._)`"" + ${o}`).elseIf((0,J._)`${o} === null`).assign(a,(0,J._)`""`);return;case"number":n.elseIf((0,J._)`${i} == "boolean" || ${o} === null
|
|
32
|
-
|| (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,J._)`+${o}`);return;case"integer":n.elseIf((0,J._)`${i} === "boolean" || ${o} === null
|
|
33
|
-
|| (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,J._)`+${o}`);return;case"boolean":n.elseIf((0,J._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,J._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf((0,J._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf((0,J._)`${i} === "string" || ${i} === "number"
|
|
34
|
-
|| ${i} === "boolean" || ${o} === null`).assign(a,(0,J._)`[${o}]`)}}}function fz({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,J._)`${e} !== undefined`,()=>t.assign((0,J._)`${e}[${r}]`,n))}function zd(t,e,r,n=ro.Correct){let o=n===ro.Correct?J.operators.EQ:J.operators.NEQ,s;switch(t){case"null":return(0,J._)`${e} ${o} null`;case"array":s=(0,J._)`Array.isArray(${e})`;break;case"object":s=(0,J._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=i((0,J._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=i();break;default:return(0,J._)`typeof ${e} ${o} ${t}`}return n===ro.Correct?s:(0,J.not)(s);function i(a=J.nil){return(0,J.and)((0,J._)`typeof ${e} == "number"`,a,r?(0,J._)`isFinite(${e})`:J.nil)}}qe.checkDataType=zd;function Rd(t,e,r,n){if(t.length===1)return zd(t[0],e,r,n);let o,s=(0,Cy.toHash)(t);if(s.array&&s.object){let i=(0,J._)`typeof ${e} != "object"`;o=s.null?i:(0,J._)`!${e} || ${i}`,delete s.null,delete s.array,delete s.object}else o=J.nil;s.number&&delete s.integer;for(let i in s)o=(0,J.and)(o,zd(i,e,r,n));return o}qe.checkDataTypes=Rd;var pz={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,J._)`{type: ${t}}`:(0,J._)`{type: ${e}}`};function Pd(t){let e=mz(t);(0,az.reportError)(e,pz)}qe.reportTypeError=Pd;function mz(t){let{gen:e,data:r,schema:n}=t,o=(0,Cy.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}});var Ny=z(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.assignDefaults=void 0;var no=G(),hz=ae();function gz(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)Iy(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>Iy(t,s,o.default))}Yi.assignDefaults=gz;function Iy(t,e,r){let{gen:n,compositeRule:o,data:s,opts:i}=t;if(r===void 0)return;let a=(0,no._)`${s}${(0,no.getProperty)(e)}`;if(o){(0,hz.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,no._)`${a} === undefined`;i.useDefaults==="empty"&&(c=(0,no._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,no._)`${a} = ${(0,no.stringify)(r)}`)}});var gt=z(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.validateUnion=fe.validateArray=fe.usePattern=fe.callValidateCode=fe.schemaProperties=fe.allSchemaProperties=fe.noPropertyInData=fe.propertyInData=fe.isOwnProperty=fe.hasPropFunc=fe.reportMissingProp=fe.checkMissingProp=fe.checkReportMissingProp=void 0;var _e=G(),Cd=ae(),Rr=cr(),yz=ae();function _z(t,e){let{gen:r,data:n,it:o}=t;r.if(Ad(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,_e._)`${e}`},!0),t.error()})}fe.checkReportMissingProp=_z;function vz({gen:t,data:e,it:{opts:r}},n,o){return(0,_e.or)(...n.map(s=>(0,_e.and)(Ad(t,e,s,r.ownProperties),(0,_e._)`${o} = ${s}`)))}fe.checkMissingProp=vz;function xz(t,e){t.setParams({missingProperty:e},!0),t.error()}fe.reportMissingProp=xz;function My(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,_e._)`Object.prototype.hasOwnProperty`})}fe.hasPropFunc=My;function Od(t,e,r){return(0,_e._)`${My(t)}.call(${e}, ${r})`}fe.isOwnProperty=Od;function bz(t,e,r,n){let o=(0,_e._)`${e}${(0,_e.getProperty)(r)} !== undefined`;return n?(0,_e._)`${o} && ${Od(t,e,r)}`:o}fe.propertyInData=bz;function Ad(t,e,r,n){let o=(0,_e._)`${e}${(0,_e.getProperty)(r)} === undefined`;return n?(0,_e.or)(o,(0,_e.not)(Od(t,e,r))):o}fe.noPropertyInData=Ad;function jy(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}fe.allSchemaProperties=jy;function wz(t,e){return jy(e).filter(r=>!(0,Cd.alwaysValidSchema)(t,e[r]))}fe.schemaProperties=wz;function $z({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:i},a,c,u){let l=u?(0,_e._)`${t}, ${e}, ${n}${o}`:e,d=[[Rr.default.instancePath,(0,_e.strConcat)(Rr.default.instancePath,s)],[Rr.default.parentData,i.parentData],[Rr.default.parentDataProperty,i.parentDataProperty],[Rr.default.rootData,Rr.default.rootData]];i.opts.dynamicRef&&d.push([Rr.default.dynamicAnchors,Rr.default.dynamicAnchors]);let m=(0,_e._)`${l}, ${r.object(...d)}`;return c!==_e.nil?(0,_e._)`${a}.call(${c}, ${m})`:(0,_e._)`${a}(${m})`}fe.callValidateCode=$z;var kz=(0,_e._)`new RegExp`;function Sz({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,_e._)`${o.code==="new RegExp"?kz:(0,yz.useFunc)(t,o)}(${r}, ${n})`})}fe.usePattern=Sz;function Tz(t){let{gen:e,data:r,keyword:n,it:o}=t,s=e.name("valid");if(o.allErrors){let a=e.let("valid",!0);return i(()=>e.assign(a,!1)),a}return e.var(s,!0),i(()=>e.break()),s;function i(a){let c=e.const("len",(0,_e._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:Cd.Type.Num},s),e.if((0,_e.not)(s),a)})}}fe.validateArray=Tz;function Ez(t){let{gen:e,schema:r,keyword:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Cd.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let i=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);e.assign(i,(0,_e._)`${i} || ${a}`),t.mergeValidEvaluated(l,a)||e.if((0,_e.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}fe.validateUnion=Ez});var Ly=z(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.validateKeywordUsage=Ht.validSchemaType=Ht.funcKeywordCode=Ht.macroKeywordCode=void 0;var We=G(),vn=cr(),zz=gt(),Rz=us();function Pz(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:i}=t,a=e.macro.call(i.self,o,s,i),c=Dy(r,n,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:We.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Ht.macroKeywordCode=Pz;function Cz(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:i,$data:a,it:c}=t;Az(c,e);let u=!a&&e.compile?e.compile.call(c.self,s,i,c):e.validate,l=Dy(n,o,u),d=n.let("valid");t.block$data(d,m),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function m(){if(e.errors===!1)h(),e.modifying&&Zy(t),g(()=>t.error());else{let _=e.async?p():f();e.modifying&&Zy(t),g(()=>Oz(t,_))}}function p(){let _=n.let("ruleErrs",null);return n.try(()=>h((0,We._)`await `),v=>n.assign(d,!1).if((0,We._)`${v} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,We._)`${v}.errors`),()=>n.throw(v))),_}function f(){let _=(0,We._)`${l}.errors`;return n.assign(_,null),h(We.nil),_}function h(_=e.async?(0,We._)`await `:We.nil){let v=c.opts.passContext?vn.default.this:vn.default.self,y=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,We._)`${_}${(0,zz.callValidateCode)(t,l,v,y)}`,e.modifying)}function g(_){var v;n.if((0,We.not)((v=e.valid)!==null&&v!==void 0?v:d),_)}}Ht.funcKeywordCode=Cz;function Zy(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,We._)`${n.parentData}[${n.parentDataProperty}]`))}function Oz(t,e){let{gen:r}=t;r.if((0,We._)`Array.isArray(${e})`,()=>{r.assign(vn.default.vErrors,(0,We._)`${vn.default.vErrors} === null ? ${e} : ${vn.default.vErrors}.concat(${e})`).assign(vn.default.errors,(0,We._)`${vn.default.vErrors}.length`),(0,Rz.extendErrors)(t)},()=>t.error())}function Az({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Dy(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,We.stringify)(r)})}function Iz(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Ht.validSchemaType=Iz;function Nz({schema:t,opts:e,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let i=o.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Ht.validateKeywordUsage=Nz});var Uy=z(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.extendSubschemaMode=Pr.extendSubschemaData=Pr.getSubschema=void 0;var Bt=G(),qy=ae();function Mz(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:i}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Bt._)`${t.schemaPath}${(0,Bt.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Bt._)`${t.schemaPath}${(0,Bt.getProperty)(e)}${(0,Bt.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,qy.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:i,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Pr.getSubschema=Mz;function jz(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:i}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=e,m=a.let("data",(0,Bt._)`${e.data}${(0,Bt.getProperty)(r)}`,!0);c(m),t.errorPath=(0,Bt.str)`${u}${(0,qy.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Bt._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(o!==void 0){let u=o instanceof Bt.Name?o:a.let("data",o,!0);c(u),i!==void 0&&(t.propertyName=i)}s&&(t.dataTypes=s);function c(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}Pr.extendSubschemaData=jz;function Zz(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}Pr.extendSubschemaMode=Zz});var Id=z((iL,Fy)=>{"use strict";Fy.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var By=z((aL,Hy)=>{"use strict";var Cr=Hy.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};Qi(e,n,o,t,"",t)};Cr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Cr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Cr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Cr.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Qi(t,e,r,n,o,s,i,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,s,i,a,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in Cr.arrayKeywords)for(var m=0;m<d.length;m++)Qi(t,e,r,d[m],o+"/"+l+"/"+m,s,o,l,n,m)}else if(l in Cr.propsKeywords){if(d&&typeof d=="object")for(var p in d)Qi(t,e,r,d[p],o+"/"+l+"/"+Dz(p),s,o,l,n,p)}else(l in Cr.keywords||t.allKeys&&!(l in Cr.skipKeywords))&&Qi(t,e,r,d,o+"/"+l,s,o,l,n)}r(n,o,s,i,a,c,u)}}function Dz(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var ds=z(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.getSchemaRefs=nt.resolveUrl=nt.normalizeId=nt._getFullPath=nt.getFullPath=nt.inlineRef=void 0;var Lz=ae(),qz=Id(),Uz=By(),Fz=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Hz(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Nd(t):e?Vy(t)<=e:!1}nt.inlineRef=Hz;var Bz=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Nd(t){for(let e in t){if(Bz.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Nd)||typeof r=="object"&&Nd(r))return!0}return!1}function Vy(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!Fz.has(r)&&(typeof t[r]=="object"&&(0,Lz.eachItem)(t[r],n=>e+=Vy(n)),e===1/0))return 1/0}return e}function Jy(t,e="",r){r!==!1&&(e=oo(e));let n=t.parse(e);return Wy(t,n)}nt.getFullPath=Jy;function Wy(t,e){return t.serialize(e).split("#")[0]+"#"}nt._getFullPath=Wy;var Vz=/#\/?$/;function oo(t){return t?t.replace(Vz,""):""}nt.normalizeId=oo;function Jz(t,e,r){return r=oo(r),t.resolve(e,r)}nt.resolveUrl=Jz;var Wz=/^[a-z_][-a-z0-9._]*$/i;function Gz(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=oo(t[r]||e),s={"":o},i=Jy(n,o,!1),a={},c=new Set;return Uz(t,{allKeys:!0},(d,m,p,f)=>{if(f===void 0)return;let h=i+m,g=s[f];typeof d[r]=="string"&&(g=_.call(this,d[r])),v.call(this,d.$anchor),v.call(this,d.$dynamicAnchor),s[m]=g;function _(y){let x=this.opts.uriResolver.resolve;if(y=oo(g?x(g,y):y),c.has(y))throw l(y);c.add(y);let $=this.refs[y];return typeof $=="string"&&($=this.refs[$]),typeof $=="object"?u(d,$.schema,y):y!==oo(h)&&(y[0]==="#"?(u(d,a[y],y),a[y]=d):this.refs[y]=h),y}function v(y){if(typeof y=="string"){if(!Wz.test(y))throw new Error(`invalid anchor "${y}"`);_.call(this,`#${y}`)}}}),a;function u(d,m,p){if(m!==void 0&&!qz(d,m))throw l(p)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}nt.getSchemaRefs=Gz});var ms=z(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.getData=Or.KeywordCxt=Or.validateFunctionCode=void 0;var Qy=zy(),Gy=ls(),jd=Ed(),ea=ls(),Kz=Ny(),ps=Ly(),Md=Uy(),j=G(),B=cr(),Xz=ds(),ur=ae(),fs=us();function Yz(t){if(r_(t)&&(n_(t),t_(t))){t1(t);return}e_(t,()=>(0,Qy.topBoolOrEmptySchema)(t))}Or.validateFunctionCode=Yz;function e_({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,j._)`${B.default.data}, ${B.default.valCxt}`,n.$async,()=>{t.code((0,j._)`"use strict"; ${Ky(r,o)}`),e1(t,o),t.code(s)}):t.func(e,(0,j._)`${B.default.data}, ${Qz(o)}`,n.$async,()=>t.code(Ky(r,o)).code(s))}function Qz(t){return(0,j._)`{${B.default.instancePath}="", ${B.default.parentData}, ${B.default.parentDataProperty}, ${B.default.rootData}=${B.default.data}${t.dynamicRef?(0,j._)`, ${B.default.dynamicAnchors}={}`:j.nil}}={}`}function e1(t,e){t.if(B.default.valCxt,()=>{t.var(B.default.instancePath,(0,j._)`${B.default.valCxt}.${B.default.instancePath}`),t.var(B.default.parentData,(0,j._)`${B.default.valCxt}.${B.default.parentData}`),t.var(B.default.parentDataProperty,(0,j._)`${B.default.valCxt}.${B.default.parentDataProperty}`),t.var(B.default.rootData,(0,j._)`${B.default.valCxt}.${B.default.rootData}`),e.dynamicRef&&t.var(B.default.dynamicAnchors,(0,j._)`${B.default.valCxt}.${B.default.dynamicAnchors}`)},()=>{t.var(B.default.instancePath,(0,j._)`""`),t.var(B.default.parentData,(0,j._)`undefined`),t.var(B.default.parentDataProperty,(0,j._)`undefined`),t.var(B.default.rootData,B.default.data),e.dynamicRef&&t.var(B.default.dynamicAnchors,(0,j._)`{}`)})}function t1(t){let{schema:e,opts:r,gen:n}=t;e_(t,()=>{r.$comment&&e.$comment&&s_(t),i1(t),n.let(B.default.vErrors,null),n.let(B.default.errors,0),r.unevaluated&&r1(t),o_(t),u1(t)})}function r1(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,j._)`${r}.evaluated`),e.if((0,j._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,j._)`${t.evaluated}.props`,(0,j._)`undefined`)),e.if((0,j._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,j._)`${t.evaluated}.items`,(0,j._)`undefined`))}function Ky(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,j._)`/*# sourceURL=${r} */`:j.nil}function n1(t,e){if(r_(t)&&(n_(t),t_(t))){o1(t,e);return}(0,Qy.boolOrEmptySchema)(t,e)}function t_({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function r_(t){return typeof t.schema!="boolean"}function o1(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&s_(t),a1(t),c1(t);let s=n.const("_errs",B.default.errors);o_(t,s),n.var(e,(0,j._)`${s} === ${B.default.errors}`)}function n_(t){(0,ur.checkUnknownRules)(t),s1(t)}function o_(t,e){if(t.opts.jtd)return Xy(t,[],!1,e);let r=(0,Gy.getSchemaTypes)(t.schema),n=(0,Gy.coerceAndCheckDataType)(t,r);Xy(t,r,!n,e)}function s1(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,ur.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function i1(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,ur.checkStrictMode)(t,"default is ignored in the schema root")}function a1(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Xz.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function c1(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function s_({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,j._)`${B.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let i=(0,j.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,j._)`${B.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function u1(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,j._)`${B.default.errors} === 0`,()=>e.return(B.default.data),()=>e.throw((0,j._)`new ${o}(${B.default.vErrors})`)):(e.assign((0,j._)`${n}.errors`,B.default.vErrors),s.unevaluated&&l1(t),e.return((0,j._)`${B.default.errors} === 0`))}function l1({gen:t,evaluated:e,props:r,items:n}){r instanceof j.Name&&t.assign((0,j._)`${e}.props`,r),n instanceof j.Name&&t.assign((0,j._)`${e}.items`,n)}function Xy(t,e,r,n){let{gen:o,schema:s,data:i,allErrors:a,opts:c,self:u}=t,{RULES:l}=u;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,ur.schemaHasRulesButRef)(s,l))){o.block(()=>a_(t,"$ref",l.all.$ref.definition));return}c.jtd||d1(t,e),o.block(()=>{for(let m of l.rules)d(m);d(l.post)});function d(m){(0,jd.shouldUseGroup)(s,m)&&(m.type?(o.if((0,ea.checkDataType)(m.type,i,c.strictNumbers)),Yy(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,ea.reportTypeError)(t)),o.endIf()):Yy(t,m),a||o.if((0,j._)`${B.default.errors} === ${n||0}`))}}function Yy(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,Kz.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,jd.shouldUseRule)(n,s)&&a_(t,s.keyword,s.definition,e.type)})}function d1(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(f1(t,e),t.opts.allowUnionTypes||p1(t,e),m1(t,t.dataTypes))}function f1(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{i_(t.dataTypes,r)||Zd(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),g1(t,e)}}function p1(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Zd(t,"use allowUnionTypes to allow union type keyword")}function m1(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,jd.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(i=>h1(e,i))&&Zd(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function h1(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function i_(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function g1(t,e){let r=[];for(let n of t.dataTypes)i_(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Zd(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,ur.checkStrictMode)(t,e,t.opts.strictTypes)}var ta=class{constructor(e,r,n){if((0,ps.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ur.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",c_(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ps.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",B.default.errors))}result(e,r,n){this.failResult((0,j.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,j.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,j._)`${r} !== undefined && (${(0,j.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?fs.reportExtraError:fs.reportError)(this,this.def.error,r)}$dataError(){(0,fs.reportError)(this,this.def.$dataError||fs.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,fs.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=j.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=j.nil,r=j.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:i}=this;n.if((0,j.or)((0,j._)`${o} === undefined`,r)),e!==j.nil&&n.assign(e,!0),(s.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==j.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,j.or)(i(),a());function i(){if(n.length){if(!(r instanceof j.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,j._)`${(0,ea.checkDataTypes)(c,r,s.opts.strictNumbers,ea.DataType.Wrong)}`}return j.nil}function a(){if(o.validateSchema){let c=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,j._)`!${c}(${r})`}return j.nil}}subschema(e,r){let n=(0,Md.getSubschema)(this.it,e);(0,Md.extendSubschemaData)(n,this.it,e),(0,Md.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return n1(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=ur.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=ur.mergeEvaluated.items(o,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(e,j.Name)),!0}};Or.KeywordCxt=ta;function a_(t,e,r,n){let o=new ta(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,ps.funcKeywordCode)(o,r):"macro"in r?(0,ps.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,ps.funcKeywordCode)(o,r)}var y1=/^\/(?:[^~]|~0|~1)*$/,_1=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function c_(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return B.default.rootData;if(t[0]==="/"){if(!y1.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=B.default.rootData}else{let u=_1.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(o=u[2],o==="#"){if(l>=e)throw new Error(c("property/index",l));return n[e-l]}if(l>e)throw new Error(c("data",l));if(s=r[e-l],!o)return s}let i=s,a=o.split("/");for(let u of a)u&&(s=(0,j._)`${s}${(0,j.getProperty)((0,ur.unescapeJsonPointer)(u))}`,i=(0,j._)`${i} && ${s}`);return i;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}Or.getData=c_});var ra=z(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var Dd=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Ld.default=Dd});var hs=z(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var qd=ds(),Ud=class extends Error{constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,qd.resolveUrl)(e,r,n),this.missingSchema=(0,qd.normalizeId)((0,qd.getFullPath)(e,this.missingRef))}};Fd.default=Ud});var oa=z(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.resolveSchema=yt.getCompilingSchema=yt.resolveRef=yt.compileSchema=yt.SchemaEnv=void 0;var Rt=G(),v1=ra(),xn=cr(),Pt=ds(),u_=ae(),x1=ms(),so=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Pt.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};yt.SchemaEnv=so;function Bd(t){let e=l_.call(this,t);if(e)return e;let r=(0,Pt.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,i=new Rt.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),a;t.$async&&(a=i.scopeValue("Error",{ref:v1.default,code:(0,Rt._)`require("ajv/dist/runtime/validation_error").default`}));let c=i.scopeName("validate");t.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:xn.default.data,parentData:xn.default.parentData,parentDataProperty:xn.default.parentDataProperty,dataNames:[xn.default.data],dataPathArr:[Rt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Rt.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Rt.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Rt._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,x1.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);let d=i.toString();l=`${i.scopeRefs(xn.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let p=new Function(`${xn.default.self}`,`${xn.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:f,items:h}=u;p.evaluated={props:f instanceof Rt.Name?void 0:f,items:h instanceof Rt.Name?void 0:h,dynamicProps:f instanceof Rt.Name,dynamicItems:h instanceof Rt.Name},p.source&&(p.source.evaluated=(0,Rt.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(t)}}yt.compileSchema=Bd;function b1(t,e,r){var n;r=(0,Pt.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=k1.call(this,t,r);if(s===void 0){let i=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;i&&(s=new so({schema:i,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=w1.call(this,s)}yt.resolveRef=b1;function w1(t){return(0,Pt.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Bd.call(this,t)}function l_(t){for(let e of this._compilations)if($1(e,t))return e}yt.getCompilingSchema=l_;function $1(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function k1(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||na.call(this,t,e)}function na(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Pt._getFullPath)(this.opts.uriResolver,r),o=(0,Pt.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return Hd.call(this,r,t);let s=(0,Pt.normalizeId)(n),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=na.call(this,t,i);return typeof a?.schema!="object"?void 0:Hd.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||Bd.call(this,i),s===(0,Pt.normalizeId)(e)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,Pt.resolveUrl)(this.opts.uriResolver,o,u)),new so({schema:a,schemaId:c,root:t,baseId:o})}return Hd.call(this,r,i)}}yt.resolveSchema=na;var S1=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Hd(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,u_.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!S1.has(a)&&u&&(e=(0,Pt.resolveUrl)(this.opts.uriResolver,e,u))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,u_.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Pt.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=na.call(this,n,a)}let{schemaId:i}=this.opts;if(s=s||new so({schema:r,schemaId:i,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var d_=z((pL,T1)=>{T1.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Xd=z((mL,v_)=>{"use strict";var E1=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Jd=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),z1=RegExp.prototype.test.bind(/^\d*$/u),bn=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Wd=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),p_=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),Gd=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),R1=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),ot=new Array(256);{let t="0123456789ABCDEF";for(let e=0;e<256;e++)ot[e]="%"+t[e>>4]+t[e&15]}function Ue(t){return t<2048?ot[192|t>>6]+ot[128|t&63]:t<65536?ot[224|t>>12]+ot[128|t>>6&63]+ot[128|t&63]:ot[240|t>>18]+ot[128|t>>12&63]+ot[128|t>>6&63]+ot[128|t&63]}function P1(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var C1=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),O1=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),A1=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),I1=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function N1(t){if(t.length===0)return!1;for(let e=0;e<t.length;e++)if(!A1(t[e])){if(t[e]==="%"&&e+2<t.length&&bn(t.slice(e+1,e+3))){e+=2;continue}return!1}return!0}function f_(t){let e=-1,r=0,n=-1,o=0;for(let a=0;a<t.length;a++)t[a]==="0"?(n===-1&&(n=a),o++,o>r&&(r=o,e=n)):(n=-1,o=0);if(r<2)return t.join(":");let s=t.slice(0,e).join(":"),i=t.slice(e+r).join(":");return s+"::"+i}function M1(t){let e=t.indexOf("::");if(e!==-1&&t.indexOf("::",e+1)!==-1)return;let r=e===-1?t.split(":"):t.slice(0,e).split(":"),n=e===-1?[]:t.slice(e+2).split(":");e!==-1&&(r.length===1&&r[0]===""&&(r.length=0),n.length===1&&n[0]===""&&(n.length=0));let o=r.concat(n),s=0;for(let a=0;a<o.length;a++){let c=o[a];if(c==="")return;if(c.indexOf(".")!==-1){if(a!==o.length-1||e!==-1&&n.length===0||!Jd(c))return;s+=2;continue}if(!C1(c))return;o[a]=parseInt(c,16).toString(16),s++}if(e===-1)return s!==8?void 0:f_(o);if(s>=8)return;let i=o.slice(0,r.length);for(let a=s;a<8;a++)i.push("0");for(let a=r.length;a<o.length;a++)i.push(o[a]);return f_(i)}function Vd(t){let e=t[0]==="["&&t[t.length-1]==="]";if((t[0]==="["||t[t.length-1]==="]")&&!e)return{host:t,isIPV6:!1,error:!0};let n=e?t.slice(1,-1):t;if(e&&O1(n))return n=n.toLowerCase(),{host:`[${n}]`,escapedHost:n,isIPV6:!1,isIPVFuture:!0};if(j1(n,":")<2)return{host:t,isIPV6:!1,error:e};let o="",s=n.indexOf("%");if(s!==-1){let a=n.slice(s,s+3).toLowerCase()==="%25"?3:1;if(o=n.slice(s+a),!N1(o))return{host:t,isIPV6:!1,error:!0};n=n.slice(0,s)}let i=M1(n);return i===void 0?{host:t,isIPV6:!1,error:!0}:{host:i+(o?"%"+o:""),escapedHost:i+(o?"%25"+o:""),isIPV6:!0}}function j1(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function m_(t){let e=t,r=[],n=-1,o=0;for(;o=e.length;){if(o===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(o===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(o===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function Z1(t){if(t===""||t[0]==="/")return m_(t);let e=t.split("/"),r=e.length-1,n=[],o=!1;for(let s=0;s<=r;s++){let i=e[s];i==="."||i===".."?(i===".."&&(n.length!==0&&n[n.length-1]!==".."?n.pop():n.push("..")),o=s===r):n.push(i)}return o&&n[n.length-1]!==".."&&n.push(""),(n.length===0||n[0]===""||n[0].includes(":"))&&n.unshift("."),n.join("/")}var D1={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},L1=/[@/?#:]/g,q1=/[@/?#]/g;function h_(t,e){let r=e?q1:L1;return r.lastIndex=0,t.replace(r,n=>D1[n])}function g_(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let o=t.slice(n+1,n+3);if(bn(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));e&&Wd(i)?r+=i:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function U1(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(n==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(bn(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));i!=="."&&Wd(i)?e+=i:e+="%"+s,r+=2;continue}}if(p_(n))e+=n;else{let o=t.charCodeAt(r);if(o<128)e+=__(o)?n:ot[o];else if(o<55296||o>57343)e+=Ue(o);else if(o<=56319&&r+1<t.length){let s=t.charCodeAt(r+1);s>=56320&&s<=57343?(e+=Ue(65536+(o-55296<<10)+(s-56320)),r++):e+=Ue(65533)}else e+=Ue(65533)}}return e}function F1(t,e=!1){let r="",n=e&&t[0]!=="/";for(let o=0;o<t.length;o++){let s=t[o];if(s==="%"&&o+2<t.length){let i=t.slice(o+1,o+3);if(bn(i)){r+="%"+i.toUpperCase(),o+=2;continue}}if(s==="/"&&(n=!1),p_(s)&&(s!==":"||!n))r+=s;else{let i=t.charCodeAt(o);if(i<128)r+=ot[i];else if(i<55296||i>57343)r+=Ue(i);else if(i<=56319&&o+1<t.length){let a=t.charCodeAt(o+1);a>=56320&&a<=57343?(r+=Ue(65536+(i-55296<<10)+(a-56320)),o++):r+=Ue(65533)}else r+=Ue(65533)}}return r}function Kd(t,e){let r="";for(let n=0;n<t.length;n++){let o=t[n];if(o==="%"&&n+2<t.length){let s=t.slice(n+1,n+3);if(bn(s)){r+="%"+s.toUpperCase(),n+=2;continue}}if(e(o))r+=o;else{let s=t.charCodeAt(n);if(s<128)r+=ot[s];else if(s<55296||s>57343)r+=Ue(s);else if(s<=56319&&n+1<t.length){let i=t.charCodeAt(n+1);i>=56320&&i<=57343?(r+=Ue(65536+(s-55296<<10)+(i-56320)),n++):r+=Ue(65533)}else r+=Ue(65533)}}return r}function y_(t){return Kd(t,R1)}function H1(t){return Kd(t,Gd)}function B1(t){return Kd(t,Gd)}function __(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===42||t===43||t===45||t===46||t===47||t===64||t===95}function V1(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(n==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(bn(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));Wd(i)?e+=i:e+="%"+s,r+=2;continue}}if(Gd(n))e+=n;else{let o=t.charCodeAt(r);if(o<128)e+=__(o)?n:ot[o];else if(o<55296||o>57343)e+=Ue(o);else if(o<=56319&&r+1<t.length){let s=t.charCodeAt(r+1);s>=56320&&s<=57343?(e+=Ue(65536+(o-55296<<10)+(s-56320)),r++):e+=Ue(65533)}else e+=Ue(65533)}}return e}function J1(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(bn(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function W1(t){let e=[];if(t.userinfo!==void 0&&(e.push(y_(t.userinfo)),e.push("@")),t.host!==void 0){let r=t.host;if(!Jd(r)){let n=Vd(r);n.isIPV6!==!0&&n.isIPVFuture!==!0&&(r=g_(r,!0),n=Vd(r)),n.isIPV6===!0||n.isIPVFuture===!0?r=`[${n.escapedHost}]`:r=h_(r,!1)}e.push(r)}if(typeof t.port=="number"||typeof t.port=="string"){let r=String(t.port);if(!z1(r))throw new TypeError("URI port is malformed.");e.push(":"),e.push(r)}return e.length?e.join(""):void 0}v_.exports={nonSimpleDomain:I1,recomposeAuthority:W1,reescapeHostDelimiters:h_,normalizePercentEncoding:g_,normalizePathEncoding:U1,serializePathEncoding:F1,normalizeQueryFragmentEncoding:V1,encodeUserinfo:y_,encodeQuery:H1,encodeFragment:B1,escapePreservingEscapes:J1,removeDotSegments:m_,removeDotSegmentsRelative:Z1,isIPv4:Jd,isUUID:E1,normalizeIPv6:Vd,stringArrayToHexStripped:P1}});var k_=z((hL,$_)=>{"use strict";var{isUUID:G1}=Xd(),K1=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,X1=["http","https","ws","wss","urn","urn:uuid"];function Y1(t){return X1.indexOf(t)!==-1}function Yd(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function x_(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function b_(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function Q1(t){return t.secure=Yd(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function eR(t){if((t.port===(Yd(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let e=t.resourceName.indexOf("?"),r=e===-1?t.resourceName:t.resourceName.slice(0,e);t.path=r&&r!=="/"?r:void 0,t.query=e===-1?void 0:t.resourceName.slice(e+1),t.resourceName=void 0}return t.fragment=void 0,t}function tR(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(K1);if(r&&r[0]===t.path){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=Qd(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function rR(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=`${r}:${e.nid||n}`,s=Qd(o);s&&(t=s.serialize(t,e));let i=t,a=t.nss;return i.path=`${n||e.nid}:${a}`,e.skipEscape=!0,i}function nR(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!G1(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function oR(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var w_={scheme:"http",domainHost:!0,parse:x_,serialize:b_},sR={scheme:"https",domainHost:w_.domainHost,parse:x_,serialize:b_},sa={scheme:"ws",domainHost:!0,parse:Q1,serialize:eR},iR={scheme:"wss",domainHost:sa.domainHost,parse:sa.parse,serialize:sa.serialize},aR={scheme:"urn",parse:tR,serialize:rR,skipNormalize:!0},cR={scheme:"urn:uuid",parse:nR,serialize:oR,skipNormalize:!0},ia={http:w_,https:sR,ws:sa,wss:iR,urn:aR,"urn:uuid":cR};Object.setPrototypeOf(ia,null);function Qd(t){return t&&(ia[t]||ia[t.toLowerCase()])||void 0}$_.exports={wsIsSecure:Yd,SCHEMES:ia,isValidSchemeName:Y1,getSchemeHandler:Qd}});var D_=z((gL,da)=>{"use strict";var{normalizeIPv6:R_,removeDotSegments:ys,removeDotSegmentsRelative:P_,recomposeAuthority:uR,normalizePercentEncoding:ef,normalizePathEncoding:lR,serializePathEncoding:S_,normalizeQueryFragmentEncoding:T_,encodeQuery:dR,encodeFragment:fR,reescapeHostDelimiters:pR,isIPv4:C_,nonSimpleDomain:mR}=Xd(),{SCHEMES:O_,getSchemeHandler:tf}=k_(),A_=/^[A-Za-z][A-Za-z0-9+.-]*$/u,I_="URI scheme is malformed.",aa="URI host is malformed.",hR=/[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;function E_(t){let e=String(t);if(!A_.test(e))throw new TypeError(I_);return e}function gR(t,e){return typeof t=="string"?t=SR(t,e):typeof t=="object"&&(t=ua(wn(t,e),e)),t}function yR(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:o,malformedAuthorityOrPort:s,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:u}=ca(t,n),{parsed:l,malformedAuthorityOrPort:d,malformedPercentEncoding:m,malformedSchemeSpecific:p,malformedHost:f,malformedScheme:h}=ca(e,n);if(s||d||i||m||a||p||c||f||u||h)throw new Error(o.error||l.error||"URI is malformed.");let g=N_(o,l,n,!0),_=tf(r&&r.scheme||g.scheme),v=g.host,y=v!==void 0&&v!==""&&(C_(v)||R_(v).isIPV6);if(j_(g,r||{},_,y))throw new Error(aa);M_(g,r||{},_,y);let x=v&&v.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(v);if(g.error&&!x)throw new Error(g.error);return n.skipEscape=!0,wn(g,n)}function N_(t,e,r,n){let o={};if(n||(t=ua(wn(t,r),r),e=ua(wn(e,r),r)),r=r||{},!r.tolerant&&e.scheme)o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=ys(e.path||""),o.query=e.query;else{if(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=ys(e.path||""),o.query=e.query;else{if(!e.path)o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query;else{if(e.path[0]==="/")o.path=ys(e.path);else{let s=t.userinfo!==void 0||t.host!==void 0||t.port!==void 0;s&&!t.path?o.path="/"+e.path:t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path,o.path=t.scheme===void 0&&!s&&o.path[0]!=="/"?P_(o.path):ys(o.path)}o.query=e.query}o.userinfo=t.userinfo,o.host=t.host,o.port=t.port}o.scheme=t.scheme}return o.fragment=e.fragment,o}function _R(t,e,r){let n=z_(t,r),o=z_(e,r);return n!==void 0&&o!==void 0&&n===o}function wn(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),o=[];r.scheme&&(r.scheme=E_(r.scheme));let s=tf(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n);let i=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,a=(r.scheme===void 0||n.reference==="suffix")&&!i,c=!n.skipEscape&&a;r.path!==void 0&&(n.skipEscape?r.path=ef(r.path):r.path=S_(r.path,c)),n.reference!=="suffix"&&r.scheme&&(r.scheme=E_(r.scheme),o.push(r.scheme,":"));let u=uR(r);if(u!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(u),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=a&&l[0]!=="/"?P_(l):ys(l)),a&&(l=S_(l,!0)),u===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),o.push(l)}return r.query!==void 0&&o.push("?",dR(r.query)),r.fragment!==void 0&&o.push("#",fR(r.fragment)),o.join("")}var vR=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,xR=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,bR=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function wR(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function gs(t){if(t===void 0)return!1;let e=t.indexOf("%");for(;e!==-1;){if(e+2>=t.length||!/^[\da-f]{2}$/iu.test(t.slice(e+1,e+3)))return!0;e=t.indexOf("%",e+3)}return!1}function la(t){return t[0]==="["&&t[t.length-1]==="]"}function $R(t){let e=t[4];return gs(t[3])||e!==void 0&&!la(e)&&gs(e)||gs(t[6])||gs(t[7])||gs(t[8])}function M_(t,e,r,n){if(j_(t,e,r,n))return t.error=t.error||aa,!0;if(!e.unicodeSupport&&(!r||!r.unicodeSupport)&&t.host&&!la(t.host)&&(e.domainHost||r&&r.domainHost)&&n===!1&&mR(t.host)){let o;try{o=new URL("http://"+t.host)}catch(s){return t.error=t.error||"Host's domain name can not be converted to ASCII: "+s,!0}if(!kR(o))return t.error=t.error||aa,!0;t.host=o.hostname}return!1}function j_(t,e,r,n){return!!(t.host&&n===!1&&!la(t.host)&&(e.domainHost||r&&r.domainHost)&&hR.test(t.host))}function kR(t){return t.username===""&&t.password===""&&t.port===""&&t.pathname==="/"&&t.search===""&&t.hash===""&&t.hostname!==""}function ca(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1,i=!1,a=!1,c=!1,u=!1,l=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let d=t.match(xR);d!==null&&d[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",o=!0);let m=t.match(bR);if(m!==null){let f=m[1],h=f.replace(/[\t\n\r]/g,"");h.length>=2&&(h.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",o=!0):f.length!==h.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",o=!0))}let p=t.match(vR);if(p){n.scheme=p[1],n.userinfo=p[3],n.host=p[4],n.port=parseInt(p[5],10),n.path=p[6]||"",n.query=p[7],n.fragment=p[8],n.scheme!==void 0&&(A_.test(n.scheme)?n.scheme=n.scheme.toLowerCase():(n.error=n.error||I_,u=!0)),s=$R(p),s&&(n.error=n.error||"URI contains malformed percent-encoding."),isNaN(n.port)&&(n.port=p[5]);let f=wR(n,p);if(f!==void 0&&(n.error=n.error||f,o=!0),n.host)if(C_(n.host)===!1){let _=la(n.host),v=n.host.indexOf("[")!==-1||n.host.indexOf("]")!==-1,y=R_(n.host);l=y.isIPV6||y.isIPVFuture===!0,c=v&&(!_||y.error===!0),n.host=l?y.host:y.host.toLowerCase(),c&&(n.error=n.error||aa,o=!0)}else l=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let h=tf(r.scheme||n.scheme);if(c||(a=M_(n,r,h,l)),t.indexOf("%")!==-1&&n.host!==void 0&&!c){let g=l?n.host:ef(n.host,!0);l||(g=ef(g.toLowerCase())),n.host=l||r.scheme!=="null"?pR(g,l):g}(!h||h&&!h.skipNormalize)&&(n.path&&(n.path=lR(n.path)),n.query&&(n.query=T_(n.query)),n.fragment&&(n.fragment=T_(n.fragment))),h&&h.parse&&(h.parse(n,r),h===O_.urn&&n.nid===void 0&&(i=!0))}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:u}}function ua(t,e){return ca(t,e).parsed}function SR(t,e){return Z_(t,e).normalized}function Z_(t,e){let{parsed:r,malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:s,malformedHost:i,malformedScheme:a}=ca(t,e);return{normalized:n||o||s||i||a?t:wn(r,e),malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:s,malformedHost:i,malformedScheme:a}}function z_(t,e){if(typeof t!="string"&&typeof t!="object")return;let r;try{r=typeof t=="string"?t:wn(t,e)}catch{return}let{normalized:n,malformedAuthorityOrPort:o,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:c}=Z_(r,e);return o||s||i||a||c?void 0:n}var rf={SCHEMES:O_,normalize:gR,resolve:yR,resolveComponent:N_,equal:_R,serialize:wn,parse:ua};da.exports=rf;da.exports.default=rf;da.exports.fastUri=rf});var q_=z(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});var L_=D_();L_.code='require("ajv/dist/runtime/uri").default';nf.default=L_});var G_=z(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.CodeGen=Me.Name=Me.nil=Me.stringify=Me.str=Me._=Me.KeywordCxt=void 0;var TR=ms();Object.defineProperty(Me,"KeywordCxt",{enumerable:!0,get:function(){return TR.KeywordCxt}});var io=G();Object.defineProperty(Me,"_",{enumerable:!0,get:function(){return io._}});Object.defineProperty(Me,"str",{enumerable:!0,get:function(){return io.str}});Object.defineProperty(Me,"stringify",{enumerable:!0,get:function(){return io.stringify}});Object.defineProperty(Me,"nil",{enumerable:!0,get:function(){return io.nil}});Object.defineProperty(Me,"Name",{enumerable:!0,get:function(){return io.Name}});Object.defineProperty(Me,"CodeGen",{enumerable:!0,get:function(){return io.CodeGen}});var ER=ra(),V_=hs(),zR=Td(),_s=oa(),RR=G(),vs=ds(),fa=ls(),sf=ae(),U_=d_(),PR=q_(),J_=(t,e)=>new RegExp(t,e);J_.code="new RegExp";var CR=["removeAdditional","useDefaults","coerceTypes"],OR=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),AR={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},IR={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},F_=200;function NR(t){var e,r,n,o,s,i,a,c,u,l,d,m,p,f,h,g,_,v,y,x,$,I,U,H,ie;let Re=t.strict,D=(e=t.code)===null||e===void 0?void 0:e.optimize,xe=D===!0||D===void 0?1:D||0,jt=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:J_,Ur=(o=t.uriResolver)!==null&&o!==void 0?o:PR.default;return{strictSchema:(i=(s=t.strictSchema)!==null&&s!==void 0?s:Re)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:Re)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:Re)!==null&&l!==void 0?l:"log",strictTuples:(m=(d=t.strictTuples)!==null&&d!==void 0?d:Re)!==null&&m!==void 0?m:"log",strictRequired:(f=(p=t.strictRequired)!==null&&p!==void 0?p:Re)!==null&&f!==void 0?f:!1,code:t.code?{...t.code,optimize:xe,regExp:jt}:{optimize:xe,regExp:jt},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:F_,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:F_,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(y=t.inlineRefs)!==null&&y!==void 0?y:!0,schemaId:(x=t.schemaId)!==null&&x!==void 0?x:"$id",addUsedSchema:($=t.addUsedSchema)!==null&&$!==void 0?$:!0,validateSchema:(I=t.validateSchema)!==null&&I!==void 0?I:!0,validateFormats:(U=t.validateFormats)!==null&&U!==void 0?U:!0,unicodeRegExp:(H=t.unicodeRegExp)!==null&&H!==void 0?H:!0,int32range:(ie=t.int32range)!==null&&ie!==void 0?ie:!0,uriResolver:Ur}}var xs=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...NR(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new RR.ValueScope({scope:{},prefixes:OR,es5:r,lines:n}),this.logger=qR(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,zR.getRules)(),H_.call(this,AR,e,"NOT SUPPORTED"),H_.call(this,IR,e,"DEPRECATED","warn"),this._metaOpts=DR.call(this),e.formats&&jR.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&ZR.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),MR.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=U_;n==="id"&&(o={...U_},o.id=o.$id,delete o.$id),r&&e&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,e,r);async function o(l,d){await s.call(this,l.$schema);let m=this._addSchema(l,d);return m.validate||i.call(this,m)}async function s(l){l&&!this.getSchema(l)&&await o.call(this,{$ref:l},!0)}async function i(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof V_.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),i.call(this,l)}}function a({missingSchema:l,missingRef:d}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${d} cannot be resolved`)}async function c(l){let d=await u.call(this,l);this.refs[l]||await s.call(this,d.$schema),this.refs[l]||this.addSchema(d,l,r)}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(e,r,n,o=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,n,o);return this}let s;if(typeof e=="object"){let{schemaId:i}=this.opts;if(s=e[i],s!==void 0&&typeof s!="string")throw new Error(`schema ${i} must be string`)}return r=(0,vs.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,o,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,e);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(e){let r;for(;typeof(r=B_.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new _s.SchemaEnv({schema:{},schemaId:n});if(r=_s.resolveSchema.call(this,o,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=B_.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,vs.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(FR.call(this,n,r),!r)return(0,sf.eachItem)(n,s=>of.call(this,s)),this;BR.call(this,r);let o={...r,type:(0,fa.getJSONTypes)(r.type),schemaType:(0,fa.getJSONTypes)(r.schemaType)};return(0,sf.eachItem)(n,o.type.length===0?s=>of.call(this,s,o):s=>o.type.forEach(i=>of.call(this,s,o,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===e);o>=0&&n.rules.splice(o,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let s=o.split("/").slice(1),i=e;for(let a of s)i=i[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,l=i[a];u&&l&&(i[a]=W_(l))}}return e}_removeAllSchemas(e,r){for(let n in e){let o=e[n];(!r||r.test(n))&&(typeof o=="string"?delete e[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[n]))}}_addSchema(e,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:a}=this.opts;if(typeof e=="object")i=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,vs.normalizeId)(i||n);let u=vs.getSchemaRefs.call(this,e,n);return c=new _s.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):_s.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{_s.compileSchema.call(this,e)}finally{this.opts=r}}};xs.ValidationError=ER.default;xs.MissingRefError=V_.default;Me.default=xs;function H_(t,e,r,n="error"){for(let o in t){let s=o;s in e&&this.logger[n](`${r}: option ${o}. ${t[s]}`)}}function B_(t){return t=(0,vs.normalizeId)(t),this.schemas[t]||this.refs[t]}function MR(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function jR(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function ZR(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function DR(){let t={...this.opts};for(let e of CR)delete t[e];return t}var LR={log(){},warn(){},error(){}};function qR(t){if(t===!1)return LR;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var UR=/^[a-z_$][a-z0-9_$:-]*$/i;function FR(t,e){let{RULES:r}=this;if((0,sf.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!UR.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function of(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=o?s.post:s.rules.find(({type:c})=>c===r);if(i||(i={type:r,rules:[]},s.rules.push(i)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,fa.getJSONTypes)(e.type),schemaType:(0,fa.getJSONTypes)(e.schemaType)}};e.before?HR.call(this,i,a,e.before):i.rules.push(a),s.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function HR(t,e,r){let n=t.rules.findIndex(o=>o.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function BR(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=W_(e)),t.validateSchema=this.compile(e,!0))}var VR={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function W_(t){return{anyOf:[t,VR]}}});var K_=z(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});var JR={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};af.default=JR});var e0=z($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.callRef=$n.getValidate=void 0;var WR=hs(),X_=gt(),st=G(),ao=cr(),Y_=oa(),pa=ae(),GR={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:s,validateName:i,opts:a,self:c}=n,{root:u}=s;if((r==="#"||r==="#/")&&o===u.baseId)return d();let l=Y_.resolveRef.call(c,u,o,r);if(l===void 0)throw new WR.default(n.opts.uriResolver,o,r);if(l instanceof Y_.SchemaEnv)return m(l);return p(l);function d(){if(s===u)return ma(t,i,s,s.$async);let f=e.scopeValue("root",{ref:u});return ma(t,(0,st._)`${f}.validate`,u,u.$async)}function m(f){let h=Q_(t,f);ma(t,h,f,f.$async)}function p(f){let h=e.scopeValue("schema",a.code.source===!0?{ref:f,code:(0,st.stringify)(f)}:{ref:f}),g=e.name("valid"),_=t.subschema({schema:f,dataTypes:[],schemaPath:st.nil,topSchemaRef:h,errSchemaPath:r},g);t.mergeEvaluated(_),t.ok(g)}}};function Q_(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,st._)`${r.scopeValue("wrapper",{ref:e})}.validate`}$n.getValidate=Q_;function ma(t,e,r,n){let{gen:o,it:s}=t,{allErrors:i,schemaEnv:a,opts:c}=s,u=c.passContext?ao.default.this:st.nil;n?l():d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let f=o.let("valid");o.try(()=>{o.code((0,st._)`await ${(0,X_.callValidateCode)(t,e,u)}`),p(e),i||o.assign(f,!0)},h=>{o.if((0,st._)`!(${h} instanceof ${s.ValidationError})`,()=>o.throw(h)),m(h),i||o.assign(f,!1)}),t.ok(f)}function d(){t.result((0,X_.callValidateCode)(t,e,u),()=>p(e),()=>m(e))}function m(f){let h=(0,st._)`${f}.errors`;o.assign(ao.default.vErrors,(0,st._)`${ao.default.vErrors} === null ? ${h} : ${ao.default.vErrors}.concat(${h})`),o.assign(ao.default.errors,(0,st._)`${ao.default.vErrors}.length`)}function p(f){var h;if(!s.opts.unevaluated)return;let g=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(s.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(s.props=pa.mergeEvaluated.props(o,g.props,s.props));else{let _=o.var("props",(0,st._)`${f}.evaluated.props`);s.props=pa.mergeEvaluated.props(o,_,s.props,st.Name)}if(s.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(s.items=pa.mergeEvaluated.items(o,g.items,s.items));else{let _=o.var("items",(0,st._)`${f}.evaluated.items`);s.items=pa.mergeEvaluated.items(o,_,s.items,st.Name)}}}$n.callRef=ma;$n.default=GR});var t0=z(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});var KR=K_(),XR=e0(),YR=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",KR.default,XR.default];cf.default=YR});var r0=z(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});var ha=G(),Ar=ha.operators,ga={maximum:{okStr:"<=",ok:Ar.LTE,fail:Ar.GT},minimum:{okStr:">=",ok:Ar.GTE,fail:Ar.LT},exclusiveMaximum:{okStr:"<",ok:Ar.LT,fail:Ar.GTE},exclusiveMinimum:{okStr:">",ok:Ar.GT,fail:Ar.LTE}},QR={message:({keyword:t,schemaCode:e})=>(0,ha.str)`must be ${ga[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,ha._)`{comparison: ${ga[t].okStr}, limit: ${e}}`},eP={keyword:Object.keys(ga),type:"number",schemaType:"number",$data:!0,error:QR,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,ha._)`${r} ${ga[e].fail} ${n} || isNaN(${r})`)}};uf.default=eP});var n0=z(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});var bs=G(),tP={message:({schemaCode:t})=>(0,bs.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,bs._)`{multipleOf: ${t}}`},rP={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:tP,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,i=e.let("res"),a=s?(0,bs._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,bs._)`${i} !== parseInt(${i})`;t.fail$data((0,bs._)`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};lf.default=rP});var s0=z(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});function o0(t){let e=t.length,r=0,n=0,o;for(;n<e;)r++,o=t.charCodeAt(n++),o>=55296&&o<=56319&&n<e&&(o=t.charCodeAt(n),(o&64512)===56320&&n++);return r}df.default=o0;o0.code='require("ajv/dist/runtime/ucs2length").default'});var i0=z(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});var kn=G(),nP=ae(),oP=s0(),sP={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,kn.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,kn._)`{limit: ${t}}`},iP={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:sP,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?kn.operators.GT:kn.operators.LT,i=o.opts.unicode===!1?(0,kn._)`${r}.length`:(0,kn._)`${(0,nP.useFunc)(t.gen,oP.default)}(${r})`;t.fail$data((0,kn._)`${i} ${s} ${n}`)}};ff.default=iP});var a0=z(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});var aP=gt(),cP=ae(),co=G(),uP={message:({schemaCode:t})=>(0,co.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,co._)`{pattern: ${t}}`},lP={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:uP,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:i}=t,a=i.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=i.opts.code,u=c.code==="new RegExp"?(0,co._)`new RegExp`:(0,cP.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,co._)`${u}(${s}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,co._)`!${l}`)}else{let c=(0,aP.usePattern)(t,o);t.fail$data((0,co._)`!${c}.test(${r})`)}}};pf.default=lP});var c0=z(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});var ws=G(),dP={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,ws.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,ws._)`{limit: ${t}}`},fP={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:dP,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?ws.operators.GT:ws.operators.LT;t.fail$data((0,ws._)`Object.keys(${r}).length ${o} ${n}`)}};mf.default=fP});var u0=z(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});var $s=gt(),ks=G(),pP=ae(),mP={message:({params:{missingProperty:t}})=>(0,ks.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ks._)`{missingProperty: ${t}}`},hP={keyword:"required",type:"object",schemaType:"array",$data:!0,error:mP,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:s,it:i}=t,{opts:a}=i;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors?u():l(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:f}=t.it;for(let h of r)if(p?.[h]===void 0&&!f.has(h)){let g=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,pP.checkStrictMode)(i,_,i.opts.strictRequired)}}function u(){if(c||s)t.block$data(ks.nil,d);else for(let p of r)(0,$s.checkReportMissingProp)(t,p)}function l(){let p=e.let("missing");if(c||s){let f=e.let("valid",!0);t.block$data(f,()=>m(p,f)),t.ok(f)}else e.if((0,$s.checkMissingProp)(t,r,p)),(0,$s.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,$s.noPropertyInData)(e,o,p,a.ownProperties),()=>t.error())})}function m(p,f){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(f,(0,$s.propertyInData)(e,o,p,a.ownProperties)),e.if((0,ks.not)(f),()=>{t.error(),e.break()})},ks.nil)}}};hf.default=hP});var l0=z(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});var Ss=G(),gP={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Ss.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Ss._)`{limit: ${t}}`},yP={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:gP,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?Ss.operators.GT:Ss.operators.LT;t.fail$data((0,Ss._)`${r}.length ${o} ${n}`)}};gf.default=yP});var ya=z(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});var d0=Id();d0.code='require("ajv/dist/runtime/equal").default';yf.default=d0});var f0=z(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});var _f=ls(),je=G(),_P=ae(),vP=ya(),xP={message:({params:{i:t,j:e}})=>(0,je.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,je._)`{i: ${t}, j: ${e}}`},bP={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:xP,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:s,schemaCode:i,it:a}=t;if(!n&&!o)return;let c=e.let("valid"),u=s.items?(0,_f.getSchemaTypes)(s.items):[];t.block$data(c,l,(0,je._)`${i} === false`),t.ok(c);function l(){let f=e.let("i",(0,je._)`${r}.length`),h=e.let("j");t.setParams({i:f,j:h}),e.assign(c,!0),e.if((0,je._)`${f} > 1`,()=>(d()?m:p)(f,h))}function d(){return u.length>0&&!u.some(f=>f==="object"||f==="array")}function m(f,h){let g=e.name("item"),_=(0,_f.checkDataTypes)(u,g,a.opts.strictNumbers,_f.DataType.Wrong),v=e.const("indices",(0,je._)`{}`);e.for((0,je._)`;${f}--;`,()=>{e.let(g,(0,je._)`${r}[${f}]`),e.if(_,(0,je._)`continue`),u.length>1&&e.if((0,je._)`typeof ${g} == "string"`,(0,je._)`${g} += "_"`),e.if((0,je._)`typeof ${v}[${g}] == "number"`,()=>{e.assign(h,(0,je._)`${v}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,je._)`${v}[${g}] = ${f}`)})}function p(f,h){let g=(0,_P.useFunc)(e,vP.default),_=e.name("outer");e.label(_).for((0,je._)`;${f}--;`,()=>e.for((0,je._)`${h} = ${f}; ${h}--;`,()=>e.if((0,je._)`${g}(${r}[${f}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};vf.default=bP});var p0=z(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});var xf=G(),wP=ae(),$P=ya(),kP={message:"must be equal to constant",params:({schemaCode:t})=>(0,xf._)`{allowedValue: ${t}}`},SP={keyword:"const",$data:!0,error:kP,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,xf._)`!${(0,wP.useFunc)(e,$P.default)}(${r}, ${o})`):t.fail((0,xf._)`${s} !== ${r}`)}};bf.default=SP});var m0=z(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});var Ts=G(),TP=ae(),EP=ya(),zP={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Ts._)`{allowedValues: ${t}}`},RP={keyword:"enum",schemaType:"array",$data:!0,error:zP,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:i}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=i.opts.loopEnum,c,u=()=>c??(c=(0,TP.useFunc)(e,EP.default)),l;if(a||n)l=e.let("valid"),t.block$data(l,d);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let p=e.const("vSchema",s);l=(0,Ts.or)(...o.map((f,h)=>m(p,h)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",s,p=>e.if((0,Ts._)`${u()}(${r}, ${p})`,()=>e.assign(l,!0).break()))}function m(p,f){let h=o[f];return typeof h=="object"&&h!==null?(0,Ts._)`${u()}(${r}, ${p}[${f}])`:(0,Ts._)`${r} === ${h}`}}};wf.default=RP});var h0=z($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});var PP=r0(),CP=n0(),OP=i0(),AP=a0(),IP=c0(),NP=u0(),MP=l0(),jP=f0(),ZP=p0(),DP=m0(),LP=[PP.default,CP.default,OP.default,AP.default,IP.default,NP.default,MP.default,jP.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ZP.default,DP.default];$f.default=LP});var Sf=z(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.validateAdditionalItems=void 0;var Sn=G(),kf=ae(),qP={message:({params:{len:t}})=>(0,Sn.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Sn._)`{limit: ${t}}`},UP={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:qP,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,kf.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}g0(t,n)}};function g0(t,e){let{gen:r,schema:n,data:o,keyword:s,it:i}=t;i.items=!0;let a=r.const("len",(0,Sn._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Sn._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,kf.alwaysValidSchema)(i,n)){let u=r.var("valid",(0,Sn._)`${a} <= ${e.length}`);r.if((0,Sn.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,a,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:kf.Type.Num},u),i.allErrors||r.if((0,Sn.not)(u),()=>r.break())})}}Es.validateAdditionalItems=g0;Es.default=UP});var Tf=z(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.validateTuple=void 0;var y0=G(),_a=ae(),FP=gt(),HP={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return _0(t,"additionalItems",e);r.items=!0,!(0,_a.alwaysValidSchema)(r,e)&&t.ok((0,FP.validateArray)(t))}};function _0(t,e,r=t.schema){let{gen:n,parentSchema:o,data:s,keyword:i,it:a}=t;l(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=_a.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,y0._)`${s}.length`);r.forEach((d,m)=>{(0,_a.alwaysValidSchema)(a,d)||(n.if((0,y0._)`${u} > ${m}`,()=>t.subschema({keyword:i,schemaProp:m,dataProp:m},c)),t.ok(c))});function l(d){let{opts:m,errSchemaPath:p}=a,f=r.length,h=f===d.minItems&&(f===d.maxItems||d[e]===!1);if(m.strictTuples&&!h){let g=`"${i}" is ${f}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,_a.checkStrictMode)(a,g,m.strictTuples)}}}zs.validateTuple=_0;zs.default=HP});var v0=z(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});var BP=Tf(),VP={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,BP.validateTuple)(t,"items")};Ef.default=VP});var b0=z(zf=>{"use strict";Object.defineProperty(zf,"__esModule",{value:!0});var x0=G(),JP=ae(),WP=gt(),GP=Sf(),KP={message:({params:{len:t}})=>(0,x0.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,x0._)`{limit: ${t}}`},XP={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:KP,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,JP.alwaysValidSchema)(n,e)&&(o?(0,GP.validateAdditionalItems)(t,o):t.ok((0,WP.validateArray)(t)))}};zf.default=XP});var w0=z(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});var _t=G(),va=ae(),YP={message:({params:{min:t,max:e}})=>e===void 0?(0,_t.str)`must contain at least ${t} valid item(s)`:(0,_t.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,_t._)`{minContains: ${t}}`:(0,_t._)`{minContains: ${t}, maxContains: ${e}}`},QP={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:YP,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t,i,a,{minContains:c,maxContains:u}=n;s.opts.next?(i=c===void 0?1:c,a=u):i=1;let l=e.const("len",(0,_t._)`${o}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,va.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,va.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,va.alwaysValidSchema)(s,r)){let h=(0,_t._)`${l} >= ${i}`;a!==void 0&&(h=(0,_t._)`${h} && ${l} <= ${a}`),t.pass(h);return}s.items=!0;let d=e.name("valid");a===void 0&&i===1?p(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,_t._)`${o}.length > 0`,m)):(e.let(d,!1),m()),t.result(d,()=>t.reset());function m(){let h=e.name("_valid"),g=e.let("count",0);p(h,()=>e.if(h,()=>f(g)))}function p(h,g){e.forRange("i",0,l,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:va.Type.Num,compositeRule:!0},h),g()})}function f(h){e.code((0,_t._)`${h}++`),a===void 0?e.if((0,_t._)`${h} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,_t._)`${h} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,_t._)`${h} >= ${i}`,()=>e.assign(d,!0)))}}};Rf.default=QP});var S0=z(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.validateSchemaDeps=Vt.validatePropertyDeps=Vt.error=void 0;var Pf=G(),eC=ae(),Rs=gt();Vt.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Pf.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Pf._)`{property: ${t},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
deps: ${r}}`};var tC={keyword:"dependencies",type:"object",schemaType:"object",error:Vt.error,code(t){let[e,r]=rC(t);$0(t,e),k0(t,r)}};function rC({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let o=Array.isArray(t[n])?e:r;o[n]=t[n]}return[e,r]}function $0(t,e=t.schema){let{gen:r,data:n,it:o}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let i in e){let a=e[i];if(a.length===0)continue;let c=(0,Rs.propertyInData)(r,n,i,o.opts.ownProperties);t.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of a)(0,Rs.checkReportMissingProp)(t,u)}):(r.if((0,Pf._)`${c} && (${(0,Rs.checkMissingProp)(t,a,s)})`),(0,Rs.reportMissingProp)(t,s),r.else())}}Vt.validatePropertyDeps=$0;function k0(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,i=r.name("valid");for(let a in e)(0,eC.alwaysValidSchema)(s,e[a])||(r.if((0,Rs.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:o,schemaProp:a},i);t.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),t.ok(i))}Vt.validateSchemaDeps=k0;Vt.default=tC});var E0=z(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});var T0=G(),nC=ae(),oC={message:"property name must be valid",params:({params:t})=>(0,T0._)`{propertyName: ${t.propertyName}}`},sC={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:oC,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,nC.alwaysValidSchema)(o,r))return;let s=e.name("valid");e.forIn("key",n,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),e.if((0,T0.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Cf.default=sC});var Af=z(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});var xa=gt(),Ct=G(),iC=cr(),ba=ae(),aC={message:"must NOT have additional properties",params:({params:t})=>(0,Ct._)`{additionalProperty: ${t.additionalProperty}}`},cC={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:aC,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:s,it:i}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&(0,ba.alwaysValidSchema)(i,r))return;let u=(0,xa.allSchemaProperties)(n.properties),l=(0,xa.allSchemaProperties)(n.patternProperties);d(),t.ok((0,Ct._)`${s} === ${iC.default.errors}`);function d(){e.forIn("key",o,g=>{!u.length&&!l.length?f(g):e.if(m(g),()=>f(g))})}function m(g){let _;if(u.length>8){let v=(0,ba.schemaRefOrVal)(i,n.properties,"properties");_=(0,xa.isOwnProperty)(e,v,g)}else u.length?_=(0,Ct.or)(...u.map(v=>(0,Ct._)`${g} === ${v}`)):_=Ct.nil;return l.length&&(_=(0,Ct.or)(_,...l.map(v=>(0,Ct._)`${(0,xa.usePattern)(t,v)}.test(${g})`))),(0,Ct.not)(_)}function p(g){e.code((0,Ct._)`delete ${o}[${g}]`)}function f(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,ba.alwaysValidSchema)(i,r)){let _=e.name("valid");c.removeAdditional==="failing"?(h(g,_,!1),e.if((0,Ct.not)(_),()=>{t.reset(),p(g)})):(h(g,_),a||e.if((0,Ct.not)(_),()=>e.break()))}}function h(g,_,v){let y={keyword:"additionalProperties",dataProp:g,dataPropType:ba.Type.Str};v===!1&&Object.assign(y,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(y,_)}}};Of.default=cC});var P0=z(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});var uC=ms(),z0=gt(),If=ae(),R0=Af(),lC={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&R0.default.code(new uC.KeywordCxt(s,R0.default,"additionalProperties"));let i=(0,z0.allSchemaProperties)(r);for(let d of i)s.definedProperties.add(d);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=If.mergeEvaluated.props(e,(0,If.toHash)(i),s.props));let a=i.filter(d=>!(0,If.alwaysValidSchema)(s,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)u(d)?l(d):(e.if((0,z0.propertyInData)(e,o,d,s.opts.ownProperties)),l(d),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function u(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function l(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Nf.default=lC});var I0=z(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});var C0=gt(),wa=G(),O0=ae(),A0=ae(),dC={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:s}=t,{opts:i}=s,a=(0,C0.allSchemaProperties)(r),c=a.filter(h=>(0,O0.alwaysValidSchema)(s,r[h]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&o.properties,l=e.name("valid");s.props!==!0&&!(s.props instanceof wa.Name)&&(s.props=(0,A0.evaluatedPropsToName)(e,s.props));let{props:d}=s;m();function m(){for(let h of a)u&&p(h),s.allErrors?f(h):(e.var(l,!0),f(h),e.if(l))}function p(h){for(let g in u)new RegExp(h).test(g)&&(0,O0.checkStrictMode)(s,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function f(h){e.forIn("key",n,g=>{e.if((0,wa._)`${(0,C0.usePattern)(t,h)}.test(${g})`,()=>{let _=c.includes(h);_||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:A0.Type.Str},l),s.opts.unevaluated&&d!==!0?e.assign((0,wa._)`${d}[${g}]`,!0):!_&&!s.allErrors&&e.if((0,wa.not)(l),()=>e.break())})})}}};Mf.default=dC});var N0=z(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});var fC=ae(),pC={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,fC.alwaysValidSchema)(n,r)){t.fail();return}let o=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};jf.default=pC});var M0=z(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});var mC=gt(),hC={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:mC.validateUnion,error:{message:"must match a schema in anyOf"}};Zf.default=hC});var j0=z(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});var $a=G(),gC=ae(),yC={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,$a._)`{passingSchemas: ${t.passing}}`},_C={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:yC,code(t){let{gen:e,schema:r,parentSchema:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,i=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(i,()=>t.reset(),()=>t.error(!0));function u(){s.forEach((l,d)=>{let m;(0,gC.alwaysValidSchema)(o,l)?e.var(c,!0):m=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,$a._)`${c} && ${i}`).assign(i,!1).assign(a,(0,$a._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(i,!0),e.assign(a,d),m&&t.mergeEvaluated(m,$a.Name)})})}}};Df.default=_C});var Z0=z(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});var vC=ae(),xC={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=e.name("valid");r.forEach((s,i)=>{if((0,vC.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:i},o);t.ok(o),t.mergeEvaluated(a)})}};Lf.default=xC});var q0=z(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});var ka=G(),L0=ae(),bC={message:({params:t})=>(0,ka.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,ka._)`{failingKeyword: ${t.ifClause}}`},wC={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:bC,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,L0.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=D0(n,"then"),s=D0(n,"else");if(!o&&!s)return;let i=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),o&&s){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(a,u("then",l),u("else",l))}else o?e.if(a,u("then")):e.if((0,ka.not)(a),u("else"));t.pass(i,()=>t.error(!0));function c(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(l)}function u(l,d){return()=>{let m=t.subschema({keyword:l},a);e.assign(i,a),t.mergeValidEvaluated(m,i),d?e.assign(d,(0,ka._)`${l}`):t.setParams({ifClause:l})}}}};function D0(t,e){let r=t.schema[e];return r!==void 0&&!(0,L0.alwaysValidSchema)(t,r)}qf.default=wC});var U0=z(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});var $C=ae(),kC={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,$C.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Uf.default=kC});var F0=z(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});var SC=Sf(),TC=v0(),EC=Tf(),zC=b0(),RC=w0(),PC=S0(),CC=E0(),OC=Af(),AC=P0(),IC=I0(),NC=N0(),MC=M0(),jC=j0(),ZC=Z0(),DC=q0(),LC=U0();function qC(t=!1){let e=[NC.default,MC.default,jC.default,ZC.default,DC.default,LC.default,CC.default,OC.default,PC.default,AC.default,IC.default];return t?e.push(TC.default,zC.default):e.push(SC.default,EC.default),e.push(RC.default),e}Ff.default=qC});var H0=z(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});var Te=G(),UC={message:({schemaCode:t})=>(0,Te.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Te._)`{format: ${t}}`},FC={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:UC,code(t,e){let{gen:r,data:n,$data:o,schema:s,schemaCode:i,it:a}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=a;if(!c.validateFormats)return;o?m():p();function m(){let f=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,Te._)`${f}[${i}]`),g=r.let("fType"),_=r.let("format");r.if((0,Te._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,Te._)`${h}.type || "string"`).assign(_,(0,Te._)`${h}.validate`),()=>r.assign(g,(0,Te._)`"string"`).assign(_,h)),t.fail$data((0,Te.or)(v(),y()));function v(){return c.strictSchema===!1?Te.nil:(0,Te._)`${i} && !${_}`}function y(){let x=l.$async?(0,Te._)`(${h}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,Te._)`${_}(${n})`,$=(0,Te._)`(typeof ${_} == "function" ? ${x} : ${_}.test(${n}))`;return(0,Te._)`${_} && ${_} !== true && ${g} === ${e} && !${$}`}}function p(){let f=d.formats[s];if(!f){v();return}if(f===!0)return;let[h,g,_]=y(f);h===e&&t.pass(x());function v(){if(c.strictSchema===!1){d.logger.warn($());return}throw new Error($());function $(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function y($){let I=$ instanceof RegExp?(0,Te.regexpCode)($):c.code.formats?(0,Te._)`${c.code.formats}${(0,Te.getProperty)(s)}`:void 0,U=r.scopeValue("formats",{key:s,ref:$,code:I});return typeof $=="object"&&!($ instanceof RegExp)?[$.type||"string",$.validate,(0,Te._)`${U}.validate`]:["string",$,U]}function x(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Te._)`await ${_}(${n})`}return typeof g=="function"?(0,Te._)`${_}(${n})`:(0,Te._)`${_}.test(${n})`}}}};Hf.default=FC});var B0=z(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});var HC=H0(),BC=[HC.default];Bf.default=BC});var V0=z(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.contentVocabulary=uo.metadataVocabulary=void 0;uo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];uo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var W0=z(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});var VC=t0(),JC=h0(),WC=F0(),GC=B0(),J0=V0(),KC=[VC.default,JC.default,(0,WC.default)(),GC.default,J0.metadataVocabulary,J0.contentVocabulary];Vf.default=KC});var K0=z(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.DiscrError=void 0;var G0;(function(t){t.Tag="tag",t.Mapping="mapping"})(G0||(Sa.DiscrError=G0={}))});var Y0=z(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0});var lo=G(),Jf=K0(),X0=oa(),XC=hs(),YC=ae(),QC={message:({params:{discrError:t,tagName:e}})=>t===Jf.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,lo._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},eO={keyword:"discriminator",type:"object",schemaType:"object",error:QC,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:s}=t,{oneOf:i}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),u=e.const("tag",(0,lo._)`${r}${(0,lo.getProperty)(a)}`);e.if((0,lo._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:Jf.DiscrError.Tag,tag:u,tagName:a})),t.ok(c);function l(){let p=m();e.if(!1);for(let f in p)e.elseIf((0,lo._)`${u} === ${f}`),e.assign(c,d(p[f]));e.else(),t.error(!1,{discrError:Jf.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function d(p){let f=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:p},f);return t.mergeEvaluated(h,lo.Name),f}function m(){var p;let f={},h=_(o),g=!0;for(let x=0;x<i.length;x++){let $=i[x];if($?.$ref&&!(0,YC.schemaHasRulesButRef)($,s.self.RULES)){let U=$.$ref;if($=X0.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,U),$ instanceof X0.SchemaEnv&&($=$.schema),$===void 0)throw new XC.default(s.opts.uriResolver,s.baseId,U)}let I=(p=$?.properties)===null||p===void 0?void 0:p[a];if(typeof I!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(h||_($)),v(I,x)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return f;function _({required:x}){return Array.isArray(x)&&x.includes(a)}function v(x,$){if(x.const)y(x.const,$);else if(x.enum)for(let I of x.enum)y(I,$);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function y(x,$){if(typeof x!="string"||x in f)throw new Error(`discriminator: "${a}" values must be unique strings`);f[x]=$}}}};Wf.default=eO});var Q0=z((oq,tO)=>{tO.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Kf=z((ve,Gf)=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.MissingRefError=ve.ValidationError=ve.CodeGen=ve.Name=ve.nil=ve.stringify=ve.str=ve._=ve.KeywordCxt=ve.Ajv=void 0;var rO=G_(),nO=W0(),oO=Y0(),ev=Q0(),sO=["/properties"],Ta="http://json-schema.org/draft-07/schema",fo=class extends rO.default{_addVocabularies(){super._addVocabularies(),nO.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(oO.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(ev,sO):ev;this.addMetaSchema(e,Ta,!1),this.refs["http://json-schema.org/schema"]=Ta}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ta)?Ta:void 0)}};ve.Ajv=fo;Gf.exports=ve=fo;Gf.exports.Ajv=fo;Object.defineProperty(ve,"__esModule",{value:!0});ve.default=fo;var iO=ms();Object.defineProperty(ve,"KeywordCxt",{enumerable:!0,get:function(){return iO.KeywordCxt}});var po=G();Object.defineProperty(ve,"_",{enumerable:!0,get:function(){return po._}});Object.defineProperty(ve,"str",{enumerable:!0,get:function(){return po.str}});Object.defineProperty(ve,"stringify",{enumerable:!0,get:function(){return po.stringify}});Object.defineProperty(ve,"nil",{enumerable:!0,get:function(){return po.nil}});Object.defineProperty(ve,"Name",{enumerable:!0,get:function(){return po.Name}});Object.defineProperty(ve,"CodeGen",{enumerable:!0,get:function(){return po.CodeGen}});var aO=ra();Object.defineProperty(ve,"ValidationError",{enumerable:!0,get:function(){return aO.default}});var cO=hs();Object.defineProperty(ve,"MissingRefError",{enumerable:!0,get:function(){return cO.default}})});var cv=z(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.formatNames=Wt.fastFormats=Wt.fullFormats=void 0;function Jt(t,e){return{validate:t,compare:e}}Wt.fullFormats={date:Jt(ov,ep),time:Jt(Yf(!0),tp),"date-time":Jt(tv(!0),iv),"iso-time":Jt(Yf(),sv),"iso-date-time":Jt(tv(),av),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:mO,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{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,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:bO,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:hO,int32:{type:"number",validate:_O},int64:{type:"number",validate:vO},float:{type:"number",validate:nv},double:{type:"number",validate:nv},password:!0,binary:!0};Wt.fastFormats={...Wt.fullFormats,date:Jt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,ep),time:Jt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,tp),"date-time":Jt(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,iv),"iso-time":Jt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,sv),"iso-date-time":Jt(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,av),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Wt.formatNames=Object.keys(Wt.fullFormats);function uO(t){return t%4===0&&(t%100!==0||t%400===0)}var lO=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,dO=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ov(t){let e=lO.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&uO(r)?29:dO[n])}function ep(t,e){if(t&&e)return t>e?1:t<e?-1:0}var Xf=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Yf(t){return function(r){let n=Xf.exec(r);if(!n)return!1;let o=+n[1],s=+n[2],i=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||t&&!a)return!1;if(o<=23&&s<=59&&i<60)return!0;let d=s-l*c,m=o-u*c-(d<0?1:0);return(m===23||m===-1)&&(d===59||d===-1)&&i<61}}function tp(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function sv(t,e){if(!(t&&e))return;let r=Xf.exec(t),n=Xf.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var Qf=/t|\s/i;function tv(t){let e=Yf(t);return function(n){let o=n.split(Qf);return o.length===2&&ov(o[0])&&e(o[1])}}function iv(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function av(t,e){if(!(t&&e))return;let[r,n]=t.split(Qf),[o,s]=e.split(Qf),i=ep(r,o);if(i!==void 0)return i||tp(n,s)}var fO=/\/|:/,pO=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function mO(t){return fO.test(t)&&pO.test(t)}var rv=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function hO(t){return rv.lastIndex=0,rv.test(t)}var gO=-(2**31),yO=2**31-1;function _O(t){return Number.isInteger(t)&&t<=yO&&t>=gO}function vO(t){return Number.isInteger(t)}function nv(){return!0}var xO=/[^\\]\\Z/;function bO(t){if(xO.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var uv=z(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.formatLimitDefinition=void 0;var wO=Kf(),Ot=G(),Ir=Ot.operators,Ea={formatMaximum:{okStr:"<=",ok:Ir.LTE,fail:Ir.GT},formatMinimum:{okStr:">=",ok:Ir.GTE,fail:Ir.LT},formatExclusiveMaximum:{okStr:"<",ok:Ir.LT,fail:Ir.GTE},formatExclusiveMinimum:{okStr:">",ok:Ir.GT,fail:Ir.LTE}},$O={message:({keyword:t,schemaCode:e})=>(0,Ot.str)`should be ${Ea[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Ot._)`{comparison: ${Ea[t].okStr}, limit: ${e}}`};mo.formatLimitDefinition={keyword:Object.keys(Ea),type:"string",schemaType:"string",$data:!0,error:$O,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:s}=t,{opts:i,self:a}=s;if(!i.validateFormats)return;let c=new wO.KeywordCxt(s,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let m=e.scopeValue("formats",{ref:a.formats,code:i.code.formats}),p=e.const("fmt",(0,Ot._)`${m}[${c.schemaCode}]`);t.fail$data((0,Ot.or)((0,Ot._)`typeof ${p} != "object"`,(0,Ot._)`${p} instanceof RegExp`,(0,Ot._)`typeof ${p}.compare != "function"`,d(p)))}function l(){let m=c.schema,p=a.formats[m];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${o}": format "${m}" does not define "compare" function`);let f=e.scopeValue("formats",{key:m,ref:p,code:i.code.formats?(0,Ot._)`${i.code.formats}${(0,Ot.getProperty)(m)}`:void 0});t.fail$data(d(f))}function d(m){return(0,Ot._)`${m}.compare(${r}, ${n}) ${Ea[o].fail} 0`}},dependencies:["format"]};var kO=t=>(t.addKeyword(mo.formatLimitDefinition),t);mo.default=kO});var pv=z((Ps,fv)=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});var ho=cv(),SO=uv(),rp=G(),lv=new rp.Name("fullFormats"),TO=new rp.Name("fastFormats"),np=(t,e={keywords:!0})=>{if(Array.isArray(e))return dv(t,e,ho.fullFormats,lv),t;let[r,n]=e.mode==="fast"?[ho.fastFormats,TO]:[ho.fullFormats,lv],o=e.formats||ho.formatNames;return dv(t,o,r,n),e.keywords&&(0,SO.default)(t),t};np.get=(t,e="full")=>{let n=(e==="fast"?ho.fastFormats:ho.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function dv(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,rp._)`require("ajv-formats/dist/formats").${n}`);for(let i of e)t.addFormat(i,r[i])}fv.exports=Ps=np;Object.defineProperty(Ps,"__esModule",{value:!0});Ps.default=np});var yx={};To(yx,{findEmbeddingModel:()=>gx,ollamaUrl:()=>Ep,semanticRerank:()=>lI});import{createHash as QA}from"node:crypto";import{existsSync as eI,mkdirSync as tI,readFileSync as rI,writeFileSync as nI}from"node:fs";import{homedir as oI}from"node:os";import{join as Tp}from"node:path";function Ep(t=process.env.OLLAMA_HOST){let e=(t??"").trim(),r="http",n="11434",o=e.indexOf("://");o>=0&&(r=e.slice(0,o),e=e.slice(o+3),r==="http"?n="80":r==="https"&&(n="443"));let s=e.indexOf("/"),i=s>=0?e.slice(s).replace(/\/+$/,""):"",a=s>=0?e.slice(0,s):e,c=/^(\[[^\]]*\]|[^:]*):([^:]*)$/.exec(a);return c?(a=c[1],/^\d+$/.test(c[2])&&Number(c[2])<=65535&&(n=c[2])):a.includes(":")&&!a.startsWith("[")&&(a=`[${a}]`),!a||a==="0.0.0.0"?a="127.0.0.1":a==="[::]"&&(a="[::1]"),`${r}://${a}:${n}${i}`}async function hx(t,e,r=6e4){let n=await fetch(Ep()+t,{method:e?"POST":"GET",headers:e?{"content-type":"application/json"}:void 0,body:e?JSON.stringify(e):void 0,signal:AbortSignal.timeout(r)});if(!n.ok)throw new Error(`${t}: HTTP ${n.status}`);return n.json()}async function gx(t){let r=((await hx("/api/tags",void 0,2e3)).models??[]).map(n=>String(n.name));return t?r.find(n=>n===t||n.startsWith(t+":"))??t:r.find(n=>sI.test(n))}function Ba(){return Tp(process.env.XDG_CACHE_HOME??Tp(oI(),".cache"),"context-doctor","embeddings.json")}function iI(){try{return eI(Ba())?JSON.parse(rI(Ba(),"utf8")):{}}catch{return{}}}function aI(t){try{let e=Object.keys(t);if(e.length>mx)for(let r of e.slice(0,e.length-mx))delete t[r];tI(Tp(Ba(),".."),{recursive:!0}),nI(Ba(),JSON.stringify(t))}catch{}}async function cI(t,e){let r=[];for(let n=0;n<e.length;n+=px){let o=await hx("/api/embed",{model:t,input:e.slice(n,n+px),truncate:!0});r.push(...o.embeddings)}return r}function uI(t,e){let r=0,n=0,o=0;for(let s=0;s<t.length;s++)r+=t[s]*e[s],n+=t[s]*t[s],o+=e[s]*e[s];return n&&o?r/Math.sqrt(n*o):0}async function lI(t,e,r={}){let n;try{n=await gx(r.model)}catch{return{used:!1,note:`semantic ranking off: no Ollama at ${Ep()} (keyword ranking only)`}}if(!n)return{used:!1,note:"semantic ranking off: Ollama has no embedding model; run `ollama pull nomic-embed-text` (keyword ranking only)"};let o=iI(),s=f=>QA("sha1").update(n+"\0"+f).digest("hex"),i=t.map(f=>(f.heading?f.heading+`
|
|
38
|
-
`:"")+f.text),a=[...new Set(i.filter(f=>!o[s(f)]))],c,u;try{let f=await cI(n,[e,...a]);u=f[0],a.forEach((h,g)=>o[s(h)]=f[g+1]),c=i.map(h=>o[s(h)])}catch(f){return{used:!1,model:n,note:`semantic ranking off: ${n} failed (${f.message}); keyword ranking only`}}a.length&&aI(o);let l=60,d=new Map([...t].filter(f=>f.score>0).sort((f,h)=>h.score-f.score).map((f,h)=>[f,h])),m=t.map((f,h)=>({c:f,s:uI(u,c[h])})).sort((f,h)=>h.s-f.s),p=new Map(m.map((f,h)=>[f.c,h]));for(let f of t){let h=d.get(f);f.score=(h===void 0?0:1/(l+h))+1/(l+p.get(f))}return{used:!0,model:n,note:`semantic ranking: ${n}, ${a.length} of ${i.length} chunks embedded (rest cached)`}}var sI,px,mx,_x=Q(()=>{"use strict";sI=/embed|bge|e5-|gte|minilm|nomic|mxbai|arctic|snowflake/i,px=64,mx=5e4});var mb,hb=Q(()=>{mb="x-hono-already-sent"});var gb,yb=Q(()=>{gb=t=>((...e)=>{if(typeof e[0]=="function"){let[r,n]=e;return async function(s,i){let a=await t(s,await r(s),n);if(a)return a;await i()}}else{let[r,n,o]=e;return(async()=>{let s=await t(r,n,o);if(!s)throw new Error("Failed to upgrade WebSocket");return s})()}})});import{STATUS_CODES as aF,ServerResponse as HN,createServer as cF}from"node:http";import{Http2ServerRequest as mr,constants as BN}from"node:http2";import{Readable as _b}from"node:stream";async function gM(t){return Promise.race([t,Promise.resolve().then(()=>Promise.resolve(void 0))])}function Ib(t,e,r){let n=a=>{t.cancel(a).catch(()=>{})};return e.on("close",n),e.on("error",n),(r??t.read()).then(i,o),t.closed.finally(()=>{e.off("close",n),e.off("error",n)});function o(a){a&&e.destroy(a)}function s(){t.read().then(i,o)}function i({done:a,value:c}){try{if(a)e.end();else if(!e.write(c))e.once("drain",s);else return t.read().then(i,o)}catch(u){o(u)}}}function Sb(t,e){if(t.locked)throw new TypeError("ReadableStream is locked.");return e.destroyed?void 0:Ib(t.getReader(),e)}var Mt,VN,JN,oc,vb,xb,em,Eb,tm,zb,WN,GN,KN,Jp,XN,YN,QN,ko,Rb,eM,tM,Bp,Wp,Pb,rm,bb,ic,wb,rM,qr,fr,So,Zs,Cb,Ob,Ms,Gp,Kp,Lr,sc,hr,$b,js,ac,Ds,nM,oM,sM,iM,aM,cM,uM,nm,lM,kb,dM,Yt,fM,Rn,Xp,$o,pr,cc,Xt,pM,mM,hM,Yp,uc,Tb,yM,_M,Nb,vM,xM,bM,Mb,lc,Qp,jb,Vp,Zb,Db,wM,om,$M,kM,SM,TM,EM,fF,Lb=Q(()=>{hb();yb();Mt=class extends Error{constructor(t,e){super(t,e),this.name="RequestError"}},VN=new Set(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","server","user-agent"]),JN=/^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/,oc=t=>t===9||t===10||t===13||t===32,vb=t=>{if(!oc(t.charCodeAt(0))&&!oc(t.charCodeAt(t.length-1)))return t;let e=0,r=t.length;for(;e<r&&oc(t.charCodeAt(e));)e++;for(;r>e&&oc(t.charCodeAt(r-1));)r--;return t.slice(e,r)},xb=/[\0\r\n]/,em=globalThis.Headers,Eb=(t,e=em)=>{let r=new e;for(let n=0;n<t.length;n+=2){let o=t[n];o.startsWith(":")||r.append(o,t[n+1])}return r},tm=class{#e;#t;#n;#o;constructor(t){this.#e=t,t instanceof mr&&(this.#t=t.rawHeaders.slice())}get#s(){return this.#t??=this.#e.rawHeaders.slice()}get#r(){return this.#n||(this.#n=Eb(this.#s),this.#t=void 0),this.#n}#i(t){if(typeof t=="string"){if(!JN.test(t))throw new TypeError(`Invalid header name: ${t}`);return t.toLowerCase()}}#a(t){let e=this.#e instanceof mr?void 0:this.#e.headers;if(!e||VN.has(t)||t==="set-cookie"||t==="__proto__")return;if(!Object.hasOwn(e,t))return null;let r=e[t];if(typeof r=="string"){let n=vb(r);return xb.test(n)?void 0:n}}#c(t,e){let r=e==="cookie"?"; ":", ",n=null;for(let o=0;o<t.length;o+=2){let s=t[o];if(s.length===e.length&&s.toLowerCase()===e){let i=vb(t[o+1]);if(xb.test(i)){this.#o=!0;return}n=n===null?i:n+r+i}}return n}append(t,e){this.#r.append(t,e)}delete(t){this.#r.delete(t)}get(t){let e=this.#i(t);if(e&&!this.#n&&!this.#o){let r=this.#a(e);if(r!==void 0)return r;let n=this.#c(this.#s,e);if(n!==void 0)return n}return this.#r.get(t)}has(t){let e=this.#i(t);if(e&&!this.#n&&!this.#o){let r=this.#a(e);if(r!==void 0)return r!==null;let n=this.#c(this.#s,e);if(n!==void 0)return n!==null}return this.#r.has(t)}set(t,e){this.#r.set(t,e)}getSetCookie(){return this.#r.getSetCookie()}keys(){return this.#r.keys()}values(){return this.#r.values()}entries(){return this.#r.entries()}forEach(t,e){this.#r.forEach((r,n)=>{t.call(e,r,n,this)})}[Symbol.iterator](){return this.entries()}};Object.defineProperty(tm.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:function(t,e,r){return`Headers (lightweight) ${r(Object.fromEntries(this),{...e,depth:t==null?null:t-1})}`}});Object.setPrototypeOf(tm.prototype,em.prototype);zb=t=>globalThis.Headers===em?new tm(t):Eb(t.rawHeaders,globalThis.Headers),WN=/^\/[!#$&-;=?-\[\]_a-z~]*$/,GN=/\/\.\.?(?:[/?#]|$)/,KN=/^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/,Jp=t=>{let e=t.indexOf("\\");if(e!==-1){let r=t.indexOf("?");if(r===-1||e<r)throw new Mt("Backslash in request path")}},XN=(t,e,r)=>{let n=`${t}://${e}${r}`;if(KN.test(e)){if(r.length===0)return n+"/";if(r.charCodeAt(0)!==47)throw new Mt("Invalid URL");return!WN.test(r)||GN.test(r)?(Jp(r),new URL(n).href):n}else{Jp(r);let o=new URL(n);if(o.hostname.length!==e.length&&o.hostname!==(e.includes(":")?e.replace(/:\d+$/,""):e).toLowerCase())throw new Mt("Invalid host header");return o.href}},YN=t=>t instanceof Mt?t:new Mt(t.message,{cause:t}),QN=global.Request,ko=class extends QN{constructor(t,e){if(typeof t=="object"&&qr in t){let r=e!==void 0&&"body"in e&&e.body!=null;if(t[hr]&&!r)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");t=t[qr]()}typeof e?.body?.getReader<"u"&&(e.duplex??="half"),super(t,e)}},Rb=Symbol("wrapBodyStream"),eM=new Set(["latin1","binary","hex","base64","base64url"]),tM=t=>t===null||eM.has(t),Bp=Symbol("bodyBufferedBeforeDisconnect"),Wp=Symbol("bodyBufferedLengthBeforeDisconnect"),Pb=(t,e)=>Buffer.isBuffer(t)?t:Buffer.from(t,e??"utf8"),rm=t=>!(t instanceof mr)&&!!t.complete&&!!t.readableAborted&&typeof t.read=="function"&&tM(t.readableEncoding),bb=t=>{if(t.readableDidRead||!rm(t))return;let e=t;e[Wp]??=t.readableLength},ic=(t,e)=>{if(t.readableDidRead&&!e||!rm(t))return;let r=t;if(r[Bp]!==void 0)return r[Bp];let n,o=t.errored;if(o&&o.code!=="ECONNRESET")n=o;else if(r[Wp]!==void 0&&t.readableLength!==r[Wp])n=ac();else{let s=e??[],i=t.read();i!==null&&s.push(Pb(i,t.readableEncoding));let a=s.length===1?s[0]:Buffer.concat(s);n=a;let c=t.headers["content-length"];if(typeof c=="string"&&/^\d+$/.test(c)){let u=Number(c);Number.isSafeInteger(u)&&a.length!==u&&(n=ac())}}return r[Bp]=n,n},wb=(t,e)=>{if(e instanceof Error){t.error(e);return}e.length>0&&t.enqueue(e),t.close()},rM=(t,e,r,n,o)=>{let s={method:t,headers:r,signal:o.signal};if(t==="TRACE"){s.method="GET";let i=new ko(e,s);return Object.defineProperty(i,"method",{get(){return"TRACE"}}),i}if(!(t==="GET"||t==="HEAD"))if("rawBody"in n&&n.rawBody instanceof Buffer)s.body=new ReadableStream({start(i){i.enqueue(n.rawBody),i.close()}});else if(n[Rb]){let i;s.body=new ReadableStream({async pull(a){try{if(!i){let l=ic(n);if(l!==void 0){wb(a,l);return}}i||=_b.toWeb(n).getReader();let{done:c,value:u}=await i.read();c?a.close():a.enqueue(u)}catch(c){a.error(c)}}})}else{let i=ic(n);i!==void 0?s.body=new ReadableStream({start(a){wb(a,i)}}):s.body=_b.toWeb(n)}return new ko(e,s)},qr=Symbol("getRequestCache"),fr=Symbol("requestCache"),So=Symbol("incomingKey"),Zs=Symbol("urlKey"),Cb=Symbol("methodKey"),Ob=Symbol("headersKey"),Ms=Symbol("abortControllerKey"),Gp=Symbol("getAbortController"),Kp=Symbol("abortRequest"),Lr=Symbol("bodyBuffer"),sc=Symbol("bodyReadPromise"),hr=Symbol("bodyConsumedDirectly"),$b=Symbol("bodyLockReader"),js=Symbol("abortReason"),ac=()=>new TypeError("Body is unusable"),Ds=()=>Promise.reject(ac()),nM=new TextDecoder,oM=t=>{if(t[hr])return Ds();t[hr]=!0},sM=t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),iM=t=>(t[Ob]||=zb(t[So])).get("content-type")||"",aM=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,cM=t=>{if(typeof t!="string"||t.length===0)return"GET";switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"PATCH":case"POST":case"PUT":case"QUERY":return t}let e=t.toUpperCase();switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"POST":case"PUT":return e;default:return t}},uM=t=>{if(!aM.test(t))return new TypeError(`'${t}' is not a valid HTTP method.`);let e=t.toUpperCase();if(e==="CONNECT"||e==="TRACK"||e==="TRACE"&&t!=="TRACE")return new TypeError(`'${t}' HTTP method is unsupported.`)},nm=(t,e,r)=>{if(t[hr])return Ds();let n=t.method;if(n==="GET"||n==="HEAD")return t[qr]()[e]();let o=uM(n);if(o)return Promise.reject(o);if(t[fr]&&n!=="TRACE")return t[fr][e]();let s=oM(t);if(s)return s;let i=lM(t);if(i){let a=Promise.resolve(r(i,t));return t[Lr]=void 0,a}return dM(t).then(a=>{let c=r(a,t);return t[Lr]=void 0,c})},lM=t=>{let e=t[So];if("rawBody"in e&&e.rawBody instanceof Buffer)return e.rawBody},kb=(t,e)=>{if(e.errored)return e.errored;let r=t[js];return r!==void 0?r instanceof Error?r:new Error(String(r)):new Error("Client connection prematurely closed.")},dM=t=>{if(t[Lr])return Promise.resolve(t[Lr]);if(t[sc])return t[sc];let e=t[So];if(e.readableDidRead)return Ds();let r=ic(e);if(r!==void 0)return r instanceof Error?Promise.reject(r):(t[Lr]=r,Promise.resolve(r));let n=new Promise((o,s)=>{let i=[],a=!1,c=h=>{a||(a=!0,f(),h())},u=h=>{let g=e.errored??h;return!rm(e)||g&&g.code!=="ECONNRESET"?!1:(c(()=>{let _=ic(e,i);_ instanceof Error?s(_):_===void 0?s(h??kb(t,e)):(t[Lr]=_,o(_))}),!0)},l=h=>{i.push(Pb(h,e.readableEncoding))},d=()=>{c(()=>{let h=i.length===1?i[0]:Buffer.concat(i);t[Lr]=h,o(h)})},m=h=>{u(h)||c(()=>{s(h)})},p=()=>{if(e.readableEnded){d();return}u()||c(()=>{s(kb(t,e))})},f=()=>{e.off("data",l),e.off("end",d),e.off("error",m),e.off("close",p),t[sc]=void 0};e.on("data",l),e.on("end",d),e.on("error",m),e.on("close",p),queueMicrotask(()=>{a||(e.readableEnded?d():e.errored?m(e.errored):e.destroyed&&p())})});return t[sc]=n,n},Yt={get method(){return this[Cb]},get url(){return this[Zs]},get headers(){return this[Ob]||=zb(this[So])},[Kp](t){this[js]===void 0&&(this[js]=t);let e=this[Ms];e&&!e.signal.aborted&&e.abort(t)},[Gp](){return this[Ms]||=new AbortController,this[js]!==void 0&&!this[Ms].signal.aborted&&this[Ms].abort(this[js]),this[Ms]},[qr](){let t=this[Gp]();if(this[fr])return this[fr];let e=this.method;if(this[hr]&&!(e==="GET"||e==="HEAD")){this[Lr]=void 0;let r={method:e==="TRACE"?"GET":e,headers:this.headers,signal:t.signal};e!=="TRACE"&&(r.body=new ReadableStream({start(o){o.close()}}),r.duplex="half");let n=new ko(this[Zs],r);return e==="TRACE"&&Object.defineProperty(n,"method",{get(){return"TRACE"}}),this[fr]=n}return this[fr]=rM(this.method,this[Zs],this.headers,this[So],t)},get body(){if(!this[hr])return this[qr]().body;let t=this[qr]();return!this[$b]&&t.body&&(this[$b]=t.body.getReader()),t.body},get bodyUsed(){return this[hr]?!0:this[fr]?this[fr].bodyUsed:!1}};Object.defineProperty(Yt,"signal",{get(){return this[Gp]().signal}});["cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","keepalive"].forEach(t=>{Object.defineProperty(Yt,t,{get(){return this[qr]()[t]}})});["clone","formData"].forEach(t=>{Object.defineProperty(Yt,t,{value:function(){if(this[hr]){if(t==="clone")throw ac();return Ds()}return this[qr]()[t]()}})});Object.defineProperty(Yt,"text",{value:function(){return nm(this,"text",t=>nM.decode(t))}});Object.defineProperty(Yt,"arrayBuffer",{value:function(){return nm(this,"arrayBuffer",t=>sM(t))}});Object.defineProperty(Yt,"blob",{value:function(){return nm(this,"blob",(t,e)=>{let r=iM(e),n=r?{headers:{"content-type":r}}:void 0;return new Response(t,n).blob()})}});Object.defineProperty(Yt,"json",{value:function(){return this[hr]?Ds():this.text().then(JSON.parse)}});Object.defineProperty(Yt,Symbol.for("nodejs.util.inspect.custom"),{value:function(t,e,r){return`Request (lightweight) ${r({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[fr]},{...e,depth:t==null?null:t-1})}`}});Object.setPrototypeOf(Yt,ko.prototype);fM=(t,e)=>{let r=Object.create(Yt);r[So]=t,r[Cb]=cM(t.method);let n=t.url||"";if(n[0]!=="/"&&(n.startsWith("http://")||n.startsWith("https://"))){if(t instanceof mr)throw new Mt("Absolute URL for :path is not allowed in HTTP/2");try{Jp(n),r[Zs]=new URL(n).href}catch(i){throw new Mt("Invalid absolute URL",{cause:i})}return r}let o=(t instanceof mr?t.authority:t.headers.host)||e;if(!o)throw new Mt("Missing host header");let s;if(t instanceof mr){if(s=t.scheme,!(s==="http"||s==="https"))throw new Mt("Unsupported scheme")}else s=t.socket&&t.socket.encrypted?"https":"http";try{r[Zs]=XN(s,o,n)}catch(i){throw i instanceof Mt?i:new Mt("Invalid URL",{cause:i})}return r},Rn="text/plain; charset=UTF-8",Xp=Symbol("responseCache"),$o=Symbol("getResponseCache"),pr=Symbol("cache"),cc=global.Response,Xt=class Ab{#e;#t;[$o](){let e=this[pr],r=e&&e[2]instanceof Headers?e[2]:void 0;return delete this[pr],this[Xp]||=new cc(this.#e,r?{status:this.#t?.status,statusText:this.#t?.statusText,headers:r}:this.#t)}constructor(e,r){let n;if(this.#e=e,r instanceof cc){let o=r[Xp];if(o){this.#t=o,this[$o]();return}this.#t=r instanceof Ab?r.#t:r,n=new Headers(r.headers)}else this.#t=r;(e==null||typeof e=="string"||typeof e?.getReader<"u"||e instanceof Blob||e instanceof Uint8Array)&&(this[pr]=[r?.status||200,e??null,n||r?.headers])}get headers(){let e=this[pr];return e?(e[2]instanceof Headers||(e[2]=new Headers(e[2]||(e[1]===null?void 0:{"content-type":Rn}))),e[2]):this[$o]().headers}get status(){return this[pr]?.[0]??this[$o]().status}get ok(){let e=this.status;return e>=200&&e<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(t=>{Object.defineProperty(Xt.prototype,t,{get(){return this[$o]()[t]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(t=>{Object.defineProperty(Xt.prototype,t,{value:function(){return this[$o]()[t]()}})});Object.defineProperty(Xt.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:function(t,e,r){return`Response (lightweight) ${r({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[Xp]},{...e,depth:t==null?null:t-1})}`}});Object.setPrototypeOf(Xt,cc);Object.setPrototypeOf(Xt.prototype,cc.prototype);pM=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,mM=t=>t instanceof URL?t.href:pM.test(t)?t:new URL(t).href,hM=new Set([301,302,303,307,308]);Object.defineProperty(Xt,"redirect",{value:function(e,r=302){if(!hM.has(r))throw new RangeError("Invalid status code");return new Xt(null,{status:r,headers:{location:mM(e)}})},writable:!0,configurable:!0});Object.defineProperty(Xt,"json",{value:function(e,r){let n=JSON.stringify(e);if(n===void 0)throw new TypeError("The data is not JSON serializable");let o=r?.headers,s;return o?(s=new Headers(o),s.has("content-type")||s.set("content-type","application/json")):s={"content-type":"application/json"},new Xt(n,{status:r?.status??200,statusText:r?.statusText,headers:s})},writable:!0,configurable:!0});Yp=(t,e)=>{let r={};if(t instanceof Headers||(t=new Headers(t??void 0)),t.has("set-cookie")){let n=[];for(let[o,s]of t)o==="set-cookie"?n.push(s):r[o]=s;n.length>0&&(r["set-cookie"]=n)}else for(let[n,o]of t)r[n]=o;return e&&(r["content-type"]??=e),r},uc=Symbol("outgoingEnded"),Tb=Symbol("incomingDraining"),yM=500,_M=64*1024*1024,Nb=t=>{let e=t;if(t.destroyed||e[Tb])return;if(e[Tb]=!0,t instanceof mr){try{t.stream?.close?.(BN.NGHTTP2_NO_ERROR)}catch{}return}let r=0,n=()=>{clearTimeout(s),t.off("data",i),t.off("end",n),t.off("error",n)},o=()=>{n();let a=t.socket;a&&!a.destroyed&&(typeof a.destroySoon=="function"?a.destroySoon():typeof a.destroy=="function"&&a.destroy())},s=setTimeout(o,yM);s.unref?.();let i=a=>{r+=a.length,r>_M&&o()};t.on("data",i),t.on("end",n),t.on("error",n),t.resume()},vM=(t,e,r,n)=>()=>{e.errored?(bb(e),t[Kp](e.errored.toString())):(!r.writableFinished||e instanceof mr&&e.aborted)&&(bb(e),t[Kp]("Client connection prematurely closed.")),n&&!e.readableEnded&&setTimeout(()=>{e.readableEnded||setTimeout(()=>{Nb(e)})})},xM=t=>{if(!(pr in t))return!1;let e=t[pr][1];return e===null||typeof e=="string"||e instanceof Uint8Array},bM=()=>new Response(null,{status:400}),Mb=t=>new Response(null,{status:t instanceof Error&&(t.name==="TimeoutError"||t.constructor.name==="TimeoutError")?504:500}),lc=(t,e)=>{let r=t instanceof Error?t:new Error("unknown error",{cause:t});r.code==="ERR_STREAM_PREMATURE_CLOSE"?console.info("The user aborted a request."):(console.error(t),e.headersSent||(e instanceof HN&&(e._contentLength=null),e.writeHead(500,{"Content-Type":"text/plain"})),e.end(`Error: ${r.message}`),e.destroy(r))},Qp=t=>{"flushHeaders"in t&&t.writable&&t.flushHeaders()},jb=(t,e,r)=>{let n=t;return n._contentLength===null&&n._hasBody&&n.useChunkedEncodingByDefault&&!n._removedContLen&&e>=200&&e!==204&&e!==304&&!t.hasHeader("content-length")&&!t.hasHeader("transfer-encoding")&&!t.hasHeader("trailer")?(n._contentLength=r,!0):!1},Vp=(t,e,r)=>{jb(t,e,r)?t.writeHead(e,{"Content-Type":Rn}):t.writeHead(e,{"Content-Type":Rn,"Content-Length":r})},Zb=async(t,e)=>{let[r,n,o]=t[pr];if(!o){n===null?(e.writeHead(r),e.end()):typeof n=="string"?(Vp(e,r,Buffer.byteLength(n)),e.end(n)):n instanceof Uint8Array?(Vp(e,r,n.byteLength),e.end(n)):n instanceof Blob?(Vp(e,r,n.size),e.end(new Uint8Array(await n.arrayBuffer()))):(e.writeHead(r,{"Content-Type":Rn}),Qp(e),await Sb(n,e)?.catch(c=>lc(c,e))),e[uc]?.();return}let s=!1,i=!1,a=!0;if(o instanceof Headers)s=o.has("content-length"),o=Yp(o,n===null?void 0:Rn);else if(Array.isArray(o)){let c=new Headers(o);s=c.has("content-length"),o=Yp(c,n===null?void 0:Rn)}else{i=!0;for(let c in o){if(c.length===14&&c.toLowerCase()==="content-length"){s=!0;break}(c.length===17&&c.toLowerCase()==="transfer-encoding"||c.length===7&&c.toLowerCase()==="trailer")&&(a=!1)}}if(!s){let c;typeof n=="string"?c=Buffer.byteLength(n):n instanceof Uint8Array?c=n.byteLength:n instanceof Blob&&(c=n.size),c!==void 0&&(!i||!a||!jb(e,r,c))&&(i&&(o={...o}),o["Content-Length"]=c)}e.writeHead(r,o),n==null?e.end():typeof n=="string"||n instanceof Uint8Array?e.end(n):n instanceof Blob?e.end(new Uint8Array(await n.arrayBuffer())):(Qp(e),await Sb(n,e)?.catch(c=>lc(c,e))),e[uc]?.()},Db=t=>typeof t.then=="function",wM=async(t,e,r={})=>{if(Db(t))if(r.errorHandler)try{t=await t}catch(o){let s=await r.errorHandler(o);if(!s)return;t=s}else t=await t.catch(Mb);if(pr in t)return Zb(t,e);let n=Yp(t.headers,t.body===null?void 0:Rn);if(t.body){let o=t.body.getReader(),s=[],i=!1,a;if(n["transfer-encoding"]!=="chunked"){let c=2;for(let u=0;u<c;u++){a||=o.read();let l=await gM(a).catch(d=>{console.error(d),i=!0});if(!l){if(u===1){await new Promise(d=>setTimeout(d)),c=3;continue}break}if(a=void 0,l.value&&s.push(l.value),l.done){i=!0;break}}i&&!("content-length"in n)&&(n["content-length"]=s.reduce((u,l)=>u+l.length,0))}e.writeHead(t.status,n),s.forEach(c=>{e.write(c)}),i?e.end():(s.length===0&&Qp(e),await Ib(o,e,a))}else n[mb]||(e.writeHead(t.status,n),e.end());e[uc]?.()},om=(t,e={})=>{let r=e.autoCleanupIncoming??!0;return e.overrideGlobalObjects!==!1&&global.Request!==ko&&(Object.defineProperty(global,"Request",{value:ko}),Object.defineProperty(global,"Response",{value:Xt})),async(n,o)=>{let s,i,a=!1,c=!1,u=()=>{!i||c||(c=!0,o.on("close",vM(i,n,o,a)))};try{if(i=fM(n,e.hostname),a=r&&!(n.method==="GET"||n.method==="HEAD"),a&&(n[Rb]=!0,n instanceof mr&&(o[uc]=()=>{n.readableEnded||setTimeout(()=>{n.readableEnded||setTimeout(()=>{n.destroy(),o.destroy()})})})),s=t(i,{incoming:n,outgoing:o}),!Db(s)&&xM(s))return a&&!n.readableEnded&&o.once("finish",()=>{n.readableEnded||Nb(n)}),Zb(s,o);u()}catch(l){if(s)return lc(l,o);if(e.errorHandler){if(u(),s=await e.errorHandler(i?l:YN(l)),!s)return}else i?s=Mb(l):s=bM()}try{return await wM(s,o,e)}catch(l){return lc(l,o)}}},$M=globalThis.CloseEvent??class extends Event{#e;constructor(t,e={}){super(t,e),this.#e=e}get wasClean(){return this.#e.wasClean??!1}get code(){return this.#e.code??0}get reason(){return this.#e.reason??""}},kM=globalThis.ErrorEvent??class extends Event{#e;constructor(t,e={}){super(t,e),this.#e=e}get message(){return this.#e.message??""}get filename(){return this.#e.filename??""}get lineno(){return this.#e.lineno??0}get colno(){return this.#e.colno??0}get error(){return this.#e.error??null}},SM=()=>Symbol("connection"),TM=Symbol("CONNECTION_SYMBOL_KEY"),EM=Symbol("WAIT_FOR_WEBSOCKET_SYMBOL"),fF=gb(async(t,e,r)=>{if(t.req.header("upgrade")?.toLowerCase()!=="websocket")return;let n=t.env,o=n[EM];if(!o||!n.incoming)return new Response(null,{status:500});let s=SM();return n[TM]=s,(async()=>{let i;try{i=await o(n.incoming,s)}catch{return}let a=[],c=(d,m)=>{a.push([d,m])};i.on("message",c);let u={binaryType:"arraybuffer",close(d,m){i.close(d,m)},protocol:i.protocol,raw:i,get readyState(){return i.readyState},send(d,m){i.send(d,{compress:m?.compress})},url:new URL(t.req.url)};try{e?.onOpen?.(new Event("open"),u)}catch(d){(r?.onError??console.error)(d)}let l=(d,m)=>{let p=Array.isArray(d)?d:[d];for(let f of p)try{e?.onMessage?.(new MessageEvent("message",{data:m?f instanceof ArrayBuffer?f:f.buffer.slice(f.byteOffset,f.byteOffset+f.byteLength):typeof f=="string"?f:Buffer.from(f).toString("utf-8")}),u)}catch(h){(r?.onError??console.error)(h)}};i.off("message",c);for(let d of a)l(...d);i.on("message",(d,m)=>{l(d,m)}),i.on("close",(d,m)=>{try{e?.onClose?.(new $M("close",{code:d,reason:m.toString()}),u)}catch(p){(r?.onError??console.error)(p)}}),i.on("error",d=>{try{e?.onError?.(new kM("error",{error:d}),u)}catch(m){(r?.onError??console.error)(m)}})})(),new Response})});var Hb=z(sm=>{"use strict";var qb=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,zM=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,Ub=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,RM=/\\([\u000b\u0020-\u00ff])/g,PM=/([\\"])/g,Fb=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;sm.format=CM;sm.parse=OM;function CM(t){if(!t||typeof t!="object")throw new TypeError("argument obj is required");var e=t.parameters,r=t.type;if(!r||!Fb.test(r))throw new TypeError("invalid type");var n=r;if(e&&typeof e=="object")for(var o,s=Object.keys(e).sort(),i=0;i<s.length;i++){if(o=s[i],!Ub.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+IM(e[o])}return n}function OM(t){if(!t)throw new TypeError("argument string is required");var e=typeof t=="object"?AM(t):t;if(typeof e!="string")throw new TypeError("argument string is required to be a string");var r=e.indexOf(";"),n=r!==-1?e.slice(0,r).trim():e.trim();if(!Fb.test(n))throw new TypeError("invalid media type");var o=new NM(n.toLowerCase());if(r!==-1){var s,i,a;for(qb.lastIndex=r;i=qb.exec(e);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=i[0].length,s=i[1].toLowerCase(),a=i[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(RM,"$1"))),o.parameters[s]=a}if(r!==e.length)throw new TypeError("invalid parameter format")}return o}function AM(t){var e;if(typeof t.getHeader=="function"?e=t.getHeader("content-type"):typeof t.headers=="object"&&(e=t.headers&&t.headers["content-type"]),typeof e!="string")throw new TypeError("content-type header is missing from object");return e}function IM(t){var e=String(t);if(Ub.test(e))return e;if(e.length>0&&!zM.test(e))throw new TypeError("invalid parameter value");return'"'+e.replace(PM,"\\$1")+'"'}function NM(t){this.parameters=Object.create(null),this.type=t}});function MM(t){if(t)try{return Bb.default.parse(t).type}catch{let e=(t.split(";",1)[0]??"").trim().toLowerCase();return e===""||t.slice(e.length).includes(",")?void 0:e}}function Vb(t){return t==="application/json"?!0:MM(t)==="application/json"}var Bb,Jb=Q(()=>{Bb=mc(Hb(),1)});function Wb(t){return`Payload Too Large: Request body must not exceed ${t} bytes`}function Gb(t){if(t===void 0)return 4194304;if(typeof t!="number"||!Number.isFinite(t)||t<=0)throw new RangeError(`maxRequestBodySize must be a positive number of bytes, got ${String(t)}`);return t}async function Kb(t,e=4194304){if(Number(t.headers.get("content-length"))>e)return{tooLarge:!0};if(t.body===null)return{tooLarge:!1,text:""};let r=t.body.getReader(),n=new TextDecoder,o=0,s="";try{for(;;){let{done:i,value:a}=await r.read();if(i)break;if(o+=a.byteLength,o>e)return{tooLarge:!0};s+=n.decode(a,{stream:!0})}}finally{r.releaseLock()}return{tooLarge:!1,text:s+n.decode()}}var Xb=Q(()=>{});function Yb(t,e){if(!Number.isFinite(t)||t<1)return;let r=setInterval(e,Math.min(t,2147483647));return r.unref?.(),r}var Qb=Q(()=>{});var dc,ew=Q(()=>{Jb();Xb();Qb();Sr();dc=class{constructor(e={}){this._started=!1,this._hasHandledRequest=!1,this._streamMapping=new Map,this._requestToStreamMapping=new Map,this._resumableStreams=new Set,this._requestResponseMap=new Map,this._initialized=!1,this._enableJsonResponse=!1,this._standaloneSseStreamId="_GET_stream",this._closed=!1,this.sessionIdGenerator=e.sessionIdGenerator,this._enableJsonResponse=e.enableJsonResponse??!1,this._eventStore=e.eventStore,this._onsessioninitialized=e.onsessioninitialized,this._onsessionclosed=e.onsessionclosed,this._allowedHosts=e.allowedHosts,this._allowedOrigins=e.allowedOrigins,this._enableDnsRebindingProtection=e.enableDnsRebindingProtection??!1,this._retryInterval=e.retryInterval,this._keepAliveMs=e.keepAliveMs??15e3,this._maxRequestBodySize=Gb(e.maxRequestBodySize)}startKeepAlive(e,r){if(this._closed)return;let n=Yb(this._keepAliveMs,()=>{try{e.enqueue(r.encode(`: keepalive
|
|
39
|
-
|
|
40
|
-
`))}catch{n!==void 0&&clearInterval(n)}});return n}async start(){if(this._started)throw new Error("Transport already started");this._started=!0}createJsonErrorResponse(e,r,n,o){let s={code:r,message:n};return o?.data!==void 0&&(s.data=o.data),new Response(JSON.stringify({jsonrpc:"2.0",error:s,id:null}),{status:e,headers:{"Content-Type":"application/json",...o?.headers}})}validateRequestHeaders(e){if(this._enableDnsRebindingProtection){if(this._allowedHosts&&this._allowedHosts.length>0){let r=e.headers.get("host");if(!r||!this._allowedHosts.includes(r)){let n=`Invalid Host header: ${r}`;return this.onerror?.(new Error(n)),this.createJsonErrorResponse(403,-32e3,n)}}if(this._allowedOrigins&&this._allowedOrigins.length>0){let r=e.headers.get("origin");if(r&&!this._allowedOrigins.includes(r)){let n=`Invalid Origin header: ${r}`;return this.onerror?.(new Error(n)),this.createJsonErrorResponse(403,-32e3,n)}}}}async handleRequest(e,r){if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");if(!this.sessionIdGenerator&&this._hasHandledRequest)throw new Error("Stateless transport cannot be reused across requests. Create a new transport per request.");this._hasHandledRequest=!0;let n=this.validateRequestHeaders(e);if(n)return n;switch(e.method){case"POST":return this.handlePostRequest(e,r);case"GET":return this.handleGetRequest(e);case"DELETE":return this.handleDeleteRequest(e);default:return this.handleUnsupportedRequest()}}async writePrimingEvent(e,r,n,o){if(!this._eventStore||o<"2025-11-25")return;let s=await this._eventStore.storeEvent(n,{}),i=`id: ${s}
|
|
57
|
+
|
|
58
|
+
`)}return v.write("payload.value = newResult;"),v.write("return payload;"),v.compile()},a,s=Zr,c=!it.jitless,u=c&&dp.value,d=t.catchall,m;e._zod.parse=(f,h)=>{m??(m=o.value);let y=f.value;return s(y)?c&&u&&h?.async===!1&&h.jitless!==!0?(a||(a=i(t.shape)),f=a(f,h),d?NS([],y,f,h,m,e,h?.abortEarly===!0):f):r(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),f)}});Ha=A("$ZodUnion",(e,t)=>{ze.init(e,t),Oe(e,"optin",o=>o.def.options.some(n=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some(n=>n._zod.optin!==void 0)?"optional":void 0),Oe(e,"optout",o=>o.def.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Oe(e,"values",o=>{if(o.def.options.every(n=>n._zod.values))return new Set(o.def.options.flatMap(n=>Array.from(n._zod.values)))}),Oe(e,"pattern",o=>{if(o.def.options.every(n=>n._zod.pattern)){let n=o.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>Pn(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)a.push(c),i=!0;else{if(c.issues.length===0)return c;a.push(c)}}return i?Promise.all(a).then(s=>vS(s,o,e,n)):vS(a,o,e,n)}});_g=A("$ZodXor",(e,t)=>{Ha.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},n);c instanceof Promise?(a.push(c),i=!0):a.push(c)}return i?Promise.all(a).then(s=>yS(s,o,e,n)):yS(a,o,e,n)}});bg=A("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ha.init(e,t);let r=e._zod.parse;Oe(e,"propValues",n=>{let i={},a=0;for(let s of n.def.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${n.def.options.indexOf(s)}"`);c[n.def.discriminator]?.has(void 0)&&a++;for(let[l,u]of Object.entries(c)){Object.prototype.hasOwnProperty.call(i,l)||lt(i,l,new Set);for(let d of u)i[l].add(d)}}return!n.def.unionFallback&&a>1&&i[n.def.discriminator]?.delete(void 0),i}),t.options.forEach((n,i)=>{let a=Oo(n._zod.def);if(a&&!Object.prototype.hasOwnProperty.call(a,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let o=Co(()=>AS(t));e._zod.parse=(n,i)=>{let a=n.value;if(!Zr(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=a?.[t.discriminator],c=o.value.get(s);return c&&(s!==void 0||i.direction!=="backward")?c._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()).filter(l=>o.value.get(l)!==null),input:a,path:[t.discriminator],inst:e}),n)}}),Sg=A("$ZodIntersection",(e,t)=>{ze.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([c,l])=>_S(r,c,l)):_S(r,i,a)}});kl=A("$ZodTuple",(e,t)=>{ze.init(e,t);let r=t.items,o=it.memoizer;o?.attach(e),e._zod.parse=(n,i)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=o?o.alloc(e,n,[],i):[];let s=[],c=$S(r,"optin"),l=$S(r,"optout");if(!t.rest){if(a.length<c)return n.issues.push({code:"too_small",minimum:c,inclusive:!0,input:a,inst:e,origin:"array"}),n;a.length>r.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:a,inst:e,origin:"array"})}let u=new Array(r.length),d=t.rest?i?.abortEarly:void 0,m=!1;for(let f=0;f<r.length;f++){let h=r[f]._zod.run({value:a[f],issues:[]},i);h instanceof Promise?s.push(h.then(y=>{u[f]=y})):(u[f]=h,d&&!m&&h.issues.length&&(m=_t(h)))}if(t.rest&&!m){let f=r.length-1,h=a.slice(r.length),y=n.issues.length;for(let v of h){if(d&&n.issues.length!==y){if(_t(n,y))break;y=n.issues.length}f++;let p=t.rest._zod.run({value:v,issues:[]},i);p instanceof Promise?s.push(p.then(b=>bS(b,n,f))):bS(p,n,f)}}return s.length?Promise.all(s).then(()=>SS(u,n,r,a,l)):SS(u,n,r,a,l)}});wg=A("$ZodRecord",(e,t)=>{ze.init(e,t);let r=it.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let i=o.value;if(!Jt(i))return o.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),o;let a=[],s=t.keyType._zod.values;if(s&&!t.partial){o.value=r?r.alloc(e,o,{},n):{};let c=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){if(c.add(typeof u=="number"?u.toString():u),u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(h=>xt(h,n,We())),input:u,path:[u],inst:e});continue}let m=d.value;if(m==="__proto__")continue;let f=t.valueType._zod.run({value:i[u],issues:[]},n);f instanceof Promise?a.push(f.then(h=>{h.issues.length&&o.issues.push(...It(u,h.issues)),o.value[m]=h.value})):(f.issues.length&&o.issues.push(...It(u,f.issues)),o.value[m]=f.value)}let l;for(let u in i)if(!c.has(u))if(t.mode==="loose"){if(u==="__proto__")continue;o.value[u]=i[u]}else l=l??[],l.push(u);l&&l.length>0&&o.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}else{o.value=r?r.alloc(e,o,{},n):{};let c;for(let l of Reflect.ownKeys(i)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,l))continue;let u=t.keyType._zod.run({value:l,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&En.test(l)&&u.issues.length){let h=t.keyType._zod.run({value:Number(l),issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(u=h)}if(u.issues.length){t.mode==="loose"?o.value[l]=i[l]:s?(c=c??[],c.push(l)):o.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(h=>xt(h,n,We())),input:l,path:[l],inst:e});continue}let m=u.value;if(m==="__proto__")continue;let f=t.valueType._zod.run({value:i[l],issues:[]},n);f instanceof Promise?a.push(f.then(h=>{h.issues.length&&o.issues.push(...It(l,h.issues)),o.value[m]=h.value})):(f.issues.length&&o.issues.push(...It(l,f.issues)),o.value[m]=f.value)}c&&c.length>0&&o.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:!0})}return a.length?Promise.all(a).then(()=>o):o}}),kg=A("$ZodMap",(e,t)=>{ze.init(e,t);let r=it.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let i=o.value;if(!(i instanceof Map))return o.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),o;let a=[];o.value=r?r.alloc(e,o,new Map,n):new Map;let s=n?.abortEarly,c=o.issues.length;for(let[l,u]of i){if(s&&o.issues.length!==c){if(_t(o,c))break;c=o.issues.length}let d=t.keyType._zod.run({value:l,issues:[]},n),m=t.valueType._zod.run({value:u,issues:[]},n);d instanceof Promise||m instanceof Promise?a.push(Promise.all([d,m]).then(([f,h])=>{wS(f,h,o,l,i,e,n)})):wS(d,m,o,l,i,e,n)}return a.length?Promise.all(a).then(()=>o):o},gg(e,gC)});zg=A("$ZodSet",(e,t)=>{ze.init(e,t);let r=it.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let i=o.value;if(!(i instanceof Set))return o.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),o;let a=[];o.value=r?r.alloc(e,o,new Set,n):new Set;let s=n?.abortEarly,c=o.issues.length;for(let l of i){if(s&&o.issues.length!==c){if(_t(o,c))break;c=o.issues.length}let u=t.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise?a.push(u.then(d=>kS(d,o))):kS(u,o)}return a.length?Promise.all(a).then(()=>o):o},gg(e,vC)});Rg=A("$ZodEnum",(e,t)=>{ze.init(e,t);let r=Po(t.entries),o=new Set(r);e._zod.values=o,Oe(e,"pattern",n=>{let i=Po(n.def.entries).filter(a=>ka.has(typeof a));return new RegExp(i.length?`^(${i.map(a=>Kt(a.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,i)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),Ig=A("$ZodLiteral",(e,t)=>{ze.init(e,t);let r=new Set(t.values);e._zod.values=r,Oe(e,"pattern",o=>{let n=o.def.values;return new RegExp(n.length?`^(${n.map(i=>typeof i=="string"?Kt(i):i?Kt(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),xg=A("$ZodFile",(e,t)=>{ze.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Tg=A("$ZodTransform",(e,t)=>{ze.init(e,t),e._zod.optin="optional",it.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new er(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r));if(n instanceof Promise)throw new Tt;return r.value=n,r}});zl=A("$ZodOptional",(e,t)=>{ze.init(e,t),Oe(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Oe(e,"values",r=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),Oe(e,"pattern",r=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${Pn(o.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let n=t.innerType._zod.run({value:r.value,issues:[]},o);return n instanceof Promise?n.then(i=>zS(r,i)):zS(r,n)}return t.innerType._zod.run(r,o)}}),Pg=A("$ZodExactOptional",(e,t)=>{zl.init(e,t),Oe(e,"values",r=>r.def.innerType._zod.values),Oe(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Eg=A("$ZodNullable",(e,t)=>{ze.init(e,t),Oe(e,"optin",r=>r.def.innerType._zod.optin),Oe(e,"optout",r=>r.def.innerType._zod.optout),Oe(e,"pattern",r=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${Pn(o.source)}|null)$`):void 0}),Oe(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),Cg=A("$ZodDefault",(e,t)=>{ze.init(e,t),e._zod.optin="defaulted",Oe(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>RS(i,t)):RS(n,t)}});Og=A("$ZodPrefault",(e,t)=>{ze.init(e,t),e._zod.optin="defaulted",Oe(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),Ng=A("$ZodNonOptional",(e,t)=>{ze.init(e,t),Oe(e,"values",r=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>IS(i,e)):IS(n,e)}});jg=A("$ZodSuccess",(e,t)=>{ze.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new er("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}});Ag=A("$ZodCatch",(e,t)=>{ze.init(e,t),Oe(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Oe(e,"optout",r=>r.def.innerType._zod.optout),Oe(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);return n instanceof Promise?n.then(i=>xS(r,i,t,o)):xS(r,n,t,o)}}),Mg=A("$ZodNaN",(e,t)=>{ze.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Rl=A("$ZodPipe",(e,t)=>{ze.init(e,t),Oe(e,"values",r=>r.def.in._zod.values),Oe(e,"optin",r=>r.def.in._zod.optin),Oe(e,"optout",r=>r.def.out._zod.optout),Oe(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>cl(a,t.in,o)):cl(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>cl(i,t.out,o)):cl(n,t.out,o)}});Ja=A("$ZodCodec",(e,t)=>{ze.init(e,t),Oe(e,"values",r=>r.def.in._zod.values),Oe(e,"optin",r=>r.def.in._zod.optin),Oe(e,"optout",r=>r.def.out._zod.optout),Oe(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>ll(a,t,o)):ll(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>ll(a,t,o)):ll(i,t,o)}}});Dg=A("$ZodPreprocess",(e,t)=>{Rl.init(e,t)}),Ug=A("$ZodReadonly",(e,t)=>{ze.init(e,t),Oe(e,"propValues",r=>r.def.innerType._zod.propValues),Oe(e,"values",r=>r.def.innerType._zod.values),Oe(e,"optin",r=>r.def.innerType?._zod?.optin),Oe(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(TS):TS(n)}});Lg=A("$ZodTemplateLiteral",(e,t)=>{ze.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){let n=Ph(o);if(!n)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);r.push(Pn(n))}else if(o===null||mp.has(typeof o))r.push(Kt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),qg=A("$ZodFunction",(e,t)=>(ze.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...o){let n=e._def.input?Zc(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?Zc(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...o){let n=e._def.input?await Bc(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await Bc(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new kl({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),Vg=A("$ZodPromise",(e,t)=>{ze.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Ka=A("$ZodLazy",(e,t)=>{ze.init(e,t),lp(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),Oe(e,"pattern",r=>r.innerType?._zod?.pattern),Oe(e,"propValues",r=>r.innerType?._zod?.propValues),Oe(e,"optin",r=>r.innerType?._zod?.optin??void 0),Oe(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Fg=A("$ZodCustom",(e,t)=>{Be.init(e,t),ze.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>PS(i,r,o,e));PS(n,r,o,e)}})});function US(e){return e!==null&&typeof e=="object"}function Zg(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}function Wa(e,t,r){let o=LS.get(e);if(o!==void 0)return o?Ga:Fo;if(t.has(e))return Ga;t.add(e);let n=Fo,i=u=>{if(n!==Ga&&u?._zod){let d=Wa(u,t,r);d>n&&(n=d)}},a=(u,d)=>{let m=Fo;for(let f of Reflect.ownKeys(u)){let h=Object.getOwnPropertyDescriptor(u,f);if(d&&!h.enumerable)continue;let y=h.get?Tl:h.value?._zod?Wa(h.value,t,r):Fo;y>m&&(m=y)}return m},s=u=>{u>n&&(n=u)},c=e._zod.def,l=c.type;switch(l){case"object":{let u=Oo(c);s(u?a(u,!0):Tl),i(c.catchall);break}case"array":i(c.element);break;case"tuple":for(let u of c.items)i(u);i(c.rest);break;case"record":case"map":i(c.keyType),i(c.valueType);break;case"set":i(c.valueType);break;case"union":for(let u of c.options)i(u);break;case"intersection":i(c.left),i(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(c.innerType);break;case"pipe":i(c.in),i(c.out);break;case"function":i(c.input),i(c.output);break;case"lazy":{let u=c._cachedInner??(r?e._zod.innerType:void 0);s(u?Wa(u,t,!1):Tl);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let u in c){let d=Object.getOwnPropertyDescriptor(c,u);if(!d||d.get)continue;let m=d.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(let f of m)i(f)}}}return t.delete(e),$C(e,n)}function $C(e,t){return t!==Tl&&LS.set(e,t===Ga),t}function El(e){return Wa(e,new Set,!0)!==Fo}function bC(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}function Xa(){return SC}function Cl(e,t){let r=e[Bg]?.backEdges;return r!==void 0&&US(t)&&r.has(t)}var Pl,Bg,DS,LS,Fo,Tl,Ga,Il,xl,SC,Hg=G(()=>{ie();Pl=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Bg="~memo",DS=[];LS=new WeakMap,Fo=0,Tl=1,Ga=2;xl=[],SC={alloc(e,t,r){let o=Il;if(!o)return r;Il=void 0;let n={value:r,issues:null};return o.set(t.value,n),xl.push(n),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,o=(n,i)=>{if(i.direction!=="backward"&&Cl(i,n.value))throw new Pl;return r(n,i)};e._zod.parse=o,e._zod.run===r&&(e._zod.run=o)})},attach(e){var t;let r,o=!1,n,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let a=e._zod.parse,s=(c,l)=>{if(r===void 0){let p=Wa(e,new Set,!1);if(p===Fo)return e._zod.parse=a,e._zod.run===s&&(e._zod.run=a),a(c,l);p===Ga||o?r=!0:o=!0}let u=c.value;if(!US(u))return a(c,l);let d=l[Bg];d||(d={buckets:new WeakMap,backEdges:void 0},l[Bg]=d);let m;n===l?m=i:(m=bC(d,e),n=l,i=m);let f=m.get(u);if(f)return c.value=f.value,f.issues?f.issues.length&&c.issues.push(...Zg(f.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(f.value)),c;Il=m;let h=xl.length,y=a(c,l);Il=void 0;let v=xl.length>h?xl.pop():void 0;return y instanceof Promise?y.then(p=>(v&&(v.issues=p.issues.length?Zg(p.issues):DS),p)):(v&&(v.issues=y.issues.length?Zg(y.issues):DS),y)};e._zod.parse=s,e._zod.run===a&&(e._zod.run=s)})}}});function qS(){return{localeError:wC()}}var wC,VS=G(()=>{ie();wC=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},map:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",mac:"\u0639\u0646\u0648\u0627\u0646 MAC",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",credit_card:"\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",currency_code:"\u0631\u0645\u0632 \u0627\u0644\u0639\u0645\u0644\u0629",iban:"IBAN",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${B(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${M(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function FS(){return{localeError:kC()}}var kC,ZS=G(()=>{ie();kC=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"},map:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"kredit kart\u0131 n\xF6mr\u0259si",currency_code:"valyuta kodu",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${B(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${M(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function BS(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function HS(){return{localeError:zC()}}var zC,JS=G(()=>{ie();zC=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},map:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",mac:"MAC \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",credit_card:"\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",currency_code:"\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${B(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=BS(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=BS(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${M(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function KS(){return{localeError:RC()}}var RC,GS=G(()=>{ie();RC=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",mac:"MAC \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",currency_code:"\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${B(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${M(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function WS(){return{localeError:IC()}}var IC,XS=G(()=>{ie();IC=()=>{let e={string:{unit:"\u0985\u0995\u09CD\u09B7\u09B0",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},file:{unit:"\u09AC\u09BE\u0987\u099F",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},array:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},set:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},map:{unit:"\u098F\u09A8\u09CD\u099F\u09CD\u09B0\u09BF",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"}};function t(n){return e[n]??null}let r={regex:"\u0987\u09A8\u09AA\u09C1\u099F",email:"\u0987\u09AE\u09C7\u0987\u09B2 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",url:"URL",emoji:"\u0987\u09AE\u09CB\u099C\u09BF",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u09A4\u09BE\u09B0\u09BF\u0996 \u0993 \u09B8\u09AE\u09AF\u09BC",date:"ISO \u09A4\u09BE\u09B0\u09BF\u0996",time:"ISO \u09B8\u09AE\u09AF\u09BC",duration:"ISO \u09B8\u09AE\u09AF\u09BC\u0995\u09BE\u09B2",ipv4:"IPv4 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",ipv6:"IPv6 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",mac:"MAC \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",cidrv4:"IPv4 \u09B0\u09C7\u099E\u09CD\u099C",cidrv6:"IPv6 \u09B0\u09C7\u099E\u09CD\u099C",base64:"base64-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",base64url:"base64url-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",json_string:"JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",e164:"E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",credit_card:"\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",currency_code:"\u09AE\u09C1\u09A6\u09CD\u09B0\u09BE \u0995\u09CB\u09A1",iban:"IBAN",jwt:"JWT",template_literal:"\u0987\u09A8\u09AA\u09C1\u099F"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${i}, \u09AA\u09CD\u09B0\u09BE\u09AA\u09CD\u09A4 ${s}`}case"invalid_value":return n.values.length===1?`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${B(n.values[0])}`:`\u0985\u09AC\u09C8\u09A7 \u0985\u09AA\u09B6\u09A8: ${M(n.values," | ")} \u098F\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7 \u098F\u0995\u099F\u09BF \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${n.origin??"\u09AE\u09BE\u09A8"} ${i}${n.maximum.toString()} ${a.unit??"\u098F\u09B2\u09BF\u09AE\u09C7\u09A8\u09CD\u099F"} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${n.origin??"\u09AE\u09BE\u09A8"} ${i}${n.maximum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${n.origin} ${i}${n.minimum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${i.prefix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C1\u09B0\u09C1 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:i.format==="ends_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${i.suffix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C7\u09B7 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:i.format==="includes"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${i.includes}" \u0985\u09A8\u09CD\u09A4\u09B0\u09CD\u09AD\u09C1\u0995\u09CD\u09A4 \u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7`:i.format==="regex"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: ${i.pattern} \u09AA\u09CD\u09AF\u09BE\u099F\u09BE\u09B0\u09CD\u09A8 \u09AE\u09BF\u09B2\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09AC\u09C8\u09A7 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0985\u09AC\u09C8\u09A7 \u09A8\u09AE\u09CD\u09AC\u09B0: ${n.divisor} \u098F\u09B0 \u0997\u09C1\u09A3\u09BF\u09A4\u0995 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`;case"unrecognized_keys":return`\u0985\u099A\u09C7\u09A8\u09BE \u0995\u09C0${n.keys.length>1?"\u0997\u09C1\u09B2\u09CB":""}: ${M(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u0995\u09C0`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0985\u09AC\u09C8\u09A7 \u09A1\u09BF\u09B8\u0995\u09CD\u09B0\u09BF\u09AE\u09BF\u09A8\u09C7\u099F\u09B0 \u09AE\u09BE\u09A8\u0964 \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${n.options.map(a=>`'${a}'`).join(" | ")}`:"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F";case"invalid_element":return`${n.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u09AE\u09BE\u09A8`;default:return"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F"}}}});function YS(){return{localeError:xC()}}var xC,QS=G(()=>{ie();xC=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",mac:"adre\xE7a MAC",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",credit_card:"n\xFAmero de targeta de cr\xE8dit",currency_code:"codi de moneda",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${B(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${M(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${M(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}}});function e0(){return{localeError:TC()}}var TC,t0=G(()=>{ie();TC=()=>{let e={string:{unit:"\u067E\u06CC\u062A",verb:"\u0628\u06CE\u062A"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u0628\u06CE\u062A"},array:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},set:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},map:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"}};function t(n){return e[n]??null}let r={regex:"regex",email:"\u0626\u06CC\u0645\u06D5\u06CC\u06B5",url:"\u0628\u06D5\u0633\u062A\u06D5\u0631 (URL)",emoji:"\u0626\u06CC\u0645\u06C6\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0695\u06CE\u06A9\u06D5\u0648\u062A \u0648 \u06A9\u0627\u062A",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",time:"\u06A9\u0627\u062A",duration:"\u0645\u0627\u0648\u06D5",ipv4:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv4",ipv6:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv6",mac:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC MAC",cidrv4:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv4",cidrv6:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv6",base64:"\u062F\u06D5\u0642\u06CC base64",base64url:"\u062F\u06D5\u0642\u06CC base64url",json_string:"\u062F\u06D5\u0642\u06CC JSON",e164:"\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",credit_card:"\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",currency_code:"\u06A9\u06C6\u062F\u06CC \u062F\u0631\u0627\u0648",iban:"IBAN",jwt:"JWT",template_literal:"\u062A\u06CE\u06A9\u0631\u062F\u06D5"},o={nan:"NaN",string:"\u0646\u0648\u0648\u0633\u06CC\u0646",number:"\u0698\u0645\u0627\u0631\u06D5",boolean:"boolean",array:"array",object:"object",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",integer:"\u0698\u0645\u0627\u0631\u06D5",float:"\u0698\u0645\u0627\u0631\u06D5",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a,c=["\u0627","\u0648","\u06C6","\u0648\u0648","\u06D5","\u06CC","\u06CE"].some(u=>s.endsWith(u))?"\u06CC\u06D5":"\u06D5",l=/^[a-zA-Z]+$/.test(s);return a==="null"||a==="undefined"?"\u062F\u0627\u0648\u0627\u06A9\u0631\u0627\u0648\u06D5":`\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${i} \u0628\u06CE\u062A\u060C \u0628\u06D5\u06B5\u0627\u0645 ${s}${l?"":c}`}case"invalid_value":return n.values.length===1?`\u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0648\u0633\u062A\u06D5: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${B(n.values[0])} \u0628\u06CE\u062A`:`\u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 \u06CC\u06D5\u06A9\u06CE\u06A9 \u0628\u06CE\u062A \u0644\u06D5 ${M(n.values,"|")}`;case"too_big":{let i=t(n.origin);return i?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${n.maximum.toString()} ${i.unit} ${i.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${n.maximum.toString()} \u0628\u06CE\u062A`}case"too_small":{let i=t(n.origin);return i?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${n.minimum.toString()} ${i.unit} ${i.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${n.minimum.toString()} \u0628\u06CE\u062A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u062F\u06D5\u0633\u062A\u067E\u06CE\u0628\u06A9\u0627\u062A \u0628\u06D5 "${i.prefix}"`:i.format==="ends_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u06A9\u06C6\u062A\u0627\u06CC\u06CC\u0628\u06CE\u062A \u0628\u06D5 "${i.suffix}"`:i.format==="includes"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 "${i.includes}" \u0644\u06D5\u062E\u06C6\u0628\u06AF\u0631\u06CE\u062A`:i.format==="regex"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0644\u06D5\u06AF\u06D5\u06B5 \u067E\u0627\u062A\u06CE\u0631\u0646\u06CC ${i.pattern} \u0628\u06AF\u0648\u0646\u062C\u06CE\u062A`:`\u0628\u06D5\u0647\u0627\u06CC ${r[i.format]??n.format} \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`}case"not_multiple_of":return`\u0698\u0645\u0627\u0631\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u062F\u06D5\u0628\u06CE\u062A \u0686\u06D5\u0646\u062F \u0647\u06CE\u0646\u062F\u06D5 \u0628\u06CE\u062A \u0628\u06C6 ${n.divisor}`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648: ${M(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A \u0644\u06D5 ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0628\u06D5\u0647\u0627\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648 \u0647\u06D5\u06CC\u06D5. \u0628\u06D5\u0647\u0627\u06CC \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648: ${n.options.map(a=>`'${a}'`).join(" | ")}`:"\u06CC\u06D5\u06A9\u06AF\u0631\u062A\u0646\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A";case"invalid_element":return`${n.origin} \u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`;default:return"\u062A\u06CE\u06A9\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A"}}}});function n0(){return{localeError:PC()}}var PC,r0=G(()=>{ie();PC=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"},map:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditn\xED karty",currency_code:"k\xF3d m\u011Bny",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${B(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${M(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}}});function o0(){return{localeError:EC()}}var EC,i0=G(()=>{ie();EC=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${B(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${M(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}}});function a0(){return{localeError:CC()}}var CC,s0=G(()=>{ie();CC=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"},map:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",currency_code:"W\xE4hrungscode",iban:"IBAN",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${B(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${M(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function c0(){return{localeError:OC()}}var OC,l0=G(()=>{ie();OC=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",credit_card:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",currency_code:"\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03BD\u03BF\u03BC\u03AF\u03C3\u03BC\u03B1\u03C4\u03BF\u03C2",iban:"IBAN",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${B(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${M(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}}});function Ol(){return{localeError:NC()}}var NC,Jg=G(()=>{ie();NC=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};function n(i,a){return i==="number"&&typeof a=="number"&&!Number.isFinite(a)?String(a):o[i]??i}return i=>{switch(i.code){case"invalid_type":{let a=n(i.expected),s=H(i.input),c=n(s,i.input);return`Invalid input: expected ${a}, received ${c}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${B(i.values[0])}`:`Invalid option: expected one of ${M(i.values,"|")}`;case"too_big":{let a=i.exact?"exactly ":i.inclusive?"<=":"<",s=t(i.origin);return s?`Too big: expected ${i.origin??"value"} to have ${a}${i.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${a}${i.maximum.toString()}`}case"too_small":{let a=i.exact?"exactly ":i.inclusive?">=":">",s=t(i.origin);return s?`Too small: expected ${i.origin} to have ${a}${i.minimum.toString()} ${s.unit}`:`Too small: expected ${i.origin} to be ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${r[a.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${M(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(s=>`'${s}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}}});function u0(){return{localeError:jC()}}var jC,d0=G(()=>{ie();jC=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",mac:"MAC-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",credit_card:"kreditkarta numero",currency_code:"valuta kodo",iban:"IBAN",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${B(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${M(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}}});function m0(){return{localeError:AC()}}var AC,f0=G(()=>{ie();AC=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",mac:"direcci\xF3n MAC",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",credit_card:"n\xFAmero de tarjeta de cr\xE9dito",currency_code:"c\xF3digo de moneda",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${B(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${M(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}}});function p0(){return{localeError:MC()}}var MC,h0=G(()=>{ie();MC=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},map:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",mac:"MAC \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",credit_card:"\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",currency_code:"\u06A9\u062F \u0627\u0631\u0632",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${B(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${M(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${M(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function g0(){return{localeError:DC()}}var DC,v0=G(()=>{ie();DC=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",currency_code:"valuuttakoodi",iban:"IBAN",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${B(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${M(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function y0(){return{localeError:UC()}}var UC,_0=G(()=>{ie();UC=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"expression r\xE9guli\xE8re",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne de caract\xE8res encod\xE9e en base64",base64url:"cha\xEEne de caract\xE8res encod\xE9e en base64url",json_string:"cha\xEEne de caract\xE8res JSON",e164:"num\xE9ro au format E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne de caract\xE8res",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"record",map:"map",set:"ensemble",file:"fichier",nonoptional:"non optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instance de ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${B(n.values[0])} attendu`:`Option invalide : une valeur parmi ${M(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne de caract\xE8res invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne de caract\xE8res invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne de caract\xE8res invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne de caract\xE8res invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${M(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function $0(){return{localeError:LC()}}var LC,b0=G(()=>{ie();LC=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"},map:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${B(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${M(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function S0(){return{localeError:qC()}}var qC,w0=G(()=>{ie();qC=()=>{let e={string:{unit:"\u0A85\u0A95\u0ACD\u0AB7\u0AB0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},file:{unit:"\u0AAC\u0ABE\u0AAF\u0A9F",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},array:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},set:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},map:{unit:"\u0A8F\u0AA8\u0ACD\u0A9F\u0ACD\u0AB0\u0AC0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"}};function t(n){return e[n]??null}let r={regex:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F",email:"\u0A88\u0AAE\u0AC7\u0A87\u0AB2 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",url:"URL",emoji:"\u0A87\u0AAE\u0ACB\u0A9C\u0AC0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96 \u0A85\u0AA8\u0AC7 \u0AB8\u0AAE\u0AAF",date:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96",time:"ISO \u0AB8\u0AAE\u0AAF",duration:"ISO \u0A85\u0AB5\u0AA7\u0ABF",ipv4:"IPv4 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",ipv6:"IPv6 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",mac:"MAC \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",cidrv4:"IPv4 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",cidrv6:"IPv6 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",base64:"base64-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",base64url:"base64url-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",json_string:"JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",e164:"E.164 \u0AA8\u0A82\u0AAC\u0AB0",credit_card:"\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",currency_code:"\u0A9A\u0AB2\u0AA3 \u0A95\u0ACB\u0AA1",iban:"IBAN",jwt:"JWT",template_literal:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${i}, \u0AAA\u0ACD\u0AB0\u0ABE\u0AAA\u0ACD\u0AA4 ${s}`}case"invalid_value":return n.values.length===1?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${B(n.values[0])}`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB5\u0ABF\u0A95\u0AB2\u0ACD\u0AAA: ${M(n.values," | ")} \u0AAE\u0ABE\u0AA7\u0ACD\u0AAF\u0AAE\u0AA5\u0AC0 \u0A8F\u0A95 \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${n.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${i}${n.maximum.toString()} ${a.unit??"\u0A8F\u0AB2\u0ABF\u0AAE\u0AC7\u0AA8\u0ACD\u0A9F"} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${n.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${i}${n.maximum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${n.origin} ${i}${n.minimum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${i.prefix}" \u0AA5\u0AC0 \u0AB6\u0AB0\u0AC2 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:i.format==="ends_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${i.suffix}" \u0AAA\u0AB0 \u0AB8\u0AAE\u0ABE\u0AAA\u0ACD\u0AA4 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:i.format==="includes"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${i.includes}" \u0AB6\u0ABE\u0AAE\u0AC7\u0AB2 \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:i.format==="regex"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: \u0AAA\u0AC7\u0A9F\u0AB0\u0ACD\u0AA8 ${i.pattern} \u0AB8\u0ABE\u0AA5\u0AC7 \u0AAE\u0AC7\u0AB3 \u0A96\u0ABE\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA8\u0A82\u0AAC\u0AB0: ${n.divisor} \u0AA8\u0ACB \u0A97\u0AC1\u0AA3\u0ABE\u0A82\u0A95 \u0AB9\u0ACB\u0AB5\u0ACB \u0A9C\u0ACB\u0A88\u0A8F`;case"unrecognized_keys":return`\u0A93\u0AB3\u0A96\u0AC0 \u0AB6\u0A95\u0ABE\u0AA4\u0ABE \u0AA8\u0AB9\u0AC0\u0A82 \u0AA4\u0AC7 \u0A95\u0AC0${n.keys.length>1?"\u0A93":""}: ${M(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A95\u0AC0`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA1\u0ABF\u0AB8\u0ACD\u0A95\u0ACD\u0AB0\u0ABF\u0AAE\u0ABF\u0AA8\u0AC7\u0A9F\u0AB0 \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF. \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${n.options.map(a=>`'${a}'`).join(" | ")}`:"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F";case"invalid_element":return`${n.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF`;default:return"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F"}}}});function k0(){return{localeError:VC()}}var VC,z0=G(()=>{ie();VC=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?e[l]:void 0,o=l=>{let u=r(l);return u?u.label:l??e.unknown.label},n=l=>`\u05D4${o(l)}`,i=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=l=>l?t[l]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},mac:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA MAC",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},credit_card:{label:"\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9",gender:"m"},currency_code:{label:"\u05E7\u05D5\u05D3 \u05DE\u05D8\u05D1\u05E2",gender:"m"},iban:{label:"IBAN",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"\u05E7\u05DC\u05D8",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,d=c[u??""]??o(u),m=H(l.input),f=c[m]??e[m]?.label??m;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${B(l.values[0])}`;let u=l.values.map(f=>B(f));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=a(l.origin),d=n(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let h=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(l.origin==="array"||l.origin==="set"){let h=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=l.inclusive?"<=":"<",f=i(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${l.maximum.toString()}`}case"too_small":{let u=a(l.origin),d=n(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let h=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(l.origin==="array"||l.origin==="set"){let h=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let v=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`}let y=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=l.inclusive?">=":">",f=i(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let d=s[u.format],m=d?.label??u.format,h=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${h}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${M(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function R0(){return{localeError:FC()}}var FC,I0=G(()=>{ie();FC=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},file:{unit:"\u092C\u093E\u0907\u091F\u094D\u0938",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F\u092F\u093E\u0901",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"}};function t(n){return e[n]??null}let r={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0924\u093F\u0925\u093F \u0914\u0930 \u0938\u092E\u092F",date:"ISO \u0924\u093F\u0925\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u092A\u0924\u093E",ipv6:"IPv6 \u092A\u0924\u093E",mac:"MAC \u092A\u0924\u093E",cidrv4:"IPv4 \u0936\u094D\u0930\u0947\u0923\u0940",cidrv6:"IPv6 \u0936\u094D\u0930\u0947\u0923\u0940",base64:"Base64-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",base64url:"Base64URL-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",e164:"E.164 \u0938\u0902\u0916\u094D\u092F\u093E",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",currency_code:"\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${i}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${s}`}case"invalid_value":return n.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${B(n.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u094B\u0902 \u092E\u0947\u0902 \u0938\u0947 \u090F\u0915 ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${n.origin??"\u092E\u093E\u0928"} \u092E\u0947\u0902 ${i}${n.maximum} ${a.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${n.origin??"\u092E\u093E\u0928"} ${i}${n.maximum} \u0939\u094B`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${n.origin} \u092E\u0947\u0902 ${i}${n.minimum} ${a.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${n.origin} ${i}${n.minimum} \u0939\u094B`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${i.prefix}" \u0938\u0947 \u0936\u0941\u0930\u0942 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:i.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${i.suffix}" \u092A\u0930 \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:i.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u0907\u0938\u092E\u0947\u0902 "${i.includes}" \u0936\u093E\u092E\u093F\u0932 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:i.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u092A\u0948\u091F\u0930\u094D\u0928 ${i.pattern} \u0938\u0947 \u092E\u0947\u0932 \u0916\u093E\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:`\u0905\u092E\u093E\u0928\u094D\u092F ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: \u092F\u0939 ${n.divisor} \u0915\u093E \u0917\u0941\u0923\u091C \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u0902\u091C\u0940${n.keys.length>1?"\u092F\u093E\u0901":""}: ${M(n.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u0902\u091C\u0940: ${n.origin} \u092E\u0947\u0902`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${n.options.map(a=>`'${a}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${n.origin} \u092E\u0947\u0902`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}}});function x0(){return{localeError:ZC()}}var ZC,T0=G(()=>{ie();ZC=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",currency_code:"kod valute",iban:"IBAN",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${B(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${M(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}}});function P0(){return{localeError:BC()}}var BC,E0=G(()=>{ie();BC=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",mac:"MAC c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",credit_card:"hitelk\xE1rtyasz\xE1m",currency_code:"p\xE9nznemk\xF3d",iban:"IBAN",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${B(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${M(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function C0(e,t,r){return Math.abs(e)===1?t:r}function Zo(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}function O0(){return{localeError:HC()}}var HC,N0=G(()=>{ie();HC=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},map:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",mac:"MAC \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",credit_card:"\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",currency_code:"\u0561\u0580\u056A\u0578\u0582\u0575\u0569\u056B \u056F\u0578\u0564",iban:"IBAN",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${B(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=C0(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Zo(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Zo(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=C0(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Zo(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Zo(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${M(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Zo(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Zo(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function j0(){return{localeError:JC()}}var JC,A0=G(()=>{ie();JC=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",credit_card:"nomor kartu kredit",currency_code:"kode mata uang",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${B(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${M(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}}});function M0(){return{localeError:KC()}}var KC,D0=G(()=>{ie();KC=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"},map:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",credit_card:"kreditkortan\xFAmer",currency_code:"gjaldmi\xF0ilsk\xF3\xF0i",iban:"IBAN",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${B(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${M(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}}});function U0(){return{localeError:GC()}}var GC,L0=G(()=>{ie();GC=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",currency_code:"codice valuta",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${B(n.values[0])}`:`Opzione non valida: atteso uno tra ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${M(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}}});function q0(){return{localeError:WC()}}var WC,V0=G(()=>{ie();WC=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},map:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",mac:"MAC\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",credit_card:"\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",currency_code:"\u901A\u8CA8\u30B3\u30FC\u30C9",iban:"IBAN",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${B(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${M(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${M(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function F0(){return{localeError:XC()}}var XC,Z0=G(()=>{ie();XC=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},map:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",mac:"MAC \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",credit_card:"\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",currency_code:"\u10D5\u10D0\u10DA\u10E3\u10E2\u10D8\u10E1 \u10D9\u10DD\u10D3\u10D8",iban:"IBAN",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${B(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${M(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${M(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function Nl(){return{localeError:YC()}}var YC,Kg=G(()=>{ie();YC=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},map:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",mac:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 MAC",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",credit_card:"\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",currency_code:"\u1780\u17BC\u178A\u179A\u17BC\u1794\u17B7\u1799\u1794\u17D0\u178E\u17D2\u178E",iban:"IBAN",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${B(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${M(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function B0(){return Nl()}var H0=G(()=>{Kg()});function J0(){return{localeError:QC()}}var QC,K0=G(()=>{ie();QC=()=>{let e={string:{unit:"\u0C85\u0C95\u0CCD\u0CB7\u0CB0\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},file:{unit:"\u0CAC\u0CC8\u0C9F\u0CCD\u200C\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},array:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},set:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},map:{unit:"entries",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"}};function t(n){return e[n]??null}let r={regex:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD",email:"email \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95\u0CA6 \u0CB8\u0CAE\u0CAF",date:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95",time:"ISO \u0CB8\u0CAE\u0CAF",duration:"ISO \u0C85\u0CB5\u0CA7\u0CBF",ipv4:"IPv4 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",ipv6:"IPv6 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",mac:"MAC \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",cidrv4:"IPv4 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",cidrv6:"IPv6 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",base64:"base64-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",base64url:"base64url-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",json_string:"JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",e164:"E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",credit_card:"\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",currency_code:"\u0C95\u0CB0\u0CC6\u0CA8\u0CCD\u0CB8\u0CBF \u0C95\u0CCB\u0CA1\u0CCD",iban:"IBAN",jwt:"JWT",template_literal:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${i}, \u0CB8\u0CCD\u0CB5\u0CC0\u0C95\u0CB0\u0CBF\u0CB8\u0CBF\u0CA6\u0CA8\u0CC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${B(n.values[0])}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C86\u0CAF\u0CCD\u0C95\u0CC6: \u0C87\u0CB5\u0CC1\u0C97\u0CB3\u0CB2\u0CCD\u0CB2\u0CBF \u0C92\u0C82\u0CA6\u0CA8\u0CCD\u0CA8\u0CC1 \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.origin??"value"} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${i}${n.maximum.toString()} ${a.unit??"\u0C85\u0C82\u0CB6\u0C97\u0CB3\u0CC1"}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.origin??"value"} \u0C8E\u0C82\u0CA6\u0CC1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.origin} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${i}${n.minimum.toString()} ${a.unit}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.origin} \u0C8E\u0C82\u0CA6\u0CC1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0CAA\u0CCD\u0CB0\u0CBE\u0CB0\u0C82\u0CAD\u0CBF\u0CB8\u0CAC\u0CC7\u0C95\u0CC1 "${i.prefix}"`:i.format==="ends_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0C95\u0CCA\u0CA8\u0CC6\u0C97\u0CCA\u0CB3\u0CCD\u0CB3\u0CAC\u0CC7\u0C95\u0CC1 "${i.suffix}"`:i.format==="includes"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C92\u0CB3\u0C97\u0CCA\u0C82\u0CA1\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 "${i.includes}"`:i.format==="regex"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0CAE\u0CBE\u0CA6\u0CB0\u0CBF\u0C97\u0CC6 \u0CB9\u0CCA\u0C82\u0CA6\u0CBF\u0C95\u0CC6\u0CAF\u0CBE\u0C97\u0CAC\u0CC7\u0C95\u0CC1 ${i.pattern}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6: \u0CAC\u0CB9\u0CC1\u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6\u0CAF\u0CBE\u0C97\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 ${n.divisor}`;case"unrecognized_keys":return`\u0C97\u0CC1\u0CB0\u0CC1\u0CA4\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CA6 \u0C95\u0CC0 ${n.keys.length>1?"s":""}: ${M(n.keys,", ")}`;case"invalid_key":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0C95\u0CC0 \u0C87\u0CA8\u0CCD ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CA4\u0CBE\u0CB0\u0CA4\u0CAE\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF. \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${n.options.map(a=>`'${a}'`).join(" | ")}`:"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD";case"invalid_element":return`\u0CB0\u0CB2\u0CCD\u0CB2\u0CBF \u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF ${n.origin}`;default:return"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD"}}}});function G0(){return{localeError:eO()}}var eO,W0=G(()=>{ie();eO=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"},map:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",mac:"MAC \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",credit_card:"\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",currency_code:"\uD1B5\uD654 \uCF54\uB4DC",iban:"IBAN",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${B(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${M(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),c=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${M(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function X0(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}function Y0(){return{localeError:tO()}}var Ya,tO,Q0=G(()=>{ie();Ya=e=>e.charAt(0).toUpperCase()+e.slice(1);tO=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,a,s){let c=e[n]??null;return c===null?c:{unit:c.unit[i],verb:c.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",mac:"MAC adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",credit_card:"kredito kortel\u0117s numeris",currency_code:"valiutos kodas",iban:"IBAN",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${B(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${M(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,X0(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${Ya(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Ya(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,a=t(n.origin,X0(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${Ya(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Ya(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${M(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${Ya(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function ew(){return{localeError:nO()}}var nO,tw=G(()=>{ie();nO=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},map:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",mac:"MAC \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",credit_card:"\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",currency_code:"\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${B(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${M(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function nw(){return{localeError:rO()}}var rO,rw=G(()=>{ie();rO=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",currency_code:"kod mata wang",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${B(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${M(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}}});function ow(){return{localeError:oO()}}var oO,iw=G(()=>{ie();oO=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},file:{unit:"\u092C\u093E\u0907\u091F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"}};function t(n){return e[n]??null}let r={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0907\u092E\u0947\u0932 \u0920\u0947\u0917\u093E\u0928\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u092E\u093F\u0924\u093F \u0930 \u0938\u092E\u092F",date:"ISO \u092E\u093F\u0924\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u0920\u0947\u0917\u093E\u0928\u093E",ipv6:"IPv6 \u0920\u0947\u0917\u093E\u0928\u093E",mac:"MAC \u0920\u0947\u0917\u093E\u0928\u093E",cidrv4:"IPv4 \u0926\u093E\u092F\u0930\u093E",cidrv6:"IPv6 \u0926\u093E\u092F\u0930\u093E",base64:"base64-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",base64url:"base64url-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",e164:"E.164 \u0928\u092E\u094D\u092C\u0930",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",currency_code:"\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${i}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${s}`}case"invalid_value":return n.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${B(n.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u0939\u0930\u0942 \u092E\u0927\u094D\u092F\u0947 \u090F\u0915 ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${n.origin??"\u092E\u093E\u0928"} \u092E\u093E ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${n.origin??"\u092E\u093E\u0928"} ${i}${n.maximum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${n.origin} \u092E\u093E ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${n.origin} ${i}${n.minimum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${i.prefix}" \u092C\u093E\u091F \u0938\u0941\u0930\u0941 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:i.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${i.suffix}" \u092E\u093E \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:i.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${i.includes}" \u0938\u092E\u093E\u0935\u0947\u0936 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:i.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: \u0922\u093E\u0901\u091A\u093E ${i.pattern} \u0938\u0901\u0917 \u092E\u0947\u0932 \u0916\u093E\u0928\u0941\u092A\u0930\u094D\u091B`:`\u0905\u092E\u093E\u0928\u094D\u092F ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: ${n.divisor} \u0915\u094B \u0917\u0941\u0923\u091C \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u091E\u094D\u091C\u0940${n.keys.length>1?"\u0939\u0930\u0942":""}: ${M(n.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u091E\u094D\u091C\u0940: ${n.origin} \u092E\u093E`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${n.options.map(a=>`'${a}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${n.origin} \u092E\u093E`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}}});function aw(){return{localeError:iO()}}var iO,sw=G(()=>{ie();iO=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",currency_code:"valutacode",iban:"IBAN",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${B(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${M(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}}});function cw(){return{localeError:aO()}}var aO,lw=G(()=>{ie();aO=()=>{let e={string:{unit:"teikn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"element",verb:"\xE5 innehalde"},set:{unit:"element",verb:"\xE5 innehalde"},map:{unit:"element",verb:"\xE5 innehalde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tal",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventa instanceof ${n.expected}, fekk ${s}`:`Ugyldig input: forventa ${i}, fekk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventa ${B(n.values[0])}`:`Ugyldig val: forventa eitt av ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventa ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`For stor(t): forventa ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventa ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventa ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 slutte med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 innehalde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tal: m\xE5 vere eit multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjende n\xF8klar":"Ukjend n\xF8kkel"}: ${M(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}}});function uw(){return{localeError:sO()}}var sO,dw=G(()=>{ie();sO=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"},map:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${B(n.values[0])}`:`Ugyldig valg: forventet en av ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${M(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}}});function mw(){return{localeError:cO()}}var cO,fw=G(()=>{ie();cO=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"},map:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",mac:"MAC ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",credit_card:"i'tib\xE2r kart\u0131 numaras\u0131",currency_code:"para birimi kodu",iban:"IBAN",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${B(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${M(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function pw(){return{localeError:lO()}}var lO,hw=G(()=>{ie();lO=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},map:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",mac:"\u062F MAC \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",credit_card:"\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",currency_code:"\u062F \u0627\u0633\u0639\u0627\u0631\u0648 \u06A9\u0648\u0689",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${B(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${M(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${M(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function gw(){return{localeError:uO()}}var uO,vw=G(()=>{ie();uO=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"},map:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",mac:"adres MAC",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",credit_card:"numer karty kredytowej",currency_code:"kod waluty",iban:"IBAN",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${B(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${M(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function yw(){return{localeError:dO()}}var dO,_w=G(()=>{ie();dO=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(a){return e[a]??null}let r={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"o intervalo de endere\xE7os IPv4",cidrv6:"o intervalo de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",currency_code:"o c\xF3digo de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},o={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},n={string:{name:"texto",articles:o.masculine},number:{name:"n\xFAmero",articles:o.masculine},int:{name:"n\xFAmero inteiro",articles:o.masculine},boolean:{name:"valor booleano",articles:o.masculine},bigint:{name:"n\xFAmero bigint",articles:o.masculine},symbol:{name:"s\xEDmbolo",articles:o.masculine},undefined:{name:'valor "undefined"',articles:o.masculine},null:{name:'valor "nulo"',articles:o.masculine},never:{name:'valor "never"',articles:o.masculine},void:{name:'valor "void"',articles:o.masculine},date:{name:"data",articles:o.feminine},array:{name:"vetor",articles:o.masculine},object:{name:"objeto",articles:o.masculine},tuple:{name:"tuplo",articles:o.masculine},record:{name:"registo",articles:o.masculine},map:{name:"mapa",articles:o.masculine},set:{name:"conjunto",articles:o.masculine},file:{name:"ficheiro",articles:o.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:o.masculine},nan:{name:'valor "NaN"',articles:o.masculine},function:{name:"fun\xE7\xE3o",articles:o.feminine}};function i(a,s){let c=n[a]??{name:`valor "${a}"`,articles:o.masculine};return`${c.articles[s]} ${c.name}`}return a=>{switch(a.code){case"invalid_type":{let s=i(a.expected,"indefinite"),c=H(a.input),l=i(c,"indefinite");return`Entrada inv\xE1lida: esperava ${s}, recebeu ${l}`}case"invalid_value":return a.values.length===1?`Entrada inv\xE1lida: esperava ${B(a.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${M(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",c=t(a.origin);return c?`Demasiado grande: esperava que ${i(a.origin,"definite")} tivesse ${s} ${a.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: esperava que ${i(a.origin,"definite")} fosse ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",c=t(a.origin);return c?`Demasiado pequeno: esperava que ${i(a.origin,"definite")} tivesse ${s} ${a.minimum.toString()} ${c.unit??"elementos"}`:`Demasiado pequeno: esperava que ${i(a.origin,"definite")} fosse ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar por "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar em "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`Formato d${r[s.format]??a.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${a.divisor}`;case"unrecognized_keys":{let s=a.keys.length>1?"s":"";return`Chave${s} inv\xE1lida${s}: ${M(a.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${i(a.origin,"definite")}`;case"invalid_union":return a.options&&Array.isArray(a.options)&&a.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${a.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${i(a.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}}});function $w(){return{localeError:mO()}}var mO,bw=G(()=>{ie();mO=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(a){return e[a]??null}let r={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"a faixa de endere\xE7os IPv4",cidrv6:"a faixa de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",currency_code:"o c\xF3digo de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},o={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},n={string:{name:"texto",articles:o.masculine},number:{name:"n\xFAmero",articles:o.masculine},int:{name:"n\xFAmero inteiro",articles:o.masculine},boolean:{name:"valor booleano",articles:o.masculine},bigint:{name:"n\xFAmero bigint",articles:o.masculine},symbol:{name:"s\xEDmbolo",articles:o.masculine},undefined:{name:'valor "undefined"',articles:o.masculine},null:{name:'valor "nulo"',articles:o.masculine},never:{name:'valor "never"',articles:o.masculine},void:{name:'valor "void"',articles:o.masculine},date:{name:"data",articles:o.feminine},array:{name:"vetor",articles:o.masculine},object:{name:"objeto",articles:o.masculine},tuple:{name:"tupla",articles:o.feminine},record:{name:"registro",articles:o.masculine},map:{name:"mapa",articles:o.masculine},set:{name:"conjunto",articles:o.masculine},file:{name:"arquivo",articles:o.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:o.masculine},nan:{name:'valor "NaN"',articles:o.masculine},function:{name:"fun\xE7\xE3o",articles:o.feminine}};function i(a,s){let c=n[a]??{name:`valor "${a}"`,articles:o.masculine};return`${c.articles[s]} ${c.name}`}return a=>{switch(a.code){case"invalid_type":{let s=i(a.expected,"indefinite"),c=H(a.input),l=i(c,"indefinite");return`Entrada inv\xE1lida: esperava ${s}, recebeu ${l}`}case"invalid_value":return a.values.length===1?`Entrada inv\xE1lida: esperava ${B(a.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${M(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",c=t(a.origin);return c?`Grande demais: esperava que ${i(a.origin,"definite")} tivesse ${s} ${a.maximum.toString()} ${c.unit??"elementos"}`:`Grande demais: esperava que ${i(a.origin,"definite")} fosse ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",c=t(a.origin);return c?`Pequeno demais: esperava que ${i(a.origin,"definite")} tivesse ${s} ${a.minimum.toString()} ${c.unit??"elementos"}`:`Pequeno demais: esperava que ${i(a.origin,"definite")} fosse ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`Formato d${r[s.format]??a.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${a.divisor}`;case"unrecognized_keys":{let s=a.keys.length>1?"s":"";return`Chave${s} inv\xE1lida${s}: ${M(a.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${i(a.origin,"definite")}`;case"invalid_union":return a.options&&Array.isArray(a.options)&&a.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${a.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${i(a.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}}});function Sw(){return{localeError:fO()}}var fO,ww=G(()=>{ie();fO=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",credit_card:"num\u0103r de card de credit",currency_code:"cod valutar",iban:"IBAN",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${B(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${M(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}}});function kw(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function zw(){return{localeError:pO()}}var pO,Rw=G(()=>{ie();pO=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},map:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",mac:"MAC \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",currency_code:"\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${B(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),c=kw(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),c=kw(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${M(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function Iw(){return{localeError:hO()}}var hO,xw=G(()=>{ie();hO=()=>{let e={string:{unit:"znakov",verb:"ma\u0165"},file:{unit:"bajtov",verb:"ma\u0165"},array:{unit:"prvkov",verb:"ma\u0165"},set:{unit:"prvkov",verb:"ma\u0165"},map:{unit:"polo\u017Eiek",verb:"ma\u0165"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rny v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"d\xE1tum a \u010Das vo form\xE1te ISO",date:"d\xE1tum vo form\xE1te ISO",time:"\u010Das vo form\xE1te ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64",base64url:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64url",json_string:"re\u0165azec vo form\xE1te JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditnej karty",currency_code:"k\xF3d meny",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"re\u0165azec",function:"funkcia",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 instanceof ${n.expected}, obdr\u017Ean\xE9 ${s}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${i}, obdr\u017Ean\xE9 ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${B(n.values[0])}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE1 jedna z hodn\xF4t ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${n.origin??"hodnota"} mus\xED ma\u0165 ${i}${n.maximum.toString()} ${a.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${n.origin??"hodnota"} mus\xED by\u0165 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je pr\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED ma\u0165 ${i}${n.minimum.toString()} ${a.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED by\u0165 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD re\u0165azec: mus\xED za\u010D\xEDna\u0165 na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD re\u0165azec: mus\xED kon\u010Di\u0165 na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD re\u0165azec: mus\xED obsahova\u0165 "${i.includes}"`:i.format==="regex"?`Neplatn\xFD re\u0165azec: mus\xED zodpoveda\u0165 vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED by\u0165 n\xE1sobkom ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1me kl\xFA\u010De: ${M(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xFA\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}}});function Tw(){return{localeError:gO()}}var gO,Pw=G(()=>{ie();gO=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",credit_card:"\u0161tevilka kreditne kartice",currency_code:"koda valute",iban:"IBAN",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${B(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${M(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}}});function Ew(){return{localeError:vO()}}var vO,Cw=G(()=>{ie();vO=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"},map:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-adress",ipv6:"IPv6-adress",mac:"MAC-adress",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",credit_card:"kreditkortsnummer",currency_code:"valutakod",iban:"IBAN",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${B(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${M(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function Ow(){return{localeError:yO()}}var yO,Nw=G(()=>{ie();yO=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},map:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",mac:"MAC \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",credit_card:"\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",currency_code:"\u0BA8\u0BBE\u0BA3\u0BAF\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BBF\u0BAF\u0BC0\u0B9F\u0BC1",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${B(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${M(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${M(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function jw(){return{localeError:_O()}}var _O,Aw=G(()=>{ie();_O=()=>{let e={string:{unit:"\u0430\u043B\u043E\u043C\u0430\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},file:{unit:"\u0431\u0430\u0439\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},array:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},set:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},map:{unit:"\u0441\u0430\u0431\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0443\u0440\u0443\u0434",email:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",url:"URL",emoji:"\u044D\u043C\u043E\u04B7\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",date:"\u0441\u0430\u043D\u0430\u0438 ISO",time:"\u0432\u0430\u049B\u0442\u0438 ISO",duration:"\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",ipv4:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",ipv6:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",mac:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",cidrv4:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",cidrv6:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",base64:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",base64url:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",json_string:"\u0441\u0430\u0442\u0440\u0438 JSON",e164:"\u0440\u0430\u049B\u0430\u043C\u0438 E.164",credit_card:"\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",currency_code:"\u0440\u0430\u043C\u0437\u0438 \u0430\u0441\u044A\u043E\u0440",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0443\u0440\u0443\u0434"},o={nan:"NaN",number:"\u0440\u0430\u049B\u0430\u043C",string:"\u0441\u0430\u0442\u0440",array:"\u043C\u0430\u0441\u0441\u0438\u0432",object:"\u043E\u0431\u044A\u0435\u043A\u0442",date:"\u0441\u0430\u043D\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${i} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${s} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`}case"invalid_value":return n.values.length===1?`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${B(n.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:`\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${M(n.values,"|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${n.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${n.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${i}${n.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${n.origin} \u0431\u043E\u044F\u0434 ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${n.origin} \u0431\u043E\u044F\u0434 ${i}${n.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${i.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`:i.format==="ends_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${i.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`:i.format==="includes"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${i.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`:i.format==="regex"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${i.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`:`${r[i.format]??n.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`}case"not_multiple_of":return`\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${n.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;case"unrecognized_keys":return`\u041A\u0430\u043B\u0438\u0434${n.keys.length>1?"\u04B3\u043E\u0438":"\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${M(n.keys,", ")}`;case"invalid_key":return`\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${n.options.map(a=>`'${a}'`).join(" | ")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";case"invalid_element":return`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${n.origin}`;default:return"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442"}}}});function Mw(){return{localeError:$O()}}var $O,Dw=G(()=>{ie();$O=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},map:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",mac:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",credit_card:"\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",currency_code:"\u0E23\u0E2B\u0E31\u0E2A\u0E2A\u0E01\u0E38\u0E25\u0E40\u0E07\u0E34\u0E19",iban:"IBAN",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${B(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${M(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function Uw(){return{localeError:bO()}}var bO,Lw=G(()=>{ie();bO=()=>{let e={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"ba\xFDt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function t(n){return e[n]??null}let r={regex:"giri\u015F",email:"e-po\xE7ta salgysy",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen \u015Fifrlenen setir",base64url:"base64url bilen \u015Fifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartyny\u0148 nomeri",currency_code:"wal\xFDuta kody",iban:"IBAN",jwt:"JWT",template_literal:"\u015Fablon"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return`N\xE4dogry baha: gara\u015Fylan ${i} \xFDerine ${s} alyndy`}case"invalid_value":return n.values.length===1?`N\xE4dogry baha: ${B(n.values[0])} bolmaly`:`N\xE4dogry sa\xFDlaw: a\u015Fakdakylardan biri bolmaly: ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Has uly: gara\u015Fyl\xFDan ${n.origin??"baha"} ${i} ${n.maximum.toString()} ${a.unit??"element"}`:`Has uly: gara\u015Fyl\xFDan ${n.origin??"baha"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Has ki\xE7i: gara\u015Fyl\xFDan ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`Has ki\xE7i: gara\u015Fyl\xFDan ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`N\xE4dogry setir: "${i.prefix}" bilen ba\u015Flamaly`:i.format==="ends_with"?`N\xE4dogry setir: "${i.suffix}" bilen gutarmaly`:i.format==="includes"?`N\xE4dogry setir: "${i.includes}" saklamaly`:i.format==="regex"?`N\xE4dogry setir: ${i.pattern} nusga la\xFDyk bolmaly`:`N\xE4dogry ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xE4dogry san: ${n.divisor} bilen galyndysyz b\xF6l\xFCnmeli`;case"unrecognized_keys":return`Tanalma\xFDan a\xE7ar${n.keys.length>1?"lar":""}: ${M(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde n\xE4dogry a\xE7ar`;case"invalid_union":return"N\xE4dogry baha";case"invalid_element":return`${n.origin} i\xE7inde n\xE4dogry baha`;default:return"N\xE4dogry baha"}}}});function qw(){return{localeError:SO()}}var SO,Vw=G(()=>{ie();SO=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},map:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",mac:"MAC adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",credit_card:"kredi kart\u0131 numaras\u0131",currency_code:"para birimi kodu",iban:"IBAN",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${B(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${M(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function jl(){return{localeError:wO()}}var wO,Gg=G(()=>{ie();wO=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",mac:"\u0430\u0434\u0440\u0435\u0441\u0430 MAC",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",currency_code:"\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u0438",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${B(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${M(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function Fw(){return jl()}var Zw=G(()=>{Gg()});function Bw(){return{localeError:kO()}}var kO,Hw=G(()=>{ie();kO=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},map:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",mac:"\u0627\u06CC\u0645 \u0627\u06D2 \u0633\u06CC \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",credit_card:"\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",currency_code:"\u06A9\u0631\u0646\u0633\u06CC \u06A9\u0648\u0688",iban:"IBAN",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${B(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${M(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${M(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function Jw(){return{localeError:zO()}}var zO,Kw=G(()=>{ie();zO=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",credit_card:"kredit karta raqami",currency_code:"valyuta kodi",iban:"IBAN",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${B(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${M(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function Gw(){return{localeError:RO()}}var RO,Ww=G(()=>{ie();RO=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},map:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",mac:"\u0111\u1ECBa ch\u1EC9 MAC",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",credit_card:"s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",currency_code:"m\xE3 ti\u1EC1n t\u1EC7",iban:"IBAN",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${B(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${M(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function Xw(){return{localeError:IO()}}var IO,Yw=G(()=>{ie();IO=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"},map:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",mac:"MAC\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",credit_card:"\u4FE1\u7528\u5361\u53F7",currency_code:"\u8D27\u5E01\u4EE3\u7801",iban:"IBAN",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${B(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${M(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function Qw(){return{localeError:xO()}}var xO,ek=G(()=>{ie();xO=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},map:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",mac:"MAC \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",credit_card:"\u4FE1\u7528\u5361\u865F",currency_code:"\u8CA8\u5E63\u4EE3\u78BC",iban:"IBAN",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${B(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${M(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function tk(){return{localeError:TO()}}var TO,nk=G(()=>{ie();TO=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"},map:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",mac:"\xE0d\xEDr\u1EB9\u0301s\xEC MAC",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",credit_card:"n\u1ECDmba kaadi gbese",currency_code:"koodu ow\xF3",iban:"IBAN",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=H(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${B(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${M(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${M(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var Qa={};an(Qa,{ar:()=>qS,az:()=>FS,be:()=>HS,bg:()=>KS,bn:()=>WS,ca:()=>YS,ckb:()=>e0,cs:()=>n0,da:()=>o0,de:()=>a0,el:()=>c0,en:()=>Ol,eo:()=>u0,es:()=>m0,fa:()=>p0,fi:()=>g0,fr:()=>y0,frCA:()=>$0,gu:()=>S0,he:()=>k0,hi:()=>R0,hr:()=>x0,hu:()=>P0,hy:()=>O0,id:()=>j0,is:()=>M0,it:()=>U0,ja:()=>q0,ka:()=>F0,kh:()=>B0,km:()=>Nl,kn:()=>J0,ko:()=>G0,lt:()=>Y0,mk:()=>ew,ms:()=>nw,ne:()=>ow,nl:()=>aw,nn:()=>cw,no:()=>uw,ota:()=>mw,pl:()=>gw,ps:()=>pw,pt:()=>yw,ptBR:()=>$w,ro:()=>Sw,ru:()=>zw,sk:()=>Iw,sl:()=>Tw,sv:()=>Ew,ta:()=>Ow,tg:()=>jw,th:()=>Mw,tk:()=>Uw,tr:()=>qw,ua:()=>Fw,uk:()=>jl,ur:()=>Bw,uz:()=>Jw,vi:()=>Gw,yo:()=>tk,zhCN:()=>Xw,zhTW:()=>Qw});var Wg=G(()=>{VS();ZS();JS();GS();XS();QS();t0();r0();i0();s0();l0();Jg();d0();f0();h0();v0();_0();b0();w0();z0();I0();T0();E0();N0();A0();D0();L0();V0();Z0();H0();Kg();K0();W0();Q0();tw();rw();iw();sw();lw();dw();fw();hw();vw();_w();bw();ww();Rw();xw();Pw();Cw();Nw();Aw();Dw();Lw();Vw();Zw();Gg();Hw();Kw();Ww();Yw();ek();nk()});function Ml(){return new Al}var rk,Xg,Yg,Al,ut,es=G(()=>{Xg=Symbol("ZodOutput"),Yg=Symbol("ZodInput"),Al=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(rk=globalThis).__zod_globalRegistry??(rk.__zod_globalRegistry=Ml());ut=globalThis.__zod_globalRegistry});function EO(e,t){try{return Ul(e,{assertOnly:!0})}catch{return t}}function nv(e,t){try{let r=Ul(e),o=Dl(e,r);return o._zod.bag.validator=EO(e,r),o}catch(r){if(t?.strict)throw r;return e}}function Dl(e,t){if(El(e))throw new je("a schema whose subtree contains a reference cycle");let r=Le(e),o=e._zod.run,n=o.__originalRun??o,i=(a,s)=>{if(s?.async||s?.direction==="backward"||s?.skipChecks||s?.[ok]||s&&Cl(s,a.value))return n(a,s);let c=t(a.value);return c!==$t?(a.value=c,a):(s&&(s[ok]=!0),n(a,s))};return i.__originalRun=n,r._zod.bag.fallbackRun=n,r._zod.bag.validator=t,r._zod.run=i,o.__originalRun||CO(r,e,t),r}function CO(e,t,r){let o=e,n=t;if(typeof n.safeParse=="function"){let i=n.safeParse;o.safeParse=(a,s)=>{let c=r(a);return c!==$t?{success:!0,data:c}:i(a,s)}}if(typeof n.parse=="function"){let i=n.parse;o.parse=(a,s)=>{let c=r(a);return c!==$t?c:i(a,s)}}}function Ul(e,t){let r=!0;try{r=El(e)}catch{}if(r)throw new je("a schema whose subtree contains a reference cycle");let o={constants:new Map,constantCounter:0,varCounter:0,definite:!0},n=new Kr(["input"]),i=Je(n,o,e,"input",!t?.assertOnly);n.write(i===null?"return true;":`return ${i};`);let a=["INVALID",...o.constants.keys()],s=[$t,...o.constants.values()],c=n.content.join(`
|
|
59
|
+
`),l=t?.debug?a.length>0?`// Constants: ${a.join(", ")}
|
|
60
|
+
${c}`:c:"",u=Function,d=`return (input) => {
|
|
61
|
+
${c}
|
|
62
|
+
}`,m;try{m=new u(...a,d)(...s)}catch(f){throw new je(`this schema (generated code failed to evaluate: ${f.message})`)}return t?.debug&&(m.code=l),m.definite=o.definite,m}function we(e,t){for(let[o,n]of e.constants)if(n===t)return o;let r=`c${e.constantCounter++}`;return e.constants.set(r,t),r}function Xr(e,t){return e.definite=!1,we(e,t)}function $e(e){return`v${e.varCounter++}`}function OO(e,t){let r=e._zod.run({value:t,issues:[]},{});if(r&&typeof r.then=="function")return $t;let o=r;return o.issues.length===0?o.value:$t}function ft(e,t,r,o,n=!0){let i=e.content.length,a=t.constants.size,s=t.constantCounter,c=t.varCounter;try{return Je(e,t,r,o,n)}catch(l){if(!(l instanceof je)||!l.islandable)throw l;if(e.content.length=i,t.constants.size>a){let u=Array.from(t.constants.keys()).slice(a);for(let d of u)t.constants.delete(d)}return t.constantCounter=s,t.varCounter=c,NO(e,t,r,o)}}function NO(e,t,r,o){t.definite=!1;let n=we(t,r),i=we(t,OO),a=$e(t);return e.write(`const ${a} = ${i}(${n}, ${o});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function AO(e,t,r,o){let n=r._zod.def.checks;if(!n||n.length===0)return o;let i=o;for(let a of n){let s=a._zod.def;if(s.when&&!jO.has(s.check))throw new je('check with a custom "when" condition');switch(s.check){case"greater_than":MO(e,t,s,i);break;case"less_than":DO(e,t,s,i);break;case"multiple_of":UO(e,t,s,i);break;case"number_format":uk(e,s,i);break;case"min_length":{let c=tr(s.minimum,"min_length"),l=Qg(e,t,i,`${i}.length >= ${c} && ${i}.length < ${s.minimum*2}`);e.write(`if (${l} < ${c}) return INVALID;`);break}case"max_length":{let c=tr(s.maximum,"max_length"),l=Qg(e,t,i,`${i}.length > ${c}`);e.write(`if (${l} > ${c}) return INVALID;`);break}case"length_equals":{let c=tr(s.length,"length_equals"),l=Qg(e,t,i,`${i}.length >= ${c} && ${i}.length <= ${s.length*2}`);e.write(`if (${l} !== ${c}) return INVALID;`);break}case"min_size":e.write(`if (${i}.size < ${tr(s.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${i}.size > ${tr(s.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${i}.size !== ${tr(s.size,"size_equals")}) return INVALID;`);break;case"string_format":i=dk(e,t,s,i);break;case"custom":i=BO(e,t,a,i);break;case"bigint_format":LO(e,s,i);break;case"mime_type":qO(e,t,s,i);break;case"property":FO(e,t,s,i);break;case"properties":VO(e,t,s,i);break;case"overwrite":{let c=$e(t);ZO(e,t,a,i,c),i=c;break}default:throw new je(`check type ${s.check}`)}}return i}function Qg(e,t,r,o){let n=we(t,Br),i=$e(t);return e.write(`const ${i} = typeof ${r} === "string" && ${o} ? ${n}(${r}) : ${r}.length;`),i}function tr(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new je(`${t} bound of type ${typeof e}`);return`${e}`}function lk(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new je("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new je("comparison check with Invalid Date bound");return we(e,t)}throw new je(`comparison check bound of type ${typeof t}`)}function MO(e,t,r,o){let n=r.inclusive?"<":"<=";e.write(`if (${o} ${n} ${lk(t,r.value)}) return INVALID;`)}function DO(e,t,r,o){let n=r.inclusive?">":">=";e.write(`if (${o} ${n} ${lk(t,r.value)}) return INVALID;`)}function UO(e,t,r,o){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new je("multiple_of check with a zero divisor");e.write(`if (${o} % ${r.value}n !== 0n) return INVALID;`)}else{let n=we(t,Sa);e.write(`if (${n}(${o}, ${tr(r.value,"multiple_of")}) !== 0) return INVALID;`)}}function uk(e,t,r){let o=t.format;switch(o){case"safeint":e.write(`if (!Number.isSafeInteger(${r})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${r}) || ${r} < -2147483648 || ${r} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${r}) || ${r} < 0 || ${r} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${r}) || ${r} < -3.4028234663852886e38 || ${r} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${r})) return INVALID;`);break;default:throw new je(`number format ${o}`)}}function LO(e,t,r){let o=t.format;if(o)switch(o){case"int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break;default:throw new je(`bigint format ${o}`)}}function qO(e,t,r,o){let n=r.mime;if(n&&n.length>0){let i=we(t,new Set(n));e.write(`if (!${i}.has(${o}.type)) return INVALID;`)}}function VO(e,t,r,o){if(r.when)throw new je('check with a custom "when" condition');e.write(`if (${o} == null) return INVALID;`);let n=r.shape;for(let i of Reflect.ownKeys(n)){let a=typeof i=="symbol"?we(t,i):yt(i),s=$e(t);e.write(`const ${s} = ${o}[${a}];`),ft(e,t,n[i],s,!1)}}function FO(e,t,r,o){let n=`${o}[${JSON.stringify(r.property)}]`;Je(e,t,r.schema,n)}function ZO(e,t,r,o,n){let i=r._zod.def.tx;if(!i)throw new je("overwrite check without a transform function");if(Yr(i))throw new cn("z.compile: async overwrite transforms are not supported");let a=we(t,i);e.write(`const ${n} = ${a}(${o});`)}function ev(){throw new Tt}function rv(e){this.issues.push(e)}function BO(e,t,r,o){let n=r._zod.def;if(n.fn){if(Yr(n.fn))throw new cn("z.compile: async .refine() predicates are not supported");let i=Xr(t,n.fn),a=we(t,ev),s=$e(t);return e.write(`const ${s} = ${i}(${o});`),e.write(`if (${s} instanceof Promise) ${a}();`),e.write(`if (!${s}) return INVALID;`),o}if(r._zod.check){if(Yr(r._zod.check))throw new cn("z.compile: async .superRefine() / check functions are not supported");let i=r._zod.check,s=Xr(t,l=>{let u={value:l,issues:[],addIssue:rv};return i(u)instanceof Promise&&ev(),u.issues.length===0?u.value:$t}),c=$e(t);return e.write(`const ${c} = ${s}(${o});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new je("custom check without a predicate or check function")}function dk(e,t,r,o,n=!0){let i=r.format;if(i==="base64"){let l=we(t,Fa);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(i==="base64url"){let l=we(t,yl);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(i==="jwt"){let l=we(t,bl),u=we(t,r.alg??null);return e.write(`if (!${l}(${o}, ${u})) return INVALID;`),o}if(i==="ipv6"){let l=we(t,Va);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(i==="cidrv6"){let l=we(t,gl);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(i==="credit_card"){let l=we(t,_l);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(i==="iban"){let l=we(t,$l);return e.write(`if (!${l}(${o})) return INVALID;`),o}let a=r;if(i==="url"||i==="httpurl"||a.normalize||a.hostname!==void 0||a.protocol!==void 0){let l=we(t,fl),u=we(t,r),d=$e(t),m=$e(t);if(e.write(`const ${d} = ${o}.trim();`),e.write(`const ${m} = ${l}(${d}, ${u});`),e.write(`if (typeof ${m} === "number") return INVALID;`),a.hostname!==void 0){let y=we(t,pl);e.write(`if (!${y}(${m}, ${u}.hostname)) return INVALID;`)}if(a.protocol!==void 0){let y=we(t,hl);e.write(`if (!${y}(${m}, ${u}.protocol)) return INVALID;`)}if(!n)return null;let f=$e(t),h=a.normalize?`${m}.href`:`${we(t,qa)}(${d})`;return e.write(`const ${f} = ${h};`),f}let s=r.fn;if(s){if(Yr(s))throw new je(`async string format ${i}`);let l=we(t,s);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(HO.has(i)&&r.pattern){let l=we(t,r.pattern);return e.write(`${l}.lastIndex = 0;`),e.write(`if (!${l}.test(${o})) return INVALID;`),o}let c=r.format;switch(c){case"regex":throw new je("regex format without a pattern");case"lowercase":e.write(`if (${o} !== ${o}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${o} !== ${o}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${o}.includes(${yt(r.includes)})) return INVALID;`);break;case"starts_with":{let l=r.prefix;e.write(`if (${o}.slice(0, ${l.length}) !== ${yt(l)}) return INVALID;`);break}case"ends_with":{let l=r.suffix;e.write(`if (${o}.slice(-${l.length}) !== ${yt(l)}) return INVALID;`);break}default:throw new je(`string format ${c}`)}return o}function Je(e,t,r,o,n=!0){let i=r._zod.def,a=i.type;if(i.coerce)throw new je(`coercion (z.coerce.${a}())`);let s=n||!!i.checks?.length,c;switch(a){case"string":c=JO(e,t,r,o,s);break;case"number":c=KO(e,r,o);break;case"boolean":c=GO(e,o);break;case"bigint":c=WO(e,r,o);break;case"symbol":c=XO(e,o);break;case"undefined":c=YO(e,o);break;case"null":c=QO(e,o);break;case"any":case"unknown":c=o;break;case"never":e.write("return INVALID;"),c=o;break;case"void":c=eN(e,o);break;case"nan":c=tN(e,o);break;case"date":c=nN(e,o);break;case"object":c=rN(e,t,r,o,s);break;case"optional":c=oN(e,t,r,o,s);break;case"nullable":c=sN(e,t,r,o,s);break;case"array":c=cN(e,t,r,o,s);break;case"literal":c=lN(e,t,r,o);break;case"enum":c=uN(e,t,r,o);break;case"readonly":{let l=ak(e,t,r,o),u=$e(t);e.write(`const ${u} = Object.freeze(${l});`),c=u;break}case"success":ak(e,t,r,o),c="true";break;case"default":case"prefault":c=dN(e,t,r,o);break;case"nonoptional":c=mN(e,t,r,o);break;case"tuple":c=fN(e,t,r,o);break;case"union":c=pN(e,t,r,o);break;case"intersection":c=vN(e,t,r,o);break;case"record":c=yN(e,t,r,o);break;case"map":c=$N(e,t,r,o);break;case"set":c=bN(e,t,r,o);break;case"file":c=SN(e,o);break;case"template_literal":c=wN(e,t,r,o);break;case"lazy":c=kN(e,t,r,o);break;case"pipe":c=zN(e,t,r,o);break;case"custom":c=RN(e,t,r,o);break;case"transform":c=TN(e,t,r,o);break;case"catch":c=xN(e,t,r,o);break;default:throw new je(`schema type ${a}`)}return c===null?null:AO(e,t,r,c)}function JO(e,t,r,o,n=!0){e.write(`if (typeof ${o} !== "string") return INVALID;`);let i=r._zod.def;return i.format===void 0?o:dk(e,t,i,o,n)}function KO(e,t,r){e.write(`if (typeof ${r} !== "number" || !Number.isFinite(${r})) return INVALID;`);let o=t._zod.def;return o.check==="number_format"&&o.format&&uk(e,{format:o.format},r),r}function GO(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function WO(e,t,r){e.write(`if (typeof ${r} !== "bigint") return INVALID;`);let o=t._zod.def;if(o.format)switch(o.format){case"int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break}return r}function XO(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function YO(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function QO(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function eN(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function tN(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function nN(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function rN(e,t,r,o,n=!0){let i=r._zod.def;e.write(`if (typeof ${o} !== "object" || ${o} === null || Array.isArray(${o})) return INVALID;`);let a=i.shape,s=Object.keys(a),c=Object.getOwnPropertySymbols(a),l=c.length?[...s,...c]:s,u=b=>typeof b=="symbol"?we(t,b):yt(b),d=b=>typeof b=="symbol"?`[${u(b)}]`:yt(b),m=a;if(s.includes("__proto__"))throw new je('object shape key "__proto__"');let f=new Map;for(let b of l){let g=m[b],S=u(b),T=$e(t);if(e.write(`const ${T} = ${o}[${S}];`),g._zod.optin!==void 0){let R=$e(t);e.write(`let ${R} = (() => {`),e.indented(w=>{let z=ft(w,t,g,T);w.write(`return ${z};`)}),e.write("})();"),g._zod.optout==="optional"?(e.write(`if (${R} === INVALID) {`),e.indented(w=>{w.write(`if (${S} in ${o}) return INVALID;`),w.write(`${R} = undefined;`)}),e.write("}")):e.write(`if (${R} === INVALID) return INVALID;`),f.set(b,R)}else{aN(g)&&e.write(`if (!(${S} in ${o})) return INVALID;`);let R=ft(e,t,g,T,n);R!==null&&f.set(b,R)}}let h=i.catchall,y="none";if(h){let b=h._zod.def.type;if(b==="never"){let g=s.map(S=>`k !== ${yt(S)}`).join(" && ")||"true";e.write(`for (const k in ${o}) {`),e.indented(S=>{S.write(`if (${g}) return INVALID;`)}),e.write("}")}else(b==="unknown"||b==="any")&&!h._zod.def.checks?.length?y="passthrough":y="schema"}let v=$e(t),p=l.some(b=>ik(m[b])||tv(m[b]));if(!n){if(y==="schema"){let b=s.length>0?we(t,new Set(s)):null;e.write(`for (const k in ${o}) {`),e.indented(g=>{g.write('if (k === "__proto__") continue;'),b&&g.write(`if (${b}.has(k)) continue;`);let S=$e(t);g.write(`const ${S} = ${o}[k];`),ft(g,t,h,S,!1)}),e.write("}")}return null}if(p){e.write(`const ${v} = {};`);for(let b of l){let g=u(b),S=f.get(b);tv(m[b])?e.write(`if (${g} in ${o}) ${v}[${g}] = ${S};`):ik(m[b])?e.write(`if (${S} !== undefined || ${g} in ${o}) ${v}[${g}] = ${S};`):e.write(`${v}[${g}] = ${S};`)}}else{let b=l.map(g=>`${d(g)}: ${f.get(g)}`).join(", ");e.write(`const ${v} = { ${b} };`)}if(y!=="none"){let b=s.length>0?we(t,new Set(s)):null;e.write(`for (const k in ${o}) {`),e.indented(g=>{if(g.write('if (k === "__proto__") continue;'),b&&g.write(`if (${b}.has(k)) continue;`),y==="passthrough")g.write(`${v}[k] = ${o}[k];`);else{let S=$e(t);g.write(`const ${S} = ${o}[k];`);let T=ft(g,t,h,S);g.write(`${v}[k] = ${T};`)}}),e.write("}")}return v}function oN(e,t,r,o,n=!0){let i=r._zod.def;if(iN(r))return Je(e,t,i.innerType,o,n);if(i.innerType._zod.optin==="defaulted"){let s=$e(t),c=$e(t);return e.write(`let ${s};`),e.write(`if (${o} === undefined) {`),e.indented(l=>{l.write(`const ${c} = (() => {`),l.indented(u=>{let d=Je(u,t,i.innerType,o);u.write(`return ${d};`)}),l.write("})();"),l.write(`if (${c} !== INVALID) ${s} = ${c};`)}),e.write("} else {"),e.indented(l=>{let u=Je(l,t,i.innerType,o);l.write(`${s} = ${u};`)}),e.write("}"),s}let a=n?$e(t):null;return a&&e.write(`let ${a};`),e.write(`if (${o} !== undefined) {`),e.indented(s=>{let c=Je(s,t,i.innerType,o,n);a&&c!==null&&s.write(`${a} = ${c};`)}),e.write("}"),a}function iN(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function aN(e){return e._zod.optin===void 0&&Wr(e)}function Wr(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?Wr(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?Wr(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(Wr):!0;case"intersection":return!t.left||!t.right?!0:Wr(t.left)&&Wr(t.right);case"pipe":return t.in?Wr(t.in):!0;default:return!0}}function tv(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function ik(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&Bo(e)}function Bo(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?Bo(t.innerType):!0;case"union":return t.options?t.options.some(Bo):!0;case"intersection":return!t.left||!t.right||Bo(t.left)||Bo(t.right);case"pipe":return t.out?Bo(t.out):!0;default:return!0}}function sN(e,t,r,o,n=!0){let i=r._zod.def,a=n?$e(t):null;return a&&e.write(`let ${a} = null;`),e.write(`if (${o} !== null) {`),e.indented(s=>{let c=Je(s,t,i.innerType,o,n);a&&c!==null&&s.write(`${a} = ${c};`)}),e.write("}"),a}function ov(e,t,r){for(let[o,n]of No(t._zod.def.checks))e.write(`if (${r} > ${tr(o,n._zod.def.check)}) return INVALID;`)}function cN(e,t,r,o,n=!0){let i=r._zod.def;e.write(`if (!Array.isArray(${o})) return INVALID;`),ov(e,r,`${o}.length`);let a=n?$e(t):null,s=$e(t),c=$e(t);return a&&e.write(`const ${a} = new Array(${o}.length);`),e.write(`for (let ${s} = 0; ${s} < ${o}.length; ${s}++) {`),e.indented(l=>{l.write(`const ${c} = ${o}[${s}];`);let u=ft(l,t,i.element,c,n);a&&u!==null&&l.write(`${a}[${s}] = ${u};`)}),e.write("}"),a}function lN(e,t,r,o){let i=r._zod.def.values;if(i.length!==1){let s=we(t,new Set(i));return e.write(`if (!${s}.has(${o})) return INVALID;`),o}let a=i[0];if(typeof a=="number"&&Number.isNaN(a)){let s=we(t,new Set(i));return e.write(`if (!${s}.has(${o})) return INVALID;`),o}if(typeof a=="string")e.write(`if (${o} !== ${yt(a)}) return INVALID;`);else if(typeof a=="number"||typeof a=="boolean")e.write(`if (${o} !== ${a}) return INVALID;`);else if(a===null)e.write(`if (${o} !== null) return INVALID;`);else if(a===void 0)e.write(`if (${o} !== undefined) return INVALID;`);else if(typeof a=="bigint")e.write(`if (${o} !== ${a}n) return INVALID;`);else throw new je(`literal type ${typeof a}`);return o}function uN(e,t,r,o){let n=r._zod.values;if(!n)throw new je("enum schema without enumerated values");let i=we(t,n);return e.write(`if (!${i}.has(${o})) return INVALID;`),o}function ak(e,t,r,o){let n=r._zod.def;return Je(e,t,n.innerType,o)}function dN(e,t,r,o){let n=r._zod.def,a=Object.getOwnPropertyDescriptor(r._zod.def,"defaultValue")?()=>r._zod.def.defaultValue:void 0;if(r._zod.def.type==="prefault"){if(!a)return Je(e,t,n.innerType,o);let c=we(t,a),l=$e(t);return e.write(`let ${l} = ${o};`),e.write(`if (${o} === undefined) ${l} = ${c}();`),Je(e,t,n.innerType,l)}let s=$e(t);if(a){let c=we(t,a),l=we(t,wa);e.write(`let ${s};`),e.write(`if (${o} === undefined) {`),e.indented(u=>{u.write(`${s} = ${l}(${c}());`)}),e.write("} else {"),e.indented(u=>{let d=Je(u,t,n.innerType,o);u.write(`${s} = ${d} === undefined ? ${l}(${c}()) : ${d};`)}),e.write("}")}else e.write(`let ${s};`),e.write(`if (${o} !== undefined) {`),e.indented(c=>{let l=Je(c,t,n.innerType,o);c.write(`${s} = ${l};`)}),e.write("}");return s}function mN(e,t,r,o){let n=r._zod.def,i=Je(e,t,n.innerType,o),a=$e(t);return e.write(`const ${a} = ${i};`),e.write(`if (${a} === undefined) return INVALID;`),a}function fN(e,t,r,o){let n=r._zod.def,i=n.items,a=n.rest;e.write(`if (!Array.isArray(${o})) return INVALID;`);let s=sk(i,"optin"),c=sk(i,"optout");a?e.write(`if (${o}.length < ${s}) return INVALID;`):e.write(`if (${o}.length < ${s} || ${o}.length > ${i.length}) return INVALID;`);let l=$e(t);e.write(`const ${l} = [];`);for(let u=0;u<i.length;u++){let d=i[u];if(u>=c)e.write(`if (${l}.length === ${u}) {`),e.indented(m=>{m.write(`if (${u} < ${o}.length) {`),m.indented(f=>{let h=$e(t);f.write(`const ${h} = ${o}[${u}];`);let y=ft(f,t,d,h);f.write(`${l}[${u}] = ${y};`)}),m.write("} else {"),m.indented(f=>{if(tv(d)){f.write(`${l}.length = ${u};`);return}let h=$e(t),y=$e(t);f.write(`const ${h} = undefined;`),f.write(`const ${y} = (() => {`),f.indented(v=>{let p=ft(v,t,d,h);v.write(`return ${p};`)}),f.write("})();"),f.write(`if (${y} === INVALID || ${y} === undefined) ${l}.length = ${u};`),f.write(`else ${l}[${u}] = ${y};`)}),m.write("}")}),e.write("}");else{let m=$e(t);e.write(`const ${m} = ${o}[${u}];`);let f=ft(e,t,d,m);e.write(`${l}[${u}] = ${f};`)}}if(a){let u=$e(t),d=$e(t);e.write(`for (let ${u} = ${i.length}; ${u} < ${o}.length; ${u}++) {`),e.indented(m=>{m.write(`const ${d} = ${o}[${u}];`);let f=ft(m,t,a,d);m.write(`${l}[${u}] = ${f};`)}),e.write("}")}return l}function sk(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function pN(e,t,r,o){let n=r._zod.def,i=n.options;if(n.discriminator)return hN(e,t,n,o);if(n.inclusive===!1)throw new je("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),o;if(i.length===1)return Je(e,t,i[0],o);if(i.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(i.flatMap(u=>u._zod.def.values)),l=we(t,c);return e.write(`if (!${l}.has(${o})) return INVALID;`),o}let s=$e(t);e.write(`let ${s};`);for(let c=0;c<i.length;c++){let l=i[c];c===0?e.write(`${s} = (() => {`):e.write(`if (${s} === INVALID) ${s} = (() => {`),e.indented(u=>{let d=Je(u,t,l,o);u.write(`return ${d};`)}),e.write("})();")}return e.write(`if (${s} === INVALID) return INVALID;`),s}function hN(e,t,r,o){if(r.unionFallback)throw new je("discriminated union with unionFallback");if(r.options.length===0)return e.write("return INVALID;"),o;let n=$e(t),i=$e(t);e.write(`const ${n} = ${o}?.[${yt(r.discriminator)}];`),e.write(`let ${i};`);let a=!0,s=new Set;for(let c of r.options){let l=c._zod.propValues?.[r.discriminator];if(!l||l.size===0)throw new je("discriminated union option without static discriminator values");for(let m of l){if(s.has(m))throw new je(`duplicate discriminator value ${String(m)}`);s.add(m)}let u=Array.from(l,m=>gN(t,n,m)),d=a?"if":"else if";e.write(`${d} (${u.join(" || ")}) {`),e.indented(m=>{let f=Je(m,t,c,o);m.write(`${i} = ${f};`)}),e.write("}"),a=!1}return e.write("else { return INVALID; }"),i}function gN(e,t,r){if(typeof r=="string")return`${t} === ${yt(r)}`;if(typeof r=="number")return Number.isNaN(r)?`Number.isNaN(${t})`:`${t} === ${r}`;if(typeof r=="boolean")return`${t} === ${r}`;if(r===null)return`${t} === null`;if(r===void 0)return`${t} === undefined`;if(typeof r=="bigint")return`${t} === ${r}n`;if(typeof r=="symbol"){let o=we(e,r);return`${t} === ${o}`}throw new je(`literal discriminator value ${String(r)}`)}function vN(e,t,r,o){let n=r._zod.def;t.definite=!1;let i=ft(e,t,n.left,o),a=ft(e,t,n.right,o),s=we(t,qo),c=$e(t);return e.write(`const ${c} = ${s}(${i}, ${a});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function yN(e,t,r,o){let n=r._zod.def,i=we(t,Jt);e.write(`if (!${i}(${o})) return INVALID;`);let a=$e(t),s=$e(t),c=$e(t);e.write(`const ${a} = {};`);let l=n,u=l.partial?void 0:n.keyType._zod.values;if(u){let f=[];for(let y of u){if(!(typeof y=="string"||typeof y=="number"||typeof y=="symbol"))throw new je(`record key value ${String(y)}`);let v=typeof y=="number"?y.toString():y;if(v==="__proto__")throw new je('record key "__proto__"');f.push(v);let p=we(t,y),b=Je(e,t,n.keyType,p),g=$e(t);e.write(`const ${g} = ${o}[${_N(t,v)}];`);let S=ft(e,t,n.valueType,g);e.write(`${a}[${b}] = ${S};`)}let h=we(t,new Set(f));return e.write(`for (const ${s} in ${o}) {`),e.indented(y=>{y.write(`if (${h}.has(${s})) continue;`),l.mode==="loose"?y.write(`if (${s} !== "__proto__") ${a}[${s}] = ${o}[${s}];`):y.write("return INVALID;")}),e.write("}"),a}let d=n.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let f=n.mode==="loose",h=Ul(n.keyType);h.definite===!1&&(t.definite=!1);let y=we(t,h),v=we(t,En),p=$e(t);return ck(e,t,o,s,b=>{b.write(`let ${p} = ${y}(${s});`),b.write(`if (${p} === INVALID && typeof ${s} === "string" && ${v}.test(${s})) ${p} = ${y}(Number(${s}));`),f?b.write(`if (${p} === INVALID) { ${a}[${s}] = ${o}[${s}]; continue; }`):b.write(`if (${p} === INVALID) return INVALID;`),b.write(`if (${p} === "__proto__") continue;`);let g=$e(t);b.write(`const ${g} = ${o}[${s}];`);let S=ft(b,t,n.valueType,g);b.write(`${a}[${p}] = ${S};`)}),a}return ck(e,t,o,s,f=>{f.write(`const ${c} = ${o}[${s}];`);let h=ft(f,t,n.valueType,c);f.write(`${a}[${s}] = ${h};`)},"return INVALID;"),a}function ck(e,t,r,o,n,i){let a=we(t,Object.prototype.propertyIsEnumerable),s=$e(t),c=$e(t),l=$e(t);e.write(`const ${s} = Object.getOwnPropertySymbols(${r});`),e.write(`const ${c} = Object.getOwnPropertyNames(${r});`),e.write(`for (let ${l} = 0; ${l} < ${c}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${o} = ${c}[${l}];`),u.write(`if (${o} === "__proto__" || !${a}.call(${r}, ${o})) continue;`),n(u)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${s}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${o} = ${s}[${l}];`),u.write(`if (!${a}.call(${r}, ${o})) continue;`),i?u.write(i):n(u)}),e.write("}")}function _N(e,t){return typeof t=="string"?yt(t):we(e,t)}function $N(e,t,r,o){let n=r._zod.def;e.write(`if (!(${o} instanceof Map)) return INVALID;`),ov(e,r,`${o}.size`);let i=$e(t),a=$e(t),s=$e(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${a}, ${s}] of ${o}) {`),e.indented(c=>{let l=Je(c,t,n.keyType,a),u=Je(c,t,n.valueType,s);c.write(`${i}.set(${l}, ${u});`)}),e.write("}"),i}function bN(e,t,r,o){let n=r._zod.def;e.write(`if (!(${o} instanceof Set)) return INVALID;`),ov(e,r,`${o}.size`);let i=$e(t),a=$e(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${a} of ${o}) {`),e.indented(s=>{let c=Je(s,t,n.valueType,a);s.write(`${i}.add(${c});`)}),e.write("}"),i}function SN(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function wN(e,t,r,o){e.write(`if (typeof ${o} !== "string") return INVALID;`);let n=r._zod.pattern;if(n){let i=we(t,n);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${o})) return INVALID;`)}return o}function kN(e,t,r,o){let n=r._zod.def,i=Xr(t,n.getter),a=we(t,{parser:null});e.write(`if (!${a}.parser) {`),e.indented(c=>{c.write(`const inner = ${i}();`),c.write(`${a}.parser = function(input) {`),c.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let s=$e(t);return e.write(`const ${s} = ${a}.parser(${o});`),e.write(`if (${s} === INVALID) return INVALID;`),s}function zN(e,t,r,o){let n=r._zod.def,i=Je(e,t,n.in,o);if(n.transform){if(Yr(n.transform))throw new cn("z.compile: async transforms in pipes are not supported");let a=n.transform,c=Xr(t,u=>{let d={value:u,issues:[],addIssue:rv},m=a(u,d);return m instanceof Promise?$t:d.issues.length===0?m:$t}),l=$e(t);return e.write(`const ${l} = ${c}(${i});`),e.write(`if (${l} === INVALID) return INVALID;`),Je(e,t,n.out,l)}else return Je(e,t,n.out,i)}function Yr(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function RN(e,t,r,o){let n=r._zod.def;if(n.fn){if(Yr(n.fn))throw new cn("z.compile: async custom predicates are not supported");let i=Xr(t,n.fn),a=we(t,ev),s=$e(t);e.write(`const ${s} = ${i}(${o});`),e.write(`if (${s} instanceof Promise) ${a}();`),e.write(`if (!${s}) return INVALID;`)}else throw new je("custom schema without a predicate function");return o}function IN(e,t,r){let o=e._zod.run({value:r,issues:[]},{});if(o&&typeof o.then=="function")return $t;let n=o;return n.issues.length===0?n.value:t()}function xN(e,t,r,o){let n=r._zod.def;if(!n.catchValue[Vc])throw new je("catch with a callback (only a constant catch value compiles)",!1);let i=$e(t);e.write(`let ${i} = (() => {`),e.indented(l=>{let u=ft(l,t,n.innerType,o);l.write(`return ${u};`)}),e.write("})();");let a=we(t,n.innerType),s=Xr(t,n.catchValue),c=we(t,IN);return e.write(`if (${i} === INVALID) {`),e.indented(l=>{l.write(`${i} = ${c}(${a}, ${s}, ${o});`),l.write(`if (${i} === INVALID) return INVALID;`)}),e.write("}"),i}function TN(e,t,r,o){let n=r._zod.def;if(n.transform){if(Yr(n.transform))throw new cn("z.compile: async transforms are not supported");let i=n.transform,s=Xr(t,l=>{let u={value:l,issues:[],addIssue:rv},d=i(l,u);return d instanceof Promise?$t:u.issues.length===0?d:$t}),c=$e(t);return e.write(`const ${c} = ${s}(${o});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return o}var $t,ok,cn,je,jO,HO,mk=G(()=>{Qn();sl();Hg();Jr();Vo();ie();$t=Symbol.for("zod.compile.invalid"),ok=Symbol.for("zod.compile.fallback"),cn=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},je=class extends Error{constructor(t,r=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=r}};jO=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);HO=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"])});function Ll(e){return e.checks&&(e.checks=[...e.checks]),e}function iv(e,t){return new e(Ll({type:"string",...te(t)}))}function av(e,t){return new e(Ll({type:"string",coerce:!0,...te(t)}))}function ql(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...te(t)})}function Vl(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...te(t)})}function Fl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...te(t)})}function Zl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...te(t)})}function Bl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...te(t)})}function Hl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...te(t)})}function ts(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...te(t)})}function Jl(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...te(t)})}function Kl(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...te(t)})}function Gl(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...te(t)})}function Wl(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...te(t)})}function Xl(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...te(t)})}function Yl(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...te(t)})}function Ql(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...te(t)})}function eu(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...te(t)})}function tu(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...te(t)})}function sv(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...te(t)})}function nu(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...te(t)})}function ru(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...te(t)})}function ou(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...te(t)})}function iu(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...te(t)})}function au(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...te(t)})}function cv(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...te(t)})}function lv(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...te(t)})}function su(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...te(t)})}function ns(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...te(t)})}function rs(e,t){return new e({type:"string",format:"date",check:"string_format",...te(t)})}function os(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...te(t)})}function is(e,t){return new e({type:"string",format:"duration",check:"string_format",...te(t)})}function dv(e,t){return new e(Ll({type:"number",checks:[],...te(t)}))}function mv(e,t){return new e(Ll({type:"number",coerce:!0,checks:[],...te(t)}))}function fv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...te(t)})}function pv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...te(t)})}function hv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...te(t)})}function gv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...te(t)})}function vv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...te(t)})}function yv(e,t){return new e({type:"boolean",...te(t)})}function _v(e,t){return new e({type:"boolean",coerce:!0,...te(t)})}function $v(e,t){return new e({type:"bigint",...te(t)})}function bv(e,t){return new e({type:"bigint",coerce:!0,...te(t)})}function Sv(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...te(t)})}function wv(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...te(t)})}function kv(e,t){return new e({type:"symbol",...te(t)})}function zv(e,t){return new e({type:"undefined",...te(t)})}function Rv(e,t){return new e({type:"null",...te(t)})}function Iv(e){return new e({type:"any"})}function xv(e){return new e({type:"unknown"})}function Tv(e,t){return new e({type:"never",...te(t)})}function Pv(e,t){return new e({type:"void",...te(t)})}function Ev(e,t){return new e({type:"date",...te(t)})}function Cv(e,t){return new e({type:"date",coerce:!0,...te(t)})}function Ov(e,t){return new e({type:"nan",...te(t)})}function $n(e,t){return new ol({check:"less_than",...te(t),value:e,inclusive:!1})}function At(e,t){return new ol({check:"less_than",...te(t),value:e,inclusive:!0})}function bn(e,t){return new il({check:"greater_than",...te(t),value:e,inclusive:!1})}function Mt(e,t){return new il({check:"greater_than",...te(t),value:e,inclusive:!0})}function cu(e){return bn(0,e)}function lu(e){return $n(0,e)}function uu(e){return At(0,e)}function du(e){return Mt(0,e)}function nr(e,t){return new lh({check:"multiple_of",...te(t),value:e})}function rr(e,t){return new mh({check:"max_size",...te(t),maximum:e})}function Sn(e,t){return new fh({check:"min_size",...te(t),minimum:e})}function Qr(e,t){return new ph({check:"size_equals",...te(t),size:e})}function eo(e,t){return new hh({check:"max_length",...te(t),maximum:e})}function Cn(e,t){return new gh({check:"min_length",...te(t),minimum:e})}function to(e,t){return new vh({check:"length_equals",...te(t),length:e})}function Ho(e,t){return new yh({check:"string_format",format:"regex",...te(t),pattern:e})}function Jo(e){return new _h({check:"string_format",format:"lowercase",...te(e)})}function Ko(e){return new $h({check:"string_format",format:"uppercase",...te(e)})}function Go(e,t){return new bh({check:"string_format",format:"includes",...te(t),includes:e})}function Wo(e,t){return new Sh({check:"string_format",format:"starts_with",...te(t),prefix:e})}function Xo(e,t){return new wh({check:"string_format",format:"ends_with",...te(t),suffix:e})}function mu(e,t,r){return new kh({check:"property",property:e,schema:t,...te(r)})}function Yo(e,t){return new zh({check:"properties",shape:e,...te(t)})}function Qo(e,t){return new Rh({check:"mime_type",mime:e,...te(t)})}function ln(e){return new Ih({check:"overwrite",tx:e})}function ei(e){return ln(t=>t.normalize(e))}function ti(){return ln(e=>e.trim())}function ni(){return ln(e=>e.toLowerCase())}function ri(){return ln(e=>e.toUpperCase())}function oi(){return ln(e=>up(e))}function Nv(e,t,r){return new e({type:"array",element:t,...te(r)})}function PN(e,t,r){return new e({type:"union",options:t,...te(r)})}function EN(e,t,r){return new e({type:"union",options:t,inclusive:!1,...te(r)})}function CN(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...te(o)})}function ON(e,t,r){return new e({type:"intersection",left:t,right:r})}function NN(e,t,r,o){let n=r instanceof ze,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...te(i)})}function jN(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...te(o)})}function AN(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...te(o)})}function MN(e,t,r){return new e({type:"set",valueType:t,...te(r)})}function DN(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...te(r)})}function UN(e,t,r){return new e({type:"enum",entries:t,...te(r)})}function LN(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...te(r)})}function jv(e,t){return new e({type:"file",...te(t)})}function qN(e,t){return new e({type:"transform",transform:t})}function VN(e,t){return new e({type:"optional",innerType:t})}function FN(e,t){return new e({type:"nullable",innerType:t})}function ZN(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():wa(r)}})}function BN(e,t,r){return new e({type:"nonoptional",innerType:t,...te(r)})}function HN(e,t){return new e({type:"success",innerType:t})}function JN(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:gp(r)})}function KN(e,t,r){return new e({type:"pipe",in:t,out:r})}function GN(e,t){return new e({type:"readonly",innerType:t})}function WN(e,t,r){return new e({type:"template_literal",parts:t,...te(r)})}function XN(e,t){return new e({type:"lazy",getter:t})}function YN(e,t){return new e({type:"promise",innerType:t})}function Av(e,t,r){let o=te(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Mv(e,t,r){return new e({type:"custom",check:"custom",fn:t,...te(r)})}function Dv(e,t){let r=fk(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(jo(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(jo(i))}},e(o.value,o)),t);return r}function fk(e,t){let r=new Be({check:"custom",...te(t)});return r._zod.check=e,r}function Uv(e){let t=new Be({check:"describe"});return t._zod.onattach=[r=>{let o=ut.get(r)??{};ut.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function Lv(e){let t=new Be({check:"meta"});return t._zod.onattach=[r=>{let o=ut.get(r)??{};ut.add(r,{...o,...e})}],t._zod.check=()=>{},t}function qv(e,t){let r=te(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let i=new Set(o),a=new Set(n),s=e.Codec??Ja,c=e.Boolean??Ba,l=e.String??Gr,u=new l({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),m=new s({type:"pipe",in:u,out:d,transform:((f,h)=>{let y=f;return r.case!=="sensitive"&&(y=y.toLowerCase()),i.has(y)?!0:a.has(y)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:h.value,inst:m,continue:!1}),{})}),reverseTransform:((f,h)=>f===!0?o[0]||"true":n[0]||"false"),error:r.error});return m._zod.bag.truthy=o,m._zod.bag.falsy=n,m._zod.bag.case=r.case??"insensitive",m}function no(e,t,r,o={}){let n=te(o),i={check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}var uv,pk=G(()=>{al();es();Vo();ie();uv={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function as(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,o)&<(e,o,r[o]);return e}function or(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??ut,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function nt(e,t,r,o,n){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:o.path,message:n}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(n);return Object.assign(r,i),!0}function Ve(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let u={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,u);else{let m=a.schema,f=t.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(e,t,m,u)}let d=e._zod.parent;d&&(a.ref||(a.ref=d),Ve(d,t,u),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&as(a.schema,c),t.io==="input"&&bt(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function hk(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function ir(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let c=o.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(a[0])?.id,m=e.external.uri??(h=>h);if(d)return{ref:m(d)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${s}/${hk(f)}`}}let c="#",l=`${c}/${s}/`;if(a[1]===r&&!a[1].schema.id)return{ref:c};let u=a[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+hk(u)}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:l}=n(a);s.def={...s.schema},l&&(s.defId=l);let u=s.schema;for(let d in u)delete u[d];u.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
63
|
+
|
|
64
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}s.count>1&&e.reused==="ref"&&i(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function yk(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let o of t){if(!o||typeof o!="object")return;yk(o);let n=Object.keys(o);if(n.length!==1||n[0]!=="type")return;let i=o.type;for(let a of Array.isArray(i)?i:[i]){if(typeof a!="string")return;r.includes(a)||r.push(a)}}delete e.anyOf,e.type=r.length===1?r[0]:r}function vk(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Vv(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let a in i)if(!_k.has(a))return null;t.push(i)}let r={},o=new Set;for(let i of t){for(let a in i.properties){if(Object.prototype.hasOwnProperty.call(r,a))continue;let s=[];for(let l of t){let u=l.properties?.[a]??vk(l);u!=null&&(s.some(d=>JSON.stringify(d)===JSON.stringify(u))||s.push(u))}let c=s.length===1?s[0]:Vv(s)??{allOf:s};lt(r,a,c)}for(let a of i.required??[])o.add(a)}let n={type:"object",properties:r};if(o.size&&(n.required=[...o]),t.every(i=>i.additionalProperties===!1))n.additionalProperties=!1;else{let i=[];for(let a of t){let s=vk(a);s&&!i.some(c=>JSON.stringify(c)===JSON.stringify(s))&&i.push(s)}i.length===1?n.additionalProperties=i[0]:i.length>1&&(n.additionalProperties={allOf:i})}return n}function QN(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of _k)if(n in e)return;let r=t.filter(n=>gk.some(i=>Array.isArray(n[i]))),o=null;if(!r.length)o=Vv(t);else{let n=r[0],i=gk.find(c=>Array.isArray(n[c]));if(Object.keys(n).length!==1)return;let a=t.filter(c=>c!==n),s=n[i].map(c=>Vv([...a,c]));if(s.some(c=>!c))return;o={[i]:s}}o&&(delete e.allOf,as(e,o))}function ar(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let c=e.seen.get(s);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){o(d);let f=e.seen.get(d),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(h)):as(l,h),as(l,u),s._zod.parent===d)for(let v in l)v==="$ref"||v==="allOf"||v in u||delete l[v];if(h.$ref&&f.def)for(let v in l)v==="$ref"||v==="allOf"||v in f.def&&JSON.stringify(l[v])===JSON.stringify(f.def[v])&&delete l[v]}let m=s._zod.parent;if(m&&m!==d){o(m);let f=e.seen.get(m);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}e.override({zodSchema:s,jsonSchema:l,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let s of[...e.seen.entries()].reverse())o(s[0]);if(e.target!=="openapi-3.0")for(let s of e.seen.entries())yk(s[1].def??s[1].schema);for(let s of e.deferred)s();if(e.intersections.length){let s=new Map;for(let c of e.seen.values())for(let l of[c.schema,c.def]){let u=l?.allOf;if(!Array.isArray(u))continue;let d=s.get(u);d?d.push(l):s.set(u,[l])}for(let c of e.intersections)for(let l of s.get(c)??[])QN(l)}}let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}as(n,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,lt(a,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:ii(t,"input",e.processors),output:ii(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function bt(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return bt(o.element,r);if(o.type==="set")return bt(o.valueType,r);if(o.type==="lazy")return bt(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return bt(o.innerType,r);if(o.type==="intersection")return bt(o.left,r)||bt(o.right,r);if(o.type==="record"||o.type==="map")return bt(o.keyType,r)||bt(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:bt(o.in,r)||bt(o.out,r);if(o.type==="object"){for(let n in o.shape)if(bt(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(bt(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(bt(n,r))return!0;return!!(o.rest&&bt(o.rest,r))}return!1}var _k,gk,Fv,ii,ss=G(()=>{es();ie();_k=new Set(["type","properties","required","additionalProperties"]),gk=["oneOf","anyOf"];Fv=(e,t={})=>r=>{let o=or({...r,processors:t});return Ve(e,o),ir(o,e),ar(o,e)},ii=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=or({...n??{},target:i,io:t,processors:r});return Ve(e,a),ir(a,e),ar(a,e)}});function rt(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of o)ej[i._zod.def.check]?.(t,i._zod.def);let n=e._zod.bag;n.minimum!==void 0&&ai(t,"minimum",n.minimum),n.exclusiveMinimum!==void 0&&ai(t,"exclusiveMinimum",n.exclusiveMinimum),n.maximum!==void 0&&si(t,"maximum",n.maximum),n.exclusiveMaximum!==void 0&&si(t,"exclusiveMaximum",n.exclusiveMaximum),n.multipleOf!==void 0&&kk(t,n.multipleOf),n.format!==void 0&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&Rk(t,n.mime);for(let i of n.patterns??[])zk(t,i);return t}function cs(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?cs(t.out):t.type==="catch"?cs(t.innerType):e._zod.optin}function Zv(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let h=e.get(t)?.def;if(!h)return t;let y=Zv(e,h,r);return y===h?t:y}for(let h of["anyOf","oneOf"]){let y=t[h];if(!Array.isArray(y))continue;let v=y.map(p=>Zv(e,p,r));v.some((p,b)=>p!==y[b])&&(t={...t,[h]:v})}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some(h=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!i?.some(h=>typeof h=="number"))return t;let{minimum:a,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:m,...f}=t;return f.enum?f.enum=f.enum.map(h=>typeof h=="number"?String(h):h):typeof f.const=="number"&&(f.const=String(f.const)),n&&(f.type="string",i||(f.pattern=(o.includes("number")?En:Ma).source)),f}function rj(e){let t=new Map;for(let o of e.seen.values())o.def&&!t.has(o.schema)&&t.set(o.schema,o);let r=new Map;for(let o of Bv.get(e)??[]){let n=e.seen.get(o),i=(n?.def??n?.schema)?.propertyNames;if(!i||i===!0||r.has(i))continue;let a=Zv(t,i,new Set);a!==i&&r.set(i,a)}if(r.size)for(let o of e.seen.values())for(let n of[o.schema,o.def]){let i=n&&r.get(n.propertyNames);i&&(n.propertyNames=i)}}function Tk(e,t,r,o,n){let i=!1,a=JSON.stringify(e,(s,c)=>typeof c!="bigint"?c:(i=!0,null));return i?(nt(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),Sy):JSON.parse(a)}function ro(e,t){if("_idmap"in e){let o=e,n=or({...t,processors:fu}),i={};for(let c of o._idmap.entries()){let[l,u]=c;Ve(u,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let c of o._idmap.entries()){let[l,u]=c;ir(n,u),lt(a,l,ar(n,u))}if(Object.keys(i).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:i}}return{schemas:a}}let r=or({...t,processors:fu});return Ve(e,r),ir(r,e),ar(r,e)}var ai,si,$k,kk,zk,Rk,Ik,bk,Sk,wk,ej,tj,nj,xk,Hv,Jv,Kv,Gv,Wv,Xv,Yv,Qv,ey,ty,ny,ry,oy,iy,ay,sy,cy,ly,uy,dy,my,fy,py,hy,gy,pu,vy,yy,Bv,_y,$y,by,Sy,wy,ky,zy,Ry,Iy,xy,hu,Ty,fu,ls=G(()=>{Jr();Vo();ss();ie();ai=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},si=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},$k=(e,t)=>{ai(e,"minimum",t),si(e,"maximum",t)},kk=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},zk=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Rk=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},Ik=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},bk=(e,t)=>ai(e,"minimum",t.minimum),Sk=(e,t)=>si(e,"maximum",t.maximum),wk=e=>(t,r)=>{Ik(t,r.format);let[o,n]=e[r.format];ai(t,"minimum",o),si(t,"maximum",n)},ej={greater_than:(e,t)=>ai(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>si(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>kk(e,t.value),number_format:wk(za),bigint_format:wk(Ra),min_length:bk,max_length:Sk,length_equals:(e,t)=>$k(e,t.length),min_size:bk,max_size:Sk,size_equals:(e,t)=>$k(e,t.size),string_format:(e,t)=>{Ik(e,t.format),t.pattern&&zk(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Rk(e,t.mime)};tj={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nj=new Map([[vl,Fp],[Za,Zp]]),xk=e=>nj.get(e)??e,Hv=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:c,contentEncoding:l,laxFormat:u}=rt(e);if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=tj[s]??s,n.format===""&&delete n.format,(s==="time"||u)&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let d=[...c].map(xk);d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},Jv=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=rt(e);n.type=u?"integer":"number";let d=typeof l=="number"&&l>=(i??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";if(d?f?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:typeof i=="number"&&(n.minimum=i),m?f?(n.maximum=c,n.exclusiveMaximum=!0):n.exclusiveMaximum=c:typeof a=="number"&&(n.maximum=a),s){let h=new Set;for(let p of s)Number.isFinite(p)&&p!==0?h.add(Math.abs(p)):nt(e,t,n,o,`A multipleOf divisor of ${p} cannot be represented in JSON Schema`);let[y,...v]=h;y!==void 0&&(n.multipleOf=y),v.length&&(n.allOf=[...n.allOf??[],...v.map(p=>({multipleOf:p}))])}},Kv=(e,t,r,o)=>{r.type="boolean"},Gv=(e,t,r,o)=>{nt(e,t,r,o,"BigInt cannot be represented in JSON Schema")},Wv=(e,t,r,o)=>{nt(e,t,r,o,"Symbols cannot be represented in JSON Schema")},Xv=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Yv=(e,t,r,o)=>{nt(e,t,r,o,"Undefined cannot be represented in JSON Schema")},Qv=(e,t,r,o)=>{nt(e,t,r,o,"Void cannot be represented in JSON Schema")},ey=(e,t,r,o)=>{r.not={}},ty=(e,t,r,o)=>{},ny=(e,t,r,o)=>{},ry=(e,t,r,o)=>{nt(e,t,r,o,"Date cannot be represented in JSON Schema")},oy=(e,t,r,o)=>{let n=e._zod.def,i=Po(n.entries);if(i.length===0){r.not={};return}i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},iy=(e,t,r,o)=>{let n=e._zod.def;if(n.values.length===0){r.not={};return}let i=[];for(let a of n.values)if(a===void 0){if(nt(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(nt(e,t,r,o,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},ay=(e,t,r,o)=>{nt(e,t,r,o,"NaN cannot be represented in JSON Schema")},sy=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},cy=(e,t,r,o)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:i,maximum:a,mime:s}=rt(e);i!==void 0&&(n.minLength=i),a!==void 0&&(n.maxLength=a),s&&(s.length===0?n.not={}:s.length===1?n.contentMediaType=s[0]:n.anyOf=s.map(c=>({contentMediaType:c})))},ly=(e,t,r,o)=>{r.type="boolean"},uy=(e,t,r,o)=>{nt(e,t,r,o,"Custom types cannot be represented in JSON Schema")},dy=(e,t,r,o)=>{nt(e,t,r,o,"Function types cannot be represented in JSON Schema")},my=(e,t,r,o)=>{nt(e,t,r,o,"Transforms cannot be represented in JSON Schema")},fy=(e,t,r,o)=>{nt(e,t,r,o,"Map cannot be represented in JSON Schema")},py=(e,t,r,o)=>{nt(e,t,r,o,"Set cannot be represented in JSON Schema")},hy=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:a,maximum:s}=rt(e);typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=Ve(i.element,t,{...o,path:[...o.path,"items"]})};gy=(e,t,r,o)=>{let n=r,i=e._zod.def,a=i.shape;if(Object.getOwnPropertySymbols(a).length&&nt(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let l in a)lt(n.properties,l,Ve(a[l],t,{...o,path:[...o.path,"properties",l]}));let c=[];for(let l of Object.keys(a)){let u=i.shape[l];(t.io==="input"?cs(u)===void 0:u._zod.optout===void 0)&&c.push(l)}c.length>0&&(n.required=c),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=Ve(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},pu=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,c)=>Ve(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=a:r.anyOf=a},vy=(e,t,r,o)=>{let n=e._zod.def,i=Ve(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=Ve(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=c,t.intersections.push(c)},yy=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((y,v)=>Ve(y,t,{...o,path:[...o.path,a,v]})),l=i.rest?Ve(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null,u=i.items.length;for(;u>0;){let y=i.items[u-1];if(!(t.io==="input"?cs(y)!==void 0:y._zod.optout==="optional"))break;u--}let d=i.items.length,m=!i.rest;t.target==="draft-2020-12"?(n.prefixItems=c,m?n.items=!1:l&&(n.items=l),u>0&&(n.minItems=u),m&&(n.maxItems=d)):t.target==="openapi-3.0"?(n.items={anyOf:c},l&&n.items.anyOf.push(l),u>0&&(n.minItems=u),m&&(n.maxItems=d)):(n.items=c,m?n.additionalItems=!1:l&&(n.additionalItems=l),u>0&&(n.minItems=u),m&&(n.maxItems=d));let{minimum:f,maximum:h}=rt(e);typeof f=="number"&&(n.minItems=f),typeof h=="number"&&(n.maxItems=h)};Bv=new WeakMap;_y=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,s=rt(a).patterns;if(i.mode==="loose"&&s&&s.size>0){let u=Ve(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of s)lt(n.patternProperties,xk(d).source,u)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=Ve(i.keyType,t,{...o,path:[...o.path,"propertyNames"]});let u=Bv.get(t);u||(u=[],Bv.set(t,u),t.deferred.push(()=>rj(t))),u.push(e)}n.additionalProperties=Ve(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let c=a._zod.values,l=t.io==="input"&&cs(i.valueType)!==void 0;if(c&&!i.partial&&!l){let u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(n.required=u.map(String))}},$y=(e,t,r,o)=>{let n=e._zod.def,i=Ve(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},by=(e,t,r,o)=>{let n=e._zod.def;Ve(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Sy=Symbol();wy=(e,t,r,o)=>{let n=e._zod.def;Ve(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a=Tk(n.defaultValue,e,t,r,o);a!==Sy&&(r.default=a)},ky=(e,t,r,o)=>{let n=e._zod.def;Ve(n.innerType,t,o);let i=t.seen.get(e);if(i.ref=n.innerType,t.io!=="input")return;let a=Tk(n.defaultValue,e,t,r,o);a!==Sy&&(r._prefault=a)},zy=(e,t,r,o)=>{let n=e._zod.def;Ve(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{nt(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=a},Ry=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;Ve(a,t,o);let s=t.seen.get(e);s.ref=a},Iy=(e,t,r,o)=>{let n=e._zod.def;Ve(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},xy=(e,t,r,o)=>{let n=e._zod.def;Ve(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},hu=(e,t,r,o)=>{let n=e._zod.def;Ve(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Ty=(e,t,r,o)=>{let n=e._zod.innerType;Ve(n,t,o);let i=t.seen.get(e);i.ref=n},fu={string:Hv,number:Jv,boolean:Kv,bigint:Gv,symbol:Wv,null:Xv,undefined:Yv,void:Qv,never:ey,any:ty,unknown:ny,date:ry,enum:oy,literal:iy,nan:ay,template_literal:sy,file:cy,success:ly,custom:uy,function:dy,transform:my,map:fy,set:py,array:hy,object:gy,union:pu,intersection:vy,tuple:yy,record:_y,nullable:$y,nonoptional:by,default:wy,prefault:ky,catch:zy,pipe:Ry,readonly:Iy,promise:xy,optional:hu,lazy:Ty}});var gu,Pk=G(()=>{ls();ss();gu=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=or({processors:fu,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return Ve(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,ir(this.ctx,t);let o=ar(this.ctx,t),{"~standard":n,...i}=o;return i}}});var Ek={};var Ck=G(()=>{});var On={};an(On,{$ZodAny:()=>dg,$ZodArray:()=>vg,$ZodAsyncError:()=>Tt,$ZodBase64:()=>Qh,$ZodBase64URL:()=>eg,$ZodBigInt:()=>wl,$ZodBigIntFormat:()=>sg,$ZodBoolean:()=>Ba,$ZodCIDRv4:()=>Xh,$ZodCIDRv6:()=>Yh,$ZodCUID:()=>Uh,$ZodCUID2:()=>Lh,$ZodCatch:()=>Ag,$ZodCheck:()=>Be,$ZodCheckBigIntFormat:()=>dh,$ZodCheckEndsWith:()=>wh,$ZodCheckGreaterThan:()=>il,$ZodCheckIncludes:()=>bh,$ZodCheckLengthEquals:()=>vh,$ZodCheckLessThan:()=>ol,$ZodCheckLowerCase:()=>_h,$ZodCheckMaxLength:()=>hh,$ZodCheckMaxSize:()=>mh,$ZodCheckMimeType:()=>Rh,$ZodCheckMinLength:()=>gh,$ZodCheckMinSize:()=>fh,$ZodCheckMultipleOf:()=>lh,$ZodCheckNumberFormat:()=>uh,$ZodCheckOverwrite:()=>Ih,$ZodCheckProperties:()=>zh,$ZodCheckProperty:()=>kh,$ZodCheckRegex:()=>yh,$ZodCheckSizeEquals:()=>ph,$ZodCheckStartsWith:()=>Sh,$ZodCheckStringFormat:()=>Lo,$ZodCheckUpperCase:()=>$h,$ZodCodec:()=>Ja,$ZodCreditCard:()=>ng,$ZodCustom:()=>Fg,$ZodCustomStringFormat:()=>ig,$ZodCyclicError:()=>Pl,$ZodDate:()=>hg,$ZodDefault:()=>Cg,$ZodDiscriminatedUnion:()=>bg,$ZodE164:()=>tg,$ZodEmail:()=>Oh,$ZodEmoji:()=>Mh,$ZodEncodeError:()=>er,$ZodEnum:()=>Rg,$ZodError:()=>bp,$ZodExactOptional:()=>Pg,$ZodFile:()=>xg,$ZodFunction:()=>qg,$ZodGUID:()=>Eh,$ZodIBAN:()=>rg,$ZodIPv4:()=>Kh,$ZodIPv6:()=>Gh,$ZodISODate:()=>Bh,$ZodISODateTime:()=>Zh,$ZodISODuration:()=>Jh,$ZodISOTime:()=>Hh,$ZodIntersection:()=>Sg,$ZodJWT:()=>og,$ZodKSUID:()=>Fh,$ZodLazy:()=>Ka,$ZodLiteral:()=>Ig,$ZodMAC:()=>Wh,$ZodMap:()=>kg,$ZodNaN:()=>Mg,$ZodNanoID:()=>Dh,$ZodNever:()=>fg,$ZodNonOptional:()=>Ng,$ZodNull:()=>ug,$ZodNullable:()=>Eg,$ZodNumber:()=>Sl,$ZodNumberFormat:()=>ag,$ZodObject:()=>jS,$ZodObjectJIT:()=>yg,$ZodOptional:()=>zl,$ZodPipe:()=>Rl,$ZodPrefault:()=>Og,$ZodPreprocess:()=>Dg,$ZodPromise:()=>Vg,$ZodReadonly:()=>Ug,$ZodRealError:()=>Pt,$ZodRecord:()=>wg,$ZodRegistry:()=>Al,$ZodSet:()=>zg,$ZodString:()=>Gr,$ZodStringFormat:()=>qe,$ZodSuccess:()=>jg,$ZodSymbol:()=>cg,$ZodTemplateLiteral:()=>Lg,$ZodTransform:()=>Tg,$ZodTuple:()=>kl,$ZodType:()=>ze,$ZodULID:()=>qh,$ZodURL:()=>Ah,$ZodUUID:()=>Ch,$ZodUndefined:()=>lg,$ZodUnion:()=>Ha,$ZodUnknown:()=>mg,$ZodVoid:()=>pg,$ZodXID:()=>Vh,$ZodXor:()=>_g,$brand:()=>yp,$constructor:()=>A,$input:()=>Yg,$output:()=>Xg,Doc:()=>Kr,INVALID:()=>$t,JSONSchema:()=>Ek,JSONSchemaGenerator:()=>gu,NEVER:()=>Ea,TimePrecision:()=>uv,URL_BAD_FORMAT:()=>Nh,URL_UNPARSEABLE:()=>La,ZodCompileAsyncError:()=>cn,ZodCompileUnsupportedError:()=>je,_any:()=>Iv,_array:()=>Nv,_base64:()=>ou,_base64url:()=>iu,_bigint:()=>$v,_boolean:()=>yv,_catch:()=>JN,_check:()=>fk,_cidrv4:()=>nu,_cidrv6:()=>ru,_coercedBigint:()=>bv,_coercedBoolean:()=>_v,_coercedDate:()=>Cv,_coercedNumber:()=>mv,_coercedString:()=>av,_creditCard:()=>cv,_cuid:()=>Gl,_cuid2:()=>Wl,_custom:()=>Av,_date:()=>Ev,_decode:()=>Jc,_decodeAsync:()=>Gc,_default:()=>ZN,_discriminatedUnion:()=>CN,_e164:()=>au,_email:()=>ql,_emoji:()=>Jl,_encode:()=>Hc,_encodeAsync:()=>Kc,_endsWith:()=>Xo,_enum:()=>DN,_file:()=>jv,_float32:()=>pv,_float64:()=>hv,_gt:()=>bn,_gte:()=>Mt,_guid:()=>Vl,_iban:()=>lv,_includes:()=>Go,_int:()=>fv,_int32:()=>gv,_int64:()=>Sv,_intersection:()=>ON,_ipv4:()=>eu,_ipv6:()=>tu,_isoDate:()=>rs,_isoDateTime:()=>ns,_isoDuration:()=>is,_isoTime:()=>os,_jwt:()=>su,_ksuid:()=>Ql,_lazy:()=>XN,_length:()=>to,_literal:()=>LN,_lowercase:()=>Jo,_lt:()=>$n,_lte:()=>At,_mac:()=>sv,_map:()=>AN,_max:()=>At,_maxLength:()=>eo,_maxSize:()=>rr,_mime:()=>Qo,_min:()=>Mt,_minLength:()=>Cn,_minSize:()=>Sn,_multipleOf:()=>nr,_nan:()=>Ov,_nanoid:()=>Kl,_nativeEnum:()=>UN,_negative:()=>lu,_never:()=>Tv,_nonnegative:()=>du,_nonoptional:()=>BN,_nonpositive:()=>uu,_normalize:()=>ei,_null:()=>Rv,_nullable:()=>FN,_number:()=>dv,_optional:()=>VN,_overwrite:()=>ln,_parse:()=>Ao,_parseAsync:()=>Mo,_pipe:()=>KN,_positive:()=>cu,_promise:()=>YN,_properties:()=>Yo,_property:()=>mu,_readonly:()=>GN,_record:()=>jN,_refine:()=>Mv,_regex:()=>Ho,_safeDecode:()=>Xc,_safeDecodeAsync:()=>Qc,_safeEncode:()=>Wc,_safeEncodeAsync:()=>Yc,_safeParse:()=>Do,_safeParseAsync:()=>Uo,_set:()=>MN,_size:()=>Qr,_slugify:()=>oi,_startsWith:()=>Wo,_string:()=>iv,_stringFormat:()=>no,_stringbool:()=>qv,_success:()=>HN,_superRefine:()=>Dv,_symbol:()=>kv,_templateLiteral:()=>WN,_toLowerCase:()=>ni,_toUpperCase:()=>ri,_transform:()=>qN,_trim:()=>ti,_tuple:()=>NN,_uint32:()=>vv,_uint64:()=>wv,_ulid:()=>Xl,_undefined:()=>zv,_union:()=>PN,_unknown:()=>xv,_uppercase:()=>Ko,_url:()=>ts,_uuid:()=>Fl,_uuidv4:()=>Zl,_uuidv6:()=>Bl,_uuidv7:()=>Hl,_void:()=>Pv,_xid:()=>Yl,_xor:()=>EN,base64Charset:()=>vl,base64urlCharset:()=>Za,canParseURL:()=>jh,clone:()=>Le,compile:()=>nv,compileFn:()=>Ul,config:()=>We,createStandardJSONSchemaMethod:()=>ii,createToJSONSchemaMethod:()=>Fv,decode:()=>EE,decodeAsync:()=>OE,describe:()=>Uv,encode:()=>PE,encodeAsync:()=>CE,extractDefs:()=>ir,finalize:()=>ar,flattenError:()=>Ca,formatError:()=>Oa,getDiscriminatedOption:()=>$g,globalConfig:()=>it,globalRegistry:()=>ut,handleUnrepresentable:()=>nt,initializeContext:()=>or,isBackEdge:()=>Cl,isRecursiveSchema:()=>El,isValidBase64:()=>Fa,isValidBase64URL:()=>yl,isValidCIDRv6:()=>gl,isValidCreditCard:()=>_l,isValidIBAN:()=>$l,isValidIPv6:()=>Va,isValidJWT:()=>bl,locales:()=>Qa,memoizer:()=>Xa,mergeValues:()=>qo,meta:()=>Lv,parse:()=>Zc,parseAsync:()=>Bc,parseURLObject:()=>CS,prettifyError:()=>wp,process:()=>Ve,processSchema:()=>Ve,regexes:()=>Gt,registry:()=>Ml,safeDecode:()=>jE,safeDecodeAsync:()=>ME,safeEncode:()=>NE,safeEncodeAsync:()=>AE,safeParse:()=>zE,safeParseAsync:()=>RE,standardProps:()=>ml,stripTabAndNewline:()=>qa,toDotPath:()=>dS,toJSONSchema:()=>ro,toZod:()=>ba,treeifyError:()=>Sp,urlHostnameOk:()=>pl,urlProtocolOk:()=>hl,util:()=>Z,validate:()=>Na,validateAsync:()=>ja,validateURL:()=>fl,version:()=>xh,withParser:()=>Dl});var Dt=G(()=>{Qn();zp();kp();Vo();Hg();al();Th();ie();ie();Jr();Wg();es();sl();mk();pk();ss();ls();Pk();Ck()});var vu={};an(vu,{endsWith:()=>Xo,gt:()=>bn,gte:()=>Mt,includes:()=>Go,length:()=>to,lowercase:()=>Jo,lt:()=>$n,lte:()=>At,maxLength:()=>eo,maxSize:()=>rr,mime:()=>Qo,minLength:()=>Cn,minSize:()=>Sn,multipleOf:()=>nr,negative:()=>lu,nonnegative:()=>du,nonpositive:()=>uu,normalize:()=>ei,overwrite:()=>ln,positive:()=>cu,properties:()=>Yo,property:()=>mu,regex:()=>Ho,size:()=>Qr,slugify:()=>oi,startsWith:()=>Wo,toLowerCase:()=>ni,toUpperCase:()=>ri,trim:()=>ti,uppercase:()=>Ko});var yu=G(()=>{Dt()});function _u(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let o=r(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}var Ok,Nk,ij,Et,Py=G(()=>{Dt();Dt();ie();Ok=new WeakSet([Object.prototype,Error.prototype]);Nk=(e,t)=>{bp.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);Ok.has(r)||(Ok.add(r),_u(r,"format",o=>n=>Oa(o,n)),_u(r,"flatten",o=>n=>Ca(o,n)),_u(r,"addIssue",o=>n=>{o.issues.push(n),o.message=JSON.stringify(o.issues,Eo,2)}),_u(r,"addIssues",o=>n=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,Eo,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},ij=A("ZodError",Nk),Et=A("ZodError",Nk,void 0,{Parent:Error})});var Ey,Cy,us,Oy,Ny,jy,Ay,My,Dy,Uy,Ly,qy,Vy=G(()=>{Dt();Py();Dt();Ey=Ao(Et),Cy=Mo(Et),us=Do(Et),Oy=Uo(Et),Ny=Hc(Et),jy=Jc(Et),Ay=Kc(Et),My=Gc(Et),Dy=Wc(Et),Uy=Xc(Et),Ly=Yc(Et),qy=Qc(Et)});var hi={};an(hi,{ZodAny:()=>Gy,ZodArray:()=>Qy,ZodBase64:()=>Mu,ZodBase64URL:()=>Du,ZodBigInt:()=>pi,ZodBigIntFormat:()=>qu,ZodBoolean:()=>fi,ZodCIDRv4:()=>ju,ZodCIDRv6:()=>Au,ZodCUID:()=>xu,ZodCUID2:()=>Tu,ZodCatch:()=>y_,ZodCodec:()=>ys,ZodCreditCard:()=>Zy,ZodCustom:()=>_s,ZodCustomStringFormat:()=>io,ZodDate:()=>fs,ZodDefault:()=>m_,ZodDiscriminatedUnion:()=>t_,ZodE164:()=>Uu,ZodEmail:()=>wu,ZodEmoji:()=>Ru,ZodEnum:()=>li,ZodExactOptional:()=>Bu,ZodFile:()=>c_,ZodFunction:()=>I_,ZodGUID:()=>zu,ZodIBAN:()=>By,ZodIPv4:()=>Ou,ZodIPv6:()=>Nu,ZodISODate:()=>cr,ZodISODateTime:()=>sr,ZodISODuration:()=>ur,ZodISOTime:()=>lr,ZodInstanceOf:()=>P_,ZodIntersection:()=>n_,ZodJWT:()=>Lu,ZodKSUID:()=>Cu,ZodLazy:()=>z_,ZodLiteral:()=>s_,ZodMAC:()=>Fy,ZodMap:()=>i_,ZodNaN:()=>$_,ZodNanoID:()=>Iu,ZodNever:()=>Xy,ZodNonOptional:()=>Hu,ZodNull:()=>Ky,ZodNullable:()=>d_,ZodNumber:()=>mi,ZodNumberFormat:()=>ao,ZodObject:()=>ps,ZodOptional:()=>gs,ZodPipe:()=>vs,ZodPrefault:()=>p_,ZodPreprocess:()=>b_,ZodPromise:()=>R_,ZodReadonly:()=>S_,ZodRecord:()=>ci,ZodSet:()=>a_,ZodString:()=>ui,ZodStringFormat:()=>Fe,ZodSuccess:()=>v_,ZodSymbol:()=>Hy,ZodTemplateLiteral:()=>k_,ZodTransform:()=>l_,ZodTuple:()=>r_,ZodType:()=>Ce,ZodULID:()=>Pu,ZodURL:()=>ms,ZodUUID:()=>wn,ZodUndefined:()=>Jy,ZodUnion:()=>hs,ZodUnknown:()=>Wy,ZodVoid:()=>Yy,ZodXID:()=>Eu,ZodXor:()=>e_,_ZodString:()=>Su,_default:()=>f_,_function:()=>Mz,any:()=>Vu,array:()=>L,base64:()=>Qk,base64url:()=>ez,bigint:()=>pz,boolean:()=>se,catch:()=>__,check:()=>Dz,cidrv4:()=>Xk,cidrv6:()=>Yk,codec:()=>Oz,creditCard:()=>nz,cuid:()=>Fk,cuid2:()=>Zk,currencyCode:()=>cz,custom:()=>Uz,date:()=>$z,describe:()=>Lz,discriminatedUnion:()=>dr,e164:()=>tz,email:()=>ku,emoji:()=>qk,enum:()=>Se,exactOptional:()=>u_,file:()=>Tz,float32:()=>uz,float64:()=>dz,function:()=>Mz,guid:()=>jk,hash:()=>lz,hex:()=>sz,hostname:()=>az,httpUrl:()=>Lk,iban:()=>rz,instanceof:()=>Vz,int:()=>$u,int32:()=>mz,int64:()=>hz,intersection:()=>un,invertCodec:()=>Nz,ipv4:()=>Kk,ipv6:()=>Wk,json:()=>Zz,jwt:()=>oz,keyof:()=>bz,ksuid:()=>Jk,lazy:()=>mr,literal:()=>q,looseObject:()=>ye,looseRecord:()=>zz,mac:()=>Gk,map:()=>Rz,meta:()=>qz,nan:()=>Cz,nanoid:()=>Vk,nativeEnum:()=>xz,never:()=>Fu,nonoptional:()=>g_,null:()=>kn,nullable:()=>ds,nullish:()=>Pz,number:()=>X,object:()=>C,optional:()=>fe,partialRecord:()=>kz,pipe:()=>bu,prefault:()=>h_,preprocess:()=>Nn,promise:()=>Az,readonly:()=>w_,record:()=>ae,refine:()=>x_,set:()=>Iz,strictObject:()=>Sz,string:()=>_,stringFormat:()=>iz,stringbool:()=>Fz,success:()=>Ez,superRefine:()=>T_,symbol:()=>vz,templateLiteral:()=>jz,transform:()=>Zu,tuple:()=>o_,uint32:()=>fz,uint64:()=>gz,ulid:()=>Bk,undefined:()=>yz,union:()=>ce,unknown:()=>pe,url:()=>di,uuid:()=>Ak,uuidv4:()=>Mk,uuidv6:()=>Dk,uuidv7:()=>Uk,void:()=>_z,xid:()=>Hk,xor:()=>wz});function sj(){it.localeError||We(Ol())}function oo(){it.memoizer||We({memoizer:Xa()})}function _(e){return iv(ui,e)}function ku(e){return ql(wu,e)}function jk(e){return Vl(zu,e)}function Ak(e){return Fl(wn,e)}function Mk(e){return Zl(wn,e)}function Dk(e){return Bl(wn,e)}function Uk(e){return Hl(wn,e)}function di(e){return ts(ms,e)}function Lk(e){return ts(ms,{protocol:Aa,hostname:Hp,...Z.normalizeParams(e)})}function qk(e){return Jl(Ru,e)}function Vk(e){return Kl(Iu,e)}function Fk(e){return Gl(xu,e)}function Zk(e){return Wl(Tu,e)}function Bk(e){return Xl(Pu,e)}function Hk(e){return Yl(Eu,e)}function Jk(e){return Ql(Cu,e)}function Kk(e){return eu(Ou,e)}function Gk(e){return sv(Fy,e)}function Wk(e){return tu(Nu,e)}function Xk(e){return nu(ju,e)}function Yk(e){return ru(Au,e)}function Qk(e){return ou(Mu,e)}function ez(e){return iu(Du,e)}function tz(e){return au(Uu,e)}function nz(e){return cv(Zy,e)}function rz(e){return lv(By,e)}function oz(e){return su(Lu,e)}function iz(e,t,r={}){return no(io,e,t,r)}function az(e){return no(io,"hostname",Bp,e)}function sz(e){return no(io,"hex",ah,e)}function cz(e){return no(io,"currency_code",Kp,e)}function lz(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=Gt[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return no(io,o,n,t)}function X(e){return dv(mi,e)}function $u(e){return fv(ao,e)}function uz(e){return pv(ao,e)}function dz(e){return hv(ao,e)}function mz(e){return gv(ao,e)}function fz(e){return vv(ao,e)}function se(e){return yv(fi,e)}function pz(e){return $v(pi,e)}function hz(e){return Sv(qu,e)}function gz(e){return wv(qu,e)}function vz(e){return kv(Hy,e)}function yz(e){return zv(Jy,e)}function kn(e){return Rv(Ky,e)}function Vu(){return Iv(Gy)}function pe(){return xv(Wy)}function Fu(e){return Tv(Xy,e)}function _z(e){return Pv(Yy,e)}function $z(e){return Ev(fs,e)}function L(e,t){return Nv(Qy,e,t)}function bz(e){let t=e._zod.def.shape;return Se(Object.keys(t))}function C(e,t){let r={type:"object",shape:e??{},...Z.normalizeParams(t)};return new ps(r)}function Sz(e,t){return new ps({type:"object",shape:e,catchall:Fu(),...Z.normalizeParams(t)})}function ye(e,t){return new ps({type:"object",shape:e,catchall:pe(),...Z.normalizeParams(t)})}function ce(e,t){return new hs({type:"union",options:e,...Z.normalizeParams(t)})}function wz(e,t){return new e_({type:"union",options:e,inclusive:!1,...Z.normalizeParams(t)})}function dr(e,t,r){return new t_({type:"union",options:t,discriminator:e,...Z.normalizeParams(r)})}function un(e,t){return new n_({type:"intersection",left:e,right:t})}function o_(e,t,r){let o=t instanceof ze,n=o?r:t,i=o?t:null;return new r_({type:"tuple",items:e,rest:i,...Z.normalizeParams(n)})}function ae(e,t,r){return!t||!t._zod?new ci({type:"record",keyType:_(),valueType:e,...Z.normalizeParams(t)}):new ci({type:"record",keyType:e,valueType:t,...Z.normalizeParams(r)})}function kz(e,t,r){return new ci({type:"record",keyType:e,valueType:t,...Z.normalizeParams(r),partial:!0})}function zz(e,t,r){return new ci({type:"record",keyType:e,valueType:t,mode:"loose",...Z.normalizeParams(r)})}function Rz(e,t,r){return new i_({type:"map",keyType:e,valueType:t,...Z.normalizeParams(r)})}function Iz(e,t){return new a_({type:"set",valueType:e,...Z.normalizeParams(t)})}function Se(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new li({type:"enum",entries:r,...Z.normalizeParams(t)})}function xz(e,t){return new li({type:"enum",entries:e,...Z.normalizeParams(t)})}function q(e,t){return new s_({type:"literal",values:Array.isArray(e)?e:[e],...Z.normalizeParams(t)})}function Tz(e){return jv(c_,e)}function Zu(e){return new l_({type:"transform",transform:e})}function fe(e){return new gs({type:"optional",innerType:e})}function u_(e){return new Bu({type:"optional",innerType:e})}function ds(e){return new d_({type:"nullable",innerType:e})}function Pz(e){return fe(ds(e))}function f_(e,t){return new m_({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Z.shallowClone(t)}})}function h_(e,t){return new p_({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Z.shallowClone(t)}})}function g_(e,t){return new Hu({type:"nonoptional",innerType:e,...Z.normalizeParams(t)})}function Ez(e){return new v_({type:"success",innerType:e})}function __(e,t){return new y_({type:"catch",innerType:e,catchValue:typeof t=="function"?t:Z.constantCatch(t)})}function Cz(e){return Ov($_,e)}function bu(e,t){return new vs({type:"pipe",in:e,out:t})}function Oz(e,t,r){return new ys({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function Nz(e){let t=e._zod.def;return new ys({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function w_(e){return new S_({type:"readonly",innerType:e})}function jz(e,t){return new k_({type:"template_literal",parts:e,...Z.normalizeParams(t)})}function mr(e){return new z_({type:"lazy",getter:e})}function Az(e){return new R_({type:"promise",innerType:e})}function Mz(e){return new I_({type:"function",input:Array.isArray(e?.input)?o_(e?.input):e?.input??L(pe()),output:e?.output??pe()})}function Dz(e){let t=new Be({check:"custom"});return t._zod.check=e,t}function Uz(e,t){return Av(_s,e??(()=>!0),t)}function x_(e,t={}){return Mv(_s,e,t)}function T_(e,t){return Dv(e,t)}function Vz(e,t={}){let r=new P_({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...Z.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}function Zz(e){let t=mr(()=>ce([_(e),X(),se(),kn(),L(t),ae(_(),t)]));return t}function Nn(e,t){return new b_({type:"pipe",in:Zu(e),out:t})}var Ce,Su,ui,Fe,sr,cr,lr,ur,wu,zu,wn,ms,Ru,Iu,xu,Tu,Pu,Eu,Cu,Ou,Fy,Nu,ju,Au,Mu,Du,Uu,Zy,By,Lu,io,mi,ao,fi,pi,qu,Hy,Jy,Ky,Gy,Wy,Xy,Yy,fs,Qy,ps,hs,e_,t_,n_,r_,ci,i_,a_,li,s_,c_,l_,gs,Bu,d_,m_,p_,Hu,v_,y_,$_,vs,ys,b_,S_,k_,z_,R_,I_,_s,Lz,qz,P_,Fz,fr=G(()=>{Dt();Dt();ls();Jr();ss();Jg();yu();Vy();Ce=A("ZodType",(e,t)=>(sj(),ze.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Z.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Le(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(x_(e,t))},superRefine(e,t){return this.check(T_(e,t))},overwrite(e){return this.check(ln(e))},optional(){return fe(this)},exactOptional(){return u_(this)},nullable(){return ds(this)},nullish(){return fe(ds(this))},nonoptional(e){return g_(this,e)},array(){return L(this)},or(e){return ce([this,e])},and(e){return un(this,e)},transform(e){return bu(this,Zu(e))},default(e){return f_(this,e)},prefault(e){return h_(this,e)},catch(e){return __(this,e)},pipe(e){return bu(this,e)},readonly(){return w_(this)},describe(e){let t=this.clone();return ut.add(t,{description:e}),t},meta(...e){if(e.length===0)return ut.get(this);let t=this.clone();return ut.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Z.hide(this,"~standard",{...ml(this),jsonSchema:{input:ii(this,"input"),output:ii(this,"output")}})},set"~standard"(e){Z.own(this,"~standard",e)},parse:function e(t,r){return Ey(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Cy(this,t,r,{callee:e})},safeParse(e,t){return us(this,e,t)},async safeParseAsync(e,t){return Oy(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Z.own(this,"spa",e)},validate(e,t){return Na(this,e,t)},validateAsync(e,t){return ja(this,e,t)},encode:function e(t,r){return Ny(this,t,r,{callee:e})},decode:function e(t,r){return jy(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Ay(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await My(this,t,r,{callee:e})},safeEncode(e,t){return Dy(this,e,t)},safeDecode(e,t){return Uy(this,e,t)},async safeEncodeAsync(e,t){return Ly(this,e,t)},async safeDecodeAsync(e,t){return qy(this,e,t)},toJSONSchema(e){return Fv(this,{})(e)},get description(){return ut.get(this)?.description},get _def(){return this._zod.def}}),Su=A("_ZodString",(e,t)=>{Gr.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hv(e,r,o,n)},Z.derived({format:e=>rt(e).format??null,minLength:e=>rt(e).minimum??null,maxLength:e=>rt(e).maximum??null},{regex(...e){return this.check(Ho(...e))},includes(...e){return this.check(Go(...e))},startsWith(...e){return this.check(Wo(...e))},endsWith(...e){return this.check(Xo(...e))},min(...e){return this.check(Cn(...e))},max(...e){return this.check(eo(...e))},length(...e){return this.check(to(...e))},nonempty(...e){return this.check(Cn(1,...e))},lowercase(e){return this.check(Jo(e))},uppercase(e){return this.check(Ko(e))},trim(){return this.check(ti())},normalize(...e){return this.check(ei(...e))},toLowerCase(){return this.check(ni())},toUpperCase(){return this.check(ri())},slugify(){return this.check(oi())}})),ui=A("ZodString",(e,t)=>{Gr.init(e,t),Su.init(e,t)},{email(e){return this.check(ql(wu,e))},url(e){return this.check(ts(ms,e))},jwt(e){return this.check(su(Lu,e))},emoji(e){return this.check(Jl(Ru,e))},guid(e){return this.check(Vl(zu,e))},uuid(e){return this.check(Fl(wn,e))},uuidv4(e){return this.check(Zl(wn,e))},uuidv6(e){return this.check(Bl(wn,e))},uuidv7(e){return this.check(Hl(wn,e))},nanoid(e){return this.check(Kl(Iu,e))},cuid(e){return this.check(Gl(xu,e))},cuid2(e){return this.check(Wl(Tu,e))},ulid(e){return this.check(Xl(Pu,e))},base64(e){return this.check(ou(Mu,e))},base64url(e){return this.check(iu(Du,e))},xid(e){return this.check(Yl(Eu,e))},ksuid(e){return this.check(Ql(Cu,e))},ipv4(e){return this.check(eu(Ou,e))},ipv6(e){return this.check(tu(Nu,e))},cidrv4(e){return this.check(nu(ju,e))},cidrv6(e){return this.check(ru(Au,e))},e164(e){return this.check(au(Uu,e))},datetime(e){return this.check(ns(sr,e))},date(e){return this.check(rs(cr,e))},time(e){return this.check(os(lr,e))},duration(e){return this.check(is(ur,e))}});Fe=A("ZodStringFormat",(e,t)=>{qe.init(e,t),Su.init(e,t)}),sr=A("ZodISODateTime",(e,t)=>{Zh.init(e,t),Fe.init(e,t)}),cr=A("ZodISODate",(e,t)=>{Bh.init(e,t),Fe.init(e,t)}),lr=A("ZodISOTime",(e,t)=>{Hh.init(e,t),Fe.init(e,t)}),ur=A("ZodISODuration",(e,t)=>{Jh.init(e,t),Fe.init(e,t)}),wu=A("ZodEmail",(e,t)=>{Oh.init(e,t),Fe.init(e,t)});zu=A("ZodGUID",(e,t)=>{Eh.init(e,t),Fe.init(e,t)});wn=A("ZodUUID",(e,t)=>{Ch.init(e,t),Fe.init(e,t)});ms=A("ZodURL",(e,t)=>{Ah.init(e,t),Fe.init(e,t)});Ru=A("ZodEmoji",(e,t)=>{Mh.init(e,t),Fe.init(e,t)});Iu=A("ZodNanoID",(e,t)=>{Dh.init(e,t),Fe.init(e,t)});xu=A("ZodCUID",(e,t)=>{Uh.init(e,t),Fe.init(e,t)});Tu=A("ZodCUID2",(e,t)=>{Lh.init(e,t),Fe.init(e,t)});Pu=A("ZodULID",(e,t)=>{qh.init(e,t),Fe.init(e,t)});Eu=A("ZodXID",(e,t)=>{Vh.init(e,t),Fe.init(e,t)});Cu=A("ZodKSUID",(e,t)=>{Fh.init(e,t),Fe.init(e,t)});Ou=A("ZodIPv4",(e,t)=>{Kh.init(e,t),Fe.init(e,t)});Fy=A("ZodMAC",(e,t)=>{Wh.init(e,t),Fe.init(e,t)});Nu=A("ZodIPv6",(e,t)=>{Gh.init(e,t),Fe.init(e,t)});ju=A("ZodCIDRv4",(e,t)=>{Xh.init(e,t),Fe.init(e,t)});Au=A("ZodCIDRv6",(e,t)=>{Yh.init(e,t),Fe.init(e,t)});Mu=A("ZodBase64",(e,t)=>{Qh.init(e,t),Fe.init(e,t)});Du=A("ZodBase64URL",(e,t)=>{eg.init(e,t),Fe.init(e,t)});Uu=A("ZodE164",(e,t)=>{tg.init(e,t),Fe.init(e,t)});Zy=A("ZodCreditCard",(e,t)=>{ng.init(e,t),Fe.init(e,t)});By=A("ZodIBAN",(e,t)=>{rg.init(e,t),Fe.init(e,t)});Lu=A("ZodJWT",(e,t)=>{og.init(e,t),Fe.init(e,t)});io=A("ZodCustomStringFormat",(e,t)=>{ig.init(e,t),Fe.init(e,t)});mi=A("ZodNumber",(e,t)=>{Sl.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jv(e,r,o,n),e.isFinite=!0},Z.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=rt(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=rt(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=rt(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>rt(e).format??null},{gt(e,t){return this.check(bn(e,t))},gte(e,t){return this.check(Mt(e,t))},min(e,t){return this.check(Mt(e,t))},lt(e,t){return this.check($n(e,t))},lte(e,t){return this.check(At(e,t))},max(e,t){return this.check(At(e,t))},int(e){return this.check($u(e))},safe(e){return this.check($u(e))},positive(e){return this.check(bn(0,e))},nonnegative(e){return this.check(Mt(0,e))},negative(e){return this.check($n(0,e))},nonpositive(e){return this.check(At(0,e))},multipleOf(e,t){return this.check(nr(e,t))},step(e,t){return this.check(nr(e,t))},finite(){return this}}));ao=A("ZodNumberFormat",(e,t)=>{ag.init(e,t),mi.init(e,t)});fi=A("ZodBoolean",(e,t)=>{Ba.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kv(e,r,o,n)});pi=A("ZodBigInt",(e,t)=>{wl.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gv(e,r,o,n)},Z.derived({minValue:e=>rt(e).minimum??null,maxValue:e=>rt(e).maximum??null,format:e=>rt(e).format??null},{gte(e,t){return this.check(Mt(e,t))},min(e,t){return this.check(Mt(e,t))},gt(e,t){return this.check(bn(e,t))},lt(e,t){return this.check($n(e,t))},lte(e,t){return this.check(At(e,t))},max(e,t){return this.check(At(e,t))},positive(e){return this.check(bn(BigInt(0),e))},negative(e){return this.check($n(BigInt(0),e))},nonpositive(e){return this.check(At(BigInt(0),e))},nonnegative(e){return this.check(Mt(BigInt(0),e))},multipleOf(e,t){return this.check(nr(e,t))}}));qu=A("ZodBigIntFormat",(e,t)=>{sg.init(e,t),pi.init(e,t)});Hy=A("ZodSymbol",(e,t)=>{cg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wv(e,r,o,n)});Jy=A("ZodUndefined",(e,t)=>{lg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yv(e,r,o,n)});Ky=A("ZodNull",(e,t)=>{ug.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xv(e,r,o,n)});Gy=A("ZodAny",(e,t)=>{dg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ty(e,r,o,n)});Wy=A("ZodUnknown",(e,t)=>{mg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ny(e,r,o,n)});Xy=A("ZodNever",(e,t)=>{fg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ey(e,r,o,n)});Yy=A("ZodVoid",(e,t)=>{pg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qv(e,r,o,n)});fs=A("ZodDate",(e,t)=>{hg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ry(e,r,o,n),e.min=(r,o)=>e.check(Mt(r,o)),e.max=(r,o)=>e.check(At(r,o))},Z.derived({minDate:e=>{let{minimum:t}=rt(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=rt(e);return t?new Date(t):null}},{}));Qy=A("ZodArray",(e,t)=>{oo(),vg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hy(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Cn(e,t))},nonempty(e){return this.check(Cn(1,e))},max(e,t){return this.check(eo(e,t))},length(e,t){return this.check(to(e,t))},unwrap(){return this.element}});ps=A("ZodObject",(e,t)=>{oo(),yg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gy(e,r,o,n),Z.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return Se(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Z.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Z.mergeDefs(this._zod.def,{catchall:pe()}))},loose(){return this.clone(Z.mergeDefs(this._zod.def,{catchall:pe()}))},strict(){return this.clone(Z.mergeDefs(this._zod.def,{catchall:Fu()}))},strip(){return this.clone(Z.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return Z.extend(this,e)},safeExtend(e){return Z.safeExtend(this,e)},merge(e){return Z.merge(this,e)},pick(e){return Z.pick(this,e)},omit(e){return Z.omit(this,e)},partial(...e){return Z.partial(gs,this,e[0])},exactPartial(...e){return Z.partial(Bu,this,e[0],"exactPartial")},required(...e){return Z.required(Hu,this,e[0])}});hs=A("ZodUnion",(e,t)=>{Ha.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pu(e,r,o,n),e.options=t.options});e_=A("ZodXor",(e,t)=>{hs.init(e,t),_g.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pu(e,r,o,n),e.options=t.options});t_=A("ZodDiscriminatedUnion",(e,t)=>{hs.init(e,t),bg.init(e,t)});n_=A("ZodIntersection",(e,t)=>{Sg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vy(e,r,o,n)});r_=A("ZodTuple",(e,t)=>{oo(),kl.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yy(e,r,o,n)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new gs({type:"optional",innerType:t}))})}});ci=A("ZodRecord",(e,t)=>{oo(),wg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_y(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});i_=A("ZodMap",(e,t)=>{oo(),kg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fy(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Sn(...r)),e.nonempty=r=>e.check(Sn(1,r)),e.max=(...r)=>e.check(rr(...r)),e.size=(...r)=>e.check(Qr(...r))});a_=A("ZodSet",(e,t)=>{oo(),zg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>py(e,r,o,n),e.min=(...r)=>e.check(Sn(...r)),e.nonempty=r=>e.check(Sn(1,r)),e.max=(...r)=>e.check(rr(...r)),e.size=(...r)=>e.check(Qr(...r))});li=A("ZodEnum",(e,t)=>{Rg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,n,i)=>oy(e,o,n,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new li({...t,checks:[],...Z.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new li({...t,checks:[],...Z.normalizeParams(n),entries:i})}});s_=A("ZodLiteral",(e,t)=>{Ig.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>iy(e,r,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]}})});c_=A("ZodFile",(e,t)=>{xg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cy(e,r,o,n),e.min=(r,o)=>e.check(Sn(r,o)),e.max=(r,o)=>e.check(rr(r,o)),e.mime=(r,o)=>e.check(Qo(Array.isArray(r)?r:[r],o))});l_=A("ZodTransform",(e,t)=>{oo(),Tg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>my(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new er(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(Z.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=r.value),a.inst??(a.inst=e),r.issues.push(Z.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r)):(r.value=n,r)}});gs=A("ZodOptional",(e,t)=>{zl.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Bu=A("ZodExactOptional",(e,t)=>{Pg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});d_=A("ZodNullable",(e,t)=>{Eg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$y(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});m_=A("ZodDefault",(e,t)=>{Cg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});p_=A("ZodPrefault",(e,t)=>{Og.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ky(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Hu=A("ZodNonOptional",(e,t)=>{Ng.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>by(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});v_=A("ZodSuccess",(e,t)=>{jg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ly(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});y_=A("ZodCatch",(e,t)=>{Ag.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});$_=A("ZodNaN",(e,t)=>{Mg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ay(e,r,o,n)});vs=A("ZodPipe",(e,t)=>{Rl.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ry(e,r,o,n),e.in=t.in,e.out=t.out});ys=A("ZodCodec",(e,t)=>{vs.init(e,t),Ja.init(e,t)});b_=A("ZodPreprocess",(e,t)=>{vs.init(e,t),Dg.init(e,t)}),S_=A("ZodReadonly",(e,t)=>{Ug.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Iy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});k_=A("ZodTemplateLiteral",(e,t)=>{Lg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sy(e,r,o,n)});z_=A("ZodLazy",(e,t)=>{Ka.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ty(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});R_=A("ZodPromise",(e,t)=>{Vg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});I_=A("ZodFunction",(e,t)=>{qg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dy(e,r,o,n)});_s=A("ZodCustom",(e,t)=>{Fg.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uy(e,r,o,n)});Lz=Uv,qz=Lv,P_=A("ZodInstanceOf",(e,t)=>{_s.init(e,t)},{properties(e,t){return this.check(Yo(e,t))}});Fz=(...e)=>qv({Codec:ys,Boolean:fi,String:ui},...e)});function cj(e){We({customError:e})}function lj(){return We().customError}var C_,E_,Bz=G(()=>{Dt();C_={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};E_||(E_={})});var Wt={};an(Wt,{ZodISODate:()=>cr,ZodISODateTime:()=>sr,ZodISODuration:()=>ur,ZodISOTime:()=>lr,date:()=>dj,datetime:()=>uj,duration:()=>fj,time:()=>mj});function uj(e){return ns(sr,e)}function dj(e){return rs(cr,e)}function mj(e){return os(lr,e)}function fj(e){return is(ur,e)}var Ju=G(()=>{Dt();fr();fr()});function hj(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function Hz(e,t){return e.map((r,o)=>o<t?r:r.optional())}function gj(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function vj(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1]===void 0?void 0:gj(r[1]);if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function yj(e,t){return le.transform(o=>o).check(o=>{let n=o.value;if(typeof n!="object"||n===null||Array.isArray(n))return;let i=Object.getOwnPropertyNames(n);if(t.minProperties!==void 0&&i.length<t.minProperties&&o.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:n,inst:e,continue:!0}),t.maxProperties!==void 0&&i.length>t.maxProperties&&o.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:n,inst:e,continue:!0}),t.keySchema)for(let a of i){let s=t.keySchema.safeParse(a);s.success||o.issues.push({code:"invalid_key",origin:"record",issues:s.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}function O_(e,t){if(e===null)return"z";let r=typeof e;if(r!=="object"){if(r==="number"&&Number.isNaN(e))return null;let o=String(e);return`${r[0]}${o.length}:${o}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let i=[];for(let a of e){let s=O_(a,t);if(s===null)return null;i.push(s)}return`a${i.length}:[${i.join(",")}]`}let o=Object.keys(e).sort(),n=[];for(let i of o){let a=O_(e[i],t);if(a===null)return null;n.push(`${i.length}:${i}=${a}`)}return`o${n.length}:{${n.join(",")}}`}finally{t.delete(e)}}function $s(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some($s):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,r])=>_j.has(t)?$s(r):!$j.has(t)||typeof r!="object"||r===null?!1:Object.values(r).some($s))}function Jz(e){return e===1?"element":"elements"}function bj(e,t){return le.transform(o=>o).check(o=>{let n=o.value;if(Array.isArray(n)){if(t.uniqueItems===!0){let i=new Map;for(let a=0;a<n.length;a++){let s=O_(n[a],new Set);if(s===null)continue;let c=i.get(s);if(c===void 0){i.set(s,a);continue}o.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${c}`,input:n,path:[a],continue:!0})}}if(t.containsSchema){let i=t.minContains??1,a=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,s=0;for(let c of n)if(t.containsSchema.safeParse(c).success&&++s>=a)break;s<i&&o.issues.push({code:"custom",message:`Array must contain at least ${i} matching ${Jz(i)}; found ${s}`,input:n,continue:!0}),t.maxContains!==void 0&&s>t.maxContains&&o.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${Jz(t.maxContains)}`,input:n,continue:!0})}}}).pipe(e)}function Kz(e,t){if(e!==!1)return e===void 0||e===!0?le.any():St(e,t)}function Gz(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return le.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return le.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=vj(n,t),a=St(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return le.null();if(n.length===0)return le.never();if(n.length===1)return le.literal(n[0]);if(n.every(a=>typeof a=="string"))return le.enum(n);let i=n.map(a=>le.literal(a));return i.length<2?i[0]:le.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return le.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return Gz(a,t)});return n.length===0?le.never():n.length===1?n[0]:le.union(n)}if(!r)return le.any();let o;switch(r){case"string":{let n=le.string();if(e.format){let i=e.format;i==="email"?n=n.check(le.email()):i==="uri"||i==="uri-reference"?n=n.check(le.url()):i==="uuid"||i==="guid"?n=n.check(le.uuid()):i==="date-time"?n=n.check(le.iso.datetime({offset:!0})):i==="date"?n=n.check(le.iso.date()):i==="time"?n=n.check(le.regex(Sj)):i==="duration"?n=n.check(le.iso.duration()):i==="hostname"?n=n.check(le.hostname()):i==="ipv4"?n=n.check(le.ipv4()):i==="ipv6"?n=n.check(le.ipv6()):i==="mac"?n=n.check(le.mac()):i==="cidr"?n=n.check(le.cidrv4()):i==="cidr-v6"?n=n.check(le.cidrv6()):i==="base64"?n=n.check(le.base64()):i==="base64url"?n=n.check(le.base64url()):i==="e164"?n=n.check(le.e164()):i==="credit_card"?n=n.check(le.creditCard()):i==="iban"?n=n.check(le.iban()):i==="jwt"?n=n.check(le.jwt()):i==="emoji"?n=n.check(le.emoji()):i==="nanoid"?n=n.check(le.nanoid()):i==="cuid"?n=n.check(le.cuid()):i==="cuid2"?n=n.check(le.cuid2()):i==="ulid"?n=n.check(le.ulid()):i==="xid"?n=n.check(le.xid()):i==="ksuid"&&(n=n.check(le.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?le.number().int():le.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=le.boolean();break}case"null":{o=le.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]),s=typeof e.additionalProperties=="object"?St(e.additionalProperties,t):void 0;for(let[d,m]of Object.entries(i)){let f=St(m,t);lt(n,d,a.has(d)?f:f.optional())}if(e.patternProperties){let d=e.patternProperties,m=Object.keys(d),f=[];for(let y of m){let v=St(d[y],t),p=le.string().regex(new RegExp(y));f.push(le.looseRecord(p,v))}let h=[];if(Object.keys(n).length>0&&h.push(le.object(n).passthrough()),h.push(...f),h.length===0)o=le.object({}).passthrough();else if(h.length===1)o=h[0];else{let y=le.intersection(h[0],h[1]);for(let v=2;v<h.length;v++)y=le.intersection(y,h[v]);o=y}if(e.additionalProperties===!1){let y=Object.keys(n),v=m.map(b=>new RegExp(b)),p=o;o=o.check(b=>{if(!Jt(b.value))return;let g=[];for(let S of Object.keys(b.value))y.includes(S)||v.some(T=>T.test(S))||g.push(S);g.length&&b.issues.push({code:"unrecognized_keys",keys:g,input:b.value,inst:p})})}}else{let d=le.object(n);e.additionalProperties===!1?o=d.strict():s?o=d.catchall(s):o=d.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,u=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||l!==void 0||u!==void 0){let d;if(c){let m=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=St(m,t)}o=yj(o,{keySchema:d,minProperties:l,maxProperties:u})}break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=typeof e.minItems=="number"?e.minItems:0,s=n.map(d=>St(d,t)),c=Hz(s,a),l=Array.isArray(i)?void 0:Kz(i,t),u=le.tuple(c);o=l?u.rest(l):u,typeof e.minItems=="number"&&(o=o.check(le.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(le.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=typeof e.minItems=="number"?e.minItems:0,s=i.map(d=>St(d,t)),c=Hz(s,a),l=Kz(e.additionalItems,t),u=le.tuple(c);o=l?u.rest(l):u,typeof e.minItems=="number"&&(o=o.check(le.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(le.maxLength(e.maxItems)))}else if(i!==void 0){let a=St(i,t),s=le.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=le.array(le.any());(e.uniqueItems===!0||e.contains!==void 0)&&(o=bj(o,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?St(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return o}function St(e,t){if(typeof e=="boolean")return e?le.any():le.never();let r=Gz(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(l=>St(l,t)),c=le.union(s);r=o?le.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(l=>St(l,t)),c=le.xor(s);r=o?le.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:le.any();else{let s=o?r:St(e.allOf[0],t),c=o?0:1;for(let l=c;l<e.allOf.length;l++)s=le.intersection(s,St(e.allOf[l],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=le.nullable(r)),e.readOnly===!0&&(r=le.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!$s(e.propertyNames)&&(n.propertyNames=e.propertyNames);for(let s of["minProperties","maxProperties"])e[s]!==void 0&&(n[s]=e[s])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!$s(e.contains)&&(n.contains=e.contains);for(let s of["uniqueItems","minContains","maxContains"])e[s]!==void 0&&(n[s]=e[s])}for(let s of Object.keys(e))pj.has(s)||lt(n,s,e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function Wz(e,t){if(typeof e=="boolean")return e?le.any():le.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=hj(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??ut};return St(r,i)}var le,pj,_j,$j,Sj,Xz=G(()=>{es();ie();yu();Ju();fr();le={...hi,...vu,iso:Wt},pj=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);_j=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),$j=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);Sj=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/});function bs(e,t){let r=typeof t=="function"?t:(a,s)=>{let c=t[a._zod.def.type];return c?c(a,s):a},o=new Map;function n(a){let s=o.get(a);if(s===Yz)return new Ka({type:"lazy",getter:()=>o.get(a)});if(s!==void 0)return s;o.set(a,Yz);let c=i(a),l=r(c,c!==a);return o.set(a,l),l}function i(a){let s=a._zod.def,c=s.type;switch(c){case"object":{let l=s.shape,u=Object.keys(l),d=!1,m={};for(let h of u){let y=n(l[h]);y!==l[h]&&(d=!0),m[h]=y}let f=s.catchall;return s.catchall&&(f=n(s.catchall),f!==s.catchall&&(d=!0)),d?Le(a,{...s,shape:m,catchall:f}):a}case"array":{let l=n(s.element);return l===s.element?a:Le(a,{...s,element:l})}case"tuple":{let l=s.items,u=!1,d=[];for(let f of l){let h=n(f);h!==f&&(u=!0),d.push(h)}let m=s.rest;return s.rest&&(m=n(s.rest),m!==s.rest&&(u=!0)),u?Le(a,{...s,items:d,rest:m}):a}case"record":case"map":{let l=n(s.keyType),u=n(s.valueType);return l===s.keyType&&u===s.valueType?a:Le(a,{...s,keyType:l,valueType:u})}case"set":{let l=n(s.valueType);return l===s.valueType?a:Le(a,{...s,valueType:l})}case"union":{let l=s.options,u=!1,d=[];for(let m of l){let f=n(m);f!==m&&(u=!0),d.push(f)}return u?Le(a,{...s,options:d}):a}case"intersection":{let l=n(s.left),u=n(s.right);return l===s.left&&u===s.right?a:Le(a,{...s,left:l,right:u})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=n(s.innerType);return l===s.innerType?a:Le(a,{...s,innerType:l})}case"pipe":{let l=n(s.in),u=n(s.out);return l===s.in&&u===s.out?a:Le(a,{...s,in:l,out:u})}case"function":{let l=n(s.input),u=n(s.output);return l===s.input&&u===s.output?a:Le(a,{...s,input:l,output:u})}case"lazy":{let l=s.getter,{_cachedInner:u,...d}=s;return Le(a,{...d,getter:()=>n(l())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return a;default:return a}}return n(e)}var Yz,N_=G(()=>{Vo();ie();Yz=Symbol("z.visit/resolving")});function Qz(e){return bs(e,{object:t=>t.partial(),union:t=>{let r=t._zod.def;return r.discriminator===void 0?t:ce(r.options)}})}var eR=G(()=>{N_();fr()});function wj(e,t){if(!t?.length)return e;let r=e._zod.def;return Le(e,sn(r,{checks:[...r.checks??[],...t]}),{parent:!0})}function tR(e){return wj(e.out,e.checks)}function kj(e){return e.in._zod.traits.has("$ZodTransform")?tR(e):e.in}function nR(e){return bs(e,{pipe:t=>kj(t._zod.def),default:(t,r)=>r?fe(t._zod.def.innerType):t,catch:(t,r)=>r?t._zod.def.innerType:t})}function rR(e){return bs(e,{pipe:t=>tR(t._zod.def),prefault:(t,r)=>r?t._zod.def.innerType:t})}var oR=G(()=>{ie();N_();fr()});var Ss={};an(Ss,{bigint:()=>xj,boolean:()=>Ij,date:()=>Tj,number:()=>Rj,string:()=>zj});function zj(e){return av(ui,e)}function Rj(e){return mv(mi,e)}function Ij(e){return _v(fi,e)}function xj(e){return bv(pi,e)}function Tj(e){return Cv(fs,e)}var iR=G(()=>{Dt();fr()});var ge={};an(ge,{$brand:()=>yp,$input:()=>Yg,$output:()=>Xg,INVALID:()=>$t,NEVER:()=>Ea,TimePrecision:()=>uv,ZodAny:()=>Gy,ZodArray:()=>Qy,ZodBase64:()=>Mu,ZodBase64URL:()=>Du,ZodBigInt:()=>pi,ZodBigIntFormat:()=>qu,ZodBoolean:()=>fi,ZodCIDRv4:()=>ju,ZodCIDRv6:()=>Au,ZodCUID:()=>xu,ZodCUID2:()=>Tu,ZodCatch:()=>y_,ZodCodec:()=>ys,ZodCompileAsyncError:()=>cn,ZodCompileUnsupportedError:()=>je,ZodCreditCard:()=>Zy,ZodCustom:()=>_s,ZodCustomStringFormat:()=>io,ZodDate:()=>fs,ZodDefault:()=>m_,ZodDiscriminatedUnion:()=>t_,ZodE164:()=>Uu,ZodEmail:()=>wu,ZodEmoji:()=>Ru,ZodEnum:()=>li,ZodError:()=>ij,ZodExactOptional:()=>Bu,ZodFile:()=>c_,ZodFirstPartyTypeKind:()=>E_,ZodFunction:()=>I_,ZodGUID:()=>zu,ZodIBAN:()=>By,ZodIPv4:()=>Ou,ZodIPv6:()=>Nu,ZodISODate:()=>cr,ZodISODateTime:()=>sr,ZodISODuration:()=>ur,ZodISOTime:()=>lr,ZodInstanceOf:()=>P_,ZodIntersection:()=>n_,ZodIssueCode:()=>C_,ZodJWT:()=>Lu,ZodKSUID:()=>Cu,ZodLazy:()=>z_,ZodLiteral:()=>s_,ZodMAC:()=>Fy,ZodMap:()=>i_,ZodNaN:()=>$_,ZodNanoID:()=>Iu,ZodNever:()=>Xy,ZodNonOptional:()=>Hu,ZodNull:()=>Ky,ZodNullable:()=>d_,ZodNumber:()=>mi,ZodNumberFormat:()=>ao,ZodObject:()=>ps,ZodOptional:()=>gs,ZodPipe:()=>vs,ZodPrefault:()=>p_,ZodPreprocess:()=>b_,ZodPromise:()=>R_,ZodReadonly:()=>S_,ZodRealError:()=>Et,ZodRecord:()=>ci,ZodSet:()=>a_,ZodString:()=>ui,ZodStringFormat:()=>Fe,ZodSuccess:()=>v_,ZodSymbol:()=>Hy,ZodTemplateLiteral:()=>k_,ZodTransform:()=>l_,ZodTuple:()=>r_,ZodType:()=>Ce,ZodULID:()=>Pu,ZodURL:()=>ms,ZodUUID:()=>wn,ZodUndefined:()=>Jy,ZodUnion:()=>hs,ZodUnknown:()=>Wy,ZodVoid:()=>Yy,ZodXID:()=>Eu,ZodXor:()=>e_,_ZodString:()=>Su,_default:()=>f_,_function:()=>Mz,any:()=>Vu,array:()=>L,base64:()=>Qk,base64url:()=>ez,bigint:()=>pz,boolean:()=>se,catch:()=>__,check:()=>Dz,cidrv4:()=>Xk,cidrv6:()=>Yk,clone:()=>Le,codec:()=>Oz,coerce:()=>Ss,compile:()=>nv,config:()=>We,core:()=>On,creditCard:()=>nz,cuid:()=>Fk,cuid2:()=>Zk,currencyCode:()=>cz,custom:()=>Uz,date:()=>$z,decode:()=>jy,decodeAsync:()=>My,deepPartial:()=>Qz,describe:()=>Lz,discriminatedUnion:()=>dr,e164:()=>tz,email:()=>ku,emoji:()=>qk,encode:()=>Ny,encodeAsync:()=>Ay,endsWith:()=>Xo,enum:()=>Se,exactOptional:()=>u_,file:()=>Tz,flattenError:()=>Ca,float32:()=>uz,float64:()=>dz,formatError:()=>Oa,fromJSONSchema:()=>Wz,function:()=>Mz,getDiscriminatedOption:()=>$g,getErrorMap:()=>lj,globalRegistry:()=>ut,gt:()=>bn,gte:()=>Mt,guid:()=>jk,hash:()=>lz,hex:()=>sz,hostname:()=>az,httpUrl:()=>Lk,iban:()=>rz,includes:()=>Go,input:()=>nR,instanceof:()=>Vz,int:()=>$u,int32:()=>mz,int64:()=>hz,intersection:()=>un,invertCodec:()=>Nz,ipv4:()=>Kk,ipv6:()=>Wk,iso:()=>Wt,json:()=>Zz,jwt:()=>oz,keyof:()=>bz,ksuid:()=>Jk,lazy:()=>mr,length:()=>to,literal:()=>q,locales:()=>Qa,looseObject:()=>ye,looseRecord:()=>zz,lowercase:()=>Jo,lt:()=>$n,lte:()=>At,mac:()=>Gk,map:()=>Rz,maxLength:()=>eo,maxSize:()=>rr,memoizer:()=>Xa,meta:()=>qz,mime:()=>Qo,minLength:()=>Cn,minSize:()=>Sn,multipleOf:()=>nr,nan:()=>Cz,nanoid:()=>Vk,nativeEnum:()=>xz,negative:()=>lu,never:()=>Fu,nonnegative:()=>du,nonoptional:()=>g_,nonpositive:()=>uu,normalize:()=>ei,null:()=>kn,nullable:()=>ds,nullish:()=>Pz,number:()=>X,object:()=>C,optional:()=>fe,output:()=>rR,overwrite:()=>ln,parse:()=>Ey,parseAsync:()=>Cy,partialRecord:()=>kz,pipe:()=>bu,positive:()=>cu,prefault:()=>h_,preprocess:()=>Nn,prettifyError:()=>wp,promise:()=>Az,properties:()=>Yo,property:()=>mu,readonly:()=>w_,record:()=>ae,refine:()=>x_,regex:()=>Ho,regexes:()=>Gt,registry:()=>Ml,safeDecode:()=>Uy,safeDecodeAsync:()=>qy,safeEncode:()=>Dy,safeEncodeAsync:()=>Ly,safeParse:()=>us,safeParseAsync:()=>Oy,set:()=>Iz,setErrorMap:()=>cj,size:()=>Qr,slugify:()=>oi,startsWith:()=>Wo,strictObject:()=>Sz,string:()=>_,stringFormat:()=>iz,stringbool:()=>Fz,success:()=>Ez,superRefine:()=>T_,symbol:()=>vz,templateLiteral:()=>jz,toJSONSchema:()=>ro,toLowerCase:()=>ni,toUpperCase:()=>ri,toZod:()=>ba,transform:()=>Zu,treeifyError:()=>Sp,trim:()=>ti,tuple:()=>o_,uint32:()=>fz,uint64:()=>gz,ulid:()=>Bk,undefined:()=>yz,union:()=>ce,unknown:()=>pe,uppercase:()=>Ko,url:()=>di,util:()=>Z,uuid:()=>Ak,uuidv4:()=>Mk,uuidv6:()=>Dk,uuidv7:()=>Uk,validate:()=>Na,validateAsync:()=>ja,void:()=>_z,withParser:()=>Dl,xid:()=>Hk,xor:()=>wz});var Ku=G(()=>{Dt();fr();yu();Py();Vy();Bz();Dt();ls();Xz();eR();oR();Wg();Ju();Ju();iR()});var aR=G(()=>{Ku()});var Gu=G(()=>{aR()});var hr,ws,gi,ks,Ut,gr,Xt,dn,An,Mn,Wu,Xu,Yu,vr,Qu,ed,td,nd,rd,pr,Xe,A_,zs,Rs,od,id,Is,at,yr,Ye,pt,ht,xs,Qe,_r,Ts,Ps,vi,yi,$r,ad,Es,sd,Cs,cd,br,jn,_i,Pj,Ej,ld,ud,dd,md,Os,Ns,fd,js,pd,hd,As,gd,vd,Ms,yd,Sr,wr,Ds,Us,M_,Ls,kr,Dn,qs,_d,$d,bd,Sd,wd,$i,kd,zd,Rd,Id,xd,Td,Pd,Ed,Vs,Cd,Od,Nd,jd,Ad,Md,Dd,Ud,Ld,qd,Vd,Fd,Zd,Bd,bi,Si,wi,Hd,Jd,Kd,ki,Gd,Wd,Xd,Yd,Qd,Fs,em,tm,zi,D_,nm,rm,om,U_,zr,im,am,sm,cm,lm,um,dm,mm,fm,so,pm,hm,gm,vm,ym,Zs,Ri,Ii,Bs,Hs,Js,_m,Ks,Gs,$m,bm,Ws,xi,Sm,wm,km,zm,Rm,Im,xm,Tm,Pm,Em,Cm,Om,Nm,jm,Am,L_,Mm,Rr,q_,Dm,V_,F_,Z_,B_,H_,J_,K_,G_,W_,X_,Y_,Q_,e$,t$,n$,sR=G(()=>{Gu();hr="2025-11-25",ws="2025-03-26",gi=[hr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ks="io.modelcontextprotocol/related-task",Ut="io.modelcontextprotocol/protocolVersion",gr="io.modelcontextprotocol/clientInfo",Xt="io.modelcontextprotocol/serverInfo",dn="io.modelcontextprotocol/clientCapabilities",An="io.modelcontextprotocol/subscriptionId",Mn="io.modelcontextprotocol/logLevel",Wu="traceparent",Xu="tracestate",Yu="baggage",vr="2.0",Qu=-32700,ed=-32600,td=-32601,nd=-32602,rd=-32603,pr=mr(()=>ce([_(),X(),se(),kn(),ae(_(),pr),L(pr)])),Xe=ae(_(),pr),A_=L(pr),zs=ce([_(),X().int()]),Rs=_(),od=C({ttl:X().optional()}),id=C({taskId:_()}),Is=ye({progressToken:zs.optional(),[ks]:id.optional()}),at=C({_meta:Is.optional()}),yr=at.extend({task:od.optional()}),Ye=C({method:_(),params:at.loose().optional()}),pt=C({_meta:Is.optional()}),ht=C({method:_(),params:pt.loose().optional()}),xs=ye({get[Xt](){return _i.optional().catch(void 0)}}),Qe=ye({_meta:xs.optional()}),_r=ce([_(),X().int()]),Ts=C({jsonrpc:q(vr),id:_r,...Ye.shape}).strict(),Ps=C({jsonrpc:q(vr),...ht.shape}).strict(),vi=C({jsonrpc:q(vr),id:_r,result:Qe}).strict(),yi=C({jsonrpc:q(vr),id:_r.optional(),error:C({code:X().int(),message:_(),data:pe().optional()})}).strict(),$r=ce([Ts,Ps,vi,yi]),ad=ce([vi,yi]),Es=Qe.strict(),sd=pt.extend({requestId:_r.optional(),reason:_().optional()}),Cs=ht.extend({method:q("notifications/cancelled"),params:sd}),cd=C({src:_(),mimeType:_().optional(),sizes:L(_()).optional(),theme:Se(["light","dark"]).optional()}),br=C({icons:L(cd).optional()}),jn=C({name:_(),title:_().optional()}),_i=jn.extend({...jn.shape,...br.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),Pj=un(C({applyDefaults:se().optional()}),Xe),Ej=Nn(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,un(C({form:Pj.optional(),url:Xe.optional()}),Xe.optional())),ld=ye({list:Xe.optional(),cancel:Xe.optional(),requests:ye({sampling:ye({createMessage:Xe.optional()}).optional(),elicitation:ye({create:Xe.optional()}).optional()}).optional()}),ud=ye({list:Xe.optional(),cancel:Xe.optional(),requests:ye({tools:ye({call:Xe.optional()}).optional()}).optional()}),dd=C({experimental:ae(_(),Xe).optional(),sampling:C({context:Xe.optional(),tools:Xe.optional()}).optional(),elicitation:Ej.optional(),roots:C({listChanged:se().optional()}).optional(),tasks:ld.optional(),extensions:ae(_(),Xe).optional()}),md=at.extend({protocolVersion:_(),capabilities:dd,clientInfo:_i}),Os=Ye.extend({method:q("initialize"),params:md}),Ns=C({experimental:ae(_(),Xe).optional(),logging:Xe.optional(),completions:Xe.optional(),prompts:C({listChanged:se().optional()}).optional(),resources:C({subscribe:se().optional(),listChanged:se().optional()}).optional(),tools:C({listChanged:se().optional()}).optional(),tasks:ud.optional(),extensions:ae(_(),Xe).optional()}),fd=Qe.extend({protocolVersion:_(),capabilities:Ns,serverInfo:_i,instructions:_().optional()}),js=ht.extend({method:q("notifications/initialized"),params:pt.optional()}),pd=Ye.extend({method:q("server/discover"),params:at.optional()}),hd=Qe.extend({supportedVersions:L(_()),capabilities:Ns,instructions:_().optional()}),As=Ye.extend({method:q("ping"),params:at.optional()}),gd=C({progress:X(),total:fe(X()),message:fe(_())}),vd=C({...pt.shape,...gd.shape,progressToken:zs}),Ms=ht.extend({method:q("notifications/progress"),params:vd}),yd=at.extend({cursor:Rs.optional()}),Sr=Ye.extend({params:yd.optional()}),wr=Qe.extend({nextCursor:Rs.optional()}),Ds=C({uri:_(),mimeType:fe(_()),_meta:ae(_(),pe()).optional()}),Us=Ds.extend({text:_()}),M_=_().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ls=Ds.extend({blob:M_}),kr=Se(["user","assistant"]),Dn=C({audience:L(kr).optional(),priority:X().min(0).max(1).optional(),lastModified:Wt.datetime({offset:!0}).optional()}),qs=C({...jn.shape,...br.shape,uri:_(),description:fe(_()),mimeType:fe(_()),size:fe(X()),annotations:Dn.optional(),_meta:fe(ye({}))}),_d=C({...jn.shape,...br.shape,uriTemplate:_(),description:fe(_()),mimeType:fe(_()),annotations:Dn.optional(),_meta:fe(ye({}))}),$d=Sr.extend({method:q("resources/list")}),bd=wr.extend({resources:L(qs)}),Sd=Sr.extend({method:q("resources/templates/list")}),wd=wr.extend({resourceTemplates:L(_d)}),$i=at.extend({uri:_()}),kd=$i,zd=Ye.extend({method:q("resources/read"),params:kd}),Rd=Qe.extend({contents:L(ce([Us,Ls]))}),Id=ht.extend({method:q("notifications/resources/list_changed"),params:pt.optional()}),xd=$i,Td=Ye.extend({method:q("resources/subscribe"),params:xd}),Pd=$i,Ed=Ye.extend({method:q("resources/unsubscribe"),params:Pd}),Vs=C({toolsListChanged:se().optional(),promptsListChanged:se().optional(),resourcesListChanged:se().optional(),resourceSubscriptions:L(_()).optional()}),Cd=at.extend({notifications:Vs}),Od=Ye.extend({method:q("subscriptions/listen"),params:Cd}),Nd=pt.extend({notifications:Vs}),jd=ht.extend({method:q("notifications/subscriptions/acknowledged"),params:Nd}),Ad=xs.extend({[An]:_r}),Md=Qe.extend({_meta:Ad}),Dd=pt.extend({uri:_()}),Ud=ht.extend({method:q("notifications/resources/updated"),params:Dd}),Ld=C({name:_(),description:fe(_()),required:fe(se())}),qd=C({...jn.shape,...br.shape,description:fe(_()),arguments:fe(L(Ld)),_meta:fe(ye({}))}),Vd=Sr.extend({method:q("prompts/list")}),Fd=wr.extend({prompts:L(qd)}),Zd=at.extend({name:_(),arguments:ae(_(),_()).optional()}),Bd=Ye.extend({method:q("prompts/get"),params:Zd}),bi=C({type:q("text"),text:_(),annotations:Dn.optional(),_meta:ae(_(),pe()).optional()}),Si=C({type:q("image"),data:M_,mimeType:_(),annotations:Dn.optional(),_meta:ae(_(),pe()).optional()}),wi=C({type:q("audio"),data:M_,mimeType:_(),annotations:Dn.optional(),_meta:ae(_(),pe()).optional()}),Hd=C({type:q("tool_use"),name:_(),id:_(),input:ae(_(),pe()),_meta:ae(_(),pe()).optional()}),Jd=C({type:q("resource"),resource:ce([Us,Ls]),annotations:Dn.optional(),_meta:ae(_(),pe()).optional()}),Kd=qs.extend({type:q("resource_link")}),ki=ce([bi,Si,wi,Kd,Jd]),Gd=C({role:kr,content:ki}),Wd=Qe.extend({description:_().optional(),messages:L(Gd)}),Xd=ht.extend({method:q("notifications/prompts/list_changed"),params:pt.optional()}),Yd=C({title:_().optional(),readOnlyHint:se().optional(),destructiveHint:se().optional(),idempotentHint:se().optional(),openWorldHint:se().optional()}),Qd=C({taskSupport:Se(["required","optional","forbidden"]).optional()}),Fs=C({...jn.shape,...br.shape,description:_().optional(),inputSchema:C({type:q("object"),properties:ae(_(),pr).optional(),required:L(_()).optional()}).catchall(pe()),outputSchema:ye({$schema:_().optional()}).optional(),annotations:Yd.optional(),execution:Qd.optional(),_meta:ae(_(),pe()).optional()}),em=Sr.extend({method:q("tools/list")}),tm=wr.extend({tools:L(Fs)}),zi=Qe.extend({content:L(ki).default([]),structuredContent:pe().optional(),isError:se().optional()}),D_=zi.or(Qe.extend({toolResult:pe()})),nm=yr.extend({name:_(),arguments:ae(_(),pe()).optional()}),rm=Ye.extend({method:q("tools/call"),params:nm}),om=ht.extend({method:q("notifications/tools/list_changed"),params:pt.optional()}),U_=C({autoRefresh:se().default(!0),debounceMs:X().int().nonnegative().default(300)}),zr=Se(["debug","info","notice","warning","error","critical","alert","emergency"]),im=at.extend({level:zr}),am=Ye.extend({method:q("logging/setLevel"),params:im}),sm=pt.extend({level:zr,logger:_().optional(),data:pe()}),cm=ht.extend({method:q("notifications/message"),params:sm}),lm=C({name:_().optional()}),um=C({hints:L(lm).optional(),costPriority:X().min(0).max(1).optional(),speedPriority:X().min(0).max(1).optional(),intelligencePriority:X().min(0).max(1).optional()}),dm=C({mode:Se(["auto","required","none"]).optional()}),mm=C({type:q("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:L(ki),structuredContent:pe().optional(),isError:se().optional(),_meta:ae(_(),pe()).optional()}),fm=dr("type",[bi,Si,wi]),so=dr("type",[bi,Si,wi,Hd,mm]),pm=C({role:kr,content:ce([so,L(so)]),_meta:ae(_(),pe()).optional()}),hm=yr.extend({messages:L(pm),modelPreferences:um.optional(),systemPrompt:_().optional(),includeContext:Se(["none","thisServer","allServers"]).optional(),temperature:X().optional(),maxTokens:X().int(),stopSequences:L(_()).optional(),metadata:Xe.optional(),tools:L(Fs).optional(),toolChoice:dm.optional()}),gm=Ye.extend({method:q("sampling/createMessage"),params:hm}),vm=Qe.extend({model:_(),stopReason:fe(Se(["endTurn","stopSequence","maxTokens"]).or(_())),role:kr,content:fm}),ym=Qe.extend({model:_(),stopReason:fe(Se(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:kr,content:ce([so,L(so)])}),Zs=C({type:q("boolean"),title:_().optional(),description:_().optional(),default:se().optional()}),Ri=C({type:q("string"),title:_().optional(),description:_().optional(),minLength:X().optional(),maxLength:X().optional(),format:Se(["email","uri","date","date-time"]).optional(),default:_().optional()}),Ii=C({type:Se(["number","integer"]),title:_().optional(),description:_().optional(),minimum:X().optional(),maximum:X().optional(),default:X().optional()}),Bs=C({type:q("string"),title:_().optional(),description:_().optional(),enum:L(_()),default:_().optional()}),Hs=C({type:q("string"),title:_().optional(),description:_().optional(),oneOf:L(C({const:_(),title:_()})),default:_().optional()}),Js=C({type:q("string"),title:_().optional(),description:_().optional(),enum:L(_()),enumNames:L(_()).optional(),default:_().optional()}),_m=ce([Bs,Hs]),Ks=C({type:q("array"),title:_().optional(),description:_().optional(),minItems:X().optional(),maxItems:X().optional(),items:C({type:q("string"),enum:L(_())}),default:L(_()).optional()}),Gs=C({type:q("array"),title:_().optional(),description:_().optional(),minItems:X().optional(),maxItems:X().optional(),items:C({anyOf:L(C({const:_(),title:_()}))}),default:L(_()).optional()}),$m=ce([Ks,Gs]),bm=ce([Js,_m,$m]),Ws=ce([bm,Zs,Ri,Ii]),xi=yr.extend({mode:q("form").optional(),message:_(),requestedSchema:C({type:q("object"),properties:ae(_(),Ws),required:L(_()).optional()}).catchall(pe())}),Sm=yr.extend({mode:q("url"),message:_(),elicitationId:_(),url:_().url()}),wm=ce([xi,Sm]),km=Ye.extend({method:q("elicitation/create"),params:wm}),zm=pt.extend({elicitationId:_()}),Rm=ht.extend({method:q("notifications/elicitation/complete"),params:zm}),Im=Qe.extend({action:Se(["accept","decline","cancel"]),content:Nn(e=>e===null?void 0:e,ae(_(),ce([_(),X(),se(),L(_())])).optional())}),xm=C({type:q("ref/resource"),uri:_()}),Tm=C({type:q("ref/prompt"),name:_()}),Pm=at.extend({ref:ce([Tm,xm]),argument:C({name:_(),value:_()}),context:C({arguments:ae(_(),_()).optional()}).optional()}),Em=Ye.extend({method:q("completion/complete"),params:Pm}),Cm=Qe.extend({completion:ye({values:L(_()).max(100),total:fe(X().int()),hasMore:fe(se())})}),Om=C({uri:_().startsWith("file://"),name:_().optional(),_meta:ae(_(),pe()).optional()}),Nm=Ye.extend({method:q("roots/list"),params:at.optional()}),jm=Qe.extend({roots:L(Om)}),Am=ht.extend({method:q("notifications/roots/list_changed"),params:pt.optional()}),L_=ye({ttl:X().optional(),pollInterval:X().optional()}),Mm=Se(["working","input_required","completed","failed","cancelled"]),Rr=C({taskId:_(),status:Mm,ttl:ce([X(),kn()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:fe(X()),statusMessage:fe(_())}),q_=Qe.extend({task:Rr}),Dm=pt.merge(Rr),V_=ht.extend({method:q("notifications/tasks/status"),params:Dm}),F_=Ye.extend({method:q("tasks/get"),params:at.extend({taskId:_()})}),Z_=Qe.merge(Rr),B_=Ye.extend({method:q("tasks/result"),params:at.extend({taskId:_()})}),H_=Qe.loose(),J_=Sr.extend({method:q("tasks/list")}),K_=wr.extend({tasks:L(Rr)}),G_=Ye.extend({method:q("tasks/cancel"),params:at.extend({taskId:_()})}),W_=Qe.merge(Rr),X_=ce([As,Os,pd,Em,am,Bd,Vd,$d,Sd,zd,Td,Ed,Od,rm,em]),Y_=ce([Cs,Ms,js,Am]),Q_=ce([Es,vm,ym,Im,jm]),e$=ce([As,gm,km,Nm]),t$=ce([Cs,Ms,cm,Ud,Id,om,Xd,jd,Rm]),n$=ce([Es,fd,hd,Cm,Wd,Fd,bd,wd,Rd,zi,tm,Md])});var st,o$,Um,Lm,i$,a$,s$,c$,r$,qm,Vm,l$,u$,d$,cR=G(()=>{Gu();st=di().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:C_.custom,message:"URL must be parseable",fatal:!0}),Ea}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),o$=ye({resource:_().url(),authorization_servers:L(st).optional(),jwks_uri:_().url().optional(),scopes_supported:L(_()).optional(),bearer_methods_supported:L(_()).optional(),resource_signing_alg_values_supported:L(_()).optional(),resource_name:_().optional(),resource_documentation:_().optional(),resource_policy_uri:_().url().optional(),resource_tos_uri:_().url().optional(),tls_client_certificate_bound_access_tokens:se().optional(),authorization_details_types_supported:L(_()).optional(),dpop_signing_alg_values_supported:L(_()).optional(),dpop_bound_access_tokens_required:se().optional()}),Um=ye({issuer:_(),authorization_endpoint:st,token_endpoint:st,registration_endpoint:st.optional(),scopes_supported:L(_()).optional(),response_types_supported:L(_()),response_modes_supported:L(_()).optional(),grant_types_supported:L(_()).optional(),token_endpoint_auth_methods_supported:L(_()).optional(),token_endpoint_auth_signing_alg_values_supported:L(_()).optional(),service_documentation:st.optional(),revocation_endpoint:st.optional(),revocation_endpoint_auth_methods_supported:L(_()).optional(),revocation_endpoint_auth_signing_alg_values_supported:L(_()).optional(),introspection_endpoint:_().optional(),introspection_endpoint_auth_methods_supported:L(_()).optional(),introspection_endpoint_auth_signing_alg_values_supported:L(_()).optional(),code_challenge_methods_supported:L(_()).optional(),client_id_metadata_document_supported:se().optional(),authorization_response_iss_parameter_supported:se().optional().catch(void 0),dpop_signing_alg_values_supported:L(_()).optional()}),Lm=ye({issuer:_(),authorization_endpoint:st,token_endpoint:st,userinfo_endpoint:st.optional(),jwks_uri:st,registration_endpoint:st.optional(),scopes_supported:L(_()).optional(),response_types_supported:L(_()),response_modes_supported:L(_()).optional(),grant_types_supported:L(_()).optional(),acr_values_supported:L(_()).optional(),subject_types_supported:L(_()),id_token_signing_alg_values_supported:L(_()),id_token_encryption_alg_values_supported:L(_()).optional(),id_token_encryption_enc_values_supported:L(_()).optional(),userinfo_signing_alg_values_supported:L(_()).optional(),userinfo_encryption_alg_values_supported:L(_()).optional(),userinfo_encryption_enc_values_supported:L(_()).optional(),request_object_signing_alg_values_supported:L(_()).optional(),request_object_encryption_alg_values_supported:L(_()).optional(),request_object_encryption_enc_values_supported:L(_()).optional(),token_endpoint_auth_methods_supported:L(_()).optional(),token_endpoint_auth_signing_alg_values_supported:L(_()).optional(),display_values_supported:L(_()).optional(),claim_types_supported:L(_()).optional(),claims_supported:L(_()).optional(),service_documentation:_().optional(),claims_locales_supported:L(_()).optional(),ui_locales_supported:L(_()).optional(),claims_parameter_supported:se().optional(),request_parameter_supported:se().optional(),request_uri_parameter_supported:se().optional(),require_request_uri_registration:se().optional(),op_policy_uri:st.optional(),op_tos_uri:st.optional(),client_id_metadata_document_supported:se().optional(),authorization_response_iss_parameter_supported:se().optional().catch(void 0)}),i$=C({...Lm.shape,...Um.pick({code_challenge_methods_supported:!0}).shape}),a$=C({access_token:_(),id_token:_().optional(),token_type:_(),expires_in:Ss.number().optional(),scope:_().optional(),refresh_token:_().optional(),issuer:_().optional().catch(void 0)}).strip(),s$=C({issued_token_type:q("urn:ietf:params:oauth:token-type:id-jag"),access_token:_(),token_type:_().optional(),expires_in:X().optional(),scope:_().optional()}).strip(),c$=C({error:_(),error_description:_().optional(),error_uri:_().optional()}),r$=st.optional().or(q("").transform(()=>{})),qm=C({redirect_uris:L(st),token_endpoint_auth_method:_().optional(),grant_types:L(_()).optional(),response_types:L(_()).optional(),application_type:_().optional(),client_name:_().optional(),client_uri:st.optional(),logo_uri:r$,scope:_().optional(),contacts:L(_()).optional(),tos_uri:r$,policy_uri:_().optional(),jwks_uri:st.optional(),jwks:Vu().optional(),software_id:_().optional(),software_version:_().optional(),software_statement:_().optional()}).strip(),Vm=C({client_id:_(),client_secret:_().optional(),client_id_issued_at:X().optional(),client_secret_expires_at:X().optional(),issuer:_().optional().catch(void 0)}).strip(),l$=qm.merge(Vm),u$=C({error:_(),error_description:_().optional()}).strip(),d$=C({token:_(),token_type_hint:_().optional()}).strip()});var lR=G(()=>{sR();cR()});function S$(e,t){let r=new Set,o=t;for(;typeof o=="function";){let n=o.mcpBrand;Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof n=="string"&&r.add(n),o=Object.getPrototypeOf(o)}r.size!==0&&Object.defineProperty(e,v$,{value:r,enumerable:!1,configurable:!0})}function Ci(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,v$)){let r=t[v$];if(r&&typeof r.has=="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}function PR(e){let t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function ER({requestedResource:e,configuredResource:t}){let r=typeof e=="string"?new URL(e):new URL(e.href),o=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==o.origin||r.pathname.length<o.pathname.length)return!1;let n=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=o.pathname.endsWith("/")?o.pathname:o.pathname+"/";return n.startsWith(i)}function CR(e){return Object.hasOwn(uR,e)?uR[e]:void 0}function dR(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Cj(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function OR(e){switch(e.method){case"elicitation/create":return e.params?.mode==="url"?{elicitation:{url:{}}}:{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;return t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0)?{sampling:{tools:{}}}:{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function rc(e,t){let r={};for(let[o,n]of Object.entries(e)){if(n===void 0)continue;let i=t===void 0?void 0:t[o];if(i===void 0){r[o]=n;continue}if(dR(n)&&dR(i)){let a={};for(let[s,c]of Object.entries(n))c!==void 0&&i[s]===void 0&&!Cj(o,s,i)&&(a[s]=c);Object.keys(a).length>0&&(r[o]=a)}}return Object.keys(r).length>0?r:void 0}function qn(e){return e>=NR}function jR(e){return e.filter(t=>!qn(t))}function Km(e){return e.filter(t=>qn(t))}function AR(e){let t=e.structuredContent;return t===void 0||!(typeof t!="object"||t===null||Array.isArray(t))||(e.content?.some(r=>r.type==="text")??!1)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}function w$(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||MR.some(t=>t in e)?e:{...e,content:[]}}function Oj(){let e=mr(()=>ce([_(),X(),se(),kn(),ae(_(),e),L(e)])),t=ae(_(),e),r=ce([_(),X().int()]),o=_(),n=C({ttl:X().optional()}),i=C({taskId:_()}),a=ye({progressToken:r.optional(),"io.modelcontextprotocol/related-task":i.optional()}),s=C({_meta:a.optional()}),c=s.extend({task:n.optional()}),l=C({method:_(),params:s.loose().optional()}),u=C({_meta:a.optional()}),d=C({method:_(),params:u.loose().optional()}),m=ye({_meta:a.optional()}),f=ce([_(),X().int()]),h=m.strict(),y=u.extend({requestId:f.optional(),reason:_().optional()}),v=d.extend({method:q("notifications/cancelled"),params:y}),p=C({src:_(),mimeType:_().optional(),sizes:L(_()).optional(),theme:Se(["light","dark"]).optional()}),b=C({icons:L(p).optional()}),g=C({name:_(),title:_().optional()}),S=g.extend({...g.shape,...b.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),T=un(C({applyDefaults:se().optional()}),t),R=Nn(mt=>mt&&typeof mt=="object"&&!Array.isArray(mt)&&Object.keys(mt).length===0?{form:{}}:mt,un(C({form:T.optional(),url:t.optional()}),t.optional())),w=ye({list:t.optional(),cancel:t.optional(),requests:ye({sampling:ye({createMessage:t.optional()}).optional(),elicitation:ye({create:t.optional()}).optional()}).optional()}),z=ye({list:t.optional(),cancel:t.optional(),requests:ye({tools:ye({call:t.optional()}).optional()}).optional()}),P=C({experimental:ae(_(),t).optional(),sampling:C({context:t.optional(),tools:t.optional()}).optional(),elicitation:R.optional(),roots:C({listChanged:se().optional()}).optional(),tasks:w.optional(),extensions:ae(_(),t).optional()}),U=s.extend({protocolVersion:_(),capabilities:P,clientInfo:S}),O=l.extend({method:q("initialize"),params:U}),D=C({experimental:ae(_(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:C({listChanged:se().optional()}).optional(),resources:C({subscribe:se().optional(),listChanged:se().optional()}).optional(),tools:C({listChanged:se().optional()}).optional(),tasks:z.optional(),extensions:ae(_(),t).optional()}),Y=m.extend({protocolVersion:_(),capabilities:D,serverInfo:S,instructions:_().optional()}),ee=d.extend({method:q("notifications/initialized"),params:u.optional()}),_e=l.extend({method:q("ping"),params:s.optional()}),Pe=C({progress:X(),total:fe(X()),message:fe(_())}),Re=C({...u.shape,...Pe.shape,progressToken:r}),Ze=d.extend({method:q("notifications/progress"),params:Re}),Te=s.extend({cursor:o.optional()}),N=l.extend({params:Te.optional()}),V=m.extend({nextCursor:o.optional()}),I=C({uri:_(),mimeType:fe(_()),_meta:ae(_(),pe()).optional()}),$=I.extend({text:_()}),k=_().refine(mt=>{try{return atob(mt),!0}catch{return!1}},{message:"Invalid Base64 string"}),x=I.extend({blob:k}),j=Se(["user","assistant"]),J=C({audience:L(j).optional(),priority:X().min(0).max(1).optional(),lastModified:Wt.datetime({offset:!0}).optional()}),oe=C({...g.shape,...b.shape,uri:_(),description:fe(_()),mimeType:fe(_()),size:fe(X()),annotations:J.optional(),_meta:fe(ye({}))}),re=C({...g.shape,...b.shape,uriTemplate:_(),description:fe(_()),mimeType:fe(_()),annotations:J.optional(),_meta:fe(ye({}))}),Ie=N.extend({method:q("resources/list")}),De=V.extend({resources:L(oe)}),E=N.extend({method:q("resources/templates/list")}),F=V.extend({resourceTemplates:L(re)}),K=s.extend({uri:_()}),me=K,he=l.extend({method:q("resources/read"),params:me}),ve=m.extend({contents:L(ce([$,x]))}),Ae=d.extend({method:q("notifications/resources/list_changed"),params:u.optional()}),Ke=K,Ue=l.extend({method:q("resources/subscribe"),params:Ke}),Ge=K,He=l.extend({method:q("resources/unsubscribe"),params:Ge}),Bt=u.extend({uri:_()}),ot=d.extend({method:q("notifications/resources/updated"),params:Bt}),In=C({name:_(),description:fe(_()),required:fe(se())}),rn=C({...g.shape,...b.shape,description:fe(_()),arguments:fe(L(In)),_meta:fe(ye({}))}),xn=N.extend({method:q("prompts/list")}),Hn=V.extend({prompts:L(rn)}),Jn=s.extend({name:_(),arguments:ae(_(),_()).optional()}),Or=l.extend({method:q("prompts/get"),params:Jn}),Nr=C({type:q("text"),text:_(),annotations:J.optional(),_meta:ae(_(),pe()).optional()}),jr=C({type:q("image"),data:k,mimeType:_(),annotations:J.optional(),_meta:ae(_(),pe()).optional()}),Ar=C({type:q("audio"),data:k,mimeType:_(),annotations:J.optional(),_meta:ae(_(),pe()).optional()}),Ji=C({type:q("tool_use"),name:_(),id:_(),input:ae(_(),pe()),_meta:ae(_(),pe()).optional()}),Kn=C({type:q("resource"),resource:ce([$,x]),annotations:J.optional(),_meta:ae(_(),pe()).optional()}),Ki=oe.extend({type:q("resource_link")}),Ht=ce([Nr,jr,Ar,Ki,Kn]),yo=C({role:j,content:Ht}),_o=m.extend({description:_().optional(),messages:L(yo)}),Mr=d.extend({method:q("notifications/prompts/list_changed"),params:u.optional()}),Gi=C({title:_().optional(),readOnlyHint:se().optional(),destructiveHint:se().optional(),idempotentHint:se().optional(),openWorldHint:se().optional()}),$o=C({taskSupport:Se(["required","optional","forbidden"]).optional()}),Dr=C({...g.shape,...b.shape,description:_().optional(),inputSchema:C({type:q("object"),properties:ae(_(),e).optional(),required:L(_()).optional()}).catchall(pe()),outputSchema:C({type:q("object"),properties:ae(_(),e).optional(),required:L(_()).optional()}).catchall(pe()).optional(),annotations:Gi.optional(),execution:$o.optional(),_meta:ae(_(),pe()).optional()}),bo=N.extend({method:q("tools/list")}),So=V.extend({tools:L(Dr)}),wo=m.extend({content:L(Ht),structuredContent:ae(_(),pe()).optional(),isError:se().optional()}),dt=c.extend({name:_(),arguments:ae(_(),pe()).optional()}),Wi=l.extend({method:q("tools/call"),params:dt}),bc=d.extend({method:q("notifications/tools/list_changed"),params:u.optional()}),ko=Se(["debug","info","notice","warning","error","critical","alert","emergency"]),Xi=s.extend({level:ko}),Yi=l.extend({method:q("logging/setLevel"),params:Xi}),Qi=u.extend({level:ko,logger:_().optional(),data:pe()}),ea=d.extend({method:q("notifications/message"),params:Qi}),ta=C({name:_().optional()}),na=C({hints:L(ta).optional(),costPriority:X().min(0).max(1).optional(),speedPriority:X().min(0).max(1).optional(),intelligencePriority:X().min(0).max(1).optional()}),ra=C({mode:Se(["auto","required","none"]).optional()}),Sc=C({type:q("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:L(Ht),structuredContent:C({}).loose().optional(),isError:se().optional(),_meta:ae(_(),pe()).optional()}),oa=dr("type",[Nr,jr,Ar]),Gn=dr("type",[Nr,jr,Ar,Ji,Sc]),ia=C({role:j,content:ce([Gn,L(Gn)]),_meta:ae(_(),pe()).optional()}),aa=c.extend({messages:L(ia),modelPreferences:na.optional(),systemPrompt:_().optional(),includeContext:Se(["none","thisServer","allServers"]).optional(),temperature:X().optional(),maxTokens:X().int(),stopSequences:L(_()).optional(),metadata:t.optional(),tools:L(Dr).optional(),toolChoice:ra.optional()}),sa=l.extend({method:q("sampling/createMessage"),params:aa}),ca=m.extend({model:_(),stopReason:fe(Se(["endTurn","stopSequence","maxTokens"]).or(_())),role:j,content:oa}),la=m.extend({model:_(),stopReason:fe(Se(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:j,content:ce([Gn,L(Gn)])}),ua=C({type:q("boolean"),title:_().optional(),description:_().optional(),default:se().optional()}),da=C({type:q("string"),title:_().optional(),description:_().optional(),minLength:X().optional(),maxLength:X().optional(),format:Se(["email","uri","date","date-time"]).optional(),default:_().optional()}),ma=C({type:Se(["number","integer"]),title:_().optional(),description:_().optional(),minimum:X().optional(),maximum:X().optional(),default:X().optional()}),fa=C({type:q("string"),title:_().optional(),description:_().optional(),enum:L(_()),default:_().optional()}),pa=C({type:q("string"),title:_().optional(),description:_().optional(),oneOf:L(C({const:_(),title:_()})),default:_().optional()}),ha=C({type:q("string"),title:_().optional(),description:_().optional(),enum:L(_()),enumNames:L(_()).optional(),default:_().optional()}),ga=ce([fa,pa]),Ur=C({type:q("array"),title:_().optional(),description:_().optional(),minItems:X().optional(),maxItems:X().optional(),items:C({type:q("string"),enum:L(_())}),default:L(_()).optional()}),Lr=C({type:q("array"),title:_().optional(),description:_().optional(),minItems:X().optional(),maxItems:X().optional(),items:C({anyOf:L(C({const:_(),title:_()}))}),default:L(_()).optional()}),wc=ce([Ur,Lr]),kc=ce([ha,ga,wc]),Nt=ce([kc,ua,da,ma]),jt=c.extend({mode:q("form").optional(),message:_(),requestedSchema:C({type:q("object"),properties:ae(_(),Nt),required:L(_()).optional()}).catchall(pe())}),va=c.extend({mode:q("url"),message:_(),elicitationId:_(),url:_().url()}),on=ce([jt,va]),zc=l.extend({method:q("elicitation/create"),params:on}),Rc=u.extend({elicitationId:_()}),Ic=d.extend({method:q("notifications/elicitation/complete"),params:Rc}),xc=m.extend({action:Se(["accept","decline","cancel"]),content:Nn(mt=>mt===null?void 0:mt,ae(_(),ce([_(),X(),se(),L(_())])).optional())}),Tc=C({type:q("ref/resource"),uri:_()}),Pc=C({type:q("ref/prompt"),name:_()}),Ec=s.extend({ref:ce([Pc,Tc]),argument:C({name:_(),value:_()}),context:C({arguments:ae(_(),_()).optional()}).optional()}),ya=l.extend({method:q("completion/complete"),params:Ec}),Cc=m.extend({completion:ye({values:L(_()).max(100),total:fe(X().int()),hasMore:fe(se())})}),Oc=C({uri:_().startsWith("file://"),name:_().optional(),_meta:ae(_(),pe()).optional()}),zo=l.extend({method:q("roots/list"),params:s.optional()}),_a=m.extend({roots:L(Oc)}),Nc=d.extend({method:q("notifications/roots/list_changed"),params:u.optional()}),jc=ye({ttl:X().optional(),pollInterval:X().optional()}),$a=Se(["working","input_required","completed","failed","cancelled"]),Wn=C({taskId:_(),status:$a,ttl:ce([X(),kn()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:fe(X()),statusMessage:fe(_())}),Rt=m.extend({task:Wn}),Ac=u.merge(Wn),qr=d.extend({method:q("notifications/tasks/status"),params:Ac}),Ro=l.extend({method:q("tasks/get"),params:s.extend({taskId:_()})}),Io=m.merge(Wn),xo=l.extend({method:q("tasks/result"),params:s.extend({taskId:_()})}),rp=m.loose(),vt=N.extend({method:q("tasks/list")}),tt=V.extend({tasks:L(Wn)}),Vr=l.extend({method:q("tasks/cancel"),params:s.extend({taskId:_()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:i,RequestMetaSchema:a,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:m,RequestIdSchema:f,EmptyResultSchema:h,CancelledNotificationParamsSchema:y,CancelledNotificationSchema:v,IconSchema:p,IconsSchema:b,BaseMetadataSchema:g,ImplementationSchema:S,ClientTasksCapabilitySchema:w,ServerTasksCapabilitySchema:z,ClientCapabilitiesSchema:P,InitializeRequestParamsSchema:U,InitializeRequestSchema:O,ServerCapabilitiesSchema:D,InitializeResultSchema:Y,InitializedNotificationSchema:ee,PingRequestSchema:_e,ProgressSchema:Pe,ProgressNotificationParamsSchema:Re,ProgressNotificationSchema:Ze,PaginatedRequestParamsSchema:Te,PaginatedRequestSchema:N,PaginatedResultSchema:V,ResourceContentsSchema:I,TextResourceContentsSchema:$,BlobResourceContentsSchema:x,RoleSchema:j,AnnotationsSchema:J,ResourceSchema:oe,ResourceTemplateSchema:re,ListResourcesRequestSchema:Ie,ListResourcesResultSchema:De,ListResourceTemplatesRequestSchema:E,ListResourceTemplatesResultSchema:F,ResourceRequestParamsSchema:K,ReadResourceRequestParamsSchema:me,ReadResourceRequestSchema:he,ReadResourceResultSchema:ve,ResourceListChangedNotificationSchema:Ae,SubscribeRequestParamsSchema:Ke,SubscribeRequestSchema:Ue,UnsubscribeRequestParamsSchema:Ge,UnsubscribeRequestSchema:He,ResourceUpdatedNotificationParamsSchema:Bt,ResourceUpdatedNotificationSchema:ot,PromptArgumentSchema:In,PromptSchema:rn,ListPromptsRequestSchema:xn,ListPromptsResultSchema:Hn,GetPromptRequestParamsSchema:Jn,GetPromptRequestSchema:Or,TextContentSchema:Nr,ImageContentSchema:jr,AudioContentSchema:Ar,ToolUseContentSchema:Ji,EmbeddedResourceSchema:Kn,ResourceLinkSchema:Ki,ContentBlockSchema:Ht,PromptMessageSchema:yo,GetPromptResultSchema:_o,PromptListChangedNotificationSchema:Mr,ToolAnnotationsSchema:Gi,ToolExecutionSchema:$o,ToolSchema:Dr,ListToolsRequestSchema:bo,ListToolsResultSchema:So,CallToolResultSchema:wo,CallToolRequestParamsSchema:dt,CallToolRequestSchema:Wi,ToolListChangedNotificationSchema:bc,LoggingLevelSchema:ko,SetLevelRequestParamsSchema:Xi,SetLevelRequestSchema:Yi,LoggingMessageNotificationParamsSchema:Qi,LoggingMessageNotificationSchema:ea,ModelHintSchema:ta,ModelPreferencesSchema:na,ToolChoiceSchema:ra,ToolResultContentSchema:Sc,SamplingContentSchema:oa,SamplingMessageContentBlockSchema:Gn,SamplingMessageSchema:ia,CreateMessageRequestParamsSchema:aa,CreateMessageRequestSchema:sa,CreateMessageResultSchema:ca,CreateMessageResultWithToolsSchema:la,BooleanSchemaSchema:ua,StringSchemaSchema:da,NumberSchemaSchema:ma,UntitledSingleSelectEnumSchemaSchema:fa,TitledSingleSelectEnumSchemaSchema:pa,LegacyTitledEnumSchemaSchema:ha,SingleSelectEnumSchemaSchema:ga,UntitledMultiSelectEnumSchemaSchema:Ur,TitledMultiSelectEnumSchemaSchema:Lr,MultiSelectEnumSchemaSchema:wc,EnumSchemaSchema:kc,PrimitiveSchemaDefinitionSchema:Nt,ElicitRequestFormParamsSchema:jt,ElicitRequestURLParamsSchema:va,ElicitRequestParamsSchema:on,ElicitRequestSchema:zc,ElicitationCompleteNotificationParamsSchema:Rc,ElicitationCompleteNotificationSchema:Ic,ElicitResultSchema:xc,ResourceTemplateReferenceSchema:Tc,PromptReferenceSchema:Pc,CompleteRequestParamsSchema:Ec,CompleteRequestSchema:ya,CompleteResultSchema:Cc,RootSchema:Oc,ListRootsRequestSchema:zo,ListRootsResultSchema:_a,RootsListChangedNotificationSchema:Nc,TaskCreationParamsSchema:jc,TaskStatusSchema:$a,TaskSchema:Wn,CreateTaskResultSchema:Rt,TaskStatusNotificationParamsSchema:Ac,TaskStatusNotificationSchema:qr,GetTaskRequestSchema:Ro,GetTaskResultSchema:Io,GetTaskPayloadRequestSchema:xo,GetTaskPayloadResultSchema:rp,ListTasksRequestSchema:vt,ListTasksResultSchema:tt,CancelTaskRequestSchema:Vr,CancelTaskResultSchema:m.merge(Wn),ClientRequestSchema:ce([_e,O,ya,Yi,Or,xn,Ie,E,he,Ue,He,Wi,bo,Ro,xo,vt,Vr]),ClientNotificationSchema:ce([v,Ze,ee,Nc,qr]),ClientResultSchema:ce([h,ca,la,xc,_a,Io,tt,Rt]),ServerRequestSchema:ce([_e,sa,zc,zo,Ro,xo,vt,Vr]),ServerNotificationSchema:ce([v,Ze,ea,ot,Ae,bc,Mr,qr,Ic]),ServerResultSchema:ce([h,Y,Cc,_o,Hn,De,F,ve,wo,So,Io,tt,Rt]),CallToolResultWireSchema:pe().superRefine((mt,PP)=>{if(!(typeof mt!="object"||mt===null||Array.isArray(mt)||mt.content!==void 0)){for(let Wb of MR)if(Wb in mt){PP.addIssue({code:"custom",message:`content is required when the body carries '${Wb}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(w$).pipe(wo)}}function k$(){return Nj??=Oj()}function DR(e){return e.type!=="object"}function mR(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Mj(e){let t=typeof e.$schema=="string"?e.$schema:void 0;if(mR(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=Qb(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,i)=>{if(Array.isArray(n))return n.map(c=>o(c,!1));if(n===null||typeof n!="object"||!i&&mR(n.$id))return n;let a={},s=!1;for(let[c,l]of Object.entries(n))i?a[c]=o(l,!1):(c==="$ref"||c==="$dynamicRef")&&typeof l=="string"?a[c]=l==="#"?"#/properties/result":l.startsWith("#/")?`#/properties/result${l.slice(1)}`:l:c==="$recursiveRef"&&l==="#"&&r?s=!0:jj.has(c)?a[c]=l:Aj.has(c)?a[c]=o(l,!0):a[c]=o(l,!1);return s&&("$ref"in a?a.allOf=[...Array.isArray(a.allOf)?a.allOf:[],{$ref:"#/properties/result"}]:a.$ref="#/properties/result"),a};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}function Gm(){if(Fm)return Fm;let e=k$();return Fm={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}},Fm}function Uj(){Gm()}function qR(e){return Object.prototype.hasOwnProperty.call(UR,e)}function VR(e){return Object.prototype.hasOwnProperty.call(LR,e)}function Lj(e){return Object.prototype.hasOwnProperty.call(Dj,e)}function qj(e){return Lj(e)?Gm().resultSchemas[e]:void 0}function Vj(e){return qR(e)?Gm().requestSchemas[e]:void 0}function Fj(e){return VR(e)?Gm().notificationSchemas[e]:void 0}function y$(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Zm(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}function pR(e){return y$(e)&&y$(e.outputSchema)&&DR(e.outputSchema)}function Zj(){let e=mr(()=>ce([_(),X(),se(),kn(),ae(_(),e),L(e)])),t=ae(_(),e),r=ce([_(),X().int()]),o=_(),n=ce([_(),X().int()]),i=Se(["user","assistant"]),a=Se(["debug","info","notice","warning","error","critical","alert","emergency"]),s=_().refine(tt=>{try{return atob(tt),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=C({ttl:X().optional()}),l=C({taskId:_()}),u=ye({progressToken:r.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=C({_meta:u.optional()}),m=d.extend({task:c.optional()}),f=C({_meta:u.optional()}),h=C({method:_(),params:f.loose().optional()}),y=C({src:_(),mimeType:_().optional(),sizes:L(_()).optional(),theme:Se(["light","dark"]).optional()}),v=C({icons:L(y).optional()}),p=C({name:_(),title:_().optional()}),b=p.extend({...p.shape,...v.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),g=un(C({applyDefaults:se().optional()}),t),S=Nn(tt=>tt&&typeof tt=="object"&&!Array.isArray(tt)&&Object.keys(tt).length===0?{form:{}}:tt,un(C({form:g.optional(),url:t.optional()}),t.optional())),T=ye({list:t.optional(),cancel:t.optional(),requests:ye({sampling:ye({createMessage:t.optional()}).optional(),elicitation:ye({create:t.optional()}).optional()}).optional()}),R=ye({list:t.optional(),cancel:t.optional(),requests:ye({tools:ye({call:t.optional()}).optional()}).optional()}),w=C({experimental:ae(_(),t).optional(),sampling:C({context:t.optional(),tools:t.optional()}).optional(),elicitation:S.optional(),roots:C({listChanged:se().optional()}).optional(),tasks:T.optional(),extensions:ae(_(),t).optional()}),z=C({experimental:ae(_(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:C({listChanged:se().optional()}).optional(),resources:C({subscribe:se().optional(),listChanged:se().optional()}).optional(),tools:C({listChanged:se().optional()}).optional(),tasks:R.optional(),extensions:ae(_(),t).optional()}),P=C({progress:X(),total:fe(X()),message:fe(_())}),U=C({...f.shape,...P.shape,progressToken:r}),O=h.extend({method:q("notifications/progress"),params:U}),D=f.extend({level:a,logger:_().optional(),data:pe()}),Y=h.extend({method:q("notifications/message"),params:D}),ee=C({uri:_(),mimeType:fe(_()),_meta:ae(_(),pe()).optional()}),_e=ee.extend({text:_()}),Pe=ee.extend({blob:s}),Re=C({audience:L(i).optional(),priority:X().min(0).max(1).optional(),lastModified:Wt.datetime({offset:!0}).optional()}),Ze=C({...p.shape,...v.shape,uri:_(),description:fe(_()),mimeType:fe(_()),size:fe(X()),annotations:Re.optional(),_meta:fe(ye({}))}),Te=C({...p.shape,...v.shape,uriTemplate:_(),description:fe(_()),mimeType:fe(_()),annotations:Re.optional(),_meta:fe(ye({}))}),N=h.extend({method:q("notifications/resources/list_changed"),params:f.optional()}),V=f.extend({uri:_()}),I=h.extend({method:q("notifications/resources/updated"),params:V}),$=C({name:_(),description:fe(_()),required:fe(se())}),k=C({...p.shape,...v.shape,description:fe(_()),arguments:fe(L($)),_meta:fe(ye({}))}),x=h.extend({method:q("notifications/prompts/list_changed"),params:f.optional()}),j=C({type:q("text"),text:_(),annotations:Re.optional(),_meta:ae(_(),pe()).optional()}),J=C({type:q("image"),data:s,mimeType:_(),annotations:Re.optional(),_meta:ae(_(),pe()).optional()}),oe=C({type:q("audio"),data:s,mimeType:_(),annotations:Re.optional(),_meta:ae(_(),pe()).optional()}),re=C({type:q("tool_use"),name:_(),id:_(),input:ae(_(),pe()),_meta:ae(_(),pe()).optional()}),Ie=C({type:q("resource"),resource:ce([_e,Pe]),annotations:Re.optional(),_meta:ae(_(),pe()).optional()}),De=Ze.extend({type:q("resource_link")}),E=ce([j,J,oe,De,Ie]),F=C({role:i,content:E}),K=C({title:_().optional(),readOnlyHint:se().optional(),destructiveHint:se().optional(),idempotentHint:se().optional(),openWorldHint:se().optional()}),me=h.extend({method:q("notifications/tools/list_changed"),params:f.optional()}),he=C({name:_().optional()}),ve=C({hints:L(he).optional(),costPriority:X().min(0).max(1).optional(),speedPriority:X().min(0).max(1).optional(),intelligencePriority:X().min(0).max(1).optional()}),Ae=C({mode:Se(["auto","required","none"]).optional()}),Ke=C({type:q("boolean"),title:_().optional(),description:_().optional(),default:se().optional()}),Ue=C({type:q("string"),title:_().optional(),description:_().optional(),minLength:X().optional(),maxLength:X().optional(),format:Se(["email","uri","date","date-time"]).optional(),default:_().optional()}),Ge=C({type:Se(["number","integer"]),title:_().optional(),description:_().optional(),minimum:X().optional(),maximum:X().optional(),default:X().optional()}),He=C({type:q("string"),title:_().optional(),description:_().optional(),enum:L(_()),default:_().optional()}),Bt=C({type:q("string"),title:_().optional(),description:_().optional(),oneOf:L(C({const:_(),title:_()})),default:_().optional()}),ot=C({type:q("string"),title:_().optional(),description:_().optional(),enum:L(_()),enumNames:L(_()).optional(),default:_().optional()}),In=ce([He,Bt]),rn=C({type:q("array"),title:_().optional(),description:_().optional(),minItems:X().optional(),maxItems:X().optional(),items:C({type:q("string"),enum:L(_())}),default:L(_()).optional()}),xn=C({type:q("array"),title:_().optional(),description:_().optional(),minItems:X().optional(),maxItems:X().optional(),items:C({anyOf:L(C({const:_(),title:_()}))}),default:L(_()).optional()}),Hn=ce([rn,xn]),Jn=ce([ot,In,Hn]),Or=ce([Jn,Ke,Ue,Ge]),Nr=m.extend({mode:q("form").optional(),message:_(),requestedSchema:C({type:q("object"),properties:ae(_(),Or),required:L(_()).optional()}).catchall(pe())}),jr=C({type:q("ref/resource"),uri:_()}),Ar=C({type:q("ref/prompt"),name:_()}),Ji=C({uri:_().startsWith("file://"),name:_().optional(),_meta:ae(_(),pe()).optional()}),Kn=w.shape,Ki=C({experimental:Kn.experimental,sampling:Kn.sampling,elicitation:Kn.elicitation,roots:Kn.roots,extensions:Kn.extensions}),Ht=z.shape,yo=C({experimental:Ht.experimental,logging:Ht.logging,completions:Ht.completions,prompts:Ht.prompts,resources:Ht.resources,tools:Ht.tools,extensions:Ht.extensions}),_o=ye({progressToken:r.optional(),[Ut]:_(),[gr]:b.optional(),[dn]:Ki,[Mn]:a.optional()}),Mr=C({...p.shape,...v.shape,description:_().optional(),inputSchema:ye({$schema:_().optional(),type:q("object")}),outputSchema:ye({$schema:_().optional()}).optional(),annotations:K.optional(),_meta:ae(_(),pe()).optional()}),Gi=C({type:q("tool_result"),toolUseId:_(),content:L(E),structuredContent:pe().optional(),isError:se().optional(),_meta:ae(_(),pe()).optional()}),$o=ce([j,J,oe,re,Gi]),Dr=C({role:i,content:ce([$o,L($o)]),_meta:ae(_(),pe()).optional()}),bo=_(),So=ye({[Xt]:b.optional().catch(void 0)}),wo=So.optional();function dt(tt){return ye({_meta:wo,resultType:bo.default("complete"),...tt})}let Wi=dt({}),bc=dt({nextCursor:o.optional()}),ko=dt({content:L(E),structuredContent:pe().optional(),isError:se().optional()}),Xi=dt({ttlMs:X().int().min(0),cacheScope:Se(["public","private"]),tools:L(Mr),nextCursor:o.optional()}),Yi=dt({ttlMs:X().int().min(0),cacheScope:Se(["public","private"]),prompts:L(k),nextCursor:o.optional()}),Qi=dt({description:_().optional(),messages:L(F)}),ea=dt({ttlMs:X().int().min(0),cacheScope:Se(["public","private"]),resources:L(Ze),nextCursor:o.optional()}),ta=dt({ttlMs:X().int().min(0),cacheScope:Se(["public","private"]),resourceTemplates:L(Te),nextCursor:o.optional()}),na=dt({ttlMs:X().int().min(0),cacheScope:Se(["public","private"]),contents:L(ce([_e,Pe]))}),ra=dt({completion:C({values:L(_()).max(100),total:X().int().optional(),hasMore:se().optional()}).loose()}),Sc=dt({ttlMs:X().int().min(0),cacheScope:Se(["public","private"])}),oa=dt({ttlMs:X().int().min(0).catch(0),cacheScope:Se(["public","private"]).catch("private"),supportedVersions:L(_()),capabilities:yo,instructions:_().optional()}),Gn=C({messages:L(Dr),modelPreferences:ve.optional(),systemPrompt:_().optional(),includeContext:Se(["none","thisServer","allServers"]).optional(),temperature:X().optional(),maxTokens:X().int(),stopSequences:L(_()).optional(),metadata:t.optional(),tools:L(Mr).optional(),toolChoice:Ae.optional()}),ia=C({method:q("sampling/createMessage"),params:Gn}),aa=C({method:q("roots/list"),params:C({_meta:ae(_(),pe()).optional()}).optional()}),sa=C({...Dr.shape,model:_(),stopReason:_().optional()}),ca=C({roots:L(Ji)}),la=C({action:Se(["accept","decline","cancel"]),content:ae(_(),ce([_(),X(),se(),L(_())])).optional()}),ua=C({mode:q("url"),message:_(),url:_().url()}),da=ce([Nr,ua]),ma=C({method:q("elicitation/create"),params:da}),fa=ce([ia,aa,ma]),pa=ce([sa,ca,la]),ha=ae(_(),fa),ga=ae(_(),pa),Ur=dt({inputRequests:ha.optional(),requestState:_().optional()}),Lr={inputResponses:ga.optional(),requestState:_().optional()},wc=C({_meta:_o,...Lr}),kc=ye({progressToken:r.optional()});function Nt(tt,Vr){return C({method:q(tt),params:C({_meta:_o,...Vr})})}function jt(tt,Vr){return C({method:q(tt),params:C({_meta:kc.optional(),...Vr}).optional()})}let va={name:_(),arguments:ae(_(),pe()).optional(),...Lr},on={cursor:o.optional()},zc=Nt("tools/call",va),Rc=Nt("tools/list",on),Ic=Nt("prompts/list",on),xc=Nt("prompts/get",{name:_(),arguments:ae(_(),_()).optional(),...Lr}),Tc=Nt("resources/list",on),Pc=Nt("resources/templates/list",on),Ec=Nt("resources/read",{uri:_(),...Lr}),ya={ref:ce([Ar,jr]),argument:C({name:_(),value:_()}),context:C({arguments:ae(_(),_()).optional()}).optional()},Cc=Nt("completion/complete",ya),Oc=Nt("server/discover",{}),zo=C({toolsListChanged:se().optional(),promptsListChanged:se().optional(),resourcesListChanged:se().optional(),resourceSubscriptions:L(_()).optional()}),_a={notifications:zo},Nc=Nt("subscriptions/listen",_a),jc=So.extend({"io.modelcontextprotocol/subscriptionId":n}),$a=ye({_meta:jc,resultType:bo.default("complete")}),Wn={"tools/call":jt("tools/call",va),"tools/list":jt("tools/list",on),"prompts/get":jt("prompts/get",{name:_(),arguments:ae(_(),_()).optional()}),"prompts/list":jt("prompts/list",on),"resources/list":jt("resources/list",on),"resources/templates/list":jt("resources/templates/list",on),"resources/read":jt("resources/read",{uri:_()}),"completion/complete":jt("completion/complete",ya),"server/discover":jt("server/discover",{}),"subscriptions/listen":jt("subscriptions/listen",_a)};function Rt(tt){return ye({_meta:wo,...tt})}let Ac={"tools/call":Rt({content:L(E),structuredContent:pe().optional(),isError:se().optional()}),"tools/list":Rt({ttlMs:X().int().min(0),cacheScope:Se(["public","private"]),tools:L(Mr),nextCursor:o.optional()}),"prompts/get":Rt({description:_().optional(),messages:L(F)}),"prompts/list":Rt({ttlMs:X().int().min(0),cacheScope:Se(["public","private"]),prompts:L(k),nextCursor:o.optional()}),"resources/list":Rt({ttlMs:X().int().min(0),cacheScope:Se(["public","private"]),resources:L(Ze),nextCursor:o.optional()}),"resources/templates/list":Rt({ttlMs:X().int().min(0),cacheScope:Se(["public","private"]),resourceTemplates:L(Te),nextCursor:o.optional()}),"resources/read":Rt({ttlMs:X().int().min(0),cacheScope:Se(["public","private"]),contents:L(ce([_e,Pe]))}),"completion/complete":Rt({completion:C({values:L(_()).max(100),total:X().int().optional(),hasMore:se().optional()}).loose()}),"server/discover":Rt({ttlMs:X().int().min(0).catch(0),cacheScope:Se(["public","private"]).catch("private"),supportedVersions:L(_()),capabilities:yo,instructions:_().optional()}),"subscriptions/listen":Rt({})},qr=ye({"io.modelcontextprotocol/subscriptionId":n.optional()}),Ro=C({method:q("notifications/subscriptions/acknowledged"),params:C({_meta:qr.optional(),notifications:zo})}),Io=C({_meta:qr.optional(),requestId:n,reason:_().optional()}),xo=C({method:q("notifications/cancelled"),params:Io}),rp={"notifications/cancelled":xo,"notifications/progress":O,"notifications/message":Y,"notifications/resources/updated":I,"notifications/resources/list_changed":N,"notifications/tools/list_changed":me,"notifications/prompts/list_changed":x,"notifications/subscriptions/acknowledged":Ro},vt=tt=>C({jsonrpc:q("2.0"),id:ce([_(),X().int()]),result:tt}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:i,LoggingLevelSchema:a,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:m,NotificationsParamsSchema:f,NotificationSchema:h,IconSchema:y,IconsSchema:v,BaseMetadataSchema:p,ImplementationSchema:b,ClientTasksCapabilitySchema:T,ServerTasksCapabilitySchema:R,ClientCapabilitiesSchema:w,ServerCapabilitiesSchema:z,ProgressSchema:P,ProgressNotificationParamsSchema:U,ProgressNotificationSchema:O,LoggingMessageNotificationParamsSchema:D,LoggingMessageNotificationSchema:Y,ResourceContentsSchema:ee,TextResourceContentsSchema:_e,BlobResourceContentsSchema:Pe,AnnotationsSchema:Re,ResourceSchema:Ze,ResourceTemplateSchema:Te,ResourceListChangedNotificationSchema:N,ResourceUpdatedNotificationParamsSchema:V,ResourceUpdatedNotificationSchema:I,PromptArgumentSchema:$,PromptSchema:k,PromptListChangedNotificationSchema:x,TextContentSchema:j,ImageContentSchema:J,AudioContentSchema:oe,ToolUseContentSchema:re,EmbeddedResourceSchema:Ie,ResourceLinkSchema:De,ContentBlockSchema:E,PromptMessageSchema:F,ToolAnnotationsSchema:K,ToolListChangedNotificationSchema:me,ModelHintSchema:he,ModelPreferencesSchema:ve,ToolChoiceSchema:Ae,BooleanSchemaSchema:Ke,StringSchemaSchema:Ue,NumberSchemaSchema:Ge,UntitledSingleSelectEnumSchemaSchema:He,TitledSingleSelectEnumSchemaSchema:Bt,LegacyTitledEnumSchemaSchema:ot,SingleSelectEnumSchemaSchema:In,UntitledMultiSelectEnumSchemaSchema:rn,TitledMultiSelectEnumSchemaSchema:xn,MultiSelectEnumSchemaSchema:Hn,EnumSchemaSchema:Jn,PrimitiveSchemaDefinitionSchema:Or,ElicitRequestFormParamsSchema:Nr,ResourceTemplateReferenceSchema:jr,PromptReferenceSchema:Ar,RootSchema:Ji,ClientCapabilities2026Schema:Ki,ServerCapabilities2026Schema:yo,RequestMetaEnvelopeSchema:_o,ToolSchema:Mr,ToolResultContentSchema:Gi,SamplingMessageContentBlockSchema:$o,SamplingMessageSchema:Dr,ResultTypeSchema:bo,ResultMetaSchema:So,ResultSchema:Wi,PaginatedResultSchema:bc,CallToolResultSchema:ko,ListToolsResultSchema:Xi,ListPromptsResultSchema:Yi,GetPromptResultSchema:Qi,ListResourcesResultSchema:ea,ListResourceTemplatesResultSchema:ta,ReadResourceResultSchema:na,CompleteResultSchema:ra,CacheableResultSchema:Sc,DiscoverResultSchema:oa,CreateMessageRequestParamsSchema:Gn,CreateMessageRequestSchema:ia,ListRootsRequestSchema:aa,CreateMessageResultSchema:sa,ListRootsResultSchema:ca,ElicitResultSchema:la,ElicitRequestURLParamsSchema:ua,ElicitRequestParamsSchema:da,ElicitRequestSchema:ma,InputRequestSchema:fa,InputResponseSchema:pa,InputRequestsSchema:ha,InputResponsesSchema:ga,InputRequiredResultSchema:Ur,InputResponseRequestParamsSchema:wc,CallToolRequestSchema:zc,ListToolsRequestSchema:Rc,ListPromptsRequestSchema:Ic,GetPromptRequestSchema:xc,ListResourcesRequestSchema:Tc,ListResourceTemplatesRequestSchema:Pc,ReadResourceRequestSchema:Ec,CompleteRequestSchema:Cc,DiscoverRequestSchema:Oc,SubscriptionFilterSchema:zo,SubscriptionsListenRequestSchema:Nc,SubscriptionsListenResultMetaSchema:jc,SubscriptionsListenResultSchema:$a,dispatchRequestSchemas:Wn,dispatchResultSchemas:Ac,NotificationMetaSchema:qr,SubscriptionsAcknowledgedNotificationSchema:Ro,CancelledNotificationParamsSchema:Io,CancelledNotificationSchema:xo,notificationSchemas2026:rp,JSONRPCResultResponseSchema:vt(Wi),CallToolResultResponseSchema:vt(ce([ko,Ur])),ListToolsResultResponseSchema:vt(Xi),ListPromptsResultResponseSchema:vt(Yi),GetPromptResultResponseSchema:vt(ce([Qi,Ur])),ListResourcesResultResponseSchema:vt(ea),ListResourceTemplatesResultResponseSchema:vt(ta),ReadResourceResultResponseSchema:vt(ce([na,Ur])),CompleteResultResponseSchema:vt(ra),DiscoverResultResponseSchema:vt(oa),SubscriptionsListenResultResponseSchema:vt($a)}}function Un(){return Bj??=Zj()}function Jj(e){return Hj.includes(e)}function Wm(e,t){if(t===void 0)return e;let r=e[Pi];if(r===void 0)return{...e,[Pi]:t};let o={},n=r.ttlMs??t.ttlMs;n!==void 0&&(o.ttlMs=n);let i=r.cacheScope??t.cacheScope;return i!==void 0&&(o.cacheScope=i),{...e,[Pi]:o}}function Kj(e){return e[Pi]}function R$(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function I$(e){return e==="public"||e==="private"}function x$(e,t){if(e.ttlMs!==void 0&&!R$(e.ttlMs))throw new RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!I$(e.cacheScope))throw new RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}function Yj(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete"||Xj.includes(e))return t;throw new de(Q.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Qj(e,t){let r=Kj(t);if(t.resultType!=="complete"||!Jj(e))return r===void 0?t:oA(t);let o=t,n=R$(o.ttlMs)?o.ttlMs:nA(r),i=I$(o.cacheScope)?o.cacheScope:rA(r),a={...o,ttlMs:n,cacheScope:i};return delete a[Pi],a}function eA(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function tA(e,t){if(t===void 0)return e;let r=e._meta;return r===void 0?{...e,_meta:{[Xt]:t}}:!eA(r)||r[Xt]!==void 0?e:{...e,_meta:{...r,[Xt]:t}}}function nA(e){return e!==void 0&&R$(e.ttlMs)?e.ttlMs:Gj}function rA(e){return e!==void 0&&I$(e.cacheScope)?e.cacheScope:Wj}function oA(e){let t={...e};return delete t[Pi],t}function P$(){if(Bm)return Bm;let e=Un();return Bm={request:{"elicitation/create":C({method:q("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":C({method:q("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":C({method:q("roots/list"),params:ye({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Bm}function aA(){P$()}function ZR(e){return iA.includes(e)}function m$(e){return ZR(e)?P$().request[e]:void 0}function sA(e){return ZR(e)?P$().response[e]:void 0}function HR(e){return Object.prototype.hasOwnProperty.call(E$,e)}function JR(e){return Object.prototype.hasOwnProperty.call(BR,e)}function cA(e){return Object.prototype.hasOwnProperty.call(E$,e)}function lA(e){return HR(e)?Un().dispatchRequestSchemas[e]:void 0}function uA(e){return cA(e)?Un().dispatchResultSchemas[e]:void 0}function dA(e){return JR(e)?Un().notificationSchemas2026[e]:void 0}function Qs(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Xs(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}function pA(e,t){let r=t,o=!1,n=()=>(o||(r={...r},o=!0),r),i=t.tools;e==="tools/list"&&Array.isArray(i)&&i.some(s=>Qs(s)&&"execution"in s)&&(n().tools=i.map(s=>{if(!Qs(s)||!("execution"in s))return s;let c={...s};return delete c.execution,c}));let a=t.capabilities;if(Qs(a)&&"tasks"in a){let s={...a};delete s.tasks,n().capabilities=s}return r}function KR(){if(Hm)return Hm;let e=Un();return Hm={"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},Hm}function hA(){KR()}function Ln(e){return e!==void 0&&qn(e)?C$:z$}function hR(e){return e.revision!==void 0?Ln(e.revision).era:e.era==="modern"?C$.era:z$.era}function f$(e){return GR.some(t=>t.hasRequestMethod(e))}function p$(e){return GR.some(t=>t.hasNotificationMethod(e))}function gR(e){return e==="tasks/get"||e==="tasks/cancel"}function vR(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function fn(e){if(!vR(e))return;let t=e._meta;return vR(t)?t:void 0}function mo(e){let t=fn(e);return t!==void 0&&Ut in t}function ji(e){let t=fn(e)?.[Ut];return typeof t=="string"?t:void 0}function uo(e){return Ln(ic).validateEnvelopeMeta(e)}function WR(e){return $r.parse(e)}function Ym(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Qm(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}function ef(e){let t=[],r=new Map,o,n=(a,s,c)=>{if(a===null||typeof a!="object")return;let l=a;if(yR in l){if(!c||s.length===0)return`${Ti(s)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let d=l[yR];if(typeof d!="string"||d.length===0)return`${Ti(s)}: x-mcp-header MUST be a non-empty string`;if(!yA.test(d))return`${Ti(s)}: x-mcp-header '${d}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let m=typeof l.type=="string"?l.type:void 0;if(m===void 0||!_A.has(m)){let y=`${Ti(s)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${m??"<none>"}`;if(m!=="number")return y;o??=y}let f=d.toLowerCase(),h=r.get(f);if(h!==void 0)return`x-mcp-header '${d}' is not case-insensitively unique (also declared as '${h}')`;r.set(f,d),t.push({path:s,headerName:d,type:m})}let u=l.properties;if(u!==null&&typeof u=="object")for(let[d,m]of Object.entries(u)){let f=n(m,[...s,d],c);if(f!==void 0)return f}for(let d of $A){let m=l[d];if(m===void 0)continue;let f=Array.isArray(m)?m:m!==null&&typeof m=="object"&&bA.has(d)?Object.values(m):[m];for(let h of f){let y=n(h,[...s,`<${d}>`],!1);if(y!==void 0)return y}}},i=n(e,[],!0);return i!==void 0?{valid:!1,reason:o??i}:o===void 0?{valid:!0,declarations:t}:{valid:!1,reason:o,declarations:t}}function Ti(e){return e.length===0?"<root>":e.join(".")}function RA(e){if(typeof e=="string")return e;if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number")return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function IA(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.codePointAt(o);return new TextDecoder("utf-8",{fatal:!0}).decode(r)}function tI(e){if(!(e.startsWith(SA)&&e.endsWith(wA)))return e;let t=e.slice(9,e.length-2);if(kA.test(t))try{return IA(t)}catch{return}}function xA(e,t){let r=e;for(let o of t){if(r===null||typeof r!="object")return;r=r[o]}return r}function nI(e,t,r){for(let o of e){let n=`${vA}${o.headerName}`,i=r.get(n),a=xA(t,o.path);if(a==null)continue;let s=RA(a);if(s===void 0)continue;if(i===null)return h$("param-header-missing",n,`the body carries ${Ti(o.path)}=${JSON.stringify(a)} but the ${n} header is absent`);let c=tI(i);if(c===void 0)return h$("param-header-invalid-encoding",n,`the ${n} header carries an invalid Base64 sentinel value`);if(!((o.type==="integer"||o.type==="number")&&zA.test(c)&&typeof a=="number"?Number(c)===a:c===s))return h$("param-header-mismatch",n,`the ${n} header decodes to ${JSON.stringify(c)} but the body carries ${Ti(o.path)}=${JSON.stringify(a)}`)}}function h$(e,t,r){return{kind:"reject",rung:"param-header-validation",cell:e,httpStatus:400,code:Ei,message:`Bad Request: the request headers and body disagree: ${r}`,data:{mismatch:{header:t,body:r}},settled:!0}}function rI(e,t){return t==="in-band"?e===Q.MissingRequiredClientCapability?400:200:O$[e]??400}function Yt(e,t,r,o,n){return{kind:"reject",rung:e,cell:t,httpStatus:r,code:o.code,message:o.message,...o.data!==void 0&&{data:o.data},settled:n}}function mn(e,t,r,o="era-classification"){return Yt(o,e,400,new de(Ei,`Bad Request: the request headers and body disagree: ${r}`,{mismatch:{header:t,body:r}}),!0)}function TA(e,t){let r=Object.hasOwn(_R,e)?_R[e]:void 0;if(r===void 0)return;let o=tc(t)?t[r]:void 0;return{field:r,value:typeof o=="string"?o:void 0}}function Jm(e){let t=0;for(;t<e.length;){let o=e.codePointAt(t);if(o!==9&&o!==32)break;t+=1}let r=e.length;for(;r>t;){let o=e.codePointAt(r-1);if(o!==9&&o!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}function oI(e,t){if(t.messageKind!=="request")return;let r=t.message.method;if(e.protocolVersionHeader===void 0){let c=t.classification.revision;return mn("version-header-missing","(missing)",c===void 0?"the body carries a modern per-request envelope but the required MCP-Protocol-Version header is absent":`the body envelope names protocol version ${c} but the required MCP-Protocol-Version header is absent`,"standard-header-validation")}if(e.mcpMethodHeader===void 0)return mn("method-header-missing","(missing)",`the body names method ${r} but the required Mcp-Method header is absent`,"standard-header-validation");let o=TA(r,t.message.params);if(o===void 0)return;let{field:n,value:i}=o;if(e.mcpNameHeader===void 0)return i===void 0?void 0:mn("name-header-missing","(missing)",`the body carries params.${n}="${i}" but the required Mcp-Name header is absent`,"standard-header-validation");let a=Jm(e.mcpNameHeader),s=tI(a);if(s===void 0)return mn("name-header-invalid-encoding",a,"the Mcp-Name header carries an invalid Base64 sentinel value","standard-header-validation");if(i!==void 0&&s!==i)return mn("name-header-mismatch",a,`the body carries params.${n}="${i}" but the Mcp-Name header names "${s}"`,"standard-header-validation")}function tc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function iI(e){return e===void 0?{era:"modern"}:{era:qn(e)?"modern":"legacy",revision:e}}function tf(e){if(!mo(e))return!1;let t=ji(e);if(t===void 0||!qn(t))return!1;let r=fn(e);return r!==void 0&&uo(r).length===0}function PA(e){if(e.length===0)return Yt("jsonrpc-shape","empty-batch",400,new de(Q.InvalidRequest,"Bad Request: empty JSON-RPC batch"),!0);for(let t of e){if(mo(tc(t)?t.params:void 0))return Yt("jsonrpc-shape","batch-with-modern-element",400,new de(Q.InvalidRequest,"Bad Request: JSON-RPC batches may not contain requests for protocol revision 2026-07-28 or later"),!0);if(!(et(t)||pn(t)||Lt(t)||Vt(t)))return Yt("jsonrpc-shape","batch-with-invalid-element",400,new de(Q.InvalidRequest,"Bad Request: JSON-RPC batch contains an invalid message"),!0)}return{kind:"legacy",reason:"batch"}}function EA(e,t){let r=t.params,o=t.method,n=e.protocolVersionHeader,i=n!==void 0&&qn(n);if(o==="initialize"&&!tf(r)){if(i)return mn("initialize-with-modern-header",n,"an initialize request (legacy handshake) was sent with a modern MCP-Protocol-Version header");let a=tc(r)&&typeof r.protocolVersion=="string"?r.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...a!==void 0&&{requestedVersion:a}}}if(mo(r)){let a=fn(r),s=(a===void 0?[]:uo(a))[0];if(s!==void 0)return Yt("envelope","envelope-invalid",400,new de(Q.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${s.key}: ${s.problem}`,{envelope:s}),!0);let c=ji(r);return n!==void 0&&c!==void 0&&n!==c?mn("header-body-version-mismatch",n,`the body envelope names protocol version ${c} but the MCP-Protocol-Version header names ${n}`):e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o?mn("method-header-mismatch",e.mcpMethodHeader,`the body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`):{kind:"modern",messageKind:"request",message:t,classification:iI(c)}}if(i){let a=fn(r),s=uo(a??{}).filter(l=>l.problem==="missing").map(l=>l.key),c=a===void 0?["_meta"]:s.length>0?s:[Ut];return Yt("envelope","modern-header-without-claim",400,new de(Q.InvalidParams,`Invalid params: the MCP-Protocol-Version header names protocol revision ${n}, but the request is missing the required per-request envelope key(s): ${c.join(", ")}`,{envelope:{missing:c}}),!0)}return{kind:"legacy",reason:"no-claim",...n!==void 0&&{requestedVersion:n}}}function CA(e,t){let r=t.params,o=t.method,n=e.protocolVersionHeader,i=n!==void 0&&qn(n);if(mo(r)){let a=ji(r);if(a===void 0){let c=fn(r),l=(c===void 0?[]:uo(c)).find(u=>u.key===Ut)??{key:Ut,problem:"expected a protocol version string"};return Yt("envelope","notification-envelope-invalid",400,new de(Q.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${l.key}: ${l.problem}`,{envelope:l}),!0)}if(n!==void 0&&n!==a)return mn("notification-header-body-version-mismatch",n,`the notification envelope names protocol version ${a} but the MCP-Protocol-Version header names ${n}`);let s=iI(a);return s.era==="modern"&&e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o?mn("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`):{kind:"modern",messageKind:"notification",message:t,classification:s}}return i?e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o?mn("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`):{kind:"modern",messageKind:"notification",message:t,classification:{era:"modern",revision:n}}:{kind:"legacy",reason:"notification",...n!==void 0&&{requestedVersion:n}}}function N$(e){if(e={...e,...e.protocolVersionHeader!==void 0&&{protocolVersionHeader:Jm(e.protocolVersionHeader)},...e.mcpMethodHeader!==void 0&&{mcpMethodHeader:Jm(e.mcpMethodHeader)},...e.mcpNameHeader!==void 0&&{mcpNameHeader:Jm(e.mcpNameHeader)}},e.httpMethod.toUpperCase()!=="POST")return{kind:"legacy",reason:"http-method"};let t=e.body;return Array.isArray(t)?PA(t):Lt(t)||Vt(t)?{kind:"legacy",reason:"response"}:tc(t)&&et(t)?EA(e,t):tc(t)&&pn(t)?CA(e,t):Yt("jsonrpc-shape","invalid-json-rpc-body",400,new de(Q.InvalidRequest,"Bad Request: the request body is not a valid JSON-RPC message"),!0)}function nf(e,t){switch(e.reason){case"http-method":return Yt("http-method","modern-only-method-not-allowed",405,new de(-32e3,"Method not allowed."),!0);case"batch":return Yt("jsonrpc-shape","modern-only-batch-not-supported",400,new de(Q.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return Yt("jsonrpc-shape","modern-only-response-post",400,new de(Q.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let r=e.requestedVersion;return Yt("era-classification","modern-only-missing-envelope",400,r===void 0?new de(Q.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...t]}):new Ir({supported:[...t],requested:r}),!0)}}}function rf(e,t){return us(e,t)}function Ys(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function Oi(e){if(e==null)return!1;let t=typeof e;return t!=="object"&&t!=="function"||!("~standard"in e)?!1:typeof e["~standard"]?.validate=="function"}function fo(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:_$});else if(r.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().");$R||($R=!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.")),o=ro(e,{target:_$,io:t})}else throw new Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output")return o.type!==void 0?o:aI(o)?{type:"object",...o}:o;if(o.type!==void 0&&o.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}function aI(e,t=e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;let r=typeof e.$ref=="string"&&OA.exec(e.$ref);if(r&&t[r[1]]?.[r[2]]?.type==="object")return!0;for(let o of["oneOf","anyOf","allOf"]){let n=e[o];if(Array.isArray(n)&&n.length>0)return n.every(i=>i!==null&&typeof i=="object"&&(i.type==="object"||aI(i,"$id"in i?{}:t)))}return!1}function NA(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function lo(e,t){let r=await e["~standard"].validate(t);return r.issues&&r.issues.length>0?{success:!1,error:r.issues.map(o=>NA(o)).join(", ")}:{success:!0,data:r.value}}function jA(e){let t=ro(e,{target:_$,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}function MA(e){let t=AA.exec(e),r=[void 0,-1,0];return t&&r.push(Number(t[1])),[!1,!0].flatMap(o=>[!1,!0].flatMap(n=>r.map(i=>Wt.datetime({local:o,offset:n,precision:i}))))}function DA(e,t){let r;switch(e){case"email":r=[ku()];break;case"uri":r=[di()];break;case"date":r=[Wt.date()];break;case"date-time":r=MA(t);break}return new Set(r.map(o=>jA(o)).filter(o=>o!==void 0))}function UA(e,t,r){return r!=="zod"?!0:DA(e,t).has(t)}function sI(e){let t=fo(e,"input"),r=t.properties||{},o=t.required||[];return Object.entries(r).map(([n,i])=>({name:n,description:i?.description,required:o.includes(n)}))}function nc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function LA(e){try{return fo(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new de(Q.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}function j$(e){return qA.has(e)||e.startsWith("x-")}function ZA(e,t,r,o){if(!nc(e))return e;let n=typeof e.type=="string"&&Object.hasOwn(bR,e.type)?bR[e.type]:void 0;if(n===void 0)return e;let i={};for(let[a,s]of Object.entries(e))n.has(a)||j$(a)?i[a]=s:a==="pattern"&&e.type==="string"&&typeof e.format=="string"?FA.has(e.format)?(typeof s!="string"||!UA(e.format,s,r))&&o.push(`${t}.${a}`):i[a]=s:o.push(`${t}.${a}`);return i}function BA(e,t){let r={},o=[];for(let[n,i]of Object.entries(e))n==="properties"&&nc(i)?r[n]=Object.fromEntries(Object.entries(i).map(([a,s])=>[a,ZA(s,`properties.${a}`,t,o)])):VA.has(n)?r[n]=i:j$(n)||o.push(n);if(o.length>0)throw new de(Q.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function HA(e,t){if(!nc(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!rf(Ws,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function $$(e,t,r=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((o,n)=>$$(o,t[n],`${r}[${n}]`)):!nc(e)||!nc(t)?[]:Object.entries(e).flatMap(([o,n])=>{let i=r?`${r}.${o}`:o;return Object.prototype.hasOwnProperty.call(t,o)?$$(n,t[o],i):j$(o)?[]:[i]})}function JA(e){if(!Oi(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=BA(LA(e.requestedSchema),t),o=rf(xi.shape.requestedSchema,r);if(!o.success)throw new de(Q.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${HA(r,o.error.message)}`);let n=$$(r,o.data);if(n.length>0)throw new de(Q.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let i=(o.data.required??[]).filter(a=>!Object.prototype.hasOwnProperty.call(o.data.properties,a));if(i.length>0)throw new de(Q.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${i.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function KA(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState=="string";if(!t&&!r)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}}}function cI(e,t,r){let o=sc(e,t);if(o.kind!=="elicit"||o.action!=="accept"||o.content===void 0)return;if(r===void 0)return o.content;let n=r["~standard"].validate(o.content);if(n instanceof Promise)throw new TypeError("acceptedContent(responses, key, schema) requires a synchronously-validating schema");return n.issues===void 0?n.value:void 0}function sc(e,t){if(e===void 0||typeof e!="object"||e===null)return{kind:"missing"};let r=e[t];if(r===null||typeof r!="object"||Array.isArray(r))return{kind:"missing"};let o=r;if(o.action==="accept"||o.action==="decline"||o.action==="cancel"){let n=o.content;return{kind:"elicit",action:o.action,...n!==null&&typeof n=="object"&&!Array.isArray(n)&&{content:n}}}return Array.isArray(o.roots)?{kind:"roots",roots:o.roots}:typeof o.role=="string"&&o.content!==void 0?{kind:"sampling",result:o}:{kind:"missing"}}function uI(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function dI(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof be?t.reason:new be(ke.RequestTimeout,String(t.reason)));return}let n=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e),i=()=>{clearTimeout(n),o(t?.reason instanceof be?t.reason:new be(ke.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",i,{once:!0})})}function mI(e){let t=new AbortController,r=()=>t.abort(e?.reason);return e?.addEventListener("abort",r,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:o=>t.abort(o),dispose:()=>e?.removeEventListener("abort",r)}}function hI(e,t){let r=e.slice(0,-6);fI[r]=t,pI[r]=o=>t.safeParse(o).success}function XA(e){switch(e){case"initialize":case"notifications/initialized":return Ln(void 0);case"server/discover":return Ln(ic);default:return}}function SR(e,t){let r=e.params;if(!ec(r))return{message:e,lifted:{}};let o=r._meta,n=ec(o)?YA.filter(c=>c in o):[],i=t==="request"?QA.filter(c=>c in r):[];if(n.length===0&&i.length===0)return{message:e,lifted:{}};let a={},s={...r};if(n.length>0&&ec(o)){let c={},l={...o};for(let u of n)c[u]=o[u],delete l[u];a.envelope=c,Object.keys(l).length>0?s._meta=l:delete s._meta}for(let c of i)c==="inputResponses"&&(a.inputResponses=s[c]),c==="requestState"&&(a.requestState=s[c]),delete s[c];return{message:{...e,params:s},lifted:a}}function wR(e,t){let r=e.validateResult(t,void 0);if(!(!r.ok&&r.reason==="not-in-era"))return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let n=e.validateResult(t,o);return n.ok?{value:n.value}:{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function cc(e){return()=>e}function M$(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:cc(t)}}}function of(e,t){yI(e,t)}function ec(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function sf(e,t){let r={...e};for(let o in t){let n=o,i=t[n];if(i===void 0)continue;let a=r[n];r[n]=ec(a)&&ec(i)?{...a,...i}:i}return r}function kR(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function t1(e){let t={},r=[];if(!kR(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!kR(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function n1(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}function D$(e){if(e)try{return o1.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();return t===""||e.slice(t.length).includes(",")?void 0:t}}function cf(e){return e==="application/json"?!0:D$(e)==="application/json"}function _I(e){return e.title!==void 0&&e.title!==""?e.title:"annotations"in e&&e.annotations?.title?e.annotations.title:e.name}function L$(e){return $r.parse(JSON.parse(e))}function uf(e){return JSON.stringify(e)+`
|
|
65
|
+
`}function a1(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!i1.test(e)){let r=[...e].filter(o=>!/[A-Za-z0-9._-]/.test(o)).filter((o,n,i)=>i.indexOf(o)===n);return t.push(`Tool name contains invalid characters: ${r.map(o=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function s1(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function q$(e){let t=a1(e);return s1(e,t.warnings),t.isValid}function zR(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function $I(e=fetch,t){return t?async(r,o)=>e(r,{...t,...o,headers:o?.headers?{...zR(t.headers),...zR(o.headers)}:t.headers}):e}function l1(e){return typeof e=="object"&&e!==null&&"_zod"in e}function u1(e){return typeof e=="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName=="string"}function d1(e){if(typeof e!="object"||e===null||Oi(e))return!1;let t=Object.getPrototypeOf(e);return t!==Object.prototype&&t!==null?!1:Object.values(e).every(r=>l1(r))}function mf(e){if(e!==void 0){if(d1(e))return C(e);if(typeof e=="object"&&e!==null&&!Oi(e)&&Object.values(e).some(t=>u1(t)))throw new TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!Oi(e))throw new TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return e}}function SI(){k$(),Un(),Uj(),aA(),hA()}function wI(e,t){let r=t.getValidator(e);return{"~standard":{version:1,vendor:"mcp",jsonSchema:{input:()=>e,output:()=>e},validate:o=>{let n=r(o);return n.valid?{value:n.data}:{issues:[{message:n.errorMessage}]}}}}}var v$,wt,qt,ke,be,TR,uR,NR,Ct,MR,Nj,jj,Aj,UR,LR,Dj,Fm,RV,IV,fR,z$,Bj,Hj,Pi,Q,de,oc,T$,Ir,Ni,Gj,Wj,Xj,iA,Bm,E$,BR,xV,TV,mA,fA,C$,Hm,ic,GR,gA,et,pn,Lt,Vt,XR,YR,zn,QR,Xm,eI,vA,yR,yA,_A,$A,bA,SA,wA,kA,zA,Ei,PV,O$,_R,$R,_$,OA,AA,qA,VA,bR,FA,ac,lI,GA,WA,fI,pI,gI,vI,A$,YA,QA,e1,yI,af,r1,o1,U$,lf,i1,RR,g$,IR,c1,df,bI,lc=G(()=>{op();ip();lR();Gu();v$=Symbol.for("mcp.sdk.errorBrands");wt=(function(e){return e.InvalidRequest="invalid_request",e.InvalidClient="invalid_client",e.InvalidGrant="invalid_grant",e.UnauthorizedClient="unauthorized_client",e.UnsupportedGrantType="unsupported_grant_type",e.InvalidScope="invalid_scope",e.AccessDenied="access_denied",e.ServerError="server_error",e.TemporarilyUnavailable="temporarily_unavailable",e.UnsupportedResponseType="unsupported_response_type",e.UnsupportedTokenType="unsupported_token_type",e.InvalidToken="invalid_token",e.MethodNotAllowed="method_not_allowed",e.TooManyRequests="too_many_requests",e.InvalidClientMetadata="invalid_client_metadata",e.InvalidRedirectUri="invalid_redirect_uri",e.InsufficientScope="insufficient_scope",e.InvalidTarget="invalid_target",e.InvalidDpopProof="invalid_dpop_proof",e.UseDpopNonce="use_dpop_nonce",e})({}),qt=class xR extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Ci(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 Ci(this,t)}constructor(t,r,o){super(r),this.code=t,this.errorUri=o,this.name="OAuthError",S$(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}static fromResponse(t){return new xR(t.error,t.error_description??t.error,t.error_uri)}},ke=(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})({}),be=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return Ci(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 Ci(this,e)}constructor(e,t,r,o){super(t,o),this.code=e,this.data=r,this.name="SdkError",S$(this,new.target)}},TR=class extends be{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r,o){super(e,t,r,o),this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};uR={};NR="2026-07-28",Ct=[NR];MR=["task","inputRequests","requestState"];jj=new Set(["const","enum","default","examples"]),Aj=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);UR={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},LR={"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},Dj={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};RV=Object.keys(UR),IV=Object.keys(LR);fR={ok:!1,reason:"not-in-era"};z$={era:"2025-11-25",hasRequestMethod:qR,hasNotificationMethod:VR,validateRequest:(e,t)=>Zm(Vj(e),t),validateResult:(e,t)=>Zm(qj(e),t),validateNotification:(e,t)=>Zm(Fj(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>fR,validateInputResponse:()=>fR,samplingResultVariant:((e,t)=>{let r=k$();return Zm(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let r=AR(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!="object"||o===null||Array.isArray(o),i=t!==void 0&&DR(t);return!n&&!i?r:{...r,structuredContent:{result:o}}},decodeResult(e,t){if(y$(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:r}}return{kind:"complete",result:t}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;return!Array.isArray(r)||!r.some(o=>pR(o))?t:{...t,tools:r.map(o=>pR(o)?{...o,outputSchema:Mj(o.outputSchema)}:o)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};Hj=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];Pi=Symbol("modelcontextprotocol.resultCacheHintFallback");Q=(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})({}),de=class FR extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Ci(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 Ci(this,t)}constructor(t,r,o){super(r),this.code=t,this.data=o,this.name="ProtocolError",S$(this,new.target)}static fromError(t,r,o){if(t===Q.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new T$(n.elicitations,r)}if(t===Q.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new Ir({supported:n.supported,requested:n.requested},r)}if(t===Q.InvalidParams||t===Q.ResourceNotFound){let n=o;if(typeof n?.uri=="string"&&(t===Q.ResourceNotFound||Object.keys(n).length===1))return new oc(n.uri,r)}if(t===Q.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new Ni({requiredCapabilities:n.requiredCapabilities},r)}return new FR(t,r,o)}},oc=class extends de{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(Q.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},T$=class extends de{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(Q.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Ir=class extends de{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(Q.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Ni=class extends de{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(Q.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Gj=0,Wj="private",Xj=["tools/call","prompts/get","resources/read"];iA=["elicitation/create","sampling/createMessage","roots/list"];E$={"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},BR={"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};xV=Object.keys(E$),TV=Object.keys(BR);mA={ok:!1,reason:"not-in-era"},fA=[Ut,dn];C$={era:"2026-07-28",hasRequestMethod:HR,hasNotificationMethod:JR,hasInputRequestMethod:e=>m$(e)!==void 0,validateRequest:(e,t)=>Xs(lA(e),t),validateResult:(e,t)=>Xs(uA(e),t),validateNotification:(e,t)=>Xs(dA(e),t),validateInputRequest:(e,t)=>Xs(m$(e),t),validateInputResponse:(e,t)=>Xs(sA(e),t),samplingResultVariant:()=>mA,outboundEnvelope(e){return{[Ut]:e.protocolVersion,[gr]:e.clientInfo,[dn]:e.clientCapabilities,...e.logLevel!==void 0&&{[Mn]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of fA)o in e||t.push({key:o,problem:"missing"});let r=Un().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let o of r.error.issues){let n=o.path.map(String),i=n.length>0?n.join("."):"_meta";n.length===1&&t.some(a=>a.key===i&&a.problem==="missing")||t.push({key:i,problem:o.message})}return t},projectCallToolResult:e=>AR(e),inputRequestSchema:m$,decodeResult(e,t){if(!Qs(t))return{kind:"invalid",error:new be(ke.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new be(ke.InvalidResult,`Invalid result for ${e}: missing required resultType \u2014 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 r!="string")return{kind:"invalid",error:new be(ke.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let a=t.inputRequests,s=Qs(a)?a:{},c=t.requestState,l=t._meta===void 0?void 0:Un().ResultMetaSchema.safeParse(t._meta),u=l?.success?l.data:void 0;return Object.keys(s).length===0&&typeof c!="string"?{kind:"invalid",error:new be(ke.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:s,...typeof c=="string"&&{requestState:c},...u!==void 0&&{_meta:u}}}if(r!=="complete")return{kind:"invalid",error:new be(ke.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=KR(),n=Object.hasOwn(o,e)?o[e]:void 0;if(n!==void 0){let a=n.safeParse(t);if(!a.success)return{kind:"invalid",error:new be(ke.InvalidResult,`Invalid result for ${e}: ${a.error}`,{method:e})}}let i={...t};return delete i.resultType,{kind:"complete",result:i}},encodeResult(e,t,r){return tA(Qj(e,Yj(e,pA(e,t))),r)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=Un().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(r=>r.message).join("; ")}`}};ic="2026-07-28";GR=[z$,C$];gA=Xb({AnnotationsSchema:()=>Dn,AudioContentSchema:()=>wi,BaseMetadataSchema:()=>jn,BaseRequestParamsSchema:()=>at,BlobResourceContentsSchema:()=>Ls,BooleanSchemaSchema:()=>Zs,CallToolRequestParamsSchema:()=>nm,CallToolRequestSchema:()=>rm,CallToolResultSchema:()=>zi,CancelTaskRequestSchema:()=>G_,CancelTaskResultSchema:()=>W_,CancelledNotificationParamsSchema:()=>sd,CancelledNotificationSchema:()=>Cs,ClientCapabilitiesSchema:()=>dd,ClientNotificationSchema:()=>Y_,ClientRequestSchema:()=>X_,ClientResultSchema:()=>Q_,ClientTasksCapabilitySchema:()=>ld,CompatibilityCallToolResultSchema:()=>D_,CompleteRequestParamsSchema:()=>Pm,CompleteRequestSchema:()=>Em,CompleteResultSchema:()=>Cm,ContentBlockSchema:()=>ki,CreateMessageRequestParamsSchema:()=>hm,CreateMessageRequestSchema:()=>gm,CreateMessageResultSchema:()=>vm,CreateMessageResultWithToolsSchema:()=>ym,CreateTaskResultSchema:()=>q_,CursorSchema:()=>Rs,DiscoverRequestSchema:()=>pd,DiscoverResultSchema:()=>hd,ElicitRequestFormParamsSchema:()=>xi,ElicitRequestParamsSchema:()=>wm,ElicitRequestSchema:()=>km,ElicitRequestURLParamsSchema:()=>Sm,ElicitResultSchema:()=>Im,ElicitationCompleteNotificationParamsSchema:()=>zm,ElicitationCompleteNotificationSchema:()=>Rm,EmbeddedResourceSchema:()=>Jd,EmptyResultSchema:()=>Es,EnumSchemaSchema:()=>bm,GetPromptRequestParamsSchema:()=>Zd,GetPromptRequestSchema:()=>Bd,GetPromptResultSchema:()=>Wd,GetTaskPayloadRequestSchema:()=>B_,GetTaskPayloadResultSchema:()=>H_,GetTaskRequestSchema:()=>F_,GetTaskResultSchema:()=>Z_,IconSchema:()=>cd,IconsSchema:()=>br,ImageContentSchema:()=>Si,ImplementationSchema:()=>_i,InitializeRequestParamsSchema:()=>md,InitializeRequestSchema:()=>Os,InitializeResultSchema:()=>fd,InitializedNotificationSchema:()=>js,JSONArraySchema:()=>A_,JSONObjectSchema:()=>Xe,JSONRPCErrorResponseSchema:()=>yi,JSONRPCMessageSchema:()=>$r,JSONRPCNotificationSchema:()=>Ps,JSONRPCRequestSchema:()=>Ts,JSONRPCResponseSchema:()=>ad,JSONRPCResultResponseSchema:()=>vi,JSONValueSchema:()=>pr,LegacyTitledEnumSchemaSchema:()=>Js,ListChangedOptionsBaseSchema:()=>U_,ListPromptsRequestSchema:()=>Vd,ListPromptsResultSchema:()=>Fd,ListResourceTemplatesRequestSchema:()=>Sd,ListResourceTemplatesResultSchema:()=>wd,ListResourcesRequestSchema:()=>$d,ListResourcesResultSchema:()=>bd,ListRootsRequestSchema:()=>Nm,ListRootsResultSchema:()=>jm,ListTasksRequestSchema:()=>J_,ListTasksResultSchema:()=>K_,ListToolsRequestSchema:()=>em,ListToolsResultSchema:()=>tm,LoggingLevelSchema:()=>zr,LoggingMessageNotificationParamsSchema:()=>sm,LoggingMessageNotificationSchema:()=>cm,ModelHintSchema:()=>lm,ModelPreferencesSchema:()=>um,MultiSelectEnumSchemaSchema:()=>$m,NotificationSchema:()=>ht,NotificationsParamsSchema:()=>pt,NumberSchemaSchema:()=>Ii,PaginatedRequestParamsSchema:()=>yd,PaginatedRequestSchema:()=>Sr,PaginatedResultSchema:()=>wr,PingRequestSchema:()=>As,PrimitiveSchemaDefinitionSchema:()=>Ws,ProgressNotificationParamsSchema:()=>vd,ProgressNotificationSchema:()=>Ms,ProgressSchema:()=>gd,ProgressTokenSchema:()=>zs,PromptArgumentSchema:()=>Ld,PromptListChangedNotificationSchema:()=>Xd,PromptMessageSchema:()=>Gd,PromptReferenceSchema:()=>Tm,PromptSchema:()=>qd,ReadResourceRequestParamsSchema:()=>kd,ReadResourceRequestSchema:()=>zd,ReadResourceResultSchema:()=>Rd,RelatedTaskMetadataSchema:()=>id,RequestIdSchema:()=>_r,RequestMetaSchema:()=>Is,RequestSchema:()=>Ye,ResourceContentsSchema:()=>Ds,ResourceLinkSchema:()=>Kd,ResourceListChangedNotificationSchema:()=>Id,ResourceRequestParamsSchema:()=>$i,ResourceSchema:()=>qs,ResourceTemplateReferenceSchema:()=>xm,ResourceTemplateSchema:()=>_d,ResourceUpdatedNotificationParamsSchema:()=>Dd,ResourceUpdatedNotificationSchema:()=>Ud,ResultMetaObjectSchema:()=>xs,ResultSchema:()=>Qe,RoleSchema:()=>kr,RootSchema:()=>Om,RootsListChangedNotificationSchema:()=>Am,SamplingContentSchema:()=>fm,SamplingMessageContentBlockSchema:()=>so,SamplingMessageSchema:()=>pm,ServerCapabilitiesSchema:()=>Ns,ServerNotificationSchema:()=>t$,ServerRequestSchema:()=>e$,ServerResultSchema:()=>n$,ServerTasksCapabilitySchema:()=>ud,SetLevelRequestParamsSchema:()=>im,SetLevelRequestSchema:()=>am,SingleSelectEnumSchemaSchema:()=>_m,StringSchemaSchema:()=>Ri,SubscribeRequestParamsSchema:()=>xd,SubscribeRequestSchema:()=>Td,SubscriptionFilterSchema:()=>Vs,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Nd,SubscriptionsAcknowledgedNotificationSchema:()=>jd,SubscriptionsListenRequestParamsSchema:()=>Cd,SubscriptionsListenRequestSchema:()=>Od,SubscriptionsListenResultMetaSchema:()=>Ad,SubscriptionsListenResultSchema:()=>Md,TaskAugmentedRequestParamsSchema:()=>yr,TaskCreationParamsSchema:()=>L_,TaskMetadataSchema:()=>od,TaskSchema:()=>Rr,TaskStatusNotificationParamsSchema:()=>Dm,TaskStatusNotificationSchema:()=>V_,TaskStatusSchema:()=>Mm,TextContentSchema:()=>bi,TextResourceContentsSchema:()=>Us,TitledMultiSelectEnumSchemaSchema:()=>Gs,TitledSingleSelectEnumSchemaSchema:()=>Hs,ToolAnnotationsSchema:()=>Yd,ToolChoiceSchema:()=>dm,ToolExecutionSchema:()=>Qd,ToolListChangedNotificationSchema:()=>om,ToolResultContentSchema:()=>mm,ToolSchema:()=>Fs,ToolUseContentSchema:()=>Hd,UnsubscribeRequestParamsSchema:()=>Pd,UnsubscribeRequestSchema:()=>Ed,UntitledMultiSelectEnumSchemaSchema:()=>Ks,UntitledSingleSelectEnumSchemaSchema:()=>Bs});et=e=>Ts.safeParse(e).success,pn=e=>Ps.safeParse(e).success,Lt=e=>vi.safeParse(e).success,Vt=e=>yi.safeParse(e).success,XR=e=>ad.safeParse(e).success,YR=e=>typeof e!="object"||e===null||e.content===void 0?!1:zi.safeParse(e).success,zn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required",QR=e=>yr.safeParse(e).success,Xm=e=>Os.safeParse(e).success,eI=e=>js.safeParse(e).success;vA="Mcp-Param-",yR="x-mcp-header",yA=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,_A=new Set(["string","integer","boolean"]);$A=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],bA=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);SA="=?base64?",wA="?=",kA=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,zA=/^-?\d+(\.\d+)?$/;Ei=-32020,PV=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32e3],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[Q.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[Ei,Q.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[Q.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope \u2014 and a missing envelope on a request whose protocol-version header names a modern revision \u2014 is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[Q.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision\u2019s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[Q.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[Ei],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half \u2014 including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[Q.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced \u2014 pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[Ei],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],O$={[Q.ParseError]:400,[Q.InvalidRequest]:400,[Q.MethodNotFound]:404,[Q.UnsupportedProtocolVersion]:400,[Q.MissingRequiredClientCapability]:400,[Ei]:400};_R={"tools/call":"name","prompts/get":"name","resources/read":"uri","tasks/get":"taskId","tasks/update":"taskId","tasks/cancel":"taskId"};$R=!1,_$="draft-2020-12";OA=/^#\/(\$defs|definitions)\/([^/~%]+)$/;AA=/\\\.\\d\{(\d+)\}/;qA=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);VA=new Set(["$schema",...Object.keys(xi.shape.requestedSchema.shape)]),bR={string:Ys([Ri,Bs,Hs,Js]),number:Ys([Ii]),integer:Ys([Ii]),boolean:Ys([Zs]),array:Ys([Ks,Gs])},FA=new Set(Ri.shape.format.unwrap().options);ac=Object.assign(KA,{elicit(e){try{return{method:"elicitation/create",params:JA(e)}}catch(t){throw t instanceof de?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"}}});lI=250;GA=["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"],WA={IdJagTokenExchangeResponseSchema:s$,OAuthClientInformationFullSchema:l$,OAuthClientInformationSchema:Vm,OAuthClientMetadataSchema:qm,OAuthClientRegistrationErrorSchema:u$,OAuthErrorResponseSchema:c$,OAuthMetadataSchema:Um,OAuthProtectedResourceMetadataSchema:o$,OAuthTokenRevocationRequestSchema:d$,OAuthTokensSchema:a$,OpenIdProviderDiscoveryMetadataSchema:i$,OpenIdProviderMetadataSchema:Lm},fI={},pI={};for(let e of GA)hI(e,gA[e]);for(let[e,t]of Object.entries(WA))hI(e,t);gI=Object.freeze(fI),vI=Object.freeze(pI);A$=6e4,YA=[Ut,gr,dn,Mn],QA=["inputResponses","requestState"];e1=cc(void 0);af=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{yI=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??gi,this.setNotificationHandler("notifications/cancelled",t=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",t=>{this._onprogress(t)}),this.setRequestHandler("ping",t=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new be(ke.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,r,o,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new be(ke.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let r=this.transport?.onerror;this._transport.onerror=n=>{r?.(n),this._onerror(n)};let o=this._transport?.onmessage;this._transport.onmessage=(n,i)=>{o?.(n,i),Lt(n)||Vt(n)?this._onresponse(n):et(n)?this._onrequest(n,i):pn(n)?this._onnotification(n,i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new be(ke.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let o of e.values())o(r);for(let o of t.values())o.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=SR(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let a=hR(t.classification);if(a!==o.era){this._onerror(new Error(`Era mismatch on inbound notification '${r.method}': classified as ${a} but this instance serves ${o.era}`));return}}if(p$(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),i=this.fallbackNotificationHandler;n===void 0&&i===void 0||Promise.resolve().then(()=>n===void 0?i(r):n(r,o)).catch(a=>this._onerror(new Error(`Uncaught error in notification handler: ${a}`)))}_onrequest(e,t){let{message:r,lifted:o}=SR(e,"request"),n=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}let i=this._transport,a=(y,v,p)=>{let b={jsonrpc:"2.0",id:r.id,error:{code:y,message:v,...p!==void 0&&{data:p}}};i?.send(b).catch(g=>this._onerror(new Error(`Failed to send an error response: ${g}`)))};if(t?.classification!==void 0){let y=hR(t.classification);if(y!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${r.method}': classified as ${y} but this instance serves ${n.era}`));let v=t.classification.revision??y;a(Q.UnsupportedProtocolVersion,`Unsupported protocol version: ${v}`,{supported:this._supportedProtocolVersions,requested:v});return}}if(f$(r.method)&&!n.hasRequestMethod(r.method)&&!(gR(r.method)&&this._customSchemaRequestMethods.has(r.method))){a(Q.MethodNotFound,"Method not found");return}let s=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(s===void 0){a(Q.MethodNotFound,"Method not found");return}let c=n.checkInboundEnvelope(o);if(c!==void 0){a(Q.InvalidParams,c);return}let l=(y,v)=>this._notificationViaCodec(this._resolveOutboundCodec(y.method),y,{...v,relatedRequestId:r.id}),u=(y,v,p)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(y.method),y,v,{...p,relatedRequestId:r.id}),d=new AbortController;this._requestHandlerAbortControllers.set(r.id,d);let m=o.inputResponses===void 0?void 0:t1(o.inputResponses),f={sessionId:i?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...m!==void 0&&{inputResponses:m.accepted},...m!==void 0&&m.droppedKeys.length>0&&{droppedInputResponseKeys:m.droppedKeys},requestState:o.requestState===void 0?e1:cc(o.requestState),signal:d.signal,send:((y,v,p)=>{let b=this._resolveOutboundCodec(y.method);if(this._assertOutboundRequestInEra(b,y.method),Oi(v))return u(y,v,p);let g=wR(b,y.method);if(g===void 0)throw new TypeError(`'${y.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(y,g,v)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},h=this.buildContext(f,t);Promise.resolve().then(()=>s(r,h)).then(async y=>{if(d.signal.aborted)return;let v;try{v=n.encodeResult(r.method,y,this._outboundServerInfo())}catch(b){this._onerror(new Error(`Failed to encode result for ${r.method}: ${b}`)),a(Q.InternalError,"Internal error");return}let p={result:v,jsonrpc:"2.0",id:r.id};await i?.send(p)},async y=>{if(d.signal.aborted)return;let v=Number.isSafeInteger(y.code)?y.code:Q.InternalError,p={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(v),message:y.message??"Internal error",...y.data!==void 0&&{data:y.data}}};await i?.send(p)}).catch(y=>this._onerror(new Error(`Failed to send response: ${y}`))).finally(()=>{this._requestHandlerAbortControllers.get(r.id)===d&&this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,o=Number(t),n=this._progressHandlers.get(o);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(s){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(s);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===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),Lt(e)?r(e):r(de.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let o=this._resolveOutboundCodec(e.method);if(Oi(t))return gR(e.method)||this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r);this._assertOutboundRequestInEra(o,e.method);let n=wR(o,e.method);if(n===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(o,e,n,t)}_negotiatedWireCodec(){return Ln(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=XA(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(f$(t)&&!e.hasRequestMethod(t))throw new be(ke.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let{relatedRequestId:n,resumptionToken:i,onresumptiontoken:a,headers:s}=o??{},c=Date.now(),l,u;return new Promise((d,m)=>{let f=R=>{m(R)};if(!this._transport){f(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(R){f(R);return}if(o?.signal?.aborted){let R=o.signal.reason;throw R instanceof be?R:new be(ke.RequestTimeout,String(R))}let h=e.era===ic&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,y=this._requestMessageId++;u=y;let v={...t,jsonrpc:"2.0",id:y};o?.onprogress&&(this._progressHandlers.set(y,o.onprogress),v.params={...t.params,_meta:{...t.params?._meta,progressToken:y}});let p=this._envelopeOutbound(v),b=!1,g=R=>{b||(this._progressHandlers.delete(y),h===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:y,reason:String(R)}}),{relatedRequestId:n,resumptionToken:i,onresumptiontoken:a}).catch(w=>this._onerror(new Error(`Failed to send cancellation: ${w}`))):h.abort(),m(R instanceof be?R:new be(ke.RequestTimeout,String(R))))};this._responseHandlers.set(y,R=>{if(o?.signal?.aborted)return;if(b=!0,R instanceof Error)return m(R);let w;try{w=e.decodeResult(t.method,R.result)}catch(P){return m(P instanceof Error?P:new Error(String(P)))}if(w.kind==="invalid")return m(w.error);if(w.kind==="input_required"){if(o?.allowInputRequired===!0)return d(n1(w));let P={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:c,retry:(U,O)=>this._requestWithSchemaViaCodec(e,U===void 0?{method:t.method}:{method:t.method,params:U},r,O)};return d(this._resolveNonCompleteResult(w,P))}let z=w.result;lo(r,z).then(P=>{P.success?d(P.data):m(new be(ke.InvalidResult,`Invalid result for ${t.method}: ${P.error}`))},m)}),l=()=>g(o?.signal?.reason),o?.signal?.addEventListener("abort",l,{once:!0});let S=o?.timeout??A$,T=()=>g(new be(ke.RequestTimeout,"Request timed out",{timeout:S}));this._setupTimeout(y,S,o?.maxTotalTimeout,T,o?.resetTimeoutOnProgress??!1),this._transport.send(p,{relatedRequestId:n,resumptionToken:i,onresumptiontoken:a,headers:s,requestSignal:h?.signal}).catch(R=>{this._progressHandlers.delete(y),m(R)})}).finally(()=>{l&&o?.signal?.removeEventListener("abort",l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new be(ke.NotConnected,"Not connected");if(p$(t.method)&&!e.hasNotificationMethod(t.method))throw new be(ke.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&r?.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(o,r).catch(n=>this._onerror(n))});return}await this._transport.send(o,r)}setRequestHandler(e,t,r){this.assertRequestHandlerCapability(e);let o;if(typeof t=="function"){if(!f$(e))throw new TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,i)=>{let a=this._negotiatedWireCodec(),s=a.validateRequest(e,n);if(!s.ok&&s.reason==="not-in-era"&&(s=a.validateInputRequest(e,n)),!s.ok)throw s.reason==="not-in-era"?new de(Q.InternalError,`No wire schema for ${e} in the resolved era`):new Error(s.message);return Promise.resolve(t(s.value,i))}}else if(r)o=async(n,i)=>{let a=await lo(t.params,{...n.params});if(!a.success)throw new de(Q.InvalidParams,`Invalid params for ${e}: ${a.error}`);return r(a.data,i)};else throw new TypeError("setRequestHandler: handler is required");typeof t=="function"?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.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,r){if(typeof t=="function"){if(!p$(e))throw new TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(o,n)=>{let i=n.validateNotification(e,o);if(!i.ok)throw i.reason==="not-in-era"?new de(Q.InternalError,`No wire schema for ${e} in the resolved era`):new Error(i.message);return Promise.resolve(t(i.value))});return}if(!r)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async o=>{let n=await lo(t.params,{...o.params});if(!n.success)throw new de(Q.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};r1=W((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(s){if(!s)throw new TypeError("argument string is required");var c=typeof s=="object"?i(s):s;if(typeof c!="string")throw new TypeError("argument string is required to be a string");var l=c.indexOf(";"),u=l!==-1?c.slice(0,l).trim():c.trim();if(!o.test(u))throw new TypeError("invalid media type");var d=new a(u.toLowerCase());if(l!==-1){var m,f,h;for(t.lastIndex=l;f=t.exec(c);){if(f.index!==l)throw new TypeError("invalid parameter format");l+=f[0].length,m=f[1].toLowerCase(),h=f[2],h.charCodeAt(0)===34&&(h=h.slice(1,-1),h.indexOf("\\")!==-1&&(h=h.replace(r,"$1"))),d.parameters[m]=h}if(l!==c.length)throw new TypeError("invalid parameter format")}return d}function i(s){var c;if(typeof s.getHeader=="function"?c=s.getHeader("content-type"):typeof s.headers=="object"&&(c=s.headers&&s.headers["content-type"]),typeof c!="string")throw new TypeError("content-type header is missing from object");return c}function a(s){this.parameters=Object.create(null),this.type=s}})),o1=Dc(r1(),1);U$=10*1024*1024,lf=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??U$}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){for(;this._buffer;){let e=this._buffer.indexOf(`
|
|
66
|
+
`);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return L$(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};i1=/^[A-Za-z0-9._-]{1,128}$/;RR=1e6,g$=1e6,IR=1e4,c1=1e6,df=class co{static isTemplate(t){return/\{[^}\s]+\}/.test(t)}static validateLength(t,r,o){if(t.length>r)throw new Error(`${o} exceeds maximum length of ${r} characters (got ${t.length})`)}template;parts;get variableNames(){return this.parts.flatMap(t=>typeof t=="string"?[]:t.names)}constructor(t){co.validateLength(t,RR,"Template"),this.template=t,this.parts=this.parse(t)}toString(){return this.template}parse(t){let r=[],o="",n=0,i=0;for(;n<t.length;)if(t[n]==="{"){o&&(r.push(o),o="");let a=t.indexOf("}",n);if(a===-1)throw new Error("Unclosed template expression");if(i++,i>IR)throw new Error(`Template contains too many expressions (max ${IR})`);let s=t.slice(n+1,a),c=this.getOperator(s),l=s.includes("*"),u=this.getNames(s),d=u[0];for(let m of u)co.validateLength(m,g$,"Variable name");r.push({name:d,operator:c,names:u,exploded:l}),n=a+1}else o+=t[n],n++;return o&&r.push(o),r}getOperator(t){return["+","#",".","/","?","&"].find(r=>t.startsWith(r))||""}getNames(t){let r=this.getOperator(t);return t.slice(r.length).split(",").map(o=>o.replace("*","").trim()).filter(o=>o.length>0)}encodeValue(t,r){return co.validateLength(t,g$,"Variable value"),r==="+"||r==="#"?encodeURI(t):encodeURIComponent(t)}expandPart(t,r){if(t.operator==="?"||t.operator==="&"){let i=t.names.map(a=>{let s=r[a];return s===void 0?"":`${a}=${Array.isArray(s)?s.map(c=>this.encodeValue(c,t.operator)).join(","):this.encodeValue(s.toString(),t.operator)}`}).filter(a=>a.length>0);return i.length===0?"":(t.operator==="?"?"?":"&")+i.join("&")}if(t.names.length>1){let i=t.names.map(a=>r[a]).filter(a=>a!==void 0);return i.length===0?"":i.map(a=>Array.isArray(a)?a[0]:a).join(",")}let o=r[t.name];if(o===void 0)return"";let n=(Array.isArray(o)?o:[o]).map(i=>this.encodeValue(i,t.operator));switch(t.operator){case"":return n.join(",");case"+":return n.join(",");case"#":return"#"+n.join(",");case".":return"."+n.join(".");case"/":return"/"+n.join("/");default:return n.join(",")}}expand(t){let r="",o=!1;for(let n of this.parts){if(typeof n=="string"){r+=n;continue}let i=this.expandPart(n,t);i&&(r+=(n.operator==="?"||n.operator==="&")&&o?i.replace("?","&"):i,(n.operator==="?"||n.operator==="&")&&(o=!0))}return r}escapeRegExp(t){return t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}partToRegExp(t){let r=[];for(let i of t.names)co.validateLength(i,g$,"Variable name");if(t.operator==="?"||t.operator==="&"){for(let i=0;i<t.names.length;i++){let a=t.names[i],s=i===0?"\\"+t.operator:"&";r.push({pattern:s+this.escapeRegExp(a)+"=([^&]+)",name:a})}return r}let o,n=t.name;switch(t.operator){case"":o=t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)";break;case"+":case"#":o="(.+)";break;case".":o=String.raw`\.([^/,]+)`;break;case"/":o="/"+(t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)");break;default:o="([^/]+)"}return r.push({pattern:o,name:n}),r}match(t){co.validateLength(t,RR,"URI");let r="^",o=[];for(let s of this.parts)if(typeof s=="string")r+=this.escapeRegExp(s);else{let c=this.partToRegExp(s);for(let{pattern:l,name:u}of c)r+=l,o.push({name:u,exploded:s.exploded})}r+="$",co.validateLength(r,c1,"Generated regex pattern");let n=new RegExp(r),i=t.match(n);if(!i)return null;let a={};for(let[s,c]of o.entries()){let{name:l,exploded:u}=c,d=i[s+1],m=l.replace("*","");a[m]=u&&d.includes(",")?d.split(","):d}return a}},bI=class b${_otherTransport;_messageQueue=[];_closed=!1;onclose;onerror;onmessage;sessionId;static createLinkedPair(){let t=new b$,r=new b$;return t._otherTransport=r,r._otherTransport=t,[t,r]}async start(){for(;this._messageQueue.length>0;){let t=this._messageQueue.shift();this.onmessage?.(t.message,t.extra)}}async close(){if(this._closed)return;this._closed=!0;let t=this._otherTransport;this._otherTransport=void 0;try{await t?.close()}finally{this.onclose?.()}}async send(t,r){if(!this._otherTransport)throw new be(ke.NotConnected,"Not connected");this._otherTransport.onmessage?this._otherTransport.onmessage(t,{authInfo:r?.authInfo}):this._otherTransport._messageQueue.push({message:t,extra:{authInfo:r?.authInfo}})}}});function V$(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return IM(t),t}var pf,kI,xe,Me,hn,gf,m1,zI,RI,hf,f1,gn,p1,h1,II,g1,vf,Ai,uc,Mi,yf,v1,xI,y1,_1,$1,F$,b1,Z$,TI,S1,w1,k1,z1,R1,I1,x1,T1,B$,P1,E1,C1,PI,EI,CI,O1,N1,j1,H$,A1,OI,M1,D1,U1,L1,q1,V1,F1,Z1,NI,B1,jI,AI,MI,H1,J$,J1,DI,UI,LI,K1,G1,qI,W1,X1,Y1,VI,Q1,eM,FI,tM,nM,rM,oM,iM,aM,sM,cM,lM,uM,dM,mM,fM,pM,hM,gM,vM,yM,_M,$M,bM,SM,wM,ZI,kM,zM,RM,IM,dc,VV,BI=G(()=>{op();ip();pf=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(p){if(super(),!e.IDENTIFIER.test(p))throw new Error("CodeGen: name must be a valid identifier");this.str=p}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(p){super(),this._items=typeof p=="string"?[p]:p}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let p=this._items[0];return p===""||p==='""'}get str(){var p;return(p=this._str)!==null&&p!==void 0?p:this._str=this._items.reduce((b,g)=>`${b}${g}`,"")}get names(){var p;return(p=this._names)!==null&&p!==void 0?p:this._names=this._items.reduce((b,g)=>(g instanceof r&&(b[g.str]=(b[g.str]||0)+1),b),{})}};e._Code=o,e.nil=new o("");function n(p,...b){let g=[p[0]],S=0;for(;S<b.length;)s(g,b[S]),g.push(p[++S]);return new o(g)}e._=n;let i=new o("+");function a(p,...b){let g=[f(p[0])],S=0;for(;S<b.length;)g.push(i),s(g,b[S]),g.push(i,f(p[++S]));return c(g),new o(g)}e.str=a;function s(p,b){b instanceof o?p.push(...b._items):b instanceof r?p.push(b):p.push(d(b))}e.addCodeArg=s;function c(p){let b=1;for(;b<p.length-1;){if(p[b]===i){let g=l(p[b-1],p[b+1]);if(g!==void 0){p.splice(b-1,3,g);continue}p[b++]="+"}b++}}function l(p,b){if(b==='""')return p;if(p==='""')return b;if(typeof p=="string")return b instanceof r||p[p.length-1]!=='"'?void 0:typeof b!="string"?`${p.slice(0,-1)}${b}"`:b[0]==='"'?p.slice(0,-1)+b.slice(1):void 0;if(typeof b=="string"&&b[0]==='"'&&!(p instanceof r))return`"${p}${b.slice(1)}`}function u(p,b){return b.emptyStr()?p:p.emptyStr()?b:a`${p}${b}`}e.strConcat=u;function d(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:f(Array.isArray(p)?p.join(","):p)}function m(p){return new o(f(p))}e.stringify=m;function f(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=f;function h(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new o(`.${p}`):n`[${p}]`}e.getProperty=h;function y(p){if(typeof p=="string"&&e.IDENTIFIER.test(p))return new o(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}e.getEsmExportName=y;function v(p){return new o(p.toString())}e.regexpCode=v})),kI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=pf();var r=class extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value}},o;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var n=class{constructor({prefixes:c,parent:l}={}){this._names={},this._prefixes=c,this._parent=l}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){let l=this._names[c]||this._nameGroup(c);return`${c}${l.index++}`}_nameGroup(c){var l,u;if(!((u=(l=this._parent)===null||l===void 0?void 0:l._prefixes)===null||u===void 0)&&u.has(c)||this._prefixes&&!this._prefixes.has(c))throw new Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}};e.Scope=n;var i=class extends t.Name{constructor(c,l){super(l),this.prefix=c}setValue(c,{property:l,itemIndex:u}){this.value=c,this.scopePath=(0,t._)`.${new t.Name(l)}[${u}]`}};e.ValueScopeName=i;let a=(0,t._)`\n`;var s=class extends n{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?a:t.nil}}get(){return this._scope}name(c){return new i(c,this._newName(c))}value(c,l){var u;if(l.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let d=this.toName(c),{prefix:m}=d,f=(u=l.key)!==null&&u!==void 0?u:l.ref,h=this._values[m];if(h){let p=h.get(f);if(p)return p}else h=this._values[m]=new Map;h.set(f,d);let y=this._scope[m]||(this._scope[m]=[]),v=y.length;return y[v]=l.ref,d.setValue(l,{property:m,itemIndex:v}),d}getValue(c,l){let u=this._values[c];if(u)return u.get(l)}scopeRefs(c,l=this._values){return this._reduceValues(l,u=>{if(u.scopePath===void 0)throw new Error(`CodeGen: name "${u}" has no value`);return(0,t._)`${c}${u.scopePath}`})}scopeCode(c=this._values,l,u){return this._reduceValues(c,d=>{if(d.value===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return d.value.code},l,u)}_reduceValues(c,l,u={},d){let m=t.nil;for(let f in c){let h=c[f];if(!h)continue;let y=u[f]=u[f]||new Map;h.forEach(v=>{if(y.has(v))return;y.set(v,o.Started);let p=l(v);if(p){let b=this.opts.es5?e.varKinds.var:e.varKinds.const;m=(0,t._)`${m}${b} ${v} = ${p};${this.opts._n}`}else if(p=d?.(v))m=(0,t._)`${m}${p}${this.opts._n}`;else throw new r(v);y.set(v,o.Completed)})}return m}};e.ValueScope=s})),xe=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=pf(),r=kI();var o=pf();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var n=kI();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var i=class{optimizeNodes(){return this}optimizeNames($,k){return this}},a=class extends i{constructor($,k,x){super(),this.varKind=$,this.name=k,this.rhs=x}render({es5:$,_n:k}){let x=$?r.varKinds.var:this.varKind,j=this.rhs===void 0?"":` = ${this.rhs}`;return`${x} ${this.name}${j};`+k}optimizeNames($,k){if($[this.name.str])return this.rhs&&(this.rhs=ee(this.rhs,$,k)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends i{constructor($,k,x){super(),this.lhs=$,this.rhs=k,this.sideEffects=x}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,k){if(!(this.lhs instanceof t.Name&&!$[this.lhs.str]&&!this.sideEffects))return this.rhs=ee(this.rhs,$,k),this}get names(){return Y(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor($,k,x,j){super($,x,j),this.op=k}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}},l=class extends i{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}},u=class extends i{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}},d=class extends i{constructor($){super(),this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}},m=class extends i{constructor($){super(),this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,k){return this.code=ee(this.code,$,k),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},f=class extends i{constructor($=[]){super(),this.nodes=$}render($){return this.nodes.reduce((k,x)=>k+x.render($),"")}optimizeNodes(){let{nodes:$}=this,k=$.length;for(;k--;){let x=$[k].optimizeNodes();Array.isArray(x)?$.splice(k,1,...x):x?$[k]=x:$.splice(k,1)}return $.length>0?this:void 0}optimizeNames($,k){let{nodes:x}=this,j=x.length;for(;j--;){let J=x[j];J.optimizeNames($,k)||(_e($,J.names),x.splice(j,1))}return x.length>0?this:void 0}get names(){return this.nodes.reduce(($,k)=>D($,k.names),{})}},h=class extends f{render($){return"{"+$._n+super.render($)+"}"+$._n}},y=class extends f{},v=class extends h{};v.kind="else";var p=class ff extends h{constructor(k,x){super(x),this.condition=k}render(k){let x=`if(${this.condition})`+super.render(k);return this.else&&(x+="else "+this.else.render(k)),x}optimizeNodes(){super.optimizeNodes();let k=this.condition;if(k===!0)return this.nodes;let x=this.else;if(x){let j=x.optimizeNodes();x=this.else=Array.isArray(j)?new v(j):j}if(x)return k===!1?x instanceof ff?x:x.nodes:this.nodes.length?this:new ff(Pe(k),x instanceof ff?[x]:x.nodes);if(!(k===!1||!this.nodes.length))return this}optimizeNames(k,x){var j;if(this.else=(j=this.else)===null||j===void 0?void 0:j.optimizeNames(k,x),!!(super.optimizeNames(k,x)||this.else))return this.condition=ee(this.condition,k,x),this}get names(){let k=super.names;return Y(k,this.condition),this.else&&D(k,this.else.names),k}};p.kind="if";var b=class extends h{};b.kind="for";var g=class extends b{constructor($){super(),this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,k){if(super.optimizeNames($,k))return this.iteration=ee(this.iteration,$,k),this}get names(){return D(super.names,this.iteration.names)}},S=class extends b{constructor($,k,x,j){super(),this.varKind=$,this.name=k,this.from=x,this.to=j}render($){let k=$.es5?r.varKinds.var:this.varKind,{name:x,from:j,to:J}=this;return`for(${k} ${x}=${j}; ${x}<${J}; ${x}++)`+super.render($)}get names(){return Y(Y(super.names,this.from),this.to)}},T=class extends b{constructor($,k,x,j){super(),this.loop=$,this.varKind=k,this.name=x,this.iterable=j}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,k){if(super.optimizeNames($,k))return this.iterable=ee(this.iterable,$,k),this}get names(){return D(super.names,this.iterable.names)}},R=class extends h{constructor($,k,x){super(),this.name=$,this.args=k,this.async=x}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}};R.kind="func";var w=class extends f{render($){return"return "+super.render($)}};w.kind="return";var z=class extends h{render($){let k="try"+super.render($);return this.catch&&(k+=this.catch.render($)),this.finally&&(k+=this.finally.render($)),k}optimizeNodes(){var $,k;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames($,k){var x,j;return super.optimizeNames($,k),(x=this.catch)===null||x===void 0||x.optimizeNames($,k),(j=this.finally)===null||j===void 0||j.optimizeNames($,k),this}get names(){let $=super.names;return this.catch&&D($,this.catch.names),this.finally&&D($,this.finally.names),$}},P=class extends h{constructor($){super(),this.error=$}render($){return`catch(${this.error})`+super.render($)}};P.kind="catch";var U=class extends h{render($){return"finally"+super.render($)}};U.kind="finally";var O=class{constructor($,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
|
|
67
|
+
`:""},this._extScope=$,this._scope=new r.Scope({parent:$}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,k){let x=this._extScope.value($,k);return(this._values[x.prefix]||(this._values[x.prefix]=new Set)).add(x),x}getScopeValue($,k){return this._extScope.getValue($,k)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,k,x,j){let J=this._scope.toName(k);return x!==void 0&&j&&(this._constants[J.str]=x),this._leafNode(new a($,J,x)),J}const($,k,x){return this._def(r.varKinds.const,$,k,x)}let($,k,x){return this._def(r.varKinds.let,$,k,x)}var($,k,x){return this._def(r.varKinds.var,$,k,x)}assign($,k,x){return this._leafNode(new s($,k,x))}add($,k){return this._leafNode(new c($,e.operators.ADD,k))}code($){return typeof $=="function"?$():$!==t.nil&&this._leafNode(new m($)),this}object(...$){let k=["{"];for(let[x,j]of $)k.length>1&&k.push(","),k.push(x),(x!==j||this.opts.es5)&&(k.push(":"),(0,t.addCodeArg)(k,j));return k.push("}"),new t._Code(k)}if($,k,x){if(this._blockNode(new p($)),k&&x)this.code(k).else().code(x).endIf();else if(k)this.code(k).endIf();else if(x)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new p($))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(p,v)}_for($,k){return this._blockNode($),k&&this.code(k).endFor(),this}for($,k){return this._for(new g($),k)}forRange($,k,x,j,J=this.opts.es5?r.varKinds.var:r.varKinds.let){let oe=this._scope.toName($);return this._for(new S(J,oe,k,x),()=>j(oe))}forOf($,k,x,j=r.varKinds.const){let J=this._scope.toName($);if(this.opts.es5){let oe=k instanceof t.Name?k:this.var("_arr",k);return this.forRange("_i",0,(0,t._)`${oe}.length`,re=>{this.var(J,(0,t._)`${oe}[${re}]`),x(J)})}return this._for(new T("of",j,J,k),()=>x(J))}forIn($,k,x,j=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf($,(0,t._)`Object.keys(${k})`,x);let J=this._scope.toName($);return this._for(new T("in",j,J,k),()=>x(J))}endFor(){return this._endBlockNode(b)}label($){return this._leafNode(new l($))}break($){return this._leafNode(new u($))}return($){let k=new w;if(this._blockNode(k),this.code($),k.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(w)}try($,k,x){if(!k&&!x)throw new Error('CodeGen: "try" without "catch" and "finally"');let j=new z;if(this._blockNode(j),this.code($),k){let J=this.name("e");this._currNode=j.catch=new P(J),k(J)}return x&&(this._currNode=j.finally=new U,this.code(x)),this._endBlockNode(P,U)}throw($){return this._leafNode(new d($))}block($,k){return this._blockStarts.push(this._nodes.length),$&&this.code($).endBlock(k),this}endBlock($){let k=this._blockStarts.pop();if(k===void 0)throw new Error("CodeGen: not in self-balancing block");let x=this._nodes.length-k;if(x<0||$!==void 0&&x!==$)throw new Error(`CodeGen: wrong number of nodes: ${x} vs ${$} expected`);return this._nodes.length=k,this}func($,k=t.nil,x,j){return this._blockNode(new R($,k,x)),j&&this.code(j).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize($=1){for(;$-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,k){let x=this._currNode;if(x instanceof $||k&&x instanceof k)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${k?`${$.kind}/${k.kind}`:$.kind}"`)}_elseNode($){let k=this._currNode;if(!(k instanceof p))throw new Error('CodeGen: "else" without "if"');return this._currNode=k.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let k=this._nodes;k[k.length-1]=$}};e.CodeGen=O;function D($,k){for(let x in k)$[x]=($[x]||0)+(k[x]||0);return $}function Y($,k){return k instanceof t._CodeOrName?D($,k.names):$}function ee($,k,x){if($ instanceof t.Name)return j($);if(!J($))return $;return new t._Code($._items.reduce((oe,re)=>(re instanceof t.Name&&(re=j(re)),re instanceof t._Code?oe.push(...re._items):oe.push(re),oe),[]));function j(oe){let re=x[oe.str];return re===void 0||k[oe.str]!==1?oe:(delete k[oe.str],re)}function J(oe){return oe instanceof t._Code&&oe._items.some(re=>re instanceof t.Name&&k[re.str]===1&&x[re.str]!==void 0)}}function _e($,k){for(let x in k)$[x]=($[x]||0)-(k[x]||0)}function Pe($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:(0,t._)`!${I($)}`}e.not=Pe;let Re=V(e.operators.AND);function Ze(...$){return $.reduce(Re)}e.and=Ze;let Te=V(e.operators.OR);function N(...$){return $.reduce(Te)}e.or=N;function V($){return(k,x)=>k===t.nil?x:x===t.nil?k:(0,t._)`${I(k)} ${$} ${I(x)}`}function I($){return $ instanceof t.Name?$:(0,t._)`(${$})`}})),Me=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let t=xe(),r=pf();function o(R){let w={};for(let z of R)w[z]=!0;return w}e.toHash=o;function n(R,w){return typeof w=="boolean"?w:Object.keys(w).length===0?!0:(i(R,w),!a(w,R.self.RULES.all))}e.alwaysValidSchema=n;function i(R,w=R.schema){let{opts:z,self:P}=R;if(!z.strictSchema||typeof w=="boolean")return;let U=P.RULES.keywords;for(let O in w)U[O]||T(R,`unknown keyword: "${O}"`)}e.checkUnknownRules=i;function a(R,w){if(typeof R=="boolean")return!R;for(let z in R)if(w[z])return!0;return!1}e.schemaHasRules=a;function s(R,w){if(typeof R=="boolean")return!R;for(let z in R)if(z!=="$ref"&&w.all[z])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:R,schemaPath:w},z,P,U){if(!U){if(typeof z=="number"||typeof z=="boolean")return z;if(typeof z=="string")return(0,t._)`${z}`}return(0,t._)`${R}${w}${(0,t.getProperty)(P)}`}e.schemaRefOrVal=c;function l(R){return m(decodeURIComponent(R))}e.unescapeFragment=l;function u(R){return encodeURIComponent(d(R))}e.escapeFragment=u;function d(R){return typeof R=="number"?`${R}`:R.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=d;function m(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=m;function f(R,w){if(Array.isArray(R))for(let z of R)w(z);else w(R)}e.eachItem=f;function h({mergeNames:R,mergeToName:w,mergeValues:z,resultToName:P}){return(U,O,D,Y)=>{let ee=D===void 0?O:D instanceof t.Name?(O instanceof t.Name?R(U,O,D):w(U,O,D),D):O instanceof t.Name?(w(U,D,O),O):z(O,D);return Y===t.Name&&!(ee instanceof t.Name)?P(U,ee):ee}}e.mergeEvaluated={props:h({mergeNames:(R,w,z)=>R.if((0,t._)`${z} !== true && ${w} !== undefined`,()=>{R.if((0,t._)`${w} === true`,()=>R.assign(z,!0),()=>R.assign(z,(0,t._)`${z} || {}`).code((0,t._)`Object.assign(${z}, ${w})`))}),mergeToName:(R,w,z)=>R.if((0,t._)`${z} !== true`,()=>{w===!0?R.assign(z,!0):(R.assign(z,(0,t._)`${z} || {}`),v(R,z,w))}),mergeValues:(R,w)=>R===!0?!0:{...R,...w},resultToName:y}),items:h({mergeNames:(R,w,z)=>R.if((0,t._)`${z} !== true && ${w} !== undefined`,()=>R.assign(z,(0,t._)`${w} === true ? true : ${z} > ${w} ? ${z} : ${w}`)),mergeToName:(R,w,z)=>R.if((0,t._)`${z} !== true`,()=>R.assign(z,w===!0?!0:(0,t._)`${z} > ${w} ? ${z} : ${w}`)),mergeValues:(R,w)=>R===!0?!0:Math.max(R,w),resultToName:(R,w)=>R.var("items",w)})};function y(R,w){if(w===!0)return R.var("props",!0);let z=R.var("props",(0,t._)`{}`);return w!==void 0&&v(R,z,w),z}e.evaluatedPropsToName=y;function v(R,w,z){Object.keys(z).forEach(P=>R.assign((0,t._)`${w}${(0,t.getProperty)(P)}`,!0))}e.setEvaluated=v;let p={};function b(R,w){return R.scopeValue("func",{ref:w,code:p[w.code]||(p[w.code]=new r._Code(w.code))})}e.useFunc=b;var g;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(g||(e.Type=g={}));function S(R,w,z){if(R instanceof t.Name){let P=w===g.Num;return z?P?(0,t._)`"[" + ${R} + "]"`:(0,t._)`"['" + ${R} + "']"`:P?(0,t._)`"/" + ${R}`:(0,t._)`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return z?(0,t.getProperty)(R).toString():"/"+d(R)}e.getErrorPath=S;function T(R,w,z=R.opts.strictSchema){if(z){if(w=`strict mode: ${w}`,z===!0)throw new Error(w);R.self.logger.warn(w)}}e.checkStrictMode=T})),hn=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};e.default=r})),gf=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=xe(),r=Me(),o=hn();e.keywordError={message:({keyword:v})=>(0,t.str)`must pass "${v}" keyword validation`},e.keyword$DataError={message:({keyword:v,schemaType:p})=>p?(0,t.str)`"${v}" keyword must be ${p} ($data)`:(0,t.str)`"${v}" keyword is invalid ($data)`};function n(v,p=e.keywordError,b,g){let{it:S}=v,{gen:T,compositeRule:R,allErrors:w}=S,z=d(v,p,b);g??(R||w)?c(T,z):l(S,(0,t._)`[${z}]`)}e.reportError=n;function i(v,p=e.keywordError,b){let{it:g}=v,{gen:S,compositeRule:T,allErrors:R}=g;c(S,d(v,p,b)),T||R||l(g,o.default.vErrors)}e.reportExtraError=i;function a(v,p){v.assign(o.default.errors,p),v.if((0,t._)`${o.default.vErrors} !== null`,()=>v.if(p,()=>v.assign((0,t._)`${o.default.vErrors}.length`,p),()=>v.assign(o.default.vErrors,null)))}e.resetErrorsCount=a;function s({gen:v,keyword:p,schemaValue:b,data:g,errsCount:S,it:T}){if(S===void 0)throw new Error("ajv implementation error");let R=v.name("err");v.forRange("i",S,o.default.errors,w=>{v.const(R,(0,t._)`${o.default.vErrors}[${w}]`),v.if((0,t._)`${R}.instancePath === undefined`,()=>v.assign((0,t._)`${R}.instancePath`,(0,t.strConcat)(o.default.instancePath,T.errorPath))),v.assign((0,t._)`${R}.schemaPath`,(0,t.str)`${T.errSchemaPath}/${p}`),T.opts.verbose&&(v.assign((0,t._)`${R}.schema`,b),v.assign((0,t._)`${R}.data`,g))})}e.extendErrors=s;function c(v,p){let b=v.const("err",p);v.if((0,t._)`${o.default.vErrors} === null`,()=>v.assign(o.default.vErrors,(0,t._)`[${b}]`),(0,t._)`${o.default.vErrors}.push(${b})`),v.code((0,t._)`${o.default.errors}++`)}function l(v,p){let{gen:b,validateName:g,schemaEnv:S}=v;S.$async?b.throw((0,t._)`new ${v.ValidationError}(${p})`):(b.assign((0,t._)`${g}.errors`,p),b.return(!1))}let u={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function d(v,p,b){let{createErrors:g}=v.it;return g===!1?(0,t._)`{}`:m(v,p,b)}function m(v,p,b={}){let{gen:g,it:S}=v,T=[f(S,b),h(v,b)];return y(v,p,T),g.object(...T)}function f({errorPath:v},{instancePath:p}){let b=p?(0,t.str)`${v}${(0,r.getErrorPath)(p,r.Type.Str)}`:v;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,b)]}function h({keyword:v,it:{errSchemaPath:p}},{schemaPath:b,parentSchema:g}){let S=g?p:(0,t.str)`${p}/${v}`;return b&&(S=(0,t.str)`${S}${(0,r.getErrorPath)(b,r.Type.Str)}`),[u.schemaPath,S]}function y(v,{params:p,message:b},g){let{keyword:S,data:T,schemaValue:R,it:w}=v,{opts:z,propertyName:P,topSchemaRef:U,schemaPath:O}=w;g.push([u.keyword,S],[u.params,typeof p=="function"?p(v):p||(0,t._)`{}`]),z.messages&&g.push([u.message,typeof b=="function"?b(v):b]),z.verbose&&g.push([u.schema,R],[u.parentSchema,(0,t._)`${U}${O}`],[o.default.data,T]),P&&g.push([u.propertyName,P])}})),m1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=gf(),r=xe(),o=hn(),n={message:"boolean schema is false"};function i(c){let{gen:l,schema:u,validateName:d}=c;u===!1?s(c,!1):typeof u=="object"&&u.$async===!0?l.return(o.default.data):(l.assign((0,r._)`${d}.errors`,null),l.return(!0))}e.topBoolOrEmptySchema=i;function a(c,l){let{gen:u,schema:d}=c;d===!1?(u.var(l,!1),s(c)):u.var(l,!0)}e.boolOrEmptySchema=a;function s(c,l){let{gen:u,data:d}=c,m={gen:u,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,t.reportError)(m,n,void 0,l)}})),zI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);function r(n){return typeof n=="string"&&t.has(n)}e.isJSONType=r;function o(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=o})),RI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:i},a){let s=i.RULES.types[a];return s&&s!==!0&&r(n,s)}e.schemaHasRulesForType=t;function r(n,i){return i.rules.some(a=>o(n,a))}e.shouldUseGroup=r;function o(n,i){var a;return n[i.keyword]!==void 0||((a=i.definition.implements)===null||a===void 0?void 0:a.some(s=>n[s]!==void 0))}e.shouldUseRule=o})),hf=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let t=zI(),r=RI(),o=gf(),n=xe(),i=Me();var a;(function(g){g[g.Correct=0]="Correct",g[g.Wrong=1]="Wrong"})(a||(e.DataType=a={}));function s(g){let S=c(g.type);if(S.includes("null")){if(g.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!S.length&&g.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');g.nullable===!0&&S.push("null")}return S}e.getSchemaTypes=s;function c(g){let S=Array.isArray(g)?g:g?[g]:[];if(S.every(t.isJSONType))return S;throw new Error("type must be JSONType or JSONType[]: "+S.join(","))}e.getJSONTypes=c;function l(g,S){let{gen:T,data:R,opts:w}=g,z=d(S,w.coerceTypes),P=S.length>0&&!(z.length===0&&S.length===1&&(0,r.schemaHasRulesForType)(g,S[0]));if(P){let U=y(S,R,w.strictNumbers,a.Wrong);T.if(U,()=>{z.length?m(g,S,z):p(g)})}return P}e.coerceAndCheckDataType=l;let u=new Set(["string","number","integer","boolean","null"]);function d(g,S){return S?g.filter(T=>u.has(T)||S==="array"&&T==="array"):[]}function m(g,S,T){let{gen:R,data:w,opts:z}=g,P=R.let("dataType",(0,n._)`typeof ${w}`),U=R.let("coerced",(0,n._)`undefined`);z.coerceTypes==="array"&&R.if((0,n._)`${P} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>R.assign(w,(0,n._)`${w}[0]`).assign(P,(0,n._)`typeof ${w}`).if(y(S,w,z.strictNumbers),()=>R.assign(U,w))),R.if((0,n._)`${U} !== undefined`);for(let D of T)(u.has(D)||D==="array"&&z.coerceTypes==="array")&&O(D);R.else(),p(g),R.endIf(),R.if((0,n._)`${U} !== undefined`,()=>{R.assign(w,U),f(g,U)});function O(D){switch(D){case"string":R.elseIf((0,n._)`${P} == "number" || ${P} == "boolean"`).assign(U,(0,n._)`"" + ${w}`).elseIf((0,n._)`${w} === null`).assign(U,(0,n._)`""`);return;case"number":R.elseIf((0,n._)`${P} == "boolean" || ${w} === null
|
|
68
|
+
|| (${P} == "string" && ${w} && ${w} == +${w})`).assign(U,(0,n._)`+${w}`);return;case"integer":R.elseIf((0,n._)`${P} === "boolean" || ${w} === null
|
|
69
|
+
|| (${P} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(U,(0,n._)`+${w}`);return;case"boolean":R.elseIf((0,n._)`${w} === "false" || ${w} === 0 || ${w} === null`).assign(U,!1).elseIf((0,n._)`${w} === "true" || ${w} === 1`).assign(U,!0);return;case"null":R.elseIf((0,n._)`${w} === "" || ${w} === 0 || ${w} === false`),R.assign(U,null);return;case"array":R.elseIf((0,n._)`${P} === "string" || ${P} === "number"
|
|
70
|
+
|| ${P} === "boolean" || ${w} === null`).assign(U,(0,n._)`[${w}]`)}}}function f({gen:g,parentData:S,parentDataProperty:T},R){g.if((0,n._)`${S} !== undefined`,()=>g.assign((0,n._)`${S}[${T}]`,R))}function h(g,S,T,R=a.Correct){let w=R===a.Correct?n.operators.EQ:n.operators.NEQ,z;switch(g){case"null":return(0,n._)`${S} ${w} null`;case"array":z=(0,n._)`Array.isArray(${S})`;break;case"object":z=(0,n._)`${S} && typeof ${S} == "object" && !Array.isArray(${S})`;break;case"integer":z=P((0,n._)`!(${S} % 1) && !isNaN(${S})`);break;case"number":z=P();break;default:return(0,n._)`typeof ${S} ${w} ${g}`}return R===a.Correct?z:(0,n.not)(z);function P(U=n.nil){return(0,n.and)((0,n._)`typeof ${S} == "number"`,U,T?(0,n._)`isFinite(${S})`:n.nil)}}e.checkDataType=h;function y(g,S,T,R){if(g.length===1)return h(g[0],S,T,R);let w,z=(0,i.toHash)(g);if(z.array&&z.object){let P=(0,n._)`typeof ${S} != "object"`;w=z.null?P:(0,n._)`!${S} || ${P}`,delete z.null,delete z.array,delete z.object}else w=n.nil;z.number&&delete z.integer;for(let P in z)w=(0,n.and)(w,h(P,S,T,R));return w}e.checkDataTypes=y;let v={message:({schema:g})=>`must be ${g}`,params:({schema:g,schemaValue:S})=>typeof g=="string"?(0,n._)`{type: ${g}}`:(0,n._)`{type: ${S}}`};function p(g){let S=b(g);(0,o.reportError)(S,v)}e.reportTypeError=p;function b(g){let{gen:S,data:T,schema:R}=g,w=(0,i.schemaRefOrVal)(g,R,"type");return{gen:S,keyword:"type",data:T,schema:R.type,schemaCode:w,schemaValue:w,parentSchema:R,params:{},it:g}}})),f1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=xe(),r=Me();function o(i,a){let{properties:s,items:c}=i.schema;if(a==="object"&&s)for(let l in s)n(i,l,s[l].default);else a==="array"&&Array.isArray(c)&&c.forEach((l,u)=>n(i,u,l.default))}e.assignDefaults=o;function n(i,a,s){let{gen:c,compositeRule:l,data:u,opts:d}=i;if(s===void 0)return;let m=(0,t._)`${u}${(0,t.getProperty)(a)}`;if(l){(0,r.checkStrictMode)(i,`default is ignored for: ${m}`);return}let f=(0,t._)`${m} === undefined`;d.useDefaults==="empty"&&(f=(0,t._)`${f} || ${m} === null || ${m} === ""`),c.if(f,(0,t._)`${m} = ${(0,t.stringify)(s)}`)}})),gn=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=xe(),r=Me(),o=hn(),n=Me();function i(g,S){let{gen:T,data:R,it:w}=g;T.if(d(T,R,S,w.opts.ownProperties),()=>{g.setParams({missingProperty:(0,t._)`${S}`},!0),g.error()})}e.checkReportMissingProp=i;function a({gen:g,data:S,it:{opts:T}},R,w){return(0,t.or)(...R.map(z=>(0,t.and)(d(g,S,z,T.ownProperties),(0,t._)`${w} = ${z}`)))}e.checkMissingProp=a;function s(g,S){g.setParams({missingProperty:S},!0),g.error()}e.reportMissingProp=s;function c(g){return g.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(g,S,T){return(0,t._)`${c(g)}.call(${S}, ${T})`}e.isOwnProperty=l;function u(g,S,T,R){let w=(0,t._)`${S}${(0,t.getProperty)(T)} !== undefined`;return R?(0,t._)`${w} && ${l(g,S,T)}`:w}e.propertyInData=u;function d(g,S,T,R){let w=(0,t._)`${S}${(0,t.getProperty)(T)} === undefined`;return R?(0,t.or)(w,(0,t.not)(l(g,S,T))):w}e.noPropertyInData=d;function m(g){return g?Object.keys(g).filter(S=>S!=="__proto__"):[]}e.allSchemaProperties=m;function f(g,S){return m(S).filter(T=>!(0,r.alwaysValidSchema)(g,S[T]))}e.schemaProperties=f;function h({schemaCode:g,data:S,it:{gen:T,topSchemaRef:R,schemaPath:w,errorPath:z},it:P},U,O,D){let Y=D?(0,t._)`${g}, ${S}, ${R}${w}`:S,ee=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,z)],[o.default.parentData,P.parentData],[o.default.parentDataProperty,P.parentDataProperty],[o.default.rootData,o.default.rootData]];P.opts.dynamicRef&&ee.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let _e=(0,t._)`${Y}, ${T.object(...ee)}`;return O!==t.nil?(0,t._)`${U}.call(${O}, ${_e})`:(0,t._)`${U}(${_e})`}e.callValidateCode=h;let y=(0,t._)`new RegExp`;function v({gen:g,it:{opts:S}},T){let R=S.unicodeRegExp?"u":"",{regExp:w}=S.code,z=w(T,R);return g.scopeValue("pattern",{key:z.toString(),ref:z,code:(0,t._)`${w.code==="new RegExp"?y:(0,n.useFunc)(g,w)}(${T}, ${R})`})}e.usePattern=v;function p(g){let{gen:S,data:T,keyword:R,it:w}=g,z=S.name("valid");if(w.allErrors){let U=S.let("valid",!0);return P(()=>S.assign(U,!1)),U}return S.var(z,!0),P(()=>S.break()),z;function P(U){let O=S.const("len",(0,t._)`${T}.length`);S.forRange("i",0,O,D=>{g.subschema({keyword:R,dataProp:D,dataPropType:r.Type.Num},z),S.if((0,t.not)(z),U)})}}e.validateArray=p;function b(g){let{gen:S,schema:T,keyword:R,it:w}=g;if(!Array.isArray(T))throw new Error("ajv implementation error");if(T.some(U=>(0,r.alwaysValidSchema)(w,U))&&!w.opts.unevaluated)return;let z=S.let("valid",!1),P=S.name("_valid");S.block(()=>T.forEach((U,O)=>{let D=g.subschema({keyword:R,schemaProp:O,compositeRule:!0},P);S.assign(z,(0,t._)`${z} || ${P}`),g.mergeValidEvaluated(D,P)||S.if((0,t.not)(z))})),g.result(z,()=>g.reset(),()=>g.error(!0))}e.validateUnion=b})),p1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=xe(),r=hn(),o=gn(),n=gf();function i(f,h){let{gen:y,keyword:v,schema:p,parentSchema:b,it:g}=f,S=h.macro.call(g.self,p,b,g),T=u(y,v,S);g.opts.validateSchema!==!1&&g.self.validateSchema(S,!0);let R=y.name("valid");f.subschema({schema:S,schemaPath:t.nil,errSchemaPath:`${g.errSchemaPath}/${v}`,topSchemaRef:T,compositeRule:!0},R),f.pass(R,()=>f.error(!0))}e.macroKeywordCode=i;function a(f,h){var y;let{gen:v,keyword:p,schema:b,parentSchema:g,$data:S,it:T}=f;l(T,h);let R=u(v,p,!S&&h.compile?h.compile.call(T.self,b,g,T):h.validate),w=v.let("valid");f.block$data(w,z),f.ok((y=h.valid)!==null&&y!==void 0?y:w);function z(){if(h.errors===!1)O(),h.modifying&&s(f),D(()=>f.error());else{let Y=h.async?P():U();h.modifying&&s(f),D(()=>c(f,Y))}}function P(){let Y=v.let("ruleErrs",null);return v.try(()=>O((0,t._)`await `),ee=>v.assign(w,!1).if((0,t._)`${ee} instanceof ${T.ValidationError}`,()=>v.assign(Y,(0,t._)`${ee}.errors`),()=>v.throw(ee))),Y}function U(){let Y=(0,t._)`${R}.errors`;return v.assign(Y,null),O(t.nil),Y}function O(Y=h.async?(0,t._)`await `:t.nil){let ee=T.opts.passContext?r.default.this:r.default.self,_e=!("compile"in h&&!S||h.schema===!1);v.assign(w,(0,t._)`${Y}${(0,o.callValidateCode)(f,R,ee,_e)}`,h.modifying)}function D(Y){var ee;v.if((0,t.not)((ee=h.valid)!==null&&ee!==void 0?ee:w),Y)}}e.funcKeywordCode=a;function s(f){let{gen:h,data:y,it:v}=f;h.if(v.parentData,()=>h.assign(y,(0,t._)`${v.parentData}[${v.parentDataProperty}]`))}function c(f,h){let{gen:y}=f;y.if((0,t._)`Array.isArray(${h})`,()=>{y.assign(r.default.vErrors,(0,t._)`${r.default.vErrors} === null ? ${h} : ${r.default.vErrors}.concat(${h})`).assign(r.default.errors,(0,t._)`${r.default.vErrors}.length`),(0,n.extendErrors)(f)},()=>f.error())}function l({schemaEnv:f},h){if(h.async&&!f.$async)throw new Error("async keyword in sync schema")}function u(f,h,y){if(y===void 0)throw new Error(`keyword "${h}" failed to compile`);return f.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,t.stringify)(y)})}function d(f,h,y=!1){return!h.length||h.some(v=>v==="array"?Array.isArray(f):v==="object"?f&&typeof f=="object"&&!Array.isArray(f):typeof f==v||y&&typeof f>"u")}e.validSchemaType=d;function m({schema:f,opts:h,self:y,errSchemaPath:v},p,b){if(Array.isArray(p.keyword)?!p.keyword.includes(b):p.keyword!==b)throw new Error("ajv implementation error");let g=p.dependencies;if(g?.some(S=>!Object.prototype.hasOwnProperty.call(f,S)))throw new Error(`parent schema must have dependencies of ${b}: ${g.join(",")}`);if(p.validateSchema&&!p.validateSchema(f[b])){let S=`keyword "${b}" value is invalid at path "${v}": `+y.errorsText(p.validateSchema.errors);if(h.validateSchema==="log")y.logger.error(S);else throw new Error(S)}}e.validateKeywordUsage=m})),h1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=xe(),r=Me();function o(a,{keyword:s,schemaProp:c,schema:l,schemaPath:u,errSchemaPath:d,topSchemaRef:m}){if(s!==void 0&&l!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(s!==void 0){let f=a.schema[s];return c===void 0?{schema:f,schemaPath:(0,t._)`${a.schemaPath}${(0,t.getProperty)(s)}`,errSchemaPath:`${a.errSchemaPath}/${s}`}:{schema:f[c],schemaPath:(0,t._)`${a.schemaPath}${(0,t.getProperty)(s)}${(0,t.getProperty)(c)}`,errSchemaPath:`${a.errSchemaPath}/${s}/${(0,r.escapeFragment)(c)}`}}if(l!==void 0){if(u===void 0||d===void 0||m===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:u,topSchemaRef:m,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(a,s,{dataProp:c,dataPropType:l,data:u,dataTypes:d,propertyName:m}){if(u!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:f}=s;if(c!==void 0){let{errorPath:y,dataPathArr:v,opts:p}=s;h(f.let("data",(0,t._)`${s.data}${(0,t.getProperty)(c)}`,!0)),a.errorPath=(0,t.str)`${y}${(0,r.getErrorPath)(c,l,p.jsPropertySyntax)}`,a.parentDataProperty=(0,t._)`${c}`,a.dataPathArr=[...v,a.parentDataProperty]}u!==void 0&&(h(u instanceof t.Name?u:f.let("data",u,!0)),m!==void 0&&(a.propertyName=m)),d&&(a.dataTypes=d);function h(y){a.data=y,a.dataLevel=s.dataLevel+1,a.dataTypes=[],s.definedProperties=new Set,a.parentData=s.data,a.dataNames=[...s.dataNames,y]}}e.extendSubschemaData=n;function i(a,{jtdDiscriminator:s,jtdMetadata:c,compositeRule:l,createErrors:u,allErrors:d}){l!==void 0&&(a.compositeRule=l),u!==void 0&&(a.createErrors=u),d!==void 0&&(a.allErrors=d),a.jtdDiscriminator=s,a.jtdMetadata=c}e.extendSubschemaMode=i})),II=W(((e,t)=>{t.exports=function r(o,n){if(o===n)return!0;if(o&&n&&typeof o=="object"&&typeof n=="object"){if(o.constructor!==n.constructor)return!1;var i,a,s;if(Array.isArray(o)){if(i=o.length,i!=n.length)return!1;for(a=i;a--!==0;)if(!r(o[a],n[a]))return!1;return!0}if(o.constructor===RegExp)return o.source===n.source&&o.flags===n.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===n.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===n.toString();if(s=Object.keys(o),i=s.length,i!==Object.keys(n).length)return!1;for(a=i;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[a]))return!1;for(a=i;a--!==0;){var c=s[a];if(!r(o[c],n[c]))return!1}return!0}return o!==o&&n!==n}})),g1=W(((e,t)=>{var r=t.exports=function(i,a,s){typeof a=="function"&&(s=a,a={}),s=a.cb||s;var c=typeof s=="function"?s:s.pre||function(){},l=s.post||function(){};o(a,c,l,i,"",i)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function o(i,a,s,c,l,u,d,m,f,h){if(c&&typeof c=="object"&&!Array.isArray(c)){a(c,l,u,d,m,f,h);for(var y in c){var v=c[y];if(Array.isArray(v)){if(y in r.arrayKeywords)for(var p=0;p<v.length;p++)o(i,a,s,v[p],l+"/"+y+"/"+p,u,l,y,c,p)}else if(y in r.propsKeywords){if(v&&typeof v=="object")for(var b in v)o(i,a,s,v[b],l+"/"+y+"/"+n(b),u,l,y,c,b)}else(y in r.keywords||i.allKeys&&!(y in r.skipKeywords))&&o(i,a,s,v,l+"/"+y,u,l,y,c)}s(c,l,u,d,m,f,h)}}function n(i){return i.replace(/~/g,"~0").replace(/\//g,"~1")}})),vf=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=Me(),r=II(),o=g1(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(v,p=!0){return typeof v=="boolean"?!0:p===!0?!s(v):p?c(v)<=p:!1}e.inlineRef=i;let a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function s(v){for(let p in v){if(a.has(p))return!0;let b=v[p];if(Array.isArray(b)&&b.some(s)||typeof b=="object"&&s(b))return!0}return!1}function c(v){let p=0;for(let b in v){if(b==="$ref")return 1/0;if(p++,!n.has(b)&&(typeof v[b]=="object"&&(0,t.eachItem)(v[b],g=>p+=c(g)),p===1/0))return 1/0}return p}function l(v,p="",b){return b!==!1&&(p=m(p)),u(v,v.parse(p))}e.getFullPath=l;function u(v,p){return v.serialize(p).split("#")[0]+"#"}e._getFullPath=u;let d=/#\/?$/;function m(v){return v?v.replace(d,""):""}e.normalizeId=m;function f(v,p,b){return b=m(b),v.resolve(p,b)}e.resolveUrl=f;let h=/^[a-z_][-a-z0-9._]*$/i;function y(v,p){if(typeof v=="boolean")return{};let{schemaId:b,uriResolver:g}=this.opts,S=m(v[b]||p),T={"":S},R=l(g,S,!1),w={},z=new Set;return o(v,{allKeys:!0},(O,D,Y,ee)=>{if(ee===void 0)return;let _e=R+D,Pe=T[ee];typeof O[b]=="string"&&(Pe=Re.call(this,O[b])),Ze.call(this,O.$anchor),Ze.call(this,O.$dynamicAnchor),T[D]=Pe;function Re(Te){let N=this.opts.uriResolver.resolve;if(Te=m(Pe?N(Pe,Te):Te),z.has(Te))throw U(Te);z.add(Te);let V=this.refs[Te];return typeof V=="string"&&(V=this.refs[V]),typeof V=="object"?P(O,V.schema,Te):Te!==m(_e)&&(Te[0]==="#"?(P(O,w[Te],Te),w[Te]=O):this.refs[Te]=_e),Te}function Ze(Te){if(typeof Te=="string"){if(!h.test(Te))throw new Error(`invalid anchor "${Te}"`);Re.call(this,`#${Te}`)}}}),w;function P(O,D,Y){if(D!==void 0&&!r(O,D))throw U(Y)}function U(O){return new Error(`reference "${O}" resolves to more than one schema`)}}e.getSchemaRefs=y})),Ai=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=m1(),r=hf(),o=RI(),n=hf(),i=f1(),a=p1(),s=h1(),c=xe(),l=hn(),u=vf(),d=Me(),m=gf();function f(E){if(R(E)&&(z(E),T(E))){p(E);return}h(E,()=>(0,t.topBoolOrEmptySchema)(E))}e.validateFunctionCode=f;function h({gen:E,validateName:F,schema:K,schemaEnv:me,opts:he},ve){he.code.es5?E.func(F,(0,c._)`${l.default.data}, ${l.default.valCxt}`,me.$async,()=>{E.code((0,c._)`"use strict"; ${g(K,he)}`),v(E,he),E.code(ve)}):E.func(F,(0,c._)`${l.default.data}, ${y(he)}`,me.$async,()=>E.code(g(K,he)).code(ve))}function y(E){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${E.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function v(E,F){E.if(l.default.valCxt,()=>{E.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),E.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),E.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),E.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),F.dynamicRef&&E.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{E.var(l.default.instancePath,(0,c._)`""`),E.var(l.default.parentData,(0,c._)`undefined`),E.var(l.default.parentDataProperty,(0,c._)`undefined`),E.var(l.default.rootData,l.default.data),F.dynamicRef&&E.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function p(E){let{schema:F,opts:K,gen:me}=E;h(E,()=>{K.$comment&&F.$comment&&ee(E),O(E),me.let(l.default.vErrors,null),me.let(l.default.errors,0),K.unevaluated&&b(E),P(E),_e(E)})}function b(E){let{gen:F,validateName:K}=E;E.evaluated=F.const("evaluated",(0,c._)`${K}.evaluated`),F.if((0,c._)`${E.evaluated}.dynamicProps`,()=>F.assign((0,c._)`${E.evaluated}.props`,(0,c._)`undefined`)),F.if((0,c._)`${E.evaluated}.dynamicItems`,()=>F.assign((0,c._)`${E.evaluated}.items`,(0,c._)`undefined`))}function g(E,F){let K=typeof E=="object"&&E[F.schemaId];return K&&(F.code.source||F.code.process)?(0,c._)`/*# sourceURL=${K} */`:c.nil}function S(E,F){if(R(E)&&(z(E),T(E))){w(E,F);return}(0,t.boolOrEmptySchema)(E,F)}function T({schema:E,self:F}){if(typeof E=="boolean")return!E;for(let K in E)if(F.RULES.all[K])return!0;return!1}function R(E){return typeof E.schema!="boolean"}function w(E,F){let{schema:K,gen:me,opts:he}=E;he.$comment&&K.$comment&&ee(E),D(E),Y(E);let ve=me.const("_errs",l.default.errors);P(E,ve),me.var(F,(0,c._)`${ve} === ${l.default.errors}`)}function z(E){(0,d.checkUnknownRules)(E),U(E)}function P(E,F){if(E.opts.jtd)return Re(E,[],!1,F);let K=(0,r.getSchemaTypes)(E.schema);Re(E,K,!(0,r.coerceAndCheckDataType)(E,K),F)}function U(E){let{schema:F,errSchemaPath:K,opts:me,self:he}=E;F.$ref&&me.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(F,he.RULES)&&he.logger.warn(`$ref: keywords ignored in schema at path "${K}"`)}function O(E){let{schema:F,opts:K}=E;F.default!==void 0&&K.useDefaults&&K.strictSchema&&(0,d.checkStrictMode)(E,"default is ignored in the schema root")}function D(E){let F=E.schema[E.opts.schemaId];F&&(E.baseId=(0,u.resolveUrl)(E.opts.uriResolver,E.baseId,F))}function Y(E){if(E.schema.$async&&!E.schemaEnv.$async)throw new Error("async schema in sync schema")}function ee({gen:E,schemaEnv:F,schema:K,errSchemaPath:me,opts:he}){let ve=K.$comment;if(he.$comment===!0)E.code((0,c._)`${l.default.self}.logger.log(${ve})`);else if(typeof he.$comment=="function"){let Ae=(0,c.str)`${me}/$comment`,Ke=E.scopeValue("root",{ref:F.root});E.code((0,c._)`${l.default.self}.opts.$comment(${ve}, ${Ae}, ${Ke}.schema)`)}}function _e(E){let{gen:F,schemaEnv:K,validateName:me,ValidationError:he,opts:ve}=E;K.$async?F.if((0,c._)`${l.default.errors} === 0`,()=>F.return(l.default.data),()=>F.throw((0,c._)`new ${he}(${l.default.vErrors})`)):(F.assign((0,c._)`${me}.errors`,l.default.vErrors),ve.unevaluated&&Pe(E),F.return((0,c._)`${l.default.errors} === 0`))}function Pe({gen:E,evaluated:F,props:K,items:me}){K instanceof c.Name&&E.assign((0,c._)`${F}.props`,K),me instanceof c.Name&&E.assign((0,c._)`${F}.items`,me)}function Re(E,F,K,me){let{gen:he,schema:ve,data:Ae,allErrors:Ke,opts:Ue,self:Ge}=E,{RULES:He}=Ge;if(ve.$ref&&(Ue.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(ve,He))){he.block(()=>oe(E,"$ref",He.all.$ref.definition));return}Ue.jtd||Te(E,F),he.block(()=>{for(let ot of He.rules)Bt(ot);Bt(He.post)});function Bt(ot){(0,o.shouldUseGroup)(ve,ot)&&(ot.type?(he.if((0,n.checkDataType)(ot.type,Ae,Ue.strictNumbers)),Ze(E,ot),F.length===1&&F[0]===ot.type&&K&&(he.else(),(0,n.reportTypeError)(E)),he.endIf()):Ze(E,ot),Ke||he.if((0,c._)`${l.default.errors} === ${me||0}`))}}function Ze(E,F){let{gen:K,schema:me,opts:{useDefaults:he}}=E;he&&(0,i.assignDefaults)(E,F.type),K.block(()=>{for(let ve of F.rules)(0,o.shouldUseRule)(me,ve)&&oe(E,ve.keyword,ve.definition,F.type)})}function Te(E,F){E.schemaEnv.meta||!E.opts.strictTypes||(N(E,F),E.opts.allowUnionTypes||V(E,F),I(E,E.dataTypes))}function N(E,F){if(F.length){if(!E.dataTypes.length){E.dataTypes=F;return}F.forEach(K=>{k(E.dataTypes,K)||j(E,`type "${K}" not allowed by context "${E.dataTypes.join(",")}"`)}),x(E,F)}}function V(E,F){F.length>1&&!(F.length===2&&F.includes("null"))&&j(E,"use allowUnionTypes to allow union type keyword")}function I(E,F){let K=E.self.RULES.all;for(let me in K){let he=K[me];if(typeof he=="object"&&(0,o.shouldUseRule)(E.schema,he)){let{type:ve}=he.definition;ve.length&&!ve.some(Ae=>$(F,Ae))&&j(E,`missing type "${ve.join(",")}" for keyword "${me}"`)}}}function $(E,F){return E.includes(F)||F==="number"&&E.includes("integer")}function k(E,F){return E.includes(F)||F==="integer"&&E.includes("number")}function x(E,F){let K=[];for(let me of E.dataTypes)k(F,me)?K.push(me):F.includes("integer")&&me==="number"&&K.push("integer");E.dataTypes=K}function j(E,F){let K=E.schemaEnv.baseId+E.errSchemaPath;F+=` at "${K}" (strictTypes)`,(0,d.checkStrictMode)(E,F,E.opts.strictTypes)}var J=class{constructor(E,F,K){if((0,a.validateKeywordUsage)(E,F,K),this.gen=E.gen,this.allErrors=E.allErrors,this.keyword=K,this.data=E.data,this.schema=E.schema[K],this.$data=F.$data&&E.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(E,this.schema,K,this.$data),this.schemaType=F.schemaType,this.parentSchema=E.schema,this.params={},this.it=E,this.def=F,this.$data)this.schemaCode=E.gen.const("vSchema",De(this.$data,E));else if(this.schemaCode=this.schemaValue,!(0,a.validSchemaType)(this.schema,F.schemaType,F.allowUndefined))throw new Error(`${K} value must be ${JSON.stringify(F.schemaType)}`);("code"in F?F.trackErrors:F.errors!==!1)&&(this.errsCount=E.gen.const("_errs",l.default.errors))}result(E,F,K){this.failResult((0,c.not)(E),F,K)}failResult(E,F,K){this.gen.if(E),K?K():this.error(),F?(this.gen.else(),F(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(E,F){this.failResult((0,c.not)(E),void 0,F)}fail(E){if(E===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(E),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(E){if(!this.$data)return this.fail(E);let{schemaCode:F}=this;this.fail((0,c._)`${F} !== undefined && (${(0,c.or)(this.invalid$data(),E)})`)}error(E,F,K){if(F){this.setParams(F),this._error(E,K),this.setParams({});return}this._error(E,K)}_error(E,F){(E?m.reportExtraError:m.reportError)(this,this.def.error,F)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(E){this.allErrors||this.gen.if(E)}setParams(E,F){F?Object.assign(this.params,E):this.params=E}block$data(E,F,K=c.nil){this.gen.block(()=>{this.check$data(E,K),F()})}check$data(E=c.nil,F=c.nil){if(!this.$data)return;let{gen:K,schemaCode:me,schemaType:he,def:ve}=this;K.if((0,c.or)((0,c._)`${me} === undefined`,F)),E!==c.nil&&K.assign(E,!0),(he.length||ve.validateSchema)&&(K.elseIf(this.invalid$data()),this.$dataError(),E!==c.nil&&K.assign(E,!1)),K.else()}invalid$data(){let{gen:E,schemaCode:F,schemaType:K,def:me,it:he}=this;return(0,c.or)(ve(),Ae());function ve(){if(K.length){if(!(F instanceof c.Name))throw new Error("ajv implementation error");let Ke=Array.isArray(K)?K:[K];return(0,c._)`${(0,n.checkDataTypes)(Ke,F,he.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function Ae(){if(me.validateSchema){let Ke=E.scopeValue("validate$data",{ref:me.validateSchema});return(0,c._)`!${Ke}(${F})`}return c.nil}}subschema(E,F){let K=(0,s.getSubschema)(this.it,E);(0,s.extendSubschemaData)(K,this.it,E),(0,s.extendSubschemaMode)(K,E);let me={...this.it,...K,items:void 0,props:void 0};return S(me,F),me}mergeEvaluated(E,F){let{it:K,gen:me}=this;K.opts.unevaluated&&(K.props!==!0&&E.props!==void 0&&(K.props=d.mergeEvaluated.props(me,E.props,K.props,F)),K.items!==!0&&E.items!==void 0&&(K.items=d.mergeEvaluated.items(me,E.items,K.items,F)))}mergeValidEvaluated(E,F){let{it:K,gen:me}=this;if(K.opts.unevaluated&&(K.props!==!0||K.items!==!0))return me.if(F,()=>this.mergeEvaluated(E,c.Name)),!0}};e.KeywordCxt=J;function oe(E,F,K,me){let he=new J(E,K,F);"code"in K?K.code(he,me):he.$data&&K.validate?(0,a.funcKeywordCode)(he,K):"macro"in K?(0,a.macroKeywordCode)(he,K):(K.compile||K.validate)&&(0,a.funcKeywordCode)(he,K)}let re=/^\/(?:[^~]|~0|~1)*$/,Ie=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function De(E,{dataLevel:F,dataNames:K,dataPathArr:me}){let he,ve;if(E==="")return l.default.rootData;if(E[0]==="/"){if(!re.test(E))throw new Error(`Invalid JSON-pointer: ${E}`);he=E,ve=l.default.rootData}else{let Ge=Ie.exec(E);if(!Ge)throw new Error(`Invalid JSON-pointer: ${E}`);let He=+Ge[1];if(he=Ge[2],he==="#"){if(He>=F)throw new Error(Ue("property/index",He));return me[F-He]}if(He>F)throw new Error(Ue("data",He));if(ve=K[F-He],!he)return ve}let Ae=ve,Ke=he.split("/");for(let Ge of Ke)Ge&&(ve=(0,c._)`${ve}${(0,c.getProperty)((0,d.unescapeJsonPointer)(Ge))}`,Ae=(0,c._)`${Ae} && ${ve}`);return Ae;function Ue(Ge,He){return`Cannot access ${Ge} ${He} levels up, current level is ${F}`}}e.getData=De})),uc=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}};e.default=t})),Mi=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=vf();var r=class extends Error{constructor(o,n,i,a){super(a||`can't resolve reference ${i} from id ${n}`),this.missingRef=(0,t.resolveUrl)(o,n,i),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(o,this.missingRef))}};e.default=r})),yf=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=xe(),r=uc(),o=hn(),n=vf(),i=Me(),a=Ai();var s=class{constructor(p){var b;this.refs={},this.dynamicAnchors={};let g;typeof p.schema=="object"&&(g=p.schema),this.schema=p.schema,this.schemaId=p.schemaId,this.root=p.root||this,this.baseId=(b=p.baseId)!==null&&b!==void 0?b:(0,n.normalizeId)(g?.[p.schemaId||"$id"]),this.schemaPath=p.schemaPath,this.localRefs=p.localRefs,this.meta=p.meta,this.$async=g?.$async,this.refs={}}};e.SchemaEnv=s;function c(p){let b=d.call(this,p);if(b)return b;let g=(0,n.getFullPath)(this.opts.uriResolver,p.root.baseId),{es5:S,lines:T}=this.opts.code,{ownProperties:R}=this.opts,w=new t.CodeGen(this.scope,{es5:S,lines:T,ownProperties:R}),z;p.$async&&(z=w.scopeValue("Error",{ref:r.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let P=w.scopeName("validate");p.validateName=P;let U={gen:w,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:p.schema,code:(0,t.stringify)(p.schema)}:{ref:p.schema}),validateName:P,ValidationError:z,schema:p.schema,schemaEnv:p,rootId:g,baseId:p.baseId||g,schemaPath:t.nil,errSchemaPath:p.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this},O;try{this._compilations.add(p),(0,a.validateFunctionCode)(U),w.optimize(this.opts.code.optimize);let D=w.toString();O=`${w.scopeRefs(o.default.scope)}return ${D}`,this.opts.code.process&&(O=this.opts.code.process(O,p));let Y=new Function(`${o.default.self}`,`${o.default.scope}`,O)(this,this.scope.get());if(this.scope.value(P,{ref:Y}),Y.errors=null,Y.schema=p.schema,Y.schemaEnv=p,p.$async&&(Y.$async=!0),this.opts.code.source===!0&&(Y.source={validateName:P,validateCode:D,scopeValues:w._values}),this.opts.unevaluated){let{props:ee,items:_e}=U;Y.evaluated={props:ee instanceof t.Name?void 0:ee,items:_e instanceof t.Name?void 0:_e,dynamicProps:ee instanceof t.Name,dynamicItems:_e instanceof t.Name},Y.source&&(Y.source.evaluated=(0,t.stringify)(Y.evaluated))}return p.validate=Y,p}catch(D){throw delete p.validate,delete p.validateName,O&&this.logger.error("Error compiling schema, function code:",O),D}finally{this._compilations.delete(p)}}e.compileSchema=c;function l(p,b,g){var S;g=(0,n.resolveUrl)(this.opts.uriResolver,b,g);let T=p.refs[g];if(T)return T;let R=f.call(this,p,g);if(R===void 0){let w=(S=p.localRefs)===null||S===void 0?void 0:S[g],{schemaId:z}=this.opts;w&&(R=new s({schema:w,schemaId:z,root:p,baseId:b}))}if(R!==void 0)return p.refs[g]=u.call(this,R)}e.resolveRef=l;function u(p){return(0,n.inlineRef)(p.schema,this.opts.inlineRefs)?p.schema:p.validate?p:c.call(this,p)}function d(p){for(let b of this._compilations)if(m(b,p))return b}e.getCompilingSchema=d;function m(p,b){return p.schema===b.schema&&p.root===b.root&&p.baseId===b.baseId}function f(p,b){let g;for(;typeof(g=this.refs[b])=="string";)b=g;return g||this.schemas[b]||h.call(this,p,b)}function h(p,b){let g=this.opts.uriResolver.parse(b),S=(0,n._getFullPath)(this.opts.uriResolver,g),T=(0,n.getFullPath)(this.opts.uriResolver,p.baseId,void 0);if(Object.keys(p.schema).length>0&&S===T)return v.call(this,g,p);let R=(0,n.normalizeId)(S),w=this.refs[R]||this.schemas[R];if(typeof w=="string"){let z=h.call(this,p,w);return typeof z?.schema!="object"?void 0:v.call(this,g,z)}if(typeof w?.schema=="object"){if(w.validate||c.call(this,w),R===(0,n.normalizeId)(b)){let{schema:z}=w,{schemaId:P}=this.opts,U=z[P];return U&&(T=(0,n.resolveUrl)(this.opts.uriResolver,T,U)),new s({schema:z,schemaId:P,root:p,baseId:T})}return v.call(this,g,w)}}e.resolveSchema=h;let y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function v(p,{baseId:b,schema:g,root:S}){var T;if(((T=p.fragment)===null||T===void 0?void 0:T[0])!=="/")return;for(let z of p.fragment.slice(1).split("/")){if(typeof g=="boolean")return;let P=g[(0,i.unescapeFragment)(z)];if(P===void 0)return;g=P;let U=typeof g=="object"&&g[this.opts.schemaId];!y.has(z)&&U&&(b=(0,n.resolveUrl)(this.opts.uriResolver,b,U))}let R;if(typeof g!="boolean"&&g.$ref&&!(0,i.schemaHasRulesButRef)(g,this.RULES)){let z=(0,n.resolveUrl)(this.opts.uriResolver,b,g.$ref);R=h.call(this,S,z)}let{schemaId:w}=this.opts;if(R=R||new s({schema:g,schemaId:w,root:S,baseId:b}),R.schema!==R.root.schema)return R}})),v1=W(((e,t)=>{t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}})),xI=W(((e,t)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),n=RegExp.prototype.test.bind(/^\d*$/u),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),a=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),s=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),c=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),l=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),u=new Array(256);{let I="0123456789ABCDEF";for(let $=0;$<256;$++)u[$]="%"+I[$>>4]+I[$&15]}function d(I){return I<2048?u[192|I>>6]+u[128|I&63]:I<65536?u[224|I>>12]+u[128|I>>6&63]+u[128|I&63]:u[240|I>>18]+u[128|I>>12&63]+u[128|I>>6&63]+u[128|I&63]}function m(I){let $="",k=0,x=0;for(x=0;x<I.length;x++)if(k=I[x].charCodeAt(0),k!==48){if(!(k>=48&&k<=57||k>=65&&k<=70||k>=97&&k<=102))return"";$+=I[x];break}for(x+=1;x<I.length;x++){if(k=I[x].charCodeAt(0),!(k>=48&&k<=57||k>=65&&k<=70||k>=97&&k<=102))return"";$+=I[x]}return $}let f=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),h=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),y=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),v=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function p(I){if(I.length===0)return!1;for(let $=0;$<I.length;$++)if(!y(I[$])){if(I[$]==="%"&&$+2<I.length&&i(I.slice($+1,$+3))){$+=2;continue}return!1}return!0}function b(I){let $=-1,k=0,x=-1,j=0;for(let re=0;re<I.length;re++)I[re]==="0"?(x===-1&&(x=re),j++,j>k&&(k=j,$=x)):(x=-1,j=0);if(k<2)return I.join(":");let J=I.slice(0,$).join(":"),oe=I.slice($+k).join(":");return J+"::"+oe}function g(I){let $=I.indexOf("::");if($!==-1&&I.indexOf("::",$+1)!==-1)return;let k=$===-1?I.split(":"):I.slice(0,$).split(":"),x=$===-1?[]:I.slice($+2).split(":");$!==-1&&(k.length===1&&k[0]===""&&(k.length=0),x.length===1&&x[0]===""&&(x.length=0));let j=k.concat(x),J=0;for(let re=0;re<j.length;re++){let Ie=j[re];if(Ie==="")return;if(Ie.indexOf(".")!==-1){if(re!==j.length-1||$!==-1&&x.length===0||!o(Ie))return;J+=2;continue}if(!f(Ie))return;j[re]=parseInt(Ie,16).toString(16),J++}if($===-1)return J!==8?void 0:b(j);if(J>=8)return;let oe=j.slice(0,k.length);for(let re=J;re<8;re++)oe.push("0");for(let re=k.length;re<j.length;re++)oe.push(j[re]);return b(oe)}function S(I){let $=I[0]==="["&&I[I.length-1]==="]";if((I[0]==="["||I[I.length-1]==="]")&&!$)return{host:I,isIPV6:!1,error:!0};let k=$?I.slice(1,-1):I;if($&&h(k))return k=k.toLowerCase(),{host:`[${k}]`,escapedHost:k,isIPV6:!1,isIPVFuture:!0};if(T(k,":")<2)return{host:I,isIPV6:!1,error:$};let x="",j=k.indexOf("%");if(j!==-1){let oe=k.slice(j,j+3).toLowerCase()==="%25"?3:1;if(x=k.slice(j+oe),!p(x))return{host:I,isIPV6:!1,error:!0};k=k.slice(0,j)}let J=g(k);return J===void 0?{host:I,isIPV6:!1,error:!0}:{host:J+(x?"%"+x:""),escapedHost:J+(x?"%25"+x:""),isIPV6:!0}}function T(I,$){let k=0;for(let x=0;x<I.length;x++)I[x]===$&&k++;return k}function R(I){let $=I,k=[],x=-1,j=0;for(;j=$.length;){if(j===1){if($===".")break;if($==="/"){k.push("/");break}else{k.push($);break}}else if(j===2){if($[0]==="."){if($[1]===".")break;if($[1]==="/"){$=$.slice(2);continue}}else if($[0]==="/"&&($[1]==="."||$[1]==="/")){k.push("/");break}}else if(j===3&&$==="/.."){k.length!==0&&k.pop(),k.push("/");break}if($[0]==="."){if($[1]==="."){if($[2]==="/"){$=$.slice(3);continue}}else if($[1]==="/"){$=$.slice(2);continue}}else if($[0]==="/"&&$[1]==="."){if($[2]==="/"){$=$.slice(2);continue}else if($[2]==="."&&$[3]==="/"){$=$.slice(3),k.length!==0&&k.pop();continue}}if((x=$.indexOf("/",1))===-1){k.push($);break}else k.push($.slice(0,x)),$=$.slice(x)}return k.join("")}let w={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},z=/[@/?#:]/g,P=/[@/?#]/g;function U(I,$){let k=$?P:z;return k.lastIndex=0,I.replace(k,x=>w[x])}function O(I,$=!1){if(I.indexOf("%")===-1)return I;let k="";for(let x=0;x<I.length;x++){if(I[x]==="%"&&x+2<I.length){let j=I.slice(x+1,x+3);if(i(j)){let J=j.toUpperCase(),oe=String.fromCharCode(parseInt(J,16));$&&a(oe)?k+=oe:k+="%"+J,x+=2;continue}}k+=I[x]}return k}function D(I){let $="";for(let k=0;k<I.length;k++){let x=I[k];if(x==="%"&&k+2<I.length){let j=I.slice(k+1,k+3);if(i(j)){let J=j.toUpperCase(),oe=String.fromCharCode(parseInt(J,16));oe!=="."&&a(oe)?$+=oe:$+="%"+J,k+=2;continue}}if(s(x))$+=x;else{let j=I.charCodeAt(k);if(j<128)$+=Ze(j)?x:u[j];else if(j<55296||j>57343)$+=d(j);else if(j<=56319&&k+1<I.length){let J=I.charCodeAt(k+1);J>=56320&&J<=57343?($+=d(65536+(j-55296<<10)+(J-56320)),k++):$+=d(65533)}else $+=d(65533)}}return $}function Y(I,$=!1){let k="",x=$&&I[0]!=="/";for(let j=0;j<I.length;j++){let J=I[j];if(J==="%"&&j+2<I.length){let oe=I.slice(j+1,j+3);if(i(oe)){k+="%"+oe.toUpperCase(),j+=2;continue}}if(J==="/"&&(x=!1),s(J)&&(J!==":"||!x))k+=J;else{let oe=I.charCodeAt(j);if(oe<128)k+=u[oe];else if(oe<55296||oe>57343)k+=d(oe);else if(oe<=56319&&j+1<I.length){let re=I.charCodeAt(j+1);re>=56320&&re<=57343?(k+=d(65536+(oe-55296<<10)+(re-56320)),j++):k+=d(65533)}else k+=d(65533)}}return k}function ee(I,$){let k="";for(let x=0;x<I.length;x++){let j=I[x];if(j==="%"&&x+2<I.length){let J=I.slice(x+1,x+3);if(i(J)){k+="%"+J.toUpperCase(),x+=2;continue}}if($(j))k+=j;else{let J=I.charCodeAt(x);if(J<128)k+=u[J];else if(J<55296||J>57343)k+=d(J);else if(J<=56319&&x+1<I.length){let oe=I.charCodeAt(x+1);oe>=56320&&oe<=57343?(k+=d(65536+(J-55296<<10)+(oe-56320)),x++):k+=d(65533)}else k+=d(65533)}}return k}function _e(I){return ee(I,l)}function Pe(I){return ee(I,c)}function Re(I){return ee(I,c)}function Ze(I){return I>=48&&I<=57||I>=65&&I<=90||I>=97&&I<=122||I===42||I===43||I===45||I===46||I===47||I===64||I===95}function Te(I){let $="";for(let k=0;k<I.length;k++){let x=I[k];if(x==="%"&&k+2<I.length){let j=I.slice(k+1,k+3);if(i(j)){let J=j.toUpperCase(),oe=String.fromCharCode(parseInt(J,16));a(oe)?$+=oe:$+="%"+J,k+=2;continue}}if(c(x))$+=x;else{let j=I.charCodeAt(k);if(j<128)$+=Ze(j)?x:u[j];else if(j<55296||j>57343)$+=d(j);else if(j<=56319&&k+1<I.length){let J=I.charCodeAt(k+1);J>=56320&&J<=57343?($+=d(65536+(j-55296<<10)+(J-56320)),k++):$+=d(65533)}else $+=d(65533)}}return $}function N(I){let $="";for(let k=0;k<I.length;k++){if(I[k]==="%"&&k+2<I.length){let x=I.slice(k+1,k+3);if(i(x)){$+="%"+x.toUpperCase(),k+=2;continue}}$+=escape(I[k])}return $}function V(I){let $=[];if(I.userinfo!==void 0&&($.push(_e(I.userinfo)),$.push("@")),I.host!==void 0){let k=I.host;if(!o(k)){let x=S(k);x.isIPV6!==!0&&x.isIPVFuture!==!0&&(k=O(k,!0),x=S(k)),x.isIPV6===!0||x.isIPVFuture===!0?k=`[${x.escapedHost}]`:k=U(k,!1)}$.push(k)}if(typeof I.port=="number"||typeof I.port=="string"){let k=String(I.port);if(!n(k))throw new TypeError("URI port is malformed.");$.push(":"),$.push(k)}return $.length?$.join(""):void 0}t.exports={nonSimpleDomain:v,recomposeAuthority:V,reescapeHostDelimiters:U,normalizePercentEncoding:O,normalizePathEncoding:D,serializePathEncoding:Y,normalizeQueryFragmentEncoding:Te,encodeUserinfo:_e,encodeQuery:Pe,encodeFragment:Re,escapePreservingEscapes:N,removeDotSegments:R,isIPv4:o,isUUID:r,normalizeIPv6:S,stringArrayToHexStripped:m}})),y1=W(((e,t)=>{let{isUUID:r}=xI(),o=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,n=["http","https","ws","wss","urn","urn:uuid"];function i(w){return n.indexOf(w)!==-1}function a(w){return w.secure===!0?!0:w.secure===!1?!1:w.scheme?w.scheme.length===3&&(w.scheme[0]==="w"||w.scheme[0]==="W")&&(w.scheme[1]==="s"||w.scheme[1]==="S")&&(w.scheme[2]==="s"||w.scheme[2]==="S"):!1}function s(w){return w.host||(w.error=w.error||"HTTP URIs must have a host."),w}function c(w){let z=String(w.scheme).toLowerCase()==="https";return(w.port===(z?443:80)||w.port==="")&&(w.port=void 0),w.path||(w.path="/"),w}function l(w){return w.secure=a(w),w.resourceName=(w.path||"/")+(w.query?"?"+w.query:""),w.path=void 0,w.query=void 0,w}function u(w){if((w.port===(a(w)?443:80)||w.port==="")&&(w.port=void 0),typeof w.secure=="boolean"&&(w.scheme=w.secure?"wss":"ws",w.secure=void 0),w.resourceName){let z=w.resourceName.indexOf("?"),P=z===-1?w.resourceName:w.resourceName.slice(0,z);w.path=P&&P!=="/"?P:void 0,w.query=z===-1?void 0:w.resourceName.slice(z+1),w.resourceName=void 0}return w.fragment=void 0,w}function d(w,z){if(!w.path)return w.error="URN can not be parsed",w;let P=w.path.match(o);if(P&&P[0]===w.path){let U=z.scheme||w.scheme||"urn";w.nid=P[1].toLowerCase(),w.nss=P[2];let O=R(`${U}:${z.nid||w.nid}`);w.path=void 0,O&&(w=O.parse(w,z))}else w.error=w.error||"URN can not be parsed.";return w}function m(w,z){if(w.nid===void 0)throw new Error("URN without nid cannot be serialized");let P=z.scheme||w.scheme||"urn",U=w.nid.toLowerCase(),O=R(`${P}:${z.nid||U}`);O&&(w=O.serialize(w,z));let D=w,Y=w.nss;return D.path=`${U||z.nid}:${Y}`,z.skipEscape=!0,D}function f(w,z){let P=w;return P.uuid=P.nss,P.nss=void 0,!z.tolerant&&(!P.uuid||!r(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function h(w){let z=w;return z.nss=(w.uuid||"").toLowerCase(),z}let y={scheme:"http",domainHost:!0,parse:s,serialize:c},v={scheme:"https",domainHost:y.domainHost,parse:s,serialize:c},p={scheme:"ws",domainHost:!0,parse:l,serialize:u},b={scheme:"wss",domainHost:p.domainHost,parse:p.parse,serialize:p.serialize},T={http:y,https:v,ws:p,wss:b,urn:{scheme:"urn",parse:d,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:f,serialize:h,skipNormalize:!0}};Object.setPrototypeOf(T,null);function R(w){return w&&(T[w]||T[w.toLowerCase()])||void 0}t.exports={wsIsSecure:a,SCHEMES:T,isValidSchemeName:i,getSchemeHandler:R}})),_1=W(((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizePercentEncoding:i,normalizePathEncoding:a,serializePathEncoding:s,normalizeQueryFragmentEncoding:c,encodeQuery:l,encodeFragment:u,reescapeHostDelimiters:d,isIPv4:m,nonSimpleDomain:f}=xI(),{SCHEMES:h,getSchemeHandler:y}=y1(),v=/^[A-Za-z][A-Za-z0-9+.-]*$/u,p="URI scheme is malformed.";function b(I){let $=unescape(String(I));if(!v.test($))throw new TypeError(p);return $}function g(I,$){return typeof I=="string"?I=Ze(I,$):typeof I=="object"&&(I=Re(w(I,$),$)),I}function S(I,$,k){let x=k?Object.assign({scheme:"null"},k):{scheme:"null"},{parsed:j,malformedAuthorityOrPort:J,malformedPercentEncoding:oe,malformedSchemeSpecific:re,malformedHost:Ie,malformedScheme:De}=Pe(I,x),{parsed:E,malformedAuthorityOrPort:F,malformedPercentEncoding:K,malformedSchemeSpecific:me,malformedHost:he,malformedScheme:ve}=Pe($,x);if(J||F||oe||K||re||me||Ie||he||De||ve)throw new Error(j.error||E.error||"URI is malformed.");let Ae=T(j,E,x,!0),Ke=y(k&&k.scheme||Ae.scheme),Ue=Ae.host,Ge=Ue!==void 0&&Ue!==""&&(m(Ue)||r(Ue).isIPV6);_e(Ae,k||{},Ke,Ge);let He=Ue&&Ue.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(Ue);if(Ae.error&&!He)throw new Error(Ae.error);return x.skipEscape=!0,w(Ae,x)}function T(I,$,k,x){let j={};return x||(I=Re(w(I,k),k),$=Re(w($,k),k)),k=k||{},!k.tolerant&&$.scheme?(j.scheme=$.scheme,j.userinfo=$.userinfo,j.host=$.host,j.port=$.port,j.path=o($.path||""),j.query=$.query):($.userinfo!==void 0||$.host!==void 0||$.port!==void 0?(j.userinfo=$.userinfo,j.host=$.host,j.port=$.port,j.path=o($.path||""),j.query=$.query):($.path?($.path[0]==="/"?j.path=o($.path):((I.userinfo!==void 0||I.host!==void 0||I.port!==void 0)&&!I.path?j.path="/"+$.path:I.path?j.path=I.path.slice(0,I.path.lastIndexOf("/")+1)+$.path:j.path=$.path,j.path=o(j.path)),j.query=$.query):(j.path=I.path,$.query!==void 0?j.query=$.query:j.query=I.query),j.userinfo=I.userinfo,j.host=I.host,j.port=I.port),j.scheme=I.scheme),j.fragment=$.fragment,j}function R(I,$,k){let x=N(I,k),j=N($,k);return x!==void 0&&j!==void 0&&x===j}function w(I,$){let k={host:I.host,scheme:I.scheme,userinfo:I.userinfo,port:I.port,path:I.path,query:I.query,nid:I.nid,nss:I.nss,uuid:I.uuid,fragment:I.fragment,reference:I.reference,resourceName:I.resourceName,secure:I.secure,error:""},x=Object.assign({},$),j=[];k.scheme&&(k.scheme=b(k.scheme));let J=y(x.scheme||k.scheme);J&&J.serialize&&J.serialize(k,x);let oe=k.userinfo!==void 0||k.host!==void 0||k.port!==void 0,re=!x.skipEscape&&k.scheme===void 0&&!oe;k.path!==void 0&&(x.skipEscape?k.path=i(k.path):k.path=s(k.path,re)),x.reference!=="suffix"&&k.scheme&&(k.scheme=b(k.scheme),j.push(k.scheme,":"));let Ie=n(k);if(Ie!==void 0&&(x.reference!=="suffix"&&j.push("//"),j.push(Ie),k.path&&k.path[0]!=="/"&&j.push("/")),k.path!==void 0){let De=k.path;!x.absolutePath&&(!J||!J.absolutePath)&&(De=o(De)),re&&(De=s(De,!0)),Ie===void 0&&De[0]==="/"&&De[1]==="/"&&(De="/%2F"+De.slice(2)),j.push(De)}return k.query!==void 0&&j.push("?",l(k.query)),k.fragment!==void 0&&j.push("#",u(k.fragment)),j.join("")}let z=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,P=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,U=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function O(I,$){if($[2]!==void 0&&I.path&&I.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof I.port=="number"&&(I.port<0||I.port>65535))return"URI port is malformed."}function D(I){if(I===void 0)return!1;let $=I.indexOf("%");for(;$!==-1;){if($+2>=I.length||!/^[\da-f]{2}$/iu.test(I.slice($+1,$+3)))return!0;$=I.indexOf("%",$+3)}return!1}function Y(I){return I[0]==="["&&I[I.length-1]==="]"}function ee(I){let $=I[4];return D(I[3])||$!==void 0&&!Y($)&&D($)||D(I[6])||D(I[7])||D(I[8])}function _e(I,$,k,x){if(!$.unicodeSupport&&(!k||!k.unicodeSupport)&&I.host&&!Y(I.host)&&($.domainHost||k&&k.domainHost)&&x===!1&&f(I.host))try{I.host=new URL("http://"+I.host).hostname}catch(j){return I.error=I.error||"Host's domain name can not be converted to ASCII: "+j,!0}return!1}function Pe(I,$){let k=Object.assign({},$),x={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},j=!1,J=!1,oe=!1,re=!1,Ie=!1,De=!1,E=!1;k.reference==="suffix"&&(k.scheme?I=k.scheme+":"+I:I="//"+I);let F=I.match(P);F!==null&&F[1].indexOf("\\")!==-1&&(x.error="URI authority must not contain a literal backslash.",j=!0);let K=I.match(U);if(K!==null){let he=K[1],ve=he.replace(/[\t\n\r]/g,"");ve.length>=2&&(ve.slice(0,2)!=="//"?(x.error=x.error||"URI authority must not contain a literal backslash.",j=!0):he.length!==ve.length&&(x.error=x.error||"URI authority introducer must not contain whitespace.",j=!0))}let me=I.match(z);if(me){if(x.scheme=me[1],x.userinfo=me[3],x.host=me[4],x.port=parseInt(me[5],10),x.path=me[6]||"",x.query=me[7],x.fragment=me[8],x.scheme!==void 0){let Ae=unescape(x.scheme);v.test(Ae)?x.scheme=Ae.toLowerCase():(x.error=x.error||p,De=!0)}J=ee(me),J&&(x.error=x.error||"URI contains malformed percent-encoding."),isNaN(x.port)&&(x.port=me[5]);let he=O(x,me);if(he!==void 0&&(x.error=x.error||he,j=!0),x.host)if(m(x.host)===!1){let Ae=Y(x.host),Ke=x.host.indexOf("[")!==-1||x.host.indexOf("]")!==-1,Ue=r(x.host);E=Ue.isIPV6||Ue.isIPVFuture===!0,Ie=Ke&&(!Ae||Ue.error===!0),x.host=E?Ue.host:Ue.host.toLowerCase(),Ie&&(x.error=x.error||"URI host is malformed.",j=!0)}else E=!0;x.scheme===void 0&&x.userinfo===void 0&&x.host===void 0&&x.port===void 0&&x.query===void 0&&!x.path?x.reference="same-document":x.scheme===void 0?x.reference="relative":x.fragment===void 0?x.reference="absolute":x.reference="uri",k.reference&&k.reference!=="suffix"&&k.reference!==x.reference&&(x.error=x.error||"URI is not a "+k.reference+" reference.");let ve=y(k.scheme||x.scheme);if(Ie||(re=_e(x,k,ve,E)),I.indexOf("%")!==-1&&x.host!==void 0&&!Ie){let Ae=E?x.host:i(x.host,!0);E||(Ae=i(Ae.toLowerCase())),x.host=d(Ae,E)}(!ve||ve&&!ve.skipNormalize)&&(x.path&&(x.path=a(x.path)),x.query&&(x.query=c(x.query)),x.fragment&&(x.fragment=c(x.fragment))),ve&&ve.parse&&(ve.parse(x,k),ve===h.urn&&x.nid===void 0&&(oe=!0))}else x.error=x.error||"URI can not be parsed.";return{parsed:x,malformedAuthorityOrPort:j,malformedPercentEncoding:J,malformedSchemeSpecific:oe,malformedHost:re,malformedScheme:De}}function Re(I,$){return Pe(I,$).parsed}function Ze(I,$){return Te(I,$).normalized}function Te(I,$){let{parsed:k,malformedAuthorityOrPort:x,malformedPercentEncoding:j,malformedSchemeSpecific:J,malformedHost:oe,malformedScheme:re}=Pe(I,$);return{normalized:x||j||J||oe||re?I:w(k,$),malformedAuthorityOrPort:x,malformedPercentEncoding:j,malformedSchemeSpecific:J,malformedHost:oe,malformedScheme:re}}function N(I,$){if(typeof I!="string"&&typeof I!="object")return;let k;try{k=typeof I=="string"?I:w(I,$)}catch{return}let{normalized:x,malformedAuthorityOrPort:j,malformedPercentEncoding:J,malformedSchemeSpecific:oe,malformedHost:re,malformedScheme:Ie}=Te(k,$);return j||J||oe||re||Ie?void 0:x}let V={SCHEMES:h,normalize:g,resolve:S,resolveComponent:T,equal:R,serialize:w,parse:Re};t.exports=V,t.exports.default=V,t.exports.fastUri=V})),$1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_1();t.code='require("ajv/dist/runtime/uri").default',e.default=t})),F$=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Ai();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=xe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});let o=uc(),n=Mi(),i=zI(),a=yf(),s=xe(),c=vf(),l=hf(),u=Me(),d=v1(),m=$1(),f=(N,V)=>new RegExp(N,V);f.code="new RegExp";let h=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},b=200;function g(N){var V,I,$,k,x,j,J,oe,re,Ie,De,E,F,K,me,he,ve,Ae,Ke,Ue,Ge,He,Bt,ot,In;let rn=N.strict,xn=(V=N.code)===null||V===void 0?void 0:V.optimize,Hn=xn===!0||xn===void 0?1:xn||0,Jn=($=(I=N.code)===null||I===void 0?void 0:I.regExp)!==null&&$!==void 0?$:f,Or=(k=N.uriResolver)!==null&&k!==void 0?k:m.default;return{strictSchema:(j=(x=N.strictSchema)!==null&&x!==void 0?x:rn)!==null&&j!==void 0?j:!0,strictNumbers:(oe=(J=N.strictNumbers)!==null&&J!==void 0?J:rn)!==null&&oe!==void 0?oe:!0,strictTypes:(Ie=(re=N.strictTypes)!==null&&re!==void 0?re:rn)!==null&&Ie!==void 0?Ie:"log",strictTuples:(E=(De=N.strictTuples)!==null&&De!==void 0?De:rn)!==null&&E!==void 0?E:"log",strictRequired:(K=(F=N.strictRequired)!==null&&F!==void 0?F:rn)!==null&&K!==void 0?K:!1,code:N.code?{...N.code,optimize:Hn,regExp:Jn}:{optimize:Hn,regExp:Jn},loopRequired:(me=N.loopRequired)!==null&&me!==void 0?me:b,loopEnum:(he=N.loopEnum)!==null&&he!==void 0?he:b,meta:(ve=N.meta)!==null&&ve!==void 0?ve:!0,messages:(Ae=N.messages)!==null&&Ae!==void 0?Ae:!0,inlineRefs:(Ke=N.inlineRefs)!==null&&Ke!==void 0?Ke:!0,schemaId:(Ue=N.schemaId)!==null&&Ue!==void 0?Ue:"$id",addUsedSchema:(Ge=N.addUsedSchema)!==null&&Ge!==void 0?Ge:!0,validateSchema:(He=N.validateSchema)!==null&&He!==void 0?He:!0,validateFormats:(Bt=N.validateFormats)!==null&&Bt!==void 0?Bt:!0,unicodeRegExp:(ot=N.unicodeRegExp)!==null&&ot!==void 0?ot:!0,int32range:(In=N.int32range)!==null&&In!==void 0?In:!0,uriResolver:Or}}var S=class{constructor(N={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,N=this.opts={...N,...g(N)};let{es5:V,lines:I}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:y,es5:V,lines:I}),this.logger=D(N.logger);let $=N.validateFormats;N.validateFormats=!1,this.RULES=(0,i.getRules)(),T.call(this,v,N,"NOT SUPPORTED"),T.call(this,p,N,"DEPRECATED","warn"),this._metaOpts=U.call(this),N.formats&&z.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),N.keywords&&P.call(this,N.keywords),typeof N.meta=="object"&&this.addMetaSchema(N.meta),w.call(this),N.validateFormats=$}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:N,meta:V,schemaId:I}=this.opts,$=d;I==="id"&&($={...d},$.id=$.$id,delete $.$id),V&&N&&this.addMetaSchema($,$[I],!1)}defaultMeta(){let{meta:N,schemaId:V}=this.opts;return this.opts.defaultMeta=typeof N=="object"?N[V]||N:void 0}validate(N,V){let I;if(typeof N=="string"){if(I=this.getSchema(N),!I)throw new Error(`no schema with key or ref "${N}"`)}else I=this.compile(N);let $=I(V);return"$async"in I||(this.errors=I.errors),$}compile(N,V){let I=this._addSchema(N,V);return I.validate||this._compileSchemaEnv(I)}compileAsync(N,V){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:I}=this.opts;return $.call(this,N,V);async function $(re,Ie){await k.call(this,re.$schema);let De=this._addSchema(re,Ie);return De.validate||x.call(this,De)}async function k(re){re&&!this.getSchema(re)&&await $.call(this,{$ref:re},!0)}async function x(re){try{return this._compileSchemaEnv(re)}catch(Ie){if(!(Ie instanceof n.default))throw Ie;return j.call(this,Ie),await J.call(this,Ie.missingSchema),x.call(this,re)}}function j({missingSchema:re,missingRef:Ie}){if(this.refs[re])throw new Error(`AnySchema ${re} is loaded but ${Ie} cannot be resolved`)}async function J(re){let Ie=await oe.call(this,re);this.refs[re]||await k.call(this,Ie.$schema),this.refs[re]||this.addSchema(Ie,re,V)}async function oe(re){let Ie=this._loading[re];if(Ie)return Ie;try{return await(this._loading[re]=I(re))}finally{delete this._loading[re]}}}addSchema(N,V,I,$=this.opts.validateSchema){if(Array.isArray(N)){for(let x of N)this.addSchema(x,void 0,I,$);return this}let k;if(typeof N=="object"){let{schemaId:x}=this.opts;if(k=N[x],k!==void 0&&typeof k!="string")throw new Error(`schema ${x} must be string`)}return V=(0,c.normalizeId)(V||k),this._checkUnique(V),this.schemas[V]=this._addSchema(N,I,V,$,!0),this}addMetaSchema(N,V,I=this.opts.validateSchema){return this.addSchema(N,V,!0,I),this}validateSchema(N,V){if(typeof N=="boolean")return!0;let I;if(I=N.$schema,I!==void 0&&typeof I!="string")throw new Error("$schema must be a string");if(I=I||this.opts.defaultMeta||this.defaultMeta(),!I)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let $=this.validate(I,N);if(!$&&V){let k="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(k);else throw new Error(k)}return $}getSchema(N){let V;for(;typeof(V=R.call(this,N))=="string";)N=V;if(V===void 0){let{schemaId:I}=this.opts,$=new a.SchemaEnv({schema:{},schemaId:I});if(V=a.resolveSchema.call(this,$,N),!V)return;this.refs[N]=V}return V.validate||this._compileSchemaEnv(V)}removeSchema(N){if(N instanceof RegExp)return this._removeAllSchemas(this.schemas,N),this._removeAllSchemas(this.refs,N),this;switch(typeof N){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let V=R.call(this,N);return typeof V=="object"&&this._cache.delete(V.schema),delete this.schemas[N],delete this.refs[N],this}case"object":{let V=N;this._cache.delete(V);let I=N[this.opts.schemaId];return I&&(I=(0,c.normalizeId)(I),delete this.schemas[I],delete this.refs[I]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(N){for(let V of N)this.addKeyword(V);return this}addKeyword(N,V){let I;if(typeof N=="string")I=N,typeof V=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),V.keyword=I);else if(typeof N=="object"&&V===void 0){if(V=N,I=V.keyword,Array.isArray(I)&&!I.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(ee.call(this,I,V),!V)return(0,u.eachItem)(I,k=>_e.call(this,k)),this;Re.call(this,V);let $={...V,type:(0,l.getJSONTypes)(V.type),schemaType:(0,l.getJSONTypes)(V.schemaType)};return(0,u.eachItem)(I,$.type.length===0?k=>_e.call(this,k,$):k=>$.type.forEach(x=>_e.call(this,k,$,x))),this}getKeyword(N){let V=this.RULES.all[N];return typeof V=="object"?V.definition:!!V}removeKeyword(N){let{RULES:V}=this;delete V.keywords[N],delete V.all[N];for(let I of V.rules){let $=I.rules.findIndex(k=>k.keyword===N);$>=0&&I.rules.splice($,1)}return this}addFormat(N,V){return typeof V=="string"&&(V=new RegExp(V)),this.formats[N]=V,this}errorsText(N=this.errors,{separator:V=", ",dataVar:I="data"}={}){return!N||N.length===0?"No errors":N.map($=>`${I}${$.instancePath} ${$.message}`).reduce(($,k)=>$+V+k)}$dataMetaSchema(N,V){let I=this.RULES.all;N=JSON.parse(JSON.stringify(N));for(let $ of V){let k=$.split("/").slice(1),x=N;for(let j of k)x=x[j];for(let j in I){let J=I[j];if(typeof J!="object")continue;let{$data:oe}=J.definition,re=x[j];oe&&re&&(x[j]=Te(re))}}return N}_removeAllSchemas(N,V){for(let I in N){let $=N[I];(!V||V.test(I))&&(typeof $=="string"?delete N[I]:$&&!$.meta&&(this._cache.delete($.schema),delete N[I]))}}_addSchema(N,V,I,$=this.opts.validateSchema,k=this.opts.addUsedSchema){let x,{schemaId:j}=this.opts;if(typeof N=="object")x=N[j];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof N!="boolean")throw new Error("schema must be object or boolean")}let J=this._cache.get(N);if(J!==void 0)return J;I=(0,c.normalizeId)(x||I);let oe=c.getSchemaRefs.call(this,N,I);return J=new a.SchemaEnv({schema:N,schemaId:j,meta:V,baseId:I,localRefs:oe}),this._cache.set(J.schema,J),k&&!I.startsWith("#")&&(I&&this._checkUnique(I),this.refs[I]=J),$&&this.validateSchema(N,!0),J}_checkUnique(N){if(this.schemas[N]||this.refs[N])throw new Error(`schema with key or id "${N}" already exists`)}_compileSchemaEnv(N){if(N.meta?this._compileMetaSchema(N):a.compileSchema.call(this,N),!N.validate)throw new Error("ajv implementation error");return N.validate}_compileMetaSchema(N){let V=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,N)}finally{this.opts=V}}};S.ValidationError=o.default,S.MissingRefError=n.default,e.default=S;function T(N,V,I,$="error"){for(let k in N){let x=k;x in V&&this.logger[$](`${I}: option ${k}. ${N[x]}`)}}function R(N){return N=(0,c.normalizeId)(N),this.schemas[N]||this.refs[N]}function w(){let N=this.opts.schemas;if(N)if(Array.isArray(N))this.addSchema(N);else for(let V in N)this.addSchema(N[V],V)}function z(){for(let N in this.opts.formats){let V=this.opts.formats[N];V&&this.addFormat(N,V)}}function P(N){if(Array.isArray(N)){this.addVocabulary(N);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let V in N){let I=N[V];I.keyword||(I.keyword=V),this.addKeyword(I)}}function U(){let N={...this.opts};for(let V of h)delete N[V];return N}let O={log(){},warn(){},error(){}};function D(N){if(N===!1)return O;if(N===void 0)return console;if(N.log&&N.warn&&N.error)return N;throw new Error("logger must implement log, warn and error methods")}let Y=/^[a-z_$][a-z0-9_$:-]*$/i;function ee(N,V){let{RULES:I}=this;if((0,u.eachItem)(N,$=>{if(I.keywords[$])throw new Error(`Keyword ${$} is already defined`);if(!Y.test($))throw new Error(`Keyword ${$} has invalid name`)}),!!V&&V.$data&&!("code"in V||"validate"in V))throw new Error('$data keyword must have "code" or "validate" function')}function _e(N,V,I){var $;let k=V?.post;if(I&&k)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:x}=this,j=k?x.post:x.rules.find(({type:oe})=>oe===I);if(j||(j={type:I,rules:[]},x.rules.push(j)),x.keywords[N]=!0,!V)return;let J={keyword:N,definition:{...V,type:(0,l.getJSONTypes)(V.type),schemaType:(0,l.getJSONTypes)(V.schemaType)}};V.before?Pe.call(this,j,J,V.before):j.rules.push(J),x.all[N]=J,($=V.implements)===null||$===void 0||$.forEach(oe=>this.addKeyword(oe))}function Pe(N,V,I){let $=N.rules.findIndex(k=>k.keyword===I);$>=0?N.rules.splice($,0,V):(N.rules.push(V),this.logger.warn(`rule ${I} is not defined`))}function Re(N){let{metaSchema:V}=N;V!==void 0&&(N.$data&&this.opts.$data&&(V=Te(V)),N.validateSchema=this.compile(V,!0))}let Ze={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Te(N){return{anyOf:[N,Ze]}}})),b1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t})),Z$=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=Mi(),r=gn(),o=xe(),n=hn(),i=yf(),a=Me(),s={keyword:"$ref",schemaType:"string",code(u){let{gen:d,schema:m,it:f}=u,{baseId:h,schemaEnv:y,validateName:v,opts:p,self:b}=f,{root:g}=y;if((m==="#"||m==="#/")&&h===g.baseId)return T();let S=i.resolveRef.call(b,g,h,m);if(S===void 0)throw new t.default(f.opts.uriResolver,h,m);if(S instanceof i.SchemaEnv)return R(S);return w(S);function T(){if(y===g)return l(u,v,y,y.$async);let z=d.scopeValue("root",{ref:g});return l(u,(0,o._)`${z}.validate`,g,g.$async)}function R(z){l(u,c(u,z),z,z.$async)}function w(z){let P=d.scopeValue("schema",p.code.source===!0?{ref:z,code:(0,o.stringify)(z)}:{ref:z}),U=d.name("valid"),O=u.subschema({schema:z,dataTypes:[],schemaPath:o.nil,topSchemaRef:P,errSchemaPath:m},U);u.mergeEvaluated(O),u.ok(U)}}};function c(u,d){let{gen:m}=u;return d.validate?m.scopeValue("validate",{ref:d.validate}):(0,o._)`${m.scopeValue("wrapper",{ref:d})}.validate`}e.getValidate=c;function l(u,d,m,f){let{gen:h,it:y}=u,{allErrors:v,schemaEnv:p,opts:b}=y,g=b.passContext?n.default.this:o.nil;f?S():T();function S(){if(!p.$async)throw new Error("async schema referenced by sync schema");let z=h.let("valid");h.try(()=>{h.code((0,o._)`await ${(0,r.callValidateCode)(u,d,g)}`),w(d),v||h.assign(z,!0)},P=>{h.if((0,o._)`!(${P} instanceof ${y.ValidationError})`,()=>h.throw(P)),R(P),v||h.assign(z,!1)}),u.ok(z)}function T(){u.result((0,r.callValidateCode)(u,d,g),()=>w(d),()=>R(d))}function R(z){let P=(0,o._)`${z}.errors`;h.assign(n.default.vErrors,(0,o._)`${n.default.vErrors} === null ? ${P} : ${n.default.vErrors}.concat(${P})`),h.assign(n.default.errors,(0,o._)`${n.default.vErrors}.length`)}function w(z){var P;if(!y.opts.unevaluated)return;let U=(P=m?.validate)===null||P===void 0?void 0:P.evaluated;if(y.props!==!0)if(U&&!U.dynamicProps)U.props!==void 0&&(y.props=a.mergeEvaluated.props(h,U.props,y.props));else{let O=h.var("props",(0,o._)`${z}.evaluated.props`);y.props=a.mergeEvaluated.props(h,O,y.props,o.Name)}if(y.items!==!0)if(U&&!U.dynamicItems)U.items!==void 0&&(y.items=a.mergeEvaluated.items(h,U.items,y.items));else{let O=h.var("items",(0,o._)`${z}.evaluated.items`);y.items=a.mergeEvaluated.items(h,O,y.items,o.Name)}}}e.callRef=l,e.default=s})),TI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=b1(),r=Z$(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o})),S1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r=t.operators,o={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},n={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:i,schemaCode:a})=>(0,t.str)`must be ${o[i].okStr} ${a}`,params:({keyword:i,schemaCode:a})=>(0,t._)`{comparison: ${o[i].okStr}, limit: ${a}}`},code(i){let{keyword:a,data:s,schemaCode:c}=i;i.fail$data((0,t._)`${s} ${o[a].fail} ${c} || isNaN(${s})`)}};e.default=n})),w1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must be multiple of ${o}`,params:({schemaCode:o})=>(0,t._)`{multipleOf: ${o}}`},code(o){let{gen:n,data:i,schemaCode:a,it:s}=o,c=s.opts.multipleOfPrecision,l=n.let("res"),u=c?(0,t._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${c}`:(0,t._)`${l} !== parseInt(${l})`;o.fail$data((0,t._)`(${a} === 0 || (${l} = ${i}/${a}, ${u}))`)}};e.default=r})),k1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r){let o=r.length,n=0,i=0,a;for(;i<o;)n++,a=r.charCodeAt(i++),a>=55296&&a<=56319&&i<o&&(a=r.charCodeAt(i),(a&64512)===56320&&i++);return n}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'})),z1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r=Me(),o=k1(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:a}){let s=i==="maxLength"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${a} characters`},params:({schemaCode:i})=>(0,t._)`{limit: ${i}}`},code(i){let{keyword:a,data:s,schemaCode:c,it:l}=i,u=a==="maxLength"?t.operators.GT:t.operators.LT,d=l.opts.unicode===!1?(0,t._)`${s}.length`:(0,t._)`${(0,r.useFunc)(i.gen,o.default)}(${s})`;i.fail$data((0,t._)`${d} ${u} ${c}`)}};e.default=n})),R1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=gn(),r=Me(),o=xe(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,o.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,o._)`{pattern: ${i}}`},code(i){let{gen:a,data:s,$data:c,schema:l,schemaCode:u,it:d}=i,m=d.opts.unicodeRegExp?"u":"";if(c){let{regExp:f}=d.opts.code,h=f.code==="new RegExp"?(0,o._)`new RegExp`:(0,r.useFunc)(a,f),y=a.let("valid");a.try(()=>a.assign(y,(0,o._)`${h}(${u}, ${m}).test(${s})`),()=>a.assign(y,!1)),i.fail$data((0,o._)`!${y}`)}else{let f=(0,t.usePattern)(i,l);i.fail$data((0,o._)`!${f}.test(${s})`)}}};e.default=n})),I1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let i=o==="maxProperties"?"more":"fewer";return(0,t.str)`must NOT have ${i} than ${n} properties`},params:({schemaCode:o})=>(0,t._)`{limit: ${o}}`},code(o){let{keyword:n,data:i,schemaCode:a}=o,s=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data((0,t._)`Object.keys(${i}).length ${s} ${a}`)}};e.default=r})),x1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=gn(),r=xe(),o=Me(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:i}})=>(0,r.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,r._)`{missingProperty: ${i}}`},code(i){let{gen:a,schema:s,schemaCode:c,data:l,$data:u,it:d}=i,{opts:m}=d;if(!u&&s.length===0)return;let f=s.length>=m.loopRequired;if(d.allErrors?h():y(),m.strictRequired){let b=i.parentSchema.properties,{definedProperties:g}=i.it;for(let S of s)if(b?.[S]===void 0&&!g.has(S)){let T=`required property "${S}" is not defined at "${d.schemaEnv.baseId+d.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(d,T,d.opts.strictRequired)}}function h(){if(f||u)i.block$data(r.nil,v);else for(let b of s)(0,t.checkReportMissingProp)(i,b)}function y(){let b=a.let("missing");if(f||u){let g=a.let("valid",!0);i.block$data(g,()=>p(b,g)),i.ok(g)}else a.if((0,t.checkMissingProp)(i,s,b)),(0,t.reportMissingProp)(i,b),a.else()}function v(){a.forOf("prop",c,b=>{i.setParams({missingProperty:b}),a.if((0,t.noPropertyInData)(a,l,b,m.ownProperties),()=>i.error())})}function p(b,g){i.setParams({missingProperty:b}),a.forOf(b,c,()=>{a.assign(g,(0,t.propertyInData)(a,l,b,m.ownProperties)),a.if((0,r.not)(g),()=>{i.error(),a.break()})},r.nil)}}};e.default=n})),T1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let i=o==="maxItems"?"more":"fewer";return(0,t.str)`must NOT have ${i} than ${n} items`},params:({schemaCode:o})=>(0,t._)`{limit: ${o}}`},code(o){let{keyword:n,data:i,schemaCode:a}=o,s=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data((0,t._)`${i}.length ${s} ${a}`)}};e.default=r})),B$=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=II();t.code='require("ajv/dist/runtime/equal").default',e.default=t})),P1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hf(),r=xe(),o=Me(),n=B$(),i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:a,j:s}})=>(0,r.str)`must NOT have duplicate items (items ## ${s} and ${a} are identical)`,params:({params:{i:a,j:s}})=>(0,r._)`{i: ${a}, j: ${s}}`},code(a){let{gen:s,data:c,$data:l,schema:u,parentSchema:d,schemaCode:m,it:f}=a;if(!l&&!u)return;let h=s.let("valid"),y=d.items?(0,t.getSchemaTypes)(d.items):[];a.block$data(h,v,(0,r._)`${m} === false`),a.ok(h);function v(){let S=s.let("i",(0,r._)`${c}.length`),T=s.let("j");a.setParams({i:S,j:T}),s.assign(h,!0),s.if((0,r._)`${S} > 1`,()=>(p()?b:g)(S,T))}function p(){return y.length>0&&!y.some(S=>S==="object"||S==="array")}function b(S,T){let R=s.name("item"),w=(0,t.checkDataTypes)(y,R,f.opts.strictNumbers,t.DataType.Wrong),z=s.const("indices",(0,r._)`{}`);s.for((0,r._)`;${S}--;`,()=>{s.let(R,(0,r._)`${c}[${S}]`),s.if(w,(0,r._)`continue`),y.length>1&&s.if((0,r._)`typeof ${R} == "string"`,(0,r._)`${R} += "_"`),s.if((0,r._)`typeof ${z}[${R}] == "number"`,()=>{s.assign(T,(0,r._)`${z}[${R}]`),a.error(),s.assign(h,!1).break()}).code((0,r._)`${z}[${R}] = ${S}`)})}function g(S,T){let R=(0,o.useFunc)(s,n.default),w=s.name("outer");s.label(w).for((0,r._)`;${S}--;`,()=>s.for((0,r._)`${T} = ${S}; ${T}--;`,()=>s.if((0,r._)`${R}(${c}[${S}], ${c}[${T}])`,()=>{a.error(),s.assign(h,!1).break(w)})))}}};e.default=i})),E1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r=Me(),o=B$(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:i})=>(0,t._)`{allowedValue: ${i}}`},code(i){let{gen:a,data:s,$data:c,schemaCode:l,schema:u}=i;c||u&&typeof u=="object"?i.fail$data((0,t._)`!${(0,r.useFunc)(a,o.default)}(${s}, ${l})`):i.fail((0,t._)`${u} !== ${s}`)}};e.default=n})),C1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r=Me(),o=B$(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,t._)`{allowedValues: ${i}}`},code(i){let{gen:a,data:s,$data:c,schema:l,schemaCode:u,it:d}=i;if(!c&&l.length===0)throw new Error("enum must have non-empty array");let m=l.length>=d.opts.loopEnum,f,h=()=>f??(f=(0,r.useFunc)(a,o.default)),y;if(m||c)y=a.let("valid"),i.block$data(y,v);else{if(!Array.isArray(l))throw new Error("ajv implementation error");let b=a.const("vSchema",u);y=(0,t.or)(...l.map((g,S)=>p(b,S)))}i.pass(y);function v(){a.assign(y,!1),a.forOf("v",u,b=>a.if((0,t._)`${h()}(${s}, ${b})`,()=>a.assign(y,!0).break()))}function p(b,g){let S=l[g];return typeof S=="object"&&S!==null?(0,t._)`${h()}(${s}, ${b}[${g}])`:(0,t._)`${s} === ${S}`}}};e.default=n})),PI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=S1(),r=w1(),o=z1(),n=R1(),i=I1(),a=x1(),s=T1(),c=P1(),l=E1(),u=C1(),d=[t.default,r.default,o.default,n.default,i.default,a.default,s.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,u.default];e.default=d})),EI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=xe(),r=Me(),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,t.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,t._)`{limit: ${i}}`},code(i){let{parentSchema:a,it:s}=i,{items:c}=a;if(!Array.isArray(c)){(0,r.checkStrictMode)(s,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(i,c)}};function n(i,a){let{gen:s,schema:c,data:l,keyword:u,it:d}=i;d.items=!0;let m=s.const("len",(0,t._)`${l}.length`);if(c===!1)i.setParams({len:a.length}),i.pass((0,t._)`${m} <= ${a.length}`);else if(typeof c=="object"&&!(0,r.alwaysValidSchema)(d,c)){let h=s.var("valid",(0,t._)`${m} <= ${a.length}`);s.if((0,t.not)(h),()=>f(h)),i.ok(h)}function f(h){s.forRange("i",a.length,m,y=>{i.subschema({keyword:u,dataProp:y,dataPropType:r.Type.Num},h),d.allErrors||s.if((0,t.not)(h),()=>s.break())})}}e.validateAdditionalItems=n,e.default=o})),CI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=xe(),r=Me(),o=gn(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(a){let{schema:s,it:c}=a;if(Array.isArray(s))return i(a,"additionalItems",s);c.items=!0,!(0,r.alwaysValidSchema)(c,s)&&a.ok((0,o.validateArray)(a))}};function i(a,s,c=a.schema){let{gen:l,parentSchema:u,data:d,keyword:m,it:f}=a;v(u),f.opts.unevaluated&&c.length&&f.items!==!0&&(f.items=r.mergeEvaluated.items(l,c.length,f.items));let h=l.name("valid"),y=l.const("len",(0,t._)`${d}.length`);c.forEach((p,b)=>{(0,r.alwaysValidSchema)(f,p)||(l.if((0,t._)`${y} > ${b}`,()=>a.subschema({keyword:m,schemaProp:b,dataProp:b},h)),a.ok(h))});function v(p){let{opts:b,errSchemaPath:g}=f,S=c.length,T=S===p.minItems&&(S===p.maxItems||p[s]===!1);if(b.strictTuples&&!T){let R=`"${m}" is ${S}-tuple, but minItems or maxItems/${s} are not specified or different at path "${g}"`;(0,r.checkStrictMode)(f,R,b.strictTuples)}}}e.validateTuple=i,e.default=n})),O1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=CI(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o=>(0,t.validateTuple)(o,"items")};e.default=r})),N1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r=Me(),o=gn(),n=EI(),i={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,t.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,t._)`{limit: ${a}}`},code(a){let{schema:s,parentSchema:c,it:l}=a,{prefixItems:u}=c;l.items=!0,!(0,r.alwaysValidSchema)(l,s)&&(u?(0,n.validateAdditionalItems)(a,u):a.ok((0,o.validateArray)(a)))}};e.default=i})),j1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r=Me(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:i}})=>i===void 0?(0,t.str)`must contain at least ${n} valid item(s)`:(0,t.str)`must contain at least ${n} and no more than ${i} valid item(s)`,params:({params:{min:n,max:i}})=>i===void 0?(0,t._)`{minContains: ${n}}`:(0,t._)`{minContains: ${n}, maxContains: ${i}}`},code(n){let{gen:i,schema:a,parentSchema:s,data:c,it:l}=n,u,d,{minContains:m,maxContains:f}=s;l.opts.next?(u=m===void 0?1:m,d=f):u=1;let h=i.const("len",(0,t._)`${c}.length`);if(n.setParams({min:u,max:d}),d===void 0&&u===0){(0,r.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(d!==void 0&&u>d){(0,r.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(l,a)){let g=(0,t._)`${h} >= ${u}`;d!==void 0&&(g=(0,t._)`${g} && ${h} <= ${d}`),n.pass(g);return}l.items=!0;let y=i.name("valid");d===void 0&&u===1?p(y,()=>i.if(y,()=>i.break())):u===0?(i.let(y,!0),d!==void 0&&i.if((0,t._)`${c}.length > 0`,v)):(i.let(y,!1),v()),n.result(y,()=>n.reset());function v(){let g=i.name("_valid"),S=i.let("count",0);p(g,()=>i.if(g,()=>b(S)))}function p(g,S){i.forRange("i",0,h,T=>{n.subschema({keyword:"contains",dataProp:T,dataPropType:r.Type.Num,compositeRule:!0},g),S()})}function b(g){i.code((0,t._)`${g}++`),d===void 0?i.if((0,t._)`${g} >= ${u}`,()=>i.assign(y,!0).break()):(i.if((0,t._)`${g} > ${d}`,()=>i.assign(y,!1).break()),u===1?i.assign(y,!0):i.if((0,t._)`${g} >= ${u}`,()=>i.assign(y,!0)))}}};e.default=o})),H$=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=xe(),r=Me(),o=gn();e.error={message:({params:{property:c,depsCount:l,deps:u}})=>{let d=l===1?"property":"properties";return(0,t.str)`must have ${d} ${u} when property ${c} is present`},params:({params:{property:c,depsCount:l,deps:u,missingProperty:d}})=>(0,t._)`{property: ${c},
|
|
71
|
+
missingProperty: ${d},
|
|
72
|
+
depsCount: ${l},
|
|
73
|
+
deps: ${u}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){let[l,u]=i(c);a(c,l),s(c,u)}};function i({schema:c}){let l={},u={};for(let d in c){if(d==="__proto__")continue;let m=Array.isArray(c[d])?l:u;m[d]=c[d]}return[l,u]}function a(c,l=c.schema){let{gen:u,data:d,it:m}=c;if(Object.keys(l).length===0)return;let f=u.let("missing");for(let h in l){let y=l[h];if(y.length===0)continue;let v=(0,o.propertyInData)(u,d,h,m.opts.ownProperties);c.setParams({property:h,depsCount:y.length,deps:y.join(", ")}),m.allErrors?u.if(v,()=>{for(let p of y)(0,o.checkReportMissingProp)(c,p)}):(u.if((0,t._)`${v} && (${(0,o.checkMissingProp)(c,y,f)})`),(0,o.reportMissingProp)(c,f),u.else())}}e.validatePropertyDeps=a;function s(c,l=c.schema){let{gen:u,data:d,keyword:m,it:f}=c,h=u.name("valid");for(let y in l)(0,r.alwaysValidSchema)(f,l[y])||(u.if((0,o.propertyInData)(u,d,y,f.opts.ownProperties),()=>{let v=c.subschema({keyword:m,schemaProp:y},h);c.mergeValidEvaluated(v,h)},()=>u.var(h,!0)),c.ok(h))}e.validateSchemaDeps=s,e.default=n})),A1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r=Me(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0,t._)`{propertyName: ${n.propertyName}}`},code(n){let{gen:i,schema:a,data:s,it:c}=n;if((0,r.alwaysValidSchema)(c,a))return;let l=i.name("valid");i.forIn("key",s,u=>{n.setParams({propertyName:u}),n.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},l),i.if((0,t.not)(l),()=>{n.error(!0),c.allErrors||i.break()})}),n.ok(l)}};e.default=o})),OI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=gn(),r=xe(),o=hn(),n=Me(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:a})=>(0,r._)`{additionalProperty: ${a.additionalProperty}}`},code(a){let{gen:s,schema:c,parentSchema:l,data:u,errsCount:d,it:m}=a;if(!d)throw new Error("ajv implementation error");let{allErrors:f,opts:h}=m;if(m.props=!0,h.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(m,c))return;let y=(0,t.allSchemaProperties)(l.properties),v=(0,t.allSchemaProperties)(l.patternProperties);p(),a.ok((0,r._)`${d} === ${o.default.errors}`);function p(){s.forIn("key",u,R=>{!y.length&&!v.length?S(R):s.if(b(R),()=>S(R))})}function b(R){let w;if(y.length>8){let z=(0,n.schemaRefOrVal)(m,l.properties,"properties");w=(0,t.isOwnProperty)(s,z,R)}else y.length?w=(0,r.or)(...y.map(z=>(0,r._)`${R} === ${z}`)):w=r.nil;return v.length&&(w=(0,r.or)(w,...v.map(z=>(0,r._)`${(0,t.usePattern)(a,z)}.test(${R})`))),(0,r.not)(w)}function g(R){s.code((0,r._)`delete ${u}[${R}]`)}function S(R){if(h.removeAdditional==="all"||h.removeAdditional&&c===!1){g(R);return}if(c===!1){a.setParams({additionalProperty:R}),a.error(),f||s.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(m,c)){let w=s.name("valid");h.removeAdditional==="failing"?(T(R,w,!1),s.if((0,r.not)(w),()=>{a.reset(),g(R)})):(T(R,w),f||s.if((0,r.not)(w),()=>s.break()))}}function T(R,w,z){let P={keyword:"additionalProperties",dataProp:R,dataPropType:n.Type.Str};z===!1&&Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1}),a.subschema(P,w)}}};e.default=i})),M1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ai(),r=gn(),o=Me(),n=OI(),i={keyword:"properties",type:"object",schemaType:"object",code(a){let{gen:s,schema:c,parentSchema:l,data:u,it:d}=a;d.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(d,n.default,"additionalProperties"));let m=(0,r.allSchemaProperties)(c);for(let p of m)d.definedProperties.add(p);d.opts.unevaluated&&m.length&&d.props!==!0&&(d.props=o.mergeEvaluated.props(s,(0,o.toHash)(m),d.props));let f=m.filter(p=>!(0,o.alwaysValidSchema)(d,c[p]));if(f.length===0)return;let h=s.name("valid");for(let p of f)y(p)?v(p):(s.if((0,r.propertyInData)(s,u,p,d.opts.ownProperties)),v(p),d.allErrors||s.else().var(h,!0),s.endIf()),a.it.definedProperties.add(p),a.ok(h);function y(p){return d.opts.useDefaults&&!d.compositeRule&&c[p].default!==void 0}function v(p){a.subschema({keyword:"properties",schemaProp:p,dataProp:p},h)}}};e.default=i})),D1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=gn(),r=xe(),o=Me(),n=Me(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(a){let{gen:s,schema:c,data:l,parentSchema:u,it:d}=a,{opts:m}=d,f=(0,t.allSchemaProperties)(c),h=f.filter(T=>(0,o.alwaysValidSchema)(d,c[T]));if(f.length===0||h.length===f.length&&(!d.opts.unevaluated||d.props===!0))return;let y=m.strictSchema&&!m.allowMatchingProperties&&u.properties,v=s.name("valid");d.props!==!0&&!(d.props instanceof r.Name)&&(d.props=(0,n.evaluatedPropsToName)(s,d.props));let{props:p}=d;b();function b(){for(let T of f)y&&g(T),d.allErrors?S(T):(s.var(v,!0),S(T),s.if(v))}function g(T){for(let R in y)new RegExp(T).test(R)&&(0,o.checkStrictMode)(d,`property ${R} matches pattern ${T} (use allowMatchingProperties)`)}function S(T){s.forIn("key",l,R=>{s.if((0,r._)`${(0,t.usePattern)(a,T)}.test(${R})`,()=>{let w=h.includes(T);w||a.subschema({keyword:"patternProperties",schemaProp:T,dataProp:R,dataPropType:n.Type.Str},v),d.opts.unevaluated&&p!==!0?s.assign((0,r._)`${p}[${R}]`,!0):!w&&!d.allErrors&&s.if((0,r.not)(v),()=>s.break())})})}}};e.default=i})),U1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Me(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:i,it:a}=o;if((0,t.alwaysValidSchema)(a,i)){o.fail();return}let s=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),o.failResult(s,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r})),L1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:gn().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t})),q1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r=Me(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0,t._)`{passingSchemas: ${n.passing}}`},code(n){let{gen:i,schema:a,parentSchema:s,it:c}=n;if(!Array.isArray(a))throw new Error("ajv implementation error");if(c.opts.discriminator&&s.discriminator)return;let l=a,u=i.let("valid",!1),d=i.let("passing",null),m=i.name("_valid");n.setParams({passing:d}),i.block(f),n.result(u,()=>n.reset(),()=>n.error(!0));function f(){l.forEach((h,y)=>{let v;(0,r.alwaysValidSchema)(c,h)?i.var(m,!0):v=n.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},m),y>0&&i.if((0,t._)`${m} && ${u}`).assign(u,!1).assign(d,(0,t._)`[${d}, ${y}]`).else(),i.if(m,()=>{i.assign(u,!0),i.assign(d,y),v&&n.mergeEvaluated(v,t.Name)})})}}};e.default=o})),V1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Me(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:i,it:a}=o;if(!Array.isArray(i))throw new Error("ajv implementation error");let s=n.name("valid");i.forEach((c,l)=>{if((0,t.alwaysValidSchema)(a,c))return;let u=o.subschema({keyword:"allOf",schemaProp:l},s);o.ok(s),o.mergeEvaluated(u)})}};e.default=r})),F1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r=Me(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:i})=>(0,t.str)`must match "${i.ifClause}" schema`,params:({params:i})=>(0,t._)`{failingKeyword: ${i.ifClause}}`},code(i){let{gen:a,parentSchema:s,it:c}=i;s.then===void 0&&s.else===void 0&&(0,r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let l=n(c,"then"),u=n(c,"else");if(!l&&!u)return;let d=a.let("valid",!0),m=a.name("_valid");if(f(),i.reset(),l&&u){let y=a.let("ifClause");i.setParams({ifClause:y}),a.if(m,h("then",y),h("else",y))}else l?a.if(m,h("then")):a.if((0,t.not)(m),h("else"));i.pass(d,()=>i.error(!0));function f(){let y=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},m);i.mergeEvaluated(y)}function h(y,v){return()=>{let p=i.subschema({keyword:y},m);a.assign(d,m),i.mergeValidEvaluated(p,d),v?a.assign(v,(0,t._)`${y}`):i.setParams({ifClause:y})}}}};function n(i,a){let s=i.schema[a];return s!==void 0&&!(0,r.alwaysValidSchema)(i,s)}e.default=o})),Z1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Me(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:i}){n.if===void 0&&(0,t.checkStrictMode)(i,`"${o}" without "if" is ignored`)}};e.default=r})),NI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=EI(),r=O1(),o=CI(),n=N1(),i=j1(),a=H$(),s=A1(),c=OI(),l=M1(),u=D1(),d=U1(),m=L1(),f=q1(),h=V1(),y=F1(),v=Z1();function p(b=!1){let g=[d.default,m.default,f.default,h.default,y.default,v.default,s.default,c.default,a.default,l.default,u.default];return b?g.push(r.default,n.default):g.push(t.default,o.default),g.push(i.default),g}e.default=p})),B1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,t.str)`must match format "${o}"`,params:({schemaCode:o})=>(0,t._)`{format: ${o}}`},code(o,n){let{gen:i,data:a,$data:s,schema:c,schemaCode:l,it:u}=o,{opts:d,errSchemaPath:m,schemaEnv:f,self:h}=u;if(!d.validateFormats)return;s?y():v();function y(){let p=i.scopeValue("formats",{ref:h.formats,code:d.code.formats}),b=i.const("fDef",(0,t._)`${p}[${l}]`),g=i.let("fType"),S=i.let("format");i.if((0,t._)`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>i.assign(g,(0,t._)`${b}.type || "string"`).assign(S,(0,t._)`${b}.validate`),()=>i.assign(g,(0,t._)`"string"`).assign(S,b)),o.fail$data((0,t.or)(T(),R()));function T(){return d.strictSchema===!1?t.nil:(0,t._)`${l} && !${S}`}function R(){let w=f.$async?(0,t._)`(${b}.async ? await ${S}(${a}) : ${S}(${a}))`:(0,t._)`${S}(${a})`,z=(0,t._)`(typeof ${S} == "function" ? ${w} : ${S}.test(${a}))`;return(0,t._)`${S} && ${S} !== true && ${g} === ${n} && !${z}`}}function v(){let p=h.formats[c];if(!p){T();return}if(p===!0)return;let[b,g,S]=R(p);b===n&&o.pass(w());function T(){if(d.strictSchema===!1){h.logger.warn(z());return}throw new Error(z());function z(){return`unknown format "${c}" ignored in schema at path "${m}"`}}function R(z){let P=z instanceof RegExp?(0,t.regexpCode)(z):d.code.formats?(0,t._)`${d.code.formats}${(0,t.getProperty)(c)}`:void 0,U=i.scopeValue("formats",{key:c,ref:z,code:P});return typeof z=="object"&&!(z instanceof RegExp)?[z.type||"string",z.validate,(0,t._)`${U}.validate`]:["string",z,U]}function w(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!f.$async)throw new Error("async format in sync schema");return(0,t._)`await ${S}(${a})`}return typeof g=="function"?(0,t._)`${S}(${a})`:(0,t._)`${S}.test(${a})`}}}};e.default=r})),jI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[B1().default];e.default=t})),AI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]})),MI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=TI(),r=PI(),o=NI(),n=jI(),i=AI(),a=[t.default,r.default,(0,o.default)(),n.default,i.metadataVocabulary,i.contentVocabulary];e.default=a})),H1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))})),J$=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r=H1(),o=yf(),n=Mi(),i=Me(),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:s,tagName:c}})=>s===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:s,tag:c,tagName:l}})=>(0,t._)`{error: ${s}, tag: ${l}, tagValue: ${c}}`},code(s){let{gen:c,data:l,schema:u,parentSchema:d,it:m}=s,{oneOf:f}=d;if(!m.opts.discriminator)throw new Error("discriminator: requires discriminator option");let h=u.propertyName;if(typeof h!="string")throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!f)throw new Error("discriminator: requires oneOf keyword");let y=c.let("valid",!1),v=c.const("tag",(0,t._)`${l}${(0,t.getProperty)(h)}`);c.if((0,t._)`typeof ${v} == "string"`,()=>p(),()=>s.error(!1,{discrError:r.DiscrError.Tag,tag:v,tagName:h})),s.ok(y);function p(){let S=g();c.if(!1);for(let T in S)c.elseIf((0,t._)`${v} === ${T}`),c.assign(y,b(S[T]));c.else(),s.error(!1,{discrError:r.DiscrError.Mapping,tag:v,tagName:h}),c.endIf()}function b(S){let T=c.name("valid"),R=s.subschema({keyword:"oneOf",schemaProp:S},T);return s.mergeEvaluated(R,t.Name),T}function g(){var S;let T={},R=z(d),w=!0;for(let O=0;O<f.length;O++){let D=f[O];if(D?.$ref&&!(0,i.schemaHasRulesButRef)(D,m.self.RULES)){let ee=D.$ref;if(D=o.resolveRef.call(m.self,m.schemaEnv.root,m.baseId,ee),D instanceof o.SchemaEnv&&(D=D.schema),D===void 0)throw new n.default(m.opts.uriResolver,m.baseId,ee)}let Y=(S=D?.properties)===null||S===void 0?void 0:S[h];if(typeof Y!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${h}"`);w=w&&(R||z(D)),P(Y,O)}if(!w)throw new Error(`discriminator: "${h}" must be required`);return T;function z({required:O}){return Array.isArray(O)&&O.includes(h)}function P(O,D){if(O.const)U(O.const,D);else if(O.enum)for(let Y of O.enum)U(Y,D);else throw new Error(`discriminator: "properties/${h}" must have "const" or "enum"`)}function U(O,D){if(typeof O!="string"||O in T)throw new Error(`discriminator: "${h}" values must be unique strings`);T[O]=D}}}};e.default=a})),J1=W(((e,t)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}})),DI=W(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=F$(),o=MI(),n=J$(),i=J1(),a=["/properties"],s="http://json-schema.org/draft-07/schema";var c=class extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(f=>this.addVocabulary(f)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let f=this.opts.$data?this.$dataMetaSchema(i,a):i;this.addMetaSchema(f,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var l=Ai();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=xe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=uc();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var m=Mi();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})),UI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=xe(),r=hn(),o=yf(),n=Z$(),i={keyword:"$dynamicAnchor",schemaType:"string",code:c=>a(c,c.schema)};function a(c,l){let{gen:u,it:d}=c;d.schemaEnv.root.dynamicAnchors[l]=!0;let m=(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(l)}`,f=d.errSchemaPath==="#"?d.validateName:s(c);u.if((0,t._)`!${m}`,()=>u.assign(m,f))}e.dynamicAnchor=a;function s(c){let{schemaEnv:l,schema:u,self:d}=c.it,{root:m,baseId:f,localRefs:h,meta:y}=l.root,{schemaId:v}=d.opts,p=new o.SchemaEnv({schema:u,schemaId:v,root:m,baseId:f,localRefs:h,meta:y});return o.compileSchema.call(d,p),(0,n.getValidate)(c,p)}e.default=i})),LI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=xe(),r=hn(),o=Z$(),n={keyword:"$dynamicRef",schemaType:"string",code:a=>i(a,a.schema)};function i(a,s){let{gen:c,keyword:l,it:u}=a;if(s[0]!=="#")throw new Error(`"${l}" only supports hash fragment reference`);let d=s.slice(1);if(u.allErrors)m();else{let h=c.let("valid",!1);m(h),a.ok(h)}function m(h){if(u.schemaEnv.root.dynamicAnchors[d]){let y=c.let("_v",(0,t._)`${r.default.dynamicAnchors}${(0,t.getProperty)(d)}`);c.if(y,f(y,h),f(u.validateName,h))}else f(u.validateName,h)()}function f(h,y){return y?()=>c.block(()=>{(0,o.callRef)(a,h),c.let(y,!0)}):()=>(0,o.callRef)(a,h)}}e.dynamicRef=i,e.default=n})),K1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=UI(),r=Me(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o})),G1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=LI(),r={keyword:"$recursiveRef",schemaType:"string",code:o=>(0,t.dynamicRef)(o,o.schema)};e.default=r})),qI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=UI(),r=LI(),o=K1(),n=G1(),i=[t.default,r.default,o.default,n.default];e.default=i})),W1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=H$(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:o=>(0,t.validatePropertyDeps)(o)};e.default=r})),X1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=H$(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:o=>(0,t.validateSchemaDeps)(o)};e.default=r})),Y1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Me(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:i}){n.contains===void 0&&(0,t.checkStrictMode)(i,`"${o}" without "contains" is ignored`)}};e.default=r})),VI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=W1(),r=X1(),o=Y1(),n=[t.default,r.default,o.default];e.default=n})),Q1=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r=Me(),o=hn(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:i})=>(0,t._)`{unevaluatedProperty: ${i.unevaluatedProperty}}`},code(i){let{gen:a,schema:s,data:c,errsCount:l,it:u}=i;if(!l)throw new Error("ajv implementation error");let{allErrors:d,props:m}=u;m instanceof t.Name?a.if((0,t._)`${m} !== true`,()=>a.forIn("key",c,v=>a.if(h(m,v),()=>f(v)))):m!==!0&&a.forIn("key",c,v=>m===void 0?f(v):a.if(y(m,v),()=>f(v))),u.props=!0,i.ok((0,t._)`${l} === ${o.default.errors}`);function f(v){if(s===!1){i.setParams({unevaluatedProperty:v}),i.error(),d||a.break();return}if(!(0,r.alwaysValidSchema)(u,s)){let p=a.name("valid");i.subschema({keyword:"unevaluatedProperties",dataProp:v,dataPropType:r.Type.Str},p),d||a.if((0,t.not)(p),()=>a.break())}}function h(v,p){return(0,t._)`!${v} || !${v}[${p}]`}function y(v,p){let b=[];for(let g in v)v[g]===!0&&b.push((0,t._)`${p} !== ${g}`);return(0,t.and)(...b)}}};e.default=n})),eM=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xe(),r=Me(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>(0,t.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,t._)`{limit: ${n}}`},code(n){let{gen:i,schema:a,data:s,it:c}=n,l=c.items||0;if(l===!0)return;let u=i.const("len",(0,t._)`${s}.length`);if(a===!1)n.setParams({len:l}),n.fail((0,t._)`${u} > ${l}`);else if(typeof a=="object"&&!(0,r.alwaysValidSchema)(c,a)){let m=i.var("valid",(0,t._)`${u} <= ${l}`);i.if((0,t.not)(m),()=>d(m,l)),n.ok(m)}c.items=!0;function d(m,f){i.forRange("i",f,u,h=>{n.subschema({keyword:"unevaluatedItems",dataProp:h,dataPropType:r.Type.Num},m),c.allErrors||i.if((0,t.not)(m),()=>i.break())})}}};e.default=o})),FI=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Q1(),r=eM(),o=[t.default,r.default];e.default=o})),tM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}})),nM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}})),rM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}})),oM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}})),iM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}})),aM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}})),sM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}})),cM=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=tM(),r=nM(),o=rM(),n=oM(),i=iM(),a=aM(),s=sM(),c=["/properties"];function l(u){return[t,r,o,n,d(this,i),a,d(this,s)].forEach(m=>this.addMetaSchema(m,void 0,!1)),this;function d(m,f){return u?m.$dataMetaSchema(f,c):f}}e.default=l})),lM=W(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=F$(),o=MI(),n=qI(),i=VI(),a=FI(),s=J$(),c=cM(),l="https://json-schema.org/draft/2019-09/schema";var u=class extends r.default{constructor(y={}){super({...y,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach(y=>this.addVocabulary(y)),this.addVocabulary(i.default),this.addVocabulary(a.default),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:y,meta:v}=this.opts;v&&(c.default.call(this,y),this.refs["http://json-schema.org/schema"]=l)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};e.Ajv2019=u,t.exports=e=u,t.exports.Ajv2019=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var d=Ai();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var m=xe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var f=uc();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=Mi();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})})),uM=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=TI(),r=PI(),o=NI(),n=qI(),i=VI(),a=FI(),s=jI(),c=AI(),l=[n.default,t.default,r.default,(0,o.default)(!0),s.default,c.metadataVocabulary,c.contentVocabulary,i.default,a.default];e.default=l})),dM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}})),mM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}})),fM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}})),pM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}})),hM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}})),gM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}})),vM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}})),yM=W(((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}})),_M=W((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dM(),r=mM(),o=fM(),n=pM(),i=hM(),a=gM(),s=vM(),c=yM(),l=["/properties"];function u(d){return[t,r,o,n,i,m(this,a),s,m(this,c)].forEach(f=>this.addMetaSchema(f,void 0,!1)),this;function m(f,h){return d?f.$dataMetaSchema(h,l):h}}e.default=u})),$M=W(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=F$(),o=uM(),n=J$(),i=_M(),a="https://json-schema.org/draft/2020-12/schema";var s=class extends r.default{constructor(m={}){super({...m,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(m=>this.addVocabulary(m)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:m,meta:f}=this.opts;f&&(i.default.call(this,m),this.refs["http://json-schema.org/schema"]=a)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var c=Ai();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var l=xe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var u=uc();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=Mi();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})})),bM=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(O,D){return{validate:O,compare:D}}e.fullFormats={date:t(i,a),time:t(c(!0),l),"date-time":t(m(!0),f),"iso-time":t(c(),u),"iso-date-time":t(m(),h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{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,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:U,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:g,int32:{type:"number",validate:R},int64:{type:"number",validate:w},float:{type:"number",validate:z},double:{type:"number",validate:z},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(O){return O%4===0&&(O%100!==0||O%400===0)}let o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(O){let D=o.exec(O);if(!D)return!1;let Y=+D[1],ee=+D[2],_e=+D[3];return ee>=1&&ee<=12&&_e>=1&&_e<=(ee===2&&r(Y)?29:n[ee])}function a(O,D){if(O&&D)return O>D?1:O<D?-1:0}let s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(O){return function(Y){let ee=s.exec(Y);if(!ee)return!1;let _e=+ee[1],Pe=+ee[2],Re=+ee[3],Ze=ee[4],Te=ee[5]==="-"?-1:1,N=+(ee[6]||0),V=+(ee[7]||0);if(N>23||V>59||O&&!Ze)return!1;if(_e<=23&&Pe<=59&&Re<60)return!0;let I=Pe-V*Te,$=_e-N*Te-(I<0?1:0);return($===23||$===-1)&&(I===59||I===-1)&&Re<61}}function l(O,D){if(!(O&&D))return;let Y=new Date("2020-01-01T"+O).valueOf(),ee=new Date("2020-01-01T"+D).valueOf();if(Y&&ee)return Y-ee}function u(O,D){if(!(O&&D))return;let Y=s.exec(O),ee=s.exec(D);if(Y&&ee)return O=Y[1]+Y[2]+Y[3],D=ee[1]+ee[2]+ee[3],O>D?1:O<D?-1:0}let d=/t|\s/i;function m(O){let D=c(O);return function(ee){let _e=ee.split(d);return _e.length===2&&i(_e[0])&&D(_e[1])}}function f(O,D){if(!(O&&D))return;let Y=new Date(O).valueOf(),ee=new Date(D).valueOf();if(Y&&ee)return Y-ee}function h(O,D){if(!(O&&D))return;let[Y,ee]=O.split(d),[_e,Pe]=D.split(d),Re=a(Y,_e);if(Re!==void 0)return Re||l(ee,Pe)}let y=/\/|:/,v=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function p(O){return y.test(O)&&v.test(O)}let b=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function g(O){return b.lastIndex=0,b.test(O)}let S=-(2**31),T=2**31-1;function R(O){return Number.isInteger(O)&&O<=T&&O>=S}function w(O){return Number.isInteger(O)}function z(){return!0}let P=/[^\\]\\Z/;function U(O){if(P.test(O))return!1;try{return new RegExp(O),!0}catch{return!1}}})),SM=W((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=DI(),r=xe(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},i={message:({keyword:s,schemaCode:c})=>(0,r.str)`should be ${n[s].okStr} ${c}`,params:({keyword:s,schemaCode:c})=>(0,r._)`{comparison: ${n[s].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:i,code(s){let{gen:c,data:l,schemaCode:u,keyword:d,it:m}=s,{opts:f,self:h}=m;if(!f.validateFormats)return;let y=new t.KeywordCxt(m,h.RULES.all.format.definition,"format");y.$data?v():p();function v(){let g=c.scopeValue("formats",{ref:h.formats,code:f.code.formats}),S=c.const("fmt",(0,r._)`${g}[${y.schemaCode}]`);s.fail$data((0,r.or)((0,r._)`typeof ${S} != "object"`,(0,r._)`${S} instanceof RegExp`,(0,r._)`typeof ${S}.compare != "function"`,b(S)))}function p(){let g=y.schema,S=h.formats[g];if(!S||S===!0)return;if(typeof S!="object"||S instanceof RegExp||typeof S.compare!="function")throw new Error(`"${d}": format "${g}" does not define "compare" function`);let T=c.scopeValue("formats",{key:g,ref:S,code:f.code.formats?(0,r._)`${f.code.formats}${(0,r.getProperty)(g)}`:void 0});s.fail$data(b(T))}function b(g){return(0,r._)`${g}.compare(${l}, ${u}) ${n[d].fail} 0`}},dependencies:["format"]};let a=s=>(s.addKeyword(e.formatLimitDefinition),s);e.default=a})),wM=W(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=bM(),o=SM(),n=xe(),i=new n.Name("fullFormats"),a=new n.Name("fastFormats"),s=(l,u={keywords:!0})=>{if(Array.isArray(u))return c(l,u,r.fullFormats,i),l;let[d,m]=u.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,i];return c(l,u.formats||r.formatNames,d,m),u.keywords&&(0,o.default)(l),l};s.get=(l,u="full")=>{let d=(u==="fast"?r.fastFormats:r.fullFormats)[l];if(!d)throw new Error(`Unknown format "${l}"`);return d};function c(l,u,d,m){var f,h;(f=(h=l.opts.code).formats)!==null&&f!==void 0||(h.formats=(0,n._)`require("ajv-formats/dist/formats").${m}`);for(let y of u)l.addFormat(y,d[y])}t.exports=e=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s})),ZI=DI(),kM=lM(),zM=$M(),RM=Dc(wM(),1),IM=RM.default;dc=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=V$(zM.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=eS(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return t==="2020-12"?this.ajv:t==="2019-09"?this._ajv2019??=V$(kM.Ajv2019):this._ajvDraft7??=V$(ZI.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&typeof e.$id=="string"?t.getSchema(e.$id)??t.compile(e):t.compile(e);return o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}},VV=ZI.Ajv});import K$ from"node:process";var _f=G(()=>{BI()});function rx(e,t){return Object.defineProperty(e,W$,{value:{complete:t},enumerable:!1,writable:!1,configurable:!1}),e}function bf(e){return!!e&&typeof e=="object"&&W$ in e}function xM(e){return e[W$]?.complete}function fc(e,t){if(!Number.isFinite(e)||e<1)return;let r=setInterval(t,Math.min(e,TM));return r.unref?.(),r}function PM(e){return e instanceof wf?ox(e):void 0}function HI(e){let t=String(e),r=t.indexOf("#");return(r===-1?t:t.slice(0,r)).replace(/\/$/,"")}function EM(e,t){return e?HI(e)===HI(t):!1}function $f(e){return e.replaceAll(/[\\"]/g,String.raw`\$&`).replaceAll(/[^\u0020-\u007E]/g," ")}function JI(e,t,r,o){let n=`Bearer error="${$f(e)}", error_description="${$f(t)}"`;return r.length>0&&(n+=`, scope="${$f(r.join(" "))}"`),o&&(n+=`, resource_metadata="${$f(o)}"`),n}async function X$(e,t){let{verifier:r,requiredScopes:o=[],expectedResource:n}=t;if(!e)throw new qt(wt.InvalidToken,"Missing Authorization header");let[i,a]=e.split(" ");if(i?.toLowerCase()!=="bearer"||!a)throw new qt(wt.InvalidToken,"Invalid Authorization header format, expected 'Bearer TOKEN'");let s=await r.verifyAccessToken(a);if(n!==void 0&&!EM(s.resource,n))throw new qt(wt.InvalidToken,"Token was not issued for this resource");if(o.length>0&&!o.every(c=>s.scopes.includes(c)))throw new qt(wt.InsufficientScope,"Insufficient scope");if(typeof s.expiresAt!="number"||Number.isNaN(s.expiresAt))throw new qt(wt.InvalidToken,"Token has no expiration time");if(s.expiresAt<Date.now()/1e3)throw new qt(wt.InvalidToken,"Token has expired");return t.resourceMetadataUrl!==void 0&&s.resourceMetadataUrl===void 0?{...s,resourceMetadataUrl:t.resourceMetadataUrl}:s}function kf(e,t){let{requiredScopes:r=[],resourceMetadataUrl:o}=t??{};if(!(e instanceof qt)){let n=new qt(wt.ServerError,"Internal Server Error");return Response.json(n.toResponseObject(),{status:500})}switch(e.code){case wt.InvalidToken:{let n=JI(e.code,e.message,r,o);return Response.json(e.toResponseObject(),{status:401,headers:{"WWW-Authenticate":n}})}case wt.InsufficientScope:{let n=JI(e.code,e.message,r,o);return Response.json(e.toResponseObject(),{status:403,headers:{"WWW-Authenticate":n}})}case wt.ServerError:return Response.json(e.toResponseObject(),{status:500});default:return Response.json(e.toResponseObject(),{status:400})}}function ix(e){let{verifier:t,requiredScopes:r=[],resourceMetadataUrl:o,expectedResource:n}=e,i={verifier:t,requiredScopes:r,resourceMetadataUrl:o,expectedResource:n};return async a=>{let[s]=(a.headers.get("authorization")??"").split(",");try{return await X$(s||void 0,i)}catch(c){return kf(c,i)}}}function CM(e,t){if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1"&&!t)throw new Error("Issuer URL must be HTTPS");if(e.hash)throw new Error(`Issuer URL must not have a fragment: ${e}`);if(e.search)throw new Error(`Issuer URL must not have a query string: ${e}`)}function Sf(e){return CM(new URL(e.oauthMetadata.issuer),e.dangerouslyAllowInsecureIssuerUrl),{resource:e.resourceServerUrl.href,authorization_servers:[e.oauthMetadata.issuer],scopes_supported:e.scopesSupported,resource_name:e.resourceName,resource_documentation:e.serviceDocumentationUrl?.href}}function Y$(e){let t=new URL(e);return t.pathname=ax(e),t.hash="",t.href}function ax(e){let t=sx(e.pathname);return`/.well-known/oauth-protected-resource${t==="/"?"":t}`}function sx(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e}function GI(e,t){if(e.method==="OPTIONS"){let o=e.headers.get("access-control-request-headers");return new Response(null,{status:204,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":KI,...o===null?{}:{"Access-Control-Allow-Headers":o,Vary:"Access-Control-Request-Headers"}}})}if(e.method!=="GET"&&e.method!=="HEAD"){let o=new qt(wt.MethodNotAllowed,`The method ${e.method} is not allowed for this endpoint`);return Response.json(o.toResponseObject(),{status:405,headers:{Allow:KI,"Access-Control-Allow-Origin":"*"}})}let r=Response.json(t,{headers:{"Access-Control-Allow-Origin":"*"}});return e.method==="HEAD"?new Response(null,{status:r.status,headers:r.headers}):r}function cx(e,t){let r=sx(new URL(e.url).pathname);if(r===ax(t.resourceServerUrl))return GI(e,Sf(t));if(r==="/.well-known/oauth-authorization-server")return Sf(t),GI(e,t.oauthMetadata)}function OM(e){return typeof e=="object"&&e!==null&&"setScopeChallengeResolver"in e&&typeof e.setScopeChallengeResolver=="function"}function lx(e,t){if(typeof e!="string"||!/^[\u0021\u0023-\u005B\u005D-\u007E]+$/.test(e))throw new TypeError(`${t} must satisfy the OAuth scope-token grammar`)}function NM(e){if(e===null||typeof e!="object"||!Array.isArray(e.scopes)||e.scopes.length===0)throw new TypeError("scope challenge must contain at least one scope");for(let[t,r]of e.scopes.entries())lx(r,`scope challenge scopes[${t}]`);if(e.errorDescription!==void 0&&typeof e.errorDescription!="string")throw new TypeError("scope challenge errorDescription must be a string");if(e.errorDescription!==void 0&&!/^[\u0020-\u0021\u0023-\u005B\u005D-\u007E]+$/.test(e.errorDescription))throw new TypeError("scope challenge errorDescription must satisfy the RFC 6750 error-description grammar");return e}function ux(...e){if(e.length===0)throw new TypeError("requireScopes must contain at least one scope");for(let[r,o]of e.entries())lx(o,`requireScopes scope[${r}]`);let t=[...e];return({authInfo:r})=>{if(r===void 0)return;let o=new Set(r.scopes);if(!t.every(n=>o.has(n)))return{scopes:t}}}async function Q$(e,t,r){for(let o of e){let n=await r({request:o,...t!==void 0&&{authInfo:t}});if(n!==void 0)return NM(n)}}function eb(e){if(e?.resourceMetadataUrl!==void 0)return e.resourceMetadataUrl;if(e?.resource?.protocol==="https:"||e?.resource?.protocol==="http:")return Y$(e.resource)}function tb(e,t){return kf(new qt(wt.InsufficientScope,e.errorDescription??"Insufficient scope"),{requiredScopes:[...e.scopes],resourceMetadataUrl:t})}function MM(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??jM,roundTimeoutMs:e?.roundTimeoutMs??AM,legacyShim:e?.legacyShim??!0}}function dx(e,t,r){if(r===null||typeof r!="object"||typeof r.method!="string")throw new de(Q.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let o=r,n=OR(o);if(n===void 0)throw new de(Q.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${o.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:o,required:n}}function DM(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let r=[...t].map(o=>o.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function G$(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new de(Q.InternalError,t)}function hx(e,t){mx(e,t)}function zf(e,t){fx(e,t)}function Rf(e){return px(e)}function qM(e){return{...e}}function VM(e,t){let r=0,o=[e];for(;o.length>0;){let n=o.pop();if(!(n===null||typeof n!="object"))if(Array.isArray(n))for(let i of n){if(++r>t)return r;i!==null&&typeof i=="object"&&o.push(i)}else for(let i in n){if(!Object.prototype.hasOwnProperty.call(n,i))continue;if(++r>t)return r;let a=n[i];a!==null&&typeof a=="object"&&o.push(a)}}return r}function FM(e){if(!(e===void 0||e===1/0)){if(typeof e!="number"||Number.isNaN(e)||e<1)throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(e)}`);return e}}function WI(e,t){if(e){let o=t;return async(n,i)=>o(n,i)}let r=t;return async(o,n)=>r(n)}function ZM(e,t){let r=fo(t,"input"),o=ef(r);return o.valid||console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${o.reason}`),r}function YI(e){if(e!==void 0)try{return fo(e,"output")}catch{return}}function QI(e,t,r){if(t){let o=r;return async(n,i)=>{let a=await lo(t,n??{});if(!a.success)throw new de(Q.InvalidParams,`Invalid arguments for prompt ${e}: ${a.error}`);return o(a.data,i)}}else{let o=r;return async(n,i)=>o(i)}}function ex(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}function tx(e){let t=e;if(t.shape&&typeof t.shape=="object")return t.shape}function BM(e){return e?.type==="optional"}function nx(e){return BM(e)?e.def?.innerType??e:e}var W$,Di,TM,ox,wf,KI,jM,AM,UM,LM,mx,fx,px,nb,Vn,If,XI,mc,xf=G(()=>{lc();_f();W$=Symbol.for("mcp.completable");Di=15e3,TM=2**31-1;wf=class{static{ox=e=>e._classification}onclose;onerror;onmessage;_classification;_responseMode;_started=!1;_used=!1;_closed=!1;_terminalDelivered=!1;_dispatchWindowOpen=!1;_requestId;_deferredResponse;_sse;_abortCleanup;_keepAliveMs;constructor(e){this._classification=e.classification,this._responseMode=e.responseMode??"auto",this._keepAliveMs=e.keepAliveMs??Di}async start(){if(this._started)throw new Error("PerRequestHTTPServerTransport is already started");this._started=!0}async handleMessage(e,t){if(this._used)throw new Error("PerRequestHTTPServerTransport serves exactly one exchange; construct a new transport per request");if(!this._started||this.onmessage===void 0)throw new Error("PerRequestHTTPServerTransport is not connected: connect a server to this transport before handling a message");if(this._closed)throw new Error("PerRequestHTTPServerTransport is closed");this._used=!0;let r=t?.request?.signal;if(r?.aborted)throw await this.close(),new be(ke.ConnectionClosed,"The request was aborted before it could be handled");let o={classification:this._classification,...t?.request!==void 0&&{request:t.request},...t?.authInfo!==void 0&&{authInfo:t.authInfo}};if(et(e)){this._requestId=e.id;let n,i,a=new Promise((s,c)=>{n=s,i=c});if(this._deferredResponse={promise:a,resolve:n,reject:i,settled:!1},r!==void 0){let s=()=>void this.close();r.addEventListener("abort",s,{once:!0}),this._abortCleanup=()=>r.removeEventListener("abort",s)}this._dispatchWindowOpen=!0;try{this.onmessage(e,o)}finally{this._dispatchWindowOpen=!1}return this._responseMode==="sse"&&!this._closed&&!this._deferredResponse.settled&&this.upgradeToSse(),a}return this.onmessage(e,o),new Response(null,{status:202})}async send(e,t){if(this._closed)return;let r=Lt(e)||Vt(e),o=r?e.id:t?.relatedRequestId;if(this._requestId===void 0||o===void 0||o!==this._requestId){r&&this.onerror?.(new Error(`Received a response for an unknown request id: ${String(e.id)}`));return}if(r){if(this._terminalDelivered)return;this._terminalDelivered=!0;let n=Vt(e)?e.error.code:void 0,i=n!==void 0&&(this._dispatchWindowOpen||n===Q.MissingRequiredClientCapability)?O$[n]:void 0;if(i!==void 0&&this._sse===void 0){this.settleResponse(Response.json(e,{status:i,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}if(this._sse!==void 0||this._responseMode==="sse"){this._sse===void 0&&this.upgradeToSse(),this.writeMessageFrame(e),this.finalizeStream();return}this.settleResponse(Response.json(e,{status:200,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}this._responseMode!=="json"&&(this._sse===void 0&&this.upgradeToSse(),this.writeMessageFrame(e))}writeCommentFrame(e){if(this._closed||this._sse===void 0||this._sse.closed)return;let t=e.split(`
|
|
74
|
+
`).map(r=>`: ${r}`).join(`
|
|
75
|
+
`);this.writeFrame(`${t}
|
|
76
|
+
|
|
77
|
+
`)}async close(){if(!this._closed){if(this._closed=!0,this._abortCleanup?.(),this._abortCleanup=void 0,this._sse?.keepAliveTimer!==void 0&&clearInterval(this._sse.keepAliveTimer),this._sse!==void 0&&!this._sse.closed){this._sse.closed=!0;try{this._sse.controller.close()}catch{}}this._deferredResponse!==void 0&&!this._deferredResponse.settled&&(this._deferredResponse.settled=!0,this._deferredResponse.reject(new be(ke.ConnectionClosed,"Connection closed before a response was produced"))),this.onclose?.()}}settleResponse(e){this._deferredResponse===void 0||this._deferredResponse.settled||(this._deferredResponse.settled=!0,this._deferredResponse.resolve(e))}upgradeToSse(){let e,t=new ReadableStream({start:r=>{e=r},cancel:()=>{this.close()}});this._sse={controller:e,encoder:new TextEncoder,closed:!1},this._sse.keepAliveTimer=fc(this._keepAliveMs,()=>this.writeCommentFrame("keepalive")),this.settleResponse(new Response(t,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}}))}finalizeStream(){if(this._sse?.keepAliveTimer!==void 0&&clearInterval(this._sse.keepAliveTimer),this._sse!==void 0&&!this._sse.closed){this._sse.closed=!0;try{this._sse.controller.close()}catch{}}queueMicrotask(()=>void this.close())}writeMessageFrame(e){this.writeFrame(`event: message
|
|
78
|
+
data: ${JSON.stringify(e)}
|
|
79
|
+
|
|
80
|
+
`)}writeFrame(e){if(!(this._sse===void 0||this._sse.closed))try{this._sse.controller.enqueue(this._sse.encoder.encode(e))}catch(t){this.onerror?.(new Error(`Failed to write to the response stream: ${t}`))}}};KI="GET, HEAD, OPTIONS";jM=8,AM=6e5;UM=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:i,roundTimeoutMs:a}=this._host,s=o.mcpReq.signal,c=n,l=0;for(;;){if(l+=1,l>i)return G$(e,uI(e,i));let u=c.inputRequests,d=u!=null&&Object.keys(u).length>0,m=typeof c.requestState=="string"?c.requestState:void 0;if(!d&&m===void 0)throw new de(Q.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let f;if(d){let v=this._host.resolvedClientCapabilities(o),p=[];for(let[g,S]of Object.entries(u)){let{embedded:T,required:R}=dx(e,g,S);if(T.method!=="roots/list"&&T.params===void 0)throw new de(Q.InternalError,`Handler for ${e} returned an input request '${g}' of kind '${T.method}' without params`);if(rc(R,v)!==void 0)return G$(e,`Cannot request input '${g}' (${T.method}): the client on this 2025-era connection did not declare the required capability${v===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);p.push([g,T])}let b=mI(s);try{let g={relatedRequestId:o.mcpReq.id,timeout:a,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:b.signal},S=await Promise.all(p.map(async([T,R])=>{try{return[T,await this._dispatchLeg(R,g)]}catch(w){throw b.abort(w),w}}));f=Object.fromEntries(S)}catch(g){if(s.aborted)throw g;return G$(e,`Fulfilling input required by '${e}' failed: ${g instanceof Error?g.message:String(g)}`)}finally{b.dispose()}}else await dI(lI,s);let h={...o,mcpReq:{...o.mcpReq,inputResponses:f,droppedInputResponseKeys:void 0,requestState:cc(m)}};if(m!==void 0){let v=await this._host.verifyRequestState(m,h,e);v!==void 0&&(h=M$(h,v))}let y=await t(r,h);if(!zn(y))return y;c=y}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;return r.mode==="url"&&r.elicitationId===void 0&&(r={...r,elicitationId:DM()}),await this._host.sendElicitation(r,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},LM=new Set(["tools/call","prompts/get","resources/read"]);nb=class extends af{_clientCapabilities;_clientVersion;static{mx=(e,t)=>{t.clientCapabilities!==void 0&&(e._clientCapabilities=t.clientCapabilities),t.clientInfo!==void 0&&(e._clientVersion=t.clientInfo)},fx=(e,t)=>{let r=t.filter(o=>!e._supportedProtocolVersions.includes(o));r.length>0&&(e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r]),e.setRequestHandler("server/discover",()=>e._ondiscover())},px=e=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_boundFromTransport=!1;_legacyInputRequiredShim(){return this._legacyShim??=new UM({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:e=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,r)=>this._verifyRequestState(e,t,r),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){if(super(t),this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new dc,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=MM(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))o!==void 0&&x$(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),Km(this._supportedProtocolVersions).length>0&&this.setRequestHandler("server/discover",()=>this._ondiscover()),this._capabilities.logging&&this._registerLoggingHandler()}async connect(e){if(this.transport!==void 0)throw new be(ke.AlreadyConnected,"Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");this._boundFromTransport&&(this._boundFromTransport=!1,this._negotiatedProtocolVersion=void 0);let t=PM(e)?.revision;t!==void 0&&!this._servedModernEra()&&Ct.includes(t)&&Km(this._supportedProtocolVersions).includes(t)&&(this._negotiatedProtocolVersion=t,this._boundFromTransport=!0),await super.connect(e)}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let r=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:o}=e.params,n=rf(zr,o);return n.success&&this._loggingLevels.set(r,n.data),{}})}buildContext(e,t){let r=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,n,i)=>{if(!this._capabilities.logging)return Promise.resolve();let a;if(this._servedModernEra()){if(a=e.mcpReq.envelope?.[Mn],a===void 0)return Promise.resolve()}else a=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);return a!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(a)?Promise.resolve():e.mcpReq.notify({method:"notifications/message",params:{level:o,data:n,logger:i}})},elicitInput:(o,n)=>this.elicitInput(o,n),requestSampling:(o,n)=>this.createMessage(o,n)},http:r?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(zr.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return r?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r):!1};registerCapabilities(e){if(this.transport)throw new be(ke.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;this._capabilities=sf(this._capabilities,e),!t&&this._capabilities.logging&&this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=LM.has(e);return r===void 0&&!o?async(n,i)=>{let a=await t(n,i);if(zn(a))throw new de(Q.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return a}:async(n,i)=>{let a=o?await this._invokeInputRequiredCapableHandler(e,t,n,i):await t(n,i);if(zn(a)){if(!o)throw new de(Q.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return a}return r===void 0?a:Wm(a,r)}}return async(r,o)=>{let n=Ln(this._negotiatedProtocolVersion),i=n.validateRequest("tools/call",r);if(!i.ok)throw new de(i.reason==="not-in-era"?Q.InternalError:Q.InvalidParams,i.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${i.message}`);let a=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(zn(a))return a;let s=w$(a),c=n.validateResult("tools/call",s);if(!c.ok)throw new de(c.reason==="not-in-era"?Q.InternalError:Q.InvalidParams,c.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${c.message}`);return c.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&qn(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,r,o){let n=this._servedModernEra(),i=o.mcpReq.requestState();if(i!==void 0&&typeof i!="string")throw new de(Q.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let a=o;if(typeof i=="string"){let d=await this._verifyRequestState(i,o,e);d!==void 0&&(a=M$(o,d))}let s;try{s=await t(r,a)}catch(d){throw d instanceof de&&d.code===Q.UrlElicitationRequired&&n?new de(Q.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { \u2026: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`):d}if(!zn(s))return s;if(!n){if(!this._inputRequiredServing.legacyShim)throw new de(Q.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??hr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,a,s)}let c=s.inputRequests,l=c!=null&&Object.keys(c).length>0,u=typeof s.requestState=="string";if(!l&&!u)throw new de(Q.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(l){let d=this._inputRequestCapabilityView(o);for(let[m,f]of Object.entries(c)){let{embedded:h,required:y}=dx(e,m,f),v=rc(y,d);if(v!==void 0)throw new Ni({requiredCapabilities:v},`Cannot request input '${m}' (${h.method}): the request's client capabilities do not declare the required capability`)}}return s}async _verifyRequestState(e,t,r){if(this._requestStateVerify!==void 0)try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(new Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new de(Q.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[dn]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new be(ke.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead \u2014 the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new be(ke.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new be(ke.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new be(ke.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new be(ke.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new be(ke.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new be(ke.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new be(ke.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new be(ke.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new be(ke.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new be(ke.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new be(ke.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new be(ke.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new be(ke.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let r=jR(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??hr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:Km(this._supportedProtocolVersions),capabilities:qM(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new be(ke.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages.at(-1),a=Array.isArray(i.content)?i.content:[i.content],s=a.some(d=>d.type==="tool_result"),c=e.messages.length>1?e.messages.at(-2):void 0,l=c?Array.isArray(c.content)?c.content:[c.content]:[],u=l.some(d=>d.type==="tool_use");if(s){if(a.some(d=>d.type!=="tool_result"))throw new de(Q.InvalidParams,"The last message must contain only tool_result content if any is present");if(!u)throw new de(Q.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(l.filter(f=>f.type==="tool_use").map(f=>f.id)),m=new Set(a.filter(f=>f.type==="tool_result").map(f=>f.toolUseId));if(d.size!==m.size||![...d].every(f=>m.has(f)))throw new de(Q.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=!!(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),n=this._wireCodec().samplingResultVariant(r,o);if(!n.ok)throw new be(ke.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new be(ke.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new be(ke.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,r){let o=e.mode??"form",n=r?.validateAcceptedContent??!0;switch(o){case"url":{let i=e;return this.request({method:"elicitation/create",params:i},t)}case"form":{let i=e.mode==="form"?e:{...e,mode:"form"},a=await this.request({method:"elicitation/create",params:i},t);if(n&&a.action==="accept"&&a.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(a.content);if(!s.valid)throw new de(Q.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof de?s:new de(Q.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return a}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new be(ke.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};Vn=class{server;_maxToolInputElements;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(!(t===void 0||!t.enabled)){if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return XI;try{let r=fo(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}}constructor(e,t){this.server=new nb(e,t),this._maxToolInputElements=FM(t?.maxToolInputElements),t?.capabilities?.tools&&this.setToolRequestHandlers(),t?.capabilities?.resources&&this.setResourceRequestHandlers(),t?.capabilities?.prompts&&this.setPromptRequestHandlers()}async connect(e){return OM(e)&&e.setScopeChallengeResolver(t=>this.resolveScopeChallenge(t)),await this.server.connect(e)}async close(){await this.server.close()}resolveScopeChallenge=e=>{switch(e.request.method){case"tools/call":{let t=e.request.params?.name;if(typeof t!="string")return;let r=this._registeredTools[t];return r===void 0||!r.enabled?void 0:r.scopeChallenge?.(e)}case"resources/read":{let t=e.request.params?.uri;if(typeof t!="string")return;let r;try{r=new URL(t)}catch{return}let o=this._registeredResources[r.toString()];if(o!==void 0)return o.enabled?o.scopeChallenge?.(e):void 0;for(let n of Object.values(this._registeredResourceTemplates))if(n.resourceTemplate.uriTemplate.match(r.toString()))return n.enabled?n.scopeChallenge?.(e):void 0;return}case"prompts/get":{let t=e.request.params?.name;if(typeof t!="string")return;let r=this._registeredPrompts[t];return r===void 0||!r.enabled?void 0:r.scopeChallenge?.(e)}default:return}};_toolHandlersInitialized=!1;setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?ZM(e,t.inputSchema):XI,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};return t.outputSchema&&(r.outputSchema=fo(t.outputSchema,"output")),r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new de(Q.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new de(Q.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(r,e.params.arguments,e.params.name),n=await this.executeToolHandler(r,o,t);return await this.validateToolOutput(r,n,e.params.name),zn(n)?n:this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof de&&o.code===Q.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(this._maxToolInputElements!==void 0&&VM(t,this._maxToolInputElements)>this._maxToolInputElements)throw new de(Q.InvalidParams,`Invalid arguments for tool ${r}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!e.inputSchema)return;let o=await lo(e.inputSchema,t??{});if(!o.success)throw new de(Q.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema||zn(t)||t.isError)return;if(t.structuredContent===void 0)throw new de(Q.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let o=await lo(e.outputSchema,t.structuredContent);if(!o.success)throw new de(Q.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${o.error}`)}async executeToolHandler(e,t,r){return e.executor(t,r)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async e=>{switch(e.params.ref.type){case"ref/prompt":return Ym(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Qm(e),this.handleResourceCompletion(e,e.params.ref);default:throw new de(Q.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new de(Q.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new de(Q.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return mc;let o=nx(tx(r.argsSchema)?.[e.params.argument.name]);if(!bf(o))return mc;let n=xM(o);return n?ex(await n(e.params.argument.value,e.params.context)):mc}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find(n=>n.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return mc;throw new de(Q.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);return o?ex(await o(e.params.argument.value,e.params.context)):mc}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,i])=>i.enabled).map(([n,i])=>({uri:n,name:i.name,...i.metadata})),o=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let i=await n.resourceTemplate.listCallback(t);for(let a of i.resources)o.push({...n.metadata,...a})}return{resources:[...r,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let r;try{r=new URL(e.params.uri)}catch{throw new de(Q.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[r.toString()];if(o){if(!o.enabled)throw new de(Q.InvalidParams,`Resource ${r} disabled`);return Wm(await o.readCallback(r,t),o.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let i=n.resourceTemplate.uriTemplate.match(r.toString());if(i){if(!n.enabled)throw new de(Q.InvalidParams,`Resource template ${n.resourceTemplate.uriTemplate} disabled`);return Wm(await n.readCallback(r,i,t),n.cacheHint)}}throw new oc(e.params.uri)}),this._resourceHandlersInitialized=!0)}_promptHandlersInitialized=!1;setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?sI(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new de(Q.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new de(Q.InvalidParams,`Prompt ${e.params.name} disabled`);return r.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0)}registerResource(e,t,r,o){let{cacheHint:n,scopeChallenge:i,...a}=r,s=a;if(n!==void 0&&x$(n,`resource ${e}`),typeof t=="string"){if(this._registeredResources[t])throw new Error(`Resource ${t} is already registered`);let c=this._createRegisteredResource(e,r.title,t,s,i,o);return n!==void 0&&(c.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let c=this._createRegisteredResourceTemplate(e,r.title,t,s,i,o);return n!==void 0&&(c.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}}_createRegisteredResource(e,t,r,o,n,i){let a={name:e,title:t,metadata:o,readCallback:i,scopeChallenge:n,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({uri:null}),update:s=>{s.uri!==void 0&&s.uri!==r&&(delete this._registeredResources[r],s.uri&&(this._registeredResources[s.uri]=a)),s.name!==void 0&&(a.name=s.name),s.metadata!==void 0&&(a.metadata=s.metadata),s.title!==void 0&&(a.title=s.title,a.metadata={...a.metadata,title:s.title}),s.callback!==void 0&&(a.readCallback=s.callback),s.scopeChallenge!==void 0&&(a.scopeChallenge=s.scopeChallenge===null?void 0:s.scopeChallenge),s.enabled!==void 0&&(a.enabled=s.enabled),this.sendResourceListChanged()}};return this._registeredResources[r]=a,a}_createRegisteredResourceTemplate(e,t,r,o,n,i){let a={resourceTemplate:r,title:t,metadata:o,readCallback:i,scopeChallenge:n,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:c=>{c.name!==void 0&&c.name!==e&&(delete this._registeredResourceTemplates[e],c.name&&(this._registeredResourceTemplates[c.name]=a)),c.template!==void 0&&(a.resourceTemplate=c.template),c.metadata!==void 0&&(a.metadata=c.metadata),c.title!==void 0&&(a.title=c.title,a.metadata={...a.metadata,title:c.title}),c.callback!==void 0&&(a.readCallback=c.callback),c.scopeChallenge!==void 0&&(a.scopeChallenge=c.scopeChallenge===null?void 0:c.scopeChallenge),c.enabled!==void 0&&(a.enabled=c.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=a;let s=r.uriTemplate.variableNames;return Array.isArray(s)&&s.some(c=>!!r.completeCallback(c))&&this.setCompletionRequestHandler(),a}_createRegisteredPrompt(e,t,r,o,n,i,a,s){let c=o,l=n,u={title:t,description:r,argsSchema:o,icons:i,scopeChallenge:a,_meta:s,handler:QI(e,o,n),enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:d=>{d.name!==void 0&&d.name!==e&&(delete this._registeredPrompts[e],d.name&&(this._registeredPrompts[d.name]=u)),d.title!==void 0&&(u.title=d.title),d.description!==void 0&&(u.description=d.description),d.icons!==void 0&&(u.icons=d.icons),d.scopeChallenge!==void 0&&(u.scopeChallenge=d.scopeChallenge===null?void 0:d.scopeChallenge),d._meta!==void 0&&(u._meta=d._meta);let m=!1;d.argsSchema!==void 0&&(u.argsSchema=d.argsSchema,c=d.argsSchema,m=!0),d.callback!==void 0&&(l=d.callback,m=!0),m&&(u.handler=QI(e,c,l)),d.enabled!==void 0&&(u.enabled=d.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[e]=u,o){let d=tx(o);d&&Object.values(d).some(m=>bf(nx(m)))&&this.setCompletionRequestHandler()}return u}_createRegisteredTool(e,t,r,o,n,i,a,s,c,l,u){q$(e);let d=u,m,f={title:t,description:r,inputSchema:o,outputSchema:n,get outputSchemaJson(){return m??=YI(f.outputSchema)},set outputSchemaJson(h){m=h},annotations:i,icons:a,execution:s,scopeChallenge:c,_meta:l,handler:u,executor:WI(o,u),enabled:!0,disable:()=>f.update({enabled:!1}),enable:()=>f.update({enabled:!0}),remove:()=>f.update({name:null}),update:h=>{h.name!==void 0&&h.name!==e&&(typeof h.name=="string"&&q$(h.name),delete this._registeredTools[e],delete this._toolInputSchemaJson[e],h.name&&(delete this._toolInputSchemaJson[h.name],this._registeredTools[h.name]=f,e=h.name)),h.title!==void 0&&(f.title=h.title),h.description!==void 0&&(f.description=h.description);let y=!1;h.paramsSchema!==void 0&&(f.inputSchema=h.paramsSchema,delete this._toolInputSchemaJson[e],y=!0),h.callback!==void 0&&(f.handler=h.callback,d=h.callback,y=!0),y&&(f.executor=WI(f.inputSchema,d)),h.outputSchema!==void 0&&(f.outputSchema=h.outputSchema,f.outputSchemaJson=YI(h.outputSchema)),h.annotations!==void 0&&(f.annotations=h.annotations),h.icons!==void 0&&(f.icons=h.icons),h.scopeChallenge!==void 0&&(f.scopeChallenge=h.scopeChallenge===null?void 0:h.scopeChallenge),h._meta!==void 0&&(f._meta=h._meta),h.enabled!==void 0&&(f.enabled=h.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=f,this.setToolRequestHandlers(),this.sendToolListChanged(),f}registerTool(e,t,r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:o,description:n,inputSchema:i,outputSchema:a,annotations:s,icons:c,scopeChallenge:l,_meta:u}=t;return this._createRegisteredTool(e,o,n,mf(i),mf(a),s,c,void 0,l,u,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:o,description:n,argsSchema:i,icons:a,scopeChallenge:s,_meta:c}=t,l=this._createRegisteredPrompt(e,o,n,mf(i),r,a,s,c);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),l}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},If=class{_uriTemplate;constructor(e,t){this._callbacks=t,this._uriTemplate=typeof e=="string"?new df(e):e}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback(e){return this._callbacks.complete?.[e]}};XI={type:"object",properties:{}};mc={completion:{values:[],hasMore:!1}}});function vx(e){return{toolsChanged:()=>e.publish({kind:"tools_list_changed"}),promptsChanged:()=>e.publish({kind:"prompts_list_changed"}),resourcesChanged:()=>e.publish({kind:"resources_list_changed"}),resourceUpdated:t=>e.publish({kind:"resource_updated",uri:t})}}function yx(e,t){switch(t.kind){case"tools_list_changed":return e.toolsListChanged===!0;case"prompts_list_changed":return e.promptsListChanged===!0;case"resources_list_changed":return e.resourcesListChanged===!0;case"resource_updated":return e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.includes(t.uri)}}function _x(e,t){let r={},o=n=>t===void 0||n===!0;return e.toolsListChanged===!0&&o(t?.tools?.listChanged)&&(r.toolsListChanged=!0),e.promptsListChanged===!0&&o(t?.prompts?.listChanged)&&(r.promptsListChanged=!0),e.resourcesListChanged===!0&&o(t?.resources?.listChanged)&&(r.resourcesListChanged=!0),e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.length>0&&o(t?.resources?.subscribe)&&(r.resourceSubscriptions=[...e.resourceSubscriptions]),r}function HM(e){switch(e.kind){case"tools_list_changed":return{method:"notifications/tools/list_changed",...e.params!==void 0&&{params:e.params}};case"prompts_list_changed":return{method:"notifications/prompts/list_changed",...e.params!==void 0&&{params:e.params}};case"resources_list_changed":return{method:"notifications/resources/list_changed",...e.params!==void 0&&{params:e.params}};case"resource_updated":return{method:"notifications/resources/updated",params:{...e.params,uri:e.uri}}}}function gx(e,t,r){return Response.json({jsonrpc:"2.0",error:{code:t,message:r},id:e},{status:200})}function Tf(e,t){return{method:e.method,params:{...e.params,_meta:{...e.params?._meta,[An]:t}}}}function $x(e){let t=Ln(ic).validateRequest("subscriptions/listen",e);return t.ok?t.value.params?.notifications:void 0}function bx(e){let{bus:t,onerror:r}=e,o=e.maxSubscriptions??Ui,n=e.keepAliveMs??Di,i=new Set;function a(s,c,l,u){if(i.size>=o)return r?.(new Error(`subscriptions/listen refused: subscription limit reached (${o})`)),gx(s.id,-32603,"Subscription limit reached");let d=$x(s);if(d===void 0)return gx(s.id,-32602,"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter");let m=_x(d,l),f=s.id,h=new TextEncoder,y,v=!1,p,b,g,S=z=>{if(!v)try{y.enqueue(h.encode(z))}catch(P){r?.(P instanceof Error?P:new Error(String(P)))}},T=(z,P)=>{S(`event: message
|
|
81
|
+
data: ${JSON.stringify({jsonrpc:"2.0",method:z,params:P})}
|
|
82
|
+
|
|
83
|
+
`)},R=z=>{if(!v){z&&S(`event: message
|
|
84
|
+
data: ${JSON.stringify({jsonrpc:"2.0",id:f,result:{resultType:"complete",_meta:{[An]:f,[Xt]:u}}})}
|
|
85
|
+
|
|
86
|
+
`),v=!0;try{p?.()}catch(P){r?.(P instanceof Error?P:new Error(String(P)))}b!==void 0&&clearInterval(b),g?.(),i.delete(R);try{y.close()}catch{}}},w=new ReadableStream({start(z){y=z;let P=Tf({method:"notifications/subscriptions/acknowledged",params:{notifications:m}},f);if(T(P.method,P.params),Object.keys(m).length===0){R(!0);return}p=t.subscribe(U=>{if(v||!yx(m,U))return;let O=Tf(HM(U),f);T(O.method,O.params)}),b=fc(n,()=>S(`: keepalive
|
|
87
|
+
|
|
88
|
+
`)),i.add(R)},cancel(){R(!1)}});if(c!==void 0)if(c.aborted)R(!1);else{let z=()=>R(!1);c.addEventListener("abort",z,{once:!0}),g=()=>c.removeEventListener("abort",z)}return new Response(w,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}return{serve:a,closeAll(){for(let s of i)s(!0)},get openCount(){return i.size}}}function KM(e,t){switch(e){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:t??""}}}var rb,Ui,JM,Sx,ob=G(()=>{xf();lc();rb=class{_listeners=new Set;constructor(e){this.onerror=e}publish(e){for(let t of this._listeners)try{t(e)}catch(r){this.onerror?.(r instanceof Error?r:new Error(String(r)))}}subscribe(e){this._listeners.add(e);let t=!0;return()=>{t&&(t=!1,this._listeners.delete(e))}}get listenerCount(){return this._listeners.size}};Ui=1024;JM=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]),Sx=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor(e=Ui,t,r){this._maxSubscriptions=e,this._serverCapabilities=t,this._serverInfo=r}setServerCapabilities(e,t){this._serverCapabilities=e,t!==void 0&&(this._serverInfo=t)}has(e){return this._subs.has(e)}serve(e){if(this._serverCapabilities===void 0)throw new Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:e.id,error:{code:-32603,message:"Subscription limit reached"}};let t=$x(e);if(t===void 0)return{jsonrpc:"2.0",id:e.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let r=_x(t,this._serverCapabilities);return this._subs.set(e.id,r),Tf({method:"notifications/subscriptions/acknowledged",params:{notifications:r}},e.id)}cancel(e){return this._subs.delete(e)}routeOutbound(e){if(!JM.has(e.method))return"passthrough";let t=e.params?.uri,r=typeof t=="string"?t:void 0,o=KM(e.method,r),n=[];for(let[i,a]of this._subs)yx(a,o)&&n.push(Tf({method:e.method,params:e.params??{}},i));return n}teardownAll(){let e=[];for(let t of this._subs.keys())e.push({jsonrpc:"2.0",id:t,result:{resultType:"complete",_meta:{[An]:t,...this._serverInfo!==void 0&&{[Xt]:this._serverInfo}}}});return this._subs.clear(),e}}});var Cx={};an(Cx,{BAGGAGE_META_KEY:()=>Yu,CLIENT_CAPABILITIES_META_KEY:()=>dn,CLIENT_INFO_META_KEY:()=>gr,DEFAULT_MAX_REQUEST_BODY_SIZE:()=>Cf,DEFAULT_NEGOTIATED_PROTOCOL_VERSION:()=>ws,DEFAULT_REQUEST_TIMEOUT_MSEC:()=>A$,INTERNAL_ERROR:()=>rd,INVALID_PARAMS:()=>nd,INVALID_REQUEST:()=>ed,InMemoryServerEventBus:()=>rb,InMemoryTransport:()=>bI,JSONRPC_VERSION:()=>vr,LATEST_PROTOCOL_VERSION:()=>hr,LOG_LEVEL_META_KEY:()=>Mn,METHOD_NOT_FOUND:()=>td,McpServer:()=>Vn,MissingRequiredClientCapabilityError:()=>Ni,OAuthError:()=>qt,OAuthErrorCode:()=>wt,PARSE_ERROR:()=>Qu,PROTOCOL_VERSION_META_KEY:()=>Ut,PerRequestHTTPServerTransport:()=>wf,Protocol:()=>af,ProtocolError:()=>de,ProtocolErrorCode:()=>Q,RELATED_TASK_META_KEY:()=>ks,ReadBuffer:()=>lf,ResourceNotFoundError:()=>oc,ResourceTemplate:()=>If,SERVER_INFO_META_KEY:()=>Xt,STDIO_DEFAULT_MAX_BUFFER_SIZE:()=>U$,SUBSCRIPTION_ID_META_KEY:()=>An,SUPPORTED_PROTOCOL_VERSIONS:()=>gi,SdkError:()=>be,SdkErrorCode:()=>ke,SdkHttpError:()=>TR,Server:()=>nb,TRACEPARENT_META_KEY:()=>Wu,TRACESTATE_META_KEY:()=>Xu,UnsupportedProtocolVersionError:()=>Ir,UriTemplate:()=>df,UrlElicitationRequiredError:()=>T$,WebStandardStreamableHTTPServerTransport:()=>Rx,acceptedContent:()=>cI,assertCompleteRequestPrompt:()=>Ym,assertCompleteRequestResourceTemplate:()=>Qm,bearerAuthChallengeResponse:()=>kf,buildOAuthProtectedResourceMetadata:()=>Sf,checkResourceAllowed:()=>ER,classifyInboundRequest:()=>N$,completable:()=>rx,createFetchWithInit:()=>$I,createMcpHandler:()=>YM,createRequestStateCodec:()=>oD,deserializeMessage:()=>L$,fromJsonSchema:()=>aD,getDisplayName:()=>_I,getOAuthProtectedResourceMetadataUrl:()=>Y$,hostHeaderValidationResponse:()=>eD,inputRequired:()=>ac,inputResponse:()=>sc,isCallToolResult:()=>YR,isCompletable:()=>bf,isInitializeRequest:()=>Xm,isInitializedNotification:()=>eI,isInputRequiredResult:()=>zn,isJSONRPCErrorResponse:()=>Vt,isJSONRPCNotification:()=>pn,isJSONRPCRequest:()=>et,isJSONRPCResponse:()=>XR,isJSONRPCResultResponse:()=>Lt,isJsonContentType:()=>cf,isLegacyRequest:()=>XM,isSpecType:()=>vI,isTaskAugmentedRequestParams:()=>QR,legacyStatelessFallback:()=>WM,localhostAllowedHostnames:()=>QM,localhostAllowedOrigins:()=>tD,mergeCapabilities:()=>sf,oauthMetadataResponse:()=>cx,originValidationResponse:()=>nD,parseJSONRPCMessage:()=>WR,preloadSchemas:()=>SI,readRequestBody:()=>sb,requireBearerAuth:()=>ix,requireScopes:()=>ux,resourceUrlFromServerUrl:()=>PR,serializeMessage:()=>uf,specTypeSchemas:()=>gI,validateHostHeader:()=>Px,validateOriginHeader:()=>Ex,verifyBearerToken:()=>X$});async function GM(e,t,r){let o=new wf({classification:r.classification,...r.responseMode!==void 0&&{responseMode:r.responseMode},...r.keepAliveMs!==void 0&&{keepAliveMs:r.keepAliveMs}});return await e.connect(o),o.handleMessage(t,{...r.request!==void 0&&{request:r.request},...r.authInfo!==void 0&&{authInfo:r.authInfo}})}function zx(e){return`Payload Too Large: Request body must not exceed ${e} bytes`}function Of(e){if(e===void 0)return Cf;if(typeof e!="number"||!Number.isFinite(e)||e<=0)throw new RangeError(`maxRequestBodySize must be a positive number of bytes, got ${String(e)}`);return e}async function sb(e,t=Cf){if(Number(e.headers.get("content-length"))>t)return{tooLarge:!0};if(e.body===null)return{tooLarge:!1,text:""};let r=e.body.getReader(),o=new TextDecoder,n=0,i="";try{for(;;){let{done:a,value:s}=await r.read();if(a)break;if(n+=s.byteLength,n>t)return{tooLarge:!0};i+=o.decode(s,{stream:!0})}}finally{r.releaseLock()}return{tooLarge:!1,text:i+o.decode()}}function xr(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;let{method:t,id:r}=e;return typeof t!="string"?null:typeof r=="string"||typeof r=="number"?r:null}function Fn(e,t,r,o,n=null){return Response.json({jsonrpc:"2.0",error:{code:t,message:r,...o!==void 0&&{data:o}},id:n},{status:e,...e===405&&{headers:{Allow:"POST"}}})}function Pf(e,t=null){return Fn(e.httpStatus,e.code,e.message,e.data,t)}function pc(e){return e instanceof Error?e:new Error(String(e))}function hc(e=null){return Fn(500,-32603,"Internal server error",void 0,e)}function wx(e){if(e.transport!==void 0)throw new Error("The factory returned an instance that is still serving another request. Return a new instance for each request.")}function Ix(e,t,r,o){return async(n,i)=>{if(n.method.toUpperCase()!=="POST")return Fn(405,-32e3,"Method not allowed.");try{let a=await e({era:"legacy",...i?.authInfo!==void 0&&{authInfo:i.authInfo},requestInfo:n}),s=new Rx({sessionIdGenerator:void 0,...r!==void 0&&{keepAliveMs:r},...o!==void 0&&{maxRequestBodySize:o}});await a.connect(s);let c=()=>{s.close().catch(()=>{}),a.close().catch(()=>{})};n.signal?.addEventListener("abort",c,{once:!0});let l=await s.handleRequest(n,{...i?.authInfo!==void 0&&{authInfo:i.authInfo},...i?.parsedBody!==void 0&&{parsedBody:i.parsedBody}});if(l.body===null||D$(l.headers.get("content-type"))!=="text/event-stream")return c(),l;let u=l.body.getReader(),d=!1,m=()=>{d||(d=!0,c())},f=new ReadableStream({pull:async h=>{try{let{done:y,value:v}=await u.read();if(y){m(),h.close();return}v!==void 0&&h.enqueue(v)}catch(y){m(),h.error(y)}},cancel:h=>(m(),u.cancel(h).catch(()=>{}))});return new Response(f,{status:l.status,statusText:l.statusText,headers:l.headers})}catch(a){try{t?.(pc(a))}catch{}return hc(xr(i?.parsedBody))}}}function WM(e,t,r){return Ix(e,t,void 0,Of(r?.maxRequestBodySize))}function xx(e){return{protocolVersionHeader:e.headers.get("mcp-protocol-version")??void 0,mcpMethodHeader:e.headers.get("mcp-method")??void 0,mcpNameHeader:e.headers.get("mcp-name")??void 0}}async function Tx(e,t,r=!0,o=Cf){let n=e.method.toUpperCase(),i,a=t,s=e,c=!1;if(n==="POST"){if(a===void 0){r&&(s=e.clone());let l;try{let u=await sb(e,o);if(u.tooLarge)return{step:"body-too-large"};l=u.text}catch{return{step:"unreadable-body"}}try{i=l.length===0?void 0:JSON.parse(l)}catch{c=!0}!c&&i!==void 0&&(a=i)}else i=a;if(c||i===void 0)return{step:"no-json-body",forwardRequest:s}}return{step:"classified",outcome:N$({httpMethod:n,...xx(e),...i!==void 0&&{body:i}}),body:i,parsedBody:a,forwardRequest:s}}async function XM(e,t,r){let o=Of(r?.maxRequestBodySize),n=await Tx(t===void 0&&e.method.toUpperCase()==="POST"?e.clone():e,t,!1,o);return n.step==="no-json-body"||n.step==="classified"&&n.outcome.kind==="legacy"}function YM(e,t={}){let{legacy:r,onerror:o,responseMode:n}=t,i=Of(t.maxRequestBodySize);if(typeof r=="function")throw new TypeError("The 'legacy' option only accepts 'stateless' or 'reject', not a handler function. To serve 2025-era traffic with your own handler, route in user land with the exported isLegacyRequest(request) predicate in front of a strict (legacy: 'reject') handler.");let a=new Set,s=!1,c=p=>{try{o?.(p)}catch{}},l=t.bus??new rb(c),u=vx(l),d=bx({bus:l,maxSubscriptions:t.maxSubscriptions??Ui,keepAliveMs:t.keepAliveMs??Di,onerror:c});n==="json"&&console.warn("responseMode: 'json' drops mid-call notifications. subscriptions/listen streams are always served over SSE regardless; other notifications emitted before a result are dropped.");let m=r==="reject"?void 0:Ix(e,c,t.keepAliveMs,i);async function f(p,b,g){let S=p.classification.revision;if(S===void 0||!Ct.includes(S)){let D=new Ir({supported:[...Ct],requested:S??"unknown"});return c(D),Fn(400,D.code,D.message,D.data,xr(p.message))}let T=oI({httpMethod:b.method,...xx(b)},p);if(T!==void 0)return c(new Error(`Rejected inbound request (${T.cell}): ${T.message}`)),Pf(T,xr(p.message));let R=p.messageKind==="request"?fn(p.message.params):void 0,w=R?.[dn];if(p.messageKind==="request"){let D=CR(p.message.method);if(D!==void 0){let Y=rc(D,w);if(Y!==void 0){let ee=new Ni({requiredCapabilities:Y});return c(ee),Fn(rI(ee.code,"ladder"),ee.code,ee.message,ee.data,p.message.id)}}}let z=await e({era:"modern",...g!==void 0&&{authInfo:g},requestInfo:b}),P=z instanceof Vn?z.server:z;if(wx(P),p.messageKind==="request"&&p.message.method==="subscriptions/listen"){let D=P.getCapabilities(),Y=Rf(P);return z.close().catch(c),d.serve(p.message,b.signal,D,Y)}if(p.messageKind==="request"&&p.message.method==="tools/call"&&z instanceof Vn){let D=p.message.params,Y=typeof D?.name=="string"?D.name:void 0,ee=Y===void 0?void 0:z.toolInputSchemaJson(Y);if(ee!==void 0){let _e=ef(ee);if(_e.declarations!==void 0&&_e.declarations.length>0){let Pe=nI(_e.declarations,D?.arguments,b.headers);if(Pe!==void 0)return z.close().catch(c),c(new Error(`Rejected inbound request (${Pe.cell}): ${Pe.message}`)),Pf(Pe,p.message.id)}}}if(p.messageKind==="request"&&z instanceof Vn)try{let D=await Q$([p.message],g,Y=>z.resolveScopeChallenge(Y));if(D!==void 0)return z.close().catch(c),tb(D,eb(g))}catch(D){return z.close().catch(c),c(pc(D)),hc(p.message.id)}wx(P),of(P,S),zf(P,Ct),R!==void 0&&hx(P,{clientInfo:R[gr],clientCapabilities:w});let U=P.onclose;a.add(P);let O=()=>{a.delete(P),P.onclose===O&&(P.onclose=U),U?.()};P.onclose=O;try{let D=await GM(z,p.message,{classification:p.classification,request:b,...g!==void 0&&{authInfo:g},...n!==void 0&&{responseMode:n},...t.keepAliveMs!==void 0&&{keepAliveMs:t.keepAliveMs}});return p.messageKind==="notification"&&queueMicrotask(()=>void P.close().catch(()=>{})),D}catch(D){return D instanceof be&&D.code===ke.ConnectionClosed?new Response(null,{status:499}):(await P.close().catch(()=>{}),a.delete(P),c(pc(D)),hc(xr(p.message)))}}async function h(p,b,g,S){if(m!==void 0)return m(b,{...g!==void 0&&{authInfo:g},...S!==void 0&&{parsedBody:S}});let T=nf(p,Ct);return T===void 0?new Response(null,{status:202}):(c(new Error(`Rejected 2025-era request on a modern-only endpoint (${T.cell}): ${T.message}`)),Pf(T,xr(S)))}async function y(p,b){let g=b?.authInfo;if(p.method.toUpperCase()==="POST"&&!cf(p.headers.get("content-type")))return c(new Error("Unsupported Media Type: Content-Type must be application/json")),Fn(415,-32e3,"Unsupported Media Type: Content-Type must be application/json");let S=await Tx(p,b?.parsedBody,!0,i);if(S.step==="unreadable-body")return Fn(400,-32700,"Parse error: the request body could not be read");if(S.step==="body-too-large")return Fn(413,-32e3,zx(i));if(S.step==="no-json-body")return m!==void 0?m(S.forwardRequest,{...g!==void 0&&{authInfo:g}}):Fn(400,-32700,"Parse error: the request body is not valid JSON");let{outcome:T,body:R,parsedBody:w,forwardRequest:z}=S;try{switch(T.kind){case"reject":return c(new Error(`Rejected inbound request (${T.cell}): ${T.message}`)),Pf(T,xr(R));case"modern":return await f(T,p,g);case"legacy":return await h(T,z,g,w)}}catch(P){return c(pc(P)),hc(xr(R))}}return{fetch:async(p,b)=>{if(s)throw new Error("This MCP handler has been closed");try{return await y(p,b)}catch(g){return c(pc(g)),hc(xr(b?.parsedBody))}},notify:u,bus:l,close:async()=>{s=!0,d.closeAll();let p=[...a].map(b=>b.close().catch(()=>{}));a.clear(),await Promise.all(p)}}}function Px(e,t){if(!e)return{ok:!1,errorCode:"missing_host",message:"Missing Host header"};let r;try{r=new URL(`http://${e}`).hostname}catch{return{ok:!1,errorCode:"invalid_host_header",message:`Invalid Host header: ${e}`,hostHeader:e}}return t.includes(r)?{ok:!0,hostname:r}:{ok:!1,errorCode:"invalid_host",message:`Invalid Host: ${r}`,hostHeader:e,hostname:r}}function QM(){return["localhost","127.0.0.1","[::1]"]}function eD(e,t){let r=Px(e.headers.get("host"),t);if(!r.ok)return Response.json({jsonrpc:"2.0",error:{code:-32e3,message:r.message},id:null},{status:403,headers:{"Content-Type":"application/json"}})}function Ex(e,t){if(e==null||e==="")return{ok:!0};let r,o;try{let n=new URL(e);r=n.hostname,o=n.protocol}catch{return{ok:!1,errorCode:"invalid_origin_header",message:`Invalid Origin header: ${e}`,originHeader:e}}return r===""?{ok:!1,errorCode:"invalid_origin_header",message:`Invalid Origin header: ${e}`,originHeader:e}:!(o!=="http:"&&o!=="https:"&&t.includes(`${o}//*`))&&!t.includes(r)?{ok:!1,errorCode:"invalid_origin",message:`Invalid Origin: ${r}`,originHeader:e,hostname:r}:{ok:!0,origin:e,hostname:r}}function tD(){return["localhost","127.0.0.1","[::1]"]}function nD(e,t){let r=Ex(e.headers.get("origin"),t);if(!r.ok)return Response.json({jsonrpc:"2.0",error:{code:-32e3,message:r.message},id:null},{status:403,headers:{"Content-Type":"application/json"}})}function ab(e){let t="";for(let r of e)t+=String.fromCodePoint(r);return btoa(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function rD(e,t){if(e.length!==t.length)return!1;let r=0;for(let o=0;o<e.length;o++)r|=e.codePointAt(o)^t.codePointAt(o);return r===0}function kx(e){let t=e.replaceAll("-","+").replaceAll("_","/"),r=atob(t),o=new Uint8Array(r.length);for(let n=0;n<r.length;n++)o[n]=r.codePointAt(n);return o}function oD(e){let t=globalThis.crypto?.subtle;if(t===void 0)throw new TypeError("createRequestStateCodec requires the Web Crypto API (globalThis.crypto.subtle); see https://ts.sdk.modelcontextprotocol.io/v2/troubleshooting for the Node.js polyfill instructions");let r=typeof e.key=="string"?new TextEncoder().encode(e.key):Uint8Array.from(e.key);if(r.byteLength<32)throw new RangeError(`createRequestStateCodec: key must be at least 32 bytes (got ${r.byteLength})`);let o=e.ttlSeconds??600;if(!Number.isFinite(o))throw new RangeError("createRequestStateCodec: ttlSeconds must be a finite number");let n=e.bind,i,a=()=>i??=t.importKey("raw",r,{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]),s=new TextEncoder,c="mcp.requestState.bind:",l=async u=>ab(new Uint8Array(await t.sign("HMAC",await a(),s.encode(c+u))).slice(0,16));return{async mint(u,d){let m={p:u,exp:Math.floor(Date.now()/1e3)+o};if(n!==void 0){if(d===void 0)throw new TypeError("createRequestStateCodec: mint() requires ctx when a bind callback is configured");m.b=await l(n(d))}let f=ab(s.encode(JSON.stringify(m)));return`${Ef}${f}.${ab(new Uint8Array(await t.sign("HMAC",await a(),s.encode(Ef+f))))}`},async verify(u,d){let m=u.lastIndexOf(".");if(!u.startsWith(Ef)||m<=3)throw new Error("malformed");let f=u.slice(3,m),h;try{h=kx(u.slice(m+1))}catch{throw new Error("malformed")}if(!await t.verify("HMAC",await a(),h,s.encode(Ef+f)))throw new Error("mac");let y;try{y=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(kx(f)))}catch{throw new Error("malformed")}if(typeof y.exp!="number"||y.exp<Math.floor(Date.now()/1e3))throw new Error("expired");if(n!==void 0){let v=await l(n(d));if(y.b===void 0||!rD(y.b,v))throw new Error("bind")}else if(y.b!==void 0)throw new Error("bind");return y.p}}}function aD(e,t){return wI(e,t??(iD??=new dc))}var Cf,ib,Rx,Ef,iD,cb=G(()=>{xf();lc();ob();_f();Cf=4*1024*1024,ib=100;Rx=class{sessionIdGenerator;_started=!1;_hasHandledRequest=!1;_closed=!1;_streamMapping=new Map;_requestToStreamMapping=new Map;_requestResponseMap=new Map;_initialized=!1;_enableJsonResponse=!1;_standaloneSseStreamId="_GET_stream";_eventStore;_onsessioninitialized;_onsessionclosed;_allowedHosts;_allowedOrigins;_enableDnsRebindingProtection;_retryInterval;_supportedProtocolVersions;_keepAliveMs;_maxRequestBodySize;_scopeChallengeResolver;sessionId;onclose;onerror;onmessage;constructor(e={}){this.sessionIdGenerator=e.sessionIdGenerator,this._enableJsonResponse=e.enableJsonResponse??!1,this._eventStore=e.eventStore,this._onsessioninitialized=e.onsessioninitialized,this._onsessionclosed=e.onsessionclosed,this._allowedHosts=e.allowedHosts,this._allowedOrigins=e.allowedOrigins,this._enableDnsRebindingProtection=e.enableDnsRebindingProtection??!1,this._retryInterval=e.retryInterval,this._supportedProtocolVersions=e.supportedProtocolVersions??gi,this._keepAliveMs=e.keepAliveMs??Di,this._maxRequestBodySize=Of(e.maxRequestBodySize)}startKeepAlive(e,t){if(this._closed)return;let r=fc(this._keepAliveMs,()=>{try{e.enqueue(t.encode(`: keepalive
|
|
89
|
+
|
|
90
|
+
`))}catch{r!==void 0&&clearInterval(r)}});return r}setScopeChallengeResolver(e){this._scopeChallengeResolver=e}async start(){if(this._started)throw new Error("Transport already started");this._started=!0}setSupportedProtocolVersions(e){this._supportedProtocolVersions=e}createJsonErrorResponse(e,t,r,o){let n={code:t,message:r};return o?.data!==void 0&&(n.data=o.data),Response.json({jsonrpc:"2.0",error:n,id:null},{status:e,headers:{"Content-Type":"application/json",...o?.headers}})}async _checkScopeChallenge(e,t){if(!this._scopeChallengeResolver)return;let r=await Q$(e.filter(o=>et(o)),t,this._scopeChallengeResolver);return r===void 0?void 0:tb(r,eb(t))}validateRequestHeaders(e){if(this._enableDnsRebindingProtection){if(this._allowedHosts&&this._allowedHosts.length>0){let t=e.headers.get("host");if(!t||!this._allowedHosts.includes(t)){let r=`Invalid Host header: ${t}`;return this.onerror?.(new Error(r)),this.createJsonErrorResponse(403,-32e3,r)}}if(this._allowedOrigins&&this._allowedOrigins.length>0){let t=e.headers.get("origin");if(t&&!this._allowedOrigins.includes(t)){let r=`Invalid Origin header: ${t}`;return this.onerror?.(new Error(r)),this.createJsonErrorResponse(403,-32e3,r)}}}}async handleRequest(e,t){if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");if(!this.sessionIdGenerator&&this._hasHandledRequest)throw new Error("Stateless transport cannot be reused across requests. Create a new transport per request.");this._hasHandledRequest=!0;let r=this.validateRequestHeaders(e);if(r)return r;switch(e.method){case"POST":return this.handlePostRequest(e,t);case"GET":return this.handleGetRequest(e);case"DELETE":return this.handleDeleteRequest(e);default:return this.handleUnsupportedRequest()}}supportsEmptySSEData(e){return this._supportedProtocolVersions.includes(e)&&e>="2025-11-25"}async writePrimingEvent(e,t,r,o){if(!this._eventStore||!this.supportsEmptySSEData(o))return;let n=await this._eventStore.storeEvent(r,{}),i=`id: ${n}
|
|
41
91
|
data:
|
|
42
92
|
|
|
43
|
-
`;this._retryInterval!==void 0&&(i=`id: ${
|
|
93
|
+
`;this._retryInterval!==void 0&&(i=`id: ${n}
|
|
44
94
|
retry: ${this._retryInterval}
|
|
45
95
|
data:
|
|
46
96
|
|
|
47
|
-
`),e.enqueue(
|
|
48
|
-
`;return o&&(
|
|
49
|
-
`),
|
|
50
|
-
|
|
51
|
-
`,e.enqueue(r.encode(s)),!0}catch(s){return this.onerror?.(s),!1}}handleUnsupportedRequest(){return this.onerror?.(new Error("Method not allowed.")),new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null}),{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest(e,r){try{let n=e.headers.get("accept");if(!n?.includes("application/json")||!n.includes("text/event-stream"))return this.onerror?.(new Error("Not Acceptable: Client must accept both application/json and text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept both application/json and text/event-stream");let o=e.headers.get("content-type");if(!Vb(o))return this.onerror?.(new Error("Unsupported Media Type: Content-Type must be application/json")),this.createJsonErrorResponse(415,-32e3,"Unsupported Media Type: Content-Type must be application/json");let s={headers:Object.fromEntries(e.headers.entries()),url:new URL(e.url)},i;if(r?.parsedBody!==void 0)i=r.parsedBody;else try{let v=await Kb(e,this._maxRequestBodySize);if(v.tooLarge){let y=Wb(this._maxRequestBodySize);return this.onerror?.(new Error(y)),this.createJsonErrorResponse(413,-32e3,y)}i=JSON.parse(v.text)}catch{return this.onerror?.(new Error("Parse error: Invalid JSON")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}if(Array.isArray(i)&&i.length>100)return this.onerror?.(new Error(`Invalid Request: Batch must not exceed ${100} messages`)),this.createJsonErrorResponse(400,-32600,`Invalid Request: Batch must not exceed ${100} messages`);let a;try{Array.isArray(i)?a=i.map(v=>Bo.parse(v)):a=[Bo.parse(i)]}catch{return this.onerror?.(new Error("Parse error: Invalid JSON-RPC message")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");let c=a.some(Ll);if(c){if(this._initialized&&this.sessionId!==void 0)return this.onerror?.(new Error("Invalid Request: Server already initialized")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(a.length>1)return this.onerror?.(new Error("Invalid Request: Only one initialization request is allowed")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized&&await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!c){let v=this.validateSession(e);if(v)return v;let y=this.validateProtocolVersion(e);if(y)return y}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");if(!a.some(or)){for(let v of a)this.onmessage?.(v,{authInfo:r?.authInfo,requestInfo:s});return new Response(null,{status:202})}let l=crypto.randomUUID(),d=a.find(v=>Ll(v)),m=d?d.params.protocolVersion:e.headers.get("mcp-protocol-version")??yg;if(this._enableJsonResponse)return new Promise(v=>{this._streamMapping.set(l,{resolveJson:v,cleanup:()=>{this._streamMapping.delete(l)}});for(let y of a)or(y)&&this._requestToStreamMapping.set(y.id,l);for(let y of a)this.onmessage?.(y,{authInfo:r?.authInfo,requestInfo:s})});let p=new TextEncoder,f,h,g=new ReadableStream({start:v=>{f=v},cancel:()=>{h!==void 0&&clearInterval(h),this._streamMapping.get(l)?.controller===f&&this._streamMapping.delete(l)}}),_={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};this.sessionId!==void 0&&(_["mcp-session-id"]=this.sessionId);for(let v of a)or(v)&&(this._streamMapping.set(l,{controller:f,encoder:p,cleanup:()=>{h!==void 0&&clearInterval(h),this._streamMapping.delete(l);try{f.close()}catch{}}}),this._requestToStreamMapping.set(v.id,l));try{await this.writePrimingEvent(f,p,l,m);for(let v of a){let y,x;or(v)&&this._eventStore&&m>="2025-11-25"&&(y=()=>{this.closeSSEStream(v.id)},x=()=>{this.closeStandaloneSSEStream()}),this.onmessage?.(v,{authInfo:r?.authInfo,requestInfo:s,closeSSEStream:y,closeStandaloneSSEStream:x})}}catch(v){this._streamMapping.get(l)?.cleanup(),this._resumableStreams.delete(l);for(let y of a)or(y)&&this._requestToStreamMapping.delete(y.id);throw v}return this._streamMapping.get(l)?.controller===f&&(h=this.startKeepAlive(f,p)),new Response(g,{status:200,headers:_})}catch(n){return this.onerror?.(n),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(n)})}}async handleDeleteRequest(e){let r=this.validateSession(e);if(r)return r;let n=this.validateProtocolVersion(e);if(n)return n;try{return await Promise.resolve(this._onsessionclosed?.(this.sessionId)),new Response(null,{status:200})}finally{await this.close()}}validateSession(e){if(this.sessionIdGenerator===void 0)return;if(!this._initialized)return this.onerror?.(new Error("Bad Request: Server not initialized")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Server not initialized");let r=e.headers.get("mcp-session-id");if(!r)return this.onerror?.(new Error("Bad Request: Mcp-Session-Id header is required")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Mcp-Session-Id header is required");if(r!==this.sessionId)return this.onerror?.(new Error("Session not found")),this.createJsonErrorResponse(404,-32001,"Session not found")}validateProtocolVersion(e){let r=e.headers.get("mcp-protocol-version");if(r!==null&&!Vn.includes(r))return this.onerror?.(new Error(`Bad Request: Unsupported protocol version: ${r} (supported versions: ${Vn.join(", ")})`)),this.createJsonErrorResponse(400,-32e3,`Bad Request: Unsupported protocol version: ${r} (supported versions: ${Vn.join(", ")})`)}async close(){this._closed||(this._closed=!0,this._streamMapping.forEach(({cleanup:e})=>{e()}),this._streamMapping.clear(),this._requestResponseMap.clear(),this._resumableStreams.clear(),this.onclose?.())}closeSSEStream(e){let r=this._requestToStreamMapping.get(e);if(!r)return;let n=this._streamMapping.get(r);n&&n.cleanup()}closeStandaloneSSEStream(){let e=this._streamMapping.get(this._standaloneSseStreamId);e&&e.cleanup()}async send(e,r){let n=r?.relatedRequestId;if((sr(e)||Jn(e))&&(n=e.id),n===void 0){if(sr(e)||Jn(e))throw new Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let i;this._eventStore&&(i=await this._eventStore.storeEvent(this._standaloneSseStreamId,e));let a=this._streamMapping.get(this._standaloneSseStreamId);if(a===void 0)return;a.controller&&a.encoder&&(i===void 0||!a.replayedEventIds?.has(i))&&this.writeSSEEvent(a.controller,a.encoder,e,i);return}let o=this._requestToStreamMapping.get(n);if(!o)throw new Error(`No connection established for request ID: ${String(n)}`);let s=this._streamMapping.get(o);if(!this._enableJsonResponse){let i;this._eventStore&&(i=await this._eventStore.storeEvent(o,e),s=this._streamMapping.get(o)),s?.controller&&s?.encoder&&(i===void 0||!s.replayedEventIds?.has(i))&&this.writeSSEEvent(s.controller,s.encoder,e,i)&&i!==void 0&&this._resumableStreams.add(o)}if(sr(e)||Jn(e)){this._requestResponseMap.set(n,e);let i=Array.from(this._requestToStreamMapping.entries()).filter(([c,u])=>u===o).map(([c])=>c);if(i.every(c=>this._requestResponseMap.has(c))){if(!s){if(this._closed){for(let c of i)this._requestResponseMap.delete(c),this._requestToStreamMapping.delete(c);return}if(!this._enableJsonResponse&&this._eventStore&&this._resumableStreams.has(o)){for(let c of i)this._requestResponseMap.delete(c),this._requestToStreamMapping.delete(c);this._resumableStreams.delete(o);return}for(let c of i)this._requestResponseMap.delete(c),this._requestToStreamMapping.delete(c);throw new Error(`No connection established for request ID: ${String(n)}`)}if(this._enableJsonResponse&&s.resolveJson){let c={"Content-Type":"application/json"};this.sessionId!==void 0&&(c["mcp-session-id"]=this.sessionId);let u=i.map(l=>this._requestResponseMap.get(l));u.length===1?s.resolveJson(new Response(JSON.stringify(u[0]),{status:200,headers:c})):s.resolveJson(new Response(JSON.stringify(u),{status:200,headers:c}))}else s.cleanup();for(let c of i)this._requestResponseMap.delete(c),this._requestToStreamMapping.delete(c);this._resumableStreams.delete(o)}}}}});var tw={};To(tw,{StreamableHTTPServerTransport:()=>am});var am,rw=Q(()=>{Lb();ew();am=class{constructor(e={}){this._requestContext=new WeakMap,this._webStandardTransport=new dc(e),this._requestListener=om(async r=>{let n=this._requestContext.get(r);return this._webStandardTransport.handleRequest(r,{authInfo:n?.authInfo,parsedBody:n?.parsedBody})},{overrideGlobalObjects:!1})}get sessionId(){return this._webStandardTransport.sessionId}set onclose(e){this._webStandardTransport.onclose=e}get onclose(){return this._webStandardTransport.onclose}set onerror(e){this._webStandardTransport.onerror=e}get onerror(){return this._webStandardTransport.onerror}set onmessage(e){this._webStandardTransport.onmessage=e}get onmessage(){return this._webStandardTransport.onmessage}async start(){return this._webStandardTransport.start()}async close(){return this._webStandardTransport.close()}async send(e,r){return this._webStandardTransport.send(e,r)}async handleRequest(e,r,n){let o=e.auth;await om(async i=>this._webStandardTransport.handleRequest(i,{authInfo:o,parsedBody:n}),{overrideGlobalObjects:!1})(e,r)}closeSSEStream(e){this._webStandardTransport.closeSSEStream(e)}closeStandaloneSSEStream(){this._webStandardTransport.closeStandaloneSSEStream()}}});var Z={};To(Z,{BRAND:()=>Zw,DIRTY:()=>Hr,EMPTY_PATH:()=>gw,INVALID:()=>L,NEVER:()=>b$,OK:()=>Ze,ParseStatus:()=>Oe,Schema:()=>W,ZodAny:()=>_r,ZodArray:()=>rr,ZodBigInt:()=>Vr,ZodBoolean:()=>Jr,ZodBranded:()=>zo,ZodCatch:()=>on,ZodDate:()=>Wr,ZodDefault:()=>nn,ZodDiscriminatedUnion:()=>Fs,ZodEffects:()=>ft,ZodEnum:()=>tn,ZodError:()=>Xe,ZodFirstPartyTypeKind:()=>S,ZodFunction:()=>Bs,ZodIntersection:()=>Yr,ZodIssueCode:()=>k,ZodLazy:()=>Qr,ZodLiteral:()=>en,ZodMap:()=>Mn,ZodNaN:()=>Zn,ZodNativeEnum:()=>rn,ZodNever:()=>kt,ZodNull:()=>Kr,ZodNullable:()=>Lt,ZodNumber:()=>Br,ZodObject:()=>Qe,ZodOptional:()=>Ye,ZodParsedType:()=>P,ZodPipeline:()=>Ro,ZodPromise:()=>vr,ZodReadonly:()=>sn,ZodRecord:()=>Hs,ZodSchema:()=>W,ZodSet:()=>jn,ZodString:()=>yr,ZodSymbol:()=>In,ZodTransformer:()=>ft,ZodTuple:()=>Dt,ZodType:()=>W,ZodUndefined:()=>Gr,ZodUnion:()=>Xr,ZodUnknown:()=>tr,ZodVoid:()=>Nn,addIssueToContext:()=>E,any:()=>Jw,array:()=>Xw,bigint:()=>Uw,boolean:()=>xm,coerce:()=>x$,custom:()=>ym,date:()=>Fw,datetimeRegex:()=>hm,defaultErrorMap:()=>Qt,discriminatedUnion:()=>e$,effect:()=>f$,enum:()=>u$,function:()=>i$,getErrorMap:()=>Cn,getParsedType:()=>Zt,instanceof:()=>Lw,intersection:()=>t$,isAborted:()=>qs,isAsync:()=>On,isDirty:()=>Us,isValid:()=>gr,late:()=>Dw,lazy:()=>a$,literal:()=>c$,makeIssue:()=>Eo,map:()=>o$,nan:()=>qw,nativeEnum:()=>l$,never:()=>Gw,null:()=>Vw,nullable:()=>m$,number:()=>vm,object:()=>_c,objectUtil:()=>hc,oboolean:()=>v$,onumber:()=>_$,optional:()=>p$,ostring:()=>y$,pipeline:()=>g$,preprocess:()=>h$,promise:()=>d$,quotelessJson:()=>pw,record:()=>n$,set:()=>s$,setErrorMap:()=>hw,strictObject:()=>Yw,string:()=>_m,symbol:()=>Hw,transformer:()=>f$,tuple:()=>r$,undefined:()=>Bw,union:()=>Qw,unknown:()=>Ww,util:()=>ee,void:()=>Kw});var ee;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function r(o){throw new Error}t.assertNever=r,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(ee||(ee={}));var hc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(hc||(hc={}));var P=ee.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zt=t=>{switch(typeof t){case"undefined":return P.undefined;case"string":return P.string;case"number":return Number.isNaN(t)?P.nan:P.number;case"boolean":return P.boolean;case"function":return P.function;case"bigint":return P.bigint;case"symbol":return P.symbol;case"object":return Array.isArray(t)?P.array:t===null?P.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?P.promise:typeof Map<"u"&&t instanceof Map?P.map:typeof Set<"u"&&t instanceof Set?P.set:typeof Date<"u"&&t instanceof Date?P.date:P.object;default:return P.unknown}};var k=ee.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),pw=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Xe=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ee.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];r[s]=r[s]||[],r[s].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Xe.create=t=>new Xe(t);var mw=(t,e)=>{let r;switch(t.code){case k.invalid_type:t.received===P.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case k.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ee.jsonStringifyReplacer)}`;break;case k.unrecognized_keys:r=`Unrecognized key(s) in object: ${ee.joinValues(t.keys,", ")}`;break;case k.invalid_union:r="Invalid input";break;case k.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ee.joinValues(t.options)}`;break;case k.invalid_enum_value:r=`Invalid enum value. Expected ${ee.joinValues(t.options)}, received '${t.received}'`;break;case k.invalid_arguments:r="Invalid function arguments";break;case k.invalid_return_type:r="Invalid function return type";break;case k.invalid_date:r="Invalid date";break;case k.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ee.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case k.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case k.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case k.custom:r="Invalid input";break;case k.invalid_intersection_types:r="Intersection results could not be merged";break;case k.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case k.not_finite:r="Number must be finite";break;default:r=e.defaultError,ee.assertNever(t)}return{message:r}},Qt=mw;var lm=Qt;function hw(t){lm=t}function Cn(){return lm}var Eo=t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}},gw=[];function E(t,e){let r=Cn(),n=Eo({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Qt?void 0:Qt].filter(o=>!!o)});t.common.issues.push(n)}var Oe=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return L;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let s=await o.key,i=await o.value;n.push({key:s,value:i})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return L;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}},L=Object.freeze({status:"aborted"}),Hr=t=>({status:"dirty",value:t}),Ze=t=>({status:"valid",value:t}),qs=t=>t.status==="aborted",Us=t=>t.status==="dirty",gr=t=>t.status==="valid",On=t=>typeof Promise<"u"&&t instanceof Promise;var N;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(N||(N={}));var dt=class{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},dm=(t,e)=>{if(gr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Xe(t.common.issues);return this._error=r,this._error}}};function V(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>{let{message:c}=t;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:o}}var W=class{get description(){return this._def.description}_getType(e){return Zt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Zt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Oe,ctx:{common:e.parent.common,data:e.data,parsedType:Zt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(On(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zt(e)},o=this._parseSync({data:e,path:n.path,parent:n});return dm(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zt(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return gr(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>gr(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Zt(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(On(o)?o:Promise.resolve(o));return dm(n,s)}refine(e,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:k.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new ft({schema:this,typeName:S.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ye.create(this,this._def)}nullable(){return Lt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rr.create(this)}promise(){return vr.create(this,this._def)}or(e){return Xr.create([this,e],this._def)}and(e){return Yr.create(this,e,this._def)}transform(e){return new ft({...V(this._def),schema:this,typeName:S.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new nn({...V(this._def),innerType:this,defaultValue:r,typeName:S.ZodDefault})}brand(){return new zo({typeName:S.ZodBranded,type:this,...V(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new on({...V(this._def),innerType:this,catchValue:r,typeName:S.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ro.create(this,e)}readonly(){return sn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},yw=/^c[^\s-]{8,}$/i,_w=/^[0-9a-z]+$/,vw=/^[0-9A-HJKMNP-TV-Z]{26}$/i,xw=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,bw=/^[a-z0-9_-]{21}$/i,ww=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$w=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Sw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",gc,Tw=/^(?:(?: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])$/,Ew=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,zw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Rw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Pw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Cw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,pm="((\\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])))",Ow=new RegExp(`^${pm}$`);function mm(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function Aw(t){return new RegExp(`^${mm(t)}$`)}function hm(t){let e=`${pm}T${mm(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Iw(t,e){return!!((e==="v4"||!e)&&Tw.test(t)||(e==="v6"||!e)&&zw.test(t))}function Nw(t,e){if(!ww.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function Mw(t,e){return!!((e==="v4"||!e)&&Ew.test(t)||(e==="v6"||!e)&&Rw.test(t))}var yr=class t extends W{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==P.string){let s=this._getOrReturnCtx(e);return E(s,{code:k.invalid_type,expected:P.string,received:s.parsedType}),L}let n=new Oe,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),E(o,{code:k.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),E(o,{code:k.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?E(o,{code:k.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&E(o,{code:k.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")kw.test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"email",code:k.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")gc||(gc=new RegExp(Sw,"u")),gc.test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"emoji",code:k.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")xw.test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"uuid",code:k.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")bw.test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"nanoid",code:k.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")yw.test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"cuid",code:k.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")_w.test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"cuid2",code:k.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")vw.test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"ulid",code:k.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),E(o,{validation:"url",code:k.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"regex",code:k.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),E(o,{code:k.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),E(o,{code:k.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),E(o,{code:k.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?hm(s).test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{code:k.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Ow.test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{code:k.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Aw(s).test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{code:k.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?$w.test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"duration",code:k.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Iw(e.data,s.version)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"ip",code:k.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?Nw(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"jwt",code:k.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Mw(e.data,s.version)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"cidr",code:k.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Pw.test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"base64",code:k.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Cw.test(e.data)||(o=this._getOrReturnCtx(e,o),E(o,{validation:"base64url",code:k.invalid_string,message:s.message}),n.dirty()):ee.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:k.invalid_string,...N.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...N.errToObj(e)})}url(e){return this._addCheck({kind:"url",...N.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...N.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...N.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...N.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...N.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...N.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...N.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...N.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...N.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...N.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...N.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...N.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...N.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...N.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...N.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...N.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...N.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...N.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...N.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...N.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...N.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...N.errToObj(r)})}nonempty(e){return this.min(1,N.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};yr.create=t=>new yr({checks:[],typeName:S.ZodString,coerce:t?.coerce??!1,...V(t)});function jw(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}var Br=class t extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==P.number){let s=this._getOrReturnCtx(e);return E(s,{code:k.invalid_type,expected:P.number,received:s.parsedType}),L}let n,o=new Oe;for(let s of this._def.checks)s.kind==="int"?ee.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),E(n,{code:k.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:k.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:k.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?jw(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),E(n,{code:k.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),E(n,{code:k.not_finite,message:s.message}),o.dirty()):ee.assertNever(s);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,N.toString(r))}gt(e,r){return this.setLimit("min",e,!1,N.toString(r))}lte(e,r){return this.setLimit("max",e,!0,N.toString(r))}lt(e,r){return this.setLimit("max",e,!1,N.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:N.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:N.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:N.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:N.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:N.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:N.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ee.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Br.create=t=>new Br({checks:[],typeName:S.ZodNumber,coerce:t?.coerce||!1,...V(t)});var Vr=class t extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==P.bigint)return this._getInvalidInput(e);let n,o=new Oe;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:k.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:k.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),E(n,{code:k.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):ee.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return E(r,{code:k.invalid_type,expected:P.bigint,received:r.parsedType}),L}gte(e,r){return this.setLimit("min",e,!0,N.toString(r))}gt(e,r){return this.setLimit("min",e,!1,N.toString(r))}lte(e,r){return this.setLimit("max",e,!0,N.toString(r))}lt(e,r){return this.setLimit("max",e,!1,N.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:N.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:N.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:N.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:N.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:N.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:N.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Vr.create=t=>new Vr({checks:[],typeName:S.ZodBigInt,coerce:t?.coerce??!1,...V(t)});var Jr=class extends W{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==P.boolean){let n=this._getOrReturnCtx(e);return E(n,{code:k.invalid_type,expected:P.boolean,received:n.parsedType}),L}return Ze(e.data)}};Jr.create=t=>new Jr({typeName:S.ZodBoolean,coerce:t?.coerce||!1,...V(t)});var Wr=class t extends W{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==P.date){let s=this._getOrReturnCtx(e);return E(s,{code:k.invalid_type,expected:P.date,received:s.parsedType}),L}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return E(s,{code:k.invalid_date}),L}let n=new Oe,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),E(o,{code:k.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),E(o,{code:k.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):ee.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:N.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:N.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Wr.create=t=>new Wr({checks:[],coerce:t?.coerce||!1,typeName:S.ZodDate,...V(t)});var In=class extends W{_parse(e){if(this._getType(e)!==P.symbol){let n=this._getOrReturnCtx(e);return E(n,{code:k.invalid_type,expected:P.symbol,received:n.parsedType}),L}return Ze(e.data)}};In.create=t=>new In({typeName:S.ZodSymbol,...V(t)});var Gr=class extends W{_parse(e){if(this._getType(e)!==P.undefined){let n=this._getOrReturnCtx(e);return E(n,{code:k.invalid_type,expected:P.undefined,received:n.parsedType}),L}return Ze(e.data)}};Gr.create=t=>new Gr({typeName:S.ZodUndefined,...V(t)});var Kr=class extends W{_parse(e){if(this._getType(e)!==P.null){let n=this._getOrReturnCtx(e);return E(n,{code:k.invalid_type,expected:P.null,received:n.parsedType}),L}return Ze(e.data)}};Kr.create=t=>new Kr({typeName:S.ZodNull,...V(t)});var _r=class extends W{constructor(){super(...arguments),this._any=!0}_parse(e){return Ze(e.data)}};_r.create=t=>new _r({typeName:S.ZodAny,...V(t)});var tr=class extends W{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ze(e.data)}};tr.create=t=>new tr({typeName:S.ZodUnknown,...V(t)});var kt=class extends W{_parse(e){let r=this._getOrReturnCtx(e);return E(r,{code:k.invalid_type,expected:P.never,received:r.parsedType}),L}};kt.create=t=>new kt({typeName:S.ZodNever,...V(t)});var Nn=class extends W{_parse(e){if(this._getType(e)!==P.undefined){let n=this._getOrReturnCtx(e);return E(n,{code:k.invalid_type,expected:P.void,received:n.parsedType}),L}return Ze(e.data)}};Nn.create=t=>new Nn({typeName:S.ZodVoid,...V(t)});var rr=class t extends W{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==P.array)return E(r,{code:k.invalid_type,expected:P.array,received:r.parsedType}),L;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(i||a)&&(E(r,{code:i?k.too_big:k.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(E(r,{code:k.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(E(r,{code:k.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>o.type._parseAsync(new dt(r,i,r.path,a)))).then(i=>Oe.mergeArray(n,i));let s=[...r.data].map((i,a)=>o.type._parseSync(new dt(r,i,r.path,a)));return Oe.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:N.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:N.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:N.toString(r)}})}nonempty(e){return this.min(1,e)}};rr.create=(t,e)=>new rr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:S.ZodArray,...V(e)});function An(t){if(t instanceof Qe){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Ye.create(An(n))}return new Qe({...t._def,shape:()=>e})}else return t instanceof rr?new rr({...t._def,type:An(t.element)}):t instanceof Ye?Ye.create(An(t.unwrap())):t instanceof Lt?Lt.create(An(t.unwrap())):t instanceof Dt?Dt.create(t.items.map(e=>An(e))):t}var Qe=class t extends W{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ee.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==P.object){let u=this._getOrReturnCtx(e);return E(u,{code:k.invalid_type,expected:P.object,received:u.parsedType}),L}let{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof kt&&this._def.unknownKeys==="strip"))for(let u in o.data)i.includes(u)||a.push(u);let c=[];for(let u of i){let l=s[u],d=o.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new dt(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof kt){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(u==="strict")a.length>0&&(E(o,{code:k.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=o.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new dt(o,d,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,m=await l.value;u.push({key:d,value:m,alwaysSet:l.alwaysSet})}return u}).then(u=>Oe.mergeObjectSync(n,u)):Oe.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return N.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:N.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:S.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of ee.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of ee.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return An(this)}partial(e){let r={};for(let n of ee.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of ee.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Ye;)s=s._def.innerType;r[n]=s}return new t({...this._def,shape:()=>r})}keyof(){return gm(ee.objectKeys(this.shape))}};Qe.create=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strip",catchall:kt.create(),typeName:S.ZodObject,...V(e)});Qe.strictCreate=(t,e)=>new Qe({shape:()=>t,unknownKeys:"strict",catchall:kt.create(),typeName:S.ZodObject,...V(e)});Qe.lazycreate=(t,e)=>new Qe({shape:t,unknownKeys:"strip",catchall:kt.create(),typeName:S.ZodObject,...V(e)});var Xr=class extends W{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new Xe(a.ctx.common.issues));return E(r,{code:k.invalid_union,unionErrors:i}),L}if(r.common.async)return Promise.all(n.map(async s=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new Xe(c));return E(r,{code:k.invalid_union,unionErrors:a}),L}}get options(){return this._def.options}};Xr.create=(t,e)=>new Xr({options:t,typeName:S.ZodUnion,...V(e)});var er=t=>t instanceof Qr?er(t.schema):t instanceof ft?er(t.innerType()):t instanceof en?[t.value]:t instanceof tn?t.options:t instanceof rn?ee.objectValues(t.enum):t instanceof nn?er(t._def.innerType):t instanceof Gr?[void 0]:t instanceof Kr?[null]:t instanceof Ye?[void 0,...er(t.unwrap())]:t instanceof Lt?[null,...er(t.unwrap())]:t instanceof zo||t instanceof sn?er(t.unwrap()):t instanceof on?er(t._def.innerType):[],Fs=class t extends W{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==P.object)return E(r,{code:k.invalid_type,expected:P.object,received:r.parsedType}),L;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(E(r,{code:k.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),L)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let i=er(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:S.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...V(n)})}};function yc(t,e){let r=Zt(t),n=Zt(e);if(t===e)return{valid:!0,data:t};if(r===P.object&&n===P.object){let o=ee.objectKeys(e),s=ee.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=yc(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===P.array&&n===P.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],c=yc(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===P.date&&n===P.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Yr=class extends W{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=(s,i)=>{if(qs(s)||qs(i))return L;let a=yc(s.value,i.value);return a.valid?((Us(s)||Us(i))&&r.dirty(),{status:r.value,value:a.data}):(E(n,{code:k.invalid_intersection_types}),L)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Yr.create=(t,e,r)=>new Yr({left:t,right:e,typeName:S.ZodIntersection,...V(r)});var Dt=class t extends W{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.array)return E(n,{code:k.invalid_type,expected:P.array,received:n.parsedType}),L;if(n.data.length<this._def.items.length)return E(n,{code:k.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),L;!this._def.rest&&n.data.length>this._def.items.length&&(E(n,{code:k.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new dt(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>Oe.mergeArray(r,i)):Oe.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Dt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Dt({items:t,typeName:S.ZodTuple,rest:null,...V(e)})};var Hs=class t extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.object)return E(n,{code:k.invalid_type,expected:P.object,received:n.parsedType}),L;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in n.data)o.push({key:s._parse(new dt(n,a,n.path,a)),value:i._parse(new dt(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Oe.mergeObjectAsync(r,o):Oe.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof W?new t({keyType:e,valueType:r,typeName:S.ZodRecord,...V(n)}):new t({keyType:yr.create(),valueType:e,typeName:S.ZodRecord,...V(r)})}},Mn=class extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.map)return E(n,{code:k.invalid_type,expected:P.map,received:n.parsedType}),L;let o=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new dt(n,a,n.path,[u,"key"])),value:s._parse(new dt(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return L;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return L;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};Mn.create=(t,e,r)=>new Mn({valueType:e,keyType:t,typeName:S.ZodMap,...V(r)});var jn=class t extends W{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.set)return E(n,{code:k.invalid_type,expected:P.set,received:n.parsedType}),L;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(E(n,{code:k.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(E(n,{code:k.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return L;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>s._parse(new dt(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:N.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:N.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};jn.create=(t,e)=>new jn({valueType:t,minSize:null,maxSize:null,typeName:S.ZodSet,...V(e)});var Bs=class t extends W{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==P.function)return E(r,{code:k.invalid_type,expected:P.function,received:r.parsedType}),L;function n(a,c){return Eo({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Cn(),Qt].filter(u=>!!u),issueData:{code:k.invalid_arguments,argumentsError:c}})}function o(a,c){return Eo({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Cn(),Qt].filter(u=>!!u),issueData:{code:k.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof vr){let a=this;return Ze(async function(...c){let u=new Xe([]),l=await a._def.args.parseAsync(c,s).catch(p=>{throw u.addIssue(n(c,p)),u}),d=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(p=>{throw u.addIssue(o(d,p)),u})})}else{let a=this;return Ze(function(...c){let u=a._def.args.safeParse(c,s);if(!u.success)throw new Xe([n(c,u.error)]);let l=Reflect.apply(i,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new Xe([o(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Dt.create(e).rest(tr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Dt.create([]).rest(tr.create()),returns:r||tr.create(),typeName:S.ZodFunction,...V(n)})}},Qr=class extends W{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Qr.create=(t,e)=>new Qr({getter:t,typeName:S.ZodLazy,...V(e)});var en=class extends W{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return E(r,{received:r.data,code:k.invalid_literal,expected:this._def.value}),L}return{status:"valid",value:e.data}}get value(){return this._def.value}};en.create=(t,e)=>new en({value:t,typeName:S.ZodLiteral,...V(e)});function gm(t,e){return new tn({values:t,typeName:S.ZodEnum,...V(e)})}var tn=class t extends W{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return E(r,{expected:ee.joinValues(n),received:r.parsedType,code:k.invalid_type}),L}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return E(r,{received:r.data,code:k.invalid_enum_value,options:n}),L}return Ze(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};tn.create=gm;var rn=class extends W{_parse(e){let r=ee.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==P.string&&n.parsedType!==P.number){let o=ee.objectValues(r);return E(n,{expected:ee.joinValues(o),received:n.parsedType,code:k.invalid_type}),L}if(this._cache||(this._cache=new Set(ee.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=ee.objectValues(r);return E(n,{received:n.data,code:k.invalid_enum_value,options:o}),L}return Ze(e.data)}get enum(){return this._def.values}};rn.create=(t,e)=>new rn({values:t,typeName:S.ZodNativeEnum,...V(e)});var vr=class extends W{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==P.promise&&r.common.async===!1)return E(r,{code:k.invalid_type,expected:P.promise,received:r.parsedType}),L;let n=r.parsedType===P.promise?r.data:Promise.resolve(r.data);return Ze(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};vr.create=(t,e)=>new vr({type:t,typeName:S.ZodPromise,...V(e)});var ft=class extends W{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===S.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{E(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return L;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?L:c.status==="dirty"?Hr(c.value):r.value==="dirty"?Hr(c.value):c});{if(r.value==="aborted")return L;let a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?L:a.status==="dirty"?Hr(a.value):r.value==="dirty"?Hr(a.value):a}}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?L:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?L:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!gr(i))return L;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>gr(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:r.value,value:a})):L);ee.assertNever(o)}};ft.create=(t,e,r)=>new ft({schema:t,typeName:S.ZodEffects,effect:e,...V(r)});ft.createWithPreprocess=(t,e,r)=>new ft({schema:e,effect:{type:"preprocess",transform:t},typeName:S.ZodEffects,...V(r)});var Ye=class extends W{_parse(e){return this._getType(e)===P.undefined?Ze(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ye.create=(t,e)=>new Ye({innerType:t,typeName:S.ZodOptional,...V(e)});var Lt=class extends W{_parse(e){return this._getType(e)===P.null?Ze(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Lt.create=(t,e)=>new Lt({innerType:t,typeName:S.ZodNullable,...V(e)});var nn=class extends W{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===P.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};nn.create=(t,e)=>new nn({innerType:t,typeName:S.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...V(e)});var on=class extends W{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return On(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Xe(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Xe(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};on.create=(t,e)=>new on({innerType:t,typeName:S.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...V(e)});var Zn=class extends W{_parse(e){if(this._getType(e)!==P.nan){let n=this._getOrReturnCtx(e);return E(n,{code:k.invalid_type,expected:P.nan,received:n.parsedType}),L}return{status:"valid",value:e.data}}};Zn.create=t=>new Zn({typeName:S.ZodNaN,...V(t)});var Zw=Symbol("zod_brand"),zo=class extends W{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Ro=class t extends W{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?L:s.status==="dirty"?(r.dirty(),Hr(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?L:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:S.ZodPipeline})}},sn=class extends W{_parse(e){let r=this._def.innerType._parse(e),n=o=>(gr(o)&&(o.value=Object.freeze(o.value)),o);return On(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};sn.create=(t,e)=>new sn({innerType:t,typeName:S.ZodReadonly,...V(e)});function fm(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function ym(t,e={},r){return t?_r.create().superRefine((n,o)=>{let s=t(n);if(s instanceof Promise)return s.then(i=>{if(!i){let a=fm(e,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!s){let i=fm(e,n),a=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:a})}}):_r.create()}var Dw={object:Qe.lazycreate},S;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(S||(S={}));var Lw=(t,e={message:`Input not instance of ${t.name}`})=>ym(r=>r instanceof t,e),_m=yr.create,vm=Br.create,qw=Zn.create,Uw=Vr.create,xm=Jr.create,Fw=Wr.create,Hw=In.create,Bw=Gr.create,Vw=Kr.create,Jw=_r.create,Ww=tr.create,Gw=kt.create,Kw=Nn.create,Xw=rr.create,_c=Qe.create,Yw=Qe.strictCreate,Qw=Xr.create,e$=Fs.create,t$=Yr.create,r$=Dt.create,n$=Hs.create,o$=Mn.create,s$=jn.create,i$=Bs.create,a$=Qr.create,c$=en.create,u$=tn.create,l$=rn.create,d$=vr.create,f$=ft.create,p$=Ye.create,m$=Lt.create,h$=ft.createWithPreprocess,g$=Ro.create,y$=()=>_m().optional(),_$=()=>vm().optional(),v$=()=>xm().optional(),x$={string:(t=>yr.create({...t,coerce:!0})),number:(t=>Br.create({...t,coerce:!0})),boolean:(t=>Jr.create({...t,coerce:!0})),bigint:(t=>Vr.create({...t,coerce:!0})),date:(t=>Wr.create({...t,coerce:!0}))};var b$=L;He();He();He();He();var Pk=w("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");de.init(t,e),t.def=e,t.parse=(r,n)=>Ac(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>un(t,r,n),t.parseAsync=async(r,n)=>Nc(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>ln(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>ct(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t))});var Ck=w("ZodMiniObject",(t,e)=>{ni.init(t,e),Pk.init(t,e),re.defineLazy(t,"shape",()=>e.shape)});function bl(t,e){let r={type:"object",get shape(){return re.assignProp(this,"shape",{...t}),this.shape},...re.normalizeParams(e)};return new Ck(r)}He();si();function Ft(t){return!!t._zod}function pn(t){let e=Object.values(t);if(e.length===0)return bl({});let r=e.every(Ft),n=e.every(o=>!Ft(o));if(r)return bl(t);if(n)return _c(t);throw new Error("Mixed Zod versions detected in object shape.")}function wr(t,e){return Ft(t)?un(t,e):t.safeParse(e)}async function pi(t,e){return Ft(t)?await ln(t,e):await t.safeParseAsync(e)}function $r(t){if(!t)return;let e;if(Ft(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Fn(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let n=Object.values(t);if(n.length>0&&n.every(o=>typeof o=="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse=="function")))return pn(t)}}if(Ft(t)){let r=t._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function Ak(t){return t.length===0?"object root":t.reduce((e,r,n)=>n===0?String(r):typeof r=="number"?`${e}[${r}]`:`${e}.${r}`,"")}function mi(t){if(t&&typeof t=="object"){if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0)return t.issues.map(e=>e.path?.length?`${e.message} at ${Ak(e.path)}`:e.message).join(`
|
|
52
|
-
`);if("message"in t&&typeof t.message=="string")return t.message;try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function Uh(t){return t.description}function Fh(t){if(Ft(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function Hn(t){if(Ft(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}Sr();function Tr(t){return t==="completed"||t==="failed"||t==="cancelled"}var Ig=Symbol("Let zodToJsonSchema decide on which parser to use");var Ag={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Ng=t=>typeof t=="string"?{...Ag,name:t}:{...Ag,...t};var Mg=t=>{let e=Ng(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}};function Xl(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function oe(t,e,r,n,o){t[e]=r,Xl(t,e,n,o)}var Di=(t,e)=>{let r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];r++);return[(t.length-r).toString(),...e.slice(r)].join("/")};function ke(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?Di(e,t.currentPath):e.join("/")}}function jg(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==S.ZodAny&&(r.items=F(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&oe(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&oe(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(oe(r,"minItems",t.exactLength.value,t.exactLength.message,e),oe(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function Zg(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?oe(r,"minimum",n.value,n.message,e):oe(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),oe(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?oe(r,"maximum",n.value,n.message,e):oe(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),oe(r,"maximum",n.value,n.message,e));break;case"multipleOf":oe(r,"multipleOf",n.value,n.message,e);break}return r}function Dg(){return{type:"boolean"}}function Li(t,e){return F(t.type._def,e)}var Lg=(t,e)=>F(t.innerType._def,e);function Yl(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>Yl(t,e,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return sE(t,e)}}var sE=(t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":oe(r,"minimum",n.value,n.message,e);break;case"max":oe(r,"maximum",n.value,n.message,e);break}return r};function qg(t,e){return{...F(t.innerType._def,e),default:t.defaultValue()}}function Ug(t,e){return e.effectStrategy==="input"?F(t.schema._def,e):ke(e)}function Fg(t){return{type:"string",enum:Array.from(t.values)}}var iE=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function Hg(t,e){let r=[F(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),F(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(s=>{if(iE(s))o.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:a,...c}=s;i=c}else n=void 0;o.push(i)}}),o.length?{allOf:o,...n}:void 0}function Bg(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}var Ql,Tt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Ql===void 0&&(Ql=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ql),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function qi(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":oe(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":oe(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":Et(r,"email",n.message,e);break;case"format:idn-email":Et(r,"idn-email",n.message,e);break;case"pattern:zod":Ve(r,Tt.email,n.message,e);break}break;case"url":Et(r,"uri",n.message,e);break;case"uuid":Et(r,"uuid",n.message,e);break;case"regex":Ve(r,n.regex,n.message,e);break;case"cuid":Ve(r,Tt.cuid,n.message,e);break;case"cuid2":Ve(r,Tt.cuid2,n.message,e);break;case"startsWith":Ve(r,RegExp(`^${ed(n.value,e)}`),n.message,e);break;case"endsWith":Ve(r,RegExp(`${ed(n.value,e)}$`),n.message,e);break;case"datetime":Et(r,"date-time",n.message,e);break;case"date":Et(r,"date",n.message,e);break;case"time":Et(r,"time",n.message,e);break;case"duration":Et(r,"duration",n.message,e);break;case"length":oe(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),oe(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Ve(r,RegExp(ed(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&Et(r,"ipv4",n.message,e),n.version!=="v4"&&Et(r,"ipv6",n.message,e);break}case"base64url":Ve(r,Tt.base64url,n.message,e);break;case"jwt":Ve(r,Tt.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Ve(r,Tt.ipv4Cidr,n.message,e),n.version!=="v4"&&Ve(r,Tt.ipv6Cidr,n.message,e);break}case"emoji":Ve(r,Tt.emoji(),n.message,e);break;case"ulid":{Ve(r,Tt.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{Et(r,"binary",n.message,e);break}case"contentEncoding:base64":{oe(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Ve(r,Tt.base64,n.message,e);break}}break}case"nanoid":Ve(r,Tt.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function ed(t,e){return e.patternStrategy==="escape"?cE(t):t}var aE=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function cE(t){let e="";for(let r=0;r<t.length;r++)aE.has(t[r])||(e+="\\"),e+=t[r];return e}function Et(t,e,r,n){t.format||t.anyOf?.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):oe(t,"format",e,r,n)}function Ve(t,e,r,n){t.pattern||t.allOf?.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:Vg(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):oe(t,"pattern",Vg(e,n),r,n)}function Vg(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,o="",s=!1,i=!1,a=!1;for(let c=0;c<n.length;c++){if(s){o+=n[c],s=!1;continue}if(r.i){if(i){if(n[c].match(/[a-z]/)){a?(o+=n[c],o+=`${n[c-2]}-${n[c]}`.toUpperCase(),a=!1):n[c+1]==="-"&&n[c+2]?.match(/[a-z]/)?(o+=n[c],a=!0):o+=`${n[c]}${n[c].toUpperCase()}`;continue}}else if(n[c].match(/[a-z]/)){o+=`[${n[c]}${n[c].toUpperCase()}]`;continue}}if(r.m){if(n[c]==="^"){o+=`(^|(?<=[\r
|
|
53
|
-
]))
|
|
54
|
-
]))
|
|
55
|
-
`:`[${n[c]}\r
|
|
56
|
-
]`;continue}o+=n[c],n[c]==="\\"?s=!0:i&&n[c]==="]"?i=!1:!i&&n[c]==="["&&(i=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return o}function Ui(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===S.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((n,o)=>({...n,[o]:F(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??ke(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:F(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===S.ZodString&&t.keyType._def.checks?.length){let{type:n,...o}=qi(t.keyType._def,e);return{...r,propertyNames:o}}else{if(t.keyType?._def.typeName===S.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===S.ZodBranded&&t.keyType._def.type._def.typeName===S.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...o}=Li(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function Jg(t,e){if(e.mapStrategy==="record")return Ui(t,e);let r=F(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||ke(e),n=F(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||ke(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function Wg(t){let e=t.values,n=Object.keys(t.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),o=Array.from(new Set(n.map(s=>typeof s)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:n}}function Gg(t){return t.target==="openAi"?void 0:{not:ke({...t,currentPath:[...t.currentPath,"not"]})}}function Kg(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var es={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Yg(t,e){if(e.target==="openApi3")return Xg(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in es&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let i=es[s._def.typeName];return i&&!o.includes(i)?[...o,i]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,s)=>{let i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...o,i];case"bigint":return[...o,"integer"];case"object":if(s._def.value===null)return[...o,"null"];case"symbol":case"undefined":case"function":default:return o}},[]);if(n.length===r.length){let o=n.filter((s,i,a)=>a.indexOf(s)===i);return{type:o.length>1?o:o[0],enum:r.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(s=>!n.includes(s))],[])};return Xg(t,e)}var Xg=(t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>F(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0};function Qg(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:es[t.innerType._def.typeName],nullable:!0}:{type:[es[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=F(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=F(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function ey(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",Xl(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?oe(r,"minimum",n.value,n.message,e):oe(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),oe(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?oe(r,"maximum",n.value,n.message,e):oe(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),oe(r,"maximum",n.value,n.message,e));break;case"multipleOf":oe(r,"multipleOf",n.value,n.message,e);break}return r}function ty(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},o=[],s=t.shape();for(let a in s){let c=s[a];if(c===void 0||c._def===void 0)continue;let u=lE(c);u&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);let l=F(c._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});l!==void 0&&(n.properties[a]=l,u||o.push(a))}o.length&&(n.required=o);let i=uE(t,e);return i!==void 0&&(n.additionalProperties=i),n}function uE(t,e){if(t.catchall._def.typeName!=="ZodNever")return F(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function lE(t){try{return t.isOptional()}catch{return!0}}var ry=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return F(t.innerType._def,e);let r=F(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:ke(e)},r]}:ke(e)};var ny=(t,e)=>{if(e.pipeStrategy==="input")return F(t.in._def,e);if(e.pipeStrategy==="output")return F(t.out._def,e);let r=F(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=F(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}};function oy(t,e){return F(t.type._def,e)}function sy(t,e){let n={type:"array",uniqueItems:!0,items:F(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&oe(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&oe(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}function iy(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>F(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:F(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>F(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function ay(t){return{not:ke(t)}}function cy(t){return ke(t)}var uy=(t,e)=>F(t.innerType._def,e);var ly=(t,e,r)=>{switch(e){case S.ZodString:return qi(t,r);case S.ZodNumber:return ey(t,r);case S.ZodObject:return ty(t,r);case S.ZodBigInt:return Zg(t,r);case S.ZodBoolean:return Dg();case S.ZodDate:return Yl(t,r);case S.ZodUndefined:return ay(r);case S.ZodNull:return Kg(r);case S.ZodArray:return jg(t,r);case S.ZodUnion:case S.ZodDiscriminatedUnion:return Yg(t,r);case S.ZodIntersection:return Hg(t,r);case S.ZodTuple:return iy(t,r);case S.ZodRecord:return Ui(t,r);case S.ZodLiteral:return Bg(t,r);case S.ZodEnum:return Fg(t);case S.ZodNativeEnum:return Wg(t);case S.ZodNullable:return Qg(t,r);case S.ZodOptional:return ry(t,r);case S.ZodMap:return Jg(t,r);case S.ZodSet:return sy(t,r);case S.ZodLazy:return()=>t.getter()._def;case S.ZodPromise:return oy(t,r);case S.ZodNaN:case S.ZodNever:return Gg(r);case S.ZodEffects:return Ug(t,r);case S.ZodAny:return ke(r);case S.ZodUnknown:return cy(r);case S.ZodDefault:return qg(t,r);case S.ZodBranded:return Li(t,r);case S.ZodReadonly:return uy(t,r);case S.ZodCatch:return Lg(t,r);case S.ZodPipeline:return ny(t,r);case S.ZodFunction:case S.ZodVoid:case S.ZodSymbol:return;default:return(n=>{})(e)}};function F(t,e,r=!1){let n=e.seen.get(t);if(e.override){let a=e.override?.(t,e,n,r);if(a!==Ig)return a}if(n&&!r){let a=dE(n,e);if(a!==void 0)return a}let o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);let s=ly(t,t.typeName,e),i=typeof s=="function"?F(s(),e):s;if(i&&fE(t,e,i),e.postProcess){let a=e.postProcess(i,t,e);return o.jsonSchema=i,a}return o.jsonSchema=i,i}var dE=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Di(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((r,n)=>e.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),ke(e)):e.$refStrategy==="seen"?ke(e):void 0}},fE=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r);var td=(t,e)=>{let r=Mg(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[u,l])=>({...c,[u]:F(l._def,{...r,currentPath:[...r.basePath,r.definitionPath,u]},!0)??ke(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=F(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??ke(r),i=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;i!==void 0&&(s.title=i),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let a=o===void 0?n?{...s,[r.definitionPath]:n}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:s}};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a};function pE(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function rd(t,e){return Ft(t)?xl(t,{target:pE(e?.target),io:e?.pipeStrategy??"input"}):td(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function nd(t){let r=$r(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Hn(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function od(t,e){let r=wr(t,e);if(!r.success)throw r.error;return r.data}var mE=6e4,Fi=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(bi,r=>{this._oncancel(r)}),this.setNotificationHandler(ki,r=>{this._onprogress(r)}),this.setRequestHandler($i,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Si,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new O(A.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Ei,async(r,n)=>{let o=async()=>{let s=r.params.taskId;if(!await this._taskStore.getTask(s,n.sessionId))throw new O(A.InvalidParams,`Task not found: ${s}`);if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),a.type==="response")l(c);else{let d=c,m=new O(d.error.code,d.error.message,d.error.data);l(m)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let i=await this._taskStore.getTask(s,n.sessionId);if(!i)throw new O(A.InvalidParams,`Task not found: ${s}`);if(!Tr(i.status))return await this._waitForTaskUpdate(s,n.signal,n.sessionId),await o();if(Tr(i.status)){let a=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s,n.sessionId),{...a,_meta:{...a._meta,[kr]:{taskId:s}}}}return await o()};return await o()}),this.setRequestHandler(zi,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new O(A.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Pi,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new O(A.InvalidParams,`Task not found: ${r.params.taskId}`);if(Tr(o.status))throw new O(A.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId,n.sessionId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new O(A.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof O?o:new O(A.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),O.fromError(A.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,i)=>{o?.(s,i),sr(s)||Jn(s)?this._onresponse(s):or(s)?this._onrequest(s,i):$g(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=O.fromError(A.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[kr]?.taskId,i=o?.sessionId,a=this._taskStore,c=!0,u;if(s&&a&&this._taskMessageQueue&&i!==void 0&&(c=!1,u=(async()=>{if(!await a.getTask(s,i))throw new O(A.InvalidParams,`Task not found: ${s}`);c=!0})()),n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:A.MethodNotFound,message:"Method not found"}};if(s&&u){let h={type:"error",message:f,timestamp:Date.now()};u.then(()=>this._enqueueTaskMessage(s,h,i),()=>o?.send(f)).catch(g=>this._onerror(new Error(`Failed to send an error response: ${g}`)))}else s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}let l=new AbortController;this._requestHandlerAbortControllers.set(e.id,l);let d=xg(e.params)?e.params.task:void 0,m=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,p={signal:l.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async f=>{if(l.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},sendRequest:async(f,h,g)=>{if(l.signal.aborted)throw new O(A.ConnectionClosed,"Request was cancelled");let _={...g,relatedRequestId:e.id};s&&!_.relatedTask&&(_.relatedTask={taskId:s});let v=_.relatedTask?.taskId??s;return v&&m&&await m.updateTaskStatus(v,"input_required"),await this.request(f,h,_)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:m,taskRequestedTtl:d?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};(u??Promise.resolve()).then(()=>{if(u&&l.signal.aborted)throw new O(A.ConnectionClosed,"Request was cancelled");d&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,p)).then(async f=>{if(l.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(l.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:A.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue&&c?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===l&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(c);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),sr(e))n(e);else{let i=new O(e.error.code,e.error.message,e.error.data);n(i)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(sr(e)&&e.result&&typeof e.result=="object"){let i=e.result;if(i.task&&typeof i.task=="object"){let a=i.task;typeof a.taskId=="string"&&(s=!0,this._taskProgressTokens.set(a.taskId,r))}}if(s||this._progressHandlers.delete(r),sr(e))o(e);else{let i=O.fromError(e.error.code,e.error.message,e.error.data);o(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(i){yield{type:"error",error:i instanceof O?i:new O(A.InternalError,String(i))}}return}let s;try{let i=await this.request(e,Wn,n);if(i.task)s=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new O(A.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:a},Tr(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:a.status==="failed"?yield{type:"error",error:new O(A.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new O(A.InternalError,`Task ${s} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof O?i:new O(A.InternalError,String(i))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i,task:a,relatedTask:c}=n??{};return new Promise((u,l)=>{let d=v=>{l(v)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(v){d(v);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,p={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),p.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),a&&(p.params={...p.params,task:a}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[kr]:c}});let f=v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(x=>this._onerror(new Error(`Failed to send cancellation: ${x}`)));let y=v instanceof O?v:new O(A.RequestTimeout,String(v));l(y)};this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return l(v);try{let y=wr(r,v.result);y.success?u(y.data):l(y.error)}catch(y){l(y)}}}),n?.signal?.addEventListener("abort",()=>{f(n?.signal?.reason)});let h=n?.timeout??mE,g=()=>f(O.fromError(A.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(m,h,n?.maxTotalTimeout,g,n?.resetTimeoutOnProgress??!1);let _=c?.taskId;if(_){let v=y=>{let x=this._responseHandlers.get(m);x?x(y):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,v),this._enqueueTaskMessage(_,{type:"request",message:p,timestamp:Date.now()}).catch(y=>{this._cleanupTimeout(m),l(y)})}else this._transport.send(p,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(v=>{this._cleanupTimeout(m),l(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Ti,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Ri,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},Sg,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[kr]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[kr]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let i={...e,jsonrpc:"2.0"};r?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[kr]:r.relatedTask}}}),await this._transport.send(i,r)}setRequestHandler(e,r){let n=nd(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let i=od(e,o);return Promise.resolve(r(i,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=nd(e);this._notificationHandlers.set(n,o=>{let s=od(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n??this._transport?.sessionId,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&or(o.message)){let s=o.message.id,i=this._requestResolvers.get(s);i?(i(new O(A.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r,n){let o=this._options?.defaultTaskPollInterval??1e3;try{let s=await this._taskStore?.getTask(e,n);s?.pollInterval&&(o=s.pollInterval)}catch{}return new Promise((s,i)=>{if(r.aborted){i(new O(A.InvalidRequest,"Request cancelled"));return}let a=setTimeout(s,o);r.addEventListener("abort",()=>{clearTimeout(a),i(new O(A.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async o=>{if(!e)throw new Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},getTask:async o=>{let s=await n.getTask(o,r);if(!s)throw new O(A.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(o,s,i)=>{await n.storeTaskResult(o,s,i,r);let a=await n.getTask(o,r);if(a){let c=Ko.parse({method:"notifications/tasks/status",params:a});await this.notification(c),Tr(a.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,s,i)=>{let a=await n.getTask(o,r);if(!a)throw new O(A.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Tr(a.status))throw new O(A.InvalidParams,`Cannot update task "${o}" from terminal status "${a.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,i,r);let c=await n.getTask(o,r);if(c){let u=Ko.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Tr(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function dy(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function fy(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let i=r[o];dy(i)&&dy(s)?r[o]={...i,...s}:r[o]=s}return r}Sr();var mv=mc(Kf(),1),hv=mc(pv(),1);function EO(){let t=new mv.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,hv.default)(t),t}var za=class{constructor(e){this._ajv=e??EO()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};Sr();var Ra=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],s=Array.isArray(o.content)?o.content:[o.content],i=s.some(l=>l.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],u=c.some(l=>l.type==="tool_use");if(i){if(s.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let l=new Set(c.filter(m=>m.type==="tool_use").map(m=>m.id)),d=new Set(s.filter(m=>m.type==="tool_result").map(m=>m.toolUseId));if(l.size!==d.size||![...l].every(m=>d.has(m)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},Qo,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),o=e.mode??"form";switch(o){case"url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let s=o==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},Xn,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};function gv(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function yv(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var Pa=class extends Fi{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Yo.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(s):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new za,this.setRequestHandler(wi,n=>this._oninitialize(n)),this.setNotificationHandler(ql,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Wl,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:i}=n.params,a=Yo.safeParse(i);return a.success&&this._loggingLevels.set(s,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Ra(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=fy(this._capabilities,e)}setRequestHandler(e,r){let o=$r(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s=Hn(o);if(typeof s!="string")throw new Error("Schema method literal must be a string");if(s==="tools/call"){let a=async(c,u)=>{let l=wr(Kn,c);if(!l.success){let f=l.error instanceof Error?l.error.message:String(l.error);throw new O(A.InvalidParams,`Invalid tools/call request: ${f}`)}let{params:d}=l.data,m=await Promise.resolve(r(c,u));if(d.task){let f=wr(Wn,m);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new O(A.InvalidParams,`Invalid task creation result: ${h}`)}return f.data}let p=wr(ji,m);if(!p.success){let f=p.error instanceof Error?p.error.message:String(p.error);throw new O(A.InvalidParams,`Invalid tools/call result: ${f}`)}return p.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){yv(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&gv(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Vn.includes(r)?r:Ml,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},xi)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(u=>u.type==="tool_result"),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],c=a.some(u=>u.type==="tool_use");if(s){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),l=new Set(o.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(u.size!==l.size||![...u].every(d=>l.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},Gl,r):this.request({method:"sampling/createMessage",params:e},Qo,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=e;return this.request({method:"elicitation/create",params:o},Xn,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=e.mode==="form"?e:{...e,mode:"form"},s=await this.request({method:"elicitation/create",params:o},Xn,r);if(s.action==="accept"&&s.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(s.content);if(!a.valid)throw new O(A.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(i){throw i instanceof O?i:new O(A.InternalError,`Error validating elicitation response: ${i instanceof Error?i.message:String(i)}`)}return s}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},Kl,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};Sr();var vv=Symbol.for("mcp.completable");function op(t){return!!t&&typeof t=="object"&&vv in t}function xv(t){return t[vv]?.complete}var _v;(function(t){t.Completable="McpCompletable"})(_v||(_v={}));var Ca=class t{static isTemplate(e){return/\{[^}\s]+\}/.test(e)}static validateLength(e,r,n){if(e.length>r)throw new Error(`${n} exceeds maximum length of ${r} characters (got ${e.length})`)}get variableNames(){return this.parts.flatMap(e=>typeof e=="string"?[]:e.names)}constructor(e){t.validateLength(e,1e6,"Template"),this.template=e,this.parts=this.parse(e)}toString(){return this.template}parse(e){let r=[],n="",o=0,s=0;for(;o<e.length;)if(e[o]==="{"){n&&(r.push(n),n="");let i=e.indexOf("}",o);if(i===-1)throw new Error("Unclosed template expression");if(s++,s>1e4)throw new Error("Template contains too many expressions (max 10000)");let a=e.slice(o+1,i),c=this.getOperator(a),u=a.includes("*"),l=this.getNames(a),d=l[0];for(let m of l)t.validateLength(m,1e6,"Variable name");r.push({name:d,operator:c,names:l,exploded:u}),o=i+1}else n+=e[o],o++;return n&&r.push(n),r}getOperator(e){return["+","#",".","/","?","&"].find(n=>e.startsWith(n))||""}getNames(e){let r=this.getOperator(e);return e.slice(r.length).split(",").map(n=>n.replace("*","").trim()).filter(n=>n.length>0)}encodeValue(e,r){return t.validateLength(e,1e6,"Variable value"),r==="+"||r==="#"?encodeURI(e):encodeURIComponent(e)}expandPart(e,r){if(e.operator==="?"||e.operator==="&"){let i=e.names.map(c=>{let u=r[c];if(u===void 0)return"";let l=Array.isArray(u)?u.map(d=>this.encodeValue(d,e.operator)).join(","):this.encodeValue(u.toString(),e.operator);return`${c}=${l}`}).filter(c=>c.length>0);return i.length===0?"":(e.operator==="?"?"?":"&")+i.join("&")}if(e.names.length>1){let i=e.names.map(a=>r[a]).filter(a=>a!==void 0);return i.length===0?"":i.map(a=>Array.isArray(a)?a[0]:a).join(",")}let n=r[e.name];if(n===void 0)return"";let s=(Array.isArray(n)?n:[n]).map(i=>this.encodeValue(i,e.operator));switch(e.operator){case"":return s.join(",");case"+":return s.join(",");case"#":return"#"+s.join(",");case".":return"."+s.join(".");case"/":return"/"+s.join("/");default:return s.join(",")}}expand(e){let r="",n=!1;for(let o of this.parts){if(typeof o=="string"){r+=o;continue}let s=this.expandPart(o,e);s&&((o.operator==="?"||o.operator==="&")&&n?r+=s.replace("?","&"):r+=s,(o.operator==="?"||o.operator==="&")&&(n=!0))}return r}escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}partToRegExp(e){let r=[];for(let s of e.names)t.validateLength(s,1e6,"Variable name");if(e.operator==="?"||e.operator==="&"){for(let s=0;s<e.names.length;s++){let i=e.names[s],a=s===0?"\\"+e.operator:"&";r.push({pattern:a+this.escapeRegExp(i)+"=([^&]+)",name:i})}return r}let n,o=e.name;switch(e.operator){case"":n=e.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)";break;case"+":case"#":n="(.+)";break;case".":n="\\.([^/,]+)";break;case"/":n="/"+(e.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)");break;default:n="([^/]+)"}return r.push({pattern:n,name:o}),r}match(e){t.validateLength(e,1e6,"URI");let r="^",n=[];for(let a of this.parts)if(typeof a=="string")r+=this.escapeRegExp(a);else{let c=this.partToRegExp(a);for(let{pattern:u,name:l}of c)r+=u,n.push({name:l,exploded:a.exploded})}r+="$",t.validateLength(r,1e6,"Generated regex pattern");let o=new RegExp(r),s=e.match(o);if(!s)return null;let i={};for(let a=0;a<n.length;a++){let{name:c,exploded:u}=n[a],l=s[a+1],d=c.replace("*","");u&&l.includes(",")?i[d]=l.split(","):i[d]=l}return i}};var zO=/^[A-Za-z0-9._-]{1,128}$/;function RO(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!zO.test(t)){let r=t.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,o,s)=>s.indexOf(n)===o);return e.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function PO(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function sp(t){let e=RO(t);return PO(t,e.warnings),e.isValid}var Oa=class{constructor(e){this._mcpServer=e}registerToolTask(e,r,n){let o={taskSupport:"required",...r.execution};if(o.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,o,r._meta,n)}};function CO(t,e){let r=0,n=[t];for(;n.length>0;){let o=n.pop();if(!(o===null||typeof o!="object"))if(Array.isArray(o))for(let s of o){if(++r>e)return r;s!==null&&typeof s=="object"&&n.push(s)}else for(let s in o){if(!Object.prototype.hasOwnProperty.call(o,s))continue;if(++r>e)return r;let i=o[s];i!==null&&typeof i=="object"&&n.push(i)}}return r}function OO(t){if(!(t===void 0||t===1/0)){if(typeof t!="number"||Number.isNaN(t)||t<1)throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(t)}`);return t}}var Aa=class{constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new Pa(e,r),this._maxToolInputElements=OO(r?.maxToolInputElements),r?.capabilities?.tools&&this.setToolRequestHandlers(),r?.capabilities?.resources&&this.setResourceRequestHandlers(),r?.capabilities?.prompts&&this.setPromptRequestHandlers()}get experimental(){return this._experimental||(this._experimental={tasks:new Oa(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Nr(Mi)),this.server.assertCanSetRequestHandler(Nr(Kn)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Mi,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let n={name:e,title:r.title,description:r.description,inputSchema:(()=>{let o=Fn(r.inputSchema);return o?rd(o,{strictUnions:!0,pipeStrategy:"input"}):AO})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=Fn(r.outputSchema);o&&(n.outputSchema=rd(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Kn,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new O(A.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new O(A.InvalidParams,`Tool ${e.params.name} disabled`);let o=!!e.params.task,s=n.execution?.taskSupport,i="createTask"in n.handler;if((s==="required"||s==="optional")&&!i)throw new O(A.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new O(A.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(s==="optional"&&!o&&i)return await this.handleAutomaticTaskPolling(n,e,r);let a=await this.validateToolInput(n,e.params.arguments,e.params.name),c=await this.executeToolHandler(n,a,r);return o||await this.validateToolOutput(n,c,e.params.name),c}catch(n){if(n instanceof O&&n.code===A.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,n){if(this._maxToolInputElements!==void 0&&CO(r,this._maxToolInputElements)>this._maxToolInputElements)throw new O(A.InvalidParams,`Invalid arguments for tool ${n}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!e.inputSchema)return;let s=Fn(e.inputSchema)??e.inputSchema,i=await pi(s,r??{});if(!i.success){let a="error"in i?i.error:"Unknown error",c=mi(a);throw new O(A.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${c}`)}return i.data}async validateToolOutput(e,r,n){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new O(A.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=Fn(e.outputSchema),s=await pi(o,r.structuredContent);if(!s.success){let i="error"in s?s.error:"Unknown error",a=mi(i);throw new O(A.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${a}`)}}async executeToolHandler(e,r,n){let o=e.handler;if("createTask"in o){if(!n.taskStore)throw new Error("No task store provided.");let i={...n,taskStore:n.taskStore};if(e.inputSchema){let a=o;return await Promise.resolve(a.createTask(r,i))}else{let a=o;return await Promise.resolve(a.createTask(i))}}if(e.inputSchema){let i=o;return await Promise.resolve(i(r,n))}else{let i=o;return await Promise.resolve(i(n))}}async handleAutomaticTaskPolling(e,r,n){if(!n.taskStore)throw new Error("No task store provided for task-capable tool.");let o=await this.validateToolInput(e,r.params.arguments,r.params.name),s=e.handler,i={...n,taskStore:n.taskStore},a=o?await Promise.resolve(s.createTask(o,i)):await Promise.resolve(s.createTask(i)),c=a.task.taskId,u=a.task,l=u.pollInterval??5e3;for(;u.status!=="completed"&&u.status!=="failed"&&u.status!=="cancelled";){await new Promise(m=>setTimeout(m,l));let d=await n.taskStore.getTask(c);if(!d)throw new O(A.InternalError,`Task ${c} not found during polling`);u=d}return await n.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Nr(Zi)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Zi,async e=>{switch(e.params.ref.type){case"ref/prompt":return Cg(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Og(e),this.handleResourceCompletion(e,e.params.ref);default:throw new O(A.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new O(A.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new O(A.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return Cs;let s=$r(n.argsSchema)?.[e.params.argument.name];if(!op(s))return Cs;let i=xv(s);if(!i)return Cs;let a=await i(e.params.argument.value,e.params.context);return wv(a)}async handleResourceCompletion(e,r){let n=Object.values(this._registeredResourceTemplates).find(i=>i.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return Cs;throw new O(A.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return Cs;let s=await o(e.params.argument.value,e.params.context);return wv(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Nr(Ci)),this.server.assertCanSetRequestHandler(Nr(Oi)),this.server.assertCanSetRequestHandler(Nr(Ai)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Ci,async(e,r)=>{let n=Object.entries(this._registeredResources).filter(([s,i])=>i.enabled).map(([s,i])=>({uri:s,name:i.name,...i.metadata})),o=[];for(let s of Object.values(this._registeredResourceTemplates)){if(!s.resourceTemplate.listCallback)continue;let i=await s.resourceTemplate.listCallback(r);for(let a of i.resources)o.push({...s.metadata,...a})}return{resources:[...n,...o]}}),this.server.setRequestHandler(Oi,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,n])=>({name:r,uriTemplate:n.resourceTemplate.uriTemplate.toString(),...n.metadata}))})),this.server.setRequestHandler(Ai,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new O(A.InvalidParams,`Resource ${n} disabled`);return o.readCallback(n,r)}for(let s of Object.values(this._registeredResourceTemplates)){let i=s.resourceTemplate.uriTemplate.match(n.toString());if(i)return s.readCallback(n,i,r)}throw new O(A.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Nr(Ii)),this.server.assertCanSetRequestHandler(Nr(Ni)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Ii,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?IO(r.argsSchema):void 0}))})),this.server.setRequestHandler(Ni,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new O(A.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new O(A.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=Fn(n.argsSchema),s=await pi(o,e.params.arguments??{});if(!s.success){let c="error"in s?s.error:"Unknown error",u=mi(c);throw new O(A.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${u}`)}let i=s.data,a=n.callback;return await Promise.resolve(a(i,r))}else{let o=n.callback;return await Promise.resolve(o(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...n){let o;typeof n[0]=="object"&&(o=n.shift());let s=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let i=this._createRegisteredResource(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let i=this._createRegisteredResourceTemplate(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}}registerResource(e,r,n,o){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}_createRegisteredResource(e,r,n,o,s){let i={name:e,title:r,metadata:o,readCallback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:a=>{typeof a.uri<"u"&&a.uri!==n&&(delete this._registeredResources[n],a.uri&&(this._registeredResources[a.uri]=i)),typeof a.name<"u"&&(i.name=a.name),typeof a.title<"u"&&(i.title=a.title),typeof a.metadata<"u"&&(i.metadata=a.metadata),typeof a.callback<"u"&&(i.readCallback=a.callback),typeof a.enabled<"u"&&(i.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[n]=i,i}_createRegisteredResourceTemplate(e,r,n,o,s){let i={resourceTemplate:n,title:r,metadata:o,readCallback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:u=>{typeof u.name<"u"&&u.name!==e&&(delete this._registeredResourceTemplates[e],u.name&&(this._registeredResourceTemplates[u.name]=i)),typeof u.title<"u"&&(i.title=u.title),typeof u.template<"u"&&(i.resourceTemplate=u.template),typeof u.metadata<"u"&&(i.metadata=u.metadata),typeof u.callback<"u"&&(i.readCallback=u.callback),typeof u.enabled<"u"&&(i.enabled=u.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let a=n.uriTemplate.variableNames;return Array.isArray(a)&&a.some(u=>!!n.completeCallback(u))&&this.setCompletionRequestHandler(),i}_createRegisteredPrompt(e,r,n,o,s){let i={title:r,description:n,argsSchema:o===void 0?void 0:pn(o),callback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:a=>{typeof a.name<"u"&&a.name!==e&&(delete this._registeredPrompts[e],a.name&&(this._registeredPrompts[a.name]=i)),typeof a.title<"u"&&(i.title=a.title),typeof a.description<"u"&&(i.description=a.description),typeof a.argsSchema<"u"&&(i.argsSchema=pn(a.argsSchema)),typeof a.callback<"u"&&(i.callback=a.callback),typeof a.enabled<"u"&&(i.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=i,o&&Object.values(o).some(c=>{let u=c instanceof Ye?c._def?.innerType:c;return op(u)})&&this.setCompletionRequestHandler(),i}_createRegisteredTool(e,r,n,o,s,i,a,c,u){sp(e);let l={title:r,description:n,inputSchema:bv(o),outputSchema:bv(s),annotations:i,execution:a,_meta:c,handler:u,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==e&&(typeof d.name=="string"&&sp(d.name),delete this._registeredTools[e],d.name&&(this._registeredTools[d.name]=l)),typeof d.title<"u"&&(l.title=d.title),typeof d.description<"u"&&(l.description=d.description),typeof d.paramsSchema<"u"&&(l.inputSchema=pn(d.paramsSchema)),typeof d.outputSchema<"u"&&(l.outputSchema=pn(d.outputSchema)),typeof d.callback<"u"&&(l.handler=d.callback),typeof d.annotations<"u"&&(l.annotations=d.annotations),typeof d._meta<"u"&&(l._meta=d._meta),typeof d.enabled<"u"&&(l.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=l,this.setToolRequestHandlers(),this.sendToolListChanged(),l}tool(e,...r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let n,o,s,i;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let c=r[0];if(ip(c))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!ip(r[0])&&(i=r.shift());else if(typeof c=="object"&&c!==null){if(Object.values(c).some(u=>typeof u=="object"&&u!==null))throw new Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);i=r.shift()}}let a=r[0];return this._createRegisteredTool(e,void 0,n,o,s,i,{taskSupport:"forbidden"},void 0,a)}registerTool(e,r,n){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:o,description:s,inputSchema:i,outputSchema:a,annotations:c,_meta:u}=r;return this._createRegisteredTool(e,o,s,i,a,c,{taskSupport:"forbidden"},u,n)}prompt(e,...r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let o;r.length>1&&(o=r.shift());let s=r[0],i=this._createRegisteredPrompt(e,void 0,n,o,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),i}registerPrompt(e,r,n){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:o,description:s,argsSchema:i}=r,a=this._createRegisteredPrompt(e,o,s,i,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},Ia=class{constructor(e,r){this._callbacks=r,this._uriTemplate=typeof e=="string"?new Ca(e):e}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback(e){return this._callbacks.complete?.[e]}},AO={type:"object",properties:{}};function $v(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function kv(t){return"_def"in t||"_zod"in t||$v(t)}function ip(t){return typeof t!="object"||t===null||kv(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some($v)}function bv(t){if(t){if(ip(t))return pn(t);if(!kv(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function IO(t){let e=$r(t);return e?Object.entries(e).map(([r,n])=>{let o=Uh(n),s=Fh(n);return{name:r,description:o,required:!s}}):[]}function Nr(t){let r=$r(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Hn(r);if(typeof n=="string")return n;throw new Error("Schema method literal must be a string")}function wv(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var Cs={completion:{values:[],hasMore:!1}};import Tv from"node:process";Sr();var NO=10*1024*1024,Na=class{constructor(e){this._maxBufferSize=e?.maxBufferSize??NO}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
57
|
-
`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),MO(r)}clear(){this._buffer=void 0}};function MO(t){return Bo.parse(JSON.parse(t))}function Sv(t){return JSON.stringify(t)+`
|
|
58
|
-
`}var Ma=class{constructor(e=Tv.stdin,r=Tv.stdout,n){this._stdin=e,this._stdout=r,this._started=!1,this._ondata=o=>{try{this._readBuffer.append(o),this.processReadBuffer()}catch(s){this.onerror?.(s),this.close().catch(()=>{})}},this._onerror=o=>{this.onerror?.(o)},this._readBuffer=new Na({maxBufferSize:n?.maxBufferSize})}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(r=>{let n=Sv(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};Sr();function ja(t){if(typeof t=="string")return{text:t,hasBinary:!1};if(t==null)return{text:"",hasBinary:!1};if(!Array.isArray(t))return{text:JSON.stringify(t??""),hasBinary:!1};let e="",r=!1,n,o,s="",i;for(let a of t){if(a==null||typeof a!="object"){e+=String(a??"");continue}let c=a;switch(c.type){case"text":case"input_text":case"output_text":e+=c.text??"";break;case"tool_use":{o="tool_call",n=c.name??n;let u=`[tool call: ${c.name}] ${JSON.stringify(c.input??{})}`;e+=u,s+=u;break}case"tool_result":{o="tool_result";let u=ja(c.content);r=r||u.hasBinary,e+=u.text,c.is_error===!0&&(i=!0);break}case"image":case"document":r=!0,e+=`[${c.type}]`;break;case"image_url":case"input_image":r=!0,e+="[image]";break;case"input_audio":r=!0,e+="[audio]";break;case"file":case"input_file":r=!0,e+="[file]";break;case"thinking":e+=c.thinking??"";break;case"redacted_thinking":e+="[redacted thinking]";break;default:e+=JSON.stringify(c)}}return{text:e,hasBinary:r,toolName:n,kind:o,toolCallText:s||void 0,isError:i}}function up(t,e){let r=t&&typeof t=="object"?t:{},n=String(r.role??"user"),o=ja(r.content),s=o.kind??(n==="developer"?"system":["system","user","assistant"].includes(n)?n:"other"),i=o.toolName,a=o.text,c=o.toolCallText;n==="tool"&&(s="tool_result");let u=r.tool_calls,l=Array.isArray(u)?u.filter(d=>d&&typeof d=="object"):void 0;if(l&&l.length>0){s="tool_call",i=l[0]?.function?.name??l[0]?.name;let d=l.map(m=>`[tool call: ${m.function?.name??m.name}] ${m.function?.arguments??JSON.stringify(m.input??{})}`).join(`
|
|
59
|
-
`);a+=d,c=(c??"")+d}return{index:e,role:n,kind:s,text:a,toolName:i,toolCallText:c,hasBinary:o.hasBinary,isError:o.isError}}function ap(t,e){let r=t.trimStart()[0];return{sourceFormat:"text",parseWarning:t.trim()===""?"Input is empty \u2014 nothing to profile.":e&&(r==="{"||r==="[")?`Input starts like JSON but does not parse (${e.message}), so it is not a conversation file.`:void 0,messages:t.trim()===""?[]:[{index:0,role:"user",kind:"user",text:t,hasBinary:!1}]}}function jO(t){if(typeof t=="string")return{text:t,hasBinary:!1};if(!t||typeof t!="object")return{text:"",hasBinary:!1};let e=t;if(typeof e.text=="string")return{text:e.text,hasBinary:!1};if(e.inlineData||e.fileData)return{text:"[file]",hasBinary:!0};if(e.functionCall){let r=`[tool call: ${e.functionCall.name}] ${JSON.stringify(e.functionCall.args??{})}`;return{text:r,hasBinary:!1,kind:"tool_call",toolName:e.functionCall.name,call:r}}if(e.functionResponse){let r=e.functionResponse.response;return{text:typeof r?.output=="string"?r.output:typeof r?.content=="string"?r.content:JSON.stringify(r??{}),hasBinary:!1,kind:"tool_result",toolName:e.functionResponse.name}}return e.executableCode?{text:String(e.executableCode.code??""),hasBinary:!1}:e.codeExecutionResult?{text:String(e.codeExecutionResult.output??""),hasBinary:!1}:{text:JSON.stringify(e),hasBinary:!1}}function cp(t,e){let r=t&&typeof t=="object"?t:{},n=r.role==="model"?"assistant":String(r.role??"user"),o=Array.isArray(r.parts)?r.parts:[],s="",i=!1,a,c,u="";for(let d of o){let m=jO(d);s+=(s&&m.text?`
|
|
60
|
-
`:"")+m.text,i||=m.hasBinary,m.kind&&(a=m.kind),c??=m.toolName,m.call&&(u+=m.call)}let l=["system","user","assistant"].includes(n)?n:"other";return{index:e,role:n,kind:a??l,text:s,toolName:c,toolCallText:u||void 0,hasBinary:i}}function ZO(t,e){if(typeof t=="string")return{index:e,role:"user",kind:"user",text:t,hasBinary:!1};let r=t&&typeof t=="object"?t:{},n=r.type;if(n==="function_call"||n==="custom_tool_call"||n==="local_shell_call"){let o=r.name??(n==="local_shell_call"?"local_shell":void 0),s=typeof r.arguments=="string"?r.arguments:JSON.stringify(r.input??r.action??{}),i=`[tool call: ${o}] ${s}`;return{index:e,role:"assistant",kind:"tool_call",text:i,toolName:o,toolCallText:i,hasBinary:!1}}if(n==="function_call_output"||n==="custom_tool_call_output"||n==="local_shell_call_output"){let o=r.output,s=typeof o=="string"?{text:o,hasBinary:!1}:ja(o);return{index:e,role:"tool",kind:"tool_result",text:s.text,hasBinary:s.hasBinary}}if(n==="reasoning"){let o=Array.isArray(r.summary)?r.summary.map(s=>s?.text??"").join(`
|
|
61
|
-
`):"";return{index:e,role:"assistant",kind:"assistant",text:o,hasBinary:!1}}return up(r,e)}function Ev(t){if(typeof t!="string")if(t!==null&&typeof t=="object")try{t=JSON.stringify(t)}catch{return ap("")}else t=t==null?"":String(t);let e;try{e=JSON.parse(t)}catch(l){return ap(t,l)}if(e===null||typeof e!="object")return ap(t);if(Array.isArray(e)){let l=e.length===0||e.some(d=>d&&typeof d=="object"&&("role"in d||"parts"in d));return e.length>0&&e.every(d=>d&&typeof d=="object"&&Array.isArray(d.parts))?{sourceFormat:"gemini",messages:e.map((d,m)=>cp(d,m))}:{sourceFormat:"array",parseWarning:l?void 0:"This is a JSON array, but no element has a `role` field \u2014 it does not look like a conversation.",messages:e.map((d,m)=>up(d,m))}}let r=e,n=typeof r.model=="string"&&r.model?r.model:void 0;if(r.messages==null&&Array.isArray(r.contents)){let l=[],d=r.systemInstruction??r.system_instruction;if(d!=null){let m=typeof d=="string"?{text:d,hasBinary:!1}:cp(d,-1);l.push({index:-1,role:"system",kind:"system",text:m.text,hasBinary:m.hasBinary})}return l.push(...r.contents.map((m,p)=>cp(m,p))),{sourceFormat:"gemini",messages:l,model:n}}if(r.messages==null&&(typeof r.input=="string"||Array.isArray(r.input))){let l=[];typeof r.instructions=="string"&&r.instructions&&l.push({index:-1,role:"system",kind:"system",text:r.instructions,hasBinary:!1});let d=typeof r.input=="string"?[r.input]:r.input;return l.push(...d.map((m,p)=>ZO(m,p))),{sourceFormat:"responses",messages:l,model:n}}let o=r.messages,s=Array.isArray(o)?o:[],i=o!=null&&!Array.isArray(o),a=[];if(r.system!=null){let l=ja(r.system);a.push({index:-1,role:"system",kind:"system",text:l.text,hasBinary:l.hasBinary})}a.push(...s.map((l,d)=>up(l,d)));let c=r.system!=null||s.some(l=>Array.isArray(l?.content)&&l.content.some(d=>d?.type==="tool_use"||d?.type==="tool_result")),u=i?`\`messages\` is a ${typeof o}, not an array \u2014 this file is malformed.`:a.length===0?'This JSON has no `messages` array (and no `system`) \u2014 it does not look like a conversation. Expected {"messages":[{"role":\u2026,"content":\u2026}]}.':void 0;return{sourceFormat:c?"anthropic":"openai",parseWarning:u,messages:a,model:n}}import{createHash as gA}from"node:crypto";var zv=[[/claude.*haiku/i,2e5],[/claude.*(fable|mythos)|claude.*opus-?(5|4-[678])|claude.*sonnet-?(5|4-6)/i,1e6],[/claude.*sonnet|claude.*opus|claude-\d/i,2e5],[/gpt-5/i,4e5],[/gpt-4o|gpt-4-turbo|gpt-4\.1|o[134](-|$)/i,128e3],[/gpt-4(?!o|\.|-turbo)/i,8192],[/gpt-3\.5/i,16385],[/gemini.*(1\.5|2\.|2-5)/i,1e6],[/gemini-?3/i,1048576],[/llama.*3/i,128e3],[/mistral|mixtral/i,32e3]],Lq=Math.max(...zv.map(([,t])=>t));function Za(t){if(t){for(let[e,r]of zv)if(e.test(t))return r}}function Mr(t){return t?/claude/i.test(t)?"anthropic":/gpt|^o\d/i.test(t)?"openai":/gemini/i.test(t)?"google":"generic":"generic"}function DO(t){return t.length===0?0:(t.match(/[{}[\]()<>;:=_\/\\|"'`#$%&*+^~-]/g)?.length??0)/t.length}var Os={anthropic:{prose:2.75,code:2.4},openai:{prose:4,code:3.2},google:{prose:4,code:3.2},generic:{prose:4,code:3.2}};function Rv(t){return DO(t)>.08}function lp(t,e){let r=Os[Mr(e)];return Rv(t)?r.code:r.prose}function At(t,e){return typeof t!="string"&&(t=String(t??"")),t?LO(t.length,Rv(t),e):0}function LO(t,e,r){if(!(t>0))return 0;let n=Os[Mr(r)];return Math.ceil(t/(e?n.code:n.prose))}var dp=4;function R(t){if(!Number.isFinite(t))return"0";if(t<0)return`-${R(-t)}`;let e=Math.round(t);if(e<1e3)return String(e);let r=Math.round(e/100);if(r<100)return`${(r/10).toFixed(1)}k`;let n=Math.round(e/1e3);if(n<1e3)return`${n}k`;let o=Math.round(e/1e5);return o<1e4?`${(o/10).toFixed(1)}M`:`${(Math.round(e/1e8)/10).toFixed(1)}B`}import{homedir as fp}from"node:os";import{join as Pv,resolve as qO}from"node:path";function Cv(t,e){if(t!==void 0&&t!==fp())return;let r=e.CLAUDE_CONFIG_DIR?.trim();return r?qO(r):void 0}function It(t,e=process.env){return Cv(t,e)??Pv(t??fp(),".claude")}function pp(t,e=process.env){return Pv(Cv(t,e)??t??fp(),".claude.json")}var Vq=Symbol("absent");var Jq=new Int32Array(new SharedArrayBuffer(4));var T=(t,e,r)=>({inputPerM:t,outputPerM:e,cacheReadPerM:r});function Ce(t,e,r){return r===void 0?new RegExp(`claude-(?:${t})-${e}(?![.\\d]|-\\d{1,2}(?!\\d))`,"i"):new RegExp(`claude-(?:${t})-${e}[-.]${r}(?!\\d)`,"i")}var Da=[/claude.*fable|claude.*mythos/i,/claude.*opus/i,/claude.*sonnet/i,/claude.*haiku/i],Ov=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function te(t){return new RegExp(`(?<![\\w.-])${Ov(t)}(?:-\\d{4}-\\d{2}-\\d{2})?(?![\\w.-])`,"i")}function Gt(t){return new RegExp(`(?<![\\w.-])${Ov(t)}(?![\\w.])(?!-(?:[\\w.]+-)*(?:lite|image|tts|live|audio|transcribe|translate)\\b)`,"i")}var Ge={fallback:!0},Nt={geo:!0},mp=t=>({over:272e3,rates:T(t.inputPerM*2,t.outputPerM*1.5,t.cacheReadPerM*2)}),vt=(t,e,r)=>{let n=T(t,e,r);return[n,{long:mp(n)}]},FO=[[Ce("fable|mythos",5,2),T(8,40,.2),{geo:!0,fast:T(16,80,.4)}],[Ce("fable|mythos",5,1),T(10,50,.25),Nt],[Ce("fable|mythos",5),T(10,50,1),Nt],[Ce("opus",5,5),T(4,20,.2),{geo:!0,fast:T(8,40,.4)}],[Ce("opus",5),T(5,25,.5),{geo:!0,fast:T(10,50,1)}],[Ce("opus",4,8),T(5,25,.5),{geo:!0,fast:T(10,50,1)}],[Ce("opus",4,7),T(5,25,.5),Nt],[Ce("opus",4,6),T(5,25,.5),Nt],[Ce("opus",4,5),T(5,25,.5)],[Ce("opus",4,1),T(15,75,1.5)],[Ce("opus",4),T(15,75,1.5)],[Ce("sonnet",5,5),T(2,10,.1),Nt],[Ce("sonnet",5),T(2,10,.2),Nt],[Ce("haiku",5,5),T(.1,.5,.01),{geo:!0,long:{over:1e5,rates:T(.5,2.5,.05)}}],[Ce("haiku",4,5),T(1,5,.1)],[Ce("sonnet",4,6),T(3,15,.3),Nt],[Ce("sonnet",4,5),T(3,15,.3)],[Ce("sonnet",4),T(3,15,.3)],[/claude-3-opus/i,T(15,75,1.5)],[/claude-3-5-haiku/i,T(.8,4,.08)],[/claude-3-haiku/i,T(.25,1.25,.03)],[/claude-3-[57]-sonnet/i,T(3,15,.3)],[Da[0],T(10,50,1),{...Ge,...Nt}],[Da[1],T(5,25,.5),{...Ge,...Nt}],[Da[2],T(3,15,.3),{...Ge,...Nt}],[Da[3],T(1,5,.1),{...Ge,...Nt}],[te("gpt-6-astra"),...vt(10,50,1)],[te("gpt-6-astra-law"),T(10,50,1)],[te("gpt-6.1-sol"),...vt(2,10,.1)],[te("gpt-6.1-terra"),...vt(1,5,.05)],[te("gpt-6-sol"),...vt(2,10,.2)],[te("gpt-6-luna"),...vt(.1,.5,.01)],[te("gpt-6-cyber"),T(20,100,2)],[te("gpt-6-rosalind"),...vt(15,75,1.5)],[te("gpt-rosalind-research"),T(5,25,.5)],[te("gpt-rosalind-discovery"),T(5,25,.5)],[te("gpt-5.6-sol"),T(4,20,.4),{long:mp(T(4,20,.4)),changes:"2026-12-01"}],[te("gpt-5.6"),T(4,20,.4),{long:mp(T(4,20,.4)),changes:"2026-12-01"}],[te("gpt-5.6-terra"),...vt(2,12,.2)],[te("gpt-5.6-luna"),...vt(.2,1.2,.02)],[te("gpt-5.6-cyber"),T(12.5,75,1.25)],[te("gpt-5.5"),...vt(5,30,.5)],[te("gpt-5.5-pro"),...vt(30,180,30)],[te("gpt-5.5-cyber"),T(12.5,75,1.25)],[te("gpt-5.4"),...vt(2.5,15,.25)],[te("gpt-5.4-mini"),T(.75,4.5,.075)],[te("gpt-5.4-nano"),T(.2,1.25,.02)],[te("gpt-5.4-pro"),...vt(30,180,30)],[te("gpt-5.3-codex"),T(1.75,14,.175)],[te("gpt-5.2"),T(1.75,14,.175)],[te("gpt-5.2-pro"),T(21,168,21)],[te("gpt-5.1"),T(1.25,10,.125)],[te("gpt-5"),T(1.25,10,.125)],[te("gpt-5-mini"),T(.25,2,.025)],[te("gpt-5-nano"),T(.05,.4,.005)],[te("gpt-5-pro"),T(15,120,15)],[te("gpt-4.1"),T(2,8,.5)],[te("gpt-4.1-mini"),T(.4,1.6,.1)],[te("gpt-4o"),T(2.5,10,1.25)],[te("gpt-4o-mini"),T(.15,.6,.075)],[te("o3"),T(2,8,.5)],[te("o3-pro"),T(20,80,20)],[te("chat-latest"),T(5,30,.5)],[/gpt-5.*(mini|nano)/i,T(.25,2,.025),Ge],[/gpt-5/i,T(1.25,10,.125),Ge],[/gpt-4o-mini/i,T(.15,.6,.075),Ge],[/gpt-4o|gpt-4\.1/i,T(2.5,10,1.25),Ge],[/gpt-4-turbo/i,T(10,30,10),Ge],[/o[13](-|$)/i,T(2,8,1),Ge],[Gt("gemini-4-argon"),T(2,10,.1),{changes:"2026-12-01",then:T(4,20,.2)}],[Gt("gemini-3.8-flash"),T(.75,3.75,.075),{changes:"2027-01-01",then:T(1.5,7.5,.15)}],[Gt("gemini-3.6-flash"),T(.75,3.75,.075),{changes:"2027-01-01",then:T(1.5,7.5,.15)}],[Gt("gemini-3.5-flash-lite"),T(.3,2.5,.03)],[Gt("gemini-3.1-flash-lite"),T(.25,1.5,.025)],[Gt("gemini-3.1-pro"),T(2,12,.2),{long:{over:2e5,rates:T(4,18,.4)}}],[Gt("gemini-3-flash"),T(.5,3,.05)],[Gt("gemini-2.5-pro"),T(1.25,10,.125),{long:{over:2e5,rates:T(2.5,15,.25)},changes:"2026-12-01",then:T(.75,3.75,.075),routes:"gemini-3.8-flash"}],[Gt("gemini-2.5-flash"),T(.3,2.5,.03)],[Gt("gemini-2.5-flash-lite"),T(.1,.4,.01)],[/gemini-3[.\d]*-flash-lite/i,T(.3,2.5,.03),Ge],[/gemini-3[.\d]*-flash/i,T(.75,3.75,.075),Ge],[/gemini-3[.\d]*-pro/i,T(2,12,.2),Ge],[/gemini.*flash/i,T(.1,.4,.025),Ge],[/gemini.*pro/i,T(1.25,5,.31),Ge]];function HO(t){if(t)return FO.find(([e])=>e.test(t))}function go(t){return HO(t)?.[1]}function jr(t,e){return t/1e6*e.inputPerM}var i9=10/1e3;var a9=Object.freeze({fastUsd:0,geoUsd:0,longUsd:0,webSearchUsd:0,webSearches:0});function hp(t){return t/25e3}function Kt(t){return Number.isFinite(t)?t>=1?`$${t.toFixed(2)}`:t>=.01?`$${t.toFixed(3)}`:`$${t.toFixed(4)}`:"$0.00"}var Av=/(?:data:[\w/+.-]+;base64,)?[A-Za-z0-9+/]{500,}={0,2}/g,BO="[context-doctor: base64 blob removed \u2014 use file/image APIs instead]";function Iv(t){if(t.startsWith("data:"))return!0;let e=new Map;for(let n of t)e.set(n,(e.get(n)??0)+1);if(e.size<24)return!1;let r=0;for(let n of e.values())n>r&&(r=n);return r/t.length<.35}function yo(t){for(let e of t.matchAll(Av))if(Iv(e[0]))return!0;return!1}function gp(t){return t.replace(Av,e=>Iv(e)?BO:e)}import{mkdirSync as g9,readFileSync as aA,writeFileSync as y9}from"node:fs";import{dirname as cA,join as uA}from"node:path";import{appendFileSync as VO,existsSync as yp,mkdirSync as JO,readFileSync as WO,statSync as GO,writeFileSync as KO}from"node:fs";import{homedir as Nv}from"node:os";import{dirname as jv,join as _o}from"node:path";var XO={optimizeSaved:0,optimizeUsd:0,proxySaved:0,proxyUsd:0,proxyRequests:0,checks:0,warnings:0,shrinkage:0};function YO(t){let e={...XO},r=new Map;for(let n of t){if(n.ev==="rollup"&&n.carried){e.optimizeSaved+=n.carried.optimizeSaved,e.optimizeUsd+=n.carried.optimizeUsd,e.proxySaved+=n.carried.proxySaved,e.proxyUsd+=n.carried.proxyUsd,e.proxyRequests+=n.carried.proxyRequests,e.checks+=n.carried.checks,e.warnings+=n.carried.warnings,e.shrinkage+=n.carried.shrinkage,n.carried.since&&(e.since=Math.min(e.since??n.carried.since,n.carried.since));continue}e.since=Math.min(e.since??n.ts,n.ts),n.ev==="optimize"?(e.optimizeSaved+=n.saved??0,e.optimizeUsd+=n.usd??0):n.ev==="proxy"?(e.proxySaved+=n.saved??0,e.proxyUsd+=n.usd??0,e.proxyRequests+=n.requests??0):(n.ev==="check"||n.ev===void 0)&&n.sid!=="doctor-probe"&&(e.checks++,n.warn&&e.warnings++,n.sid&&n.sid!=="mcp-sketch"&&typeof n.tok=="number"&&r.set(n.sid,[...r.get(n.sid)??[],n.tok]))}for(let n of r.values())for(let o=1;o<n.length;o++)n[o]<n[o-1]&&(e.shrinkage+=n[o-1]-n[o]);return e}function QO(){let t=process.env.XDG_STATE_HOME?.trim();return t?_o(t,"context-doctor"):process.platform==="win32"?_o(process.env.LOCALAPPDATA?.trim()||_o(Nv(),"AppData","Local"),"context-doctor"):_o(Nv(),".local","state","context-doctor")}function eA(){let t=QO();if(yp(t))return t;let e=It();return yp(e)?e:t}function _p(){return process.env.CONTEXT_DOCTOR_HOOK_STATE??_o(eA(),".context-doctor-hook-state.json")}function tA(){return _o(jv(_p()),".context-doctor-ledger.jsonl")}var Mv=100,rA=256*1024,nA=128*1024,oA=500,sA=4*1024;function iA(t){if(typeof t!="string")return;let e=t.replace(/[\u0000-\u001f\u007f-\u009f]/g,"");return e.length>Mv?e.slice(0,Mv):e}function La(t){let e=tA();try{if(JO(jv(e),{recursive:!0}),yp(e)&&GO(e).size>rA){let n=WO(e,"utf8").trimEnd().split(`
|
|
62
|
-
`),o=d=>{try{return[JSON.parse(d)]}catch{return[]}},s=new Set,i=0;for(let d=n.length-1;d>=0&&s.size<oA;d--){let m=Buffer.byteLength(n[d])+1;if(!(m>sA)){if(i+m>nA)break;s.add(d),i+=m}}let a=n.filter((d,m)=>s.has(m)),c=n.filter((d,m)=>!s.has(m)).flatMap(o),u=YO(c),l={ts:Date.now(),ev:"rollup",carried:u};KO(e,[JSON.stringify(l),...a].join(`
|
|
97
|
+
`),e.enqueue(t.encode(i))}async handleGetRequest(e){if(!e.headers.get("accept")?.includes("text/event-stream"))return this.onerror?.(new Error("Not Acceptable: Client must accept text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept text/event-stream");let t=this.validateSession(e);if(t)return t;let r=this.validateProtocolVersion(e);if(r)return r;if(this._eventStore){let c=e.headers.get("last-event-id");if(c)return this.replayEvents(c)}if(this._streamMapping.get(this._standaloneSseStreamId)!==void 0)return this.onerror?.(new Error("Conflict: Only one SSE stream is allowed per session")),this.createJsonErrorResponse(409,-32e3,"Conflict: Only one SSE stream is allowed per session");let o=new TextEncoder,n,i,a=new ReadableStream({start:c=>{n=c},cancel:()=>{i!==void 0&&clearInterval(i),this._streamMapping.get(this._standaloneSseStreamId)?.controller===n&&this._streamMapping.delete(this._standaloneSseStreamId)}}),s={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};return this.sessionId!==void 0&&(s["mcp-session-id"]=this.sessionId),this._streamMapping.set(this._standaloneSseStreamId,{controller:n,encoder:o,cleanup:()=>{i!==void 0&&clearInterval(i),this._streamMapping.delete(this._standaloneSseStreamId);try{n.close()}catch{}}}),i=this.startKeepAlive(n,o),new Response(a,{headers:s})}async replayEvents(e){if(!this._eventStore)return this.onerror?.(new Error("Event store not configured")),this.createJsonErrorResponse(400,-32e3,"Event store not configured");try{let t;if(this._eventStore.getStreamIdForEventId){if(t=await this._eventStore.getStreamIdForEventId(e),!t)return this.onerror?.(new Error("Invalid event ID format")),this.createJsonErrorResponse(400,-32e3,"Invalid event ID format");if(this._streamMapping.get(t)!==void 0)return this.onerror?.(new Error("Conflict: Stream already has an active connection")),this.createJsonErrorResponse(409,-32e3,"Conflict: Stream already has an active connection")}let r={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};this.sessionId!==void 0&&(r["mcp-session-id"]=this.sessionId);let o=new TextEncoder,n,i,a=!1,s,c=new ReadableStream({start:u=>{n=u},cancel:()=>{a=!0,i!==void 0&&clearInterval(i),s!==void 0&&this._streamMapping.get(s)?.controller===n&&this._streamMapping.delete(s)}}),l=new Set;if(s=await this._eventStore.replayEventsAfter(e,{send:async(u,d)=>{if(l.add(u),!this.writeSSEEvent(n,o,d,u))try{n.close()}catch{}}}),this._closed||a){try{n.close()}catch{}return this.createJsonErrorResponse(404,-32001,"Session not found")}if(this._streamMapping.get(s)?.cleanup(),this._streamMapping.set(s,{controller:n,encoder:o,replayedEventIds:l,cleanup:()=>{i!==void 0&&clearInterval(i),this._streamMapping.delete(s);try{n.close()}catch{}}}),s!==this._standaloneSseStreamId&&![...this._requestToStreamMapping.values()].includes(s)){this._streamMapping.delete(s);try{n.close()}catch{}}return this._streamMapping.get(s)?.controller===n&&(i=this.startKeepAlive(n,o)),new Response(c,{headers:r})}catch(t){return this.onerror?.(t),this.createJsonErrorResponse(500,-32e3,"Error replaying events")}}writeSSEEvent(e,t,r,o){try{let n=`event: message
|
|
98
|
+
`;return o&&(n+=`id: ${o}
|
|
99
|
+
`),n+=`data: ${JSON.stringify(r)}
|
|
100
|
+
|
|
101
|
+
`,e.enqueue(t.encode(n)),!0}catch(n){return this.onerror?.(n),!1}}handleUnsupportedRequest(){return this.onerror?.(new Error("Method not allowed.")),Response.json({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null},{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest(e,t){try{let r=e.headers.get("accept");if(!r?.includes("application/json")||!r.includes("text/event-stream"))return this.onerror?.(new Error("Not Acceptable: Client must accept both application/json and text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept both application/json and text/event-stream");if(!cf(e.headers.get("content-type")))return this.onerror?.(new Error("Unsupported Media Type: Content-Type must be application/json")),this.createJsonErrorResponse(415,-32e3,"Unsupported Media Type: Content-Type must be application/json");let o=e,n;if(t?.parsedBody===void 0)try{let v=await sb(e,this._maxRequestBodySize);if(v.tooLarge){let p=zx(this._maxRequestBodySize);return this.onerror?.(new Error(p)),this.createJsonErrorResponse(413,-32e3,p)}n=JSON.parse(v.text)}catch(v){return this.onerror?.(v),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}else n=t.parsedBody;if(Array.isArray(n)&&n.length>ib)return this.onerror?.(new Error(`Invalid Request: Batch must not exceed ${ib} messages`)),this.createJsonErrorResponse(400,-32600,`Invalid Request: Batch must not exceed ${ib} messages`);let i;try{i=Array.isArray(n)?n.map(v=>$r.parse(v)):[$r.parse(n)]}catch(v){return this.onerror?.(v),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");let a=i.some(v=>Xm(v));if(a){if(this._initialized&&this.sessionId!==void 0)return this.onerror?.(new Error("Invalid Request: Server already initialized")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(i.length>1)return this.onerror?.(new Error("Invalid Request: Only one initialization request is allowed")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized&&await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!a){let v=this.validateSession(e);if(v)return v;let p=this.validateProtocolVersion(e);if(p)return p}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");let s;try{s=await this._checkScopeChallenge(i,t?.authInfo)}catch(v){return this.onerror?.(v),this.createJsonErrorResponse(500,-32603,"Internal server error")}if(s)return s;if(!i.some(v=>et(v))){for(let v of i)this.onmessage?.(v,{authInfo:t?.authInfo,request:o});return new Response(null,{status:202})}let c=crypto.randomUUID(),l=i.find(v=>Xm(v)),u=l?l.params.protocolVersion:e.headers.get("mcp-protocol-version")??ws;if(this._enableJsonResponse)return new Promise(v=>{this._streamMapping.set(c,{resolveJson:v,cleanup:()=>{this._streamMapping.delete(c)}});for(let p of i)et(p)&&this._requestToStreamMapping.set(p.id,c);for(let p of i)this.onmessage?.(p,{authInfo:t?.authInfo,request:o})});let d=new TextEncoder,m,f,h=new ReadableStream({start:v=>{m=v},cancel:()=>{f!==void 0&&clearInterval(f),this._streamMapping.get(c)?.controller===m&&this._streamMapping.delete(c)}}),y={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};this.sessionId!==void 0&&(y["mcp-session-id"]=this.sessionId);for(let v of i)et(v)&&(this._streamMapping.set(c,{controller:m,encoder:d,cleanup:()=>{f!==void 0&&clearInterval(f),this._streamMapping.delete(c);try{m.close()}catch{}}}),this._requestToStreamMapping.set(v.id,c));await this.writePrimingEvent(m,d,c,u);for(let v of i){let p,b;et(v)&&this._eventStore&&this.supportsEmptySSEData(u)&&(p=()=>{this.closeSSEStream(v.id)},b=()=>{this.closeStandaloneSSEStream()}),this.onmessage?.(v,{authInfo:t?.authInfo,request:o,closeSSEStream:p,closeStandaloneSSEStream:b})}return this._streamMapping.get(c)?.controller===m&&(f=this.startKeepAlive(m,d)),new Response(h,{status:200,headers:y})}catch(r){return this.onerror?.(r),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(r)})}}async handleDeleteRequest(e){let t=this.validateSession(e);if(t)return t;let r=this.validateProtocolVersion(e);if(r)return r;try{return await Promise.resolve(this._onsessionclosed?.(this.sessionId)),new Response(null,{status:200})}finally{await this.close()}}validateSession(e){if(this.sessionIdGenerator===void 0)return;if(!this._initialized)return this.onerror?.(new Error("Bad Request: Server not initialized")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Server not initialized");let t=e.headers.get("mcp-session-id");if(!t)return this.onerror?.(new Error("Bad Request: Mcp-Session-Id header is required")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Mcp-Session-Id header is required");if(t!==this.sessionId)return this.onerror?.(new Error("Session not found")),this.createJsonErrorResponse(404,-32001,"Session not found")}validateProtocolVersion(e){let t=e.headers.get("mcp-protocol-version");if(t!==null&&!this._supportedProtocolVersions.includes(t)){let r=`Bad Request: Unsupported protocol version: ${t} (supported versions: ${this._supportedProtocolVersions.join(", ")})`;return this.onerror?.(new Error(r)),this.createJsonErrorResponse(400,-32e3,r)}}async close(){if(!this._closed){this._closed=!0;for(let{cleanup:e}of this._streamMapping.values())e();this._streamMapping.clear(),this._requestResponseMap.clear(),this.onclose?.()}}closeSSEStream(e){let t=this._requestToStreamMapping.get(e);if(!t)return;let r=this._streamMapping.get(t);r&&r.cleanup()}closeStandaloneSSEStream(){let e=this._streamMapping.get(this._standaloneSseStreamId);e&&e.cleanup()}async send(e,t){let r=t?.relatedRequestId;if((Lt(e)||Vt(e))&&(r=e.id),r===void 0){if(Lt(e)||Vt(e))throw new Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let i;this._eventStore&&(i=await this._eventStore.storeEvent(this._standaloneSseStreamId,e));let a=this._streamMapping.get(this._standaloneSseStreamId);if(a===void 0)return;a.controller&&a.encoder&&(i===void 0||!a.replayedEventIds?.has(i))&&this.writeSSEEvent(a.controller,a.encoder,e,i);return}let o=this._requestToStreamMapping.get(r);if(!o)throw new Error(`No connection established for request ID: ${String(r)}`);let n=this._streamMapping.get(o);if(!this._enableJsonResponse){let i;this._eventStore&&(i=await this._eventStore.storeEvent(o,e),n=this._streamMapping.get(o)),n?.controller&&n?.encoder&&(i===void 0||!n.replayedEventIds?.has(i))&&this.writeSSEEvent(n.controller,n.encoder,e,i)}if(Lt(e)||Vt(e)){this._requestResponseMap.set(r,e);let i=[...this._requestToStreamMapping.entries()].filter(([a,s])=>s===o).map(([a])=>a);if(i.every(a=>this._requestResponseMap.has(a))){if(!n){if(this._enableJsonResponse)throw new Error(`No connection established for request ID: ${String(r)}`);if(!this._eventStore){this.onerror?.(new Error(`Response for request ID ${String(r)} is undeliverable: per-request stream is disconnected and no eventStore is configured`));for(let a of i)this._requestResponseMap.delete(a),this._requestToStreamMapping.delete(a);return}for(let a of i)this._requestResponseMap.delete(a),this._requestToStreamMapping.delete(a);return}if(this._enableJsonResponse&&n.resolveJson){let a={"Content-Type":"application/json"};this.sessionId!==void 0&&(a["mcp-session-id"]=this.sessionId);let s=i.map(c=>this._requestResponseMap.get(c));s.length===1?n.resolveJson(Response.json(s[0],{status:200,headers:a})):n.resolveJson(Response.json(s,{status:200,headers:a})),n.cleanup()}else n.cleanup();for(let a of i)this._requestResponseMap.delete(a),this._requestToStreamMapping.delete(a)}}}};Ef="v1."});var IT={};an(IT,{findEmbeddingModel:()=>RT,ollamaUrl:()=>Tb,semanticRerank:()=>UU});import{createHash as xU}from"node:crypto";import{existsSync as TU,mkdirSync as PU,readFileSync as EU,writeFileSync as CU}from"node:fs";import{homedir as OU}from"node:os";import{join as xb}from"node:path";function Tb(e=process.env.OLLAMA_HOST){let t=(e??"").trim(),r="http",o="11434",n=t.indexOf("://");n>=0&&(r=t.slice(0,n),t=t.slice(n+3),r==="http"?o="80":r==="https"&&(o="443"));let i=t.indexOf("/"),a=i>=0?t.slice(i).replace(/\/+$/,""):"",s=i>=0?t.slice(0,i):t,c=/^(\[[^\]]*\]|[^:]*):([^:]*)$/.exec(s);return c?(s=c[1],/^\d+$/.test(c[2])&&Number(c[2])<=65535&&(o=c[2])):s.includes(":")&&!s.startsWith("[")&&(s=`[${s}]`),!s||s==="0.0.0.0"?s="127.0.0.1":s==="[::]"&&(s="[::1]"),`${r}://${s}:${o}${a}`}async function zT(e,t,r=6e4){let o=await fetch(Tb()+e,{method:t?"POST":"GET",headers:t?{"content-type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0,signal:AbortSignal.timeout(r)});if(!o.ok)throw new Error(`${e}: HTTP ${o.status}`);return o.json()}async function RT(e){let r=((await zT("/api/tags",void 0,2e3)).models??[]).map(o=>String(o.name));return e?r.find(o=>o===e||o.startsWith(e+":"))??e:r.find(o=>NU.test(o))}function Vf(){return xb(process.env.XDG_CACHE_HOME??xb(OU(),".cache"),"context-doctor","embeddings.json")}function jU(){try{return TU(Vf())?JSON.parse(EU(Vf(),"utf8")):{}}catch{return{}}}function AU(e){try{let t=Object.keys(e);if(t.length>kT)for(let r of t.slice(0,t.length-kT))delete e[r];PU(xb(Vf(),".."),{recursive:!0}),CU(Vf(),JSON.stringify(e))}catch{}}async function MU(e,t){let r=[];for(let o=0;o<t.length;o+=wT){let n=await zT("/api/embed",{model:e,input:t.slice(o,o+wT),truncate:!0});r.push(...n.embeddings)}return r}function DU(e,t){let r=0,o=0,n=0;for(let i=0;i<e.length;i++)r+=e[i]*t[i],o+=e[i]*e[i],n+=t[i]*t[i];return o&&n?r/Math.sqrt(o*n):0}async function UU(e,t,r={}){let o;try{o=await RT(r.model)}catch{return{used:!1,note:`semantic ranking off: no Ollama at ${Tb()} (keyword ranking only)`}}if(!o)return{used:!1,note:"semantic ranking off: Ollama has no embedding model; run `ollama pull nomic-embed-text` (keyword ranking only)"};let n=jU(),i=h=>xU("sha1").update(o+"\0"+h).digest("hex"),a=e.map(h=>(h.heading?h.heading+`
|
|
102
|
+
`:"")+h.text),s=[...new Set(a.filter(h=>!n[i(h)]))],c,l;try{let h=await MU(o,[t,...s]);l=h[0],s.forEach((y,v)=>n[i(y)]=h[v+1]),c=a.map(y=>n[i(y)])}catch(h){return{used:!1,model:o,note:`semantic ranking off: ${o} failed (${h.message}); keyword ranking only`}}s.length&&AU(n);let u=60,d=new Map([...e].filter(h=>h.score>0).sort((h,y)=>y.score-h.score).map((h,y)=>[h,y])),m=e.map((h,y)=>({c:h,s:DU(l,c[y])})).sort((h,y)=>y.s-h.s),f=new Map(m.map((h,y)=>[h.c,y]));for(let h of e){let y=d.get(h);h.score=(y===void 0?0:1/(u+y))+1/(u+f.get(h))}return{used:!0,model:o,note:`semantic ranking: ${o}, ${s.length} of ${a.length} chunks embedded (rest cached)`}}var NU,wT,kT,xT=G(()=>{"use strict";NU=/embed|bge|e5-|gte|minilm|nomic|mxbai|arctic|snowflake/i,wT=64,kT=5e4});cb();xf();lc();ob();_f();var Ox=Symbol("swallowsErrorsAfterClose"),sD=class{_readBuffer;_started=!1;_closed=!1;constructor(e=K$.stdin,t=K$.stdout,r){this._stdin=e,this._stdout=t,this._readBuffer=new lf({maxBufferSize:r?.maxBufferSize})}onclose;onerror;onmessage;_ondata=e=>{try{this._readBuffer.append(e),this.processReadBuffer()}catch(t){this.onerror?.(t),this.close().catch(()=>{})}};_onerror=e=>{this.onerror?.(e)};_onstdouterror=e=>{this._closed||(this.onerror?.(e),this.close().catch(()=>{}))};_onstdinclose=()=>{this.close().catch(()=>{})};async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0;for(let e of this._stdout.listeners("error"))e[Ox]&&this._stdout.off("error",e);(this._stdin.readableEnded||this._stdin.destroyed)&&setImmediate(this._onstdinclose),this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdin.on("end",this._onstdinclose),this._stdin.on("close",this._onstdinclose),this._stdout.on("error",this._onstdouterror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._closed||(this._closed=!0,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.off("end",this._onstdinclose),this._stdin.off("close",this._onstdinclose),this._onstdouterror[Ox]=!0,this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.())}send(e){return this._closed?Promise.reject(new Error("StdioServerTransport is closed")):new Promise((t,r)=>{let o=uf(e),n=!1,i=s=>{n||(n=!0,this._stdout.off("error",i),this._stdout.off("drain",a),r(s))},a=()=>{n||(n=!0,this._stdout.off("error",i),this._stdout.off("drain",a),t())};if(this._stdout.once("error",i),this._stdout.write(o)){if(n)return;n=!0,this._stdout.off("error",i),t()}else n||this._stdout.once("drain",a)})}},Nx=3e3,cD=class{onclose;onerror;onmessage;_closed=!1;_pendingRequests=new Set;_drainWaiters=[];constructor(e,t,r){this._wire=e,this._onInstanceClose=t,this._outboundIntercept=r}async start(){}async send(e,t){if(Lt(e)||Vt(e)){let{id:r}=e;r!==void 0&&this._settle(r)}if(!this._closed&&this._outboundIntercept?.(e)!=="handled")return this._wire.send(e,t)}setProtocolVersion=e=>{this._wire.setProtocolVersion?.(e)};deliver(e,t){if(!this._closed){if(et(e))this._pendingRequests.add(e.id);else if(pn(e)&&e.method==="notifications/cancelled"){let r=e.params?.requestId;r!==void 0&&this._settle(r)}this.onmessage?.(e,t)}}async whenRequestsAnswered(e){return this._closed||this._pendingRequests.size===0?!0:await new Promise(t=>{let r=()=>{clearTimeout(o),t(!0)},o=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter(n=>n!==r),t(!1)},e);this._drainWaiters.push(r)})}async close(){if(!this._closed){this._closed=!0,this._pendingRequests.clear(),this._releaseDrainWaiters();try{this._onInstanceClose()}finally{this.onclose?.()}}}_settle(e){this._pendingRequests.delete(e),this._pendingRequests.size===0&&this._releaseDrainWaiters()}_releaseDrainWaiters(){let e=this._drainWaiters;this._drainWaiters=[];for(let t of e)t()}};function lD(e){let t=e.params;if(e.method==="initialize"&&!tf(t)){let i=t!==null&&typeof t=="object"&&typeof t.protocolVersion=="string"?t.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...i!==void 0&&{requestedVersion:i}}}if(!mo(t))return{kind:"legacy",reason:"no-claim"};let r=fn(t),o=(r===void 0?[]:uo(r))[0];if(o!==void 0)return{kind:"invalid-envelope",issue:o};let n=ji(t);return n===void 0||!Ct.includes(n)?{kind:"unsupported-revision",requested:n??"unknown"}:{kind:"modern",revision:n,classification:{era:"modern",revision:n}}}function jx(e,t={}){let r=t.legacy??"serve",o=t.transport??new sD,n={phase:"opening"},i,a=!1,s=()=>a||n.phase==="closed",c=z=>{try{t.onerror?.(z)}catch{}},l=(z,P,U,O)=>o.send({jsonrpc:"2.0",id:z,error:{code:P,message:U,...O!==void 0&&{data:O}}}).catch(D=>c(vn(D))),u=new Sx(t.maxSubscriptions??Ui),d=z=>{if(!pn(z))return;let P=u.routeOutbound(z);if(P!=="passthrough"){for(let U of P)o.send({jsonrpc:"2.0",...U}).catch(O=>c(vn(O)));return"handled"}},m=async z=>{if(et(z)&&z.method==="subscriptions/listen"){let P=fn(z.params),U=mo(z.params)?(P===void 0?[]:uo(P))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},O=ji(z.params),D;if(U!==void 0)D={jsonrpc:"2.0",id:z.id,error:{code:-32602,message:`Invalid _meta envelope: ${U.key}: ${U.problem}`}};else if(O===void 0||!Ct.includes(O)){let Y=new Ir({supported:[...Ct],requested:O??"unknown"});D={jsonrpc:"2.0",id:z.id,error:{code:Y.code,message:Y.message,data:Y.data}}}else D=u.serve(z);return await o.send("error"in D?D:{jsonrpc:"2.0",method:D.method,params:D.params}).catch(Y=>c(vn(Y))),!0}if(pn(z)&&z.method==="notifications/cancelled"){let P=z.params?.requestId;if(P!==void 0&&u.cancel(P))return!0}return!1},f=(z,P,U)=>{let O=nf({kind:"legacy",reason:P,...U!==void 0&&{requestedVersion:U}},Ct);return O===void 0?Promise.resolve():(c(new Error(`Rejected 2025-era request on a modern-only stdio connection (${O.cell}): ${O.message}`)),l(z.id,O.code,O.message,O.data))},h=z=>{a||z===i||R()},y=async(z,P)=>{let U=await e({era:z}),O=U instanceof Vn?U.server:U;z==="modern"&&(of(O,P),zf(O,Ct),u.setServerCapabilities(O.getCapabilities(),Rf(O)));let D=new cD(o,()=>h(D),z==="modern"?d:void 0);return await U.connect(D),{product:U,channel:D}},v=z=>z.product.close().catch(P=>c(vn(P))),p=async z=>{i=z.channel;try{await z.channel.whenRequestsAnswered(Nx)||c(new Error(`Discarded the probe instance with requests still unanswered after ${Nx}ms; continuing with the fallback`)),await z.product.close()}catch(P){c(vn(P))}finally{i=void 0}},b=async z=>{if(n.phase==="closed")return;if(n.phase==="pinned"){if(n.era==="modern"&&et(z)&&z.method==="initialize"&&!tf(z.params)){await f(z,"initialize",z.params!==null&&typeof z.params=="object"&&typeof z.params.protocolVersion=="string"?z.params.protocolVersion:void 0);return}if(n.era==="modern"&&await m(z)||s())return;n.instance.channel.deliver(z);return}if(!et(z)&&!pn(z)){c(new Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let P=lD(z);switch(P.kind){case"invalid-envelope":{let U=`Invalid _meta envelope for protocol revision 2026-07-28: ${P.issue.key}: ${P.issue.problem}`;et(z)?await l(z.id,Q.InvalidParams,U,{envelope:P.issue}):c(new Error(`Discarded a notification with a malformed envelope: ${U}`));return}case"unsupported-revision":if(et(z)){let U=new Ir({supported:[...Ct],requested:P.requested});c(U),await l(z.id,U.code,U.message,U.data)}else c(new Error(`Discarded a notification claiming unsupported protocol revision ${P.requested}`));return;case"modern":if(et(z)&&z.method==="server/discover"){if(n.phase==="probe"){n.instance.channel.deliver(z,{classification:P.classification});return}let U=await y("modern",P.revision);if(s()){await v(U);return}n={phase:"probe",instance:U},U.channel.deliver(z,{classification:P.classification});return}if(n.phase==="probe"){if(pn(z)){n.instance.channel.deliver(z,{classification:P.classification});return}n={phase:"pinned",era:"modern",instance:n.instance}}else{let U=await y("modern",P.revision);if(s()){await v(U);return}n={phase:"pinned",era:"modern",instance:U}}if(await m(z)||s())return;n.instance.channel.deliver(z,{classification:P.classification});return;case"legacy":{if(r==="reject"){et(z)&&await f(z,P.reason,P.requestedVersion);return}if(n.phase==="probe"){if(await p(n.instance),s())return;n={phase:"opening"}}let U=await y("legacy");if(s()){await v(U);return}n={phase:"pinned",era:"legacy",instance:U},n.instance.channel.deliver(z);return}}},g=[],S=!1,T=async()=>{if(!S){S=!0;try{for(;g.length>0;){let z=g.shift();try{await b(z)}catch(P){et(z)&&await l(z.id,Q.InternalError,"Internal server error"),c(vn(P))}}}finally{S=!1}}},R=async()=>{if(a||n.phase==="closed")return;a=!0;let z=n;n={phase:"closed"};for(let P of u.teardownAll())await o.send(P).catch(U=>c(vn(U)));(z.phase==="probe"||z.phase==="pinned")&&await z.instance.product.close().catch(P=>c(vn(P))),await o.close().catch(P=>c(vn(P)))};o.onmessage=z=>{g.push(z),T()},o.onerror=z=>{c(z),(n.phase==="probe"||n.phase==="pinned")&&n.instance.channel.onerror?.(z)},o.onclose=()=>{if(a||n.phase==="closed")return;a=!0;let z=n;n={phase:"closed"},(z.phase==="probe"||z.phase==="pinned")&&z.instance.product.close().catch(P=>c(vn(P)))};let w=o.start().catch(z=>{throw c(vn(z)),z});return w.catch(()=>{}),{close:async()=>{await w.catch(()=>{}),await R()}}}function vn(e){return e instanceof Error?e:new Error(String(e))}Ku();Ku();import{resolve as $2}from"node:path";function Nf(e){if(typeof e=="string")return{text:e,hasBinary:!1};if(e==null)return{text:"",hasBinary:!1};if(!Array.isArray(e))return{text:JSON.stringify(e??""),hasBinary:!1};let t="",r=!1,o,n,i="",a;for(let s of e){if(s==null||typeof s!="object"){t+=String(s??"");continue}let c=s;switch(c.type){case"text":case"input_text":case"output_text":t+=c.text??"";break;case"tool_use":{n="tool_call",o=c.name??o;let l=`[tool call: ${c.name}] ${JSON.stringify(c.input??{})}`;t+=l,i+=l;break}case"tool_result":{n="tool_result";let l=Nf(c.content);r=r||l.hasBinary,t+=l.text,c.is_error===!0&&(a=!0);break}case"image":case"document":r=!0,t+=`[${c.type}]`;break;case"image_url":case"input_image":r=!0,t+="[image]";break;case"input_audio":r=!0,t+="[audio]";break;case"file":case"input_file":r=!0,t+="[file]";break;case"thinking":t+=c.thinking??"";break;case"redacted_thinking":t+="[redacted thinking]";break;default:t+=JSON.stringify(c)}}return{text:t,hasBinary:r,toolName:o,kind:n,toolCallText:i||void 0,isError:a}}function db(e,t){let r=e&&typeof e=="object"?e:{},o=String(r.role??"user"),n=Nf(r.content),i=n.kind??(o==="developer"?"system":["system","user","assistant"].includes(o)?o:"other"),a=n.toolName,s=n.text,c=n.toolCallText;o==="tool"&&(i="tool_result");let l=r.tool_calls,u=Array.isArray(l)?l.filter(d=>d&&typeof d=="object"):void 0;if(u&&u.length>0){i="tool_call",a=u[0]?.function?.name??u[0]?.name;let d=u.map(m=>`[tool call: ${m.function?.name??m.name}] ${m.function?.arguments??JSON.stringify(m.input??{})}`).join(`
|
|
103
|
+
`);s+=d,c=(c??"")+d}return{index:t,role:o,kind:i,text:s,toolName:a,toolCallText:c,hasBinary:n.hasBinary,isError:n.isError}}function lb(e,t){let r=e.trimStart()[0];return{sourceFormat:"text",parseWarning:e.trim()===""?"Input is empty \u2014 nothing to profile.":t&&(r==="{"||r==="[")?`Input starts like JSON but does not parse (${t.message}), so it is not a conversation file.`:void 0,messages:e.trim()===""?[]:[{index:0,role:"user",kind:"user",text:e,hasBinary:!1}]}}function uD(e){if(typeof e=="string")return{text:e,hasBinary:!1};if(!e||typeof e!="object")return{text:"",hasBinary:!1};let t=e;if(typeof t.text=="string")return{text:t.text,hasBinary:!1};if(t.inlineData||t.fileData)return{text:"[file]",hasBinary:!0};if(t.functionCall){let r=`[tool call: ${t.functionCall.name}] ${JSON.stringify(t.functionCall.args??{})}`;return{text:r,hasBinary:!1,kind:"tool_call",toolName:t.functionCall.name,call:r}}if(t.functionResponse){let r=t.functionResponse.response;return{text:typeof r?.output=="string"?r.output:typeof r?.content=="string"?r.content:JSON.stringify(r??{}),hasBinary:!1,kind:"tool_result",toolName:t.functionResponse.name}}return t.executableCode?{text:String(t.executableCode.code??""),hasBinary:!1}:t.codeExecutionResult?{text:String(t.codeExecutionResult.output??""),hasBinary:!1}:{text:JSON.stringify(t),hasBinary:!1}}function ub(e,t){let r=e&&typeof e=="object"?e:{},o=r.role==="model"?"assistant":String(r.role??"user"),n=Array.isArray(r.parts)?r.parts:[],i="",a=!1,s,c,l="";for(let d of n){let m=uD(d);i+=(i&&m.text?`
|
|
104
|
+
`:"")+m.text,a||=m.hasBinary,m.kind&&(s=m.kind),c??=m.toolName,m.call&&(l+=m.call)}let u=["system","user","assistant"].includes(o)?o:"other";return{index:t,role:o,kind:s??u,text:i,toolName:c,toolCallText:l||void 0,hasBinary:a}}function dD(e,t){if(typeof e=="string")return{index:t,role:"user",kind:"user",text:e,hasBinary:!1};let r=e&&typeof e=="object"?e:{},o=r.type;if(o==="function_call"||o==="custom_tool_call"||o==="local_shell_call"){let n=r.name??(o==="local_shell_call"?"local_shell":void 0),i=typeof r.arguments=="string"?r.arguments:JSON.stringify(r.input??r.action??{}),a=`[tool call: ${n}] ${i}`;return{index:t,role:"assistant",kind:"tool_call",text:a,toolName:n,toolCallText:a,hasBinary:!1}}if(o==="function_call_output"||o==="custom_tool_call_output"||o==="local_shell_call_output"){let n=r.output,i=typeof n=="string"?{text:n,hasBinary:!1}:Nf(n);return{index:t,role:"tool",kind:"tool_result",text:i.text,hasBinary:i.hasBinary}}if(o==="reasoning"){let n=Array.isArray(r.summary)?r.summary.map(i=>i?.text??"").join(`
|
|
105
|
+
`):"";return{index:t,role:"assistant",kind:"assistant",text:n,hasBinary:!1}}return db(r,t)}function Ax(e){if(typeof e!="string")if(e!==null&&typeof e=="object")try{e=JSON.stringify(e)}catch{return lb("")}else e=e==null?"":String(e);let t;try{t=JSON.parse(e)}catch(u){return lb(e,u)}if(t===null||typeof t!="object")return lb(e);if(Array.isArray(t)){let u=t.length===0||t.some(d=>d&&typeof d=="object"&&("role"in d||"parts"in d));return t.length>0&&t.every(d=>d&&typeof d=="object"&&Array.isArray(d.parts))?{sourceFormat:"gemini",messages:t.map((d,m)=>ub(d,m))}:{sourceFormat:"array",parseWarning:u?void 0:"This is a JSON array, but no element has a `role` field \u2014 it does not look like a conversation.",messages:t.map((d,m)=>db(d,m))}}let r=t,o=typeof r.model=="string"&&r.model?r.model:void 0;if(r.messages==null&&Array.isArray(r.contents)){let u=[],d=r.systemInstruction??r.system_instruction;if(d!=null){let m=typeof d=="string"?{text:d,hasBinary:!1}:ub(d,-1);u.push({index:-1,role:"system",kind:"system",text:m.text,hasBinary:m.hasBinary})}return u.push(...r.contents.map((m,f)=>ub(m,f))),{sourceFormat:"gemini",messages:u,model:o}}if(r.messages==null&&(typeof r.input=="string"||Array.isArray(r.input))){let u=[];typeof r.instructions=="string"&&r.instructions&&u.push({index:-1,role:"system",kind:"system",text:r.instructions,hasBinary:!1});let d=typeof r.input=="string"?[r.input]:r.input;return u.push(...d.map((m,f)=>dD(m,f))),{sourceFormat:"responses",messages:u,model:o}}let n=r.messages,i=Array.isArray(n)?n:[],a=n!=null&&!Array.isArray(n),s=[];if(r.system!=null){let u=Nf(r.system);s.push({index:-1,role:"system",kind:"system",text:u.text,hasBinary:u.hasBinary})}s.push(...i.map((u,d)=>db(u,d)));let c=r.system!=null||i.some(u=>Array.isArray(u?.content)&&u.content.some(d=>d?.type==="tool_use"||d?.type==="tool_result")),l=a?`\`messages\` is a ${typeof n}, not an array \u2014 this file is malformed.`:s.length===0?'This JSON has no `messages` array (and no `system`) \u2014 it does not look like a conversation. Expected {"messages":[{"role":\u2026,"content":\u2026}]}.':void 0;return{sourceFormat:c?"anthropic":"openai",parseWarning:l,messages:s,model:o}}import{createHash as ZD}from"node:crypto";var Mx=[[/claude.*haiku/i,2e5],[/claude.*(fable|mythos)|claude.*opus-?(5|4-[678])|claude.*sonnet-?(5|4-6)/i,1e6],[/claude.*sonnet|claude.*opus|claude-\d/i,2e5],[/gpt-5/i,4e5],[/gpt-4o|gpt-4-turbo|gpt-4\.1|o[134](-|$)/i,128e3],[/gpt-4(?!o|\.|-turbo)/i,8192],[/gpt-3\.5/i,16385],[/gemini.*(1\.5|2\.|2-5)/i,1e6],[/gemini-?3/i,1048576],[/llama.*3/i,128e3],[/mistral|mixtral/i,32e3]],iZ=Math.max(...Mx.map(([,e])=>e));function jf(e){if(e){for(let[t,r]of Mx)if(t.test(e))return r}}function Tr(e){return e?/claude/i.test(e)?"anthropic":/gpt|^o\d/i.test(e)?"openai":/gemini/i.test(e)?"google":"generic":"generic"}function mD(e){return e.length===0?0:(e.match(/[{}[\]()<>;:=_\/\\|"'`#$%&*+^~-]/g)?.length??0)/e.length}var gc={anthropic:{prose:2.75,code:2.4},openai:{prose:4,code:3.2},google:{prose:4,code:3.2},generic:{prose:4,code:3.2}};function Dx(e){return mD(e)>.08}function mb(e,t){let r=gc[Tr(t)];return Dx(e)?r.code:r.prose}function yn(e,t){return typeof e!="string"&&(e=String(e??"")),e?fD(e.length,Dx(e),t):0}function fD(e,t,r){if(!(e>0))return 0;let o=gc[Tr(r)];return Math.ceil(e/(t?o.code:o.prose))}var fb=4;function ue(e){if(!Number.isFinite(e))return"0";if(e<0)return`-${ue(-e)}`;let t=Math.round(e);if(t<1e3)return String(t);let r=Math.round(t/100);if(r<100)return`${(r/10).toFixed(1)}k`;let o=Math.round(t/1e3);if(o<1e3)return`${o}k`;let n=Math.round(t/1e5);return n<1e4?`${(n/10).toFixed(1)}M`:`${(Math.round(t/1e8)/10).toFixed(1)}B`}import{homedir as pb}from"node:os";import{join as Ux,resolve as pD}from"node:path";function Lx(e,t){if(e!==void 0&&e!==pb())return;let r=t.CLAUDE_CONFIG_DIR?.trim();return r?pD(r):void 0}function Qt(e,t=process.env){return Lx(e,t)??Ux(e??pb(),".claude")}function hb(e,t=process.env){return Ux(Lx(e,t)??e??pb(),".claude.json")}var dZ=Symbol("absent");var mZ=new Int32Array(new SharedArrayBuffer(4));var ne=(e,t,r)=>({inputPerM:e,outputPerM:t,cacheReadPerM:r});function ct(e,t,r){return r===void 0?new RegExp(`claude-(?:${e})-${t}(?![.\\d]|-\\d{1,2}(?!\\d))`,"i"):new RegExp(`claude-(?:${e})-${t}[-.]${r}(?!\\d)`,"i")}var Af=[/claude.*fable|claude.*mythos/i,/claude.*opus/i,/claude.*sonnet/i,/claude.*haiku/i],qx=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function Ne(e){return new RegExp(`(?<![\\w.-])${qx(e)}(?:-\\d{4}-\\d{2}-\\d{2})?(?![\\w.-])`,"i")}function en(e){return new RegExp(`(?<![\\w.-])${qx(e)}(?![\\w.])(?!-(?:[\\w.]+-)*(?:lite|image|tts|live|audio|transcribe|translate)\\b)`,"i")}var kt={fallback:!0},_n={geo:!0},gb=e=>({over:272e3,rates:ne(e.inputPerM*2,e.outputPerM*1.5,e.cacheReadPerM*2)}),Ft=(e,t,r)=>{let o=ne(e,t,r);return[o,{long:gb(o)}]},gD=[[ct("fable|mythos",5,2),ne(8,40,.2),{geo:!0,fast:ne(16,80,.4)}],[ct("fable|mythos",5,1),ne(10,50,.25),_n],[ct("fable|mythos",5),ne(10,50,1),_n],[ct("opus",5,5),ne(4,20,.2),{geo:!0,fast:ne(8,40,.4)}],[ct("opus",5),ne(5,25,.5),{geo:!0,fast:ne(10,50,1)}],[ct("opus",4,8),ne(5,25,.5),{geo:!0,fast:ne(10,50,1)}],[ct("opus",4,7),ne(5,25,.5),_n],[ct("opus",4,6),ne(5,25,.5),_n],[ct("opus",4,5),ne(5,25,.5)],[ct("opus",4,1),ne(15,75,1.5)],[ct("opus",4),ne(15,75,1.5)],[ct("sonnet",5,5),ne(2,10,.1),_n],[ct("sonnet",5),ne(2,10,.2),_n],[ct("haiku",5,5),ne(.1,.5,.01),{geo:!0,long:{over:1e5,rates:ne(.5,2.5,.05)}}],[ct("haiku",4,5),ne(1,5,.1)],[ct("sonnet",4,6),ne(3,15,.3),_n],[ct("sonnet",4,5),ne(3,15,.3)],[ct("sonnet",4),ne(3,15,.3)],[/claude-3-opus/i,ne(15,75,1.5)],[/claude-3-5-haiku/i,ne(.8,4,.08)],[/claude-3-haiku/i,ne(.25,1.25,.03)],[/claude-3-[57]-sonnet/i,ne(3,15,.3)],[Af[0],ne(10,50,1),{...kt,..._n}],[Af[1],ne(5,25,.5),{...kt,..._n}],[Af[2],ne(3,15,.3),{...kt,..._n}],[Af[3],ne(1,5,.1),{...kt,..._n}],[Ne("gpt-6-astra"),...Ft(10,50,1)],[Ne("gpt-6-astra-law"),ne(10,50,1)],[Ne("gpt-6.1-sol"),...Ft(2,10,.1)],[Ne("gpt-6.1-terra"),...Ft(1,5,.05)],[Ne("gpt-6-sol"),...Ft(2,10,.2)],[Ne("gpt-6-luna"),...Ft(.1,.5,.01)],[Ne("gpt-6-cyber"),...Ft(20,100,2)],[Ne("gpt-6-rosalind"),...Ft(15,75,1.5)],[Ne("gpt-rosalind-research"),ne(5,25,.5)],[Ne("gpt-rosalind-discovery"),ne(5,25,.5)],[Ne("gpt-5.6-sol"),ne(4,20,.4),{long:gb(ne(4,20,.4)),changes:"2026-12-01"}],[Ne("gpt-5.6"),ne(4,20,.4),{long:gb(ne(4,20,.4)),changes:"2026-12-01"}],[Ne("gpt-5.6-terra"),...Ft(2,12,.2)],[Ne("gpt-5.6-luna"),...Ft(.2,1.2,.02)],[Ne("gpt-5.6-cyber"),ne(12.5,75,1.25)],[Ne("gpt-5.5"),...Ft(5,30,.5)],[Ne("gpt-5.5-pro"),...Ft(30,180,30)],[Ne("gpt-5.5-cyber"),ne(12.5,75,1.25)],[Ne("gpt-5.5-cyber-preview"),ne(12.5,75,1.25)],[Ne("gpt-5.4"),...Ft(2.5,15,.25)],[Ne("gpt-5.4-mini"),ne(.75,4.5,.075)],[Ne("gpt-5.4-nano"),ne(.2,1.25,.02)],[Ne("gpt-5.4-pro"),...Ft(30,180,30)],[Ne("gpt-5.3-codex"),ne(1.75,14,.175)],[Ne("gpt-5.2"),ne(1.75,14,.175)],[Ne("gpt-5.2-pro"),ne(21,168,21)],[Ne("gpt-5.1"),ne(1.25,10,.125)],[Ne("gpt-5"),ne(1.25,10,.125)],[Ne("gpt-5-mini"),ne(.25,2,.025)],[Ne("gpt-5-nano"),ne(.05,.4,.005)],[Ne("gpt-5-pro"),ne(15,120,15)],[Ne("gpt-4.1"),ne(2,8,.5)],[Ne("gpt-4.1-mini"),ne(.4,1.6,.1)],[Ne("gpt-4o"),ne(2.5,10,1.25)],[Ne("gpt-4o-mini"),ne(.15,.6,.075)],[Ne("o3"),ne(2,8,.5)],[Ne("o3-pro"),ne(20,80,20)],[Ne("chat-latest"),ne(5,30,.5)],[Ne("gpt-5-search-api"),ne(1.25,10,.125)],[/gpt-5.*(mini|nano)/i,ne(.25,2,.025),kt],[/gpt-5/i,ne(1.25,10,.125),kt],[/gpt-4o-mini/i,ne(.15,.6,.075),kt],[/gpt-4o|gpt-4\.1/i,ne(2.5,10,1.25),kt],[/gpt-4-turbo/i,ne(10,30,10),kt],[/o[13](-|$)/i,ne(2,8,1),kt],[en("gemini-4-carbon"),ne(2,10,.1),{changes:"2026-12-01",then:ne(4,20,.2)}],[en("gemini-4-argon"),ne(2,10,.1),{changes:"2026-12-01",then:ne(4,20,.2)}],[en("gemini-4-hydrogen"),ne(1.5,7.5,.075)],[en("gemini-3.8-flash"),ne(.75,3.75,.075),{changes:"2027-01-01",then:ne(1.5,7.5,.15)}],[en("gemini-3.6-flash"),ne(.75,3.75,.075),{changes:"2027-01-01",then:ne(1.5,7.5,.15)}],[en("gemini-3.5-flash-lite"),ne(.3,2.5,.03)],[en("gemini-3.1-flash-lite"),ne(.25,1.5,.025)],[en("gemini-3.1-pro"),ne(2,12,.2),{long:{over:2e5,rates:ne(4,18,.4)}}],[en("gemini-3-flash"),ne(.5,3,.05)],[en("gemini-2.5-pro"),ne(1.25,10,.125),{long:{over:2e5,rates:ne(2.5,15,.25)},changes:"2026-12-01",then:ne(.75,3.75,.075),routes:"gemini-3.8-flash"}],[en("gemini-2.5-flash"),ne(.3,2.5,.03)],[en("gemini-2.5-flash-lite"),ne(.1,.4,.01)],[/gemini-3[.\d]*-flash-lite/i,ne(.3,2.5,.03),kt],[/gemini-3[.\d]*-flash/i,ne(.75,3.75,.075),kt],[/gemini-3[.\d]*-pro/i,ne(2,12,.2),kt],[/gemini.*flash/i,ne(.1,.4,.025),kt],[/gemini.*pro/i,ne(1.25,5,.31),kt]];function vD(e){if(e)return gD.find(([t])=>t.test(e))}function Li(e){return vD(e)?.[1]}function Pr(e,t){return e/1e6*t.inputPerM}var RZ=10/1e3;var IZ=Object.freeze({fastUsd:0,geoUsd:0,longUsd:0,webSearchUsd:0,webSearches:0});function vb(e){return e/25e3}function Rn(e){return Number.isFinite(e)?e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:`$${e.toFixed(4)}`:"$0.00"}var yD=/data:[\w/+.-]+;base64,$/,_D="[context-doctor: base64 blob removed \u2014 use file/image APIs instead]";function Fx(e){if(e.startsWith("data:"))return!0;let t=new Uint32Array(128),r=0,o=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n)&127;t[i]++===0&&r++,t[i]>o&&(o=t[i])}return r<24?!1:o/e.length<.35}function Vx(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47}function*Zx(e){let t=e.length,r=0,o=0;for(;r<t;){if(!Vx(e.charCodeAt(r))){r++;continue}let n=r;for(;n<t&&Vx(e.charCodeAt(n));)n++;if(n-r<500){r=n;continue}let i=n;for(;i<t&&i-n<2&&e.charCodeAt(i)===61;)i++;let a=yD.exec(e.slice(Math.max(o,r-1e3),r));yield[a?r-a[0].length:r,i],r=o=i}}function qi(e){for(let[t,r]of Zx(e))if(Fx(e.slice(t,r)))return!0;return!1}function yb(e){let t=[],r=0;for(let[o,n]of Zx(e))Fx(e.slice(o,n))&&(t.push(e.slice(r,o),_D),r=n);return t.length===0?e:(t.push(e.slice(r)),t.join(""))}import{mkdirSync as AZ,readFileSync as jD,writeFileSync as MZ}from"node:fs";import{dirname as AD,join as MD}from"node:path";import{appendFileSync as $D,existsSync as _b,mkdirSync as bD,readFileSync as SD,statSync as wD,writeFileSync as kD}from"node:fs";import{homedir as Bx}from"node:os";import{dirname as Jx,join as Vi}from"node:path";var zD={optimizeSaved:0,optimizeUsd:0,proxySaved:0,proxyUsd:0,proxyRequests:0,checks:0,warnings:0,shrinkage:0};function RD(e){let t={...zD},r=new Map;for(let o of e){if(o.ev==="rollup"&&o.carried){t.optimizeSaved+=o.carried.optimizeSaved,t.optimizeUsd+=o.carried.optimizeUsd,t.proxySaved+=o.carried.proxySaved,t.proxyUsd+=o.carried.proxyUsd,t.proxyRequests+=o.carried.proxyRequests,t.checks+=o.carried.checks,t.warnings+=o.carried.warnings,t.shrinkage+=o.carried.shrinkage,o.carried.since&&(t.since=Math.min(t.since??o.carried.since,o.carried.since));continue}t.since=Math.min(t.since??o.ts,o.ts),o.ev==="optimize"?(t.optimizeSaved+=o.saved??0,t.optimizeUsd+=o.usd??0):o.ev==="proxy"?(t.proxySaved+=o.saved??0,t.proxyUsd+=o.usd??0,t.proxyRequests+=o.requests??0):(o.ev==="check"||o.ev===void 0)&&o.sid!=="doctor-probe"&&(t.checks++,o.warn&&t.warnings++,o.sid&&o.sid!=="mcp-sketch"&&typeof o.tok=="number"&&r.set(o.sid,[...r.get(o.sid)??[],o.tok]))}for(let o of r.values())for(let n=1;n<o.length;n++)o[n]<o[n-1]&&(t.shrinkage+=o[n-1]-o[n]);return t}function ID(){let e=process.env.XDG_STATE_HOME?.trim();return e?Vi(e,"context-doctor"):process.platform==="win32"?Vi(process.env.LOCALAPPDATA?.trim()||Vi(Bx(),"AppData","Local"),"context-doctor"):Vi(Bx(),".local","state","context-doctor")}function xD(){let e=ID();if(_b(e))return e;let t=Qt();return _b(t)?t:e}function $b(){return process.env.CONTEXT_DOCTOR_HOOK_STATE??Vi(xD(),".context-doctor-hook-state.json")}function TD(){return Vi(Jx($b()),".context-doctor-ledger.jsonl")}var Hx=100,PD=256*1024,ED=128*1024,CD=500,OD=4*1024;function ND(e){if(typeof e!="string")return;let t=e.replace(/[\u0000-\u001f\u007f-\u009f]/g,"");return t.length>Hx?t.slice(0,Hx):t}function Mf(e){let t=TD();try{if(bD(Jx(t),{recursive:!0}),_b(t)&&wD(t).size>PD){let o=SD(t,"utf8").trimEnd().split(`
|
|
106
|
+
`),n=d=>{try{return[JSON.parse(d)]}catch{return[]}},i=new Set,a=0;for(let d=o.length-1;d>=0&&i.size<CD;d--){let m=Buffer.byteLength(o[d])+1;if(!(m>OD)){if(a+m>ED)break;i.add(d),a+=m}}let s=o.filter((d,m)=>i.has(m)),c=o.filter((d,m)=>!i.has(m)).flatMap(n),l=RD(c),u={ts:Date.now(),ev:"rollup",carried:l};kD(t,[JSON.stringify(u),...s].join(`
|
|
63
107
|
`)+`
|
|
64
|
-
`)}let r={...
|
|
65
|
-
`)}catch{}}var lA=2,dA=.5,fA=2;function pA(){return uA(cA(_p()),".context-doctor-calibration.json")}function mA(t){let e=(t??"").toLowerCase();return e.includes("claude")?"claude":/gpt|^o\d/.test(e)?"gpt":e.includes("gemini")?"gemini":e?e.split(/[-_/]/)[0]:"unknown"}function hA(){try{return JSON.parse(aA(pA(),"utf8"))}catch{return{}}}function Zv(t){if(process.env.CONTEXT_DOCTOR_NO_CALIBRATION)return{factor:1,samples:0};let e=hA()[mA(t)];if(!e||e.v!==lA||e.samples<1||e.heuristicSum<=0)return{factor:1,samples:0};let r=e.exactSum/e.heuristicSum;return!Number.isFinite(r)||r<dA||r>fA?{factor:1,samples:0}:{factor:r,samples:e.samples}}function yA(t){switch(t.kind){case"system":return"system";case"user":return"user";case"assistant":return"assistant";case"tool_call":return"tool_calls";case"tool_result":return"tool_results";default:return"other"}}function _A(t,e){let r=new Map,n=0;for(let a of t){if(a.estSavings<=0)continue;if(a.messages.length===0){n+=a.estSavings;continue}let c=a.id==="near_duplicate"&&a.messages.length>2?a.messages.slice(1):[a.messages[a.messages.length-1]],u=a.estSavings/c.length;for(let l of c)r.set(l,Math.max(r.get(l)??0,u))}let o=Math.round([...r.values()].reduce((a,c)=>a+c,0)),s=Math.max(0,e-o),i=o+Math.min(n,s);return Math.min(i,Math.round(e*.9))}function vA(t,e=90){let r=t.replace(/\s+/g," ").trim();return r.length>e?r.slice(0,e)+"\u2026":r}function Dv(t){return gA("sha1").update(t.replace(/\s+/g," ").trim()).digest("hex")}function xA(t){let e=2166136261;for(let r=0;r<t.length;r++)e^=t.charCodeAt(r),e=Math.imul(e,16777619);return e>>>0}function bA(t){let e=t.toLowerCase().replace(/\s+/g," ").trim().split(" "),r=e.length>1500,n=new Set;for(let o=0;o+8<=e.length;o++){let s=xA(e.slice(o,o+8).join(" "));(!r||s%8===0)&&n.add(s)}return n}var Lv=.6;function wA(t,e){if(t.size===0||e.size===0)return 0;let r=0,[n,o]=t.size<=e.size?[t,e]:[e,t];for(let s of n)o.has(s)&&r++;return r/(t.size+e.size-r)}var qv=/\b(?:cat|bat|head|tail|less|more|nl)\s+((?:-[^\s;|&]+\s+)*)([^\s|;&><'"`]{3,})/g;function $A(t){return/[*?$]/.test(t)||t.startsWith("-")||t==="EOF"||t==="<<"||!/^[\w./~@+-]+$/.test(t)?!1:t.includes("/")||/\.[A-Za-z0-9]{1,8}$/.test(t)}function kA(t,e){if(/read|open|cat|view|get_file/i.test(t??"")){let n=/"(?:file_path|filePath|path|file)"\s*:\s*"([^"]{3,})"/.exec(e);if(n)return[n[1]]}if(!/bash|shell|terminal|exec|run_command/i.test(t??""))return[];let r=new Set;qv.lastIndex=0;for(let n of e.matchAll(qv)){let o=n[2].replace(/\\+$/,"");$A(o)&&r.add(o)}return[...r]}function Uv(t,e){e=e??t.model;let r=e??(t.sourceFormat==="anthropic"?"claude":t.sourceFormat==="gemini"?"gemini":void 0),n=Zv(r),o=t.messages.map(y=>({msg:y,tokens:Math.round(At(y.text,r)*n.factor)+dp})),s=o.reduce((y,x)=>y+x.tokens,0),i={system:0,user:0,assistant:0,tool_calls:0,tool_results:0,other:0};for(let y of o)i[yA(y.msg)]+=y.tokens;let a=[];for(let y of o)y.msg.kind==="tool_result"&&y.tokens>2e3&&a.push({id:"large_tool_result",severity:y.tokens>8e3?"high":"warn",estSavings:Math.round(y.tokens*.8),message:`Tool result at message #${y.msg.index}${y.msg.toolName?` (${y.msg.toolName})`:""} is ~${R(y.tokens)} tokens.`,suggestion:"Truncate or summarize large tool outputs before they enter history; keep only the fields the model actually used.",messages:[y.msg.index]});for(let y of o)y.msg.kind==="tool_call"&&y.tokens>2e3&&a.push({id:"large_tool_call",severity:y.tokens>8e3?"high":"warn",estSavings:Math.round(y.tokens*.8),message:`Tool call at message #${y.msg.index}${y.msg.toolName?` (${y.msg.toolName})`:""} carries ~${R(y.tokens)} tokens of arguments.`,suggestion:'Usually a whole file being written inline. Once it has run, replace the arguments with a reference ("wrote <path>") \u2014 or write files in smaller pieces so no single call carries the entire content.',messages:[y.msg.index]});let c=new Map;for(let y of o){if(y.msg.text.length<300)continue;let x=Dv(y.msg.text),$=c.get(x);$!==void 0?a.push({id:"duplicate_content",severity:"warn",estSavings:y.tokens-dp,message:`Message #${y.msg.index} duplicates the content of message #${$} (~${R(y.tokens)} tokens).`,suggestion:"Replace repeated content with a short reference to the first occurrence.",messages:[$,y.msg.index]}):c.set(x,y.msg.index)}{let y=o.filter(D=>D.msg.text.length>=300).sort((D,xe)=>xe.tokens-D.tokens).slice(0,150),x=y.map(D=>bA(D.msg.text)),$=x.map(D=>D.size),I=new Set(a.filter(D=>D.id==="duplicate_content").flatMap(D=>D.messages)),U=y.map((D,xe)=>xe),H=D=>{for(;U[D]!==D;)D=U[D]=U[U[D]];return D},ie=y.map(()=>({sim:0,partnerTokens:0}));for(let D=0;D<y.length;D++)for(let xe=D+1;xe<y.length;xe++){let jt=y[D],Ur=y[xe];if(I.has(jt.msg.index)&&I.has(Ur.msg.index))continue;let Ls=Math.min($[D],$[xe]),Pn=Math.max($[D],$[xe]);if(Pn===0||Ls/Pn<Lv)continue;let wt=wA(x[D],x[xe]);wt<Lv||(U[H(D)]=H(xe),wt>ie[D].sim&&(ie[D]={sim:wt,partnerTokens:Ur.tokens}),wt>ie[xe].sim&&(ie[xe]={sim:wt,partnerTokens:jt.tokens}))}let Re=new Map;y.forEach((D,xe)=>{if(ie[xe].sim===0)return;let jt=H(xe);Re.set(jt,[...Re.get(jt)??[],xe])});for(let D of Re.values()){if(D.length<2)continue;D.sort(($t,Fr)=>y[$t].msg.index-y[Fr].msg.index);let xe=D.slice(1),jt=xe.reduce(($t,Fr)=>$t+Math.round(Math.min(y[Fr].tokens,ie[Fr].partnerTokens)*ie[Fr].sim*.9),0),Ur=D.map($t=>ie[$t].sim),Ls=Math.round(Math.min(...Ur)*100),Pn=Math.round(Math.max(...Ur)*100),wt=D.map($t=>y[$t].msg.index),um=Ls===Pn?`~${Pn}%`:`${Ls}-${Pn}%`,iw=xe.reduce(($t,Fr)=>$t+y[Fr].tokens,0);a.push({id:"near_duplicate",severity:"warn",estSavings:jt,message:D.length===2?`Messages #${wt[0]} and #${wt[1]} are ${um} similar (~${R(Math.min(y[D[0]].tokens,y[D[1]].tokens))} tokens repeated with different framing).`:`${D.length} messages are ${um} similar to each other (${wt.slice(0,6).map($t=>`#${$t}`).join(", ")}${wt.length>6?", \u2026":""}): ~${R(iw)} tokens in the ${xe.length} later copies repeat the first with different framing.`,suggestion:"Replace the later copies with a short reference to the first \u2014 repeats survive even when the surrounding words differ.",messages:wt})}}let u=new Map;for(let y of o){if(y.msg.kind!=="tool_call"||!y.msg.toolCallText)continue;let x=Dv(y.msg.toolCallText),$=u.get(x)??[];$.push(y.msg.index),u.set(x,$)}let l=y=>o.find(x=>x.msg.index>y&&x.msg.kind==="tool_result")?.msg;for(let[,y]of u){if(y.length<2)continue;let x=y.slice(1).filter((I,U)=>l(y[U])?.isError===!0).length,$=y.length-1-x;x>0&&a.push({id:"retried_tool_call",severity:x>=3?"warn":"info",estSavings:0,message:`The same tool call was retried ${x} time(s) after it failed (messages #${y.join(", #")}).`,suggestion:x>=3?"Three or more identical retries of a failing command is a loop. Each attempt keeps its error output in context; the answer is in the first error, not in the fourth attempt.":"A retry after a failure is normal once. The failed attempt's output stays in context though, so once the fix is understood the earlier error can go.",messages:y}),$>0&&a.push({id:"repeated_tool_call",severity:"info",estSavings:0,message:`The same tool call (with identical arguments) was repeated ${$} time(s) after it had already succeeded (messages #${y.join(", #")}).`,suggestion:"Repeating a call that already succeeded means the earlier result scrolled out of the model's attention \u2014 keep results in a compact recap instead of re-calling.",messages:y})}{let y=new Map;for(let x of o)if(!(x.msg.kind!=="tool_call"||!x.msg.toolCallText))for(let $ of kA(x.msg.toolName,x.msg.toolCallText))y.set($,[...y.get($)??[],x.msg.index]);for(let[x,$]of y){if($.length<3)continue;let I=o.filter(H=>H.msg.kind==="tool_result"&&$.some(ie=>H.msg.index===ie+1)).reduce((H,ie)=>H+ie.tokens,0),U=Math.round(I*($.length-1)/$.length);a.push({id:"repeated_file_read",severity:U>4e3?"high":"warn",estSavings:U,message:`${x.split("/").pop()} was read ${$.length} times (messages #${$.join(", #")}), keeping ${$.length} copies in context.`,suggestion:"Re-read a file only after it changes; otherwise refer back to the copy already in context.",messages:$})}}for(let y of o)y.msg.kind!=="tool_result"||y.tokens<500||!/Traceback \(most recent call last\)|command not found|npm error|ERR!|\bexit code [1-9]|Exception in thread|FAILED|error TS\d+/i.test(y.msg.text)||a.push({id:"retained_error_output",severity:"warn",estSavings:Math.round(y.tokens*.85),message:`Message #${y.msg.index} holds ~${R(y.tokens)} tokens of failed tool output (errors, stack trace or non-zero exit).`,suggestion:"Keep the one line that identifies the failure and drop the rest \u2014 a full trace has no value once the fix is understood.",messages:[y.msg.index]});for(let y of o)yo(y.msg.text)&&a.push({id:"base64_blob",severity:"high",estSavings:Math.round(y.tokens*.9),message:`Message #${y.msg.index} contains a base64/binary blob (~${R(y.tokens)} tokens of mostly meaningless characters).`,suggestion:"Never put base64 in text content \u2014 use the provider's file/image APIs or replace with a file reference.",messages:[y.msg.index]});let d=t.messages.filter(y=>y.kind==="user"||y.kind==="assistant").length;if(d>40){let x=o.slice(0,Math.floor(o.length/2)).reduce(($,I)=>$+I.tokens,0);a.push({id:"long_history",severity:"warn",estSavings:Math.round(x*.7),message:`Conversation has ${d} turns; the older half holds ~${R(x)} tokens.`,suggestion:"Summarize the older half of the conversation into a compact recap and drop the raw turns (context-doctor optimize --strategy prune-history).",messages:[]})}s>0&&i.system/s>.25&&i.system>2e3&&a.push({id:"large_system_prompt",severity:"info",estSavings:0,message:`System prompt is ~${R(i.system)} tokens (${Math.round(i.system/s*100)}% of the context).`,suggestion:"A big system prompt is fine IF it is stable \u2014 put it first and use prompt caching (Anthropic: cache_control; OpenAI: automatic prefix caching) so you stop paying full price for it every call.",messages:[]}),(Mr(e)==="anthropic"||Mr(e)==="openai")&&a.push({id:"cache_ordering",severity:"info",estSavings:0,message:"Prompt caching only matches a byte-identical prefix.",suggestion:"Keep stable content (system prompt, tool definitions, reference docs) at the start and never interleave it with per-request content \u2014 a single changed byte early in the prompt invalidates the cache for everything after it.",messages:[]});let m=Za(e),p=m?s/m*100:void 0;p!==void 0&&p>70&&a.push({id:"near_window_limit",severity:p>90?"high":"warn",estSavings:0,message:`Context is at ~${p.toFixed(0)}% of ${e}'s window.`,suggestion:"Models degrade well before the hard limit (lost-in-the-middle). Compact now rather than when the request fails.",messages:[]});let f=o.map(y=>({index:y.msg.index,role:y.msg.role,kind:y.msg.kind,tokens:y.tokens,preview:vA(y.msg.text),toolName:y.msg.toolName})).sort((y,x)=>x.tokens-y.tokens).slice(0,5),h={high:0,warn:1,info:2};a.sort((y,x)=>h[y.severity]-h[x.severity]||x.estSavings-y.estSavings);let g=_A(a,s),_=go(e),v;if(_){let y=jr(s,_),x=jr(g,_);v={perCallUsd:y,per1kCallsUsd:y*1e3,savingsPerCallUsd:x,savingsPer1kCallsUsd:x*1e3,ttftSeconds:hp(s),ttftSavedSeconds:hp(g)}}return{totalTokens:s,model:e,contextWindow:m,usagePct:p,messageCount:t.messages.length,categories:i,largestMessages:f,findings:a,totalEstSavings:g,cost:v,sourceFormat:t.sourceFormat,calibration:n.samples>0?n:void 0,parseWarning:t.parseWarning}}import{createHash as SA}from"node:crypto";var Bv=10,qa={strategies:["dedupe","trim-tool-results","strip-base64"],keepRecent:6,maxToolResultTokens:300,trimBoundaryStep:Bv};function TA(t){if(t?.name==="Write"&&typeof t.input?.file_path=="string")return t.input.file_path;let e=t?.name==="Bash"?String(t.input?.command??""):"",r=/(?:cat|tee)\s*>+\s*([^\s<]+)\s*<</.exec(e);return r?r[1]:null}function EA(t,e,r){if(!r)return!1;for(let n=e+1;n<t.length;n++){let o=t[n]?.content;if(Array.isArray(o))for(let s of o){if(s?.type!=="tool_use")continue;let i=s.input?.file_path,a=s.name==="Bash"?String(s.input?.command??""):"";if(i===r||a.includes(r)){if(s.name==="Read"||/\b(cat|head|tail|sed|less)\b/.test(a))return!1;if(s.name==="Edit"||s.name==="MultiEdit")return!0}}}return!1}function Fv(t,e,r){let n=Math.round(e*lp("",r)),o={};for(let[s,i]of Object.entries(t))typeof i=="string"&&i.length>n?o[s]=i.slice(0,n)+`
|
|
66
|
-
[context-doctor: ${
|
|
67
|
-
`):JSON.stringify(
|
|
68
|
-
`),
|
|
69
|
-
\u2026[context-doctor: trimmed ${
|
|
70
|
-
`);let
|
|
71
|
-
`)}var
|
|
72
|
-
`)):(
|
|
73
|
-
`))}function
|
|
108
|
+
`)}let r={...e};for(let o of["model","sid","cv","app"])if(o in r){let n=ND(r[o]);n===void 0?delete r[o]:r[o]=n}$D(t,JSON.stringify({ts:Date.now(),...r})+`
|
|
109
|
+
`)}catch{}}var DD=2,UD=.5,LD=2;function qD(){return MD(AD($b()),".context-doctor-calibration.json")}function VD(e){let t=(e??"").toLowerCase();return t.includes("claude")?"claude":/gpt|^o\d/.test(t)?"gpt":t.includes("gemini")?"gemini":t?t.split(/[-_/]/)[0]:"unknown"}function FD(){try{return JSON.parse(jD(qD(),"utf8"))}catch{return{}}}function Kx(e){if(process.env.CONTEXT_DOCTOR_NO_CALIBRATION)return{factor:1,samples:0};let t=FD()[VD(e)];if(!t||t.v!==DD||t.samples<1||t.heuristicSum<=0)return{factor:1,samples:0};let r=t.exactSum/t.heuristicSum;return!Number.isFinite(r)||r<UD||r>LD?{factor:1,samples:0}:{factor:r,samples:t.samples}}function BD(e){switch(e.kind){case"system":return"system";case"user":return"user";case"assistant":return"assistant";case"tool_call":return"tool_calls";case"tool_result":return"tool_results";default:return"other"}}function HD(e,t){let r=new Map,o=0;for(let s of e){if(s.estSavings<=0)continue;if(s.messages.length===0){o+=s.estSavings;continue}let c=s.id==="near_duplicate"&&s.messages.length>2?s.messages.slice(1):[s.messages[s.messages.length-1]],l=s.estSavings/c.length;for(let u of c)r.set(u,Math.max(r.get(u)??0,l))}let n=Math.round([...r.values()].reduce((s,c)=>s+c,0)),i=Math.max(0,t-n),a=n+Math.min(o,i);return Math.min(a,Math.round(t*.9))}function JD(e,t=90){let r=e.replace(/\s+/g," ").trim();return r.length>t?r.slice(0,t)+"\u2026":r}function Gx(e){return ZD("sha1").update(e.replace(/\s+/g," ").trim()).digest("hex")}function KD(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return t>>>0}function GD(e){let t=e.toLowerCase().replace(/\s+/g," ").trim().split(" "),r=t.length>1500,o=new Set;for(let n=0;n+8<=t.length;n++){let i=KD(t.slice(n,n+8).join(" "));(!r||i%8===0)&&o.add(i)}return o}var Wx=.6;function WD(e,t){if(e.size===0||t.size===0)return 0;let r=0,[o,n]=e.size<=t.size?[e,t]:[t,e];for(let i of o)n.has(i)&&r++;return r/(e.size+t.size-r)}var Xx=/\b(?:cat|bat|head|tail|less|more|nl)\s+((?:-[^\s;|&]+\s+)*)([^\s|;&><'"`]{3,})/g;function XD(e){return/[*?$]/.test(e)||e.startsWith("-")||e==="EOF"||e==="<<"||!/^[\w./~@+-]+$/.test(e)?!1:e.includes("/")||/\.[A-Za-z0-9]{1,8}$/.test(e)}function YD(e,t){if(/read|open|cat|view|get_file/i.test(e??"")){let o=/"(?:file_path|filePath|path|file)"\s*:\s*"([^"]{3,})"/.exec(t);if(o)return[o[1]]}if(!/bash|shell|terminal|exec|run_command/i.test(e??""))return[];let r=new Set;Xx.lastIndex=0;for(let o of t.matchAll(Xx)){let n=o[2].replace(/\\+$/,"");XD(n)&&r.add(n)}return[...r]}function Yx(e,t){t=t??e.model;let r=t??(e.sourceFormat==="anthropic"?"claude":e.sourceFormat==="gemini"?"gemini":void 0),o=Kx(r),n=e.messages.map(g=>({msg:g,tokens:Math.round(yn(g.text,r)*o.factor)+fb})),i=n.reduce((g,S)=>g+S.tokens,0),a={system:0,user:0,assistant:0,tool_calls:0,tool_results:0,other:0};for(let g of n)a[BD(g.msg)]+=g.tokens;let s=[];for(let g of n)g.msg.kind==="tool_result"&&g.tokens>2e3&&s.push({id:"large_tool_result",severity:g.tokens>8e3?"high":"warn",estSavings:Math.round(g.tokens*.8),message:`Tool result at message #${g.msg.index}${g.msg.toolName?` (${g.msg.toolName})`:""} is ~${ue(g.tokens)} tokens.`,suggestion:"Truncate or summarize large tool outputs before they enter history; keep only the fields the model actually used.",messages:[g.msg.index]});for(let g of n)g.msg.kind==="tool_call"&&g.tokens>2e3&&s.push({id:"large_tool_call",severity:g.tokens>8e3?"high":"warn",estSavings:Math.round(g.tokens*.8),message:`Tool call at message #${g.msg.index}${g.msg.toolName?` (${g.msg.toolName})`:""} carries ~${ue(g.tokens)} tokens of arguments.`,suggestion:'Usually a whole file being written inline. Once it has run, replace the arguments with a reference ("wrote <path>") \u2014 or write files in smaller pieces so no single call carries the entire content.',messages:[g.msg.index]});let c=new Map;for(let g of n){if(g.msg.text.length<300)continue;let S=Gx(g.msg.text),T=c.get(S);T!==void 0?s.push({id:"duplicate_content",severity:"warn",estSavings:g.tokens-fb,message:`Message #${g.msg.index} duplicates the content of message #${T} (~${ue(g.tokens)} tokens).`,suggestion:"Replace repeated content with a short reference to the first occurrence.",messages:[T,g.msg.index]}):c.set(S,g.msg.index)}{let g=n.filter(O=>O.msg.text.length>=300).sort((O,D)=>D.tokens-O.tokens).slice(0,150),S=g.map(O=>GD(O.msg.text)),T=S.map(O=>O.size),R=new Set(s.filter(O=>O.id==="duplicate_content").flatMap(O=>O.messages)),w=g.map((O,D)=>D),z=O=>{for(;w[O]!==O;)O=w[O]=w[w[O]];return O},P=g.map(()=>({sim:0,partnerTokens:0}));for(let O=0;O<g.length;O++)for(let D=O+1;D<g.length;D++){let Y=g[O],ee=g[D];if(R.has(Y.msg.index)&&R.has(ee.msg.index))continue;let _e=Math.min(T[O],T[D]),Pe=Math.max(T[O],T[D]);if(Pe===0||_e/Pe<Wx)continue;let Re=WD(S[O],S[D]);Re<Wx||(w[z(O)]=z(D),Re>P[O].sim&&(P[O]={sim:Re,partnerTokens:ee.tokens}),Re>P[D].sim&&(P[D]={sim:Re,partnerTokens:Y.tokens}))}let U=new Map;g.forEach((O,D)=>{if(P[D].sim===0)return;let Y=z(D);U.set(Y,[...U.get(Y)??[],D])});for(let O of U.values()){if(O.length<2)continue;O.sort((N,V)=>g[N].msg.index-g[V].msg.index);let D=O.slice(1),Y=D.reduce((N,V)=>N+Math.round(Math.min(g[V].tokens,P[V].partnerTokens)*P[V].sim*.9),0),ee=O.map(N=>P[N].sim),_e=Math.round(Math.min(...ee)*100),Pe=Math.round(Math.max(...ee)*100),Re=O.map(N=>g[N].msg.index),Ze=_e===Pe?`~${Pe}%`:`${_e}-${Pe}%`,Te=D.reduce((N,V)=>N+g[V].tokens,0);s.push({id:"near_duplicate",severity:"warn",estSavings:Y,message:O.length===2?`Messages #${Re[0]} and #${Re[1]} are ${Ze} similar (~${ue(Math.min(g[O[0]].tokens,g[O[1]].tokens))} tokens repeated with different framing).`:`${O.length} messages are ${Ze} similar to each other (${Re.slice(0,6).map(N=>`#${N}`).join(", ")}${Re.length>6?", \u2026":""}): ~${ue(Te)} tokens in the ${D.length} later copies repeat the first with different framing.`,suggestion:"Replace the later copies with a short reference to the first \u2014 repeats survive even when the surrounding words differ.",messages:Re})}}let l=new Map;for(let g of n){if(g.msg.kind!=="tool_call"||!g.msg.toolCallText)continue;let S=Gx(g.msg.toolCallText),T=l.get(S)??[];T.push(g.msg.index),l.set(S,T)}let u=g=>n.find(S=>S.msg.index>g&&S.msg.kind==="tool_result")?.msg;for(let[,g]of l){if(g.length<2)continue;let S=g.slice(1).filter((R,w)=>u(g[w])?.isError===!0).length,T=g.length-1-S;S>0&&s.push({id:"retried_tool_call",severity:S>=3?"warn":"info",estSavings:0,message:`The same tool call was retried ${S} time(s) after it failed (messages #${g.join(", #")}).`,suggestion:S>=3?"Three or more identical retries of a failing command is a loop. Each attempt keeps its error output in context; the answer is in the first error, not in the fourth attempt.":"A retry after a failure is normal once. The failed attempt's output stays in context though, so once the fix is understood the earlier error can go.",messages:g}),T>0&&s.push({id:"repeated_tool_call",severity:"info",estSavings:0,message:`The same tool call (with identical arguments) was repeated ${T} time(s) after it had already succeeded (messages #${g.join(", #")}).`,suggestion:"Repeating a call that already succeeded means the earlier result scrolled out of the model's attention \u2014 keep results in a compact recap instead of re-calling.",messages:g})}{let g=new Map;for(let S of n)if(!(S.msg.kind!=="tool_call"||!S.msg.toolCallText))for(let T of YD(S.msg.toolName,S.msg.toolCallText))g.set(T,[...g.get(T)??[],S.msg.index]);for(let[S,T]of g){if(T.length<3)continue;let R=n.filter(z=>z.msg.kind==="tool_result"&&T.some(P=>z.msg.index===P+1)).reduce((z,P)=>z+P.tokens,0),w=Math.round(R*(T.length-1)/T.length);s.push({id:"repeated_file_read",severity:w>4e3?"high":"warn",estSavings:w,message:`${S.split("/").pop()} was read ${T.length} times (messages #${T.join(", #")}), keeping ${T.length} copies in context.`,suggestion:"Re-read a file only after it changes; otherwise refer back to the copy already in context.",messages:T})}}for(let g of n)g.msg.kind!=="tool_result"||g.tokens<500||!/Traceback \(most recent call last\)|command not found|npm error|ERR!|\bexit code [1-9]|Exception in thread|FAILED|error TS\d+/i.test(g.msg.text)||s.push({id:"retained_error_output",severity:"warn",estSavings:Math.round(g.tokens*.85),message:`Message #${g.msg.index} holds ~${ue(g.tokens)} tokens of failed tool output (errors, stack trace or non-zero exit).`,suggestion:"Keep the one line that identifies the failure and drop the rest \u2014 a full trace has no value once the fix is understood.",messages:[g.msg.index]});for(let g of n)qi(g.msg.text)&&s.push({id:"base64_blob",severity:"high",estSavings:Math.round(g.tokens*.9),message:`Message #${g.msg.index} contains a base64/binary blob (~${ue(g.tokens)} tokens of mostly meaningless characters).`,suggestion:"Never put base64 in text content \u2014 use the provider's file/image APIs or replace with a file reference.",messages:[g.msg.index]});let d=e.messages.filter(g=>g.kind==="user"||g.kind==="assistant").length;if(d>40){let S=n.slice(0,Math.floor(n.length/2)).reduce((T,R)=>T+R.tokens,0);s.push({id:"long_history",severity:"warn",estSavings:Math.round(S*.7),message:`Conversation has ${d} turns; the older half holds ~${ue(S)} tokens.`,suggestion:"Summarize the older half of the conversation into a compact recap and drop the raw turns (context-doctor optimize --strategy prune-history).",messages:[]})}i>0&&a.system/i>.25&&a.system>2e3&&s.push({id:"large_system_prompt",severity:"info",estSavings:0,message:`System prompt is ~${ue(a.system)} tokens (${Math.round(a.system/i*100)}% of the context).`,suggestion:"A big system prompt is fine IF it is stable \u2014 put it first and use prompt caching (Anthropic: cache_control; OpenAI: automatic prefix caching) so you stop paying full price for it every call.",messages:[]}),(Tr(t)==="anthropic"||Tr(t)==="openai")&&s.push({id:"cache_ordering",severity:"info",estSavings:0,message:"Prompt caching only matches a byte-identical prefix.",suggestion:"Keep stable content (system prompt, tool definitions, reference docs) at the start and never interleave it with per-request content \u2014 a single changed byte early in the prompt invalidates the cache for everything after it.",messages:[]});let m=jf(t),f=m?i/m*100:void 0;f!==void 0&&f>70&&s.push({id:"near_window_limit",severity:f>90?"high":"warn",estSavings:0,message:`Context is at ~${f.toFixed(0)}% of ${t}'s window.`,suggestion:"Models degrade well before the hard limit (lost-in-the-middle). Compact now rather than when the request fails.",messages:[]});let h=n.map(g=>({index:g.msg.index,role:g.msg.role,kind:g.msg.kind,tokens:g.tokens,preview:JD(g.msg.text),toolName:g.msg.toolName})).sort((g,S)=>S.tokens-g.tokens).slice(0,5),y={high:0,warn:1,info:2};s.sort((g,S)=>y[g.severity]-y[S.severity]||S.estSavings-g.estSavings);let v=HD(s,i),p=Li(t),b;if(p){let g=Pr(i,p),S=Pr(v,p);b={perCallUsd:g,per1kCallsUsd:g*1e3,savingsPerCallUsd:S,savingsPer1kCallsUsd:S*1e3,ttftSeconds:vb(i),ttftSavedSeconds:vb(v)}}return{totalTokens:i,model:t,contextWindow:m,usagePct:f,messageCount:e.messages.length,categories:a,largestMessages:h,findings:s,totalEstSavings:v,cost:b,sourceFormat:e.sourceFormat,calibration:o.samples>0?o:void 0,parseWarning:e.parseWarning}}import{createHash as QD}from"node:crypto";var tT=10,Df={strategies:["dedupe","trim-tool-results","strip-base64"],keepRecent:6,maxToolResultTokens:300,trimBoundaryStep:tT};function eU(e){if(e?.name==="Write"&&typeof e.input?.file_path=="string")return e.input.file_path;let t=e?.name==="Bash"?String(e.input?.command??""):"",r=/(?:cat|tee)\s*>+\s*([^\s<]+)\s*<</.exec(t);return r?r[1]:null}function tU(e,t,r){if(!r)return!1;for(let o=t+1;o<e.length;o++){let n=e[o]?.content;if(Array.isArray(n))for(let i of n){if(i?.type!=="tool_use")continue;let a=i.input?.file_path,s=i.name==="Bash"?String(i.input?.command??""):"";if(a===r||s.includes(r)){if(i.name==="Read"||/\b(cat|head|tail|sed|less)\b/.test(s))return!1;if(i.name==="Edit"||i.name==="MultiEdit")return!0}}}return!1}function Qx(e,t,r){let o=Math.round(t*mb("",r)),n={};for(let[i,a]of Object.entries(e))typeof a=="string"&&a.length>o?n[i]=a.slice(0,o)+`
|
|
110
|
+
[context-doctor: ${a.length-o} more chars trimmed \u2014 this call already ran]`:n[i]=a;return n}function bb(e,t,r=tT){let o=e-t;return o<=0?0:o<r?o:Math.floor(o/r)*r}function nU(e){return QD("sha1").update(e.trim()).digest("hex")}function Fi(e){return typeof e=="string"?e:e==null?"":Array.isArray(e)?e.map(t=>typeof t=="string"?t:t?.type==="text"?t.text??"":t?.type==="tool_result"?Fi(t.content):t?.type==="tool_use"?JSON.stringify(t.input??{}):"").join(`
|
|
111
|
+
`):JSON.stringify(e)}function Sb(e,t){let r=e?.content,o=e?.role==="tool"?"tool_result":"text",n=(i,a)=>{let s=i.filter(d=>d?.type==="text"&&typeof d.text=="string");if(s.length===0)return i;let c=s.map(d=>d.text).join(`
|
|
112
|
+
`),l=t(c,a);if(l===c)return i;let u=!1;return i.map(d=>d?.type==="text"&&typeof d.text=="string"?u?null:(u=!0,{...d,text:l}):d).filter(d=>d!==null)};return typeof r=="string"?t(r,o):Array.isArray(r)?o==="tool_result"?n(r,o):r.map(i=>{if(i?.type==="text"&&typeof i.text=="string"){let a=t(i.text,"text");return a===i.text?i:{...i,text:a}}if(i?.type==="tool_result"){if(typeof i.content=="string"){let a=t(i.content,"tool_result");return a===i.content?i:{...i,content:a}}if(Array.isArray(i.content)){let a=n(i.content,"tool_result");return a===i.content?i:{...i,content:a}}}return i}):r}function wb(e){return typeof e=="string"?qi(e)?yb(e):e:Array.isArray(e)?e.map(wb):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,wb(r)])):e}function rU(e,t,r){let o=Math.round(t*mb(e,r));if(e.length<=o)return e;let n=e.slice(0,o),i=e.length-o;return`${n}
|
|
113
|
+
\u2026[context-doctor: trimmed ${i} chars of stale tool output]`}function oU(e){let t=new Set;for(let r of e)if(Array.isArray(r?.content))for(let o of r.content)o?.type==="tool_use"&&o.id&&t.add(o.id);for(let r of e){if(!Array.isArray(r?.content))continue;let o=r.content.filter(n=>n?.type!=="tool_result"||n.tool_use_id&&t.has(n.tool_use_id));o.length!==r.content.length&&(r.content=o.length>0?o:[{type:"text",text:"[context-doctor: earlier tool result dropped with the pruned history]"}])}}function eT(e){return e?.role==="tool"?!0:Array.isArray(e?.content)?e.content.some(t=>t?.type==="tool_result"):!1}function nT(e,t={}){let r={strategies:t.strategies??Df.strategies,keepRecent:t.keepRecent??Df.keepRecent,maxToolResultTokens:t.maxToolResultTokens??Df.maxToolResultTokens,trimBoundaryStep:t.trimBoundaryStep&&t.trimBoundaryStep>0?Math.floor(t.trimBoundaryStep):Df.trimBoundaryStep},o;try{o=JSON.parse(e)}catch{throw new Error("optimize requires a JSON conversation (message array, or object with a `messages` field)")}let n=Array.isArray(o)?o:o?.messages;if(!Array.isArray(n))throw Array.isArray(o?.contents)||typeof o?.input=="string"||Array.isArray(o?.input)?new Error(`optimize rewrites a \`messages\` array (Anthropic or OpenAI chat); this is ${Array.isArray(o?.contents)?"a Gemini `contents`":"an OpenAI Responses `input`"} request. Profile it with analyze (or profile_context); the autopilot proxy slims these requests live.`):new Error("No `messages` array found in input");for(let v=n.length-1;v>=0;v--)(!n[v]||typeof n[v]!="object")&&n.splice(v,1);let i=!Array.isArray(o)&&o?.system!=null||n.some(v=>Array.isArray(v?.content)&&v.content.some(p=>p?.type==="tool_use"||p?.type==="tool_result")),a=t.model??(!Array.isArray(o)&&typeof o?.model=="string"?o.model:void 0)??(i?"claude":void 0),s=v=>yn(v,a),c=Array.isArray(o)?0:(o?.system!=null?s(typeof o.system=="string"?o.system:Fi(o.system)):0)+(o?.tools!=null?s(JSON.stringify(o.tools)):0),l=v=>{let p=s(Fi(v.content));for(let b of Array.isArray(v.tool_calls)?v.tool_calls:[]){let g=b?.function;g&&(p+=s(`${g.name??""} ${typeof g.arguments=="string"?g.arguments:JSON.stringify(g.arguments??{})}`))}return v.function_call&&(p+=s(`${v.function_call.name??""} ${v.function_call.arguments??""}`)),p},u=c+n.reduce((v,p)=>v+l(p),0),d=[];if(r.strategies.includes("strip-base64")&&n.forEach((v,p)=>{let b=Fi(v.content);if(!qi(b))return;let g=s(b),S=Sb(v,R=>qi(R)?yb(R):R);Array.isArray(S)&&(S=S.map(R=>R?.type==="tool_use"&&R.input!=null?{...R,input:wb(R.input)}:R));let T=g-s(Fi(S));T>50&&(v.content=S,d.push({strategy:"strip-base64",messageIndex:p,tokensSaved:T,note:"Removed inline base64 data"}))}),r.strategies.includes("dedupe")){let v=bb(n.length,r.keepRecent,r.trimBoundaryStep),p=new Map;n.forEach((b,g)=>{let S=0,T,R=Sb(b,w=>{if(w.length<300)return w;let z=nU(w),P=p.get(z);if(P===void 0)return p.set(z,g),w;if(g>=v)return w;let U=`[context-doctor: identical to message #${P} \u2014 content removed]`;return S+=s(w)-s(U),T??=P,U});S<=0||(b.content=R,d.push({strategy:"dedupe",messageIndex:g,tokensSaved:S,note:`Duplicate of message #${T}`}))})}if(r.strategies.includes("trim-tool-results")){let v=bb(n.length,r.keepRecent,r.trimBoundaryStep);n.forEach((p,b)=>{if(b>=v||!eT(p))return;let g=0,S=Sb(p,(T,R)=>{if(R!=="tool_result")return T;let w=s(T);if(w<=r.maxToolResultTokens)return T;let z=rU(T,r.maxToolResultTokens,a),P=s(z);return P>=w?T:(g+=w-P,z)});g<=0||(p.content=S,d.push({strategy:"trim-tool-results",messageIndex:b,tokensSaved:g,note:"Stale tool result truncated"}))})}if(r.strategies.includes("trim-tool-calls")){let v=bb(n.length,r.keepRecent,r.trimBoundaryStep);n.forEach((p,b)=>{if(b>=v)return;let g=0;if(Array.isArray(p.content))for(let S of p.content){if(S?.type!=="tool_use"||S.input==null||typeof S.input!="object"||tU(n,b,eU(S)))continue;let T=s(JSON.stringify(S.input));if(T<=r.maxToolResultTokens)continue;let R=Qx(S.input,r.maxToolResultTokens,a),w=s(JSON.stringify(R));w>=T||(S.input=R,g+=T-w)}for(let S of p.tool_calls??[]){let T=S?.function?.arguments;if(typeof T!="string")continue;let R=s(T);if(R<=r.maxToolResultTokens)continue;let w;try{w=JSON.parse(T)}catch{continue}if(!w||typeof w!="object"||Array.isArray(w))continue;let z=JSON.stringify(Qx(w,r.maxToolResultTokens,a)),P=s(z);P>=R||(S.function.arguments=z,g+=R-P)}g>0&&d.push({strategy:"trim-tool-calls",messageIndex:b,tokensSaved:g,note:"Arguments of a completed tool call truncated"})})}let m,f=0;for(;f<n.length&&(n[f]?.role==="system"||n[f]?.role==="developer");)f++;let h=Math.max(2,r.keepRecent);if(r.strategies.includes("prune-history")&&n.length-f>h*2){let v=n.length-h;for(;v<n.length&&eT(n[v]);)v++;if(n.length-v>=2){oU(n.slice(v));let p=n.slice(f,v),b=p.reduce((S,T)=>S+l(T),0);m=p.map((S,T)=>`[${f+T}:${S.role}] ${Fi(S.content).replace(/\s+/g," ").slice(0,200)}`).join(`
|
|
114
|
+
`);let g={role:"user",content:`[context-doctor: ${p.length} earlier messages (~${b} tokens) pruned. Replace this stub with an LLM-written summary of those turns for best results.]`};n.splice(f,v-f,g),d.push({strategy:"prune-history",messageIndex:f,tokensSaved:b-s(g.content),note:`Pruned ${p.length} old messages`})}}let y=c+n.reduce((v,p)=>v+l(p),0);return{conversation:o,tokensBefore:u,tokensAfter:y,applied:d,prunedDigest:m}}var rT={system:"System prompt",user:"User messages",assistant:"Assistant replies",tool_calls:"Tool calls",tool_results:"Tool results",other:"Other"},iU={high:"\u2716",warn:"\u25B2",info:"\u2139"};function aU(e,t=28){let r=Math.round(e*t);return"\u2588".repeat(r)+"\u2591".repeat(t-r)}function sU(e){return e.replace(/(?:[A-Za-z]:)?(?:~|\.{1,2})?(?:[\\/][\w.@+-]+)+|[\w.@~+-]+(?:[\\/][\w.@+-]+)+/g,"[path]").replace(/(?<![\w.@+-])[\w@+-][\w.@+-]*\.[A-Za-z][A-Za-z0-9]{0,9}(?![\w@+-]|\.\w)/g,"[file]")}function oT(e,t={}){let r=[],o=e;if(r.push("CONTEXT DOCTOR \u2014 profile"),r.push("\u2550".repeat(56)),o.parseWarning&&(r.push(`\u26A0 ${o.parseWarning}${o.sourceFormat==="text"&&o.messageCount>0?" Profiled as raw text below, which is almost certainly not what you want.":""}`),r.push("")),r.push(`Total: ~${ue(o.totalTokens)} tokens across ${o.messageCount} messages (${o.sourceFormat} format)`),o.calibration){let a=Math.round((o.calibration.factor-1)*100);r.push(` estimates calibrated ${a>=0?"+":""}${a}% from ${o.calibration.samples} exact count(s) you ran on this machine (analyze --exact)`)}if(o.model){let a=o.contextWindow?` of ${ue(o.contextWindow)} window (${o.usagePct.toFixed(1)}%)`:" (unknown window size)";r.push(`Model: ${o.model}${a}`)}o.cost&&r.push(`Cost: ~${Rn(o.cost.perCallUsd)} input per call \xB7 ~${Rn(o.cost.per1kCallsUsd)} per 1k calls \xB7 ~${o.cost.ttftSeconds.toFixed(1)}s of latency per call (estimates)`),r.push(""),r.push("Where the tokens go"),r.push("\u2500".repeat(56));let n=Object.entries(o.categories).filter(([,a])=>a>0).sort((a,s)=>s[1]-a[1]),i=Math.max(...n.map(([a])=>rT[a].length));for(let[a,s]of n){let c=o.totalTokens>0?s/o.totalTokens:0;r.push(`${rT[a].padEnd(i)} ${aU(c)} ${String(Math.round(c*100)).padStart(3)}% ~${ue(s)}`)}r.push(""),r.push("Largest messages"),r.push("\u2500".repeat(56));for(let a of o.largestMessages){let s=a.toolName?`${a.kind}:${a.toolName}`:a.kind,c=t.redact?"[redacted]":a.preview;r.push(` #${a.index} [${s}] ~${ue(a.tokens)} ${c}`)}if(r.push(""),o.findings.length>0){r.push(`Findings (${o.findings.length})`),r.push("\u2500".repeat(56));let a=3,s=new Map,c=new Map;for(let l of o.findings){let u=s.get(l.id)??0;if(u>=a){let f=c.get(l.id)??{count:0,savings:0};c.set(l.id,{count:f.count+1,savings:f.savings+l.estSavings});continue}s.set(l.id,u+1);let d=l.estSavings>0?` [save ~${ue(l.estSavings)}]`:"";r.push(`${iU[l.severity]} ${t.redact?sU(l.message):l.message}${d}`),r.push(` \u2192 ${l.suggestion}`);let m=c.get(l.id);u+1===a&&m===void 0&&c.set(l.id,{count:0,savings:0})}for(let[l,u]of c){if(u.count===0)continue;let d=Math.min(u.savings,o.totalEstSavings),m=d>0?`, up to ~${ue(d)} more recoverable`:"";r.push(` \u2026 and ${u.count} more of the same kind (${l})${m}. Use --json for the full list.`)}if(r.push(""),o.totalEstSavings>0){let l=o.totalTokens>0?Math.round(o.totalEstSavings/o.totalTokens*100):0,u=`Potential recovery: ~${ue(o.totalEstSavings)} tokens (~${l}% of context)`;o.cost&&o.cost.savingsPerCallUsd>0&&(u+=` \u2248 ${Rn(o.cost.savingsPer1kCallsUsd)} per 1k calls, ${o.cost.ttftSavedSeconds.toFixed(1)}s faster per call`),r.push(u),r.push("Run `context-doctor optimize <file>` to apply the safe fixes automatically.")}}else r.push("No issues found \u2014 this context is in good shape.");return r.join(`
|
|
115
|
+
`)}var cU=2060,lU={code:42,tool_result:56,paste:56,text:80,base64:76,image:0},uU=6.3,dU={paste:2400,code:2400,tool_result:2400,text:900,base64:12e3,image:0},mU=1500,iT=2e3,fU=30,kb=400,pU=1e4,hU=6;function gU(e,t){let r=gc[Tr(t)];return e==="code"||e==="tool_result"||e==="base64"?r.code:r.prose}function vU(e,t){if(e.kind==="image")return e.approx_tokens&&e.approx_tokens>0?Math.round(e.approx_tokens):mU;if(e.approx_tokens&&e.approx_tokens>0)return Math.round(e.approx_tokens);let r=e.approx_chars&&e.approx_chars>0?e.approx_chars:e.approx_lines&&e.approx_lines>0?e.approx_lines*lU[e.kind]:e.approx_words&&e.approx_words>0?e.approx_words*uU:dU[e.kind];return Math.round(r/gU(e.kind,t))}function zb(e){return Math.round(cU/gc[Tr(e)].prose)}var aT=60;function yU(e){let t=String(e??"").replace(/\s+/g," ").trim()||"unnamed block";return t.length>aT?t.slice(0,aT-1)+"\u2026":t}function _U(e){let t=Math.max(0,Math.floor(e.turns||0)),r=(Array.isArray(e.blocks)?e.blocks:[]).map(p=>({...p,label:yU(p?.label)})),o=zb(e.model),n=t*o,i=r.map(p=>({block:p,tokens:vU(p,e.model),copies:Math.max(1,Math.floor(p.repeated??1))})),a=i.reduce((p,b)=>p+b.tokens*b.copies,0),s=n+a,c=[];for(let{block:p,tokens:b,copies:g}of i){if(g>1&&c.push({id:"duplicate_block",severity:"warn",estSavings:b*(g-1),message:`"${p.label}" appears ${g} times (~${ue(b)} each).`,action:`Refer to "${p.label}" by name from now on; never re-quote it.`}),p.kind==="base64"){c.push({id:"base64_blob",severity:"high",estSavings:Math.max(0,b-50),message:`"${p.label}" is inline base64 (~${ue(b)}), which the model cannot read anyway.`,action:`Drop it: describe "${p.label}" in one line and ask the user to attach it as a file if needed.`});continue}if(p.kind!=="image"&&b>=iT){let S=p.stale?Math.max(0,b-100):Math.round(b*.7);c.push({id:"large_block",severity:b>=4*iT?"high":"warn",estSavings:S,message:`"${p.label}" (turn ${p.turn}, ${p.kind}) is ~${ue(b)}${p.stale?" and already acted on":""}.`,action:p.stale?`Replace "${p.label}" with a one-line note of what it was and what came of it.`:`Summarize "${p.label}" into the points still needed (facts, identifiers, decisions) and work from the summary.`})}}let l=i.filter(p=>p.block.kind==="image");if(l.length>=3){let p=l.reduce((b,g)=>b+g.tokens*g.copies,0);c.push({id:"many_images",severity:"info",estSavings:0,message:`${l.length} images (~${ue(p)}) ride along on every turn.`,action:"Once an image has been read, describe what it showed in a sentence so it need not be looked at again; new chats should get only the images still needed."})}if(t>=fU){let p=hU*o+kb;c.push({id:"long_history",severity:s>1e5?"high":"warn",estSavings:Math.max(0,s-p),message:`${t} turns: every new message re-reads ~${ue(s)}.`,action:`Offer a handoff once: with the user's agreement, write a \u2264${kb}-token brief (goal, decisions, current state, open items, key identifiers) and call save_handoff, or the user picks the \`handoff\` prompt. A new chat re-reads ~${ue(p)} of conversation instead, plus the app's own system prompt, which every chat carries.`})}let u=jf(e.model),d=u?Math.round(s/u*100):void 0;d!==void 0&&d>=70&&c.push({id:"near_window_limit",severity:"high",estSavings:0,message:`~${d}% of the ${ue(u)} window. Quality drops and the app may start dropping early turns.`,action:"Do the handoff now rather than at the next problem."});let m={high:0,warn:1,info:2};c.sort((p,b)=>m[p.severity]-m[b.severity]||b.estSavings-p.estSavings);let f=c.find(p=>p.id==="long_history")?.estSavings??0,h=c.filter(p=>p.id!=="long_history").reduce((p,b)=>p+b.estSavings,0),y=Math.min(s,Math.max(f,h)),v=Li(e.model);return{totalTokens:s,baselineTokens:n,blockTokens:a,turns:t,model:e.model,contextWindow:u,usagePct:d,findings:c,totalEstSavings:y,perTurnUsd:v?Pr(s,v):void 0,perTurnCachedUsd:v?s/1e6*v.cacheReadPerM:void 0}}function sT(e){let t=[],r=e.usagePct!==void 0?` (~${e.usagePct}% of ${ue(e.contextWindow)})`:"";return t.push(`Context estimate from sketch: ~${ue(e.totalTokens)} tokens${r}, ${e.turns} turns.`),t.push(` ${ue(e.baselineTokens)} plain conversation + ${ue(e.blockTokens)} in pastes, tool output and images. Estimate, usually within \xB120%.`),e.perTurnUsd!==void 0?t.push(` Re-read on every turn: ${Rn(e.perTurnUsd)} at list price, ${Rn(e.perTurnCachedUsd)} when cached. On a subscription this is what spends the usage limit.`):t.push(" Re-read on every turn. On a subscription this is what spends the usage limit."),e.findings.length===0?(t.push("No findings: nothing large, repeated, or stale in the sketch. Keep going."),t.join(`
|
|
116
|
+
`)):(t.push(""),t.push(`Findings (recoverable ~${ue(e.totalEstSavings)} tokens, but only in a new chat: a chat app's history cannot be edited):`),e.findings.forEach((n,i)=>{let a=n.estSavings>0?` [~${ue(n.estSavings)}]`:"";t.push(`${i+1}. ${n.severity.toUpperCase()}${a} ${n.message}`),t.push(` \u2192 ${n.action}`)}),t.push(""),t.push("Act on #1 in your reply (do it, do not just suggest it): work from your summary and refer to blocks by name from now on, which stops this chat growing; tell the user in one line what you summarized. What is already here stays until a new chat."),!e.findings.some(n=>n.id==="long_history")&&e.totalEstSavings>=pU&&t.push(`To recover the ~${ue(e.totalEstSavings)}: offer a handoff once. With the user's agreement, call save_handoff (a \u2264${kb}-token brief plus the blocks that must stay exact); a new chat starts from that.`),t.join(`
|
|
117
|
+
`))}function cT(e,{record:t=!0}={}){let r=_U(e);return t&&Mf({ev:"check",src:"mcp",tok:r.totalTokens,warn:r.findings.some(o=>o.severity!=="info"),model:e.model}),r}import{spawnSync as ET}from"node:child_process";import{existsSync as CT,lstatSync as LU,readdirSync as qU,readFileSync as VU,realpathSync as Ob,statSync as FU}from"node:fs";import{homedir as jb}from"node:os";import{basename as Bf,extname as Hf,isAbsolute as ZU,join as Ee,relative as OT,resolve as BU,sep as HU}from"node:path";import{execFile as bU,spawnSync as lT}from"node:child_process";import{existsSync as uT,mkdtempSync as dT,readFileSync as Ib,rmSync as mT}from"node:fs";import{tmpdir as fT}from"node:os";import{dirname as pT,extname as hT,join as Uf,resolve as SU}from"node:path";import{tmpdir as $U}from"node:os";function po(){return $U()}var Lf=new Set([".pdf",".docx",".doc",".rtf",".odt",".pptx"]),gT={encoding:"utf8",timeout:3e4,maxBuffer:64*1024*1024};function vc(e,t){try{let r=lT(e,t,{...gT,cwd:po()});return r.status===0&&typeof r.stdout=="string"&&r.stdout.trim()?r.stdout:void 0}catch{return}}var vT=["-convert","txt","-noload","-nostore","-stdout"],yT='ObjC.import("PDFKit"); function run(a) { const d = $.PDFDocument.alloc.initWithURL($.NSURL.fileURLWithPath(a[0])); return d.isNil() ? "" : d.string.js }';function wU(e){let t=vc("pdftotext",["-enc","UTF-8",e,"-"])??vc("pdftotext",[e,"-"]);if(t)return t;let r=Uf(dT(Uf(fT(),"cd-pdf-")),"out.txt");try{lT("pdftotext",[e,r],{...gT,cwd:po()});let o=uT(r)?Ib(r,"utf8"):"";return o.trim()?o:void 0}catch{return}finally{mT(pT(r),{recursive:!0,force:!0})}}function kU(e,t){let r=vc("unzip",["-p",e,...t]);return r?_T(r):void 0}function _T(e){return e.replace(/<\/(w:p|a:p|text:p|text:h)>/g,`
|
|
74
118
|
|
|
75
119
|
`).replace(/<(w:tab|w:br)\/>/g," ").replace(/<[^>]+>/g,"").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&").replace(/\n{3,}/g,`
|
|
76
120
|
|
|
77
|
-
`).trim()}function
|
|
121
|
+
`).trim()}function $T(e){return SU(e)}function bT(e){let t=$T(e),r=hT(t).toLowerCase(),o=process.platform==="darwin",n;if(r===".pdf"){if(n=wU(t)?.replace(/\f/g,`
|
|
78
122
|
|
|
79
|
-
`),!o&&n
|
|
123
|
+
`),!n&&o&&(n=vc("osascript",["-l","JavaScript","-e",yT,t])),!n)return{error:o?"no text layer (scanned PDF?) or unreadable":"needs pdftotext (install poppler-utils), or the PDF has no text layer"}}else{if(o&&r!==".pptx"&&(n=vc("textutil",[...vT,t])),!n){let i=r===".docx"?["word/document.xml"]:r===".pptx"?["ppt/slides/*.xml"]:r===".odt"?["content.xml"]:[];i.length&&(n=kU(t,i))}if(!n)return{error:o?"unreadable document":`needs unzip${r===".doc"||r===".rtf"?" (and .doc/.rtf need macOS textutil; save as .docx)":""}`}}return{text:n}}var yc=2e4,Zt=()=>performance.now();function zU(e){return Math.min(e,3e4,Math.max(2e3,e/2))}function Rb(e,t,r){let o=Math.ceil(r-Zt());if(o<=0)return Promise.resolve({timedOut:!0});let n=Math.ceil(zU(o));return new Promise(i=>{let a=!1,s=u=>{a||(a=!0,clearTimeout(l),i(u))},c,l=setTimeout(()=>{c?.kill("SIGKILL"),s({timedOut:Zt()>=r-50})},n);try{c=bU(e,t,{cwd:po(),encoding:"utf8",timeout:n,killSignal:"SIGKILL",maxBuffer:64*1024*1024,windowsHide:!0},(u,d)=>{if(u)return s({timedOut:Zt()>=r-50});s({out:typeof d=="string"&&d.trim()?d:void 0,timedOut:!1})}),c.on("error",()=>s({timedOut:!1})),c.stdin?.on("error",()=>{}),c.stdin?.end()}catch{s({timedOut:!1})}})}async function qf(e,t=Zt()+yc){let r=$T(e),o=hT(r).toLowerCase(),n=process.platform==="darwin",i,a=!1,s=async(l,u)=>{if(i||a)return;let d=await Rb(l,u,t);d.timedOut?a=!0:i=d.out},c=()=>({error:"not read: the time allowed for reading documents in this call ran out"});if(o===".pdf"){if(await s("pdftotext",["-enc","UTF-8",r,"-"]),await s("pdftotext",[r,"-"]),!i&&!a){let l=Uf(dT(Uf(fT(),"cd-pdf-")),"out.txt");try{(await Rb("pdftotext",[r,l],t)).timedOut?a=!0:uT(l)&&(i=Ib(l,"utf8").trim()?Ib(l,"utf8"):void 0)}finally{mT(pT(l),{recursive:!0,force:!0})}}return i=i?.replace(/\f/g,`
|
|
80
124
|
|
|
81
|
-
`),!
|
|
125
|
+
`),!i&&n&&await s("osascript",["-l","JavaScript","-e",yT,r]),i?{text:i}:a?c():{error:n?"no text layer (scanned PDF?) or unreadable":"needs pdftotext (install poppler-utils), or the PDF has no text layer"}}if(n&&o!==".pptx"&&await s("textutil",[...vT,r]),!i&&!a){let l=o===".docx"?["word/document.xml"]:o===".pptx"?["ppt/slides/*.xml"]:o===".odt"?["content.xml"]:[];if(l.length){let u=await Rb("unzip",["-p",r,...l],t);u.timedOut?a=!0:u.out&&(i=_T(u.out))}}return i?{text:i}:a?c():{error:n?"unreadable document":`needs unzip${o===".doc"||o===".rtf"?" (and .doc/.rtf need macOS textutil; save as .docx)":""}`}}import{homedir as ST}from"node:os";import{join as RU,resolve as IU}from"node:path";function ho(e,t=process.env){if(e===void 0||e===ST()){let r=t.CODEX_HOME?.trim();if(r)return IU(r)}return RU(e??ST(),".codex")}var JU=4e3,KU=400,GU="claude",WU=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".rb",".go",".rs",".java",".kt",".swift",".c",".h",".cc",".cpp",".hpp",".cs",".php",".scala",".sh",".bash",".zsh",".sql",".lua",".dart",".vue",".svelte"]),XU=new Set([".md",".mdx",".markdown",".rst",".adoc"]);function YU(e,t){let r=Hf(e).toLowerCase();return XU.has(r)?"markdown":WU.has(r)?"code":/^#{1,6}\s+\S/m.test(t)&&!/^#!/.test(t)?"markdown":"prose"}var QU=/^(?![\s})\]]|$)/,TT=/^(\/\*\*?|\*\/?|\/\/|#(?!include|define|!)|"""|\'\'\'|--|@\w+)/;function e4(e,t){let r=[],o=[],n="",i=0,a=!1,s=!1,c=(l,u)=>{l>i&&e.slice(i,l).some(d=>d.trim())&&r.push({start:i,end:l,heading:n,hard:a}),i=l,a=u};for(let l=0;l<e.length;l++){let u=e[l];if(t==="markdown"){/^\s*(```|~~~)/.test(u)&&(s=!s);let d=!s&&/^(#{1,6})\s+(.+?)\s*#*\s*$/.exec(u);if(d){c(l,!0);let m=d[1].length;o.length=m-1,o[m-1]=d[2],n=o.filter(Boolean).join(" > ");continue}!s&&!u.trim()&&l+1<e.length&&e[l+1].trim()&&c(l+1,!1)}else t==="code"?l>0&&!e[l-1].trim()&&u.trim()&&QU.test(u)&&c(l,!1):!u.trim()&&l+1<e.length&&e[l+1].trim()&&c(l+1,!1)}if(c(e.length,!1),t!=="markdown")for(let l of r){let u=e.slice(l.start,l.end).map(f=>f.trim()).filter(Boolean),d=u.map(f=>f.replace(TT,"").trim()).find(Boolean),m=t==="code"&&(u.find(f=>!TT.test(f))||d)||u[0]||"";l.heading=m.slice(0,80)}return r}var t4=e=>e>=55296&&e<=56319,n4=e=>e>=56320&&e<=57343;function NT(e,t={}){let r=Math.max(50,t.maxChunkTokens??KU),o=t.model??GU,n=YU(e.name,e.text),i=[],a=[],s=Math.floor(r*2.4);e.text.replace(/\r\n?/g,`
|
|
82
126
|
`).split(`
|
|
83
|
-
`).forEach((m,
|
|
84
|
-
`,
|
|
85
|
-
`);return{id:`${
|
|
86
|
-
`);r.push(`PACKED ~${
|
|
87
|
-
`)}if(
|
|
88
|
-
`);for(let
|
|
89
|
-
`)}var
|
|
127
|
+
`).forEach((m,f)=>{for(;m.length>s;){let h=m.lastIndexOf(" ",s),y=h>s/2?h+1:s;t4(m.charCodeAt(y-1))&&n4(m.charCodeAt(y))&&y--,i.push(m.slice(0,y)),a.push(f+1),m=m.slice(y)}i.push(m),a.push(f+1)});let c=[0];for(let m of i)c.push(c[c.length-1]+yn(m+`
|
|
128
|
+
`,o));let l=(m,f)=>c[f]-c[m],u=[];for(let m of e4(i,n)){if(l(m.start,m.end)<=r){u.push(m);continue}let f=m.start;for(let h=m.start+1;h<=m.end;h++)if(h===m.end||l(f,h+1)>r){let y=f===m.start;u.push({start:f,end:h,heading:y?m.heading:`${m.heading} (cont.)`,hard:y&&m.hard}),f=h}}let d=[];for(let m of u){let f=d[d.length-1];f&&!m.hard&&f.heading===m.heading&&l(f.start,m.end)<=r||f&&!m.hard&&n!=="markdown"&&l(f.start,m.end)<=r?f.end=m.end:d.push({...m})}return d.map((m,f)=>{let h=m.start,y=m.end;for(;h<y&&!i[h].trim();)h++;for(;y>h&&!i[y-1].trim();)y--;let v=i.slice(h,y).join(`
|
|
129
|
+
`);return{id:`${e.name}#${f+1}`,source:e.name,startLine:a[h]??h+1,endLine:a[y-1]??y,heading:m.heading,text:v,tokens:yn(v,o),score:0}})}var r4=new Set("a an and are as at be but by can do does for from has have how i if in into is it its of on or our so that the their them then there these they this to was we were what when where which who why will with you your about should would could not no yes all any my me get set use using used".split(" "));function Ff(e){let t=[],r=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^\p{L}\p{N}]+/u);for(let o of r)o.length<2||r4.has(o)||(o.length>4&&o.endsWith("ies")?o=o.slice(0,-3)+"y":o.length>3&&o.endsWith("s")&&!o.endsWith("ss")&&(o=o.slice(0,-1)),t.push(o));return t}function jT(e,t){let r=[...new Set(Ff(t))];if(r.length===0||e.length===0)return;let o=e.map(a=>{let s=[...Ff(a.text),...Ff(a.heading),...Ff(a.heading)],c=new Map;for(let l of s)c.set(l,(c.get(l)??0)+1);return{len:s.length,tf:c}}),n=o.reduce((a,s)=>a+s.len,0)/o.length||1,i=o.length;for(let a of r){let s=o.filter(l=>l.tf.has(a)).length;if(s===0)continue;let c=Math.log(1+(i-s+.5)/(s+.5));o.forEach((l,u)=>{let d=l.tf.get(a)??0;d&&(e[u].score+=c*(d*2.2/(d+1.2*(1-.75+.75*l.len/n))))})}}function AT(e,t={}){let r=e.map(n=>NT(n,t)),o=t.query?.trim()||void 0;return o&&jT(r.flat(),o),DT(e,r,o,t)}async function MT(e,t={}){let r=e.map(i=>NT(i,t)),o=t.query?.trim()||void 0,n;if(o&&(jT(r.flat(),o),t.semantic)){let{semanticRerank:i}=await Promise.resolve().then(()=>(xT(),IT));n=(await i(r.flat(),o,{model:typeof t.semantic=="string"?t.semantic:void 0})).note}return{...DT(e,r,o,t),semanticNote:n}}function DT(e,t,r,o){let n=Math.max(1,o.budget??JU),i=t.flat(),a=[],s=[],c=[],l=0,u=(f,h)=>{if(!a.includes(f)){if(l+f.tokens>n){c.some(y=>y.id===f.id)||c.push({id:f.id,tokens:f.tokens,requested:h});return}a.push(f),l+=f.tokens}},d="outline";if(o.ids?.length){d="ids";let f=new Map(i.map(h=>[h.id,h]));for(let h of o.ids){let y=f.get(h);y?u(y,!0):s.push(h)}}if(r){d==="outline"&&(d="query");for(let f of[...i].filter(h=>h.score>0).sort((h,y)=>y.score-h.score))u(f,!1)}let m=new Map(i.map((f,h)=>[f,h]));return a.sort((f,h)=>m.get(f)-m.get(h)),{mode:d,query:r,budget:n,totalTokens:i.reduce((f,h)=>f+h.tokens,0),packedTokens:l,selected:a,chunks:i,missingIds:s,unfit:c,sources:e.map((f,h)=>({name:f.name,tokens:t[h].reduce((y,v)=>y+v.tokens,0),chunks:t[h].length,selected:t[h].filter(y=>a.includes(y)).length}))}}function Pb(e,t){let r=e.slice(0,t).map(o=>` ${o.id} L${o.startLine}-${o.endLine} ~${ue(o.tokens)} ${o.heading}`);return e.length>t&&r.push(` \u2026 ${e.length-t} more`),r}function UT(e,{outlineLimit:t=60}={}){let r=[],o=e.totalTokens>0?Math.round(e.packedTokens/e.totalTokens*100):0,n=e.sources.length===1?e.sources[0].name:`${e.sources.length} files`;if(e.mode==="outline")return r.push(`OUTLINE of ${n}: ~${ue(e.totalTokens)} tokens in ${e.chunks.length} chunks. Nothing packed: pass a query, or chunk ids from this list.`),r.push(...Pb(e.chunks,t)),r.join(`
|
|
130
|
+
`);r.push(`PACKED ~${ue(e.packedTokens)} of ~${ue(e.totalTokens)} tokens (${o}%) from ${n}: ${e.selected.length} of ${e.chunks.length} chunks`+(e.query?` for "${e.query}"`:"")+`, budget ${ue(e.budget)}.`),e.missingIds.length&&r.push(`Unknown ids: ${e.missingIds.join(", ")}.`),e.semanticNote&&r.push(`(${e.semanticNote})`);let i=(e.unfit??[]).filter(s=>s.requested);if(e.selected.length>0&&i.length>0&&r.push(`Did not fit the budget of ${ue(e.budget)}: ${i.map(s=>`${s.id} (~${ue(s.tokens)})`).join(", ")}. Ask for it alone or with a larger budget (--max-tokens; MCP max_tokens).`),e.selected.length===0&&(e.unfit??[]).length>0){let s=e.unfit[0],c=e.chunks.find(l=>l.id===s.id);return r.push(`Nothing fit the budget of ${ue(e.budget)} tokens: ${s.requested?"the requested chunk":"the best match"} ${s.id}${c?.heading?` (${c.heading})`:""} is ~${ue(s.tokens)} tokens. Raise the budget to at least ${s.tokens} (--max-tokens; MCP max_tokens), or use smaller chunks (--chunk-tokens).`),r.push(...Pb(e.chunks,t)),r.join(`
|
|
131
|
+
`)}if(e.selected.length===0)return r.push("No chunk matched. Choose from the outline by id, or rephrase with words the document would use."),r.push(...Pb(e.chunks,t)),r.join(`
|
|
132
|
+
`);for(let s of e.selected)r.push("",`\u2500\u2500 ${s.id} \xB7 L${s.startLine}-${s.endLine}${s.heading?` \xB7 ${s.heading}`:""} \xB7 ~${ue(s.tokens)}`,s.text);let a=e.chunks.length-e.selected.length;if(a>0){let s=e.chunks.filter(c=>c.score>0&&!e.selected.includes(c)).sort((c,l)=>l.score-c.score).slice(0,5);r.push("",`Not included: ${a} chunk(s). `+(s.length?`Next best: ${s.map(c=>`${c.id} (${c.heading||`L${c.startLine}`})`).join("; ")}.`:"Ask for the outline to see them."))}return r.join(`
|
|
133
|
+
`)}var o4=new Set(["node_modules",".git","dist","build",".next","target","__pycache__",".venv","venv","vendor"]),Zf={files:500,fileBytes:5*1024*1024,totalBytes:50*1024*1024},LT=["-c","core.fsmonitor=false"];function i4(e){try{let t=ET("git",[...LT,"-C",e,"ls-files","-z","--cached","--others","--exclude-standard"],{cwd:po(),encoding:"utf8",maxBuffer:67108864,timeout:3e4});return t.status!==0||typeof t.stdout!="string"?void 0:t.stdout.split("\0").filter(r=>r&&CT(Ee(e,r))).sort()}catch{return}}function a4(e){let t=ET("git",[...LT,"-C",e,"ls-files","-z","--others","--ignored","--exclude-standard","--directory"],{cwd:po(),encoding:"utf8",maxBuffer:67108864,timeout:3e4});return t.status===0&&typeof t.stdout=="string"&&t.stdout.length>0}function qT(e,t){let r=OT(e,t);return r===""||r!==".."&&!r.startsWith(".."+HU)&&!ZU(r)}var s4=new Set([".npmrc",".pypirc",".netrc","_netrc",".git-credentials",".pgpass",".htpasswd",".vault-token",".credentials.json","oauth_creds.json","credentials.tfrc.json"]),c4=new Set([".bash_history",".zsh_history",".zhistory",".sh_history","fish_history","consolehost_history.txt"]),l4=[[".codex",["auth.json"]],[".cargo",["credentials","credentials.toml"]],[".gem",["credentials"]]],u4=new Set([".pem",".key",".p12",".pfx",".keystore",".jks"]);function Ab(e,t=process.platform){let r=e.trim();if(t==="win32"){if(/^[\\/]{2}/.test(r))return"a network share or device path (\\\\host\\share, \\\\.\\\u2026): pack_context reads this computer's own files only";if(r.replace(/^[a-zA-Z]:/,"").includes(":"))return'an alternate data stream (a name with ":" after the drive): pack_context reads files by their own names'}if(t==="darwin"&&/^\/+net(\/|$)/i.test(r))return"a /net path, which macOS mounts from another host on access: pack_context reads this computer's own files only"}function PT(e){let t=Bf(e),r=t.toLowerCase();if(r===".env"||r.startsWith(".env."))return"an .env file";if(s4.has(r))return`a credentials file (${t})`;if(c4.has(r))return`a shell history (${t})`;if(/^id_(rsa|dsa|ecdsa|ed25519)(_sk)?$/.test(r)||/^id_(rsa|dsa|ecdsa|ed25519)/.test(r)&&!r.endsWith(".pub"))return"a private SSH key";if(u4.has(Hf(r)))return`a key or certificate store (${Hf(r)})`;let o=e.split(/[\\/]+/),n=(o[o.length-2]??"").toLowerCase();if(r==="credentials"&&n===".aws")return"AWS credentials";if(l4.some(([i,a])=>i===n&&a.includes(r)))return`a credentials file (${n}/${t})`}function d4(){let e=jb(),t=[...[".ssh",".aws",".gnupg",".kube",".docker",".azure",Ee(".config","gcloud"),Ee(".config","gh"),Ee(".config","github-copilot"),Ee("Library","Keychains"),".password-store"].map(r=>Ee(e,r)),...[".yarnrc.yml",Ee(".m2","settings.xml"),Ee(".m2","settings-security.xml")].map(r=>Ee(e,r)),Ee(Qt(),".credentials.json"),Ee(ho(),"auth.json"),"/etc/shadow","/etc/gshadow","/etc/sudoers","/etc/master.passwd","/etc/ssh"];return[...new Set([...t,...t.map(Er)])]}function m4(){let e=jb(),t=[hb(),Ee(e,".claude.json"),`${hb()}.backup`,Ee(e,".claude.json.backup"),Ee(Qt(),"backups"),Ee(e,".claude","backups"),...[Qt(),Ee(e,".claude")].flatMap(r=>[Ee(r,"settings.json"),Ee(r,"settings.local.json")]),Ee(e,".cursor","mcp.json"),Ee(ho(),"config.toml"),Ee(e,".codex","config.toml"),Ee(e,".gemini","settings.json"),Ee(e,".gemini","config","mcp_config.json"),Ee(e,".gemini","antigravity","mcp_config.json"),Ee(e,"Library","Application Support","Claude","claude_desktop_config.json"),Ee(process.env.APPDATA||Ee(e,"AppData","Roaming"),"Claude","claude_desktop_config.json"),Ee(e,".config","Claude","claude_desktop_config.json"),Ee(process.env.COPILOT_HOME||Ee(e,".copilot"),"mcp-config.json"),Ee(e,".copilot","mcp-config.json"),...Nb().map(r=>Ee(r,"Claude","Claude Extensions Settings")),...VT().map(r=>Ee(r,"mcp.json")),Ee(e,".codeium","windsurf","mcp_config.json"),...Nb().map(r=>Ee(r,"zed","settings.json"))];return[...new Set([...t,...t.map(Er)])]}function Nb(){let e=jb();return[...new Set([Ee(e,"Library","Application Support"),process.env.APPDATA||Ee(e,"AppData","Roaming"),process.env.XDG_CONFIG_HOME||Ee(e,".config"),Ee(e,".config")])]}function VT(){return Nb().flatMap(e=>["Code","Code - Insiders"].map(t=>Ee(e,t,"User")))}function f4(){let e=VT().map(t=>Ee(t,"profiles"));return[...new Set([...e,...e.map(Er)])]}function Er(e){for(let t of[Ob.native,Ob])try{return t(e)}catch{}return BU(e)}function Eb(e,t){let r=process.platform==="darwin"||process.platform==="win32"?o=>o.toLowerCase():o=>o;return t.find(o=>qT(r(o),r(e)))}function Cb(e){let t=e?.code;return t==="ENOENT"?"not found":t==="EACCES"||t==="EPERM"?"permission denied":t==="ENOTDIR"?"not a directory":t==="EISDIR"?"is a directory":t==="ELOOP"?"too many symlinks":t?`unreadable (${t})`:`unreadable (${e?.message??e})`}function p4(e,t=process.cwd()){let r=typeof t=="string"?{cwd:t}:t,o=r.cwd??process.cwd(),n=r.includeSecrets===!0,i=r.secretsHint??"",a=n?[]:d4(),s=n?[]:m4(),c=n?[]:f4(),l=[],u=[],d=0,m=new Set,f="",h=0,y=!1,v=(p,b)=>{if(l.length>=Zf.files){(b||u.length<20)&&u.push(`${p}: over ${Zf.files} files`);return}let g;try{g=b?FU(p):LU(p)}catch(z){u.push(`${p}: ${Cb(z)}`);return}if(g.isSymbolicLink()){let z;try{z=Er(Ob(p))}catch{return}qT(f,z)||u.push(`${p}: symlink pointing outside the folder (not followed)`);return}if(a.length>0){let z=Er(p),P=Eb(z,a);if(P){b&&u.push(`${p}: refused, ${P} holds credentials${i}`);return}let U=Eb(z,s)??(Bf(z).toLowerCase()==="mcp.json"?Eb(z,c):void 0);if(U){u.push(`${p}: refused, ${U} can hold API keys (an MCP server's env)${i}`);return}}if(g.isDirectory()){let z=Bf(p);if(!b&&o4.has(z))return;if(!b&&z.startsWith(".")){h++;return}let P=b?i4(p):void 0;if(b&&(y=P!==void 0),P){P.length===0&&a4(p)&&u.push(`${p}: ignored by git (.gitignore); pack reads folders as git does, so ignored files stay out. Name a file to pack it anyway`);for(let O of P)v(Ee(p,O),!1);return}let U;try{U=qU(p).sort()}catch(O){u.push(`${p}: ${Cb(O)}`);return}for(let O of U)v(Ee(p,O),!1);return}if(!g.isFile()){b&&u.push(`${p}: not a regular file`);return}if(!n){let z=PT(p)??PT(Er(p));if(z){u.push(`${p}: ${z}, likely holding secrets; not packed${i}`);return}}if(!b&&Bf(p).startsWith(".")&&!y){h++;return}let S=Er(p);if(m.has(S))return;if(g.size>Zf.fileBytes||d+g.size>Zf.totalBytes){u.push(`${p}: too large (${Math.round(g.size/1024)} KB)`);return}let T=OT(o,p),R=T&&!T.startsWith("..")?T:p;if(Lf.has(Hf(p).toLowerCase())){if(r.defer){d+=g.size,m.add(S),l.push({name:R,text:""}),r.defer.push({slot:l.length-1,path:p});return}let z=bT(p);"error"in z?u.push(`${p}: ${z.error}`):(d+=g.size,m.add(S),l.push({name:R,text:z.text}));return}let w;try{w=VU(p)}catch(z){u.push(`${p}: ${Cb(z)}`);return}if(w.subarray(0,8e3).includes(0)){b&&u.push(`${p}: binary (pack reads text, PDF and Word/PowerPoint/ODT files)`);return}d+=g.size,m.add(S),l.push({name:R,text:w.toString("utf8")})};for(let p of e){if(!CT(p)){u.push(`${p}: not found`);continue}f=Er(p),h=0,y=!1,v(p,!0),h>0&&u.push(`${p}: ${h} hidden file(s) or folder(s) not read (name one to pack it)`)}return{sources:l,skipped:u}}async function FT(e,t={}){let r=[],{sources:o,skipped:n}=p4(e,{...t,defer:r}),i=Zt()+(t.budgetMs??yc),a=new Set;for(let s of r){let c=await qf(s.path,i);"error"in c?(n.push(`${s.path}: ${c.error}`),a.add(s.slot)):o[s.slot].text=c.text}return{sources:o.filter((s,c)=>!a.has(c)),skipped:n}}var ZT=`Context hygiene rules (always on):
|
|
90
134
|
1. When asked about tokens, cost, speed or limits, and once at ~30 turns or 3+ large pastes: call profile_context BEFORE answering; in a chat app pass a \`sketch\`. Act on its top finding. Do not estimate token counts yourself.
|
|
91
135
|
2. When a chat grows long, offer a handoff once (save_handoff): only a new chat cuts its history.
|
|
92
136
|
3. Summarize any paste or tool result over ~2k tokens into the points you need.
|
|
93
137
|
4. Refer to earlier content by name; never re-quote it or inline base64.
|
|
94
138
|
5. For a big file you won't edit, call pack_context with the question; don't read it whole.
|
|
95
|
-
6. If optimize_context returns a pruned-turns digest, write its \u2264150-token summary.`;var
|
|
96
|
-
`),structured:
|
|
97
|
-
`),structured:
|
|
139
|
+
6. If optimize_context returns a pruned-turns digest, write its \u2264150-token summary.`;var h4=["openai/session","openai/subject"];function BT(e,t=process.env){let r=t.CONTEXT_DOCTOR_RESULTS?.trim().toLowerCase();return r==="full"||r==="compact"?r:e&&typeof e=="object"&&h4.some(o=>typeof e[o]=="string")?"compact":"full"}var Zi=e=>Math.round(e);function HT(e,t){let r=e.findings[0],o=e.totalTokens>0?Math.round(e.totalEstSavings/e.totalTokens*100):0,n=[`~${ue(e.totalTokens)} tokens in ${e.messageCount} messages (${e.sourceFormat})${e.usagePct!==void 0?`, ${e.usagePct.toFixed(0)}% of the window`:""}; ~${ue(e.totalEstSavings)} recoverable (${o}%).`];e.parseWarning&&n.unshift(`\u26A0 ${e.parseWarning}`),n.push(r?"Act on #1 (first in structuredContent.findings).":"No findings.");let i=Object.fromEntries(Object.entries(e.categories).filter(([,s])=>s>0).sort((s,c)=>c[1]-s[1]).map(([s,c])=>[s,Zi(c)])),a={total_tokens:Zi(e.totalTokens),messages:e.messageCount,recoverable_tokens:Zi(e.totalEstSavings),by_category:i,findings:e.findings.slice(0,6).map(s=>`${s.severity}${s.estSavings>0?` ~${ue(s.estSavings)}`:""}: ${s.message} \u2192 ${s.suggestion}`)};return e.findings.length>6&&(a.more_findings=e.findings.length-6),e.model&&(a.model=e.model),e.usagePct!==void 0&&(a.window_pct=Number(e.usagePct.toFixed(1))),e.cost&&(a.usd_per_call=Number(e.cost.perCallUsd.toFixed(4))),{text:n.join(`
|
|
140
|
+
`),structured:a,meta:{"context-doctor/report":t,"context-doctor/largest":e.largestMessages.map(s=>({index:s.index,kind:s.kind,tokens:Zi(s.tokens),preview:s.preview}))}}}function JT(e,t){let[r,...o]=e.findings,n=[`~${ue(e.totalTokens)} tokens, ${e.turns} turns${e.usagePct!==void 0?`, ~${e.usagePct}% of the window`:""} (estimate); ~${ue(e.totalEstSavings)} recoverable, only in a new chat.`];r?(n.push(`Act on #1 now: ${r.message} \u2192 ${r.action}`),n.push("This chat's history cannot be edited: what is already here comes back only in a new chat (save_handoff).")):n.push("No findings. Keep going.");let i={total_tokens:e.totalTokens,recoverable_tokens:e.totalEstSavings,recoverable_by:"a new chat (handoff)"};return o.length&&(i.other_findings=o.map(a=>`${a.severity}${a.estSavings>0?` ~${ue(a.estSavings)}`:""}: ${a.message}`)),e.usagePct!==void 0&&(i.window_pct=e.usagePct),e.perTurnUsd!==void 0&&(i.usd_per_turn=Number(e.perTurnUsd.toFixed(4))),{text:n.join(`
|
|
141
|
+
`),structured:i,meta:{"context-doctor/report":t}}}function g4(e,t){let r=o=>o.slice(o.lastIndexOf("#")+1);return e===t?`#${r(e)}`:`#${r(e)}-${r(t)}`}function v4(e){let t=e.replace(/\s*\(cont\.\)$/,""),r=t.split(" > ");return r[r.length-1]||t}function KT(e,t,r=120){let o=new Map;for(let d of e.chunks){let m=o.get(d.source)??[],f=v4(d.heading),h=m[m.length-1];h&&h.heading===f?(h.last=d.id,h.tokens+=d.tokens):m.push({first:d.id,last:d.id,heading:f,tokens:d.tokens}),o.set(d.source,m)}let n=r,i=0,a=[...o.entries()].map(([d,m])=>{let f=m.slice(0,Math.max(0,n));n-=f.length,i+=m.length-f.length;let h=m.reduce((y,v)=>y+v.tokens,0);return{name:d,tokens:Zi(h),sections:f.map(y=>`${g4(y.first,y.last)} ${y.heading} ~${ue(y.tokens)}`)}}),s=e.sources.length===1?e.sources[0].name:`${e.sources.length} files`,c=e.chunks[0]?.id??"name#1",l=`OUTLINE of ${s}: ~${ue(e.totalTokens)} tokens in ${e.chunks.length} chunks, as sections in structuredContent. Nothing packed: pass a query, or ids (<name>#<n>, e.g. ${c}).`,u={total_tokens:Zi(e.totalTokens),chunks:e.chunks.length,sources:a};return i>0&&(u.sections_not_shown=i),{text:l,structured:u,meta:{"context-doctor/outline":t}}}import{existsSync as y4,lstatSync as Bn,mkdirSync as YT,readdirSync as _4,readFileSync as Mb,realpathSync as Jf,rmSync as $4,writeFileSync as GT}from"node:fs";import{homedir as Hi}from"node:os";import{isAbsolute as b4,join as Ot,relative as S4,sep as w4}from"node:path";var nn={briefTargetTokens:400,briefChars:6e3,titleChars:80,modelChars:100,blocks:20,labelChars:80,blockChars:2e4,totalChars:6e4,kept:100,readBytes:512*1024};function Ub(e=Hi()){return Ot(e,".context-doctor","handoffs")}var k4=/^\d{8}-\d{6}-[a-z0-9]+(?:-[a-z0-9]+)*$/;function QT(e){return typeof e=="string"&&e.length<=80&&k4.test(e)}function z4(e){return e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40).replace(/-+$/g,"")||"handoff"}function R4(e){let t=r=>String(r).padStart(2,"0");return`${e.getUTCFullYear()}${t(e.getUTCMonth()+1)}${t(e.getUTCDate())}-${t(e.getUTCHours())}${t(e.getUTCMinutes())}${t(e.getUTCSeconds())}`}function Lb(e){let t=[],r=nn;typeof e?.brief!="string"||!e.brief.trim()?t.push("`brief` is empty: write the handoff brief first."):e.brief.length>r.briefChars&&t.push(`\`brief\` is ${e.brief.length} characters; the limit is ${r.briefChars} (aim for \u2264${r.briefTargetTokens} tokens).`),e.title!==void 0&&(typeof e.title!="string"||e.title.length>r.titleChars)&&t.push(`\`title\` must be a string of at most ${r.titleChars} characters.`);let o=e.verbatim??[];if(!Array.isArray(o))t.push("`verbatim` must be a list of {label, text}.");else{o.length>r.blocks&&t.push(`${o.length} verbatim blocks; the limit is ${r.blocks}. Keep only what must stay exact.`);let n=typeof e.brief=="string"?e.brief.length:0;o.forEach((i,a)=>{(typeof i?.label!="string"||!i.label.trim()||i.label.length>r.labelChars)&&t.push(`verbatim[${a}].label must be 1-${r.labelChars} characters.`),typeof i?.text!="string"||!i.text.trim()?t.push(`verbatim[${a}].text is empty.`):i.text.length>r.blockChars?t.push(`verbatim[${a}] ("${String(i.label).slice(0,40)}") is ${i.text.length} characters; the limit is ${r.blockChars}. Summarize it, or keep only the exact lines needed.`):n+=i.text.length}),n>r.totalChars&&t.push(`The handoff is ${n} characters; the limit is ${r.totalChars}. A handoff that big is not a cut.`)}e.model!==void 0&&typeof e.model!="string"&&t.push("`model` must be a string.");for(let n of["chatTokens","turns"]){let i=e[n];i!==void 0&&(typeof i!="number"||!Number.isFinite(i)||i<0||i>1e8)&&t.push(`\`${n}\` must be a non-negative number.`)}return t}var Bi="masked by context-doctor",gt=(e,t,r=()=>!0)=>({kind:e,re:t,replace:o=>r(o[0])?`[${e.replace(/^an? /,"")} ${Bi}]`:void 0}),I4=e=>/[0-9]/.test(e)&&/[A-Z]/.test(e)&&/[a-z]/.test(e),x4=[gt("a private key",/-----BEGIN [A-Z0-9 ]*PRIVATE KEY(?: BLOCK)?-----[\s\S]*?(?:-----END [A-Z0-9 ]*PRIVATE KEY(?: BLOCK)?-----|$)/g),gt("an Anthropic key",/(?<![A-Za-z0-9_.-])sk-ant-[A-Za-z0-9_-]{20,}/g),gt("an OpenAI key",/(?<![A-Za-z0-9_.-])sk-(?:proj-|svcacct-|admin-)?[A-Za-z0-9_-]{20,}/g,I4),gt("an AWS access key",/(?<![A-Za-z0-9])(?:AKIA|ASIA)[0-9A-Z]{16}(?![A-Za-z0-9])/g),gt("a GitHub token",/(?<![A-Za-z0-9])(?:gh[pousr]_[A-Za-z0-9]{36,}|github_pat_[A-Za-z0-9_]{22,})/g),gt("a GitLab token",/(?<![A-Za-z0-9])glpat-[A-Za-z0-9_-]{20,}/g),gt("a Slack token",/(?<![A-Za-z0-9])xox[abposr]-[A-Za-z0-9-]{10,}/g),gt("a Slack webhook",/https:\/\/hooks\.slack\.com\/(?:services|workflows|triggers)\/[A-Za-z0-9_/-]+/g),gt("a Google API key",/(?<![A-Za-z0-9])AIza[0-9A-Za-z_-]{30,}/g),gt("an npm token",/(?<![A-Za-z0-9])npm_[A-Za-z0-9]{36}(?![A-Za-z0-9])/g),gt("a Stripe key",/(?<![A-Za-z0-9])(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{16,}/g),gt("a Stripe webhook secret",/(?<![A-Za-z0-9])whsec_[A-Za-z0-9]{20,}/g),gt("a Hugging Face token",/(?<![A-Za-z0-9])hf_[A-Za-z0-9]{30,}/g),gt("a SendGrid key",/(?<![A-Za-z0-9])SG\.[A-Za-z0-9_-]{16,}\.[A-Za-z0-9_-]{16,}/g),gt("a Twilio key",/(?<![A-Za-z0-9])SK[0-9a-f]{32}(?![A-Za-z0-9])/g),gt("a JWT",/(?<![A-Za-z0-9])eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g),{kind:"a password in a URL",re:/\b([a-z][a-z0-9+.-]*:\/\/)([^\s:@/]*):([^\s@/]+)@/gi,replace:e=>`${e[1]}${e[2]}:[${Bi}]@`},{kind:"a bearer token",re:/\b(Bearer|Basic|Token)(\s+)([A-Za-z0-9._~+/=-]{16,})/g,replace:e=>`${e[1]}${e[2]}[${Bi}]`},{kind:"a database password",re:/(\bmysql(?:dump|admin)?\b[^\n]*?\s-p)([^\s-][^\s]*)/g,replace:e=>`${e[1]}[${Bi}]`}],eP="(?:password|passwd|passphrase|pwd|secret|secret[_-]?key|secret[_-]?access[_-]?key|access[_-]?key|client[_-]?secret|api[_-]?key|apikey|access[_-]?token|auth[_-]?token|authtoken|refresh[_-]?token|bearer[_-]?token|token|private[_-]?key|account[_-]?key|shared[_-]?access[_-]?key|credentials?)",T4=new RegExp(`(?<![A-Za-z0-9])((?:[A-Za-z0-9]+[_.-])*${eP}["']?\\s*[:=]\\s*["']?)([^\\s"'\`,;()<>{}\\[\\]]{3,})(?=$|[\\s"'\`,;)\\]}])`,"gim"),P4=new RegExp(`(?<![A-Za-z0-9])((?:[A-Za-z0-9]+[_.-])*${eP}["']?\\s*[:=]\\s*)(["'])([^"'\\n]{3,500})\\2`,"gim"),E4=/^(?:string|str|number|int|integer|bool|boolean|any|null|nil|none|undefined|true|false|required|optional|empty|redacted|hidden|secret|password|\*+|x{3,}|\.{3,})$/i,C4=/^(?:your[_-]|<|\$\{?|%|\{\{|changeme|placeholder|example|dummy)|(?:[_-]here)(?:[_-]?\d+)?$/i;function WT(e){return!(E4.test(e)||C4.test(e)||/^(?:\/|~\/|\.{1,2}\/|[A-Za-z]:\\)/.test(e)||/^(?:process\.env|os\.environ|env\.|ENV\[|getenv)/i.test(e)||/^[A-Za-z_$][\w$]*(?:\.[\w$]+)+$/.test(e)&&!/[0-9]/.test(e)||/^\d{1,7}$/.test(e))}function Cr(e){let t=0,r=new Set,o=String(e??"");for(let n of x4)o=o.replace(n.re,(...i)=>{let a=i.slice(0,-2).filter(c=>typeof c=="string"||c===void 0),s=n.replace(a);return s===void 0?a[0]:(t++,r.add(n.kind),s)});return o=o.replace(P4,(n,i,a,s)=>WT(s.trim())?(t++,r.add("a password or secret assignment"),`${i}${a}[${Bi}]${a}`):n),o=o.replace(T4,(n,i,a)=>WT(a)?(t++,r.add("a password or secret assignment"),`${i}[${Bi}]`):n),{text:o,count:t,kinds:[...r]}}function O4(e){let t=Math.max(0,...(e.match(/`+/g)??[]).map(r=>r.length));return"`".repeat(Math.max(3,t+1))}function Db(e,t){let r=e.replace(/\s+/g," ").trim();return r.length>t?r.slice(0,t-1)+"\u2026":r}function N4(e,t,r,o){let n=[`# Handoff: ${e}`,"",`Continue from this handoff (written ${t.slice(0,16).replace("T"," ")} UTC, saved by context-doctor). It replaces the earlier chat; ask for anything it does not cover.`,"",r.trim()];if(o.length){n.push("","## Verbatim (keep exact)");for(let i of o){let a=O4(i.text);n.push("",`### ${Db(i.label,nn.labelChars)}`,"",a,i.text.replace(/\s+$/,""),a)}}return n.join(`
|
|
98
142
|
`)+`
|
|
99
|
-
`}function
|
|
100
|
-
`)}function
|
|
101
|
-
`);return
|
|
102
|
-
`).find(
|
|
103
|
-
`,{mode:384,flag:"wx"})}catch(
|
|
104
|
-
|
|
105
|
-
`)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
`)
|
|
110
|
-
`).
|
|
111
|
-
prune-history
|
|
112
|
-
|
|
113
|
-
|
|
143
|
+
`}function j4(e,t){let r={after:e};t.chatTokens!==void 0&&t.chatTokens>0?(r.now=Math.round(t.chatTokens),r.nowSource="given"):t.turns!==void 0&&t.turns>0&&(r.now=Math.round(t.turns)*zb(t.model),r.nowSource="turns");let o=Li(t.model);return o&&(r.afterUsd=Pr(r.after,o),r.afterCachedUsd=r.after/1e6*o.cacheReadPerM,r.now!==void 0&&(r.nowUsd=Pr(r.now,o),r.nowCachedUsd=r.now/1e6*o.cacheReadPerM)),r}function tP(e){let t=(n,i)=>n!==void 0?` (${Rn(n)} at list price, ${Rn(i??0)} cached)`:"";if(e.now===void 0)return`A new chat starts from ~${ue(e.after)} tokens${t(e.afterUsd,e.afterCachedUsd)}, plus the app's own system prompt. Pass chat_tokens (from profile_context) to see the per-turn saving.`;let r=e.nowSource==="turns"?" (estimated from the turn count)":"",o=Math.max(0,e.now-e.after);return[`Now: ~${ue(e.now)} tokens re-read on every turn${r}${t(e.nowUsd,e.nowCachedUsd)}.`,`After: ~${ue(e.after)} in a new chat${t(e.afterUsd,e.afterCachedUsd)}, plus the app's own system prompt, which every chat carries.`,`Saves ~${ue(o)} tokens per further turn${e.now>0?` (${Math.round(o/e.now*100)}%)`:""}; on a subscription that is usage limit.`].join(`
|
|
144
|
+
`)}function Kf(e,t){let r=S4(e,t);return r===""||r!==".."&&!r.startsWith(".."+w4)&&!b4(r)}var go=class extends Error{};function Gf(e,t){let r=a=>{if(t)throw new go(a)},o;try{o=Jf(e)}catch{return r("the home directory cannot be read")}let n=Ot(e,".context-doctor"),i=Ub(e);for(let a of[n,i]){let s;try{s=Bn(a)}catch{if(!t)return;try{YT(a,{mode:448}),s=Bn(a)}catch(l){return r(`cannot create ${tn(a,e)} (${l.code??"error"})`)}}if(s.isSymbolicLink())return r(`${tn(a,e)} is a symbolic link; handoffs are only written to a real folder in the home directory`);if(!s.isDirectory())return r(`${tn(a,e)} is not a folder`);let c;try{c=Jf(a)}catch{return r(`${tn(a,e)} cannot be read`)}if(!Kf(o,c))return r(`${tn(a,e)} resolves outside the home directory`)}return i}function XT(e,t){let r=Date.parse(e.created);return Number.isFinite(r)&&r<=t+6e4?r:0}function A4(e){let t=r=>typeof r.order=="number"&&Number.isFinite(r.order)?r.order:0;return(r,o)=>XT(o,e)-XT(r,e)||t(o)-t(r)||(r.id<o.id?1:r.id>o.id?-1:0)}var M4=0;function Wf(e=Hi()){let t=Gf(e,!1);if(!t)return[];let r;try{r=_4(t)}catch{return[]}let o=[];for(let n of r){if(!QT(n))continue;let i=Ot(t,n);try{if(!Bn(i).isDirectory())continue;let a=Ot(i,"meta.json");if(!Bn(a).isFile())continue;let s=JSON.parse(Mb(a,"utf8"));if(s?.id!==n||typeof s.created!="string")continue;o.push(s)}catch{continue}}return o.sort(A4(Date.now()))}function qb(e,t=Hi()){let r=e==="latest"?Wf(t)[0]?.id:e;if(!QT(r))return;let o=Gf(t,!1);if(!o)return;let n=Ot(o,r),i=Ot(n,"handoff.md");if(Kf(o,i))try{let a=Bn(i);if(!a.isFile()||a.size>nn.readBytes||!Bn(n).isDirectory()||!Bn(Ot(n,"meta.json")).isFile())return;let s=JSON.parse(Mb(Ot(n,"meta.json"),"utf8"));return s?.id!==r?void 0:{meta:s,markdown:Mb(i,"utf8")}}catch{return}}function D4(e,t,r){let o=Gf(e,!1);if(!o)return 0;let n=Wf(e).filter(a=>a.id!==r),i=0;for(let a of n.slice(Math.max(0,t-1))){let s=Ot(o,a.id);try{if(!Kf(o,s)||!Bn(s).isDirectory()||!Bn(Ot(s,"meta.json")).isFile()||!Kf(Jf(o),Jf(s)))continue;$4(s,{recursive:!0,force:!0}),i++}catch{}}return i}function Zn(e,{keepNewlines:t=!0}={}){let r=String(e??"").replace(/\r\n?/g,`
|
|
145
|
+
`);return t?r.replace(/[\u0000-\u0008\u000b-\u001f\u007f-\u009f]/g,""):r.replace(/[\u0000-\u001f\u007f-\u009f]/g," ")}function nP(e,{home:t=Hi(),now:r=new Date,store:o=!0}={}){let n=Lb(e);if(n.length)throw new Error(n.join(" "));let i=new Set,a=0,s=S=>{let T=Cr(S);return a+=T.count,T.kinds.forEach(R=>i.add(R)),T.text},c=s(Zn(e.brief)),l=Db(e.title?.trim()?s(Zn(e.title,{keepNewlines:!1})):c.split(`
|
|
146
|
+
`).find(S=>S.trim())?.replace(/^#+\s*/,"")||"handoff",nn.titleChars),u=(e.verbatim??[]).map(S=>({label:Db(s(Zn(S.label,{keepNewlines:!1})),nn.labelChars),text:s(Zn(S.text))})),d=e.model===void 0?void 0:s(Zn(String(e.model),{keepNewlines:!1})).slice(0,nn.modelChars)||void 0,m=r.toISOString(),f=N4(l,m,c,u),h=`${R4(r)}-${z4(l)}`,y={id:h,title:l,created:m,model:d,tokens:yn(f,d),briefTokens:yn(c,d),blocks:u.map(S=>({label:S.label,tokens:yn(S.text,d)})),masked:a,order:Date.now()*1e3+M4++%1e3},v=j4(y.tokens,{...e,model:d});if(!o)return{meta:y,markdown:f,maskedKinds:[...i],math:v,rotated:0};let p=Gf(t,!0),b="";for(let S=1;S<=200;S++){let T=S===1?h:`${h}-${S}`,R=Ot(p,T);try{YT(R,{mode:448}),y.id=T,b=R;break}catch(w){if(w.code!=="EEXIST")throw new go(`cannot create a handoff folder in ${tn(p,t)} (${w.code??"error"})`)}}if(!b)throw new go(`too many handoffs saved in the same second in ${tn(p,t)}`);try{GT(Ot(b,"handoff.md"),f,{mode:384,flag:"wx"}),GT(Ot(b,"meta.json"),JSON.stringify(y,null,2)+`
|
|
147
|
+
`,{mode:384,flag:"wx"})}catch(S){throw new go(`cannot write the handoff in ${tn(b,t)} (${S.code??"error"})`)}let g=D4(t,nn.kept,y.id);if(!y4(Ot(b,"handoff.md")))throw new go(`the handoff in ${tn(b,t)} is gone`);return{meta:y,markdown:f,dir:b,maskedKinds:[...i],math:v,rotated:g}}function tn(e,t=Hi()){return t&&e.startsWith(t)?"~"+e.slice(t.length):e}function rP(e,t=Hi()){return t&&t.length>1?String(e).split(t).join("~"):String(e)}import{lookup as U4}from"node:dns";import{request as L4}from"node:http";import{request as q4}from"node:https";import{isIP as iP}from"node:net";import{mkdtempSync as V4,rmSync as F4,writeFileSync as Z4}from"node:fs";import{tmpdir as B4}from"node:os";import{extname as H4,join as oP}from"node:path";var zt={files:10,bytes:5*1024*1024,totalBytes:20*1024*1024,timeoutMs:2e4,redirects:3,callMs:6e4},J4={"application/pdf":".pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","application/msword":".doc","application/rtf":".rtf","text/rtf":".rtf","application/vnd.oasis.opendocument.text":".odt","application/vnd.openxmlformats-officedocument.presentationml.presentation":".pptx"};function aP(e=process.env){return e.CONTEXT_DOCTOR_TEST_LOOPBACK_FILES==="1"}function Vb(e){let[t,r]=e.split(".").map(Number),o=Number(e.split(".")[2]);return t===0||t===10||t===127||t>=224||t===169&&r===254||t===172&&r>=16&&r<=31||t===192&&r===168||t===100&&r>=64&&r<=127||t===192&&r===0||t===198&&(r===18||r===19)||t===198&&r===51&&o===100||t===203&&r===0&&o===113||t===192&&r===88&&o===99}function K4(e){let t=e.toLowerCase().replace(/^\[|\]$/g,"").replace(/%.*$/,""),r=t.match(/(\d+\.\d+\.\d+\.\d+)$/);if(r){let[l,u,d,m]=r[1].split(".").map(Number);t=t.slice(0,-r[1].length)+`${(l<<8|u).toString(16)}:${(d<<8|m).toString(16)}`}let[o,n]=t.split("::"),i=o?o.split(":"):[],a=n!==void 0&&n?n.split(":"):[],s=t.includes("::")?8-i.length-a.length:0,c=[...i,...Array(Math.max(0,s)).fill("0"),...a].map(l=>parseInt(l||"0",16));return c.length===8&&c.every(l=>Number.isInteger(l)&&l>=0&&l<=65535)?c:void 0}function sP(e){let t=e.replace(/^\[|\]$/g,""),r=iP(t);if(r===4)return Vb(t);if(r===6){let o=K4(t);return o?o.slice(0,5).every(n=>n===0)&&(o[5]===65535||o[5]===0)?o[5]===0&&o[6]===0&&o[7]<=1?!0:Vb(`${o[6]>>8}.${o[6]&255}.${o[7]>>8}.${o[7]&255}`):o.slice(0,4).every(n=>n===0)&&o[4]===65535&&o[5]===0?Vb(`${o[6]>>8}.${o[6]&255}.${o[7]>>8}.${o[7]&255}`):o[0]===100&&o[1]===65435||o[0]===8194||o[0]===8193&&o[1]===0||(o[0]&65024)===64512||(o[0]&65472)===65152||(o[0]&65280)===65280||o[0]===8193&&o[1]===3512||o[0]===256&&o[1]===0&&o[2]===0&&o[3]===0:!0}return!0}function Fb(e){let t=e.replace(/^\[|\]$/g,"").toLowerCase();return t==="localhost"||t==="::1"||/^127\./.test(t)}function G4(e,t=process.env){let r;try{r=new URL(e)}catch{return{error:"not a URL"}}if(r.username||r.password)return{error:"credentials in the URL"};let o=r.hostname.replace(/^\[|\]$/g,""),n=aP(t)&&Fb(o);return r.protocol!=="https:"&&!(r.protocol==="http:"&&n)?{error:`only https downloads are allowed (got ${r.protocol.replace(":","")})`}:n?{url:r}:/^localhost$|\.localhost$|\.local$|\.internal$/i.test(o.replace(/\.$/,""))?{error:"a local host name"}:iP(o)&&sP(o)?{error:"a private or loopback address"}:{url:r}}function W4(e){return(t,r,o)=>{U4(t,r,(n,i,a)=>{if(n)return o(n);if((Array.isArray(i)?i:[{address:i,family:a??4}]).find(l=>sP(l.address)&&!(e&&Fb(l.address))))return o(Object.assign(new Error(`${t} resolves to a private address`),{code:"EPRIVATE"}));Array.isArray(i)?o(null,i):o(null,i,a)})}}function X4(e,t,r,o){return new Promise(n=>{let i=aP(t)&&Fb(e.hostname),a=e.protocol==="https:"?q4:L4,s=!1,c=m=>{s||(s=!0,clearTimeout(u),n(m))},l=Math.max(1,r-Zt()),u=setTimeout(()=>{d.destroy(),c({status:0,error:"timed out"})},l),d=a(e,{method:"GET",lookup:W4(i),timeout:l,headers:{accept:"*/*","user-agent":"context-doctor"}},m=>{let f=m.statusCode??0;if(f>=300&&f<400)return m.resume(),c({status:f,location:typeof m.headers.location=="string"?m.headers.location:void 0});if(f!==200)return m.resume(),c({status:f,error:`HTTP ${f}`});let h=o<zt.bytes?`over the ${zt.totalBytes/1024/1024} MB total for one call`:`too large (over ${zt.bytes/1024/1024} MB)`,y=Number(m.headers["content-length"]);if(Number.isFinite(y)&&y>o)return d.destroy(),c({status:f,error:h});let v=[],p=0;m.on("data",b=>{if(p+=b.length,p>o){d.destroy(),c({status:f,error:h});return}v.push(b)}),m.on("end",()=>c({status:f,body:Buffer.concat(v)})),m.on("error",b=>c({status:f,error:b.message}))});d.on("timeout",()=>{d.destroy(),c({status:0,error:"timed out"})}),d.on("error",m=>c({status:0,error:m.code==="EPRIVATE"?"refused: the host resolves to a private address":m.message})),d.end()})}async function Y4(e,t=process.env,{deadline:r,maxBytes:o=zt.bytes}={}){let n=Math.min(Zt()+zt.timeoutMs,r??1/0),i=Math.max(0,Math.min(o,zt.bytes)),a=e;for(let s=0;s<=zt.redirects;s++){let c=G4(a,t);if("error"in c)return{error:s===0?`refused: ${c.error}`:`refused a redirect: ${c.error}`};if(Zt()>=n)return{error:"timed out"};let l=await X4(c.url,t,n,i);if(l.error)return{error:l.error};if(l.location!==void 0){if(!l.location)return{error:`HTTP ${l.status} without a location`};try{a=new URL(l.location,c.url).toString()}catch{return{error:"refused a redirect: not a URL"}}continue}return{body:l.body??Buffer.alloc(0)}}return{error:`more than ${zt.redirects} redirects`}}function Q4(e){return((e.file_name??"").split(/[\\/]/).pop()?.replace(/[^\w.\- ]+/g,"_").trim()||String(e.file_id||"file").replace(/[^\w.-]+/g,"_")).slice(0,80)}async function cP(e,t=process.env){let r=[],o=[],n=0,i=Zt()+zt.callMs;for(let a of e.slice(0,zt.files)){let s=Q4(a);if(Zt()>=i){o.push(`${s}: not read, the ${zt.callMs/1e3} s allowed for one call ran out`);continue}let c=await Y4(String(a.download_url??""),t,{deadline:i,maxBytes:zt.totalBytes-n});if("error"in c){o.push(`${s}: ${c.error}`);continue}n+=c.body.length;let l=H4(s).toLowerCase(),u=Lf.has(l)?l:J4[(a.mime_type??"").split(";")[0].trim().toLowerCase()];if(u){let d=V4(oP(B4(),"cd-file-"));try{let m=oP(d,`upload${u}`);Z4(m,c.body,{mode:384});let f=await qf(m,Math.min(Zt()+yc,i));"error"in f?o.push(`${s}: ${f.error}`):r.push({name:s,text:f.text})}finally{F4(d,{recursive:!0,force:!0})}continue}if(c.body.subarray(0,8e3).includes(0)){o.push(`${s}: binary (pack reads text, PDF and Word/PowerPoint/ODT files)`);continue}r.push({name:s,text:c.body.toString("utf8")})}return e.length>zt.files&&o.push(`${e.length-zt.files} more file(s): at most ${zt.files} per call`),{sources:r,skipped:o}}import{isIP as e2}from"node:net";var lP={bodyBytes:10*1024*1024,bodyMs:3e4},t2=["https://chatgpt.com","https://chat.openai.com"],uP=["localhost","127.0.0.1","::1"];function Xf(e){return(e??"").split(",").map(t=>t.trim()).filter(Boolean)}function _c(e){let t=e.trim().toLowerCase();return t.startsWith("[")?t=t.slice(1,t.indexOf("]")>0?t.indexOf("]"):void 0):t.split(":").length===2&&(t=t.split(":")[0]),t.replace(/\.$/,"")}function dP(e,t,r,o=process.env,n={}){let i=[...Xf(t),...Xf(o.CONTEXT_DOCTOR_ALLOWED_HOSTS)],a=new Set([...t2,...Xf(r),...Xf(o.CONTEXT_DOCTOR_ALLOWED_ORIGINS)].map(l=>l.toLowerCase().replace(/\/+$/,"")));if(i.includes("*"))return{hosts:"*",origins:a,ipLiterals:n.ipLiterals};let s=_c(e),c=new Set([...uP,...i.map(_c)]);return s&&s!=="0.0.0.0"&&s!=="::"&&c.add(s),{hosts:c,origins:a,ipLiterals:n.ipLiterals}}function mP(e,t=!1){let r=_c(e.includes(":")&&!e.startsWith("[")?`[${e}]`:e);if(!(r==="localhost"||r==="::1"||/^127\.\d+\.\d+\.\d+$/.test(r)||/^::ffff:127\./.test(r)))return`WARNING: listening on ${e}, beyond this machine, with no sign-in: anyone who can reach it can call its tools${t?" and save handoffs here (--store-handoffs)":""}.
|
|
148
|
+
Put it behind your tunnel's or reverse proxy's authentication unless only you can reach this address.`}function fP(e,t=8808){let r=Number(e);return e!==void 0&&e.trim()!==""&&Number.isInteger(r)&&r>=0&&r<=65535?r:t}function pP(e,t){if(e.hosts!=="*"){let o=_c(String(t.host??""));if(!o)return"the request has no Host header";if(!e.hosts.has(o)&&!(e.ipLiterals&&e2(o)))return`Host "${o}" is not one this server answers to. Behind a tunnel or under a host name, start it with --allowed-hosts ${o}`}let r=t.origin;if(r!==void 0){let o=String(r).toLowerCase().replace(/\/+$/,"");if(e.origins.has(o))return;let n;try{n=new URL(o)}catch{return`Origin "${o}" is not allowed`}let i=_c(n.host);if(!(uP.includes(i)||e.hosts!=="*"&&e.hosts.has(i)))return`Origin "${o}" is not allowed. To let a web page call this server, start it with --allowed-origins ${o}`}}function hP(e,t=lP.bodyBytes,r=lP.bodyMs){return new Promise(o=>{let n=!1,i=setTimeout(()=>{n||(n=!0,o({status:408,code:-32600,message:`the request body did not arrive within ${Math.round(r/1e3)} s`}))},r),a=d=>{clearTimeout(i),o(d)},s={status:413,code:-32600,message:`request body over ${Math.round(t/1024/1024)} MB`},c=Number(e.headers["content-length"]);if(Number.isFinite(c)&&c>t)return e.resume(),a(s);let l=[],u=0;e.on("data",d=>{if(!n){if(u+=d.length,u>t)return n=!0,l.length=0,e.resume(),a(s);l.push(d)}}),e.on("end",()=>{if(!n){n=!0;try{a({value:JSON.parse(Buffer.concat(l).toString("utf8"))})}catch{a({status:400,code:-32700,message:"Parse error: the body is not JSON"})}}}),e.on("error",()=>{n||(n=!0,a({status:400,code:-32700,message:"the request body could not be read"}))})})}import{closeSync as c2,existsSync as Yf,openSync as l2,readdirSync as Qf,readSync as u2,statSync as Hb}from"node:fs";import{homedir as Jb}from"node:os";import{basename as bP,dirname as d2,isAbsolute as m2,join as vo,resolve as SP}from"node:path";import{readdirSync as aB,readFileSync as sB,statSync as cB,existsSync as lB,openSync as n2,readSync as r2,closeSync as o2}from"node:fs";import{StringDecoder as i2}from"node:string_decoder";import{homedir as a2}from"node:os";import{join as s2}from"node:path";function gP(e,t=a2()){return s2(Qt(t),"projects",e.replace(/[^A-Za-z0-9]/g,"-"))}function Zb(e,t){let r=n2(e,"r"),o=new i2("utf8"),n=Buffer.allocUnsafe(4*1024*1024),i="";try{for(;;){let a=r2(r,n,0,n.length,null);if(a===0)break;i+=o.write(n.subarray(0,a));let s;for(;(s=i.indexOf(`
|
|
149
|
+
`))!==-1;)t(i.slice(0,s)),i=i.slice(s+1)}i+=o.end(),i&&t(i)}finally{o2(r)}}var $c=2e5,f2=8e6,vP=16384;function Bb(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>typeof t=="string"?t:typeof t?.text=="string"?t.text:t?.type==="image"||t?.type==="input_image"?"[image]":"").filter(Boolean).join(`
|
|
150
|
+
`):""}function p2(e){if(e.length<=$c)return{whole:e};let t=$c/2;return{head:e.slice(0,t+vP),tail:e.slice(-(t+vP)),length:e.length}}var yP=e=>"whole"in e?e.whole.length:$c;function h2(e){if("whole"in e){let s=Cr(Zn(e.whole));return{text:s.text,masked:s.count}}let t=$c/2,r=Cr(Zn(e.head)),o=Zn(e.tail),n=0,i=/-----END [A-Z0-9 ]*PRIVATE KEY(?: BLOCK)?-----/.exec(o);i&&!/-----BEGIN [A-Z0-9 ]*PRIVATE KEY/.test(o.slice(0,i.index))&&(o=`[private key masked by context-doctor]${o.slice(i.index+i[0].length)}`,n=1);let a=Cr(o);return{text:`${r.text.slice(0,t)}
|
|
151
|
+
[\u2026 ${e.length-$c} characters \u2026]
|
|
152
|
+
${a.text.slice(-t)}`,masked:r.count+a.count+n}}function _P(e,t){let r=t??{},o=["command","file_path","path","pattern","url","query","cmd","description","prompt"].find(i=>typeof r[i]=="string"),n=o?String(r[o]):typeof t=="string"?t:JSON.stringify(t??"");return`${e}: ${n.slice(0,2e3)}`}function g2(e,t=f2){let r=[],o=0,n=0,i=0,a=0,s=/[\\/]subagents[\\/]agent-[^\\/]*\.jsonl$/.test(e)||void 0,c=new Map,l=(m,f,h)=>{let y=h.trim();if(!y)return;i++;let v=p2(y);for(r.push({n:i,at:typeof m=="string"?m:void 0,kind:f,raw:v,compactedBy:0,c:a}),n+=yP(v);n>t&&o<r.length-1;)n-=yP(r[o].raw),r[o].raw={whole:""},o++;o>1024&&(r.splice(0,o),o=0),c.size>1e5&&c.clear()};Zb(e,m=>{let f;try{f=JSON.parse(m)}catch{return}if(!f||typeof f!="object")return;if(f.payload&&typeof f.payload=="object"&&typeof f.type=="string"&&!f.message){let v=f.payload;if(f.type==="compacted"||v.type==="context_compacted"){a++;return}if(f.type!=="response_item")return;if(v.type==="message"&&(v.role==="user"||v.role==="assistant"))return l(f.timestamp,v.role,Bb(v.content));if(v.type==="function_call"||v.type==="custom_tool_call"||v.type==="local_shell_call"){let p=String(v.name??(v.type==="local_shell_call"?"shell":v.type));typeof v.call_id=="string"&&c.set(v.call_id,p);let b=v.arguments??v.input??v.action;if(typeof b=="string")try{b=JSON.parse(b)}catch{}return l(f.timestamp,"tool call",_P(p,b))}return/_call_output$/.test(String(v.type))?l(f.timestamp,`tool output (${c.get(v.call_id)??"tool"})`,Bb(v.output)):void 0}if(f.type==="system"&&f.subtype==="compact_boundary"){a++;return}if(f.isCompactSummary)return;let h=f.message;if(!h||(s===void 0&&(s=f.isSidechain===!0),f.isSidechain&&!s))return;let y=h.content;if(f.type==="user"){if(typeof y=="string")return l(f.timestamp,"user",y);if(!Array.isArray(y))return;for(let v of y)v?.type==="tool_result"?l(f.timestamp,`tool output (${c.get(v.tool_use_id)??"tool"})`,Bb(v.content)):typeof v?.text=="string"&&l(f.timestamp,"user",v.text);return}if(f.type==="assistant"&&Array.isArray(y))for(let v of y)v?.type==="text"?l(f.timestamp,"assistant",String(v.text??"")):v?.type==="tool_use"&&(typeof v.id=="string"&&c.set(v.id,String(v.name??"tool")),l(f.timestamp,"tool call",_P(String(v.name??"tool"),v.input)))});let u=0;return{entries:r.slice(o).map(({c:m,raw:f,...h})=>{let y=h2(f);return u+=y.masked,{...h,text:y.text,compactedBy:a-m}}),total:i,compactions:a,masked:u}}function v2(e){try{let t=l2(e,"r");try{let r=Buffer.alloc(65536),o=u2(t,r,0,r.length,0),n=r.subarray(0,o).toString("utf8").split(`
|
|
153
|
+
`)[0],i=JSON.parse(n)?.payload?.cwd;return typeof i=="string"?i:void 0}finally{c2(t)}}catch{return}}function $P(e){let t;try{for(let r of Qf(e)){if(!r.endsWith(".jsonl"))continue;let o=vo(e,r),n=Hb(o).mtimeMs;(!t||n>t.at)&&(t={path:o,at:n})}}catch{}return t}function y2(e,t){let r=vo(ho(t),"sessions");if(!Yf(r))return;let o=Date.now()-7*864e5,n=[],i=(a,s)=>{let c;try{c=Qf(a)}catch{return}for(let l of c){let u=vo(a,l),d;try{d=Hb(u)}catch{continue}d.isDirectory()?s<3&&i(u,s+1):l.endsWith(".jsonl")&&d.mtimeMs>=o&&n.push({path:u,at:d.mtimeMs})}};return i(r,0),n.sort((a,s)=>s.at-a.at).find(a=>v2(a.path)===SP(e))}function wP(e=process.env,t=process.cwd(),r=Jb(),o={}){let n=e.CLAUDE_CODE_SESSION_ID?.trim();if(n&&/^[\w.-]+$/.test(n)){let s=_2(n,r);if(s&&s.endsWith(`${n}.jsonl`)){if(o.envMayBeStale){let c=$P(d2(s));if(c&&c.path!==s&&c.at>Hb(s).mtimeMs)return{path:c.path,how:`the newest Claude Code session in this project (${bP(c.path,".jsonl")}; CLAUDE_CODE_SESSION_ID still names ${n}, as after /clear)`}}return{path:s,how:`this Claude Code session (${n})`}}}let i=$P(gP(t,r)),a=y2(t,r);return a&&(!i||a.at>i.at)?{path:a.path,how:"the newest Codex session started in this folder"}:i?{path:i.path,how:"the newest Claude Code session in this folder"}:void 0}function _2(e,t=Jb()){if((m2(e)||e.includes("/")||e.includes("\\"))&&Yf(e))return SP(e);if(!/^[\w.-]+$/.test(e))return;let r=vo(Qt(t),"projects"),o=[];try{o=Qf(r)}catch{}for(let s of o){let c=vo(r,s,`${e}.jsonl`);if(Yf(c))return c}let n=vo(ho(t),"sessions"),i,a=(s,c)=>{if(i)return;let l;try{l=Qf(s)}catch{return}for(let u of l){let d=vo(s,u);if(u.endsWith(".jsonl")&&u.includes(e)){i=d;return}c<3&&!u.includes(".")&&a(d,c+1)}};return Yf(n)&&a(n,0),i}function kP(e,t,r={}){let o=g2(e),{entries:n,compactions:i}=o,a=new Map,s=n.map(f=>{let h=`#${f.n}`;return a.set(h,f),{name:h,text:f.text}}),c=Math.max(200,r.budget??2e3),l=AT(s,{query:t,budget:c,maxChunkTokens:300}),u=f=>f.compactedBy===0?"in context":`before compaction ${i-f.compactedBy+1} of ${i}`,d=[...l.selected].sort((f,h)=>h.score-f.score).map(f=>{let h=a.get(f.source);return{id:f.id,n:h.n,at:h.at,kind:h.kind,where:u(h),tokens:f.tokens,score:f.score,text:f.text}}),m=l.chunks.filter(f=>f.score>0&&!l.selected.includes(f)).length;return{path:e,how:r.how??"the session named",query:t,entries:o.total,compactions:i,totalTokens:l.totalTokens,hits:d,masked:o.masked,more:m,leftOut:o.total-n.length}}function zP(e,t=Jb()){let r=bP(e.path).replace(/\.jsonl$/,"").slice(0,48),o=[`RECALL from ${e.how}${e.how.includes(r)?"":` (${r})`}: ${e.entries} entries, ~${ue(e.totalTokens)} tokens, ${e.compactions} compaction${e.compactions===1?"":"s"}.`];if(!e.hits.length)return o.push(`Nothing in it matches "${e.query}". Try the words the output itself would use (a file name, an error, a command).`),o.join(`
|
|
154
|
+
`);o.push(`Best ${e.hits.length} excerpt${e.hits.length===1?"":"s"} for "${e.query}", best first${e.more?` (${e.more} more matched; a narrower query or a larger max_tokens gets them)`:""}:`),e.masked&&o.push(`${e.masked} secret-looking string${e.masked===1?"":"s"} masked.`),e.leftOut&&o.push(`The oldest ${e.leftOut} entries were not searched: the transcript is that large.`);for(let n of e.hits){let i=n.at?n.at.slice(0,16).replace("T"," ")+" UTC":"time not recorded";o.push("",`\u2500\u2500 entry ${n.n} of ${e.entries} \xB7 ${i} \xB7 ${n.kind} \xB7 ${n.where} \xB7 ~${ue(n.tokens)}`,n.text)}return o.join(`
|
|
155
|
+
`).replaceAll(t,"~")}var b2=["dedupe","trim-tool-results","trim-tool-calls","strip-base64","prune-history"],S2={approx_tokens:1e7,approx_lines:1e6,approx_words:5e6,approx_chars:4e7};function Kb(e,t,r){if(BT(e)==="full")return{content:[{type:"text",text:t}]};let o=r();return{content:[{type:"text",text:o.text}],structuredContent:o.structured,_meta:o.meta}}var ep={ttlMs:864e5,cacheScope:"private"},RP="consent",tp="the consent form failed, so nothing was assumed";function w2(e){return e.mcpReq.envelope?.["io.modelcontextprotocol/clientCapabilities"]}function IP(e,t){return e===void 0?!0:!e||typeof e!="object"||Array.isArray(e)?!1:Object.entries(e).every(([r,o])=>r in t&&typeof o=="boolean")}async function xP(e,t,r,o){if(t.mcpReq.envelope){if(!w2(t)?.elicitation?.form)return{asked:!1};let n=sc(t.mcpReq.inputResponses,RP);return n.kind==="missing"?{pending:ac({inputRequests:{[RP]:ac.elicit({mode:"form",message:r,requestedSchema:{type:"object",properties:o}})}})}:n.kind!=="elicit"?{asked:!0,ok:!1,content:{},why:tp}:n.action==="accept"?IP(n.content,o)?{asked:!0,ok:!0,content:n.content??{}}:{asked:!0,ok:!1,content:{},why:tp}:{asked:!0,ok:!1,content:{},why:n.action==="decline"?"the user declined":"the user dismissed the prompt"}}if(!e.server.getClientCapabilities()?.elicitation?.form)return{asked:!1};try{let n=await t.mcpReq.elicitInput({mode:"form",message:r,requestedSchema:{type:"object",properties:o}},{timeout:12e4});return n.action==="accept"?IP(n.content,o)?{asked:!0,ok:!0,content:n.content??{}}:{asked:!0,ok:!1,content:{},why:tp}:{asked:!0,ok:!1,content:{},why:n.action==="decline"?"the user declined":"the user dismissed the prompt"}}catch(n){return n instanceof be&&n.code===ke.RequestTimeout?{asked:!0,ok:!1,content:{},why:"no answer within two minutes"}:{asked:!0,ok:!1,content:{},why:tp}}}function Gb({http:e=!1,storeHandoffs:t=!e}={}){let r=!e,o=new Vn({name:"context-doctor",version:"0.48.0"},{instructions:ZT,maxToolInputElements:1e4,cacheHints:{"tools/list":ep,"prompts/list":ep,"resources/templates/list":ep,"server/discover":ep}});o.registerTool("profile_context",{description:"Profile a conversation's context: token breakdown, largest blocks, wasted context. Pass `conversation` (JSON or text) or, in a chat app, a `sketch` (~120 tokens). Call it when the user asks about tokens, cost, speed or limits, and once past ~30 turns or 3+ large pastes. Act on the top finding.",inputSchema:ge.object({conversation:ge.string().optional().describe("JSON or text; in a chat app pass `sketch`"),sketch:ge.object({turns:ge.number().int().nonnegative().describe("Exchanges so far"),model:ge.string().optional(),blocks:ge.array(ge.object({turn:ge.number().int().positive(),kind:ge.enum(["paste","code","tool_result","image","base64","text"]),label:ge.string().describe("Short name"),approx_tokens:ge.number().optional(),approx_lines:ge.number().optional(),approx_words:ge.number().optional(),approx_chars:ge.number().optional(),repeated:ge.number().int().optional().describe("Times it appears (2+ = duplicate)"),stale:ge.boolean().optional().describe("Acted on, no longer needed")})).describe("Only blocks over ~500 tokens, repeated, or images.")}).optional().describe("For chat apps. One size hint per block: lines for code, words for prose, chars for logs."),model:ge.string().optional().describe("e.g. claude-sonnet-5")}),annotations:{title:"Profile context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},async({conversation:a,sketch:s,model:c},l)=>{if(s){let m=v=>({isError:!0,content:[{type:"text",text:v}]});if(s.turns>1e5)return m(`sketch.turns is ${s.turns}; the most that makes sense is 100000.`);if(s.blocks.length>500)return m(`sketch.blocks has ${s.blocks.length} blocks; list at most 500 (only those over ~500 tokens, repeated, or images).`);for(let[v,p]of s.blocks.entries()){if(p.turn>1e5)return m(`sketch.blocks[${v}].turn is ${p.turn}; the most that makes sense is 100000.`);if(p.repeated!==void 0&&(p.repeated<1||p.repeated>1e3))return m(`sketch.blocks[${v}].repeated is ${p.repeated}; give 1 to 1000.`);for(let[b,g]of Object.entries(S2)){let S=p[b];if(typeof S=="number"&&!(S>0))return m(`sketch.blocks[${v}].${b} is ${S}; a size is above 0.`);if(typeof S=="number"&&S>g)return m(`sketch.blocks[${v}].${b} is ${S}; the most that makes sense is ${g}. Give a rough size of the block itself.`)}}let f=a?"Note: both `conversation` and `sketch` were passed; profiled the sketch only. Pass one.\n\n":"",h=cT({...s,model:s.model??c},{record:!e}),y=f+sT(h);return Kb(l.mcpReq._meta,y,()=>{let v=JT(h,y);return{...v,text:f+v.text}})}if(!a)return{isError:!0,content:[{type:"text",text:"Pass either `conversation` (full JSON or text) or `sketch` (turns + large/repeated blocks). In a chat app, use `sketch`."}]};let u=Yx(Ax(a),c),d=oT(u);return Kb(l.mcpReq._meta,d,()=>HT(u,d))}),o.registerTool("optimize_context",{description:"Rewrite a conversation to reclaim tokens (dedupe, trim stale tool results, strip base64; prune-history is lossy). Returns slimmed JSON and the savings. Use after profile_context finds waste the user wants fixed; prune-history only with the user's consent, then write the summary the result asks for.",inputSchema:ge.object({conversation:ge.string().describe("Conversation JSON"),strategies:ge.array(ge.enum(b2)).optional().describe("Default: dedupe, trim-tool-results, strip-base64"),keep_recent:ge.number().int().nonnegative().optional().describe("Tail messages kept (default 6)"),max_tool_result_tokens:ge.number().int().positive().optional().describe("Per trimmed result (default 300)")}),annotations:{title:"Optimize context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},async({conversation:a,strategies:s,keep_recent:c,max_tool_result_tokens:l},u)=>{let d="";if(s?.includes("prune-history")){let b=await xP(o,u,`Prune old turns from this conversation? It is lossy: all but the last ${Math.max(2,c??6)} messages are replaced by a summary the assistant writes.`,{prune:{type:"boolean",title:"Replace old turns with a summary",default:!0}});if("pending"in b)return b.pending;b.asked&&(!b.ok||b.content.prune===!1)&&(s=s.filter(g=>g!=="prune-history"),d=`
|
|
156
|
+
prune-history skipped: ${b.ok?"the user unticked it":b.why}.`)}let m=nT(a,{strategies:s,keepRecent:c,maxToolResultTokens:l}),f=m.tokensBefore-m.tokensAfter;f>0&&!e&&Mf({ev:"optimize",src:"mcp",saved:f,model:m.conversation?.model});let h=`Saved ~${ue(f)} tokens (${ue(m.tokensBefore)} \u2192 ${ue(m.tokensAfter)}) via ${m.applied.length} change(s):
|
|
157
|
+
`+m.applied.map(b=>`- [${b.strategy}] message #${b.messageIndex}: ${b.note} (~${ue(b.tokensSaved)})`).join(`
|
|
158
|
+
`)+d,y=1e5,v=JSON.stringify(m.conversation),p=[{type:"text",text:h},v.length<=y?{type:"text",text:v}:{type:"text",text:`[optimized conversation is ${v.length} chars \u2014 too large to echo into this context. Tell the user the savings above and that \`npx context-doctor optimize <file> --out slim.json\` produces the file directly.]`}];return m.prunedDigest&&p.push({type:"text",text:`ACTION REQUIRED (you, the assistant calling this tool): the pruned turns are digested below. Write a dense factual summary of them (\u2264150 tokens: decisions, current state, open items, key identifiers) and replace the '[context-doctor: ... pruned]' stub message in the conversation above with your summary before presenting the result.
|
|
114
159
|
|
|
115
160
|
PRUNED TURNS DIGEST:
|
|
116
|
-
`+
|
|
117
|
-
Skipped: ${
|
|
161
|
+
`+m.prunedDigest}),{content:p}});let n=ge.object({download_url:ge.string(),file_id:ge.string(),mime_type:ge.string().optional(),file_name:ge.string().optional()}).strict(),i={...e?{}:{paths:ge.array(ge.string()).optional().describe("Files or folders, absolute paths")},text:ge.string().optional().describe("Raw text to pack instead of files"),query:ge.string().optional().describe("The question; omit for an outline"),max_tokens:ge.number().int().positive().optional().describe("Budget, default 4000"),ids:ge.array(ge.string()).optional().describe("Chunk ids, e.g. docs/guide.md#4"),model:ge.string().optional().describe("Model to count for"),...e?{files:ge.array(n).optional().describe("Files the user uploaded")}:{semantic:ge.boolean().optional().describe("Also rank by meaning (local Ollama embeddings)")}};if(o.registerTool("pack_context",{description:"Read only the parts of large files a question needs: the chunks that best match `query` within `max_tokens`, with ids and line ranges. No query: an outline; pick with `ids`. Use instead of reading a big doc, log or folder whole when not editing it. Text, code, PDF, Word, PowerPoint, ODT.",inputSchema:ge.object(i),annotations:{title:"Pack context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},...e?{_meta:{"openai/fileParams":["files"]}}:{}},async(a,s)=>{let{paths:c,text:l,query:u,max_tokens:d,ids:m,model:f,semantic:h,files:y}=a,v=P=>({content:[{type:"text",text:P}],isError:!0});if((c?.length??0)>50)return v(`${c.length} paths; pass at most 50 (a folder counts as one).`);if((m?.length??0)>200)return v(`${m.length} ids; ask for at most 200.`);if(d!==void 0&&d>2e5)return v(`max_tokens ${d}; the most is 200000.`);if(c?.length&&!r)return v("This server runs over HTTP and does not read files. Pass the document as `text`, or attach it (`files`).");let p=P=>Ab(P)??Ab($2(P)),b=(c??[]).flatMap(P=>{let U=p(P);return U?[`${P}: refused, ${U}`]:[]}),g=(c??[]).filter(P=>!p(P)),{sources:S,skipped:T}=g.length?await FT(g):{sources:[],skipped:[]};if(T.unshift(...b),e&&y?.length){let P=await cP(y);S.push(...P.sources),T.push(...P.skipped)}if(l&&S.push({name:"text",text:l}),S.length===0)return v(T.length?`Nothing readable: ${T.join("; ")}`:r?"Pass `paths` (files or folders) or `text`.":"This server runs over HTTP and reads no files from its own disk: pass the user's upload as `files`, or the document as `text`.");let R=await MT(S,{query:u,budget:d,ids:m,model:f,semantic:e?void 0:h}),w=T.length?`
|
|
162
|
+
Skipped: ${T.slice(0,10).join("; ")}${T.length>10?` (+${T.length-10} more)`:""}`:"",z=UT(R)+w;return R.mode!=="outline"?{content:[{type:"text",text:z}]}:Kb(s.mcpReq._meta,z,()=>{let P=KT(R,z);return{...P,text:P.text+w}})}),o.registerPrompt("context_checkup",{description:"Profile this conversation's context and apply the top fix. One click, no typing."},async()=>({messages:[{role:"user",content:{type:"text",text:"Run profile_context on our conversation so far: pass a `sketch` (turn count, the model you are running as, and every block over ~500 tokens, repeated, or an image; one size hint each). Report the total, the top three findings, and the estimated recoverable tokens in under 120 words. Then, if the top finding is recoverable, apply it: summarize the offending content into the points still needed and tell me what you dropped. Do not re-quote the content you are summarizing."}}]})),o.registerPrompt("handoff",{title:"Hand off to a new chat",description:"Write a short brief of this chat, save it, and continue in a new chat: the only way to cut a long chat's cost.",argsSchema:ge.object({focus:ge.string().max(200).optional().describe("What the next chat should work on (optional)")})},async({focus:a})=>({messages:[{role:"user",content:{type:"text",text:`Hand this chat off to a new one. Write a dense brief of at most ${nn.briefTargetTokens} tokens: the goal, decisions made (with the reason in a few words), the current state, open items and the next step, and key identifiers (names, paths, IDs, versions, numbers). Leave out what is finished or no longer needed. Separately, list only the blocks that must stay exact (code, config, commands, figures), each with a short label. Then call save_handoff with the brief, those blocks as \`verbatim\`, a short title, the model you run as, and \`chat_tokens\` if you have a profile_context figure (else \`turns\`). Do not write the brief into this reply before the call. After it, tell me in two lines how to continue, as its result says.`+(a?.trim()?` The next chat will work on: ${a.trim()}`:"")}}]})),o.registerPrompt("ask_file",{title:"Ask a big file",description:"Answer from a big file or folder without reading it whole: pack_context returns only the parts the question needs.",argsSchema:ge.object({path:ge.string().max(1e3).describe("Absolute path to the file or folder"),question:ge.string().max(2e3).describe("What you want to know from it")})},async({path:a,question:s})=>({messages:[{role:"user",content:{type:"text",text:`Answer from ${JSON.stringify(a)} without pasting or reading it whole: ${s}
|
|
118
163
|
|
|
119
|
-
Call pack_context with paths [${JSON.stringify(
|
|
120
|
-
`)[0]).text.slice(0,80)}"${
|
|
121
|
-
`)}]}}),e
|
|
122
|
-
`)}]})),
|
|
164
|
+
Call pack_context with paths [${JSON.stringify(a)}] and the question as \`query\`. Answer from the chunks it returns and cite their ids. If they do not hold the answer, call it again with the ids it names as next best, or with no query for an outline to pick from; do not read the file whole. If pack_context cannot read paths here, ask me to attach or paste the file, and pass it as \`files\` or \`text\`.`}}]})),o.registerTool("save_handoff",{description:`Save a handoff for continuing in a new chat (a chat's history cannot be cut; a new chat can). Write \`brief\` yourself (\u2264${nn.briefTargetTokens} tokens: goal, decisions, state, open items, identifiers); put what must stay exact in \`verbatim\`. Only when the user agrees.`,inputSchema:ge.object({brief:ge.string(),verbatim:ge.array(ge.object({label:ge.string(),text:ge.string()})).optional().describe("Code, config, figures"),title:ge.string().optional(),chat_tokens:ge.number().optional().describe("Chat size, from profile_context"),turns:ge.number().optional(),model:ge.string().optional()}),annotations:{title:"Save handoff",readOnlyHint:!t,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}},async({brief:a,verbatim:s,title:c,chat_tokens:l,turns:u,model:d},m)=>{let f={brief:a,verbatim:s,title:c,model:d,chatTokens:l,turns:u},h=Lb(f);if(h.length)return{isError:!0,content:[{type:"text",text:`Not saved: ${h.join(" ")}`}]};let y=s;if(t){let S=s?.length??0,T=await xP(o,m,`Save a handoff of this chat on this computer (${tn(Ub())}) to start a new chat from? "${Cr(c??a.split(`
|
|
165
|
+
`)[0]).text.slice(0,80)}"${S?`, with ${S} verbatim block(s): ${Cr(s.map(R=>R.label).join(", ")).text.slice(0,200)}`:""}.`,S?{include_verbatim:{type:"boolean",title:"Include the verbatim blocks",default:!0}}:{});if("pending"in T)return T.pending;if(T.asked&&!T.ok)return{content:[{type:"text",text:`Not saved: ${T.why}. Do not retry; ask the user in the chat if they still want a handoff.`}]};T.asked&&T.content.include_verbatim===!1&&(y=void 0)}let v;try{v=nP({...f,verbatim:y},{store:t})}catch(S){let T=rP(S.message);return{isError:!0,content:[{type:"text",text:`Not saved: ${e?"the server could not store the handoff":T}.`}]}}let p=v.meta,b=`brief ~${ue(p.briefTokens)}${p.blocks.length?`, ${p.blocks.length} verbatim block(s) ~${ue(p.blocks.reduce((S,T)=>S+T.tokens,0))}`:""}`,g=[v.dir?`Handoff saved: ${p.id} (~${ue(p.tokens)} tokens: ${b}) in ${tn(v.dir)}.`:`Handoff ready (~${ue(p.tokens)} tokens: ${b}), not stored: this server runs over HTTP and keeps nothing.`];return p.masked>0&&g.push(`Masked ${p.masked} secret-looking string(s) (${v.maskedKinds.join(", ")}) before saving; the user re-adds them by hand in the new chat if needed.`),p.briefTokens>nn.briefTargetTokens&&g.push(`The brief is ~${p.briefTokens} tokens; the target is \u2264${nn.briefTargetTokens}. It is saved; tighter is cheaper next time.`),g.push(tP(v.math)),v.dir?(g.push(e?"Now print the brief and the verbatim blocks in one fenced block, and tell the user to start a new chat with it as the first message (or, on the machine running this server, `context-doctor handoff latest --copy`). Then stop working in this chat.":"Now tell the user, in two lines: open a new chat and attach the resource handoff://latest (Claude Desktop: + menu, context-doctor), or paste the handoff; `context-doctor handoff latest --copy` copies it. Where attaching is not possible (ChatGPT, the web, phones), print the brief and the verbatim blocks in one fenced block to paste. Then stop working in this chat."),e||o.server.sendResourceListChanged().catch(()=>{})):g.push("Now print the brief and the verbatim blocks in one fenced block, and tell the user to start a new chat with it as the first message. Then stop working in this chat."),{content:[{type:"text",text:g.join(`
|
|
166
|
+
`)}]}}),t&&!e){let a="No handoff saved yet. In a long chat, pick the `handoff` prompt (+ menu) or ask for a handoff; the assistant saves it with save_handoff.";o.registerResource("handoff-latest","handoff://latest",{title:"Latest handoff",description:"The newest saved handoff: attach it to a new chat to continue there.",mimeType:"text/markdown"},async s=>({contents:[{uri:s.href,mimeType:"text/markdown",text:qb("latest")?.markdown??a}]})),o.registerResource("handoff",new If("handoff://{id}",{list:async()=>({resources:Wf().slice(0,20).map(s=>({uri:`handoff://${s.id}`,name:s.id,title:s.title,description:`~${ue(s.tokens)} tokens, saved ${s.created.slice(0,16).replace("T"," ")} UTC`,mimeType:"text/markdown"}))})}),{title:"Saved handoff",description:"A saved handoff, by id.",mimeType:"text/markdown"},async(s,{id:c})=>{let l=qb(String(Array.isArray(c)?c[0]:c));if(!l)throw new de(Q.InvalidParams,`No saved handoff at ${s.href}. List them with resources/list, or run \`context-doctor handoff list\`.`);return{contents:[{uri:s.href,mimeType:"text/markdown",text:l.markdown}]}})}return r&&o.registerTool("recall",{description:"Search this session's transcript on disk (compacted turns, cleared tool output) for `query`: best excerpts with time and position. Use before asking the user again.",inputSchema:ge.object({query:ge.string(),max_tokens:ge.number().optional()}),annotations:{title:"Recall",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},async({query:a,max_tokens:s})=>{let c=wP(process.env,process.cwd(),void 0,{envMayBeStale:!0});if(!c)return{isError:!0,content:[{type:"text",text:"No transcript of this session on disk (Claude Code and Codex keep one; chat apps do not)."}]};let l=Math.min(2e4,Math.max(200,Math.floor(Number(s)||2e3))),u=kP(c.path,a,{budget:l,how:c.how});return{content:[{type:"text",text:zP(u)}]}}),o.registerTool("context_best_practices",{description:"Checklist for keeping context lean and prompts cacheable, optionally per provider.",inputSchema:ge.object({provider:ge.enum(["general","anthropic","openai"]).optional().describe("Default: general")}),annotations:{title:"Context best practices",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},async({provider:a})=>({content:[{type:"text",text:[...TP.general,...a&&a!=="general"?TP[a]:[]].map((c,l)=>`${l+1}. ${c}`).join(`
|
|
167
|
+
`)}]})),k2(o),o}function k2(e){let t=e.server._requestHandlers,r=t?.get("tools/list");if(!t||!r)return;let o=n=>{if(Array.isArray(n))return n.forEach(o);if(!n||typeof n!="object")return;let i=n;i.maximum===Number.MAX_SAFE_INTEGER&&delete i.maximum,i.minimum===-Number.MAX_SAFE_INTEGER&&delete i.minimum,Object.values(i).forEach(o)};t.set("tools/list",async(n,i)=>{let a=await r(n,i);for(let s of a?.tools??[])s.inputSchema&&(delete s.inputSchema.$schema,o(s.inputSchema));return a})}var TP={general:["Put stable content first (system prompt, tool definitions, reference docs) and volatile content last \u2014 prompt caches match byte-identical prefixes only.","Truncate or summarize tool results before they enter history; keep only what the model actually needs downstream.","Never inline base64/binary data in text content \u2014 use file/image APIs.","Summarize and drop conversation history past ~30-40 turns; models lose the middle of long contexts well before the hard limit.","Deduplicate: if the same document/result appears twice, replace later copies with a reference.","Measure before optimizing \u2014 profile the conversation to find the actual heavy hitters."],anthropic:["Use prompt caching with cache_control breakpoints after your stable prefix: cached reads cost 2.5-10% of input depending on the model, and cache writes 1.25x input (5-minute cache) or 2x (1-hour cache).","Current Claude generations have a 1M-token window (Haiku 200k), but quality degrades under heavy fill; aim to stay under ~70%.","For agents: prefer compact tool-result summaries in history and re-fetch details on demand."],openai:["Prefix caching is automatic for prompts >1024 tokens \u2014 but only on byte-identical prefixes, so keep the front of your prompt stable.","Use max_completion_tokens headroom math: input + output must fit the window together."]};function z2(e,t,r){let o=new Headers,n=e.rawHeaders;for(let i=0;i<n.length;i+=2){let a=n[i].toLowerCase();a==="accept"||a==="content-length"||a==="transfer-encoding"||a==="connection"||o.append(a,n[i+1])}return o.set("accept",t),new Request(`http://${e.headers.host??"localhost"}${e.url??"/mcp"}`,{method:e.method,headers:o,signal:r})}async function R2(e,t){if(e.statusCode=t.status,t.headers.forEach((o,n)=>e.setHeader(n,o)),!t.body){e.end();return}e.flushHeaders();let r=t.body.getReader();try{for(;;){let{done:o,value:n}=await r.read();if(o)break;e.write(n)||await new Promise(i=>e.once("drain",i))}}finally{e.end()}}var np=process.argv.slice(2);if(np.includes("--http")){let e=m=>{let f=np.indexOf(m);return f>=0?np[f+1]:void 0},t=fP(e("--port")),r=e("--host")??"127.0.0.1",o=np.includes("--store-handoffs"),n=dP(r,e("--allowed-hosts"),e("--allowed-origins")),{createServer:i}=await import("node:http"),{WebStandardStreamableHTTPServerTransport:a,createMcpHandler:s,isJsonContentType:c,isLegacyRequest:l}=await Promise.resolve().then(()=>(cb(),Cx)),u=s(()=>Gb({http:!0,storeHandoffs:o}),{legacy:"reject"}),d=i(async(m,f)=>{try{if(m.url==="/health"){f.setHeader("content-type","application/json"),f.end(JSON.stringify({ok:!0,service:"context-doctor-mcp"}));return}let h=(m.url??"").split("?")[0];if(h!=="/mcp"&&h!=="/mcp/"){f.statusCode=404,f.end(JSON.stringify({error:"MCP endpoint is /mcp"}));return}let y=(w,z,P)=>{let U=()=>{f.writableEnded||(f.statusCode=w,f.setHeader("content-type","application/json"),(w===413||w===408)&&f.setHeader("connection","close"),f.end(JSON.stringify({jsonrpc:"2.0",error:{code:z,message:P},id:null})),(w===413||w===408)&&setTimeout(()=>m.destroy(),1e3).unref())};if(w===413&&m.headers["content-length"]===void 0&&!m.complete){m.resume();let O=setTimeout(U,5e3);O.unref(),m.once("end",()=>{clearTimeout(O),U()}),m.once("error",()=>{clearTimeout(O),U()});return}U()},v=pP(n,m.headers);if(v)return y(403,-32e3,`Forbidden: ${v}.`);if(m.method!=="POST"){f.statusCode=405,f.setHeader("allow","POST"),f.end(JSON.stringify({error:"Stateless server: POST /mcp only"}));return}if(!c(m.headers["content-type"]))return m.resume(),y(415,-32e3,"Unsupported Media Type: Content-Type must be application/json");let p=await hP(m);if(!("value"in p))return y(p.status,p.code,p.message);let b=String(m.headers.accept??""),g=b.includes("text/event-stream"),S=new AbortController;f.on("close",()=>S.abort());let T=z2(m,g&&b.includes("application/json")?b:"application/json, text/event-stream",S.signal),R;if(await l(T,p.value)){let w=Gb({http:!0,storeHandoffs:o}),z=new a({sessionIdGenerator:void 0,enableJsonResponse:!g});f.on("close",()=>{z.close(),w.close()}),await w.connect(z),R=await z.handleRequest(T,{parsedBody:p.value})}else R=await u.fetch(T,{parsedBody:p.value});await R2(f,R)}catch(h){f.headersSent||(f.statusCode=500),f.end(JSON.stringify({error:h.message}))}});d.listen(t,r,()=>{let m=d.address()?.port??t;console.error(`context-doctor MCP (streamable HTTP) on http://${r.includes(":")?`[${r}]`:r}:${m}/mcp`);let f=mP(r,o);f&&console.error(f),console.error("ChatGPT developer-mode connectors need a URL their servers can reach \u2014 expose this via your host or a tunnel."),console.error(n.hosts==="*"?"Host check off (--allowed-hosts '*').":`Answering Host: ${[...n.hosts].join(", ")}. Behind a tunnel, add its host name: --allowed-hosts <name>.`)})}else jx(()=>Gb());
|