@modelcontextprotocol/server-wiki-explorer 1.1.2 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mcp-app.html CHANGED
@@ -5,90 +5,51 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <meta name="color-scheme" content="light dark">
7
7
  <title>Wiki Explorer</title>
8
- <script type="module" crossorigin>var Ay=Object.defineProperty;var jy=(e,n,r)=>n in e?Ay(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var je=(e,n,r)=>jy(e,typeof n!="symbol"?n+"":n,r);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();function T(e,n,r){function o(u,l){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),n(u,l);const c=s.prototype,d=Object.keys(c);for(let f=0;f<d.length;f++){const h=d[f];h in u||(u[h]=c[h].bind(u))}}const i=(r==null?void 0:r.Parent)??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function s(u){var l;const c=r!=null&&r.Parent?new a:this;o(c,u),(l=c._zod).deferred??(l.deferred=[]);for(const d of c._zod.deferred)d();return c}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:u=>{var l,c;return r!=null&&r.Parent&&u instanceof r.Parent?!0:(c=(l=u==null?void 0:u._zod)==null?void 0:l.traits)==null?void 0:c.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class Sn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Af extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const jf={};function Wt(e){return jf}function Zf(e){const n=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,i])=>n.indexOf(+o)===-1).map(([o,i])=>i)}function $a(e,n){return typeof n=="bigint"?n.toString():n}function to(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Ka(e){return e==null}function Ya(e){const n=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(n,r)}function Zy(e,n){const r=(e.toString().split(".")[1]||"").length,o=n.toString();let i=(o.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(o)){const l=o.match(/\d?e-(\d?)/);l!=null&&l[1]&&(i=Number.parseInt(l[1]))}const a=r>i?r:i,s=Number.parseInt(e.toFixed(a).replace(".","")),u=Number.parseInt(n.toFixed(a).replace(".",""));return s%u/10**a}const Fl=Symbol("evaluating");function ue(e,n,r){let o;Object.defineProperty(e,n,{get(){if(o!==Fl)return o===void 0&&(o=Fl,o=r()),o},set(i){Object.defineProperty(e,n,{value:i})},configurable:!0})}function gn(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Yt(...e){const n={};for(const r of e){const o=Object.getOwnPropertyDescriptors(r);Object.assign(n,o)}return Object.defineProperties({},n)}function ql(e){return JSON.stringify(e)}function Cy(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Cf="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Dy=to(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function On(e){if(cr(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const r=n.prototype;return!(cr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Df(e){return On(e)?{...e}:Array.isArray(e)?[...e]:e}const Ry=new Set(["string","number","symbol"]);function Pn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qt(e,n,r){const o=new e._zod.constr(n??e._zod.def);return(!n||r!=null&&r.parent)&&(o._zod.parent=e),o}function q(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if((n==null?void 0:n.message)!==void 0){if((n==null?void 0:n.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function My(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const Ly={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Fy(e,n){const r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=Yt(e._zod.def,{get shape(){const s={};for(const u in n){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(s[u]=r.shape[u])}return gn(this,"shape",s),s},checks:[]});return Qt(e,a)}function qy(e,n){const r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=Yt(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const u in n){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);n[u]&&delete s[u]}return gn(this,"shape",s),s},checks:[]});return Qt(e,a)}function Jy(e,n){if(!On(n))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const a=e._zod.def.shape;for(const s in n)if(Object.getOwnPropertyDescriptor(a,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Yt(e._zod.def,{get shape(){const a={...e._zod.def.shape,...n};return gn(this,"shape",a),a}});return Qt(e,i)}function Hy(e,n){if(!On(n))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Yt(e._zod.def,{get shape(){const o={...e._zod.def.shape,...n};return gn(this,"shape",o),o}});return Qt(e,r)}function Vy(e,n){const r=Yt(e._zod.def,{get shape(){const o={...e._zod.def.shape,...n._zod.def.shape};return gn(this,"shape",o),o},get catchall(){return n._zod.def.catchall},checks:[]});return Qt(e,r)}function Wy(e,n,r){const i=n._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=Yt(n._zod.def,{get shape(){const u=n._zod.def.shape,l={...u};if(r)for(const c in r){if(!(c in u))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(l[c]=e?new e({type:"optional",innerType:u[c]}):u[c])}else for(const c in u)l[c]=e?new e({type:"optional",innerType:u[c]}):u[c];return gn(this,"shape",l),l},checks:[]});return Qt(n,s)}function Gy(e,n,r){const o=Yt(n._zod.def,{get shape(){const i=n._zod.def.shape,a={...i};if(r)for(const s in r){if(!(s in a))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(a[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(const s in i)a[s]=new e({type:"nonoptional",innerType:i[s]});return gn(this,"shape",a),a}});return Qt(n,o)}function kn(e,n=0){var r;if(e.aborted===!0)return!0;for(let o=n;o<e.issues.length;o++)if(((r=e.issues[o])==null?void 0:r.continue)!==!0)return!0;return!1}function xn(e,n){return n.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function si(e){return typeof e=="string"?e:e==null?void 0:e.message}function Gt(e,n,r){var i,a,s,u,l,c;const o={...e,path:e.path??[]};if(!e.message){const d=si((s=(a=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:a.error)==null?void 0:s.call(a,e))??si((u=n==null?void 0:n.error)==null?void 0:u.call(n,e))??si((l=r.customError)==null?void 0:l.call(r,e))??si((c=r.localeError)==null?void 0:c.call(r,e))??"Invalid input";o.message=d}return delete o.inst,delete o.continue,n!=null&&n.reportInput||delete o.input,o}function Qa(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function fr(...e){const[n,r,o]=e;return typeof n=="string"?{message:n,code:"custom",input:r,inst:o}:{...n}}const Rf=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,$a,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Mf=T("$ZodError",Rf),Lf=T("$ZodError",Rf,{Parent:Error});function By(e,n=r=>r.message){const r={},o=[];for(const i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(n(i))):o.push(n(i));return{formErrors:o,fieldErrors:r}}function Xy(e,n=r=>r.message){const r={_errors:[]},o=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s}));else if(a.code==="invalid_key")o({issues:a.issues});else if(a.code==="invalid_element")o({issues:a.issues});else if(a.path.length===0)r._errors.push(n(a));else{let s=r,u=0;for(;u<a.path.length;){const l=a.path[u];u===a.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(n(a))):s[l]=s[l]||{_errors:[]},s=s[l],u++}}};return o(e),r}const es=e=>(n,r,o,i)=>{const a=o?Object.assign(o,{async:!1}):{async:!1},s=n._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new Sn;if(s.issues.length){const u=new((i==null?void 0:i.Err)??e)(s.issues.map(l=>Gt(l,a,Wt())));throw Cf(u,i==null?void 0:i.callee),u}return s.value},ts=e=>async(n,r,o,i)=>{const a=o?Object.assign(o,{async:!0}):{async:!0};let s=n._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){const u=new((i==null?void 0:i.Err)??e)(s.issues.map(l=>Gt(l,a,Wt())));throw Cf(u,i==null?void 0:i.callee),u}return s.value},no=e=>(n,r,o)=>{const i=o?{...o,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Sn;return a.issues.length?{success:!1,error:new(e??Mf)(a.issues.map(s=>Gt(s,i,Wt())))}:{success:!0,data:a.value}},Ff=no(Lf),ro=e=>async(n,r,o)=>{const i=o?Object.assign(o,{async:!0}):{async:!0};let a=n._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(s=>Gt(s,i,Wt())))}:{success:!0,data:a.value}},Ky=ro(Lf),Yy=e=>(n,r,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return es(e)(n,r,i)},Qy=e=>(n,r,o)=>es(e)(n,r,o),eb=e=>async(n,r,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ts(e)(n,r,i)},tb=e=>async(n,r,o)=>ts(e)(n,r,o),nb=e=>(n,r,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return no(e)(n,r,i)},rb=e=>(n,r,o)=>no(e)(n,r,o),ib=e=>async(n,r,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ro(e)(n,r,i)},ob=e=>async(n,r,o)=>ro(e)(n,r,o),ab=/^[cC][^\s-]{8,}$/,sb=/^[0-9a-z]+$/,ub=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,lb=/^[0-9a-vA-V]{20}$/,cb=/^[A-Za-z0-9]{27}$/,fb=/^[a-zA-Z0-9_-]{21}$/,db=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,hb=/^([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})$/,Jl=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)$/,pb=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,mb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function gb(){return new RegExp(mb,"u")}const vb=/^(?:(?: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])$/,_b=/^(([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}|:))$/,yb=/^((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])$/,bb=/^(([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])$/,$b=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qf=/^[A-Za-z0-9_-]*$/,wb=/^\+[1-9]\d{6,14}$/,Jf="(?:(?:\\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])))",kb=new RegExp(`^${Jf}$`);function Hf(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xb(e){return new RegExp(`^${Hf(e)}$`)}function Sb(e){const n=Hf({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${n}(?:${r.join("|")})`;return new RegExp(`^${Jf}T(?:${o})$`)}const Ib=e=>{const n=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},zb=/^-?\d+$/,Vf=/^-?\d+(?:\.\d+)?$/,Ob=/^(?:true|false)$/i,Pb=/^null$/i,Tb=/^[^A-Z]*$/,Eb=/^[^a-z]*$/,Ve=T("$ZodCheck",(e,n)=>{var r;e._zod??(e._zod={}),e._zod.def=n,(r=e._zod).onattach??(r.onattach=[])}),Wf={number:"number",bigint:"bigint",object:"date"},Gf=T("$ZodCheckLessThan",(e,n)=>{Ve.init(e,n);const r=Wf[typeof n.value];e._zod.onattach.push(o=>{const i=o._zod.bag,a=(n.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<a&&(n.inclusive?i.maximum=n.value:i.exclusiveMaximum=n.value)}),e._zod.check=o=>{(n.inclusive?o.value<=n.value:o.value<n.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:o.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Bf=T("$ZodCheckGreaterThan",(e,n)=>{Ve.init(e,n);const r=Wf[typeof n.value];e._zod.onattach.push(o=>{const i=o._zod.bag,a=(n.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>a&&(n.inclusive?i.minimum=n.value:i.exclusiveMinimum=n.value)}),e._zod.check=o=>{(n.inclusive?o.value>=n.value:o.value>n.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:o.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Nb=T("$ZodCheckMultipleOf",(e,n)=>{Ve.init(e,n),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=n.value)}),e._zod.check=r=>{if(typeof r.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%n.value===BigInt(0):Zy(r.value,n.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:n.value,input:r.value,inst:e,continue:!n.abort})}}),Ub=T("$ZodCheckNumberFormat",(e,n)=>{var s;Ve.init(e,n),n.format=n.format||"float64";const r=(s=n.format)==null?void 0:s.includes("int"),o=r?"int":"number",[i,a]=Ly[n.format];e._zod.onattach.push(u=>{const l=u._zod.bag;l.format=n.format,l.minimum=i,l.maximum=a,r&&(l.pattern=zb)}),e._zod.check=u=>{const l=u.value;if(r){if(!Number.isInteger(l)){u.issues.push({expected:o,format:n.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?u.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!n.abort}):u.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!n.abort});return}}l<i&&u.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!n.abort}),l>a&&u.issues.push({origin:"number",input:l,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!n.abort})}}),Ab=T("$ZodCheckMaxLength",(e,n)=>{var r;Ve.init(e,n),(r=e._zod.def).when??(r.when=o=>{const i=o.value;return!Ka(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{const i=o._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<i&&(o._zod.bag.maximum=n.maximum)}),e._zod.check=o=>{const i=o.value;if(i.length<=n.maximum)return;const s=Qa(i);o.issues.push({origin:s,code:"too_big",maximum:n.maximum,inclusive:!0,input:i,inst:e,continue:!n.abort})}}),jb=T("$ZodCheckMinLength",(e,n)=>{var r;Ve.init(e,n),(r=e._zod.def).when??(r.when=o=>{const i=o.value;return!Ka(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{const i=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>i&&(o._zod.bag.minimum=n.minimum)}),e._zod.check=o=>{const i=o.value;if(i.length>=n.minimum)return;const s=Qa(i);o.issues.push({origin:s,code:"too_small",minimum:n.minimum,inclusive:!0,input:i,inst:e,continue:!n.abort})}}),Zb=T("$ZodCheckLengthEquals",(e,n)=>{var r;Ve.init(e,n),(r=e._zod.def).when??(r.when=o=>{const i=o.value;return!Ka(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{const i=o._zod.bag;i.minimum=n.length,i.maximum=n.length,i.length=n.length}),e._zod.check=o=>{const i=o.value,a=i.length;if(a===n.length)return;const s=Qa(i),u=a>n.length;o.issues.push({origin:s,...u?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!n.abort})}}),io=T("$ZodCheckStringFormat",(e,n)=>{var r,o;Ve.init(e,n),e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=n.format,n.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(n.pattern))}),n.pattern?(r=e._zod).check??(r.check=i=>{n.pattern.lastIndex=0,!n.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:n.format,input:i.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(o=e._zod).check??(o.check=()=>{})}),Cb=T("$ZodCheckRegex",(e,n)=>{io.init(e,n),e._zod.check=r=>{n.pattern.lastIndex=0,!n.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),Db=T("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=Tb),io.init(e,n)}),Rb=T("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=Eb),io.init(e,n)}),Mb=T("$ZodCheckIncludes",(e,n)=>{Ve.init(e,n);const r=Pn(n.includes),o=new RegExp(typeof n.position=="number"?`^.{${n.position}}${r}`:r);n.pattern=o,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(o)}),e._zod.check=i=>{i.value.includes(n.includes,n.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:i.value,inst:e,continue:!n.abort})}}),Lb=T("$ZodCheckStartsWith",(e,n)=>{Ve.init(e,n);const r=new RegExp(`^${Pn(n.prefix)}.*`);n.pattern??(n.pattern=r),e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(n.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:o.value,inst:e,continue:!n.abort})}}),Fb=T("$ZodCheckEndsWith",(e,n)=>{Ve.init(e,n);const r=new RegExp(`.*${Pn(n.suffix)}$`);n.pattern??(n.pattern=r),e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(n.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:o.value,inst:e,continue:!n.abort})}}),qb=T("$ZodCheckOverwrite",(e,n)=>{Ve.init(e,n),e._zod.check=r=>{r.value=n.tx(r.value)}});class Jb{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const o=n.split(`
9
- `).filter(s=>s),i=Math.min(...o.map(s=>s.length-s.trimStart().length)),a=o.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(const s of a)this.content.push(s)}compile(){const n=Function,r=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(a=>` ${a}`)];return new n(...r,i.join(`
10
- `))}}const Hb={major:4,minor:3,patch:5},be=T("$ZodType",(e,n)=>{var i;var r;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=Hb;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const a of o)for(const s of a._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const a=(u,l,c)=>{let d=kn(u),f;for(const h of l){if(h._zod.def.when){if(!h._zod.def.when(u))continue}else if(d)continue;const p=u.issues.length,m=h._zod.check(u);if(m instanceof Promise&&(c==null?void 0:c.async)===!1)throw new Sn;if(f||m instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await m,u.issues.length!==p&&(d||(d=kn(u,p)))});else{if(u.issues.length===p)continue;d||(d=kn(u,p))}}return f?f.then(()=>u):u},s=(u,l,c)=>{if(kn(u))return u.aborted=!0,u;const d=a(l,o,c);if(d instanceof Promise){if(c.async===!1)throw new Sn;return d.then(f=>e._zod.parse(f,c))}return e._zod.parse(d,c)};e._zod.run=(u,l)=>{if(l.skipChecks)return e._zod.parse(u,l);if(l.direction==="backward"){const d=e._zod.parse({value:u.value,issues:[]},{...l,skipChecks:!0});return d instanceof Promise?d.then(f=>s(f,u,l)):s(d,u,l)}const c=e._zod.parse(u,l);if(c instanceof Promise){if(l.async===!1)throw new Sn;return c.then(d=>a(d,o,l))}return a(c,o,l)}}ue(e,"~standard",()=>({validate:a=>{var s;try{const u=Ff(e,a);return u.success?{value:u.data}:{issues:(s=u.error)==null?void 0:s.issues}}catch{return Ky(e,a).then(l=>{var c;return l.success?{value:l.data}:{issues:(c=l.error)==null?void 0:c.issues}})}},vendor:"zod",version:1}))}),ns=T("$ZodString",(e,n)=>{var r;be.init(e,n),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??Ib(e._zod.bag),e._zod.parse=(o,i)=>{if(n.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),$e=T("$ZodStringFormat",(e,n)=>{io.init(e,n),ns.init(e,n)}),Vb=T("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=hb),$e.init(e,n)}),Wb=T("$ZodUUID",(e,n)=>{if(n.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(o===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=Jl(o))}else n.pattern??(n.pattern=Jl());$e.init(e,n)}),Gb=T("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=pb),$e.init(e,n)}),Bb=T("$ZodURL",(e,n)=>{$e.init(e,n),e._zod.check=r=>{try{const o=r.value.trim(),i=new URL(o);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:r.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:r.value,inst:e,continue:!n.abort})),n.normalize?r.value=i.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort})}}}),Xb=T("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=gb()),$e.init(e,n)}),Kb=T("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=fb),$e.init(e,n)}),Yb=T("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=ab),$e.init(e,n)}),Qb=T("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=sb),$e.init(e,n)}),e0=T("$ZodULID",(e,n)=>{n.pattern??(n.pattern=ub),$e.init(e,n)}),t0=T("$ZodXID",(e,n)=>{n.pattern??(n.pattern=lb),$e.init(e,n)}),n0=T("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=cb),$e.init(e,n)}),r0=T("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=Sb(n)),$e.init(e,n)}),i0=T("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=kb),$e.init(e,n)}),o0=T("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=xb(n)),$e.init(e,n)}),a0=T("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=db),$e.init(e,n)}),s0=T("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=vb),$e.init(e,n),e._zod.bag.format="ipv4"}),u0=T("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=_b),$e.init(e,n),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!n.abort})}}}),l0=T("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=yb),$e.init(e,n)}),c0=T("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=bb),$e.init(e,n),e._zod.check=r=>{const o=r.value.split("/");try{if(o.length!==2)throw new Error;const[i,a]=o;if(!a)throw new Error;const s=Number(a);if(`${s}`!==a)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!n.abort})}}});function Xf(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const f0=T("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=$b),$e.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Xf(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!n.abort})}});function d0(e){if(!qf.test(e))return!1;const n=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return Xf(r)}const h0=T("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=qf),$e.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{d0(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!n.abort})}}),p0=T("$ZodE164",(e,n)=>{n.pattern??(n.pattern=wb),$e.init(e,n)});function m0(e,n=null){try{const r=e.split(".");if(r.length!==3)return!1;const[o]=r;if(!o)return!1;const i=JSON.parse(atob(o));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||n&&(!("alg"in i)||i.alg!==n))}catch{return!1}}const g0=T("$ZodJWT",(e,n)=>{$e.init(e,n),e._zod.check=r=>{m0(r.value,n.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!n.abort})}}),Kf=T("$ZodNumber",(e,n)=>{be.init(e,n),e._zod.pattern=e._zod.bag.pattern??Vf,e._zod.parse=(r,o)=>{if(n.coerce)try{r.value=Number(r.value)}catch{}const i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),r}}),v0=T("$ZodNumberFormat",(e,n)=>{Ub.init(e,n),Kf.init(e,n)}),_0=T("$ZodBoolean",(e,n)=>{be.init(e,n),e._zod.pattern=Ob,e._zod.parse=(r,o)=>{if(n.coerce)try{r.value=!!r.value}catch{}const i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),y0=T("$ZodNull",(e,n)=>{be.init(e,n),e._zod.pattern=Pb,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{const i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),r}}),b0=T("$ZodUnknown",(e,n)=>{be.init(e,n),e._zod.parse=r=>r}),$0=T("$ZodNever",(e,n)=>{be.init(e,n),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Hl(e,n,r){e.issues.length&&n.issues.push(...xn(r,e.issues)),n.value[r]=e.value}const w0=T("$ZodArray",(e,n)=>{be.init(e,n),e._zod.parse=(r,o)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);const a=[];for(let s=0;s<i.length;s++){const u=i[s],l=n.element._zod.run({value:u,issues:[]},o);l instanceof Promise?a.push(l.then(c=>Hl(c,r,s))):Hl(l,r,s)}return a.length?Promise.all(a).then(()=>r):r}});function Oi(e,n,r,o,i){if(e.issues.length){if(i&&!(r in o))return;n.issues.push(...xn(r,e.issues))}e.value===void 0?r in o&&(n.value[r]=void 0):n.value[r]=e.value}function Yf(e){var o,i,a,s;const n=Object.keys(e.shape);for(const u of n)if(!((s=(a=(i=(o=e.shape)==null?void 0:o[u])==null?void 0:i._zod)==null?void 0:a.traits)!=null&&s.has("$ZodType")))throw new Error(`Invalid element at key "${u}": expected a Zod schema`);const r=My(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function Qf(e,n,r,o,i,a){const s=[],u=i.keySet,l=i.catchall._zod,c=l.def.type,d=l.optout==="optional";for(const f in n){if(u.has(f))continue;if(c==="never"){s.push(f);continue}const h=l.run({value:n[f],issues:[]},o);h instanceof Promise?e.push(h.then(p=>Oi(p,r,f,n,d))):Oi(h,r,f,n,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:n,inst:a}),e.length?Promise.all(e).then(()=>r):r}const k0=T("$ZodObject",(e,n)=>{be.init(e,n);const r=Object.getOwnPropertyDescriptor(n,"shape");if(!(r!=null&&r.get)){const u=n.shape;Object.defineProperty(n,"shape",{get:()=>{const l={...u};return Object.defineProperty(n,"shape",{value:l}),l}})}const o=to(()=>Yf(n));ue(e._zod,"propValues",()=>{const u=n.shape,l={};for(const c in u){const d=u[c]._zod;if(d.values){l[c]??(l[c]=new Set);for(const f of d.values)l[c].add(f)}}return l});const i=cr,a=n.catchall;let s;e._zod.parse=(u,l)=>{s??(s=o.value);const c=u.value;if(!i(c))return u.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),u;u.value={};const d=[],f=s.shape;for(const h of s.keys){const p=f[h],m=p._zod.optout==="optional",v=p._zod.run({value:c[h],issues:[]},l);v instanceof Promise?d.push(v.then(y=>Oi(y,u,h,c,m))):Oi(v,u,h,c,m)}return a?Qf(d,c,u,l,o.value,e):d.length?Promise.all(d).then(()=>u):u}}),x0=T("$ZodObjectJIT",(e,n)=>{k0.init(e,n);const r=e._zod.parse,o=to(()=>Yf(n)),i=h=>{var z;const p=new Jb(["shape","payload","ctx"]),m=o.value,v=$=>{const b=ql($);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};p.write("const input = payload.value;");const y=Object.create(null);let g=0;for(const $ of m.keys)y[$]=`key_${g++}`;p.write("const newResult = {};");for(const $ of m.keys){const b=y[$],k=ql($),x=h[$],O=((z=x==null?void 0:x._zod)==null?void 0:z.optout)==="optional";p.write(`const ${b} = ${v($)};`),O?p.write(`
11
- if (${b}.issues.length) {
8
+ <script type="module" crossorigin>var Ku=Object.defineProperty;var Yu=(e,n,r)=>n in e?Ku(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var be=(e,n,r)=>Yu(e,typeof n!="symbol"?n+"":n,r);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function r(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(o){if(o.ep)return;o.ep=!0;const s=r(o);fetch(o.href,s)}})();function A(e,n,r){function i(u,c){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),n(u,c);const l=a.prototype,h=Object.keys(l);for(let f=0;f<h.length;f++){const d=h[f];d in u||(u[d]=l[d].bind(u))}}const o=(r==null?void 0:r.Parent)??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function a(u){var c;const l=r!=null&&r.Parent?new s:this;i(l,u),(c=l._zod).deferred??(c.deferred=[]);for(const h of l._zod.deferred)h();return l}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:u=>{var c,l;return r!=null&&r.Parent&&u instanceof r.Parent?!0:(l=(c=u==null?void 0:u._zod)==null?void 0:c.traits)==null?void 0:l.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}class Mt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ns extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const Ds={};function mt(e){return Ds}function js(e){const n=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>n.indexOf(+i)===-1).map(([i,o])=>o)}function Ur(e,n){return typeof n=="bigint"?n.toString():n}function dr(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function hi(e){return e==null}function di(e){const n=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(n,r)}function Qu(e,n){const r=(e.toString().split(".")[1]||"").length,i=n.toString();let o=(i.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(i)){const c=i.match(/\d?e-(\d?)/);c!=null&&c[1]&&(o=Number.parseInt(c[1]))}const s=r>o?r:o,a=Number.parseInt(e.toFixed(s).replace(".","")),u=Number.parseInt(n.toFixed(s).replace(".",""));return a%u/10**s}const uo=Symbol("evaluating");function Q(e,n,r){let i;Object.defineProperty(e,n,{get(){if(i!==uo)return i===void 0&&(i=uo,i=r()),i},set(o){Object.defineProperty(e,n,{value:o})},configurable:!0})}function Et(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})}function yt(...e){const n={};for(const r of e){const i=Object.getOwnPropertyDescriptors(r);Object.assign(n,i)}return Object.defineProperties({},n)}function co(e){return JSON.stringify(e)}function ec(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Zs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function cn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const tc=dr(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function Dt(e){if(cn(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const r=n.prototype;return!(cn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function qs(e){return Dt(e)?{...e}:Array.isArray(e)?[...e]:e}const nc=new Set(["string","number","symbol"]);function jt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vt(e,n,r){const i=new e._zod.constr(n??e._zod.def);return(!n||r!=null&&r.parent)&&(i._zod.parent=e),i}function Z(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if((n==null?void 0:n.message)!==void 0){if((n==null?void 0:n.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function rc(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const ic={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function oc(e,n){const r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=yt(e._zod.def,{get shape(){const a={};for(const u in n){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=r.shape[u])}return Et(this,"shape",a),a},checks:[]});return vt(e,s)}function sc(e,n){const r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=yt(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const u in n){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);n[u]&&delete a[u]}return Et(this,"shape",a),a},checks:[]});return vt(e,s)}function ac(e,n){if(!Dt(n))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const s=e._zod.def.shape;for(const a in n)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=yt(e._zod.def,{get shape(){const s={...e._zod.def.shape,...n};return Et(this,"shape",s),s}});return vt(e,o)}function uc(e,n){if(!Dt(n))throw new Error("Invalid input to safeExtend: expected a plain object");const r=yt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...n};return Et(this,"shape",i),i}});return vt(e,r)}function cc(e,n){const r=yt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...n._zod.def.shape};return Et(this,"shape",i),i},get catchall(){return n._zod.def.catchall},checks:[]});return vt(e,r)}function lc(e,n,r){const o=n._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=yt(n._zod.def,{get shape(){const u=n._zod.def.shape,c={...u};if(r)for(const l in r){if(!(l in u))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=e?new e({type:"optional",innerType:u[l]}):u[l])}else for(const l in u)c[l]=e?new e({type:"optional",innerType:u[l]}):u[l];return Et(this,"shape",c),c},checks:[]});return vt(n,a)}function fc(e,n,r){const i=yt(n._zod.def,{get shape(){const o=n._zod.def.shape,s={...o};if(r)for(const a in r){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(s[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)s[a]=new e({type:"nonoptional",innerType:o[a]});return Et(this,"shape",s),s}});return vt(n,i)}function $t(e,n=0){var r;if(e.aborted===!0)return!0;for(let i=n;i<e.issues.length;i++)if(((r=e.issues[i])==null?void 0:r.continue)!==!0)return!0;return!1}function It(e,n){return n.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function $n(e){return typeof e=="string"?e:e==null?void 0:e.message}function _t(e,n,r){var o,s,a,u,c,l;const i={...e,path:e.path??[]};if(!e.message){const h=$n((a=(s=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:s.error)==null?void 0:a.call(s,e))??$n((u=n==null?void 0:n.error)==null?void 0:u.call(n,e))??$n((c=r.customError)==null?void 0:c.call(r,e))??$n((l=r.localeError)==null?void 0:l.call(r,e))??"Invalid input";i.message=h}return delete i.inst,delete i.continue,n!=null&&n.reportInput||delete i.input,i}function pi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ln(...e){const[n,r,i]=e;return typeof n=="string"?{message:n,code:"custom",input:r,inst:i}:{...n}}const Us=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,Ur,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ls=A("$ZodError",Us),Fs=A("$ZodError",Us,{Parent:Error});function hc(e,n=r=>r.message){const r={},i=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(n(o))):i.push(n(o));return{formErrors:i,fieldErrors:r}}function dc(e,n=r=>r.message){const r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)r._errors.push(n(s));else{let a=r,u=0;for(;u<s.path.length;){const c=s.path[u];u===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return i(e),r}const gi=e=>(n,r,i,o)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new Mt;if(a.issues.length){const u=new((o==null?void 0:o.Err)??e)(a.issues.map(c=>_t(c,s,mt())));throw Zs(u,o==null?void 0:o.callee),u}return a.value},mi=e=>async(n,r,i,o)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const u=new((o==null?void 0:o.Err)??e)(a.issues.map(c=>_t(c,s,mt())));throw Zs(u,o==null?void 0:o.callee),u}return a.value},pr=e=>(n,r,i)=>{const o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Mt;return s.issues.length?{success:!1,error:new(e??Ls)(s.issues.map(a=>_t(a,o,mt())))}:{success:!0,data:s.value}},Hs=pr(Fs),gr=e=>async(n,r,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=n._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>_t(a,o,mt())))}:{success:!0,data:s.value}},pc=gr(Fs),gc=e=>(n,r,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return gi(e)(n,r,o)},mc=e=>(n,r,i)=>gi(e)(n,r,i),_c=e=>async(n,r,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return mi(e)(n,r,o)},yc=e=>async(n,r,i)=>mi(e)(n,r,i),vc=e=>(n,r,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return pr(e)(n,r,o)},bc=e=>(n,r,i)=>pr(e)(n,r,i),wc=e=>async(n,r,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return gr(e)(n,r,o)},xc=e=>async(n,r,i)=>gr(e)(n,r,i),kc=/^[cC][^\s-]{8,}$/,Sc=/^[0-9a-z]+$/,zc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Tc=/^[0-9a-vA-V]{20}$/,Cc=/^[A-Za-z0-9]{27}$/,Pc=/^[a-zA-Z0-9_-]{21}$/,Ec=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ac=/^([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})$/,lo=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)$/,Rc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$c="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ic(){return new RegExp($c,"u")}const Mc=/^(?:(?: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])$/,Oc=/^(([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}|:))$/,Nc=/^((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])$/,Dc=/^(([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])$/,jc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vs=/^[A-Za-z0-9_-]*$/,Zc=/^\+[1-9]\d{6,14}$/,Bs="(?:(?:\\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])))",qc=new RegExp(`^${Bs}$`);function Ws(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Uc(e){return new RegExp(`^${Ws(e)}$`)}function Lc(e){const n=Ws({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${n}(?:${r.join("|")})`;return new RegExp(`^${Bs}T(?:${i})$`)}const Fc=e=>{const n=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},Hc=/^-?\d+$/,Js=/^-?\d+(?:\.\d+)?$/,Vc=/^(?:true|false)$/i,Bc=/^null$/i,Wc=/^undefined$/i,Jc=/^[^A-Z]*$/,Gc=/^[^a-z]*$/,Ce=A("$ZodCheck",(e,n)=>{var r;e._zod??(e._zod={}),e._zod.def=n,(r=e._zod).onattach??(r.onattach=[])}),Gs={number:"number",bigint:"bigint",object:"date"},Xs=A("$ZodCheckLessThan",(e,n)=>{Ce.init(e,n);const r=Gs[typeof n.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(n.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<s&&(n.inclusive?o.maximum=n.value:o.exclusiveMaximum=n.value)}),e._zod.check=i=>{(n.inclusive?i.value<=n.value:i.value<n.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:i.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Ks=A("$ZodCheckGreaterThan",(e,n)=>{Ce.init(e,n);const r=Gs[typeof n.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(n.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>s&&(n.inclusive?o.minimum=n.value:o.exclusiveMinimum=n.value)}),e._zod.check=i=>{(n.inclusive?i.value>=n.value:i.value>n.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:i.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Xc=A("$ZodCheckMultipleOf",(e,n)=>{Ce.init(e,n),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=n.value)}),e._zod.check=r=>{if(typeof r.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%n.value===BigInt(0):Qu(r.value,n.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:n.value,input:r.value,inst:e,continue:!n.abort})}}),Kc=A("$ZodCheckNumberFormat",(e,n)=>{var a;Ce.init(e,n),n.format=n.format||"float64";const r=(a=n.format)==null?void 0:a.includes("int"),i=r?"int":"number",[o,s]=ic[n.format];e._zod.onattach.push(u=>{const c=u._zod.bag;c.format=n.format,c.minimum=o,c.maximum=s,r&&(c.pattern=Hc)}),e._zod.check=u=>{const c=u.value;if(r){if(!Number.isInteger(c)){u.issues.push({expected:i,format:n.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?u.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!n.abort}):u.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!n.abort});return}}c<o&&u.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!n.abort}),c>s&&u.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!n.abort})}}),Yc=A("$ZodCheckMaxLength",(e,n)=>{var r;Ce.init(e,n),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!hi(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<o&&(i._zod.bag.maximum=n.maximum)}),e._zod.check=i=>{const o=i.value;if(o.length<=n.maximum)return;const a=pi(o);i.issues.push({origin:a,code:"too_big",maximum:n.maximum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),Qc=A("$ZodCheckMinLength",(e,n)=>{var r;Ce.init(e,n),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!hi(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>o&&(i._zod.bag.minimum=n.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=n.minimum)return;const a=pi(o);i.issues.push({origin:a,code:"too_small",minimum:n.minimum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),el=A("$ZodCheckLengthEquals",(e,n)=>{var r;Ce.init(e,n),(r=e._zod.def).when??(r.when=i=>{const o=i.value;return!hi(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=n.length,o.maximum=n.length,o.length=n.length}),e._zod.check=i=>{const o=i.value,s=o.length;if(s===n.length)return;const a=pi(o),u=s>n.length;i.issues.push({origin:a,...u?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!n.abort})}}),mr=A("$ZodCheckStringFormat",(e,n)=>{var r,i;Ce.init(e,n),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=n.format,n.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(n.pattern))}),n.pattern?(r=e._zod).check??(r.check=o=>{n.pattern.lastIndex=0,!n.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:n.format,input:o.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(i=e._zod).check??(i.check=()=>{})}),tl=A("$ZodCheckRegex",(e,n)=>{mr.init(e,n),e._zod.check=r=>{n.pattern.lastIndex=0,!n.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),nl=A("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=Jc),mr.init(e,n)}),rl=A("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=Gc),mr.init(e,n)}),il=A("$ZodCheckIncludes",(e,n)=>{Ce.init(e,n);const r=jt(n.includes),i=new RegExp(typeof n.position=="number"?`^.{${n.position}}${r}`:r);n.pattern=i,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.includes(n.includes,n.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:o.value,inst:e,continue:!n.abort})}}),ol=A("$ZodCheckStartsWith",(e,n)=>{Ce.init(e,n);const r=new RegExp(`^${jt(n.prefix)}.*`);n.pattern??(n.pattern=r),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(n.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:i.value,inst:e,continue:!n.abort})}}),sl=A("$ZodCheckEndsWith",(e,n)=>{Ce.init(e,n);const r=new RegExp(`.*${jt(n.suffix)}$`);n.pattern??(n.pattern=r),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(n.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:i.value,inst:e,continue:!n.abort})}}),al=A("$ZodCheckOverwrite",(e,n)=>{Ce.init(e,n),e._zod.check=r=>{r.value=n.tx(r.value)}});class ul{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const i=n.split(`
9
+ `).filter(a=>a),o=Math.min(...i.map(a=>a.length-a.trimStart().length)),s=i.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const n=Function,r=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new n(...r,o.join(`
10
+ `))}}const cl={major:4,minor:3,patch:5},ae=A("$ZodType",(e,n)=>{var o;var r;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=cl;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const s of i)for(const a of s._zod.onattach)a(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const s=(u,c,l)=>{let h=$t(u),f;for(const d of c){if(d._zod.def.when){if(!d._zod.def.when(u))continue}else if(h)continue;const p=u.issues.length,g=d._zod.check(u);if(g instanceof Promise&&(l==null?void 0:l.async)===!1)throw new Mt;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,u.issues.length!==p&&(h||(h=$t(u,p)))});else{if(u.issues.length===p)continue;h||(h=$t(u,p))}}return f?f.then(()=>u):u},a=(u,c,l)=>{if($t(u))return u.aborted=!0,u;const h=s(c,i,l);if(h instanceof Promise){if(l.async===!1)throw new Mt;return h.then(f=>e._zod.parse(f,l))}return e._zod.parse(h,l)};e._zod.run=(u,c)=>{if(c.skipChecks)return e._zod.parse(u,c);if(c.direction==="backward"){const h=e._zod.parse({value:u.value,issues:[]},{...c,skipChecks:!0});return h instanceof Promise?h.then(f=>a(f,u,c)):a(h,u,c)}const l=e._zod.parse(u,c);if(l instanceof Promise){if(c.async===!1)throw new Mt;return l.then(h=>s(h,i,c))}return s(l,i,c)}}Q(e,"~standard",()=>({validate:s=>{var a;try{const u=Hs(e,s);return u.success?{value:u.data}:{issues:(a=u.error)==null?void 0:a.issues}}catch{return pc(e,s).then(c=>{var l;return c.success?{value:c.data}:{issues:(l=c.error)==null?void 0:l.issues}})}},vendor:"zod",version:1}))}),_i=A("$ZodString",(e,n)=>{var r;ae.init(e,n),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??Fc(e._zod.bag),e._zod.parse=(i,o)=>{if(n.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),fe=A("$ZodStringFormat",(e,n)=>{mr.init(e,n),_i.init(e,n)}),ll=A("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=Ac),fe.init(e,n)}),fl=A("$ZodUUID",(e,n)=>{if(n.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(i===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=lo(i))}else n.pattern??(n.pattern=lo());fe.init(e,n)}),hl=A("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=Rc),fe.init(e,n)}),dl=A("$ZodURL",(e,n)=>{fe.init(e,n),e._zod.check=r=>{try{const i=r.value.trim(),o=new URL(i);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:r.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:r.value,inst:e,continue:!n.abort})),n.normalize?r.value=o.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort})}}}),pl=A("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=Ic()),fe.init(e,n)}),gl=A("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=Pc),fe.init(e,n)}),ml=A("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=kc),fe.init(e,n)}),_l=A("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=Sc),fe.init(e,n)}),yl=A("$ZodULID",(e,n)=>{n.pattern??(n.pattern=zc),fe.init(e,n)}),vl=A("$ZodXID",(e,n)=>{n.pattern??(n.pattern=Tc),fe.init(e,n)}),bl=A("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=Cc),fe.init(e,n)}),wl=A("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=Lc(n)),fe.init(e,n)}),xl=A("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=qc),fe.init(e,n)}),kl=A("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=Uc(n)),fe.init(e,n)}),Sl=A("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=Ec),fe.init(e,n)}),zl=A("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=Mc),fe.init(e,n),e._zod.bag.format="ipv4"}),Tl=A("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=Oc),fe.init(e,n),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!n.abort})}}}),Cl=A("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=Nc),fe.init(e,n)}),Pl=A("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=Dc),fe.init(e,n),e._zod.check=r=>{const i=r.value.split("/");try{if(i.length!==2)throw new Error;const[o,s]=i;if(!s)throw new Error;const a=Number(s);if(`${a}`!==s)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!n.abort})}}});function Ys(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const El=A("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=jc),fe.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Ys(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!n.abort})}});function Al(e){if(!Vs.test(e))return!1;const n=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return Ys(r)}const Rl=A("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=Vs),fe.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Al(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!n.abort})}}),$l=A("$ZodE164",(e,n)=>{n.pattern??(n.pattern=Zc),fe.init(e,n)});function Il(e,n=null){try{const r=e.split(".");if(r.length!==3)return!1;const[i]=r;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||n&&(!("alg"in o)||o.alg!==n))}catch{return!1}}const Ml=A("$ZodJWT",(e,n)=>{fe.init(e,n),e._zod.check=r=>{Il(r.value,n.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!n.abort})}}),Qs=A("$ZodNumber",(e,n)=>{ae.init(e,n),e._zod.pattern=e._zod.bag.pattern??Js,e._zod.parse=(r,i)=>{if(n.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),Ol=A("$ZodNumberFormat",(e,n)=>{Kc.init(e,n),Qs.init(e,n)}),Nl=A("$ZodBoolean",(e,n)=>{ae.init(e,n),e._zod.pattern=Vc,e._zod.parse=(r,i)=>{if(n.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Dl=A("$ZodUndefined",(e,n)=>{ae.init(e,n),e._zod.pattern=Wc,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,i)=>{const o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),r}}),jl=A("$ZodNull",(e,n)=>{ae.init(e,n),e._zod.pattern=Bc,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{const o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),Zl=A("$ZodUnknown",(e,n)=>{ae.init(e,n),e._zod.parse=r=>r}),ql=A("$ZodNever",(e,n)=>{ae.init(e,n),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function fo(e,n,r){e.issues.length&&n.issues.push(...It(r,e.issues)),n.value[r]=e.value}const Ul=A("$ZodArray",(e,n)=>{ae.init(e,n),e._zod.parse=(r,i)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const s=[];for(let a=0;a<o.length;a++){const u=o[a],c=n.element._zod.run({value:u,issues:[]},i);c instanceof Promise?s.push(c.then(l=>fo(l,r,a))):fo(c,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function Gn(e,n,r,i,o){if(e.issues.length){if(o&&!(r in i))return;n.issues.push(...It(r,e.issues))}e.value===void 0?r in i&&(n.value[r]=void 0):n.value[r]=e.value}function ea(e){var i,o,s,a;const n=Object.keys(e.shape);for(const u of n)if(!((a=(s=(o=(i=e.shape)==null?void 0:i[u])==null?void 0:o._zod)==null?void 0:s.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${u}": expected a Zod schema`);const r=rc(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function ta(e,n,r,i,o,s){const a=[],u=o.keySet,c=o.catchall._zod,l=c.def.type,h=c.optout==="optional";for(const f in n){if(u.has(f))continue;if(l==="never"){a.push(f);continue}const d=c.run({value:n[f],issues:[]},i);d instanceof Promise?e.push(d.then(p=>Gn(p,r,f,n,h))):Gn(d,r,f,n,h)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:n,inst:s}),e.length?Promise.all(e).then(()=>r):r}const Ll=A("$ZodObject",(e,n)=>{ae.init(e,n);const r=Object.getOwnPropertyDescriptor(n,"shape");if(!(r!=null&&r.get)){const u=n.shape;Object.defineProperty(n,"shape",{get:()=>{const c={...u};return Object.defineProperty(n,"shape",{value:c}),c}})}const i=dr(()=>ea(n));Q(e._zod,"propValues",()=>{const u=n.shape,c={};for(const l in u){const h=u[l]._zod;if(h.values){c[l]??(c[l]=new Set);for(const f of h.values)c[l].add(f)}}return c});const o=cn,s=n.catchall;let a;e._zod.parse=(u,c)=>{a??(a=i.value);const l=u.value;if(!o(l))return u.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),u;u.value={};const h=[],f=a.shape;for(const d of a.keys){const p=f[d],g=p._zod.optout==="optional",_=p._zod.run({value:l[d],issues:[]},c);_ instanceof Promise?h.push(_.then(y=>Gn(y,u,d,l,g))):Gn(_,u,d,l,g)}return s?ta(h,l,u,c,i.value,e):h.length?Promise.all(h).then(()=>u):u}}),Fl=A("$ZodObjectJIT",(e,n)=>{Ll.init(e,n);const r=e._zod.parse,i=dr(()=>ea(n)),o=d=>{var C;const p=new ul(["shape","payload","ctx"]),g=i.value,_=b=>{const v=co(b);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`};p.write("const input = payload.value;");const y=Object.create(null);let m=0;for(const b of g.keys)y[b]=`key_${m++}`;p.write("const newResult = {};");for(const b of g.keys){const v=y[b],k=co(b),x=d[b],P=((C=x==null?void 0:x._zod)==null?void 0:C.optout)==="optional";p.write(`const ${v} = ${_(b)};`),P?p.write(`
11
+ if (${v}.issues.length) {
12
12
  if (${k} in input) {
13
- payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
13
+ payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
14
14
  ...iss,
15
15
  path: iss.path ? [${k}, ...iss.path] : [${k}]
16
16
  })));
17
17
  }
18
18
  }
19
19
 
20
- if (${b}.value === undefined) {
20
+ if (${v}.value === undefined) {
21
21
  if (${k} in input) {
22
22
  newResult[${k}] = undefined;
23
23
  }
24
24
  } else {
25
- newResult[${k}] = ${b}.value;
25
+ newResult[${k}] = ${v}.value;
26
26
  }
27
27
 
28
28
  `):p.write(`
29
- if (${b}.issues.length) {
30
- payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
29
+ if (${v}.issues.length) {
30
+ payload.issues = payload.issues.concat(${v}.issues.map(iss => ({
31
31
  ...iss,
32
32
  path: iss.path ? [${k}, ...iss.path] : [${k}]
33
33
  })));
34
34
  }
35
35
 
36
- if (${b}.value === undefined) {
36
+ if (${v}.value === undefined) {
37
37
  if (${k} in input) {
38
38
  newResult[${k}] = undefined;
39
39
  }
40
40
  } else {
41
- newResult[${k}] = ${b}.value;
41
+ newResult[${k}] = ${v}.value;
42
42
  }
43
43
 
44
- `)}p.write("payload.value = newResult;"),p.write("return payload;");const w=p.compile();return($,b)=>w(h,$,b)};let a;const s=cr,u=!jf.jitless,c=u&&Dy.value,d=n.catchall;let f;e._zod.parse=(h,p)=>{f??(f=o.value);const m=h.value;return s(m)?u&&c&&(p==null?void 0:p.async)===!1&&p.jitless!==!0?(a||(a=i(n.shape)),h=a(h,p),d?Qf([],m,h,p,f,e):h):r(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h)}});function Vl(e,n,r,o){for(const a of e)if(a.issues.length===0)return n.value=a.value,n;const i=e.filter(a=>!kn(a));return i.length===1?(n.value=i[0].value,i[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(a=>a.issues.map(s=>Gt(s,o,Wt())))}),n)}const ed=T("$ZodUnion",(e,n)=>{be.init(e,n),ue(e._zod,"optin",()=>n.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ue(e._zod,"optout",()=>n.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ue(e._zod,"values",()=>{if(n.options.every(i=>i._zod.values))return new Set(n.options.flatMap(i=>Array.from(i._zod.values)))}),ue(e._zod,"pattern",()=>{if(n.options.every(i=>i._zod.pattern)){const i=n.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>Ya(a.source)).join("|")})$`)}});const r=n.options.length===1,o=n.options[0]._zod.run;e._zod.parse=(i,a)=>{if(r)return o(i,a);let s=!1;const u=[];for(const l of n.options){const c=l._zod.run({value:i.value,issues:[]},a);if(c instanceof Promise)u.push(c),s=!0;else{if(c.issues.length===0)return c;u.push(c)}}return s?Promise.all(u).then(l=>Vl(l,i,e,a)):Vl(u,i,e,a)}}),S0=T("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,ed.init(e,n);const r=e._zod.parse;ue(e._zod,"propValues",()=>{const i={};for(const a of n.options){const s=a._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(a)}"`);for(const[u,l]of Object.entries(s)){i[u]||(i[u]=new Set);for(const c of l)i[u].add(c)}}return i});const o=to(()=>{var s;const i=n.options,a=new Map;for(const u of i){const l=(s=u._zod.propValues)==null?void 0:s[n.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(u)}"`);for(const c of l){if(a.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);a.set(c,u)}}return a});e._zod.parse=(i,a)=>{const s=i.value;if(!cr(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;const u=o.value.get(s==null?void 0:s[n.discriminator]);return u?u._zod.run(i,a):n.unionFallback?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,input:s,path:[n.discriminator],inst:e}),i)}}),I0=T("$ZodIntersection",(e,n)=>{be.init(e,n),e._zod.parse=(r,o)=>{const i=r.value,a=n.left._zod.run({value:i,issues:[]},o),s=n.right._zod.run({value:i,issues:[]},o);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([l,c])=>Wl(r,l,c)):Wl(r,a,s)}});function wa(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(On(e)&&On(n)){const r=Object.keys(n),o=Object.keys(e).filter(a=>r.indexOf(a)!==-1),i={...e,...n};for(const a of o){const s=wa(e[a],n[a]);if(!s.valid)return{valid:!1,mergeErrorPath:[a,...s.mergeErrorPath]};i[a]=s.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let o=0;o<e.length;o++){const i=e[o],a=n[o],s=wa(i,a);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Wl(e,n,r){const o=new Map;let i;for(const u of n.issues)if(u.code==="unrecognized_keys"){i??(i=u);for(const l of u.keys)o.has(l)||o.set(l,{}),o.get(l).l=!0}else e.issues.push(u);for(const u of r.issues)if(u.code==="unrecognized_keys")for(const l of u.keys)o.has(l)||o.set(l,{}),o.get(l).r=!0;else e.issues.push(u);const a=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length&&i&&e.issues.push({...i,keys:a}),kn(e))return e;const s=wa(n.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const z0=T("$ZodRecord",(e,n)=>{be.init(e,n),e._zod.parse=(r,o)=>{const i=r.value;if(!On(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;const a=[],s=n.keyType._zod.values;if(s){r.value={};const u=new Set;for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){u.add(typeof c=="number"?c.toString():c);const d=n.valueType._zod.run({value:i[c],issues:[]},o);d instanceof Promise?a.push(d.then(f=>{f.issues.length&&r.issues.push(...xn(c,f.issues)),r.value[c]=f.value})):(d.issues.length&&r.issues.push(...xn(c,d.issues)),r.value[c]=d.value)}let l;for(const c in i)u.has(c)||(l=l??[],l.push(c));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l})}else{r.value={};for(const u of Reflect.ownKeys(i)){if(u==="__proto__")continue;let l=n.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Vf.test(u)&&l.issues.length&&l.issues.some(f=>f.code==="invalid_type"&&f.expected==="number")){const f=n.keyType._zod.run({value:Number(u),issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(l=f)}if(l.issues.length){n.mode==="loose"?r.value[u]=i[u]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>Gt(f,o,Wt())),input:u,path:[u],inst:e});continue}const d=n.valueType._zod.run({value:i[u],issues:[]},o);d instanceof Promise?a.push(d.then(f=>{f.issues.length&&r.issues.push(...xn(u,f.issues)),r.value[l.value]=f.value})):(d.issues.length&&r.issues.push(...xn(u,d.issues)),r.value[l.value]=d.value)}}return a.length?Promise.all(a).then(()=>r):r}}),O0=T("$ZodEnum",(e,n)=>{be.init(e,n);const r=Zf(n.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(i=>Ry.has(typeof i)).map(i=>typeof i=="string"?Pn(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const s=i.value;return o.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:e}),i}}),P0=T("$ZodLiteral",(e,n)=>{if(be.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(n.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.values.map(o=>typeof o=="string"?Pn(o):o?Pn(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,i)=>{const a=o.value;return r.has(a)||o.issues.push({code:"invalid_value",values:n.values,input:a,inst:e}),o}}),T0=T("$ZodTransform",(e,n)=>{be.init(e,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Af(e.constructor.name);const i=n.transform(r.value,r);if(o.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(r.value=s,r));if(i instanceof Promise)throw new Sn;return r.value=i,r}});function Gl(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const td=T("$ZodOptional",(e,n)=>{be.init(e,n),e._zod.optin="optional",e._zod.optout="optional",ue(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),ue(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${Ya(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(n.innerType._zod.optin==="optional"){const i=n.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>Gl(a,r.value)):Gl(i,r.value)}return r.value===void 0?r:n.innerType._zod.run(r,o)}}),E0=T("$ZodExactOptional",(e,n)=>{td.init(e,n),ue(e._zod,"values",()=>n.innerType._zod.values),ue(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(r,o)=>n.innerType._zod.run(r,o)}),N0=T("$ZodNullable",(e,n)=>{be.init(e,n),ue(e._zod,"optin",()=>n.innerType._zod.optin),ue(e._zod,"optout",()=>n.innerType._zod.optout),ue(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${Ya(r.source)}|null)$`):void 0}),ue(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:n.innerType._zod.run(r,o)}),U0=T("$ZodDefault",(e,n)=>{be.init(e,n),e._zod.optin="optional",ue(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return n.innerType._zod.run(r,o);if(r.value===void 0)return r.value=n.defaultValue,r;const i=n.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>Bl(a,n)):Bl(i,n)}});function Bl(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const A0=T("$ZodPrefault",(e,n)=>{be.init(e,n),e._zod.optin="optional",ue(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=n.defaultValue),n.innerType._zod.run(r,o))}),j0=T("$ZodNonOptional",(e,n)=>{be.init(e,n),ue(e._zod,"values",()=>{const r=n.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{const i=n.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>Xl(a,e)):Xl(i,e)}});function Xl(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const Z0=T("$ZodCatch",(e,n)=>{be.init(e,n),ue(e._zod,"optin",()=>n.innerType._zod.optin),ue(e._zod,"optout",()=>n.innerType._zod.optout),ue(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return n.innerType._zod.run(r,o);const i=n.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>(r.value=a.value,a.issues.length&&(r.value=n.catchValue({...r,error:{issues:a.issues.map(s=>Gt(s,o,Wt()))},input:r.value}),r.issues=[]),r)):(r.value=i.value,i.issues.length&&(r.value=n.catchValue({...r,error:{issues:i.issues.map(a=>Gt(a,o,Wt()))},input:r.value}),r.issues=[]),r)}}),C0=T("$ZodPipe",(e,n)=>{be.init(e,n),ue(e._zod,"values",()=>n.in._zod.values),ue(e._zod,"optin",()=>n.in._zod.optin),ue(e._zod,"optout",()=>n.out._zod.optout),ue(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){const a=n.out._zod.run(r,o);return a instanceof Promise?a.then(s=>ui(s,n.in,o)):ui(a,n.in,o)}const i=n.in._zod.run(r,o);return i instanceof Promise?i.then(a=>ui(a,n.out,o)):ui(i,n.out,o)}});function ui(e,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},r)}const D0=T("$ZodReadonly",(e,n)=>{be.init(e,n),ue(e._zod,"propValues",()=>n.innerType._zod.propValues),ue(e._zod,"values",()=>n.innerType._zod.values),ue(e._zod,"optin",()=>{var r,o;return(o=(r=n.innerType)==null?void 0:r._zod)==null?void 0:o.optin}),ue(e._zod,"optout",()=>{var r,o;return(o=(r=n.innerType)==null?void 0:r._zod)==null?void 0:o.optout}),e._zod.parse=(r,o)=>{if(o.direction==="backward")return n.innerType._zod.run(r,o);const i=n.innerType._zod.run(r,o);return i instanceof Promise?i.then(Kl):Kl(i)}});function Kl(e){return e.value=Object.freeze(e.value),e}const R0=T("$ZodCustom",(e,n)=>{Ve.init(e,n),be.init(e,n),e._zod.parse=(r,o)=>r,e._zod.check=r=>{const o=r.value,i=n.fn(o);if(i instanceof Promise)return i.then(a=>Yl(a,r,o,e));Yl(i,r,o,e)}});function Yl(e,n,r,o){if(!e){const i={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(i.params=o._zod.def.params),n.issues.push(fr(i))}}var Ql;class M0{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...r){const o=r[0];return this._map.set(n,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const r=this._map.get(n);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(n),this}get(n){const r=n._zod.parent;if(r){const o={...this.get(r)??{}};delete o.id;const i={...o,...this._map.get(n)};return Object.keys(i).length?i:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function L0(){return new M0}(Ql=globalThis).__zod_globalRegistry??(Ql.__zod_globalRegistry=L0());const er=globalThis.__zod_globalRegistry;function F0(e,n){return new e({type:"string",...q(n)})}function q0(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...q(n)})}function ec(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...q(n)})}function J0(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...q(n)})}function H0(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...q(n)})}function V0(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...q(n)})}function W0(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...q(n)})}function G0(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...q(n)})}function B0(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...q(n)})}function X0(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...q(n)})}function K0(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...q(n)})}function Y0(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...q(n)})}function Q0(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...q(n)})}function e$(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...q(n)})}function t$(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...q(n)})}function n$(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...q(n)})}function r$(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...q(n)})}function i$(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...q(n)})}function o$(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...q(n)})}function a$(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...q(n)})}function s$(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...q(n)})}function u$(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...q(n)})}function l$(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...q(n)})}function c$(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...q(n)})}function f$(e,n){return new e({type:"string",format:"date",check:"string_format",...q(n)})}function d$(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...q(n)})}function h$(e,n){return new e({type:"string",format:"duration",check:"string_format",...q(n)})}function p$(e,n){return new e({type:"number",checks:[],...q(n)})}function m$(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...q(n)})}function g$(e,n){return new e({type:"boolean",...q(n)})}function v$(e,n){return new e({type:"null",...q(n)})}function _$(e){return new e({type:"unknown"})}function y$(e,n){return new e({type:"never",...q(n)})}function tc(e,n){return new Gf({check:"less_than",...q(n),value:e,inclusive:!1})}function ua(e,n){return new Gf({check:"less_than",...q(n),value:e,inclusive:!0})}function nc(e,n){return new Bf({check:"greater_than",...q(n),value:e,inclusive:!1})}function la(e,n){return new Bf({check:"greater_than",...q(n),value:e,inclusive:!0})}function rc(e,n){return new Nb({check:"multiple_of",...q(n),value:e})}function nd(e,n){return new Ab({check:"max_length",...q(n),maximum:e})}function Pi(e,n){return new jb({check:"min_length",...q(n),minimum:e})}function rd(e,n){return new Zb({check:"length_equals",...q(n),length:e})}function b$(e,n){return new Cb({check:"string_format",format:"regex",...q(n),pattern:e})}function $$(e){return new Db({check:"string_format",format:"lowercase",...q(e)})}function w$(e){return new Rb({check:"string_format",format:"uppercase",...q(e)})}function k$(e,n){return new Mb({check:"string_format",format:"includes",...q(n),includes:e})}function x$(e,n){return new Lb({check:"string_format",format:"starts_with",...q(n),prefix:e})}function S$(e,n){return new Fb({check:"string_format",format:"ends_with",...q(n),suffix:e})}function Ln(e){return new qb({check:"overwrite",tx:e})}function I$(e){return Ln(n=>n.normalize(e))}function z$(){return Ln(e=>e.trim())}function O$(){return Ln(e=>e.toLowerCase())}function P$(){return Ln(e=>e.toUpperCase())}function T$(){return Ln(e=>Cy(e))}function E$(e,n,r){return new e({type:"array",element:n,...q(r)})}function N$(e,n,r){const o=q(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:n,...o})}function U$(e,n,r){return new e({type:"custom",check:"custom",fn:n,...q(r)})}function A$(e){const n=j$(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(fr(o,r.value,n._zod.def));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(fr(i))}},e(r.value,r)));return n}function j$(e,n){const r=new Ve({check:"custom",...q(n)});return r._zod.check=e,r}function id(e){let n=(e==null?void 0:e.target)??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??er,target:n,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Pe(e,n,r={path:[],schemaPath:[]}){var d,f;var o;const i=e._zod.def,a=n.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;const s={schema:{},count:1,cycle:void 0,path:r.path};n.seen.set(e,s);const u=(f=(d=e._zod).toJSONSchema)==null?void 0:f.call(d);if(u)s.schema=u;else{const h={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,s.schema,h);else{const m=s.schema,v=n.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,n,m,h)}const p=e._zod.parent;p&&(s.ref||(s.ref=p),Pe(p,n,h),n.seen.get(p).isParent=!0)}const l=n.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),n.io==="input"&&Re(e)&&(delete s.schema.examples,delete s.schema.default),n.io==="input"&&s.schema._prefault&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,n.seen.get(e).schema}function od(e,n){var s,u,l,c;const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const d of e.seen.entries()){const f=(s=e.metadataRegistry.get(d[0]))==null?void 0:s.id;if(f){const h=o.get(f);if(h&&h!==d[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(f,d[0])}}const i=d=>{var v;const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=(v=e.external.registry.get(d[0]))==null?void 0:v.id,g=e.external.uri??(z=>z);if(y)return{ref:g(y)};const w=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=w,{defId:w,ref:`${g("__shared")}#/${f}/${w}`}}if(d[1]===r)return{ref:"#"};const p=`#/${f}/`,m=d[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:p+m}},a=d=>{if(d[1].schema.$ref)return;const f=d[1],{ref:h,defId:p}=i(d);f.def={...f.schema},p&&(f.defId=p);const m=f.schema;for(const v in m)delete m[v];m.$ref=h};if(e.cycles==="throw")for(const d of e.seen.entries()){const f=d[1];if(f.cycle)throw new Error(`Cycle detected: #/${(u=f.cycle)==null?void 0:u.join("/")}/<root>
44
+ `)}p.write("payload.value = newResult;"),p.write("return payload;");const w=p.compile();return(b,v)=>w(d,b,v)};let s;const a=cn,u=!Ds.jitless,l=u&&tc.value,h=n.catchall;let f;e._zod.parse=(d,p)=>{f??(f=i.value);const g=d.value;return a(g)?u&&l&&(p==null?void 0:p.async)===!1&&p.jitless!==!0?(s||(s=o(n.shape)),d=s(d,p),h?ta([],g,d,p,f,e):d):r(d,p):(d.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),d)}});function ho(e,n,r,i){for(const s of e)if(s.issues.length===0)return n.value=s.value,n;const o=e.filter(s=>!$t(s));return o.length===1?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(s=>s.issues.map(a=>_t(a,i,mt())))}),n)}const na=A("$ZodUnion",(e,n)=>{ae.init(e,n),Q(e._zod,"optin",()=>n.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Q(e._zod,"optout",()=>n.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Q(e._zod,"values",()=>{if(n.options.every(o=>o._zod.values))return new Set(n.options.flatMap(o=>Array.from(o._zod.values)))}),Q(e._zod,"pattern",()=>{if(n.options.every(o=>o._zod.pattern)){const o=n.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>di(s.source)).join("|")})$`)}});const r=n.options.length===1,i=n.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return i(o,s);let a=!1;const u=[];for(const c of n.options){const l=c._zod.run({value:o.value,issues:[]},s);if(l instanceof Promise)u.push(l),a=!0;else{if(l.issues.length===0)return l;u.push(l)}}return a?Promise.all(u).then(c=>ho(c,o,e,s)):ho(u,o,e,s)}}),Hl=A("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,na.init(e,n);const r=e._zod.parse;Q(e._zod,"propValues",()=>{const o={};for(const s of n.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(s)}"`);for(const[u,c]of Object.entries(a)){o[u]||(o[u]=new Set);for(const l of c)o[u].add(l)}}return o});const i=dr(()=>{var a;const o=n.options,s=new Map;for(const u of o){const c=(a=u._zod.propValues)==null?void 0:a[n.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(u)}"`);for(const l of c){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,u)}}return s});e._zod.parse=(o,s)=>{const a=o.value;if(!cn(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),o;const u=i.value.get(a==null?void 0:a[n.discriminator]);return u?u._zod.run(o,s):n.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,input:a,path:[n.discriminator],inst:e}),o)}}),Vl=A("$ZodIntersection",(e,n)=>{ae.init(e,n),e._zod.parse=(r,i)=>{const o=r.value,s=n.left._zod.run({value:o,issues:[]},i),a=n.right._zod.run({value:o,issues:[]},i);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([c,l])=>po(r,c,l)):po(r,s,a)}});function Lr(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Dt(e)&&Dt(n)){const r=Object.keys(n),i=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...n};for(const s of i){const a=Lr(e[s],n[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};o[s]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;i<e.length;i++){const o=e[i],s=n[i],a=Lr(o,s);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function po(e,n,r){const i=new Map;let o;for(const u of n.issues)if(u.code==="unrecognized_keys"){o??(o=u);for(const c of u.keys)i.has(c)||i.set(c,{}),i.get(c).l=!0}else e.issues.push(u);for(const u of r.issues)if(u.code==="unrecognized_keys")for(const c of u.keys)i.has(c)||i.set(c,{}),i.get(c).r=!0;else e.issues.push(u);const s=[...i].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(s.length&&o&&e.issues.push({...o,keys:s}),$t(e))return e;const a=Lr(n.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Bl=A("$ZodRecord",(e,n)=>{ae.init(e,n),e._zod.parse=(r,i)=>{const o=r.value;if(!Dt(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const s=[],a=n.keyType._zod.values;if(a){r.value={};const u=new Set;for(const l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){u.add(typeof l=="number"?l.toString():l);const h=n.valueType._zod.run({value:o[l],issues:[]},i);h instanceof Promise?s.push(h.then(f=>{f.issues.length&&r.issues.push(...It(l,f.issues)),r.value[l]=f.value})):(h.issues.length&&r.issues.push(...It(l,h.issues)),r.value[l]=h.value)}let c;for(const l in o)u.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c})}else{r.value={};for(const u of Reflect.ownKeys(o)){if(u==="__proto__")continue;let c=n.keyType._zod.run({value:u,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Js.test(u)&&c.issues.length&&c.issues.some(f=>f.code==="invalid_type"&&f.expected==="number")){const f=n.keyType._zod.run({value:Number(u),issues:[]},i);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(c=f)}if(c.issues.length){n.mode==="loose"?r.value[u]=o[u]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(f=>_t(f,i,mt())),input:u,path:[u],inst:e});continue}const h=n.valueType._zod.run({value:o[u],issues:[]},i);h instanceof Promise?s.push(h.then(f=>{f.issues.length&&r.issues.push(...It(u,f.issues)),r.value[c.value]=f.value})):(h.issues.length&&r.issues.push(...It(u,h.issues)),r.value[c.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}}),Wl=A("$ZodEnum",(e,n)=>{ae.init(e,n);const r=js(n.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(o=>nc.has(typeof o)).map(o=>typeof o=="string"?jt(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const a=o.value;return i.has(a)||o.issues.push({code:"invalid_value",values:r,input:a,inst:e}),o}}),Jl=A("$ZodLiteral",(e,n)=>{if(ae.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(n.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.values.map(i=>typeof i=="string"?jt(i):i?jt(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,o)=>{const s=i.value;return r.has(s)||i.issues.push({code:"invalid_value",values:n.values,input:s,inst:e}),i}}),Gl=A("$ZodTransform",(e,n)=>{ae.init(e,n),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ns(e.constructor.name);const o=n.transform(r.value,r);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(r.value=a,r));if(o instanceof Promise)throw new Mt;return r.value=o,r}});function go(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const ra=A("$ZodOptional",(e,n)=>{ae.init(e,n),e._zod.optin="optional",e._zod.optout="optional",Q(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),Q(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${di(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(n.innerType._zod.optin==="optional"){const o=n.innerType._zod.run(r,i);return o instanceof Promise?o.then(s=>go(s,r.value)):go(o,r.value)}return r.value===void 0?r:n.innerType._zod.run(r,i)}}),Xl=A("$ZodExactOptional",(e,n)=>{ra.init(e,n),Q(e._zod,"values",()=>n.innerType._zod.values),Q(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(r,i)=>n.innerType._zod.run(r,i)}),Kl=A("$ZodNullable",(e,n)=>{ae.init(e,n),Q(e._zod,"optin",()=>n.innerType._zod.optin),Q(e._zod,"optout",()=>n.innerType._zod.optout),Q(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${di(r.source)}|null)$`):void 0}),Q(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:n.innerType._zod.run(r,i)}),Yl=A("$ZodDefault",(e,n)=>{ae.init(e,n),e._zod.optin="optional",Q(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);if(r.value===void 0)return r.value=n.defaultValue,r;const o=n.innerType._zod.run(r,i);return o instanceof Promise?o.then(s=>mo(s,n)):mo(o,n)}});function mo(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const Ql=A("$ZodPrefault",(e,n)=>{ae.init(e,n),e._zod.optin="optional",Q(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=n.defaultValue),n.innerType._zod.run(r,i))}),ef=A("$ZodNonOptional",(e,n)=>{ae.init(e,n),Q(e._zod,"values",()=>{const r=n.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const o=n.innerType._zod.run(r,i);return o instanceof Promise?o.then(s=>_o(s,e)):_o(o,e)}});function _o(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const tf=A("$ZodCatch",(e,n)=>{ae.init(e,n),Q(e._zod,"optin",()=>n.innerType._zod.optin),Q(e._zod,"optout",()=>n.innerType._zod.optout),Q(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);const o=n.innerType._zod.run(r,i);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=n.catchValue({...r,error:{issues:s.issues.map(a=>_t(a,i,mt()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=n.catchValue({...r,error:{issues:o.issues.map(s=>_t(s,i,mt()))},input:r.value}),r.issues=[]),r)}}),nf=A("$ZodPipe",(e,n)=>{ae.init(e,n),Q(e._zod,"values",()=>n.in._zod.values),Q(e._zod,"optin",()=>n.in._zod.optin),Q(e._zod,"optout",()=>n.out._zod.optout),Q(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){const s=n.out._zod.run(r,i);return s instanceof Promise?s.then(a=>In(a,n.in,i)):In(s,n.in,i)}const o=n.in._zod.run(r,i);return o instanceof Promise?o.then(s=>In(s,n.out,i)):In(o,n.out,i)}});function In(e,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},r)}const rf=A("$ZodReadonly",(e,n)=>{ae.init(e,n),Q(e._zod,"propValues",()=>n.innerType._zod.propValues),Q(e._zod,"values",()=>n.innerType._zod.values),Q(e._zod,"optin",()=>{var r,i;return(i=(r=n.innerType)==null?void 0:r._zod)==null?void 0:i.optin}),Q(e._zod,"optout",()=>{var r,i;return(i=(r=n.innerType)==null?void 0:r._zod)==null?void 0:i.optout}),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);const o=n.innerType._zod.run(r,i);return o instanceof Promise?o.then(yo):yo(o)}});function yo(e){return e.value=Object.freeze(e.value),e}const of=A("$ZodCustom",(e,n)=>{Ce.init(e,n),ae.init(e,n),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,o=n.fn(i);if(o instanceof Promise)return o.then(s=>vo(s,r,i,e));vo(o,r,i,e)}});function vo(e,n,r,i){if(!e){const o={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),n.issues.push(ln(o))}}var bo;class sf{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...r){const i=r[0];return this._map.set(n,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const r=this._map.get(n);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(n),this}get(n){const r=n._zod.parent;if(r){const i={...this.get(r)??{}};delete i.id;const o={...i,...this._map.get(n)};return Object.keys(o).length?o:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function af(){return new sf}(bo=globalThis).__zod_globalRegistry??(bo.__zod_globalRegistry=af());const Qt=globalThis.__zod_globalRegistry;function uf(e,n){return new e({type:"string",...Z(n)})}function cf(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Z(n)})}function wo(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Z(n)})}function lf(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Z(n)})}function ff(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Z(n)})}function hf(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Z(n)})}function df(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Z(n)})}function pf(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(n)})}function gf(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Z(n)})}function mf(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Z(n)})}function _f(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Z(n)})}function yf(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Z(n)})}function vf(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Z(n)})}function bf(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Z(n)})}function wf(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Z(n)})}function xf(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Z(n)})}function kf(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Z(n)})}function Sf(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Z(n)})}function zf(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Z(n)})}function Tf(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Z(n)})}function Cf(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Z(n)})}function Pf(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Z(n)})}function Ef(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Z(n)})}function Af(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Z(n)})}function Rf(e,n){return new e({type:"string",format:"date",check:"string_format",...Z(n)})}function $f(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...Z(n)})}function If(e,n){return new e({type:"string",format:"duration",check:"string_format",...Z(n)})}function Mf(e,n){return new e({type:"number",checks:[],...Z(n)})}function Of(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(n)})}function Nf(e,n){return new e({type:"boolean",...Z(n)})}function Df(e,n){return new e({type:"undefined",...Z(n)})}function jf(e,n){return new e({type:"null",...Z(n)})}function Zf(e){return new e({type:"unknown"})}function qf(e,n){return new e({type:"never",...Z(n)})}function xo(e,n){return new Xs({check:"less_than",...Z(n),value:e,inclusive:!1})}function Pr(e,n){return new Xs({check:"less_than",...Z(n),value:e,inclusive:!0})}function ko(e,n){return new Ks({check:"greater_than",...Z(n),value:e,inclusive:!1})}function Er(e,n){return new Ks({check:"greater_than",...Z(n),value:e,inclusive:!0})}function So(e,n){return new Xc({check:"multiple_of",...Z(n),value:e})}function ia(e,n){return new Yc({check:"max_length",...Z(n),maximum:e})}function Xn(e,n){return new Qc({check:"min_length",...Z(n),minimum:e})}function oa(e,n){return new el({check:"length_equals",...Z(n),length:e})}function Uf(e,n){return new tl({check:"string_format",format:"regex",...Z(n),pattern:e})}function Lf(e){return new nl({check:"string_format",format:"lowercase",...Z(e)})}function Ff(e){return new rl({check:"string_format",format:"uppercase",...Z(e)})}function Hf(e,n){return new il({check:"string_format",format:"includes",...Z(n),includes:e})}function Vf(e,n){return new ol({check:"string_format",format:"starts_with",...Z(n),prefix:e})}function Bf(e,n){return new sl({check:"string_format",format:"ends_with",...Z(n),suffix:e})}function Ft(e){return new al({check:"overwrite",tx:e})}function Wf(e){return Ft(n=>n.normalize(e))}function Jf(){return Ft(e=>e.trim())}function Gf(){return Ft(e=>e.toLowerCase())}function Xf(){return Ft(e=>e.toUpperCase())}function Kf(){return Ft(e=>ec(e))}function Yf(e,n,r){return new e({type:"array",element:n,...Z(r)})}function Qf(e,n,r){const i=Z(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:n,...i})}function eh(e,n,r){return new e({type:"custom",check:"custom",fn:n,...Z(r)})}function th(e){const n=nh(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(ln(i,r.value,n._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),r.issues.push(ln(o))}},e(r.value,r)));return n}function nh(e,n){const r=new Ce({check:"custom",...Z(n)});return r._zod.check=e,r}function sa(e){let n=(e==null?void 0:e.target)??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Qt,target:n,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function ge(e,n,r={path:[],schemaPath:[]}){var h,f;var i;const o=e._zod.def,s=n.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};n.seen.set(e,a);const u=(f=(h=e._zod).toJSONSchema)==null?void 0:f.call(h);if(u)a.schema=u;else{const d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,a.schema,d);else{const g=a.schema,_=n.processors[o.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);_(e,n,g,d)}const p=e._zod.parent;p&&(a.ref||(a.ref=p),ge(p,n,d),n.seen.get(p).isParent=!0)}const c=n.metadataRegistry.get(e);return c&&Object.assign(a.schema,c),n.io==="input"&&xe(e)&&(delete a.schema.examples,delete a.schema.default),n.io==="input"&&a.schema._prefault&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,n.seen.get(e).schema}function aa(e,n){var a,u,c,l;const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const h of e.seen.entries()){const f=(a=e.metadataRegistry.get(h[0]))==null?void 0:a.id;if(f){const d=i.get(f);if(d&&d!==h[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(f,h[0])}}const o=h=>{var _;const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=(_=e.external.registry.get(h[0]))==null?void 0:_.id,m=e.external.uri??(C=>C);if(y)return{ref:m(y)};const w=h[1].defId??h[1].schema.id??`schema${e.counter++}`;return h[1].defId=w,{defId:w,ref:`${m("__shared")}#/${f}/${w}`}}if(h[1]===r)return{ref:"#"};const p=`#/${f}/`,g=h[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:p+g}},s=h=>{if(h[1].schema.$ref)return;const f=h[1],{ref:d,defId:p}=o(h);f.def={...f.schema},p&&(f.defId=p);const g=f.schema;for(const _ in g)delete g[_];g.$ref=d};if(e.cycles==="throw")for(const h of e.seen.entries()){const f=h[1];if(f.cycle)throw new Error(`Cycle detected: #/${(u=f.cycle)==null?void 0:u.join("/")}/<root>
45
45
 
46
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const f=d[1];if(n===d[0]){a(d);continue}if(e.external){const p=(l=e.external.registry.get(d[0]))==null?void 0:l.id;if(n!==d[0]&&p){a(d);continue}}if((c=e.metadataRegistry.get(d[0]))==null?void 0:c.id){a(d);continue}if(f.cycle){a(d);continue}if(f.count>1&&e.reused==="ref"){a(d);continue}}}function ad(e,n){var s,u,l;const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=c=>{const d=e.seen.get(c);if(d.ref===null)return;const f=d.def??d.schema,h={...f},p=d.ref;if(d.ref=null,p){o(p);const v=e.seen.get(p),y=v.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(y)):Object.assign(f,y),Object.assign(f,h),c._zod.parent===p)for(const w in f)w==="$ref"||w==="allOf"||w in h||delete f[w];if(y.$ref)for(const w in f)w==="$ref"||w==="allOf"||w in v.def&&JSON.stringify(f[w])===JSON.stringify(v.def[w])&&delete f[w]}const m=c._zod.parent;if(m&&m!==p){o(m);const v=e.seen.get(m);if(v!=null&&v.schema.$ref&&(f.$ref=v.schema.$ref,v.def))for(const y in f)y==="$ref"||y==="allOf"||y in v.def&&JSON.stringify(f[y])===JSON.stringify(v.def[y])&&delete f[y]}e.override({zodSchema:c,jsonSchema:f,path:d.path??[]})};for(const c of[...e.seen.entries()].reverse())o(c[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,(s=e.external)!=null&&s.uri){const c=(u=e.external.registry.get(n))==null?void 0:u.id;if(!c)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(c)}Object.assign(i,r.def??r.schema);const a=((l=e.external)==null?void 0:l.defs)??{};for(const c of e.seen.entries()){const d=c[1];d.def&&d.defId&&(a[d.defId]=d.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const c=JSON.parse(JSON.stringify(i));return Object.defineProperty(c,"~standard",{value:{...n["~standard"],jsonSchema:{input:Ti(n,"input",e.processors),output:Ti(n,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Re(e,n){const r=n??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Re(o.element,r);if(o.type==="set")return Re(o.valueType,r);if(o.type==="lazy")return Re(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")return Re(o.innerType,r);if(o.type==="intersection")return Re(o.left,r)||Re(o.right,r);if(o.type==="record"||o.type==="map")return Re(o.keyType,r)||Re(o.valueType,r);if(o.type==="pipe")return Re(o.in,r)||Re(o.out,r);if(o.type==="object"){for(const i in o.shape)if(Re(o.shape[i],r))return!0;return!1}if(o.type==="union"){for(const i of o.options)if(Re(i,r))return!0;return!1}if(o.type==="tuple"){for(const i of o.items)if(Re(i,r))return!0;return!!(o.rest&&Re(o.rest,r))}return!1}const Z$=(e,n={})=>r=>{const o=id({...r,processors:n});return Pe(e,o),od(o,e),ad(o,e)},Ti=(e,n,r={})=>o=>{const{libraryOptions:i,target:a}=o??{},s=id({...i??{},target:a,io:n,processors:r});return Pe(e,s),od(s,e),ad(s,e)},C$={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},D$=(e,n,r,o)=>{const i=r;i.type="string";const{minimum:a,maximum:s,format:u,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof s=="number"&&(i.maxLength=s),u&&(i.format=C$[u]??u,i.format===""&&delete i.format,u==="time"&&delete i.format),c&&(i.contentEncoding=c),l&&l.size>0){const d=[...l];d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(f=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},R$=(e,n,r,o)=>{const i=r,{minimum:a,maximum:s,format:u,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:d}=e._zod.bag;typeof u=="string"&&u.includes("int")?i.type="integer":i.type="number",typeof d=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(i.minimum=d,i.exclusiveMinimum=!0):i.exclusiveMinimum=d),typeof a=="number"&&(i.minimum=a,typeof d=="number"&&n.target!=="draft-04"&&(d>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof c=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c),typeof s=="number"&&(i.maximum=s,typeof c=="number"&&n.target!=="draft-04"&&(c<=s?delete i.maximum:delete i.exclusiveMaximum)),typeof l=="number"&&(i.multipleOf=l)},M$=(e,n,r,o)=>{r.type="boolean"},L$=(e,n,r,o)=>{n.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},F$=(e,n,r,o)=>{r.not={}},q$=(e,n,r,o)=>{},J$=(e,n,r,o)=>{const i=e._zod.def,a=Zf(i.entries);a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),r.enum=a},H$=(e,n,r,o)=>{const i=e._zod.def,a=[];for(const s of i.values)if(s===void 0){if(n.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(n.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(s))}else a.push(s);if(a.length!==0)if(a.length===1){const s=a[0];r.type=s===null?"null":typeof s,n.target==="draft-04"||n.target==="openapi-3.0"?r.enum=[s]:r.const=s}else a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),a.every(s=>typeof s=="boolean")&&(r.type="boolean"),a.every(s=>s===null)&&(r.type="null"),r.enum=a},V$=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},W$=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},G$=(e,n,r,o)=>{const i=r,a=e._zod.def,{minimum:s,maximum:u}=e._zod.bag;typeof s=="number"&&(i.minItems=s),typeof u=="number"&&(i.maxItems=u),i.type="array",i.items=Pe(a.element,n,{...o,path:[...o.path,"items"]})},B$=(e,n,r,o)=>{var c;const i=r,a=e._zod.def;i.type="object",i.properties={};const s=a.shape;for(const d in s)i.properties[d]=Pe(s[d],n,{...o,path:[...o.path,"properties",d]});const u=new Set(Object.keys(s)),l=new Set([...u].filter(d=>{const f=a.shape[d]._zod;return n.io==="input"?f.optin===void 0:f.optout===void 0}));l.size>0&&(i.required=Array.from(l)),((c=a.catchall)==null?void 0:c._zod.def.type)==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Pe(a.catchall,n,{...o,path:[...o.path,"additionalProperties"]})):n.io==="output"&&(i.additionalProperties=!1)},X$=(e,n,r,o)=>{const i=e._zod.def,a=i.inclusive===!1,s=i.options.map((u,l)=>Pe(u,n,{...o,path:[...o.path,a?"oneOf":"anyOf",l]}));a?r.oneOf=s:r.anyOf=s},K$=(e,n,r,o)=>{const i=e._zod.def,a=Pe(i.left,n,{...o,path:[...o.path,"allOf",0]}),s=Pe(i.right,n,{...o,path:[...o.path,"allOf",1]}),u=c=>"allOf"in c&&Object.keys(c).length===1,l=[...u(a)?a.allOf:[a],...u(s)?s.allOf:[s]];r.allOf=l},Y$=(e,n,r,o)=>{const i=r,a=e._zod.def;i.type="object";const s=a.keyType,u=s._zod.bag,l=u==null?void 0:u.patterns;if(a.mode==="loose"&&l&&l.size>0){const d=Pe(a.valueType,n,{...o,path:[...o.path,"patternProperties","*"]});i.patternProperties={};for(const f of l)i.patternProperties[f.source]=d}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(i.propertyNames=Pe(a.keyType,n,{...o,path:[...o.path,"propertyNames"]})),i.additionalProperties=Pe(a.valueType,n,{...o,path:[...o.path,"additionalProperties"]});const c=s._zod.values;if(c){const d=[...c].filter(f=>typeof f=="string"||typeof f=="number");d.length>0&&(i.required=d)}},Q$=(e,n,r,o)=>{const i=e._zod.def,a=Pe(i.innerType,n,o),s=n.seen.get(e);n.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},ew=(e,n,r,o)=>{const i=e._zod.def;Pe(i.innerType,n,o);const a=n.seen.get(e);a.ref=i.innerType},tw=(e,n,r,o)=>{const i=e._zod.def;Pe(i.innerType,n,o);const a=n.seen.get(e);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},nw=(e,n,r,o)=>{const i=e._zod.def;Pe(i.innerType,n,o);const a=n.seen.get(e);a.ref=i.innerType,n.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},rw=(e,n,r,o)=>{const i=e._zod.def;Pe(i.innerType,n,o);const a=n.seen.get(e);a.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},iw=(e,n,r,o)=>{const i=e._zod.def,a=n.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Pe(a,n,o);const s=n.seen.get(e);s.ref=a},ow=(e,n,r,o)=>{const i=e._zod.def;Pe(i.innerType,n,o);const a=n.seen.get(e);a.ref=i.innerType,r.readOnly=!0},sd=(e,n,r,o)=>{const i=e._zod.def;Pe(i.innerType,n,o);const a=n.seen.get(e);a.ref=i.innerType};function rs(e){return!!e._zod}function ud(e,n){return rs(e)?Ff(e,n):e.safeParse(n)}function aw(e){var r,o;if(!e)return;let n;if(rs(e)?n=(o=(r=e._zod)==null?void 0:r.def)==null?void 0:o.shape:n=e.shape,!!n){if(typeof n=="function")try{return n()}catch{return}return n}}function sw(e){var i;if(rs(e)){const s=(i=e._zod)==null?void 0:i.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}const r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}const o=e.value;if(o!==void 0)return o}const uw=T("ZodISODateTime",(e,n)=>{r0.init(e,n),ze.init(e,n)});function ld(e){return c$(uw,e)}const lw=T("ZodISODate",(e,n)=>{i0.init(e,n),ze.init(e,n)});function cw(e){return f$(lw,e)}const fw=T("ZodISOTime",(e,n)=>{o0.init(e,n),ze.init(e,n)});function dw(e){return d$(fw,e)}const hw=T("ZodISODuration",(e,n)=>{a0.init(e,n),ze.init(e,n)});function pw(e){return h$(hw,e)}const mw=(e,n)=>{Mf.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Xy(e,r)},flatten:{value:r=>By(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,$a,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,$a,2)}},isEmpty:{get(){return e.issues.length===0}}})},ct=T("ZodError",mw,{Parent:Error}),gw=es(ct),vw=ts(ct),_w=no(ct),yw=ro(ct),bw=Yy(ct),$w=Qy(ct),ww=eb(ct),kw=tb(ct),xw=nb(ct),Sw=rb(ct),Iw=ib(ct),zw=ob(ct),we=T("ZodType",(e,n)=>(be.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:Ti(e,"input"),output:Ti(e,"output")}}),e.toJSONSchema=Z$(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...r)=>e.clone(Yt(n,{checks:[...n.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(r,o)=>Qt(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.parse=(r,o)=>gw(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>_w(e,r,o),e.parseAsync=async(r,o)=>vw(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>yw(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>bw(e,r,o),e.decode=(r,o)=>$w(e,r,o),e.encodeAsync=async(r,o)=>ww(e,r,o),e.decodeAsync=async(r,o)=>kw(e,r,o),e.safeEncode=(r,o)=>xw(e,r,o),e.safeDecode=(r,o)=>Sw(e,r,o),e.safeEncodeAsync=async(r,o)=>Iw(e,r,o),e.safeDecodeAsync=async(r,o)=>zw(e,r,o),e.refine=(r,o)=>e.check(_k(r,o)),e.superRefine=r=>e.check(yk(r)),e.overwrite=r=>e.check(Ln(r)),e.optional=()=>Oe(e),e.exactOptional=()=>ok(e),e.nullable=()=>ac(e),e.nullish=()=>Oe(ac(e)),e.nonoptional=r=>fk(e,r),e.array=()=>ie(e),e.or=r=>ve([e,r]),e.and=r=>is(e,r),e.transform=r=>xa(e,gd(r)),e.default=r=>uk(e,r),e.prefault=r=>ck(e,r),e.catch=r=>hk(e,r),e.pipe=r=>xa(e,r),e.readonly=()=>gk(e),e.describe=r=>{const o=e.clone();return er.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){var r;return(r=er.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return er.get(e);const o=e.clone();return er.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),cd=T("_ZodString",(e,n)=>{ns.init(e,n),we.init(e,n),e._zod.processJSONSchema=(o,i,a)=>D$(e,o,i);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(b$(...o)),e.includes=(...o)=>e.check(k$(...o)),e.startsWith=(...o)=>e.check(x$(...o)),e.endsWith=(...o)=>e.check(S$(...o)),e.min=(...o)=>e.check(Pi(...o)),e.max=(...o)=>e.check(nd(...o)),e.length=(...o)=>e.check(rd(...o)),e.nonempty=(...o)=>e.check(Pi(1,...o)),e.lowercase=o=>e.check($$(o)),e.uppercase=o=>e.check(w$(o)),e.trim=()=>e.check(z$()),e.normalize=(...o)=>e.check(I$(...o)),e.toLowerCase=()=>e.check(O$()),e.toUpperCase=()=>e.check(P$()),e.slugify=()=>e.check(T$())}),Ow=T("ZodString",(e,n)=>{ns.init(e,n),cd.init(e,n),e.email=r=>e.check(q0(Pw,r)),e.url=r=>e.check(G0(Tw,r)),e.jwt=r=>e.check(l$(Hw,r)),e.emoji=r=>e.check(B0(Ew,r)),e.guid=r=>e.check(ec(ic,r)),e.uuid=r=>e.check(J0(li,r)),e.uuidv4=r=>e.check(H0(li,r)),e.uuidv6=r=>e.check(V0(li,r)),e.uuidv7=r=>e.check(W0(li,r)),e.nanoid=r=>e.check(X0(Nw,r)),e.guid=r=>e.check(ec(ic,r)),e.cuid=r=>e.check(K0(Uw,r)),e.cuid2=r=>e.check(Y0(Aw,r)),e.ulid=r=>e.check(Q0(jw,r)),e.base64=r=>e.check(a$(Fw,r)),e.base64url=r=>e.check(s$(qw,r)),e.xid=r=>e.check(e$(Zw,r)),e.ksuid=r=>e.check(t$(Cw,r)),e.ipv4=r=>e.check(n$(Dw,r)),e.ipv6=r=>e.check(r$(Rw,r)),e.cidrv4=r=>e.check(i$(Mw,r)),e.cidrv6=r=>e.check(o$(Lw,r)),e.e164=r=>e.check(u$(Jw,r)),e.datetime=r=>e.check(ld(r)),e.date=r=>e.check(cw(r)),e.time=r=>e.check(dw(r)),e.duration=r=>e.check(pw(r))});function P(e){return F0(Ow,e)}const ze=T("ZodStringFormat",(e,n)=>{$e.init(e,n),cd.init(e,n)}),Pw=T("ZodEmail",(e,n)=>{Gb.init(e,n),ze.init(e,n)}),ic=T("ZodGUID",(e,n)=>{Vb.init(e,n),ze.init(e,n)}),li=T("ZodUUID",(e,n)=>{Wb.init(e,n),ze.init(e,n)}),Tw=T("ZodURL",(e,n)=>{Bb.init(e,n),ze.init(e,n)}),Ew=T("ZodEmoji",(e,n)=>{Xb.init(e,n),ze.init(e,n)}),Nw=T("ZodNanoID",(e,n)=>{Kb.init(e,n),ze.init(e,n)}),Uw=T("ZodCUID",(e,n)=>{Yb.init(e,n),ze.init(e,n)}),Aw=T("ZodCUID2",(e,n)=>{Qb.init(e,n),ze.init(e,n)}),jw=T("ZodULID",(e,n)=>{e0.init(e,n),ze.init(e,n)}),Zw=T("ZodXID",(e,n)=>{t0.init(e,n),ze.init(e,n)}),Cw=T("ZodKSUID",(e,n)=>{n0.init(e,n),ze.init(e,n)}),Dw=T("ZodIPv4",(e,n)=>{s0.init(e,n),ze.init(e,n)}),Rw=T("ZodIPv6",(e,n)=>{u0.init(e,n),ze.init(e,n)}),Mw=T("ZodCIDRv4",(e,n)=>{l0.init(e,n),ze.init(e,n)}),Lw=T("ZodCIDRv6",(e,n)=>{c0.init(e,n),ze.init(e,n)}),Fw=T("ZodBase64",(e,n)=>{f0.init(e,n),ze.init(e,n)}),qw=T("ZodBase64URL",(e,n)=>{h0.init(e,n),ze.init(e,n)}),Jw=T("ZodE164",(e,n)=>{p0.init(e,n),ze.init(e,n)}),Hw=T("ZodJWT",(e,n)=>{g0.init(e,n),ze.init(e,n)}),fd=T("ZodNumber",(e,n)=>{Kf.init(e,n),we.init(e,n),e._zod.processJSONSchema=(o,i,a)=>R$(e,o,i),e.gt=(o,i)=>e.check(nc(o,i)),e.gte=(o,i)=>e.check(la(o,i)),e.min=(o,i)=>e.check(la(o,i)),e.lt=(o,i)=>e.check(tc(o,i)),e.lte=(o,i)=>e.check(ua(o,i)),e.max=(o,i)=>e.check(ua(o,i)),e.int=o=>e.check(oc(o)),e.safe=o=>e.check(oc(o)),e.positive=o=>e.check(nc(0,o)),e.nonnegative=o=>e.check(la(0,o)),e.negative=o=>e.check(tc(0,o)),e.nonpositive=o=>e.check(ua(0,o)),e.multipleOf=(o,i)=>e.check(rc(o,i)),e.step=(o,i)=>e.check(rc(o,i)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function fe(e){return p$(fd,e)}const Vw=T("ZodNumberFormat",(e,n)=>{v0.init(e,n),fd.init(e,n)});function oc(e){return m$(Vw,e)}const Ww=T("ZodBoolean",(e,n)=>{_0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>M$(e,r,o)});function Te(e){return g$(Ww,e)}const Gw=T("ZodNull",(e,n)=>{y0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>L$(e,r,o)});function dd(e){return v$(Gw,e)}const Bw=T("ZodUnknown",(e,n)=>{b0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>q$()});function Se(){return _$(Bw)}const Xw=T("ZodNever",(e,n)=>{$0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>F$(e,r,o)});function Kw(e){return y$(Xw,e)}const Yw=T("ZodArray",(e,n)=>{w0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>G$(e,r,o,i),e.element=n.element,e.min=(r,o)=>e.check(Pi(r,o)),e.nonempty=r=>e.check(Pi(1,r)),e.max=(r,o)=>e.check(nd(r,o)),e.length=(r,o)=>e.check(rd(r,o)),e.unwrap=()=>e.element});function ie(e,n){return E$(Yw,e,n)}const hd=T("ZodObject",(e,n)=>{x0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>B$(e,r,o,i),ue(e,"shape",()=>n.shape),e.keyof=()=>Ke(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Se()}),e.loose=()=>e.clone({...e._zod.def,catchall:Se()}),e.strict=()=>e.clone({...e._zod.def,catchall:Kw()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Jy(e,r),e.safeExtend=r=>Hy(e,r),e.merge=r=>Vy(e,r),e.pick=r=>Fy(e,r),e.omit=r=>qy(e,r),e.partial=(...r)=>Wy(vd,e,r[0]),e.required=(...r)=>Gy(_d,e,r[0])});function L(e,n){const r={type:"object",shape:e??{},...q(n)};return new hd(r)}function Je(e,n){return new hd({type:"object",shape:e,catchall:Se(),...q(n)})}const pd=T("ZodUnion",(e,n)=>{ed.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>X$(e,r,o,i),e.options=n.options});function ve(e,n){return new pd({type:"union",options:e,...q(n)})}const Qw=T("ZodDiscriminatedUnion",(e,n)=>{pd.init(e,n),S0.init(e,n)});function md(e,n,r){return new Qw({type:"union",options:n,discriminator:e,...q(r)})}const ek=T("ZodIntersection",(e,n)=>{I0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>K$(e,r,o,i)});function is(e,n){return new ek({type:"intersection",left:e,right:n})}const tk=T("ZodRecord",(e,n)=>{z0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Y$(e,r,o,i),e.keyType=n.keyType,e.valueType=n.valueType});function Ie(e,n,r){return new tk({type:"record",keyType:e,valueType:n,...q(r)})}const ka=T("ZodEnum",(e,n)=>{O0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(o,i,a)=>J$(e,o,i),e.enum=n.entries,e.options=Object.values(n.entries);const r=new Set(Object.keys(n.entries));e.extract=(o,i)=>{const a={};for(const s of o)if(r.has(s))a[s]=n.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ka({...n,checks:[],...q(i),entries:a})},e.exclude=(o,i)=>{const a={...n.entries};for(const s of o)if(r.has(s))delete a[s];else throw new Error(`Key ${s} not found in enum`);return new ka({...n,checks:[],...q(i),entries:a})}});function Ke(e,n){const r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new ka({type:"enum",entries:r,...q(n)})}const nk=T("ZodLiteral",(e,n)=>{P0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>H$(e,r,o),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function V(e,n){return new nk({type:"literal",values:Array.isArray(e)?e:[e],...q(n)})}const rk=T("ZodTransform",(e,n)=>{T0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>W$(e,r),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Af(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(fr(a,r.value,n));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(fr(s))}};const i=n.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r)):(r.value=i,r)}});function gd(e){return new rk({type:"transform",transform:e})}const vd=T("ZodOptional",(e,n)=>{td.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>sd(e,r,o,i),e.unwrap=()=>e._zod.def.innerType});function Oe(e){return new vd({type:"optional",innerType:e})}const ik=T("ZodExactOptional",(e,n)=>{E0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>sd(e,r,o,i),e.unwrap=()=>e._zod.def.innerType});function ok(e){return new ik({type:"optional",innerType:e})}const ak=T("ZodNullable",(e,n)=>{N0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Q$(e,r,o,i),e.unwrap=()=>e._zod.def.innerType});function ac(e){return new ak({type:"nullable",innerType:e})}const sk=T("ZodDefault",(e,n)=>{U0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>tw(e,r,o,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function uk(e,n){return new sk({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():Df(n)}})}const lk=T("ZodPrefault",(e,n)=>{A0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>nw(e,r,o,i),e.unwrap=()=>e._zod.def.innerType});function ck(e,n){return new lk({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():Df(n)}})}const _d=T("ZodNonOptional",(e,n)=>{j0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>ew(e,r,o,i),e.unwrap=()=>e._zod.def.innerType});function fk(e,n){return new _d({type:"nonoptional",innerType:e,...q(n)})}const dk=T("ZodCatch",(e,n)=>{Z0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>rw(e,r,o,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function hk(e,n){return new dk({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const pk=T("ZodPipe",(e,n)=>{C0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>iw(e,r,o,i),e.in=n.in,e.out=n.out});function xa(e,n){return new pk({type:"pipe",in:e,out:n})}const mk=T("ZodReadonly",(e,n)=>{D0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>ow(e,r,o,i),e.unwrap=()=>e._zod.def.innerType});function gk(e){return new mk({type:"readonly",innerType:e})}const yd=T("ZodCustom",(e,n)=>{R0.init(e,n),we.init(e,n),e._zod.processJSONSchema=(r,o,i)=>V$(e,r)});function vk(e,n){return N$(yd,e??(()=>!0),n)}function _k(e,n={}){return U$(yd,e,n)}function yk(e){return A$(e)}function bd(e,n){return xa(gd(e),n)}const rn="io.modelcontextprotocol/related-task",oo="2.0",Ee=vk(e=>e!==null&&(typeof e=="object"||typeof e=="function")),$d=ve([P(),fe().int()]),wd=P();Je({ttl:ve([fe(),dd()]).optional(),pollInterval:fe().optional()});const bk=L({ttl:fe().optional()}),$k=L({taskId:P()}),os=Je({progressToken:$d.optional(),[rn]:$k.optional()}),Ye=L({_meta:os.optional()}),Sr=Ye.extend({task:bk.optional()}),wk=e=>Sr.safeParse(e).success,Ne=L({method:P(),params:Ye.loose().optional()}),ft=L({_meta:os.optional()}),dt=L({method:P(),params:ft.loose().optional()}),Ue=Je({_meta:os.optional()}),Ir=ve([P(),fe().int()]),kd=L({jsonrpc:V(oo),id:Ir,...Ne.shape}).strict(),sc=e=>kd.safeParse(e).success,xd=L({jsonrpc:V(oo),...dt.shape}).strict(),kk=e=>xd.safeParse(e).success,as=L({jsonrpc:V(oo),id:Ir,result:Ue}).strict(),ci=e=>as.safeParse(e).success;var ce;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ce||(ce={}));const ss=L({jsonrpc:V(oo),id:Ir.optional(),error:L({code:fe().int(),message:P(),data:Se().optional()})}).strict(),xk=e=>ss.safeParse(e).success,Sk=ve([kd,xd,as,ss]);ve([as,ss]);const us=Ue.strict(),Ik=ft.extend({requestId:Ir.optional(),reason:P().optional()}),ls=dt.extend({method:V("notifications/cancelled"),params:Ik}),zk=L({src:P(),mimeType:P().optional(),sizes:ie(P()).optional(),theme:Ke(["light","dark"]).optional()}),zr=L({icons:ie(zk).optional()}),Tn=L({name:P(),title:P().optional()}),ao=Tn.extend({...Tn.shape,...zr.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),Ok=is(L({applyDefaults:Te().optional()}),Ie(P(),Se())),Pk=bd(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,is(L({form:Ok.optional(),url:Ee.optional()}),Ie(P(),Se()).optional())),Tk=Je({list:Ee.optional(),cancel:Ee.optional(),requests:Je({sampling:Je({createMessage:Ee.optional()}).optional(),elicitation:Je({create:Ee.optional()}).optional()}).optional()}),Ek=Je({list:Ee.optional(),cancel:Ee.optional(),requests:Je({tools:Je({call:Ee.optional()}).optional()}).optional()}),Nk=L({experimental:Ie(P(),Ee).optional(),sampling:L({context:Ee.optional(),tools:Ee.optional()}).optional(),elicitation:Pk.optional(),roots:L({listChanged:Te().optional()}).optional(),tasks:Tk.optional()}),Uk=Ye.extend({protocolVersion:P(),capabilities:Nk,clientInfo:ao}),Ak=Ne.extend({method:V("initialize"),params:Uk}),jk=L({experimental:Ie(P(),Ee).optional(),logging:Ee.optional(),completions:Ee.optional(),prompts:L({listChanged:Te().optional()}).optional(),resources:L({subscribe:Te().optional(),listChanged:Te().optional()}).optional(),tools:L({listChanged:Te().optional()}).optional(),tasks:Ek.optional()}),Zk=Ue.extend({protocolVersion:P(),capabilities:jk,serverInfo:ao,instructions:P().optional()}),Ck=dt.extend({method:V("notifications/initialized"),params:ft.optional()}),so=Ne.extend({method:V("ping"),params:Ye.optional()}),Dk=L({progress:fe(),total:Oe(fe()),message:Oe(P())}),Rk=L({...ft.shape,...Dk.shape,progressToken:$d}),cs=dt.extend({method:V("notifications/progress"),params:Rk}),Mk=Ye.extend({cursor:wd.optional()}),Or=Ne.extend({params:Mk.optional()}),Pr=Ue.extend({nextCursor:wd.optional()}),Lk=Ke(["working","input_required","completed","failed","cancelled"]),Tr=L({taskId:P(),status:Lk,ttl:ve([fe(),dd()]),createdAt:P(),lastUpdatedAt:P(),pollInterval:Oe(fe()),statusMessage:Oe(P())}),fs=Ue.extend({task:Tr}),Fk=ft.merge(Tr),Ei=dt.extend({method:V("notifications/tasks/status"),params:Fk}),ds=Ne.extend({method:V("tasks/get"),params:Ye.extend({taskId:P()})}),hs=Ue.merge(Tr),ps=Ne.extend({method:V("tasks/result"),params:Ye.extend({taskId:P()})});Ue.loose();const ms=Or.extend({method:V("tasks/list")}),gs=Pr.extend({tasks:ie(Tr)}),vs=Ne.extend({method:V("tasks/cancel"),params:Ye.extend({taskId:P()})}),qk=Ue.merge(Tr),Sd=L({uri:P(),mimeType:Oe(P()),_meta:Ie(P(),Se()).optional()}),Id=Sd.extend({text:P()}),_s=P().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),zd=Sd.extend({blob:_s}),Er=Ke(["user","assistant"]),Fn=L({audience:ie(Er).optional(),priority:fe().min(0).max(1).optional(),lastModified:ld({offset:!0}).optional()}),Od=L({...Tn.shape,...zr.shape,uri:P(),description:Oe(P()),mimeType:Oe(P()),annotations:Fn.optional(),_meta:Oe(Je({}))}),Jk=L({...Tn.shape,...zr.shape,uriTemplate:P(),description:Oe(P()),mimeType:Oe(P()),annotations:Fn.optional(),_meta:Oe(Je({}))}),Hk=Or.extend({method:V("resources/list")}),Vk=Pr.extend({resources:ie(Od)}),Wk=Or.extend({method:V("resources/templates/list")}),Gk=Pr.extend({resourceTemplates:ie(Jk)}),ys=Ye.extend({uri:P()}),Bk=ys,Xk=Ne.extend({method:V("resources/read"),params:Bk}),Kk=Ue.extend({contents:ie(ve([Id,zd]))}),Yk=dt.extend({method:V("notifications/resources/list_changed"),params:ft.optional()}),Qk=ys,ex=Ne.extend({method:V("resources/subscribe"),params:Qk}),tx=ys,nx=Ne.extend({method:V("resources/unsubscribe"),params:tx}),rx=ft.extend({uri:P()}),ix=dt.extend({method:V("notifications/resources/updated"),params:rx}),ox=L({name:P(),description:Oe(P()),required:Oe(Te())}),ax=L({...Tn.shape,...zr.shape,description:Oe(P()),arguments:Oe(ie(ox)),_meta:Oe(Je({}))}),sx=Or.extend({method:V("prompts/list")}),ux=Pr.extend({prompts:ie(ax)}),lx=Ye.extend({name:P(),arguments:Ie(P(),P()).optional()}),cx=Ne.extend({method:V("prompts/get"),params:lx}),bs=L({type:V("text"),text:P(),annotations:Fn.optional(),_meta:Ie(P(),Se()).optional()}),$s=L({type:V("image"),data:_s,mimeType:P(),annotations:Fn.optional(),_meta:Ie(P(),Se()).optional()}),ws=L({type:V("audio"),data:_s,mimeType:P(),annotations:Fn.optional(),_meta:Ie(P(),Se()).optional()}),fx=L({type:V("tool_use"),name:P(),id:P(),input:Ie(P(),Se()),_meta:Ie(P(),Se()).optional()}),Pd=L({type:V("resource"),resource:ve([Id,zd]),annotations:Fn.optional(),_meta:Ie(P(),Se()).optional()}),Td=Od.extend({type:V("resource_link")}),Nr=ve([bs,$s,ws,Td,Pd]),dx=L({role:Er,content:Nr}),hx=Ue.extend({description:P().optional(),messages:ie(dx)}),px=dt.extend({method:V("notifications/prompts/list_changed"),params:ft.optional()}),mx=L({title:P().optional(),readOnlyHint:Te().optional(),destructiveHint:Te().optional(),idempotentHint:Te().optional(),openWorldHint:Te().optional()}),gx=L({taskSupport:Ke(["required","optional","forbidden"]).optional()}),ks=L({...Tn.shape,...zr.shape,description:P().optional(),inputSchema:L({type:V("object"),properties:Ie(P(),Ee).optional(),required:ie(P()).optional()}).catchall(Se()),outputSchema:L({type:V("object"),properties:Ie(P(),Ee).optional(),required:ie(P()).optional()}).catchall(Se()).optional(),annotations:mx.optional(),execution:gx.optional(),_meta:Ie(P(),Se()).optional()}),Ed=Or.extend({method:V("tools/list")}),vx=Pr.extend({tools:ie(ks)}),uo=Ue.extend({content:ie(Nr).default([]),structuredContent:Ie(P(),Se()).optional(),isError:Te().optional()});uo.or(Ue.extend({toolResult:Se()}));const _x=Sr.extend({name:P(),arguments:Ie(P(),Se()).optional()}),Nd=Ne.extend({method:V("tools/call"),params:_x}),yx=dt.extend({method:V("notifications/tools/list_changed"),params:ft.optional()});L({autoRefresh:Te().default(!0),debounceMs:fe().int().nonnegative().default(300)});const Ud=Ke(["debug","info","notice","warning","error","critical","alert","emergency"]),bx=Ye.extend({level:Ud}),$x=Ne.extend({method:V("logging/setLevel"),params:bx}),wx=ft.extend({level:Ud,logger:P().optional(),data:Se()}),kx=dt.extend({method:V("notifications/message"),params:wx}),xx=L({name:P().optional()}),Sx=L({hints:ie(xx).optional(),costPriority:fe().min(0).max(1).optional(),speedPriority:fe().min(0).max(1).optional(),intelligencePriority:fe().min(0).max(1).optional()}),Ix=L({mode:Ke(["auto","required","none"]).optional()}),zx=L({type:V("tool_result"),toolUseId:P().describe("The unique identifier for the corresponding tool call."),content:ie(Nr).default([]),structuredContent:L({}).loose().optional(),isError:Te().optional(),_meta:Ie(P(),Se()).optional()}),Ox=md("type",[bs,$s,ws]),Ni=md("type",[bs,$s,ws,fx,zx]),Px=L({role:Er,content:ve([Ni,ie(Ni)]),_meta:Ie(P(),Se()).optional()}),Tx=Sr.extend({messages:ie(Px),modelPreferences:Sx.optional(),systemPrompt:P().optional(),includeContext:Ke(["none","thisServer","allServers"]).optional(),temperature:fe().optional(),maxTokens:fe().int(),stopSequences:ie(P()).optional(),metadata:Ee.optional(),tools:ie(ks).optional(),toolChoice:Ix.optional()}),Ex=Ne.extend({method:V("sampling/createMessage"),params:Tx}),Nx=Ue.extend({model:P(),stopReason:Oe(Ke(["endTurn","stopSequence","maxTokens"]).or(P())),role:Er,content:Ox}),Ux=Ue.extend({model:P(),stopReason:Oe(Ke(["endTurn","stopSequence","maxTokens","toolUse"]).or(P())),role:Er,content:ve([Ni,ie(Ni)])}),Ax=L({type:V("boolean"),title:P().optional(),description:P().optional(),default:Te().optional()}),jx=L({type:V("string"),title:P().optional(),description:P().optional(),minLength:fe().optional(),maxLength:fe().optional(),format:Ke(["email","uri","date","date-time"]).optional(),default:P().optional()}),Zx=L({type:Ke(["number","integer"]),title:P().optional(),description:P().optional(),minimum:fe().optional(),maximum:fe().optional(),default:fe().optional()}),Cx=L({type:V("string"),title:P().optional(),description:P().optional(),enum:ie(P()),default:P().optional()}),Dx=L({type:V("string"),title:P().optional(),description:P().optional(),oneOf:ie(L({const:P(),title:P()})),default:P().optional()}),Rx=L({type:V("string"),title:P().optional(),description:P().optional(),enum:ie(P()),enumNames:ie(P()).optional(),default:P().optional()}),Mx=ve([Cx,Dx]),Lx=L({type:V("array"),title:P().optional(),description:P().optional(),minItems:fe().optional(),maxItems:fe().optional(),items:L({type:V("string"),enum:ie(P())}),default:ie(P()).optional()}),Fx=L({type:V("array"),title:P().optional(),description:P().optional(),minItems:fe().optional(),maxItems:fe().optional(),items:L({anyOf:ie(L({const:P(),title:P()}))}),default:ie(P()).optional()}),qx=ve([Lx,Fx]),Jx=ve([Rx,Mx,qx]),Hx=ve([Jx,Ax,jx,Zx]),Vx=Sr.extend({mode:V("form").optional(),message:P(),requestedSchema:L({type:V("object"),properties:Ie(P(),Hx),required:ie(P()).optional()})}),Wx=Sr.extend({mode:V("url"),message:P(),elicitationId:P(),url:P().url()}),Gx=ve([Vx,Wx]),Bx=Ne.extend({method:V("elicitation/create"),params:Gx}),Xx=ft.extend({elicitationId:P()}),Kx=dt.extend({method:V("notifications/elicitation/complete"),params:Xx}),Yx=Ue.extend({action:Ke(["accept","decline","cancel"]),content:bd(e=>e===null?void 0:e,Ie(P(),ve([P(),fe(),Te(),ie(P())])).optional())}),Qx=L({type:V("ref/resource"),uri:P()}),e1=L({type:V("ref/prompt"),name:P()}),t1=Ye.extend({ref:ve([e1,Qx]),argument:L({name:P(),value:P()}),context:L({arguments:Ie(P(),P()).optional()}).optional()}),n1=Ne.extend({method:V("completion/complete"),params:t1}),r1=Ue.extend({completion:Je({values:ie(P()).max(100),total:Oe(fe().int()),hasMore:Oe(Te())})}),i1=L({uri:P().startsWith("file://"),name:P().optional(),_meta:Ie(P(),Se()).optional()}),o1=Ne.extend({method:V("roots/list"),params:Ye.optional()}),a1=Ue.extend({roots:ie(i1)}),s1=dt.extend({method:V("notifications/roots/list_changed"),params:ft.optional()});ve([so,Ak,n1,$x,cx,sx,Hk,Wk,Xk,ex,nx,Nd,Ed,ds,ps,ms,vs]);ve([ls,cs,Ck,s1,Ei]);ve([us,Nx,Ux,Yx,a1,hs,gs,fs]);ve([so,Ex,Bx,o1,ds,ps,ms,vs]);ve([ls,cs,kx,ix,Yk,yx,px,Ei,Kx]);ve([us,Zk,r1,hx,ux,Vk,Gk,Kk,uo,vx,hs,gs,fs]);class oe extends Error{constructor(n,r,o){super(`MCP error ${n}: ${r}`),this.code=n,this.data=o,this.name="McpError"}static fromError(n,r,o){if(n===ce.UrlElicitationRequired&&o){const i=o;if(i.elicitations)return new u1(i.elicitations,r)}return new oe(n,r,o)}}class u1 extends oe{constructor(n,r=`URL elicitation${n.length>1?"s":""} required`){super(ce.UrlElicitationRequired,r,{elicitations:n})}get elicitations(){var n;return((n=this.data)==null?void 0:n.elicitations)??[]}}function tn(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function uc(e){const n=aw(e),r=n==null?void 0:n.method;if(!r)throw new Error("Schema is missing a method literal");const o=sw(r);if(typeof o!="string")throw new Error("Schema method literal must be a string");return o}function lc(e,n){const r=ud(e,n);if(!r.success)throw r.error;return r.data}const l1=6e4;class c1{constructor(n){this._options=n,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(ls,r=>{this._oncancel(r)}),this.setNotificationHandler(cs,r=>{this._onprogress(r)}),this.setRequestHandler(so,r=>({})),this._taskStore=n==null?void 0:n.taskStore,this._taskMessageQueue=n==null?void 0:n.taskMessageQueue,this._taskStore&&(this.setRequestHandler(ds,async(r,o)=>{const i=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!i)throw new oe(ce.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(ps,async(r,o)=>{const i=async()=>{var u;const a=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(a,o.sessionId);){if(l.type==="response"||l.type==="error"){const c=l.message,d=c.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(c);else{const h=c,p=new oe(h.error.code,h.error.message,h.error.data);f(p)}else{const h=l.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${d}`))}continue}await((u=this._transport)==null?void 0:u.send(l.message,{relatedRequestId:o.requestId}))}}const s=await this._taskStore.getTask(a,o.sessionId);if(!s)throw new oe(ce.InvalidParams,`Task not found: ${a}`);if(!tn(s.status))return await this._waitForTaskUpdate(a,o.signal),await i();if(tn(s.status)){const l=await this._taskStore.getTaskResult(a,o.sessionId);return this._clearTaskQueue(a),{...l,_meta:{...l._meta,[rn]:{taskId:a}}}}return await i()};return await i()}),this.setRequestHandler(ms,async(r,o)=>{var i;try{const{tasks:a,nextCursor:s}=await this._taskStore.listTasks((i=r.params)==null?void 0:i.cursor,o.sessionId);return{tasks:a,nextCursor:s,_meta:{}}}catch(a){throw new oe(ce.InvalidParams,`Failed to list tasks: ${a instanceof Error?a.message:String(a)}`)}}),this.setRequestHandler(vs,async(r,o)=>{try{const i=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!i)throw new oe(ce.InvalidParams,`Task not found: ${r.params.taskId}`);if(tn(i.status))throw new oe(ce.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",o.sessionId),this._clearTaskQueue(r.params.taskId);const a=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!a)throw new oe(ce.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...a}}catch(i){throw i instanceof oe?i:new oe(ce.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(n){if(!n.params.requestId)return;const r=this._requestHandlerAbortControllers.get(n.params.requestId);r==null||r.abort(n.params.reason)}_setupTimeout(n,r,o,i,a=!1){this._timeoutInfo.set(n,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:o,resetTimeoutOnProgress:a,onTimeout:i})}_resetTimeout(n){const r=this._timeoutInfo.get(n);if(!r)return!1;const o=Date.now()-r.startTime;if(r.maxTotalTimeout&&o>=r.maxTotalTimeout)throw this._timeoutInfo.delete(n),oe.fromError(ce.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:o});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(n){const r=this._timeoutInfo.get(n);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(n))}async connect(n){var a,s,u;this._transport=n;const r=(a=this.transport)==null?void 0:a.onclose;this._transport.onclose=()=>{r==null||r(),this._onclose()};const o=(s=this.transport)==null?void 0:s.onerror;this._transport.onerror=l=>{o==null||o(l),this._onerror(l)};const i=(u=this._transport)==null?void 0:u.onmessage;this._transport.onmessage=(l,c)=>{i==null||i(l,c),ci(l)||xk(l)?this._onresponse(l):sc(l)?this._onrequest(l,c):kk(l)?this._onnotification(l):this._onerror(new Error(`Unknown message type: ${JSON.stringify(l)}`))},await this._transport.start()}_onclose(){var o;const n=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();const r=oe.fromError(ce.ConnectionClosed,"Connection closed");this._transport=void 0,(o=this.onclose)==null||o.call(this);for(const i of n.values())i(r)}_onerror(n){var r;(r=this.onerror)==null||r.call(this,n)}_onnotification(n){const r=this._notificationHandlers.get(n.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(n)).catch(o=>this._onerror(new Error(`Uncaught error in notification handler: ${o}`)))}_onrequest(n,r){var d,f,h,p;const o=this._requestHandlers.get(n.method)??this.fallbackRequestHandler,i=this._transport,a=(h=(f=(d=n.params)==null?void 0:d._meta)==null?void 0:f[rn])==null?void 0:h.taskId;if(o===void 0){const m={jsonrpc:"2.0",id:n.id,error:{code:ce.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:m,timestamp:Date.now()},i==null?void 0:i.sessionId).catch(v=>this._onerror(new Error(`Failed to enqueue error response: ${v}`))):i==null||i.send(m).catch(v=>this._onerror(new Error(`Failed to send an error response: ${v}`)));return}const s=new AbortController;this._requestHandlerAbortControllers.set(n.id,s);const u=wk(n.params)?n.params.task:void 0,l=this._taskStore?this.requestTaskStore(n,i==null?void 0:i.sessionId):void 0,c={signal:s.signal,sessionId:i==null?void 0:i.sessionId,_meta:(p=n.params)==null?void 0:p._meta,sendNotification:async m=>{const v={relatedRequestId:n.id};a&&(v.relatedTask={taskId:a}),await this.notification(m,v)},sendRequest:async(m,v,y)=>{var z;const g={...y,relatedRequestId:n.id};a&&!g.relatedTask&&(g.relatedTask={taskId:a});const w=((z=g.relatedTask)==null?void 0:z.taskId)??a;return w&&l&&await l.updateTaskStatus(w,"input_required"),await this.request(m,v,g)},authInfo:r==null?void 0:r.authInfo,requestId:n.id,requestInfo:r==null?void 0:r.requestInfo,taskId:a,taskStore:l,taskRequestedTtl:u==null?void 0:u.ttl,closeSSEStream:r==null?void 0:r.closeSSEStream,closeStandaloneSSEStream:r==null?void 0:r.closeStandaloneSSEStream};Promise.resolve().then(()=>{u&&this.assertTaskHandlerCapability(n.method)}).then(()=>o(n,c)).then(async m=>{if(s.signal.aborted)return;const v={result:m,jsonrpc:"2.0",id:n.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:v,timestamp:Date.now()},i==null?void 0:i.sessionId):await(i==null?void 0:i.send(v))},async m=>{if(s.signal.aborted)return;const v={jsonrpc:"2.0",id:n.id,error:{code:Number.isSafeInteger(m.code)?m.code:ce.InternalError,message:m.message??"Internal error",...m.data!==void 0&&{data:m.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:v,timestamp:Date.now()},i==null?void 0:i.sessionId):await(i==null?void 0:i.send(v))}).catch(m=>this._onerror(new Error(`Failed to send response: ${m}`))).finally(()=>{this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(n){const{progressToken:r,...o}=n.params,i=Number(r),a=this._progressHandlers.get(i);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(n)}`));return}const s=this._responseHandlers.get(i),u=this._timeoutInfo.get(i);if(u&&s&&u.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(l){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),s(l);return}a(o)}_onresponse(n){const r=Number(n.id),o=this._requestResolvers.get(r);if(o){if(this._requestResolvers.delete(r),ci(n))o(n);else{const s=new oe(n.error.code,n.error.message,n.error.data);o(s)}return}const i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(n)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let a=!1;if(ci(n)&&n.result&&typeof n.result=="object"){const s=n.result;if(s.task&&typeof s.task=="object"){const u=s.task;typeof u.taskId=="string"&&(a=!0,this._taskProgressTokens.set(u.taskId,r))}}if(a||this._progressHandlers.delete(r),ci(n))i(n);else{const s=oe.fromError(n.error.code,n.error.message,n.error.data);i(s)}}get transport(){return this._transport}async close(){var n;await((n=this._transport)==null?void 0:n.close())}async*requestStream(n,r,o){var s,u;const{task:i}=o??{};if(!i){try{yield{type:"result",result:await this.request(n,r,o)}}catch(l){yield{type:"error",error:l instanceof oe?l:new oe(ce.InternalError,String(l))}}return}let a;try{const l=await this.request(n,fs,o);if(l.task)a=l.task.taskId,yield{type:"taskCreated",task:l.task};else throw new oe(ce.InternalError,"Task creation did not return a task");for(;;){const c=await this.getTask({taskId:a},o);if(yield{type:"taskStatus",task:c},tn(c.status)){c.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},r,o)}:c.status==="failed"?yield{type:"error",error:new oe(ce.InternalError,`Task ${a} failed`)}:c.status==="cancelled"&&(yield{type:"error",error:new oe(ce.InternalError,`Task ${a} was cancelled`)});return}if(c.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},r,o)};return}const d=c.pollInterval??((s=this._options)==null?void 0:s.defaultTaskPollInterval)??1e3;await new Promise(f=>setTimeout(f,d)),(u=o==null?void 0:o.signal)==null||u.throwIfAborted()}}catch(l){yield{type:"error",error:l instanceof oe?l:new oe(ce.InternalError,String(l))}}}request(n,r,o){const{relatedRequestId:i,resumptionToken:a,onresumptiontoken:s,task:u,relatedTask:l}=o??{};return new Promise((c,d)=>{var w,z,$,b,k;const f=x=>{d(x)};if(!this._transport){f(new Error("Not connected"));return}if(((w=this._options)==null?void 0:w.enforceStrictCapabilities)===!0)try{this.assertCapabilityForMethod(n.method),u&&this.assertTaskCapability(n.method)}catch(x){f(x);return}(z=o==null?void 0:o.signal)==null||z.throwIfAborted();const h=this._requestMessageId++,p={...n,jsonrpc:"2.0",id:h};o!=null&&o.onprogress&&(this._progressHandlers.set(h,o.onprogress),p.params={...n.params,_meta:{...(($=n.params)==null?void 0:$._meta)||{},progressToken:h}}),u&&(p.params={...p.params,task:u}),l&&(p.params={...p.params,_meta:{...((b=p.params)==null?void 0:b._meta)||{},[rn]:l}});const m=x=>{var Z;this._responseHandlers.delete(h),this._progressHandlers.delete(h),this._cleanupTimeout(h),(Z=this._transport)==null||Z.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:h,reason:String(x)}},{relatedRequestId:i,resumptionToken:a,onresumptiontoken:s}).catch(A=>this._onerror(new Error(`Failed to send cancellation: ${A}`)));const O=x instanceof oe?x:new oe(ce.RequestTimeout,String(x));d(O)};this._responseHandlers.set(h,x=>{var O;if(!((O=o==null?void 0:o.signal)!=null&&O.aborted)){if(x instanceof Error)return d(x);try{const Z=ud(r,x.result);Z.success?c(Z.data):d(Z.error)}catch(Z){d(Z)}}}),(k=o==null?void 0:o.signal)==null||k.addEventListener("abort",()=>{var x;m((x=o==null?void 0:o.signal)==null?void 0:x.reason)});const v=(o==null?void 0:o.timeout)??l1,y=()=>m(oe.fromError(ce.RequestTimeout,"Request timed out",{timeout:v}));this._setupTimeout(h,v,o==null?void 0:o.maxTotalTimeout,y,(o==null?void 0:o.resetTimeoutOnProgress)??!1);const g=l==null?void 0:l.taskId;if(g){const x=O=>{const Z=this._responseHandlers.get(h);Z?Z(O):this._onerror(new Error(`Response handler missing for side-channeled request ${h}`))};this._requestResolvers.set(h,x),this._enqueueTaskMessage(g,{type:"request",message:p,timestamp:Date.now()}).catch(O=>{this._cleanupTimeout(h),d(O)})}else this._transport.send(p,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:s}).catch(x=>{this._cleanupTimeout(h),d(x)})})}async getTask(n,r){return this.request({method:"tasks/get",params:n},hs,r)}async getTaskResult(n,r,o){return this.request({method:"tasks/result",params:n},r,o)}async listTasks(n,r){return this.request({method:"tasks/list",params:n},gs,r)}async cancelTask(n,r){return this.request({method:"tasks/cancel",params:n},qk,r)}async notification(n,r){var u,l,c,d;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(n.method);const o=(u=r==null?void 0:r.relatedTask)==null?void 0:u.taskId;if(o){const f={...n,jsonrpc:"2.0",params:{...n.params,_meta:{...((l=n.params)==null?void 0:l._meta)||{},[rn]:r.relatedTask}}};await this._enqueueTaskMessage(o,{type:"notification",message:f,timestamp:Date.now()});return}if((((c=this._options)==null?void 0:c.debouncedNotificationMethods)??[]).includes(n.method)&&!n.params&&!(r!=null&&r.relatedRequestId)&&!(r!=null&&r.relatedTask)){if(this._pendingDebouncedNotifications.has(n.method))return;this._pendingDebouncedNotifications.add(n.method),Promise.resolve().then(()=>{var h,p;if(this._pendingDebouncedNotifications.delete(n.method),!this._transport)return;let f={...n,jsonrpc:"2.0"};r!=null&&r.relatedTask&&(f={...f,params:{...f.params,_meta:{...((h=f.params)==null?void 0:h._meta)||{},[rn]:r.relatedTask}}}),(p=this._transport)==null||p.send(f,r).catch(m=>this._onerror(m))});return}let s={...n,jsonrpc:"2.0"};r!=null&&r.relatedTask&&(s={...s,params:{...s.params,_meta:{...((d=s.params)==null?void 0:d._meta)||{},[rn]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(n,r){const o=uc(n);this.assertRequestHandlerCapability(o),this._requestHandlers.set(o,(i,a)=>{const s=lc(n,i);return Promise.resolve(r(s,a))})}removeRequestHandler(n){this._requestHandlers.delete(n)}assertCanSetRequestHandler(n){if(this._requestHandlers.has(n))throw new Error(`A request handler for ${n} already exists, which would be overridden`)}setNotificationHandler(n,r){const o=uc(n);this._notificationHandlers.set(o,i=>{const a=lc(n,i);return Promise.resolve(r(a))})}removeNotificationHandler(n){this._notificationHandlers.delete(n)}_cleanupTaskProgressHandler(n){const r=this._taskProgressTokens.get(n);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(n))}async _enqueueTaskMessage(n,r,o){var a;if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const i=(a=this._options)==null?void 0:a.maxTaskQueueSize;await this._taskMessageQueue.enqueue(n,r,o,i)}async _clearTaskQueue(n,r){if(this._taskMessageQueue){const o=await this._taskMessageQueue.dequeueAll(n,r);for(const i of o)if(i.type==="request"&&sc(i.message)){const a=i.message.id,s=this._requestResolvers.get(a);s?(s(new oe(ce.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${n} cleanup`))}}}async _waitForTaskUpdate(n,r){var i,a;let o=((i=this._options)==null?void 0:i.defaultTaskPollInterval)??1e3;try{const s=await((a=this._taskStore)==null?void 0:a.getTask(n));s!=null&&s.pollInterval&&(o=s.pollInterval)}catch{}return new Promise((s,u)=>{if(r.aborted){u(new oe(ce.InvalidRequest,"Request cancelled"));return}const l=setTimeout(s,o);r.addEventListener("abort",()=>{clearTimeout(l),u(new oe(ce.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(n,r){const o=this._taskStore;if(!o)throw new Error("No task store configured");return{createTask:async i=>{if(!n)throw new Error("No request provided");return await o.createTask(i,n.id,{method:n.method,params:n.params},r)},getTask:async i=>{const a=await o.getTask(i,r);if(!a)throw new oe(ce.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(i,a,s)=>{await o.storeTaskResult(i,a,s,r);const u=await o.getTask(i,r);if(u){const l=Ei.parse({method:"notifications/tasks/status",params:u});await this.notification(l),tn(u.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>o.getTaskResult(i,r),updateTaskStatus:async(i,a,s)=>{const u=await o.getTask(i,r);if(!u)throw new oe(ce.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(tn(u.status))throw new oe(ce.InvalidParams,`Cannot update task "${i}" from terminal status "${u.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await o.updateTaskStatus(i,a,s,r);const l=await o.getTask(i,r);if(l){const c=Ei.parse({method:"notifications/tasks/status",params:l});await this.notification(c),tn(l.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>o.listTasks(i,r)}}}var f1=Object.defineProperty,Mt=(e,n)=>{for(var r in n)f1(e,r,{get:n[r],enumerable:!0,configurable:!0,set:o=>n[r]=()=>o})};class d1{constructor(n=window.parent,r){je(this,"eventTarget");je(this,"eventSource");je(this,"messageListener");je(this,"onclose");je(this,"onerror");je(this,"onmessage");je(this,"sessionId");je(this,"setProtocolVersion");this.eventTarget=n,this.eventSource=r,this.messageListener=o=>{var a,s,u;if(r&&o.source!==this.eventSource){console.debug("Ignoring message from unknown source",o);return}let i=Sk.safeParse(o.data);i.success?(console.debug("Parsed message",i.data),(a=this.onmessage)==null||a.call(this,i.data)):((s=o.data)==null?void 0:s.jsonrpc)!=="2.0"?console.debug("Ignoring non-JSON-RPC message",i.error.message,o):(console.error("Failed to parse message",i.error.message,o),(u=this.onerror)==null||u.call(this,Error("Invalid JSON-RPC message received: "+i.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(n,r){console.debug("Sending message",n),this.eventTarget.postMessage(n,"*")}async close(){var n;window.removeEventListener("message",this.messageListener),(n=this.onclose)==null||n.call(this)}}var h1="2026-01-26",_={};Mt(_,{xor:()=>Xv,xid:()=>yv,void:()=>Jv,uuidv7:()=>fv,uuidv6:()=>cv,uuidv4:()=>lv,uuid:()=>uv,util:()=>re,url:()=>dv,uppercase:()=>_o,unknown:()=>hn,union:()=>Go,undefined:()=>Fv,ulid:()=>_v,uint64:()=>Mv,uint32:()=>Cv,tuple:()=>Hu,trim:()=>xo,treeifyError:()=>Gd,transform:()=>Xo,toUpperCase:()=>Io,toLowerCase:()=>So,toJSONSchema:()=>Mg,templateLiteral:()=>l_,symbol:()=>Lv,superRefine:()=>_l,success:()=>a_,stringbool:()=>g_,stringFormat:()=>Tv,string:()=>Ri,strictObject:()=>Gv,startsWith:()=>bo,slugify:()=>zo,size:()=>Fr,setErrorMap:()=>Az,set:()=>t_,safeParseAsync:()=>Kg,safeParse:()=>Xg,safeEncodeAsync:()=>iv,safeEncode:()=>nv,safeDecodeAsync:()=>ov,safeDecode:()=>rv,registry:()=>Bs,regexes:()=>_n,regex:()=>go,refine:()=>vl,record:()=>Vu,readonly:()=>fl,property:()=>bu,promise:()=>c_,prettifyError:()=>Xd,preprocess:()=>__,prefault:()=>il,positive:()=>gu,pipe:()=>gr,partialRecord:()=>Yv,parseAsync:()=>Bg,parse:()=>Gg,overwrite:()=>Ft,optional:()=>pr,object:()=>Wv,number:()=>Pu,nullish:()=>o_,nullable:()=>mr,null:()=>Au,normalize:()=>ko,nonpositive:()=>_u,nonoptional:()=>ol,nonnegative:()=>yu,never:()=>Vo,negative:()=>vu,nativeEnum:()=>n_,nanoid:()=>mv,nan:()=>s_,multipleOf:()=>Un,minSize:()=>Kt,minLength:()=>dn,mime:()=>wo,meta:()=>p_,maxSize:()=>qn,maxLength:()=>qr,map:()=>e_,mac:()=>wv,lte:()=>st,lt:()=>Bt,lowercase:()=>vo,looseRecord:()=>Qv,looseObject:()=>Bv,locales:()=>Gs,literal:()=>r_,length:()=>Jr,lazy:()=>pl,ksuid:()=>bv,keyof:()=>Vv,jwt:()=>Pv,json:()=>v_,iso:()=>ku,ipv6:()=>kv,ipv4:()=>$v,intersection:()=>qu,int64:()=>Rv,int32:()=>Zv,int:()=>Mi,instanceof:()=>m_,includes:()=>yo,httpUrl:()=>hv,hostname:()=>Ev,hex:()=>Nv,hash:()=>Uv,guid:()=>sv,gte:()=>qe,gt:()=>Xt,globalRegistry:()=>at,getErrorMap:()=>jz,function:()=>Li,fromJSONSchema:()=>Rz,formatError:()=>Os,float64:()=>jv,float32:()=>Av,flattenError:()=>zs,file:()=>i_,exactOptional:()=>Qu,enum:()=>Bo,endsWith:()=>$o,encodeAsync:()=>ev,encode:()=>Yg,emoji:()=>pv,email:()=>av,e164:()=>Ov,discriminatedUnion:()=>Kv,describe:()=>h_,decodeAsync:()=>tv,decode:()=>Qg,date:()=>Hv,custom:()=>d_,cuid2:()=>vv,cuid:()=>gv,core:()=>Ad,config:()=>De,coerce:()=>b_,codec:()=>u_,clone:()=>ht,cidrv6:()=>Sv,cidrv4:()=>xv,check:()=>f_,catch:()=>ul,boolean:()=>Tu,bigint:()=>Dv,base64url:()=>zv,base64:()=>Iv,array:()=>Kr,any:()=>qv,_function:()=>Li,_default:()=>nl,_ZodString:()=>Oo,ZodXor:()=>Mu,ZodXID:()=>jo,ZodVoid:()=>Du,ZodUnknown:()=>Zu,ZodUnion:()=>Qr,ZodUndefined:()=>Nu,ZodUUID:()=>xt,ZodURL:()=>Wr,ZodULID:()=>Ao,ZodType:()=>ee,ZodTuple:()=>Ju,ZodTransform:()=>Ku,ZodTemplateLiteral:()=>dl,ZodSymbol:()=>Eu,ZodSuccess:()=>al,ZodStringFormat:()=>me,ZodString:()=>Vr,ZodSet:()=>Gu,ZodRecord:()=>ei,ZodRealError:()=>et,ZodReadonly:()=>cl,ZodPromise:()=>ml,ZodPrefault:()=>rl,ZodPipe:()=>Qo,ZodOptional:()=>Ko,ZodObject:()=>Yr,ZodNumberFormat:()=>yn,ZodNumber:()=>Gr,ZodNullable:()=>el,ZodNull:()=>Uu,ZodNonOptional:()=>Yo,ZodNever:()=>Cu,ZodNanoID:()=>Eo,ZodNaN:()=>ll,ZodMap:()=>Wu,ZodMAC:()=>Ou,ZodLiteral:()=>Bu,ZodLazy:()=>hl,ZodKSUID:()=>Zo,ZodJWT:()=>Jo,ZodIssueCode:()=>Uz,ZodIntersection:()=>Fu,ZodISOTime:()=>Iu,ZodISODuration:()=>zu,ZodISODateTime:()=>xu,ZodISODate:()=>Su,ZodIPv6:()=>Do,ZodIPv4:()=>Co,ZodGUID:()=>hr,ZodFunction:()=>gl,ZodFirstPartyTypeKind:()=>Ta,ZodFile:()=>Xu,ZodExactOptional:()=>Yu,ZodError:()=>Nz,ZodEnum:()=>Cn,ZodEmoji:()=>To,ZodEmail:()=>Po,ZodE164:()=>qo,ZodDiscriminatedUnion:()=>Lu,ZodDefault:()=>tl,ZodDate:()=>Wo,ZodCustomStringFormat:()=>Jn,ZodCustom:()=>ti,ZodCodec:()=>ea,ZodCatch:()=>sl,ZodCUID2:()=>Uo,ZodCUID:()=>No,ZodCIDRv6:()=>Mo,ZodCIDRv4:()=>Ro,ZodBoolean:()=>Br,ZodBigIntFormat:()=>Ho,ZodBigInt:()=>Xr,ZodBase64URL:()=>Fo,ZodBase64:()=>Lo,ZodArray:()=>Ru,ZodAny:()=>ju,TimePrecision:()=>ym,NEVER:()=>jd,$output:()=>hm,$input:()=>pm,$brand:()=>Zd});var Ad={};Mt(Ad,{version:()=>Xh,util:()=>re,treeifyError:()=>Gd,toJSONSchema:()=>Mg,toDotPath:()=>Bd,safeParseAsync:()=>Yd,safeParse:()=>Kd,safeEncodeAsync:()=>V1,safeEncode:()=>J1,safeDecodeAsync:()=>W1,safeDecode:()=>H1,registry:()=>Bs,regexes:()=>_n,process:()=>de,prettifyError:()=>Xd,parseAsync:()=>za,parse:()=>Ia,meta:()=>eg,locales:()=>Gs,isValidJWT:()=>$p,isValidBase64URL:()=>_p,isValidBase64:()=>Ls,initializeContext:()=>An,globalRegistry:()=>at,globalConfig:()=>Ui,formatError:()=>Os,flattenError:()=>zs,finalize:()=>Zn,extractDefs:()=>jn,encodeAsync:()=>F1,encode:()=>M1,describe:()=>Qm,decodeAsync:()=>q1,decode:()=>L1,createToJSONSchemaMethod:()=>ng,createStandardJSONSchemaMethod:()=>dr,config:()=>De,clone:()=>ht,_xor:()=>sz,_xid:()=>au,_void:()=>qm,_uuidv7:()=>eu,_uuidv6:()=>Qs,_uuidv4:()=>Ys,_uuid:()=>Ks,_url:()=>mo,_uppercase:()=>_o,_unknown:()=>Lm,_union:()=>az,_undefined:()=>Dm,_ulid:()=>ou,_uint64:()=>Zm,_uint32:()=>Tm,_tuple:()=>cz,_trim:()=>xo,_transform:()=>vz,_toUpperCase:()=>Io,_toLowerCase:()=>So,_templateLiteral:()=>Iz,_symbol:()=>Cm,_superRefine:()=>Km,_success:()=>wz,_stringbool:()=>tg,_stringFormat:()=>Hr,_string:()=>gm,_startsWith:()=>bo,_slugify:()=>zo,_size:()=>Fr,_set:()=>hz,_safeParseAsync:()=>Cr,_safeParse:()=>Zr,_safeEncodeAsync:()=>js,_safeEncode:()=>Us,_safeDecodeAsync:()=>Zs,_safeDecode:()=>As,_regex:()=>go,_refine:()=>Xm,_record:()=>fz,_readonly:()=>Sz,_property:()=>bu,_promise:()=>Oz,_positive:()=>gu,_pipe:()=>xz,_parseAsync:()=>jr,_parse:()=>Ar,_overwrite:()=>Ft,_optional:()=>_z,_number:()=>xm,_nullable:()=>yz,_null:()=>Rm,_normalize:()=>ko,_nonpositive:()=>_u,_nonoptional:()=>$z,_nonnegative:()=>yu,_never:()=>Fm,_negative:()=>vu,_nativeEnum:()=>mz,_nanoid:()=>nu,_nan:()=>Vm,_multipleOf:()=>Un,_minSize:()=>Kt,_minLength:()=>dn,_min:()=>qe,_mime:()=>wo,_maxSize:()=>qn,_maxLength:()=>qr,_max:()=>st,_map:()=>dz,_mac:()=>_m,_lte:()=>st,_lt:()=>Bt,_lowercase:()=>vo,_literal:()=>gz,_length:()=>Jr,_lazy:()=>zz,_ksuid:()=>su,_jwt:()=>mu,_isoTime:()=>wm,_isoDuration:()=>km,_isoDateTime:()=>bm,_isoDate:()=>$m,_ipv6:()=>lu,_ipv4:()=>uu,_intersection:()=>lz,_int64:()=>jm,_int32:()=>Pm,_int:()=>Im,_includes:()=>yo,_guid:()=>Di,_gte:()=>qe,_gt:()=>Xt,_float64:()=>Om,_float32:()=>zm,_file:()=>Gm,_enum:()=>pz,_endsWith:()=>$o,_encodeAsync:()=>Es,_encode:()=>Ps,_emoji:()=>tu,_email:()=>Xs,_e164:()=>pu,_discriminatedUnion:()=>uz,_default:()=>bz,_decodeAsync:()=>Ns,_decode:()=>Ts,_date:()=>Jm,_custom:()=>Bm,_cuid2:()=>iu,_cuid:()=>ru,_coercedString:()=>vm,_coercedNumber:()=>Sm,_coercedDate:()=>Hm,_coercedBoolean:()=>Nm,_coercedBigint:()=>Am,_cidrv6:()=>fu,_cidrv4:()=>cu,_check:()=>Ym,_catch:()=>kz,_boolean:()=>Em,_bigint:()=>Um,_base64url:()=>hu,_base64:()=>du,_array:()=>Wm,_any:()=>Mm,TimePrecision:()=>ym,NEVER:()=>jd,JSONSchemaGenerator:()=>Tz,JSONSchema:()=>Ez,Doc:()=>Bh,$output:()=>hm,$input:()=>pm,$constructor:()=>S,$brand:()=>Zd,$ZodXor:()=>Rp,$ZodXID:()=>ap,$ZodVoid:()=>Np,$ZodUnknown:()=>Tp,$ZodUnion:()=>po,$ZodUndefined:()=>zp,$ZodUUID:()=>Yh,$ZodURL:()=>ep,$ZodULID:()=>op,$ZodType:()=>Q,$ZodTuple:()=>Hs,$ZodTransform:()=>Gp,$ZodTemplateLiteral:()=>om,$ZodSymbol:()=>Ip,$ZodSuccess:()=>em,$ZodStringFormat:()=>pe,$ZodString:()=>Lr,$ZodSet:()=>Jp,$ZodRegistry:()=>mm,$ZodRecord:()=>Fp,$ZodRealError:()=>Qe,$ZodReadonly:()=>im,$ZodPromise:()=>sm,$ZodPrefault:()=>Yp,$ZodPipe:()=>rm,$ZodOptional:()=>Vs,$ZodObjectJIT:()=>Dp,$ZodObject:()=>Cp,$ZodNumberFormat:()=>xp,$ZodNumber:()=>Fs,$ZodNullable:()=>Xp,$ZodNull:()=>Op,$ZodNonOptional:()=>Qp,$ZodNever:()=>Ep,$ZodNanoID:()=>np,$ZodNaN:()=>nm,$ZodMap:()=>qp,$ZodMAC:()=>pp,$ZodLiteral:()=>Vp,$ZodLazy:()=>um,$ZodKSUID:()=>sp,$ZodJWT:()=>wp,$ZodIntersection:()=>Lp,$ZodISOTime:()=>cp,$ZodISODuration:()=>fp,$ZodISODateTime:()=>up,$ZodISODate:()=>lp,$ZodIPv6:()=>hp,$ZodIPv4:()=>dp,$ZodGUID:()=>Kh,$ZodFunction:()=>am,$ZodFile:()=>Wp,$ZodExactOptional:()=>Bp,$ZodError:()=>Is,$ZodEnum:()=>Hp,$ZodEncodeError:()=>lo,$ZodEmoji:()=>tp,$ZodEmail:()=>Qh,$ZodE164:()=>bp,$ZodDiscriminatedUnion:()=>Mp,$ZodDefault:()=>Kp,$ZodDate:()=>Up,$ZodCustomStringFormat:()=>kp,$ZodCustom:()=>lm,$ZodCodec:()=>Ws,$ZodCheckUpperCase:()=>Fh,$ZodCheckStringFormat:()=>Mr,$ZodCheckStartsWith:()=>Jh,$ZodCheckSizeEquals:()=>Zh,$ZodCheckRegex:()=>Mh,$ZodCheckProperty:()=>Vh,$ZodCheckOverwrite:()=>Gh,$ZodCheckNumberFormat:()=>Nh,$ZodCheckMultipleOf:()=>Eh,$ZodCheckMinSize:()=>jh,$ZodCheckMinLength:()=>Dh,$ZodCheckMimeType:()=>Wh,$ZodCheckMaxSize:()=>Ah,$ZodCheckMaxLength:()=>Ch,$ZodCheckLowerCase:()=>Lh,$ZodCheckLessThan:()=>Rs,$ZodCheckLengthEquals:()=>Rh,$ZodCheckIncludes:()=>qh,$ZodCheckGreaterThan:()=>Ms,$ZodCheckEndsWith:()=>Hh,$ZodCheckBigIntFormat:()=>Uh,$ZodCheck:()=>ke,$ZodCatch:()=>tm,$ZodCUID2:()=>ip,$ZodCUID:()=>rp,$ZodCIDRv6:()=>gp,$ZodCIDRv4:()=>mp,$ZodBoolean:()=>qs,$ZodBigIntFormat:()=>Sp,$ZodBigInt:()=>Js,$ZodBase64URL:()=>yp,$ZodBase64:()=>vp,$ZodAsyncError:()=>un,$ZodArray:()=>Ap,$ZodAny:()=>Pp});var jd=Object.freeze({status:"aborted"});function S(e,n,r){function o(u,l){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),n(u,l);let c=s.prototype,d=Object.keys(c);for(let f=0;f<d.length;f++){let h=d[f];h in u||(u[h]=c[h].bind(u))}}let i=(r==null?void 0:r.Parent)??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function s(u){var l;let c=r!=null&&r.Parent?new a:this;o(c,u),(l=c._zod).deferred??(l.deferred=[]);for(let d of c._zod.deferred)d();return c}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:u=>{var l,c;return r!=null&&r.Parent&&u instanceof r.Parent?!0:(c=(l=u==null?void 0:u._zod)==null?void 0:l.traits)==null?void 0:c.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}var Zd=Symbol("zod_brand");let un=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};class lo extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}var Ui={};function De(e){return e&&Object.assign(Ui,e),Ui}var re={};Mt(re,{unwrapMessage:()=>tr,uint8ArrayToHex:()=>D1,uint8ArrayToBase64url:()=>Z1,uint8ArrayToBase64:()=>Vd,stringifyPrimitive:()=>G,slugify:()=>Dd,shallowClone:()=>Md,safeExtend:()=>T1,required:()=>U1,randomString:()=>k1,propertyKeyTypes:()=>ji,promiseAllObject:()=>w1,primitiveTypes:()=>Ld,prefixIssues:()=>_t,pick:()=>z1,partial:()=>N1,parsedType:()=>Y,optionalKeys:()=>Fd,omit:()=>O1,objectClone:()=>y1,numKeys:()=>x1,nullish:()=>vn,normalizeParams:()=>U,mergeDefs:()=>Lt,merge:()=>E1,jsonStringifyReplacer:()=>Ai,joinValues:()=>N,issue:()=>Zi,isPlainObject:()=>fn,isObject:()=>En,hexToUint8Array:()=>C1,getSizableOrigin:()=>fo,getParsedType:()=>S1,getLengthableOrigin:()=>ho,getEnumValues:()=>xs,getElementAtPath:()=>$1,floatSafeRemainder:()=>Cd,finalizeIssue:()=>ut,extend:()=>P1,escapeRegex:()=>Ct,esc:()=>Sa,defineLazy:()=>ne,createTransparentProxy:()=>I1,cloneDef:()=>b1,clone:()=>ht,cleanRegex:()=>co,cleanEnum:()=>A1,captureStackTrace:()=>Ss,cached:()=>Ur,base64urlToUint8Array:()=>j1,base64ToUint8Array:()=>Hd,assignProp:()=>en,assertNotEqual:()=>m1,assertNever:()=>v1,assertIs:()=>g1,assertEqual:()=>p1,assert:()=>_1,allowsEval:()=>Rd,aborted:()=>an,NUMBER_FORMAT_RANGES:()=>qd,Class:()=>R1,BIGINT_FORMAT_RANGES:()=>Jd});function p1(e){return e}function m1(e){return e}function g1(e){}function v1(e){throw Error("Unexpected value in exhaustive check")}function _1(e){}function xs(e){let n=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>n.indexOf(+r)===-1).map(([r,o])=>o)}function N(e,n="|"){return e.map(r=>G(r)).join(n)}function Ai(e,n){return typeof n=="bigint"?n.toString():n}function Ur(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function vn(e){return e==null}function co(e){let n=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(n,r)}function Cd(e,n){let r=(e.toString().split(".")[1]||"").length,o=n.toString(),i=(o.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(o)){let l=o.match(/\d?e-(\d?)/);l!=null&&l[1]&&(i=Number.parseInt(l[1]))}let a=r>i?r:i,s=Number.parseInt(e.toFixed(a).replace(".","")),u=Number.parseInt(n.toFixed(a).replace(".",""));return s%u/10**a}var cc=Symbol("evaluating");function ne(e,n,r){let o;Object.defineProperty(e,n,{get(){if(o!==cc)return o===void 0&&(o=cc,o=r()),o},set(i){Object.defineProperty(e,n,{value:i})},configurable:!0})}function y1(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function en(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Lt(...e){let n={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(n,o)}return Object.defineProperties({},n)}function b1(e){return Lt(e._zod.def)}function $1(e,n){return n?n.reduce((r,o)=>r==null?void 0:r[o],e):e}function w1(e){let n=Object.keys(e),r=n.map(o=>e[o]);return Promise.all(r).then(o=>{let i={};for(let a=0;a<n.length;a++)i[n[a]]=o[a];return i})}function k1(e=10){let n="";for(let r=0;r<e;r++)n+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return n}function Sa(e){return JSON.stringify(e)}function Dd(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ss="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function En(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Rd=Ur(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{return new Function(""),!0}catch{return!1}});function fn(e){if(En(e)===!1)return!1;let n=e.constructor;if(n===void 0||typeof n!="function")return!0;let r=n.prototype;return!(En(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Md(e){return fn(e)?{...e}:Array.isArray(e)?[...e]:e}function x1(e){let n=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&n++;return n}var S1=e=>{let n=typeof e;switch(n){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 Error(`Unknown data type: ${n}`)}},ji=new Set(["string","number","symbol"]),Ld=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ct(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ht(e,n,r){let o=new e._zod.constr(n??e._zod.def);return(!n||r!=null&&r.parent)&&(o._zod.parent=e),o}function U(e){let n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if((n==null?void 0:n.message)!==void 0){if((n==null?void 0:n.error)!==void 0)throw Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function I1(e){let n;return new Proxy({},{get(r,o,i){return n??(n=e()),Reflect.get(n,o,i)},set(r,o,i,a){return n??(n=e()),Reflect.set(n,o,i,a)},has(r,o){return n??(n=e()),Reflect.has(n,o)},deleteProperty(r,o){return n??(n=e()),Reflect.deleteProperty(n,o)},ownKeys(r){return n??(n=e()),Reflect.ownKeys(n)},getOwnPropertyDescriptor(r,o){return n??(n=e()),Reflect.getOwnPropertyDescriptor(n,o)},defineProperty(r,o,i){return n??(n=e()),Reflect.defineProperty(n,o,i)}})}function G(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Fd(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}var qd={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]},Jd={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function z1(e,n){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=Lt(e._zod.def,{get shape(){let a={};for(let s in n){if(!(s in r.shape))throw Error(`Unrecognized key: "${s}"`);n[s]&&(a[s]=r.shape[s])}return en(this,"shape",a),a},checks:[]});return ht(e,i)}function O1(e,n){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=Lt(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in n){if(!(s in r.shape))throw Error(`Unrecognized key: "${s}"`);n[s]&&delete a[s]}return en(this,"shape",a),a},checks:[]});return ht(e,i)}function P1(e,n){if(!fn(n))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in n)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=Lt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...n};return en(this,"shape",i),i}});return ht(e,o)}function T1(e,n){if(!fn(n))throw Error("Invalid input to safeExtend: expected a plain object");let r=Lt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...n};return en(this,"shape",o),o}});return ht(e,r)}function E1(e,n){let r=Lt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...n._zod.def.shape};return en(this,"shape",o),o},get catchall(){return n._zod.def.catchall},checks:[]});return ht(e,r)}function N1(e,n,r){let o=n._zod.def.checks;if(o&&o.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=Lt(n._zod.def,{get shape(){let a=n._zod.def.shape,s={...a};if(r)for(let u in r){if(!(u in a))throw Error(`Unrecognized key: "${u}"`);r[u]&&(s[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)s[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return en(this,"shape",s),s},checks:[]});return ht(n,i)}function U1(e,n,r){let o=Lt(n._zod.def,{get shape(){let i=n._zod.def.shape,a={...i};if(r)for(let s in r){if(!(s in a))throw Error(`Unrecognized key: "${s}"`);r[s]&&(a[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(let s in i)a[s]=new e({type:"nonoptional",innerType:i[s]});return en(this,"shape",a),a}});return ht(n,o)}function an(e,n=0){var r;if(e.aborted===!0)return!0;for(let o=n;o<e.issues.length;o++)if(((r=e.issues[o])==null?void 0:r.continue)!==!0)return!0;return!1}function _t(e,n){return n.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function tr(e){return typeof e=="string"?e:e==null?void 0:e.message}function ut(e,n,r){var i,a,s,u,l,c;let o={...e,path:e.path??[]};if(!e.message){let d=tr((s=(a=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:a.error)==null?void 0:s.call(a,e))??tr((u=n==null?void 0:n.error)==null?void 0:u.call(n,e))??tr((l=r.customError)==null?void 0:l.call(r,e))??tr((c=r.localeError)==null?void 0:c.call(r,e))??"Invalid input";o.message=d}return delete o.inst,delete o.continue,!(n!=null&&n.reportInput)&&delete o.input,o}function fo(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ho(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Y(e){let n=typeof e;switch(n){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 n}function Zi(...e){let[n,r,o]=e;return typeof n=="string"?{message:n,code:"custom",input:r,inst:o}:{...n}}function A1(e){return Object.entries(e).filter(([n,r])=>Number.isNaN(Number.parseInt(n,10))).map(n=>n[1])}function Hd(e){let n=atob(e),r=new Uint8Array(n.length);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return r}function Vd(e){let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}function j1(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-n.length%4)%4);return Hd(n+r)}function Z1(e){return Vd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function C1(e){let n=e.replace(/^0x/,"");if(n.length%2!==0)throw Error("Invalid hex string length");let r=new Uint8Array(n.length/2);for(let o=0;o<n.length;o+=2)r[o/2]=Number.parseInt(n.slice(o,o+2),16);return r}function D1(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}class R1{constructor(...n){}}var Wd=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,Ai,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Is=S("$ZodError",Wd),Qe=S("$ZodError",Wd,{Parent:Error});function zs(e,n=r=>r.message){let r={},o=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(n(i))):o.push(n(i));return{formErrors:o,fieldErrors:r}}function Os(e,n=r=>r.message){let r={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s}));else if(a.code==="invalid_key")o({issues:a.issues});else if(a.code==="invalid_element")o({issues:a.issues});else if(a.path.length===0)r._errors.push(n(a));else{let s=r,u=0;for(;u<a.path.length;){let l=a.path[u];u!==a.path.length-1?s[l]=s[l]||{_errors:[]}:(s[l]=s[l]||{_errors:[]},s[l]._errors.push(n(a))),s=s[l],u++}}};return o(e),r}function Gd(e,n=r=>r.message){let r={errors:[]},o=(i,a=[])=>{var s,u;for(let l of i.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(c=>o({issues:c},l.path));else if(l.code==="invalid_key")o({issues:l.issues},l.path);else if(l.code==="invalid_element")o({issues:l.issues},l.path);else{let c=[...a,...l.path];if(c.length===0){r.errors.push(n(l));continue}let d=r,f=0;for(;f<c.length;){let h=c[f],p=f===c.length-1;typeof h=="string"?(d.properties??(d.properties={}),(s=d.properties)[h]??(s[h]={errors:[]}),d=d.properties[h]):(d.items??(d.items=[]),(u=d.items)[h]??(u[h]={errors:[]}),d=d.items[h]),p&&d.errors.push(n(l)),f++}}};return o(e),r}function Bd(e){let n=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?n.push(`[${o}]`):typeof o=="symbol"?n.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?n.push(`[${JSON.stringify(o)}]`):(n.length&&n.push("."),n.push(o));return n.join("")}function Xd(e){var o;let n=[],r=[...e.issues].sort((i,a)=>(i.path??[]).length-(a.path??[]).length);for(let i of r)n.push(`✖ ${i.message}`),(o=i.path)!=null&&o.length&&n.push(` → at ${Bd(i.path)}`);return n.join(`
47
- `)}var Ar=e=>(n,r,o,i)=>{let a=o?Object.assign(o,{async:!1}):{async:!1},s=n._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new un;if(s.issues.length){let u=new((i==null?void 0:i.Err)??e)(s.issues.map(l=>ut(l,a,De())));throw Ss(u,i==null?void 0:i.callee),u}return s.value},Ia=Ar(Qe),jr=e=>async(n,r,o,i)=>{let a=o?Object.assign(o,{async:!0}):{async:!0},s=n._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let u=new((i==null?void 0:i.Err)??e)(s.issues.map(l=>ut(l,a,De())));throw Ss(u,i==null?void 0:i.callee),u}return s.value},za=jr(Qe),Zr=e=>(n,r,o)=>{let i=o?{...o,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new un;return a.issues.length?{success:!1,error:new(e??Is)(a.issues.map(s=>ut(s,i,De())))}:{success:!0,data:a.value}},Kd=Zr(Qe),Cr=e=>async(n,r,o)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},a=n._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(s=>ut(s,i,De())))}:{success:!0,data:a.value}},Yd=Cr(Qe),Ps=e=>(n,r,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ar(e)(n,r,i)},M1=Ps(Qe),Ts=e=>(n,r,o)=>Ar(e)(n,r,o),L1=Ts(Qe),Es=e=>async(n,r,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return jr(e)(n,r,i)},F1=Es(Qe),Ns=e=>async(n,r,o)=>jr(e)(n,r,o),q1=Ns(Qe),Us=e=>(n,r,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Zr(e)(n,r,i)},J1=Us(Qe),As=e=>(n,r,o)=>Zr(e)(n,r,o),H1=As(Qe),js=e=>async(n,r,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Cr(e)(n,r,i)},V1=js(Qe),Zs=e=>async(n,r,o)=>Cr(e)(n,r,o),W1=Zs(Qe),_n={};Mt(_n,{xid:()=>nh,uuid7:()=>K1,uuid6:()=>X1,uuid4:()=>B1,uuid:()=>Nn,uppercase:()=>Ph,unicodeEmail:()=>uh,undefined:()=>zh,ulid:()=>th,time:()=>bh,string:()=>wh,sha512_hex:()=>_S,sha512_base64url:()=>bS,sha512_base64:()=>yS,sha384_hex:()=>mS,sha384_base64url:()=>vS,sha384_base64:()=>gS,sha256_hex:()=>dS,sha256_base64url:()=>pS,sha256_base64:()=>hS,sha1_hex:()=>lS,sha1_base64url:()=>fS,sha1_base64:()=>cS,rfc5322Email:()=>Q1,number:()=>Ds,null:()=>Ih,nanoid:()=>ih,md5_hex:()=>aS,md5_base64url:()=>uS,md5_base64:()=>sS,mac:()=>dh,lowercase:()=>Oh,ksuid:()=>rh,ipv6:()=>fh,ipv4:()=>ch,integer:()=>xh,idnEmail:()=>eS,html5Email:()=>Y1,hostname:()=>rS,hex:()=>oS,guid:()=>ah,extendedDuration:()=>G1,emoji:()=>lh,email:()=>sh,e164:()=>gh,duration:()=>oh,domain:()=>iS,datetime:()=>$h,date:()=>_h,cuid2:()=>eh,cuid:()=>Qd,cidrv6:()=>ph,cidrv4:()=>hh,browserEmail:()=>tS,boolean:()=>Sh,bigint:()=>kh,base64url:()=>Cs,base64:()=>mh});var Qd=/^[cC][^\s-]{8,}$/,eh=/^[0-9a-z]+$/,th=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nh=/^[0-9a-vA-V]{20}$/,rh=/^[A-Za-z0-9]{27}$/,ih=/^[a-zA-Z0-9_-]{21}$/,oh=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,G1=/^[-+]?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)?)??$/,ah=/^([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})$/,Nn=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)$/,B1=Nn(4),X1=Nn(6),K1=Nn(7),sh=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Y1=/^[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])?)*$/,Q1=/^(([^<>()\[\]\\.,;:\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,}))$/,uh=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,eS=uh,tS=/^[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])?)*$/,nS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function lh(){return new RegExp(nS,"u")}var ch=/^(?:(?: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])$/,fh=/^(([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}|:))$/,dh=e=>{let n=Ct(e??":");return new RegExp(`^(?:[0-9A-F]{2}${n}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${n}){5}[0-9a-f]{2}$`)},hh=/^((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])$/,ph=/^(([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])$/,mh=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Cs=/^[A-Za-z0-9_-]*$/,rS=/^(?=.{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])?)*\.?$/,iS=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,gh=/^\+[1-9]\d{6,14}$/,vh="(?:(?:\\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])))",_h=new RegExp(`^${vh}$`);function yh(e){return typeof e.precision=="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function bh(e){return new RegExp(`^${yh(e)}$`)}function $h(e){let n=yh({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${n}(?:${r.join("|")})`;return new RegExp(`^${vh}T(?:${o})$`)}var wh=e=>{let n=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},kh=/^-?\d+n?$/,xh=/^-?\d+$/,Ds=/^-?\d+(?:\.\d+)?$/,Sh=/^(?:true|false)$/i,Ih=/^null$/i,zh=/^undefined$/i,Oh=/^[^A-Z]*$/,Ph=/^[^a-z]*$/,oS=/^[0-9a-fA-F]*$/;function Dr(e,n){return new RegExp(`^[A-Za-z0-9+/]{${e}}${n}$`)}function Rr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var aS=/^[0-9a-fA-F]{32}$/,sS=Dr(22,"=="),uS=Rr(22),lS=/^[0-9a-fA-F]{40}$/,cS=Dr(27,"="),fS=Rr(27),dS=/^[0-9a-fA-F]{64}$/,hS=Dr(43,"="),pS=Rr(43),mS=/^[0-9a-fA-F]{96}$/,gS=Dr(64,""),vS=Rr(64),_S=/^[0-9a-fA-F]{128}$/,yS=Dr(86,"=="),bS=Rr(86),ke=S("$ZodCheck",(e,n)=>{var r;e._zod??(e._zod={}),e._zod.def=n,(r=e._zod).onattach??(r.onattach=[])}),Th={number:"number",bigint:"bigint",object:"date"},Rs=S("$ZodCheckLessThan",(e,n)=>{ke.init(e,n);let r=Th[typeof n.value];e._zod.onattach.push(o=>{let i=o._zod.bag,a=(n.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<a&&(n.inclusive?i.maximum=n.value:i.exclusiveMaximum=n.value)}),e._zod.check=o=>{(n.inclusive?o.value<=n.value:o.value<n.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:o.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Ms=S("$ZodCheckGreaterThan",(e,n)=>{ke.init(e,n);let r=Th[typeof n.value];e._zod.onattach.push(o=>{let i=o._zod.bag,a=(n.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>a&&(n.inclusive?i.minimum=n.value:i.exclusiveMinimum=n.value)}),e._zod.check=o=>{(n.inclusive?o.value>=n.value:o.value>n.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:o.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Eh=S("$ZodCheckMultipleOf",(e,n)=>{ke.init(e,n),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=n.value)}),e._zod.check=r=>{if(typeof r.value!=typeof n.value)throw Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%n.value===BigInt(0):Cd(r.value,n.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:n.value,input:r.value,inst:e,continue:!n.abort})}}),Nh=S("$ZodCheckNumberFormat",(e,n)=>{var s;ke.init(e,n),n.format=n.format||"float64";let r=(s=n.format)==null?void 0:s.includes("int"),o=r?"int":"number",[i,a]=qd[n.format];e._zod.onattach.push(u=>{let l=u._zod.bag;l.format=n.format,l.minimum=i,l.maximum=a,r&&(l.pattern=xh)}),e._zod.check=u=>{let l=u.value;if(r){if(!Number.isInteger(l)){u.issues.push({expected:o,format:n.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?u.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!n.abort}):u.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!n.abort});return}}l<i&&u.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!n.abort}),l>a&&u.issues.push({origin:"number",input:l,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!n.abort})}}),Uh=S("$ZodCheckBigIntFormat",(e,n)=>{ke.init(e,n);let[r,o]=Jd[n.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=n.format,a.minimum=r,a.maximum=o}),e._zod.check=i=>{let a=i.value;a<r&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!n.abort}),a>o&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!n.abort})}}),Ah=S("$ZodCheckMaxSize",(e,n)=>{var r;ke.init(e,n),(r=e._zod.def).when??(r.when=o=>{let i=o.value;return!vn(i)&&i.size!==void 0}),e._zod.onattach.push(o=>{let i=o._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<i&&(o._zod.bag.maximum=n.maximum)}),e._zod.check=o=>{let i=o.value;i.size<=n.maximum||o.issues.push({origin:fo(i),code:"too_big",maximum:n.maximum,inclusive:!0,input:i,inst:e,continue:!n.abort})}}),jh=S("$ZodCheckMinSize",(e,n)=>{var r;ke.init(e,n),(r=e._zod.def).when??(r.when=o=>{let i=o.value;return!vn(i)&&i.size!==void 0}),e._zod.onattach.push(o=>{let i=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>i&&(o._zod.bag.minimum=n.minimum)}),e._zod.check=o=>{let i=o.value;i.size>=n.minimum||o.issues.push({origin:fo(i),code:"too_small",minimum:n.minimum,inclusive:!0,input:i,inst:e,continue:!n.abort})}}),Zh=S("$ZodCheckSizeEquals",(e,n)=>{var r;ke.init(e,n),(r=e._zod.def).when??(r.when=o=>{let i=o.value;return!vn(i)&&i.size!==void 0}),e._zod.onattach.push(o=>{let i=o._zod.bag;i.minimum=n.size,i.maximum=n.size,i.size=n.size}),e._zod.check=o=>{let i=o.value,a=i.size;if(a===n.size)return;let s=a>n.size;o.issues.push({origin:fo(i),...s?{code:"too_big",maximum:n.size}:{code:"too_small",minimum:n.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!n.abort})}}),Ch=S("$ZodCheckMaxLength",(e,n)=>{var r;ke.init(e,n),(r=e._zod.def).when??(r.when=o=>{let i=o.value;return!vn(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{let i=o._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<i&&(o._zod.bag.maximum=n.maximum)}),e._zod.check=o=>{let i=o.value;if(i.length<=n.maximum)return;let a=ho(i);o.issues.push({origin:a,code:"too_big",maximum:n.maximum,inclusive:!0,input:i,inst:e,continue:!n.abort})}}),Dh=S("$ZodCheckMinLength",(e,n)=>{var r;ke.init(e,n),(r=e._zod.def).when??(r.when=o=>{let i=o.value;return!vn(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{let i=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>i&&(o._zod.bag.minimum=n.minimum)}),e._zod.check=o=>{let i=o.value;if(i.length>=n.minimum)return;let a=ho(i);o.issues.push({origin:a,code:"too_small",minimum:n.minimum,inclusive:!0,input:i,inst:e,continue:!n.abort})}}),Rh=S("$ZodCheckLengthEquals",(e,n)=>{var r;ke.init(e,n),(r=e._zod.def).when??(r.when=o=>{let i=o.value;return!vn(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{let i=o._zod.bag;i.minimum=n.length,i.maximum=n.length,i.length=n.length}),e._zod.check=o=>{let i=o.value,a=i.length;if(a===n.length)return;let s=ho(i),u=a>n.length;o.issues.push({origin:s,...u?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!n.abort})}}),Mr=S("$ZodCheckStringFormat",(e,n)=>{var r,o;ke.init(e,n),e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=n.format,n.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(n.pattern))}),n.pattern?(r=e._zod).check??(r.check=i=>{n.pattern.lastIndex=0,!n.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:n.format,input:i.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(o=e._zod).check??(o.check=()=>{})}),Mh=S("$ZodCheckRegex",(e,n)=>{Mr.init(e,n),e._zod.check=r=>{n.pattern.lastIndex=0,!n.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),Lh=S("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=Oh),Mr.init(e,n)}),Fh=S("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=Ph),Mr.init(e,n)}),qh=S("$ZodCheckIncludes",(e,n)=>{ke.init(e,n);let r=Ct(n.includes),o=new RegExp(typeof n.position=="number"?`^.{${n.position}}${r}`:r);n.pattern=o,e._zod.onattach.push(i=>{let a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(o)}),e._zod.check=i=>{i.value.includes(n.includes,n.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:i.value,inst:e,continue:!n.abort})}}),Jh=S("$ZodCheckStartsWith",(e,n)=>{ke.init(e,n);let r=new RegExp(`^${Ct(n.prefix)}.*`);n.pattern??(n.pattern=r),e._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(n.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:o.value,inst:e,continue:!n.abort})}}),Hh=S("$ZodCheckEndsWith",(e,n)=>{ke.init(e,n);let r=new RegExp(`.*${Ct(n.suffix)}$`);n.pattern??(n.pattern=r),e._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(n.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:o.value,inst:e,continue:!n.abort})}});function fc(e,n,r){e.issues.length&&n.issues.push(..._t(r,e.issues))}var Vh=S("$ZodCheckProperty",(e,n)=>{ke.init(e,n),e._zod.check=r=>{let o=n.schema._zod.run({value:r.value[n.property],issues:[]},{});if(o instanceof Promise)return o.then(i=>fc(i,r,n.property));fc(o,r,n.property)}}),Wh=S("$ZodCheckMimeType",(e,n)=>{ke.init(e,n);let r=new Set(n.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=n.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:n.mime,input:o.value.type,inst:e,continue:!n.abort})}}),Gh=S("$ZodCheckOverwrite",(e,n)=>{ke.init(e,n),e._zod.check=r=>{r.value=n.tx(r.value)}});class Bh{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}let r=n.split(`
48
- `).filter(a=>a),o=Math.min(...r.map(a=>a.length-a.trimStart().length)),i=r.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let n=Function,r=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(i=>` ${i}`)];return new n(...r,o.join(`
49
- `))}}var Xh={major:4,minor:3,patch:5},Q=S("$ZodType",(e,n)=>{var i;var r;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=Xh;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let a of o)for(let s of a._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{let a=(u,l,c)=>{let d=an(u),f;for(let h of l){if(h._zod.def.when){if(!h._zod.def.when(u))continue}else if(d)continue;let p=u.issues.length,m=h._zod.check(u);if(m instanceof Promise&&(c==null?void 0:c.async)===!1)throw new un;if(f||m instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await m,u.issues.length!==p&&(d||(d=an(u,p)))});else{if(u.issues.length===p)continue;d||(d=an(u,p))}}return f?f.then(()=>u):u},s=(u,l,c)=>{if(an(u))return u.aborted=!0,u;let d=a(l,o,c);if(d instanceof Promise){if(c.async===!1)throw new un;return d.then(f=>e._zod.parse(f,c))}return e._zod.parse(d,c)};e._zod.run=(u,l)=>{if(l.skipChecks)return e._zod.parse(u,l);if(l.direction==="backward"){let d=e._zod.parse({value:u.value,issues:[]},{...l,skipChecks:!0});return d instanceof Promise?d.then(f=>s(f,u,l)):s(d,u,l)}let c=e._zod.parse(u,l);if(c instanceof Promise){if(l.async===!1)throw new un;return c.then(d=>a(d,o,l))}return a(c,o,l)}}ne(e,"~standard",()=>({validate:a=>{var s;try{let u=Kd(e,a);return u.success?{value:u.data}:{issues:(s=u.error)==null?void 0:s.issues}}catch{return Yd(e,a).then(l=>{var c;return l.success?{value:l.data}:{issues:(c=l.error)==null?void 0:c.issues}})}},vendor:"zod",version:1}))}),Lr=S("$ZodString",(e,n)=>{var r;Q.init(e,n),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??wh(e._zod.bag),e._zod.parse=(o,i)=>{if(n.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),pe=S("$ZodStringFormat",(e,n)=>{Mr.init(e,n),Lr.init(e,n)}),Kh=S("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=ah),pe.init(e,n)}),Yh=S("$ZodUUID",(e,n)=>{if(n.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(r===void 0)throw Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=Nn(r))}else n.pattern??(n.pattern=Nn());pe.init(e,n)}),Qh=S("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=sh),pe.init(e,n)}),ep=S("$ZodURL",(e,n)=>{pe.init(e,n),e._zod.check=r=>{try{let o=r.value.trim(),i=new URL(o);n.hostname&&(n.hostname.lastIndex=0,!n.hostname.test(i.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:r.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,!n.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:r.value,inst:e,continue:!n.abort})),n.normalize?r.value=i.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort})}}}),tp=S("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=lh()),pe.init(e,n)}),np=S("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=ih),pe.init(e,n)}),rp=S("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=Qd),pe.init(e,n)}),ip=S("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=eh),pe.init(e,n)}),op=S("$ZodULID",(e,n)=>{n.pattern??(n.pattern=th),pe.init(e,n)}),ap=S("$ZodXID",(e,n)=>{n.pattern??(n.pattern=nh),pe.init(e,n)}),sp=S("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=rh),pe.init(e,n)}),up=S("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=$h(n)),pe.init(e,n)}),lp=S("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=_h),pe.init(e,n)}),cp=S("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=bh(n)),pe.init(e,n)}),fp=S("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=oh),pe.init(e,n)}),dp=S("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=ch),pe.init(e,n),e._zod.bag.format="ipv4"}),hp=S("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=fh),pe.init(e,n),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!n.abort})}}}),pp=S("$ZodMAC",(e,n)=>{n.pattern??(n.pattern=dh(n.delimiter)),pe.init(e,n),e._zod.bag.format="mac"}),mp=S("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=hh),pe.init(e,n)}),gp=S("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=ph),pe.init(e,n),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw Error();let[i,a]=o;if(!a)throw Error();let s=Number(a);if(`${s}`!==a||s<0||s>128)throw Error();new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!n.abort})}}});function Ls(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var vp=S("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=mh),pe.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Ls(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!n.abort})}});function _p(e){if(!Cs.test(e))return!1;let n=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return Ls(r)}var yp=S("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=Cs),pe.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{_p(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!n.abort})}}),bp=S("$ZodE164",(e,n)=>{n.pattern??(n.pattern=gh),pe.init(e,n)});function $p(e,n=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let i=JSON.parse(atob(o));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||n&&(!("alg"in i)||i.alg!==n))}catch{return!1}}var wp=S("$ZodJWT",(e,n)=>{pe.init(e,n),e._zod.check=r=>{$p(r.value,n.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!n.abort})}}),kp=S("$ZodCustomStringFormat",(e,n)=>{pe.init(e,n),e._zod.check=r=>{n.fn(r.value)||r.issues.push({code:"invalid_format",format:n.format,input:r.value,inst:e,continue:!n.abort})}}),Fs=S("$ZodNumber",(e,n)=>{Q.init(e,n),e._zod.pattern=e._zod.bag.pattern??Ds,e._zod.parse=(r,o)=>{if(n.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),r}}),xp=S("$ZodNumberFormat",(e,n)=>{Nh.init(e,n),Fs.init(e,n)}),qs=S("$ZodBoolean",(e,n)=>{Q.init(e,n),e._zod.pattern=Sh,e._zod.parse=(r,o)=>{if(n.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Js=S("$ZodBigInt",(e,n)=>{Q.init(e,n),e._zod.pattern=kh,e._zod.parse=(r,o)=>{if(n.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}}),Sp=S("$ZodBigIntFormat",(e,n)=>{Uh.init(e,n),Js.init(e,n)}),Ip=S("$ZodSymbol",(e,n)=>{Q.init(e,n),e._zod.parse=(r,o)=>{let i=r.value;return typeof i=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),r}}),zp=S("$ZodUndefined",(e,n)=>{Q.init(e,n),e._zod.pattern=zh,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,o)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),r}}),Op=S("$ZodNull",(e,n)=>{Q.init(e,n),e._zod.pattern=Ih,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),r}}),Pp=S("$ZodAny",(e,n)=>{Q.init(e,n),e._zod.parse=r=>r}),Tp=S("$ZodUnknown",(e,n)=>{Q.init(e,n),e._zod.parse=r=>r}),Ep=S("$ZodNever",(e,n)=>{Q.init(e,n),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Np=S("$ZodVoid",(e,n)=>{Q.init(e,n),e._zod.parse=(r,o)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Up=S("$ZodDate",(e,n)=>{Q.init(e,n),e._zod.parse=(r,o)=>{if(n.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:e}),r}});function dc(e,n,r){e.issues.length&&n.issues.push(..._t(r,e.issues)),n.value[r]=e.value}var Ap=S("$ZodArray",(e,n)=>{Q.init(e,n),e._zod.parse=(r,o)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let a=[];for(let s=0;s<i.length;s++){let u=i[s],l=n.element._zod.run({value:u,issues:[]},o);l instanceof Promise?a.push(l.then(c=>dc(c,r,s))):dc(l,r,s)}return a.length?Promise.all(a).then(()=>r):r}});function Ci(e,n,r,o,i){if(e.issues.length){if(i&&!(r in o))return;n.issues.push(..._t(r,e.issues))}e.value===void 0?r in o&&(n.value[r]=void 0):n.value[r]=e.value}function jp(e){var o,i,a,s;let n=Object.keys(e.shape);for(let u of n)if(!((s=(a=(i=(o=e.shape)==null?void 0:o[u])==null?void 0:i._zod)==null?void 0:a.traits)!=null&&s.has("$ZodType")))throw Error(`Invalid element at key "${u}": expected a Zod schema`);let r=Fd(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function Zp(e,n,r,o,i,a){let s=[],u=i.keySet,l=i.catchall._zod,c=l.def.type,d=l.optout==="optional";for(let f in n){if(u.has(f))continue;if(c==="never"){s.push(f);continue}let h=l.run({value:n[f],issues:[]},o);h instanceof Promise?e.push(h.then(p=>Ci(p,r,f,n,d))):Ci(h,r,f,n,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:n,inst:a}),e.length?Promise.all(e).then(()=>r):r}var Cp=S("$ZodObject",(e,n)=>{var s;if(Q.init(e,n),!((s=Object.getOwnPropertyDescriptor(n,"shape"))!=null&&s.get)){let u=n.shape;Object.defineProperty(n,"shape",{get:()=>{let l={...u};return Object.defineProperty(n,"shape",{value:l}),l}})}let r=Ur(()=>jp(n));ne(e._zod,"propValues",()=>{let u=n.shape,l={};for(let c in u){let d=u[c]._zod;if(d.values){l[c]??(l[c]=new Set);for(let f of d.values)l[c].add(f)}}return l});let o=En,i=n.catchall,a;e._zod.parse=(u,l)=>{a??(a=r.value);let c=u.value;if(!o(c))return u.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),u;u.value={};let d=[],f=a.shape;for(let h of a.keys){let p=f[h],m=p._zod.optout==="optional",v=p._zod.run({value:c[h],issues:[]},l);v instanceof Promise?d.push(v.then(y=>Ci(y,u,h,c,m))):Ci(v,u,h,c,m)}return i?Zp(d,c,u,l,r.value,e):d.length?Promise.all(d).then(()=>u):u}}),Dp=S("$ZodObjectJIT",(e,n)=>{Cp.init(e,n);let r=e._zod.parse,o=Ur(()=>jp(n)),i=f=>{var w,z;let h=new Bh(["shape","payload","ctx"]),p=o.value,m=$=>{let b=Sa($);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};h.write("const input = payload.value;");let v=Object.create(null),y=0;for(let $ of p.keys)v[$]=`key_${y++}`;h.write("const newResult = {};");for(let $ of p.keys){let b=v[$],k=Sa($),x=((z=(w=f[$])==null?void 0:w._zod)==null?void 0:z.optout)==="optional";h.write(`const ${b} = ${m($)};`),x?h.write(`
50
- if (${b}.issues.length) {
51
- if (${k} in input) {
52
- payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
53
- ...iss,
54
- path: iss.path ? [${k}, ...iss.path] : [${k}]
55
- })));
56
- }
57
- }
58
-
59
- if (${b}.value === undefined) {
60
- if (${k} in input) {
61
- newResult[${k}] = undefined;
62
- }
63
- } else {
64
- newResult[${k}] = ${b}.value;
65
- }
66
-
67
- `):h.write(`
68
- if (${b}.issues.length) {
69
- payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
70
- ...iss,
71
- path: iss.path ? [${k}, ...iss.path] : [${k}]
72
- })));
73
- }
74
-
75
- if (${b}.value === undefined) {
76
- if (${k} in input) {
77
- newResult[${k}] = undefined;
78
- }
79
- } else {
80
- newResult[${k}] = ${b}.value;
81
- }
82
-
83
- `)}h.write("payload.value = newResult;"),h.write("return payload;");let g=h.compile();return($,b)=>g(f,$,b)},a,s=En,u=!Ui.jitless,l=u&&Rd.value,c=n.catchall,d;e._zod.parse=(f,h)=>{d??(d=o.value);let p=f.value;return s(p)?u&&l&&(h==null?void 0:h.async)===!1&&h.jitless!==!0?(a||(a=i(n.shape)),f=a(f,h),c?Zp([],p,f,h,d,e):f):r(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f)}});function hc(e,n,r,o){for(let a of e)if(a.issues.length===0)return n.value=a.value,n;let i=e.filter(a=>!an(a));return i.length===1?(n.value=i[0].value,i[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(a=>a.issues.map(s=>ut(s,o,De())))}),n)}var po=S("$ZodUnion",(e,n)=>{Q.init(e,n),ne(e._zod,"optin",()=>n.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ne(e._zod,"optout",()=>n.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ne(e._zod,"values",()=>{if(n.options.every(i=>i._zod.values))return new Set(n.options.flatMap(i=>Array.from(i._zod.values)))}),ne(e._zod,"pattern",()=>{if(n.options.every(i=>i._zod.pattern)){let i=n.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>co(a.source)).join("|")})$`)}});let r=n.options.length===1,o=n.options[0]._zod.run;e._zod.parse=(i,a)=>{if(r)return o(i,a);let s=!1,u=[];for(let l of n.options){let c=l._zod.run({value:i.value,issues:[]},a);if(c instanceof Promise)u.push(c),s=!0;else{if(c.issues.length===0)return c;u.push(c)}}return s?Promise.all(u).then(l=>hc(l,i,e,a)):hc(u,i,e,a)}});function pc(e,n,r,o){let i=e.filter(a=>a.issues.length===0);return i.length===1?(n.value=i[0].value,n):(i.length===0?n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(a=>a.issues.map(s=>ut(s,o,De())))}):n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:[],inclusive:!1}),n)}var Rp=S("$ZodXor",(e,n)=>{po.init(e,n),n.inclusive=!1;let r=n.options.length===1,o=n.options[0]._zod.run;e._zod.parse=(i,a)=>{if(r)return o(i,a);let s=!1,u=[];for(let l of n.options){let c=l._zod.run({value:i.value,issues:[]},a);c instanceof Promise?(u.push(c),s=!0):u.push(c)}return s?Promise.all(u).then(l=>pc(l,i,e,a)):pc(u,i,e,a)}}),Mp=S("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,po.init(e,n);let r=e._zod.parse;ne(e._zod,"propValues",()=>{let i={};for(let a of n.options){let s=a._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index "${n.options.indexOf(a)}"`);for(let[u,l]of Object.entries(s)){i[u]||(i[u]=new Set);for(let c of l)i[u].add(c)}}return i});let o=Ur(()=>{var s;let i=n.options,a=new Map;for(let u of i){let l=(s=u._zod.propValues)==null?void 0:s[n.discriminator];if(!l||l.size===0)throw Error(`Invalid discriminated union option at index "${n.options.indexOf(u)}"`);for(let c of l){if(a.has(c))throw Error(`Duplicate discriminator value "${String(c)}"`);a.set(c,u)}}return a});e._zod.parse=(i,a)=>{let s=i.value;if(!En(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;let u=o.value.get(s==null?void 0:s[n.discriminator]);return u?u._zod.run(i,a):n.unionFallback?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,input:s,path:[n.discriminator],inst:e}),i)}}),Lp=S("$ZodIntersection",(e,n)=>{Q.init(e,n),e._zod.parse=(r,o)=>{let i=r.value,a=n.left._zod.run({value:i,issues:[]},o),s=n.right._zod.run({value:i,issues:[]},o);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([u,l])=>mc(r,u,l)):mc(r,a,s)}});function Oa(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(fn(e)&&fn(n)){let r=Object.keys(n),o=Object.keys(e).filter(a=>r.indexOf(a)!==-1),i={...e,...n};for(let a of o){let s=Oa(e[a],n[a]);if(!s.valid)return{valid:!1,mergeErrorPath:[a,...s.mergeErrorPath]};i[a]=s.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let i=e[o],a=n[o],s=Oa(i,a);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function mc(e,n,r){let o=new Map,i;for(let u of n.issues)if(u.code==="unrecognized_keys"){i??(i=u);for(let l of u.keys)o.has(l)||o.set(l,{}),o.get(l).l=!0}else e.issues.push(u);for(let u of r.issues)if(u.code==="unrecognized_keys")for(let l of u.keys)o.has(l)||o.set(l,{}),o.get(l).r=!0;else e.issues.push(u);let a=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length&&i&&e.issues.push({...i,keys:a}),an(e))return e;let s=Oa(n.value,r.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var Hs=S("$ZodTuple",(e,n)=>{Q.init(e,n);let r=n.items;e._zod.parse=(o,i)=>{let a=o.value;if(!Array.isArray(a))return o.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],u=[...r].reverse().findIndex(d=>d._zod.optin!=="optional"),l=u===-1?0:r.length-u;if(!n.rest){let d=a.length>r.length,f=a.length<l-1;if(d||f)return o.issues.push({...d?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:a,inst:e,origin:"array"}),o}let c=-1;for(let d of r){if(c++,c>=a.length&&c>=l)continue;let f=d._zod.run({value:a[c],issues:[]},i);f instanceof Promise?s.push(f.then(h=>fi(h,o,c))):fi(f,o,c)}if(n.rest){let d=a.slice(r.length);for(let f of d){c++;let h=n.rest._zod.run({value:f,issues:[]},i);h instanceof Promise?s.push(h.then(p=>fi(p,o,c))):fi(h,o,c)}}return s.length?Promise.all(s).then(()=>o):o}});function fi(e,n,r){e.issues.length&&n.issues.push(..._t(r,e.issues)),n.value[r]=e.value}var Fp=S("$ZodRecord",(e,n)=>{Q.init(e,n),e._zod.parse=(r,o)=>{let i=r.value;if(!fn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let a=[],s=n.keyType._zod.values;if(s){r.value={};let u=new Set;for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){u.add(typeof c=="number"?c.toString():c);let d=n.valueType._zod.run({value:i[c],issues:[]},o);d instanceof Promise?a.push(d.then(f=>{f.issues.length&&r.issues.push(..._t(c,f.issues)),r.value[c]=f.value})):(d.issues.length&&r.issues.push(..._t(c,d.issues)),r.value[c]=d.value)}let l;for(let c in i)u.has(c)||(l=l??[],l.push(c));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l})}else{r.value={};for(let u of Reflect.ownKeys(i)){if(u==="__proto__")continue;let l=n.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Ds.test(u)&&l.issues.length&&l.issues.some(d=>d.code==="invalid_type"&&d.expected==="number")){let d=n.keyType._zod.run({value:Number(u),issues:[]},o);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");d.issues.length===0&&(l=d)}if(l.issues.length){n.mode==="loose"?r.value[u]=i[u]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(d=>ut(d,o,De())),input:u,path:[u],inst:e});continue}let c=n.valueType._zod.run({value:i[u],issues:[]},o);c instanceof Promise?a.push(c.then(d=>{d.issues.length&&r.issues.push(..._t(u,d.issues)),r.value[l.value]=d.value})):(c.issues.length&&r.issues.push(..._t(u,c.issues)),r.value[l.value]=c.value)}}return a.length?Promise.all(a).then(()=>r):r}}),qp=S("$ZodMap",(e,n)=>{Q.init(e,n),e._zod.parse=(r,o)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;let a=[];r.value=new Map;for(let[s,u]of i){let l=n.keyType._zod.run({value:s,issues:[]},o),c=n.valueType._zod.run({value:u,issues:[]},o);l instanceof Promise||c instanceof Promise?a.push(Promise.all([l,c]).then(([d,f])=>{gc(d,f,r,s,i,e,o)})):gc(l,c,r,s,i,e,o)}return a.length?Promise.all(a).then(()=>r):r}});function gc(e,n,r,o,i,a,s){e.issues.length&&(ji.has(typeof o)?r.issues.push(..._t(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:a,issues:e.issues.map(u=>ut(u,s,De()))})),n.issues.length&&(ji.has(typeof o)?r.issues.push(..._t(o,n.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:a,key:o,issues:n.issues.map(u=>ut(u,s,De()))})),r.value.set(e.value,n.value)}var Jp=S("$ZodSet",(e,n)=>{Q.init(e,n),e._zod.parse=(r,o)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let a=[];r.value=new Set;for(let s of i){let u=n.valueType._zod.run({value:s,issues:[]},o);u instanceof Promise?a.push(u.then(l=>vc(l,r))):vc(u,r)}return a.length?Promise.all(a).then(()=>r):r}});function vc(e,n){e.issues.length&&n.issues.push(...e.issues),n.value.add(e.value)}var Hp=S("$ZodEnum",(e,n)=>{Q.init(e,n);let r=xs(n.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(i=>ji.has(typeof i)).map(i=>typeof i=="string"?Ct(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{let s=i.value;return o.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:e}),i}}),Vp=S("$ZodLiteral",(e,n)=>{if(Q.init(e,n),n.values.length===0)throw Error("Cannot create literal schema with no valid values");let r=new Set(n.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.values.map(o=>typeof o=="string"?Ct(o):o?Ct(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,i)=>{let a=o.value;return r.has(a)||o.issues.push({code:"invalid_value",values:n.values,input:a,inst:e}),o}}),Wp=S("$ZodFile",(e,n)=>{Q.init(e,n),e._zod.parse=(r,o)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:e}),r}}),Gp=S("$ZodTransform",(e,n)=>{Q.init(e,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new lo(e.constructor.name);let i=n.transform(r.value,r);if(o.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(r.value=a,r));if(i instanceof Promise)throw new un;return r.value=i,r}});function _c(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}var Vs=S("$ZodOptional",(e,n)=>{Q.init(e,n),e._zod.optin="optional",e._zod.optout="optional",ne(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),ne(e._zod,"pattern",()=>{let r=n.innerType._zod.pattern;return r?new RegExp(`^(${co(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(n.innerType._zod.optin==="optional"){let i=n.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>_c(a,r.value)):_c(i,r.value)}return r.value===void 0?r:n.innerType._zod.run(r,o)}}),Bp=S("$ZodExactOptional",(e,n)=>{Vs.init(e,n),ne(e._zod,"values",()=>n.innerType._zod.values),ne(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(r,o)=>n.innerType._zod.run(r,o)}),Xp=S("$ZodNullable",(e,n)=>{Q.init(e,n),ne(e._zod,"optin",()=>n.innerType._zod.optin),ne(e._zod,"optout",()=>n.innerType._zod.optout),ne(e._zod,"pattern",()=>{let r=n.innerType._zod.pattern;return r?new RegExp(`^(${co(r.source)}|null)$`):void 0}),ne(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:n.innerType._zod.run(r,o)}),Kp=S("$ZodDefault",(e,n)=>{Q.init(e,n),e._zod.optin="optional",ne(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return n.innerType._zod.run(r,o);if(r.value===void 0)return r.value=n.defaultValue,r;let i=n.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>yc(a,n)):yc(i,n)}});function yc(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}var Yp=S("$ZodPrefault",(e,n)=>{Q.init(e,n),e._zod.optin="optional",ne(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=n.defaultValue),n.innerType._zod.run(r,o))}),Qp=S("$ZodNonOptional",(e,n)=>{Q.init(e,n),ne(e._zod,"values",()=>{let r=n.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let i=n.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>bc(a,e)):bc(i,e)}});function bc(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}var em=S("$ZodSuccess",(e,n)=>{Q.init(e,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new lo("ZodSuccess");let i=n.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>(r.value=a.issues.length===0,r)):(r.value=i.issues.length===0,r)}}),tm=S("$ZodCatch",(e,n)=>{Q.init(e,n),ne(e._zod,"optin",()=>n.innerType._zod.optin),ne(e._zod,"optout",()=>n.innerType._zod.optout),ne(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return n.innerType._zod.run(r,o);let i=n.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>(r.value=a.value,a.issues.length&&(r.value=n.catchValue({...r,error:{issues:a.issues.map(s=>ut(s,o,De()))},input:r.value}),r.issues=[]),r)):(r.value=i.value,i.issues.length&&(r.value=n.catchValue({...r,error:{issues:i.issues.map(a=>ut(a,o,De()))},input:r.value}),r.issues=[]),r)}}),nm=S("$ZodNaN",(e,n)=>{Q.init(e,n),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)}),rm=S("$ZodPipe",(e,n)=>{Q.init(e,n),ne(e._zod,"values",()=>n.in._zod.values),ne(e._zod,"optin",()=>n.in._zod.optin),ne(e._zod,"optout",()=>n.out._zod.optout),ne(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let a=n.out._zod.run(r,o);return a instanceof Promise?a.then(s=>di(s,n.in,o)):di(a,n.in,o)}let i=n.in._zod.run(r,o);return i instanceof Promise?i.then(a=>di(a,n.out,o)):di(i,n.out,o)}});function di(e,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},r)}var Ws=S("$ZodCodec",(e,n)=>{Q.init(e,n),ne(e._zod,"values",()=>n.in._zod.values),ne(e._zod,"optin",()=>n.in._zod.optin),ne(e._zod,"optout",()=>n.out._zod.optout),ne(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=n.in._zod.run(r,o);return i instanceof Promise?i.then(a=>hi(a,n,o)):hi(i,n,o)}else{let i=n.out._zod.run(r,o);return i instanceof Promise?i.then(a=>hi(a,n,o)):hi(i,n,o)}}});function hi(e,n,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let o=n.transform(e.value,e);return o instanceof Promise?o.then(i=>pi(e,i,n.out,r)):pi(e,o,n.out,r)}else{let o=n.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>pi(e,i,n.in,r)):pi(e,o,n.in,r)}}function pi(e,n,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:n,issues:e.issues},o)}var im=S("$ZodReadonly",(e,n)=>{Q.init(e,n),ne(e._zod,"propValues",()=>n.innerType._zod.propValues),ne(e._zod,"values",()=>n.innerType._zod.values),ne(e._zod,"optin",()=>{var r,o;return(o=(r=n.innerType)==null?void 0:r._zod)==null?void 0:o.optin}),ne(e._zod,"optout",()=>{var r,o;return(o=(r=n.innerType)==null?void 0:r._zod)==null?void 0:o.optout}),e._zod.parse=(r,o)=>{if(o.direction==="backward")return n.innerType._zod.run(r,o);let i=n.innerType._zod.run(r,o);return i instanceof Promise?i.then($c):$c(i)}});function $c(e){return e.value=Object.freeze(e.value),e}var om=S("$ZodTemplateLiteral",(e,n)=>{Q.init(e,n);let r=[];for(let o of n.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let i=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!i)throw Error(`Invalid template literal part: ${o._zod.traits}`);let a=i.startsWith("^")?1:0,s=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(a,s))}else if(o===null||Ld.has(typeof o))r.push(Ct(`${o}`));else throw Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,i)=>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:n.format??"template_literal",pattern:e._zod.pattern.source}),o)}),am=S("$ZodFunction",(e,n)=>(Q.init(e,n),e._def=n,e._zod.def=n,e.implement=r=>{if(typeof r!="function")throw Error("implement() must be called with a function");return function(...o){let i=e._def.input?Ia(e._def.input,o):o,a=Reflect.apply(r,this,i);return e._def.output?Ia(e._def.output,a):a}},e.implementAsync=r=>{if(typeof r!="function")throw Error("implementAsync() must be called with a function");return async function(...o){let i=e._def.input?await za(e._def.input,o):o,a=await Reflect.apply(r,this,i);return e._def.output?await za(e._def.output,a):a}},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 Hs({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=>new e.constructor({type:"function",input:e._def.input,output:r}),e)),sm=S("$ZodPromise",(e,n)=>{Q.init(e,n),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(i=>n.innerType._zod.run({value:i,issues:[]},o))}),um=S("$ZodLazy",(e,n)=>{Q.init(e,n),ne(e._zod,"innerType",()=>n.getter()),ne(e._zod,"pattern",()=>{var r,o;return(o=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:o.pattern}),ne(e._zod,"propValues",()=>{var r,o;return(o=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:o.propValues}),ne(e._zod,"optin",()=>{var r,o;return((o=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:o.optin)??void 0}),ne(e._zod,"optout",()=>{var r,o;return((o=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:o.optout)??void 0}),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),lm=S("$ZodCustom",(e,n)=>{ke.init(e,n),Q.init(e,n),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,i=n.fn(o);if(i instanceof Promise)return i.then(a=>wc(a,r,o,e));wc(i,r,o,e)}});function wc(e,n,r,o){if(!e){let i={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(i.params=o._zod.def.params),n.issues.push(Zi(i))}}var Gs={};Mt(Gs,{zhTW:()=>rz,zhCN:()=>tz,yo:()=>oz,vi:()=>QI,uz:()=>KI,ur:()=>BI,uk:()=>dm,ua:()=>WI,tr:()=>HI,th:()=>qI,ta:()=>LI,sv:()=>RI,sl:()=>CI,ru:()=>jI,pt:()=>UI,ps:()=>PI,pl:()=>EI,ota:()=>zI,no:()=>SI,nl:()=>kI,ms:()=>$I,mk:()=>yI,lt:()=>vI,ko:()=>mI,km:()=>fm,kh:()=>hI,ka:()=>fI,ja:()=>lI,it:()=>sI,is:()=>oI,id:()=>rI,hy:()=>tI,hu:()=>QS,he:()=>KS,frCA:()=>BS,fr:()=>WS,fi:()=>HS,fa:()=>qS,es:()=>LS,eo:()=>RS,en:()=>cm,de:()=>ZS,da:()=>AS,cs:()=>NS,ca:()=>TS,bg:()=>OS,be:()=>IS,az:()=>xS,ar:()=>wS});var $S=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function n(i){return e[i]??null}let r={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},o={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${i.expected}، ولكن تم إدخال ${u}`:`مدخلات غير مقبولة: يفترض إدخال ${a}، ولكن تم إدخال ${u}`}case"invalid_value":return i.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${G(i.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?` أكبر من اللازم: يفترض أن تكون ${i.origin??"القيمة"} ${a} ${i.maximum.toString()} ${s.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${i.origin??"القيمة"} ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`أصغر من اللازم: يفترض لـ ${i.origin} أن يكون ${a} ${i.minimum.toString()} ${s.unit}`:`أصغر من اللازم: يفترض لـ ${i.origin} أن يكون ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${i.prefix}"`:a.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${a.suffix}"`:a.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${a.includes}"`:a.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${a.pattern}`:`${r[a.format]??i.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${i.divisor}`;case"unrecognized_keys":return`معرف${i.keys.length>1?"ات":""} غريب${i.keys.length>1?"ة":""}: ${N(i.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${i.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${i.origin}`;default:return"مدخل غير مقبول"}}};function wS(){return{localeError:$S()}}var kS=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function n(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",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"},o={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Yanlış dəyər: gözlənilən instanceof ${i.expected}, daxil olan ${u}`:`Yanlış dəyər: gözlənilən ${a}, daxil olan ${u}`}case"invalid_value":return i.values.length===1?`Yanlış dəyər: gözlənilən ${G(i.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Çox böyük: gözlənilən ${i.origin??"dəyər"} ${a}${i.maximum.toString()} ${s.unit??"element"}`:`Çox böyük: gözlənilən ${i.origin??"dəyər"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Çox kiçik: gözlənilən ${i.origin} ${a}${i.minimum.toString()} ${s.unit}`:`Çox kiçik: gözlənilən ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Yanlış mətn: "${a.prefix}" ilə başlamalıdır`:a.format==="ends_with"?`Yanlış mətn: "${a.suffix}" ilə bitməlidir`:a.format==="includes"?`Yanlış mətn: "${a.includes}" daxil olmalıdır`:a.format==="regex"?`Yanlış mətn: ${a.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${r[a.format]??i.format}`}case"not_multiple_of":return`Yanlış ədəd: ${i.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${i.keys.length>1?"lar":""}: ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${i.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function xS(){return{localeError:kS()}}function kc(e,n,r,o){let i=Math.abs(e),a=i%10,s=i%100;return s>=11&&s<=19?o:a===1?n:a>=2&&a<=4?r:o}var SS=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function n(i){return e[i]??null}let r={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},o={nan:"NaN",number:"лік",array:"масіў"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Няправільны ўвод: чакаўся instanceof ${i.expected}, атрымана ${u}`:`Няправільны ўвод: чакаўся ${a}, атрымана ${u}`}case"invalid_value":return i.values.length===1?`Няправільны ўвод: чакалася ${G(i.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);if(s){let u=Number(i.maximum),l=kc(u,s.unit.one,s.unit.few,s.unit.many);return`Занадта вялікі: чакалася, што ${i.origin??"значэнне"} павінна ${s.verb} ${a}${i.maximum.toString()} ${l}`}return`Занадта вялікі: чакалася, што ${i.origin??"значэнне"} павінна быць ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);if(s){let u=Number(i.minimum),l=kc(u,s.unit.one,s.unit.few,s.unit.many);return`Занадта малы: чакалася, што ${i.origin} павінна ${s.verb} ${a}${i.minimum.toString()} ${l}`}return`Занадта малы: чакалася, што ${i.origin} павінна быць ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${a.prefix}"`:a.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${a.suffix}"`:a.format==="includes"?`Няправільны радок: павінен змяшчаць "${a.includes}"`:a.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${a.pattern}`:`Няправільны ${r[a.format]??i.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${i.keys.length>1?"ключы":"ключ"}: ${N(i.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${i.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${i.origin}`;default:return"Няправільны ўвод"}}};function IS(){return{localeError:SS()}}var zS=()=>{let e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function n(i){return e[i]??null}let r={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},o={nan:"NaN",number:"число",array:"масив"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Невалиден вход: очакван instanceof ${i.expected}, получен ${u}`:`Невалиден вход: очакван ${a}, получен ${u}`}case"invalid_value":return i.values.length===1?`Невалиден вход: очакван ${G(i.values[0])}`:`Невалидна опция: очаквано едно от ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Твърде голямо: очаква се ${i.origin??"стойност"} да съдържа ${a}${i.maximum.toString()} ${s.unit??"елемента"}`:`Твърде голямо: очаква се ${i.origin??"стойност"} да бъде ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Твърде малко: очаква се ${i.origin} да съдържа ${a}${i.minimum.toString()} ${s.unit}`:`Твърде малко: очаква се ${i.origin} да бъде ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;if(a.format==="starts_with")return`Невалиден низ: трябва да започва с "${a.prefix}"`;if(a.format==="ends_with")return`Невалиден низ: трябва да завършва с "${a.suffix}"`;if(a.format==="includes")return`Невалиден низ: трябва да включва "${a.includes}"`;if(a.format==="regex")return`Невалиден низ: трябва да съвпада с ${a.pattern}`;let s="Невалиден";return a.format==="emoji"&&(s="Невалидно"),a.format==="datetime"&&(s="Невалидно"),a.format==="date"&&(s="Невалидна"),a.format==="time"&&(s="Невалидно"),a.format==="duration"&&(s="Невалидна"),`${s} ${r[a.format]??i.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${i.divisor}`;case"unrecognized_keys":return`Неразпознат${i.keys.length>1?"и":""} ключ${i.keys.length>1?"ове":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${i.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${i.origin}`;default:return"Невалиден вход"}}};function OS(){return{localeError:zS()}}var PS=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function n(i){return e[i]??null}let r={regex:"entrada",email:"adreça electrònica",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ça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Tipus invàlid: s'esperava instanceof ${i.expected}, s'ha rebut ${u}`:`Tipus invàlid: s'esperava ${a}, s'ha rebut ${u}`}case"invalid_value":return i.values.length===1?`Valor invàlid: s'esperava ${G(i.values[0])}`:`Opció invàlida: s'esperava una de ${N(i.values," o ")}`;case"too_big":{let a=i.inclusive?"com a màxim":"menys de",s=n(i.origin);return s?`Massa gran: s'esperava que ${i.origin??"el valor"} contingués ${a} ${i.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"com a mínim":"més de",s=n(i.origin);return s?`Massa petit: s'esperava que ${i.origin} contingués ${a} ${i.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Format invàlid: ha de començar amb "${a.prefix}"`:a.format==="ends_with"?`Format invàlid: ha d'acabar amb "${a.suffix}"`:a.format==="includes"?`Format invàlid: ha d'incloure "${a.includes}"`:a.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${a.pattern}`:`Format invàlid per a ${r[a.format]??i.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${i.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${i.origin}`;default:return"Entrada invàlida"}}};function TS(){return{localeError:PS()}}var ES=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function n(i){return e[i]??null}let r={regex:"regulární výraz",email:"e-mailová 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 čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Neplatný vstup: očekáváno instanceof ${i.expected}, obdrženo ${u}`:`Neplatný vstup: očekáváno ${a}, obdrženo ${u}`}case"invalid_value":return i.values.length===1?`Neplatný vstup: očekáváno ${G(i.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Hodnota je příliš velká: ${i.origin??"hodnota"} musí mít ${a}${i.maximum.toString()} ${s.unit??"prvků"}`:`Hodnota je příliš velká: ${i.origin??"hodnota"} musí být ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Hodnota je příliš malá: ${i.origin??"hodnota"} musí mít ${a}${i.minimum.toString()} ${s.unit??"prvků"}`:`Hodnota je příliš malá: ${i.origin??"hodnota"} musí být ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neplatný řetězec: musí začínat na "${a.prefix}"`:a.format==="ends_with"?`Neplatný řetězec: musí končit na "${a.suffix}"`:a.format==="includes"?`Neplatný řetězec: musí obsahovat "${a.includes}"`:a.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${a.pattern}`:`Neplatný formát ${r[a.format]??i.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${i.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${N(i.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${i.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${i.origin}`;default:return"Neplatný vstup"}}};function NS(){return{localeError:ES()}}var US=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function n(i){return e[i]??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æt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldigt input: forventede instanceof ${i.expected}, fik ${u}`:`Ugyldigt input: forventede ${a}, fik ${u}`}case"invalid_value":return i.values.length===1?`Ugyldig værdi: forventede ${G(i.values[0])}`:`Ugyldigt valg: forventede en af følgende ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin),u=o[i.origin]??i.origin;return s?`For stor: forventede ${u??"value"} ${s.verb} ${a} ${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${u??"value"} havde ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin),u=o[i.origin]??i.origin;return s?`For lille: forventede ${u} ${s.verb} ${a} ${i.minimum.toString()} ${s.unit}`:`For lille: forventede ${u} havde ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ugyldig streng: skal starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: skal ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: skal indeholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: skal matche mønsteret ${a.pattern}`:`Ugyldig ${r[a.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${N(i.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${i.origin}`;default:return"Ugyldigt input"}}};function AS(){return{localeError:US()}}var jS=()=>{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"}};function n(i){return e[i]??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",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Ungültige Eingabe: erwartet instanceof ${i.expected}, erhalten ${u}`:`Ungültige Eingabe: erwartet ${a}, erhalten ${u}`}case"invalid_value":return i.values.length===1?`Ungültige Eingabe: erwartet ${G(i.values[0])}`:`Ungültige Option: erwartet eine von ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Zu groß: erwartet, dass ${i.origin??"Wert"} ${a}${i.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${i.origin??"Wert"} ${a}${i.maximum.toString()} ist`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Zu klein: erwartet, dass ${i.origin} ${a}${i.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${a}${i.minimum.toString()} ist`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ungültiger String: muss mit "${a.prefix}" beginnen`:a.format==="ends_with"?`Ungültiger String: muss mit "${a.suffix}" enden`:a.format==="includes"?`Ungültiger String: muss "${a.includes}" enthalten`:a.format==="regex"?`Ungültiger String: muss dem Muster ${a.pattern} entsprechen`:`Ungültig: ${r[a.format]??i.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${N(i.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${i.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${i.origin}`;default:return"Ungültige Eingabe"}}};function ZS(){return{localeError:jS()}}var CS=()=>{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 n(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",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return`Invalid input: expected ${a}, received ${u}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${G(i.values[0])}`:`Invalid option: expected one of ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(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.inclusive?">=":">",s=n(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":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function cm(){return{localeError:CS()}}var DS=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function n(i){return e[i]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",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ŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-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",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Nevalida enigo: atendiĝis instanceof ${i.expected}, riceviĝis ${u}`:`Nevalida enigo: atendiĝis ${a}, riceviĝis ${u}`}case"invalid_value":return i.values.length===1?`Nevalida enigo: atendiĝis ${G(i.values[0])}`:`Nevalida opcio: atendiĝis unu el ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${a}${i.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Tro malgranda: atendiĝis ke ${i.origin} havu ${a}${i.minimum.toString()} ${s.unit}`:`Tro malgranda: atendiĝis ke ${i.origin} estu ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${a.prefix}"`:a.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${a.suffix}"`:a.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${a.includes}"`:a.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${a.pattern}`:`Nevalida ${r[a.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} ŝlosilo${i.keys.length>1?"j":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function RS(){return{localeError:DS()}}var MS=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function n(i){return e[i]??null}let r={regex:"entrada",email:"dirección de correo electrónico",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ón ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Entrada inválida: se esperaba instanceof ${i.expected}, recibido ${u}`:`Entrada inválida: se esperaba ${a}, recibido ${u}`}case"invalid_value":return i.values.length===1?`Entrada inválida: se esperaba ${G(i.values[0])}`:`Opción inválida: se esperaba una de ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin),u=o[i.origin]??i.origin;return s?`Demasiado grande: se esperaba que ${u??"valor"} tuviera ${a}${i.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${u??"valor"} fuera ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin),u=o[i.origin]??i.origin;return s?`Demasiado pequeño: se esperaba que ${u} tuviera ${a}${i.minimum.toString()} ${s.unit}`:`Demasiado pequeño: se esperaba que ${u} fuera ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cadena inválida: debe comenzar con "${a.prefix}"`:a.format==="ends_with"?`Cadena inválida: debe terminar en "${a.suffix}"`:a.format==="includes"?`Cadena inválida: debe incluir "${a.includes}"`:a.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${a.pattern}`:`Inválido ${r[a.format]??i.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Llave inválida en ${o[i.origin]??i.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${o[i.origin]??i.origin}`;default:return"Entrada inválida"}}};function LS(){return{localeError:MS()}}var FS=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function n(i){return e[i]??null}let r={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},o={nan:"NaN",number:"عدد",array:"آرایه"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`ورودی نامعتبر: می‌بایست instanceof ${i.expected} می‌بود، ${u} دریافت شد`:`ورودی نامعتبر: می‌بایست ${a} می‌بود، ${u} دریافت شد`}case"invalid_value":return i.values.length===1?`ورودی نامعتبر: می‌بایست ${G(i.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${N(i.values,"|")} می‌بود`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`خیلی بزرگ: ${i.origin??"مقدار"} باید ${a}${i.maximum.toString()} ${s.unit??"عنصر"} باشد`:`خیلی بزرگ: ${i.origin??"مقدار"} باید ${a}${i.maximum.toString()} باشد`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`خیلی کوچک: ${i.origin} باید ${a}${i.minimum.toString()} ${s.unit} باشد`:`خیلی کوچک: ${i.origin} باید ${a}${i.minimum.toString()} باشد`}case"invalid_format":{let a=i;return a.format==="starts_with"?`رشته نامعتبر: باید با "${a.prefix}" شروع شود`:a.format==="ends_with"?`رشته نامعتبر: باید با "${a.suffix}" تمام شود`:a.format==="includes"?`رشته نامعتبر: باید شامل "${a.includes}" باشد`:a.format==="regex"?`رشته نامعتبر: باید با الگوی ${a.pattern} مطابقت داشته باشد`:`${r[a.format]??i.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${i.divisor} باشد`;case"unrecognized_keys":return`کلید${i.keys.length>1?"های":""} ناشناس: ${N(i.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${i.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${i.origin}`;default:return"ورودی نامعتبر"}}};function qS(){return{localeError:FS()}}var JS=()=>{let e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function n(i){return e[i]??null}let r={regex:"säännöllinen lauseke",email:"sähköpostiosoite",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äivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${u}`:`Virheellinen tyyppi: odotettiin ${a}, oli ${u}`}case"invalid_value":return i.values.length===1?`Virheellinen syöte: täytyy olla ${G(i.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Liian suuri: ${s.subject} täytyy olla ${a}${i.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon täytyy olla ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Liian pieni: ${s.subject} täytyy olla ${a}${i.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon täytyy olla ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${a.prefix}"`:a.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${a.suffix}"`:a.format==="includes"?`Virheellinen syöte: täytyy sisältää "${a.includes}"`:a.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${a.pattern}`:`Virheellinen ${r[a.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${N(i.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öte"}}};function HS(){return{localeError:JS()}}var VS=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function n(i){return e[i]??null}let r={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},o={nan:"NaN",number:"nombre",array:"tableau"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Entrée invalide : instanceof ${i.expected} attendu, ${u} reçu`:`Entrée invalide : ${a} attendu, ${u} reçu`}case"invalid_value":return i.values.length===1?`Entrée invalide : ${G(i.values[0])} attendu`:`Option invalide : une valeur parmi ${N(i.values,"|")} attendue`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Trop grand : ${i.origin??"valeur"} doit ${s.verb} ${a}${i.maximum.toString()} ${s.unit??"élément(s)"}`:`Trop grand : ${i.origin??"valeur"} doit être ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Trop petit : ${i.origin} doit ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`Trop petit : ${i.origin} doit être ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Chaîne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Chaîne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Chaîne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${a.pattern}`:`${r[a.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${i.divisor}`;case"unrecognized_keys":return`Clé${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${N(i.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${i.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entrée invalide"}}};function WS(){return{localeError:VS()}}var GS=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function n(i){return e[i]??null}let r={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},o={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Entrée invalide : attendu instanceof ${i.expected}, reçu ${u}`:`Entrée invalide : attendu ${a}, reçu ${u}`}case"invalid_value":return i.values.length===1?`Entrée invalide : attendu ${G(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"≤":"<",s=n(i.origin);return s?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${a}${i.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"≥":">",s=n(i.origin);return s?`Trop petit : attendu que ${i.origin} ait ${a}${i.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${i.origin} soit ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Chaîne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Chaîne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Chaîne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Chaîne invalide : doit correspondre au motif ${a.pattern}`:`${r[a.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${i.divisor}`;case"unrecognized_keys":return`Clé${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${N(i.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${i.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entrée invalide"}}};function BS(){return{localeError:GS()}}var XS=()=>{let e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},n={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},r=c=>c?e[c]:void 0,o=c=>{let d=r(c);return d?d.label:c??e.unknown.label},i=c=>`ה${o(c)}`,a=c=>{var d;return(((d=r(c))==null?void 0:d.gender)??"m")==="f"?"צריכה להיות":"צריך להיות"},s=c=>c?n[c]??null:null,u={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",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:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},l={nan:"NaN"};return c=>{var d;switch(c.code){case"invalid_type":{let f=c.expected,h=l[f??""]??o(f),p=Y(c.input),m=l[p]??((d=e[p])==null?void 0:d.label)??p;return/^[A-Z]/.test(c.expected)?`קלט לא תקין: צריך להיות instanceof ${c.expected}, התקבל ${m}`:`קלט לא תקין: צריך להיות ${h}, התקבל ${m}`}case"invalid_value":{if(c.values.length===1)return`ערך לא תקין: הערך חייב להיות ${G(c.values[0])}`;let f=c.values.map(p=>G(p));if(c.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${f[0]} או ${f[1]}`;let h=f[f.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${f.slice(0,-1).join(", ")} או ${h}`}case"too_big":{let f=s(c.origin),h=i(c.origin??"value");if(c.origin==="string")return`${(f==null?void 0:f.longLabel)??"ארוך"} מדי: ${h} צריכה להכיל ${c.maximum.toString()} ${(f==null?void 0:f.unit)??""} ${c.inclusive?"או פחות":"לכל היותר"}`.trim();if(c.origin==="number"){let v=c.inclusive?`קטן או שווה ל-${c.maximum}`:`קטן מ-${c.maximum}`;return`גדול מדי: ${h} צריך להיות ${v}`}if(c.origin==="array"||c.origin==="set"){let v=c.origin==="set"?"צריכה":"צריך",y=c.inclusive?`${c.maximum} ${(f==null?void 0:f.unit)??""} או פחות`:`פחות מ-${c.maximum} ${(f==null?void 0:f.unit)??""}`;return`גדול מדי: ${h} ${v} להכיל ${y}`.trim()}let p=c.inclusive?"<=":"<",m=a(c.origin??"value");return f!=null&&f.unit?`${f.longLabel} מדי: ${h} ${m} ${p}${c.maximum.toString()} ${f.unit}`:`${(f==null?void 0:f.longLabel)??"גדול"} מדי: ${h} ${m} ${p}${c.maximum.toString()}`}case"too_small":{let f=s(c.origin),h=i(c.origin??"value");if(c.origin==="string")return`${(f==null?void 0:f.shortLabel)??"קצר"} מדי: ${h} צריכה להכיל ${c.minimum.toString()} ${(f==null?void 0:f.unit)??""} ${c.inclusive?"או יותר":"לפחות"}`.trim();if(c.origin==="number"){let v=c.inclusive?`גדול או שווה ל-${c.minimum}`:`גדול מ-${c.minimum}`;return`קטן מדי: ${h} צריך להיות ${v}`}if(c.origin==="array"||c.origin==="set"){let v=c.origin==="set"?"צריכה":"צריך";if(c.minimum===1&&c.inclusive){let g=(c.origin==="set","לפחות פריט אחד");return`קטן מדי: ${h} ${v} להכיל ${g}`}let y=c.inclusive?`${c.minimum} ${(f==null?void 0:f.unit)??""} או יותר`:`יותר מ-${c.minimum} ${(f==null?void 0:f.unit)??""}`;return`קטן מדי: ${h} ${v} להכיל ${y}`.trim()}let p=c.inclusive?">=":">",m=a(c.origin??"value");return f!=null&&f.unit?`${f.shortLabel} מדי: ${h} ${m} ${p}${c.minimum.toString()} ${f.unit}`:`${(f==null?void 0:f.shortLabel)??"קטן"} מדי: ${h} ${m} ${p}${c.minimum.toString()}`}case"invalid_format":{let f=c;if(f.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${f.prefix}"`;if(f.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${f.suffix}"`;if(f.format==="includes")return`המחרוזת חייבת לכלול "${f.includes}"`;if(f.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${f.pattern}`;let h=u[f.format],p=(h==null?void 0:h.label)??f.format,m=((h==null?void 0:h.gender)??"m")==="f"?"תקינה":"תקין";return`${p} לא ${m}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${c.divisor}`;case"unrecognized_keys":return`מפתח${c.keys.length>1?"ות":""} לא מזוה${c.keys.length>1?"ים":"ה"}: ${N(c.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${i(c.origin??"array")}`;default:return"קלט לא תקין"}}};function KS(){return{localeError:XS()}}var YS=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function n(i){return e[i]??null}let r={regex:"bemenet",email:"email cím",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őbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"szám",array:"tömb"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Érvénytelen bemenet: a várt érték instanceof ${i.expected}, a kapott érték ${u}`:`Érvénytelen bemenet: a várt érték ${a}, a kapott érték ${u}`}case"invalid_value":return i.values.length===1?`Érvénytelen bemenet: a várt érték ${G(i.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Túl nagy: ${i.origin??"érték"} mérete túl nagy ${a}${i.maximum.toString()} ${s.unit??"elem"}`:`Túl nagy: a bemeneti érték ${i.origin??"érték"} túl nagy: ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Túl kicsi: a bemeneti érték ${i.origin} mérete túl kicsi ${a}${i.minimum.toString()} ${s.unit}`:`Túl kicsi: a bemeneti érték ${i.origin} túl kicsi ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Érvénytelen string: "${a.prefix}" értékkel kell kezdődnie`:a.format==="ends_with"?`Érvénytelen string: "${a.suffix}" értékkel kell végződnie`:a.format==="includes"?`Érvénytelen string: "${a.includes}" értéket kell tartalmaznia`:a.format==="regex"?`Érvénytelen string: ${a.pattern} mintának kell megfelelnie`:`Érvénytelen ${r[a.format]??i.format}`}case"not_multiple_of":return`Érvénytelen szám: ${i.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${i.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${i.origin}`;default:return"Érvénytelen bemenet"}}};function QS(){return{localeError:YS()}}function xc(e,n,r){return Math.abs(e)===1?n:r}function bn(e){if(!e)return"";let n=["ա","ե","ը","ի","ո","ու","օ"],r=e[e.length-1];return e+(n.includes(r)?"ն":"ը")}var eI=()=>{let e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function n(i){return e[i]??null}let r={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},o={nan:"NaN",number:"թիվ",array:"զանգված"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${i.expected}, ստացվել է ${u}`:`Սխալ մուտքագրում․ սպասվում էր ${a}, ստացվել է ${u}`}case"invalid_value":return i.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${G(i.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);if(s){let u=Number(i.maximum),l=xc(u,s.unit.one,s.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${bn(i.origin??"արժեք")} կունենա ${a}${i.maximum.toString()} ${l}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${bn(i.origin??"արժեք")} լինի ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);if(s){let u=Number(i.minimum),l=xc(u,s.unit.one,s.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${bn(i.origin)} կունենա ${a}${i.minimum.toString()} ${l}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${bn(i.origin)} լինի ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Սխալ տող․ պետք է սկսվի "${a.prefix}"-ով`:a.format==="ends_with"?`Սխալ տող․ պետք է ավարտվի "${a.suffix}"-ով`:a.format==="includes"?`Սխալ տող․ պետք է պարունակի "${a.includes}"`:a.format==="regex"?`Սխալ տող․ պետք է համապատասխանի ${a.pattern} ձևաչափին`:`Սխալ ${r[a.format]??i.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${i.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${i.keys.length>1?"ներ":""}. ${N(i.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${bn(i.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${bn(i.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function tI(){return{localeError:eI()}}var nI=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function n(i){return e[i]??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",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",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${u}`:`Input tidak valid: diharapkan ${a}, diterima ${u}`}case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${G(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${a}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Terlalu kecil: diharapkan ${i.origin} memiliki ${a}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`String tidak valid: harus dimulai dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak valid: harus berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak valid: harus menyertakan "${a.includes}"`:a.format==="regex"?`String tidak valid: harus sesuai pola ${a.pattern}`:`${r[a.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}};function rI(){return{localeError:nI()}}var iI=()=>{let e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function n(i){return e[i]??null}let r={regex:"gildi",email:"netfang",url:"vefslóð",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ími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"númer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Rangt gildi: Þú slóst inn ${u} þar sem á að vera instanceof ${i.expected}`:`Rangt gildi: Þú slóst inn ${u} þar sem á að vera ${a}`}case"invalid_value":return i.values.length===1?`Rangt gildi: gert ráð fyrir ${G(i.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Of stórt: gert er ráð fyrir að ${i.origin??"gildi"} hafi ${a}${i.maximum.toString()} ${s.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${i.origin??"gildi"} sé ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Of lítið: gert er ráð fyrir að ${i.origin} hafi ${a}${i.minimum.toString()} ${s.unit}`:`Of lítið: gert er ráð fyrir að ${i.origin} sé ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ógildur strengur: verður að byrja á "${a.prefix}"`:a.format==="ends_with"?`Ógildur strengur: verður að enda á "${a.suffix}"`:a.format==="includes"?`Ógildur strengur: verður að innihalda "${a.includes}"`:a.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${a.pattern}`:`Rangt ${r[a.format]??i.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`Óþekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${N(i.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${i.origin}`;default:return"Rangt gildi"}}};function oI(){return{localeError:iI()}}var aI=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function n(i){return e[i]??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",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Input non valido: atteso instanceof ${i.expected}, ricevuto ${u}`:`Input non valido: atteso ${a}, ricevuto ${u}`}case"invalid_value":return i.values.length===1?`Input non valido: atteso ${G(i.values[0])}`:`Opzione non valida: atteso uno tra ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Troppo grande: ${i.origin??"valore"} deve avere ${a}${i.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Troppo piccolo: ${i.origin} deve avere ${a}${i.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${i.origin} deve essere ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Stringa non valida: deve iniziare con "${a.prefix}"`:a.format==="ends_with"?`Stringa non valida: deve terminare con "${a.suffix}"`:a.format==="includes"?`Stringa non valida: deve includere "${a.includes}"`:a.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${a.pattern}`:`Invalid ${r[a.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${N(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}};function sI(){return{localeError:aI()}}var uI=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function n(i){return e[i]??null}let r={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},o={nan:"NaN",number:"数値",array:"配列"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`無効な入力: instanceof ${i.expected}が期待されましたが、${u}が入力されました`:`無効な入力: ${a}が期待されましたが、${u}が入力されました`}case"invalid_value":return i.values.length===1?`無効な入力: ${G(i.values[0])}が期待されました`:`無効な選択: ${N(i.values,"、")}のいずれかである必要があります`;case"too_big":{let a=i.inclusive?"以下である":"より小さい",s=n(i.origin);return s?`大きすぎる値: ${i.origin??"値"}は${i.maximum.toString()}${s.unit??"要素"}${a}必要があります`:`大きすぎる値: ${i.origin??"値"}は${i.maximum.toString()}${a}必要があります`}case"too_small":{let a=i.inclusive?"以上である":"より大きい",s=n(i.origin);return s?`小さすぎる値: ${i.origin}は${i.minimum.toString()}${s.unit}${a}必要があります`:`小さすぎる値: ${i.origin}は${i.minimum.toString()}${a}必要があります`}case"invalid_format":{let a=i;return a.format==="starts_with"?`無効な文字列: "${a.prefix}"で始まる必要があります`:a.format==="ends_with"?`無効な文字列: "${a.suffix}"で終わる必要があります`:a.format==="includes"?`無効な文字列: "${a.includes}"を含む必要があります`:a.format==="regex"?`無効な文字列: パターン${a.pattern}に一致する必要があります`:`無効な${r[a.format]??i.format}`}case"not_multiple_of":return`無効な数値: ${i.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${i.keys.length>1?"群":""}: ${N(i.keys,"、")}`;case"invalid_key":return`${i.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${i.origin}内の無効な値`;default:return"無効な入力"}}};function lI(){return{localeError:uI()}}var cI=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function n(i){return e[i]??null}let r={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},o={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${i.expected}, მიღებული ${u}`:`არასწორი შეყვანა: მოსალოდნელი ${a}, მიღებული ${u}`}case"invalid_value":return i.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${G(i.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${N(i.values,"|")}-დან`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`ზედმეტად დიდი: მოსალოდნელი ${i.origin??"მნიშვნელობა"} ${s.verb} ${a}${i.maximum.toString()} ${s.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${i.origin??"მნიშვნელობა"} იყოს ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`ზედმეტად პატარა: მოსალოდნელი ${i.origin} ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${i.origin} იყოს ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`არასწორი სტრინგი: უნდა იწყებოდეს "${a.prefix}"-ით`:a.format==="ends_with"?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${a.suffix}"-ით`:a.format==="includes"?`არასწორი სტრინგი: უნდა შეიცავდეს "${a.includes}"-ს`:a.format==="regex"?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${a.pattern}`:`არასწორი ${r[a.format]??i.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${i.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${i.keys.length>1?"ები":"ი"}: ${N(i.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${i.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${i.origin}-ში`;default:return"არასწორი შეყვანა"}}};function fI(){return{localeError:cI()}}var dI=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function n(i){return e[i]??null}let r={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},o={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${i.expected} ប៉ុន្តែទទួលបាន ${u}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${a} ប៉ុន្តែទទួលបាន ${u}`}case"invalid_value":return i.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${G(i.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`ធំពេក៖ ត្រូវការ ${i.origin??"តម្លៃ"} ${a} ${i.maximum.toString()} ${s.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${i.origin??"តម្លៃ"} ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`តូចពេក៖ ត្រូវការ ${i.origin} ${a} ${i.minimum.toString()} ${s.unit}`:`តូចពេក៖ ត្រូវការ ${i.origin} ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${a.prefix}"`:a.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${a.suffix}"`:a.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${a.includes}"`:a.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${a.pattern}`:`មិនត្រឹមត្រូវ៖ ${r[a.format]??i.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${i.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${N(i.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function fm(){return{localeError:dI()}}function hI(){return fm()}var pI=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function n(i){return e[i]??null}let r={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},o={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`잘못된 입력: 예상 타입은 instanceof ${i.expected}, 받은 타입은 ${u}입니다`:`잘못된 입력: 예상 타입은 ${a}, 받은 타입은 ${u}입니다`}case"invalid_value":return i.values.length===1?`잘못된 입력: 값은 ${G(i.values[0])} 이어야 합니다`:`잘못된 옵션: ${N(i.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let a=i.inclusive?"이하":"미만",s=a==="미만"?"이어야 합니다":"여야 합니다",u=n(i.origin),l=(u==null?void 0:u.unit)??"요소";return u?`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()}${l} ${a}${s}`:`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()} ${a}${s}`}case"too_small":{let a=i.inclusive?"이상":"초과",s=a==="이상"?"이어야 합니다":"여야 합니다",u=n(i.origin),l=(u==null?void 0:u.unit)??"요소";return u?`${i.origin??"값"}이 너무 작습니다: ${i.minimum.toString()}${l} ${a}${s}`:`${i.origin??"값"}이 너무 작습니다: ${i.minimum.toString()} ${a}${s}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`잘못된 문자열: "${a.prefix}"(으)로 시작해야 합니다`:a.format==="ends_with"?`잘못된 문자열: "${a.suffix}"(으)로 끝나야 합니다`:a.format==="includes"?`잘못된 문자열: "${a.includes}"을(를) 포함해야 합니다`:a.format==="regex"?`잘못된 문자열: 정규식 ${a.pattern} 패턴과 일치해야 합니다`:`잘못된 ${r[a.format]??i.format}`}case"not_multiple_of":return`잘못된 숫자: ${i.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${N(i.keys,", ")}`;case"invalid_key":return`잘못된 키: ${i.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${i.origin}`;default:return"잘못된 입력"}}};function mI(){return{localeError:pI()}}var Hn=e=>e.charAt(0).toUpperCase()+e.slice(1);function Sc(e){let n=Math.abs(e),r=n%10,o=n%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}var gI=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function n(i,a,s,u){let l=e[i]??null;return l===null?l:{unit:l.unit[a],verb:l.verb[u][s?"inclusive":"notInclusive"]}}let r={regex:"įvestis",email:"el. pašto 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ė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},o={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Gautas tipas ${u}, o tikėtasi - instanceof ${i.expected}`:`Gautas tipas ${u}, o tikėtasi - ${a}`}case"invalid_value":return i.values.length===1?`Privalo būti ${G(i.values[0])}`:`Privalo būti vienas iš ${N(i.values,"|")} pasirinkimų`;case"too_big":{let a=o[i.origin]??i.origin,s=n(i.origin,Sc(Number(i.maximum)),i.inclusive??!1,"smaller");if(s!=null&&s.verb)return`${Hn(a??i.origin??"reikšmė")} ${s.verb} ${i.maximum.toString()} ${s.unit??"elementų"}`;let u=i.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Hn(a??i.origin??"reikšmė")} turi būti ${u} ${i.maximum.toString()} ${s==null?void 0:s.unit}`}case"too_small":{let a=o[i.origin]??i.origin,s=n(i.origin,Sc(Number(i.minimum)),i.inclusive??!1,"bigger");if(s!=null&&s.verb)return`${Hn(a??i.origin??"reikšmė")} ${s.verb} ${i.minimum.toString()} ${s.unit??"elementų"}`;let u=i.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Hn(a??i.origin??"reikšmė")} turi būti ${u} ${i.minimum.toString()} ${s==null?void 0:s.unit}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Eilutė privalo prasidėti "${a.prefix}"`:a.format==="ends_with"?`Eilutė privalo pasibaigti "${a.suffix}"`:a.format==="includes"?`Eilutė privalo įtraukti "${a.includes}"`:a.format==="regex"?`Eilutė privalo atitikti ${a.pattern}`:`Neteisingas ${r[a.format]??i.format}`}case"not_multiple_of":return`Skaičius privalo būti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${N(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let a=o[i.origin]??i.origin;return`${Hn(a??i.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function vI(){return{localeError:gI()}}var _I=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function n(i){return e[i]??null}let r={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},o={nan:"NaN",number:"број",array:"низа"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Грешен внес: се очекува instanceof ${i.expected}, примено ${u}`:`Грешен внес: се очекува ${a}, примено ${u}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${G(i.values[0])}`:`Грешана опција: се очекува една ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Премногу голем: се очекува ${i.origin??"вредноста"} да има ${a}${i.maximum.toString()} ${s.unit??"елементи"}`:`Премногу голем: се очекува ${i.origin??"вредноста"} да биде ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Премногу мал: се очекува ${i.origin} да има ${a}${i.minimum.toString()} ${s.unit}`:`Премногу мал: се очекува ${i.origin} да биде ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Неважечка низа: мора да започнува со "${a.prefix}"`:a.format==="ends_with"?`Неважечка низа: мора да завршува со "${a.suffix}"`:a.format==="includes"?`Неважечка низа: мора да вклучува "${a.includes}"`:a.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${a.pattern}`:`Invalid ${r[a.format]??i.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${N(i.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${i.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${i.origin}`;default:return"Грешен внес"}}};function yI(){return{localeError:_I()}}var bI=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function n(i){return e[i]??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",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${u}`:`Input tidak sah: dijangka ${a}, diterima ${u}`}case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${G(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Terlalu besar: dijangka ${i.origin??"nilai"} ${s.verb} ${a}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Terlalu kecil: dijangka ${i.origin} ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`String tidak sah: mesti bermula dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak sah: mesti mengandungi "${a.includes}"`:a.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${a.pattern}`:`${r[a.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${N(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}};function $I(){return{localeError:bI()}}var wI=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function n(i){return e[i]??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",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${u}`:`Ongeldige invoer: verwacht ${a}, ontving ${u}`}case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${G(i.values[0])}`:`Ongeldige optie: verwacht één van ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin),u=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return s?`Te ${u}: verwacht dat ${i.origin??"waarde"} ${a}${i.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${u}: verwacht dat ${i.origin??"waarde"} ${a}${i.maximum.toString()} is`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin),u=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return s?`Te ${u}: verwacht dat ${i.origin} ${a}${i.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${u}: verwacht dat ${i.origin} ${a}${i.minimum.toString()} is`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ongeldige tekst: moet met "${a.prefix}" beginnen`:a.format==="ends_with"?`Ongeldige tekst: moet op "${a.suffix}" eindigen`:a.format==="includes"?`Ongeldige tekst: moet "${a.includes}" bevatten`:a.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${a.pattern}`:`Ongeldig: ${r[a.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};function kI(){return{localeError:wI()}}var xI=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function n(i){return e[i]??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-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventet instanceof ${i.expected}, fikk ${u}`:`Ugyldig input: forventet ${a}, fikk ${u}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${G(i.values[0])}`:`Ugyldig valg: forventet en av ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`For stor(t): forventet ${i.origin??"value"} til å ha ${a}${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til å ha ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`For lite(n): forventet ${i.origin} til å ha ${a}${i.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${i.origin} til å ha ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ugyldig streng: må starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: må ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: må inneholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: må matche mønsteret ${a.pattern}`:`Ugyldig ${r[a.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${N(i.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};function SI(){return{localeError:xI()}}var II=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function n(i){return e[i]??null}let r={regex:"giren",email:"epostagâh",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âmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Fâsit giren: umulan instanceof ${i.expected}, alınan ${u}`:`Fâsit giren: umulan ${a}, alınan ${u}`}case"invalid_value":return i.values.length===1?`Fâsit giren: umulan ${G(i.values[0])}`:`Fâsit tercih: mûteberler ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Fazla büyük: ${i.origin??"value"}, ${a}${i.maximum.toString()} ${s.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${i.origin??"value"}, ${a}${i.maximum.toString()} olmalıydı.`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Fazla küçük: ${i.origin}, ${a}${i.minimum.toString()} ${s.unit} sahip olmalıydı.`:`Fazla küçük: ${i.origin}, ${a}${i.minimum.toString()} olmalıydı.`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Fâsit metin: "${a.prefix}" ile başlamalı.`:a.format==="ends_with"?`Fâsit metin: "${a.suffix}" ile bitmeli.`:a.format==="includes"?`Fâsit metin: "${a.includes}" ihtivâ etmeli.`:a.format==="regex"?`Fâsit metin: ${a.pattern} nakşına uymalı.`:`Fâsit ${r[a.format]??i.format}`}case"not_multiple_of":return`Fâsit sayı: ${i.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${i.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function zI(){return{localeError:II()}}var OI=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function n(i){return e[i]??null}let r={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},o={nan:"NaN",number:"عدد",array:"ارې"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`ناسم ورودي: باید instanceof ${i.expected} وای, مګر ${u} ترلاسه شو`:`ناسم ورودي: باید ${a} وای, مګر ${u} ترلاسه شو`}case"invalid_value":return i.values.length===1?`ناسم ورودي: باید ${G(i.values[0])} وای`:`ناسم انتخاب: باید یو له ${N(i.values,"|")} څخه وای`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`ډیر لوی: ${i.origin??"ارزښت"} باید ${a}${i.maximum.toString()} ${s.unit??"عنصرونه"} ولري`:`ډیر لوی: ${i.origin??"ارزښت"} باید ${a}${i.maximum.toString()} وي`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`ډیر کوچنی: ${i.origin} باید ${a}${i.minimum.toString()} ${s.unit} ولري`:`ډیر کوچنی: ${i.origin} باید ${a}${i.minimum.toString()} وي`}case"invalid_format":{let a=i;return a.format==="starts_with"?`ناسم متن: باید د "${a.prefix}" سره پیل شي`:a.format==="ends_with"?`ناسم متن: باید د "${a.suffix}" سره پای ته ورسيږي`:a.format==="includes"?`ناسم متن: باید "${a.includes}" ولري`:a.format==="regex"?`ناسم متن: باید د ${a.pattern} سره مطابقت ولري`:`${r[a.format]??i.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${i.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${i.keys.length>1?"کلیډونه":"کلیډ"}: ${N(i.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${i.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${i.origin} کې`;default:return"ناسمه ورودي"}}};function PI(){return{localeError:OI()}}var TI=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function n(i){return e[i]??null}let r={regex:"wyrażenie",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",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},o={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${i.expected}, otrzymano ${u}`:`Nieprawidłowe dane wejściowe: oczekiwano ${a}, otrzymano ${u}`}case"invalid_value":return i.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${G(i.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Za duża wartość: oczekiwano, że ${i.origin??"wartość"} będzie mieć ${a}${i.maximum.toString()} ${s.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${i.origin??"wartość"} będzie wynosić ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Za mała wartość: oczekiwano, że ${i.origin??"wartość"} będzie mieć ${a}${i.minimum.toString()} ${s.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${i.origin??"wartość"} będzie wynosić ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${a.prefix}"`:a.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${a.suffix}"`:a.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${a.includes}"`:a.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${a.pattern}`:`Nieprawidłow(y/a/e) ${r[a.format]??i.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${i.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${i.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function EI(){return{localeError:TI()}}var NI=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function n(i){return e[i]??null}let r={regex:"padrão",email:"endereço de 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:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"número",null:"nulo"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Tipo inválido: esperado instanceof ${i.expected}, recebido ${u}`:`Tipo inválido: esperado ${a}, recebido ${u}`}case"invalid_value":return i.values.length===1?`Entrada inválida: esperado ${G(i.values[0])}`:`Opção inválida: esperada uma das ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${a}${i.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Muito pequeno: esperado que ${i.origin} tivesse ${a}${i.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Texto inválido: deve começar com "${a.prefix}"`:a.format==="ends_with"?`Texto inválido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inválido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inválido: deve corresponder ao padrão ${a.pattern}`:`${r[a.format]??i.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Chave inválida em ${i.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${i.origin}`;default:return"Campo inválido"}}};function UI(){return{localeError:NI()}}function Ic(e,n,r,o){let i=Math.abs(e),a=i%10,s=i%100;return s>=11&&s<=19?o:a===1?n:a>=2&&a<=4?r:o}var AI=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function n(i){return e[i]??null}let r={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},o={nan:"NaN",number:"число",array:"массив"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Неверный ввод: ожидалось instanceof ${i.expected}, получено ${u}`:`Неверный ввод: ожидалось ${a}, получено ${u}`}case"invalid_value":return i.values.length===1?`Неверный ввод: ожидалось ${G(i.values[0])}`:`Неверный вариант: ожидалось одно из ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);if(s){let u=Number(i.maximum),l=Ic(u,s.unit.one,s.unit.few,s.unit.many);return`Слишком большое значение: ожидалось, что ${i.origin??"значение"} будет иметь ${a}${i.maximum.toString()} ${l}`}return`Слишком большое значение: ожидалось, что ${i.origin??"значение"} будет ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);if(s){let u=Number(i.minimum),l=Ic(u,s.unit.one,s.unit.few,s.unit.many);return`Слишком маленькое значение: ожидалось, что ${i.origin} будет иметь ${a}${i.minimum.toString()} ${l}`}return`Слишком маленькое значение: ожидалось, что ${i.origin} будет ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Неверная строка: должна начинаться с "${a.prefix}"`:a.format==="ends_with"?`Неверная строка: должна заканчиваться на "${a.suffix}"`:a.format==="includes"?`Неверная строка: должна содержать "${a.includes}"`:a.format==="regex"?`Неверная строка: должна соответствовать шаблону ${a.pattern}`:`Неверный ${r[a.format]??i.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспознанн${i.keys.length>1?"ые":"ый"} ключ${i.keys.length>1?"и":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${i.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${i.origin}`;default:return"Неверные входные данные"}}};function jI(){return{localeError:AI()}}var ZI=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function n(i){return e[i]??null}let r={regex:"vnos",email:"e-poštni 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 čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"število",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Neveljaven vnos: pričakovano instanceof ${i.expected}, prejeto ${u}`:`Neveljaven vnos: pričakovano ${a}, prejeto ${u}`}case"invalid_value":return i.values.length===1?`Neveljaven vnos: pričakovano ${G(i.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Preveliko: pričakovano, da bo ${i.origin??"vrednost"} imelo ${a}${i.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${i.origin??"vrednost"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Premajhno: pričakovano, da bo ${i.origin} imelo ${a}${i.minimum.toString()} ${s.unit}`:`Premajhno: pričakovano, da bo ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neveljaven niz: mora se začeti z "${a.prefix}"`:a.format==="ends_with"?`Neveljaven niz: mora se končati z "${a.suffix}"`:a.format==="includes"?`Neveljaven niz: mora vsebovati "${a.includes}"`:a.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${a.pattern}`:`Neveljaven ${r[a.format]??i.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i ključi":" ključ"}: ${N(i.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}};function CI(){return{localeError:ZI()}}var DI=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function n(i){return e[i]??null}let r={regex:"reguljärt 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-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Ogiltig inmatning: förväntat instanceof ${i.expected}, fick ${u}`:`Ogiltig inmatning: förväntat ${a}, fick ${u}`}case"invalid_value":return i.values.length===1?`Ogiltig inmatning: förväntat ${G(i.values[0])}`:`Ogiltigt val: förväntade en av ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`För stor(t): förväntade ${i.origin??"värdet"} att ha ${a}${i.maximum.toString()} ${s.unit??"element"}`:`För stor(t): förväntat ${i.origin??"värdet"} att ha ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`För lite(t): förväntade ${i.origin??"värdet"} att ha ${a}${i.minimum.toString()} ${s.unit}`:`För lite(t): förväntade ${i.origin??"värdet"} att ha ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ogiltig sträng: måste börja med "${a.prefix}"`:a.format==="ends_with"?`Ogiltig sträng: måste sluta med "${a.suffix}"`:a.format==="includes"?`Ogiltig sträng: måste innehålla "${a.includes}"`:a.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${a.pattern}"`:`Ogiltig(t) ${r[a.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${N(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${i.origin??"värdet"}`;default:return"Ogiltig input"}}};function RI(){return{localeError:DI()}}var MI=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function n(i){return e[i]??null}let r={regex:"உள்ளீடு",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 தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${i.expected}, பெறப்பட்டது ${u}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${a}, பெறப்பட்டது ${u}`}case"invalid_value":return i.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${G(i.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${N(i.values,"|")} இல் ஒன்று`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${i.origin??"மதிப்பு"} ${a}${i.maximum.toString()} ${s.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${i.origin??"மதிப்பு"} ${a}${i.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${i.origin} ${a}${i.minimum.toString()} ${s.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${i.origin} ${a}${i.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let a=i;return a.format==="starts_with"?`தவறான சரம்: "${a.prefix}" இல் தொடங்க வேண்டும்`:a.format==="ends_with"?`தவறான சரம்: "${a.suffix}" இல் முடிவடைய வேண்டும்`:a.format==="includes"?`தவறான சரம்: "${a.includes}" ஐ உள்ளடக்க வேண்டும்`:a.format==="regex"?`தவறான சரம்: ${a.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${r[a.format]??i.format}`}case"not_multiple_of":return`தவறான எண்: ${i.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${i.keys.length>1?"கள்":""}: ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${i.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function LI(){return{localeError:MI()}}var FI=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function n(i){return e[i]??null}let r={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},o={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${i.expected} แต่ได้รับ ${u}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${a} แต่ได้รับ ${u}`}case"invalid_value":return i.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${G(i.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"ไม่เกิน":"น้อยกว่า",s=n(i.origin);return s?`เกินกำหนด: ${i.origin??"ค่า"} ควรมี${a} ${i.maximum.toString()} ${s.unit??"รายการ"}`:`เกินกำหนด: ${i.origin??"ค่า"} ควรมี${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"อย่างน้อย":"มากกว่า",s=n(i.origin);return s?`น้อยกว่ากำหนด: ${i.origin} ควรมี${a} ${i.minimum.toString()} ${s.unit}`:`น้อยกว่ากำหนด: ${i.origin} ควรมี${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${a.prefix}"`:a.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${a.suffix}"`:a.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${a.includes}" อยู่ในข้อความ`:a.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${a.pattern}`:`รูปแบบไม่ถูกต้อง: ${r[a.format]??i.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${i.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${N(i.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${i.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${i.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function qI(){return{localeError:FI()}}var JI=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function n(i){return e[i]??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üre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},o={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Geçersiz değer: beklenen instanceof ${i.expected}, alınan ${u}`:`Geçersiz değer: beklenen ${a}, alınan ${u}`}case"invalid_value":return i.values.length===1?`Geçersiz değer: beklenen ${G(i.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Çok büyük: beklenen ${i.origin??"değer"} ${a}${i.maximum.toString()} ${s.unit??"öğe"}`:`Çok büyük: beklenen ${i.origin??"değer"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Çok küçük: beklenen ${i.origin} ${a}${i.minimum.toString()} ${s.unit}`:`Çok küçük: beklenen ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Geçersiz metin: "${a.prefix}" ile başlamalı`:a.format==="ends_with"?`Geçersiz metin: "${a.suffix}" ile bitmeli`:a.format==="includes"?`Geçersiz metin: "${a.includes}" içermeli`:a.format==="regex"?`Geçersiz metin: ${a.pattern} desenine uymalı`:`Geçersiz ${r[a.format]??i.format}`}case"not_multiple_of":return`Geçersiz sayı: ${i.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${i.keys.length>1?"lar":""}: ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${i.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function HI(){return{localeError:JI()}}var VI=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function n(i){return e[i]??null}let r={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},o={nan:"NaN",number:"число",array:"масив"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Неправильні вхідні дані: очікується instanceof ${i.expected}, отримано ${u}`:`Неправильні вхідні дані: очікується ${a}, отримано ${u}`}case"invalid_value":return i.values.length===1?`Неправильні вхідні дані: очікується ${G(i.values[0])}`:`Неправильна опція: очікується одне з ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Занадто велике: очікується, що ${i.origin??"значення"} ${s.verb} ${a}${i.maximum.toString()} ${s.unit??"елементів"}`:`Занадто велике: очікується, що ${i.origin??"значення"} буде ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Занадто мале: очікується, що ${i.origin} ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`Занадто мале: очікується, що ${i.origin} буде ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Неправильний рядок: повинен починатися з "${a.prefix}"`:a.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${a.suffix}"`:a.format==="includes"?`Неправильний рядок: повинен містити "${a.includes}"`:a.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${a.pattern}`:`Неправильний ${r[a.format]??i.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${i.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${i.keys.length>1?"і":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${i.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${i.origin}`;default:return"Неправильні вхідні дані"}}};function dm(){return{localeError:VI()}}function WI(){return dm()}var GI=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function n(i){return e[i]??null}let r={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},o={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`غلط ان پٹ: instanceof ${i.expected} متوقع تھا، ${u} موصول ہوا`:`غلط ان پٹ: ${a} متوقع تھا، ${u} موصول ہوا`}case"invalid_value":return i.values.length===1?`غلط ان پٹ: ${G(i.values[0])} متوقع تھا`:`غلط آپشن: ${N(i.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`بہت بڑا: ${i.origin??"ویلیو"} کے ${a}${i.maximum.toString()} ${s.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${i.origin??"ویلیو"} کا ${a}${i.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`بہت چھوٹا: ${i.origin} کے ${a}${i.minimum.toString()} ${s.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${i.origin} کا ${a}${i.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let a=i;return a.format==="starts_with"?`غلط سٹرنگ: "${a.prefix}" سے شروع ہونا چاہیے`:a.format==="ends_with"?`غلط سٹرنگ: "${a.suffix}" پر ختم ہونا چاہیے`:a.format==="includes"?`غلط سٹرنگ: "${a.includes}" شامل ہونا چاہیے`:a.format==="regex"?`غلط سٹرنگ: پیٹرن ${a.pattern} سے میچ ہونا چاہیے`:`غلط ${r[a.format]??i.format}`}case"not_multiple_of":return`غلط نمبر: ${i.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${i.keys.length>1?"ز":""}: ${N(i.keys,"، ")}`;case"invalid_key":return`${i.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${i.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function BI(){return{localeError:GI()}}var XI=()=>{let e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function n(i){return e[i]??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",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${u}`:`Noto‘g‘ri kirish: kutilgan ${a}, qabul qilingan ${u}`}case"invalid_value":return i.values.length===1?`Noto‘g‘ri kirish: kutilgan ${G(i.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Juda katta: kutilgan ${i.origin??"qiymat"} ${a}${i.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${i.origin??"qiymat"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Juda kichik: kutilgan ${i.origin} ${a}${i.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Noto‘g‘ri satr: "${a.prefix}" bilan boshlanishi kerak`:a.format==="ends_with"?`Noto‘g‘ri satr: "${a.suffix}" bilan tugashi kerak`:a.format==="includes"?`Noto‘g‘ri satr: "${a.includes}" ni o‘z ichiga olishi kerak`:a.format==="regex"?`Noto‘g‘ri satr: ${a.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${r[a.format]??i.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${i.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${i.keys.length>1?"lar":""}: ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${i.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function KI(){return{localeError:XI()}}var YI=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function n(i){return e[i]??null}let r={regex:"đầu vào",email:"địa chỉ 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ày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},o={nan:"NaN",number:"số",array:"mảng"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${i.expected}, nhận được ${u}`:`Đầu vào không hợp lệ: mong đợi ${a}, nhận được ${u}`}case"invalid_value":return i.values.length===1?`Đầu vào không hợp lệ: mong đợi ${G(i.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Quá lớn: mong đợi ${i.origin??"giá trị"} ${s.verb} ${a}${i.maximum.toString()} ${s.unit??"phần tử"}`:`Quá lớn: mong đợi ${i.origin??"giá trị"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Quá nhỏ: mong đợi ${i.origin} ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`Quá nhỏ: mong đợi ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${a.prefix}"`:a.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${a.suffix}"`:a.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${a.includes}"`:a.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${a.pattern}`:`${r[a.format]??i.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${i.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${N(i.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${i.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${i.origin}`;default:return"Đầu vào không hợp lệ"}}};function QI(){return{localeError:YI()}}var ez=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function n(i){return e[i]??null}let r={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},o={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`无效输入:期望 instanceof ${i.expected},实际接收 ${u}`:`无效输入:期望 ${a},实际接收 ${u}`}case"invalid_value":return i.values.length===1?`无效输入:期望 ${G(i.values[0])}`:`无效选项:期望以下之一 ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`数值过大:期望 ${i.origin??"值"} ${a}${i.maximum.toString()} ${s.unit??"个元素"}`:`数值过大:期望 ${i.origin??"值"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`数值过小:期望 ${i.origin} ${a}${i.minimum.toString()} ${s.unit}`:`数值过小:期望 ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`无效字符串:必须以 "${a.prefix}" 开头`:a.format==="ends_with"?`无效字符串:必须以 "${a.suffix}" 结尾`:a.format==="includes"?`无效字符串:必须包含 "${a.includes}"`:a.format==="regex"?`无效字符串:必须满足正则表达式 ${a.pattern}`:`无效${r[a.format]??i.format}`}case"not_multiple_of":return`无效数字:必须是 ${i.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${i.origin} 中包含无效值(value)`;default:return"无效输入"}}};function tz(){return{localeError:ez()}}var nz=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function n(i){return e[i]??null}let r={regex:"輸入",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 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},o={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`無效的輸入值:預期為 instanceof ${i.expected},但收到 ${u}`:`無效的輸入值:預期為 ${a},但收到 ${u}`}case"invalid_value":return i.values.length===1?`無效的輸入值:預期為 ${G(i.values[0])}`:`無效的選項:預期為以下其中之一 ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`數值過大:預期 ${i.origin??"值"} 應為 ${a}${i.maximum.toString()} ${s.unit??"個元素"}`:`數值過大:預期 ${i.origin??"值"} 應為 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`數值過小:預期 ${i.origin} 應為 ${a}${i.minimum.toString()} ${s.unit}`:`數值過小:預期 ${i.origin} 應為 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`無效的字串:必須以 "${a.prefix}" 開頭`:a.format==="ends_with"?`無效的字串:必須以 "${a.suffix}" 結尾`:a.format==="includes"?`無效的字串:必須包含 "${a.includes}"`:a.format==="regex"?`無效的字串:必須符合格式 ${a.pattern}`:`無效的 ${r[a.format]??i.format}`}case"not_multiple_of":return`無效的數字:必須為 ${i.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${i.keys.length>1?"們":""}:${N(i.keys,"、")}`;case"invalid_key":return`${i.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${i.origin} 中有無效的值`;default:return"無效的輸入值"}}};function rz(){return{localeError:nz()}}var iz=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function n(i){return e[i]??null}let r={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},o={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return i=>{switch(i.code){case"invalid_type":{let a=o[i.expected]??i.expected,s=Y(i.input),u=o[s]??s;return/^[A-Z]/.test(i.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${i.expected}, àmọ̀ a rí ${u}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${a}, àmọ̀ a rí ${u}`}case"invalid_value":return i.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${G(i.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${N(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=n(i.origin);return s?`Tó pọ̀ jù: a ní láti jẹ́ pé ${i.origin??"iye"} ${s.verb} ${a}${i.maximum} ${s.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${a}${i.maximum}`}case"too_small":{let a=i.inclusive?">=":">",s=n(i.origin);return s?`Kéré ju: a ní láti jẹ́ pé ${i.origin} ${s.verb} ${a}${i.minimum} ${s.unit}`:`Kéré ju: a ní láti jẹ́ ${a}${i.minimum}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${a.prefix}"`:a.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${a.suffix}"`:a.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${a.includes}"`:a.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${a.pattern}`:`Aṣìṣe: ${r[a.format]??i.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${i.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${N(i.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${i.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${i.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function oz(){return{localeError:iz()}}var zc,hm=Symbol("ZodOutput"),pm=Symbol("ZodInput");class mm{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...r){let o=r[0];return this._map.set(n,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){let r=this._map.get(n);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(n),this}get(n){let r=n._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let i={...o,...this._map.get(n)};return Object.keys(i).length?i:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function Bs(){return new mm}(zc=globalThis).__zod_globalRegistry??(zc.__zod_globalRegistry=Bs());var at=globalThis.__zod_globalRegistry;function gm(e,n){return new e({type:"string",...U(n)})}function vm(e,n){return new e({type:"string",coerce:!0,...U(n)})}function Xs(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...U(n)})}function Di(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...U(n)})}function Ks(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...U(n)})}function Ys(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...U(n)})}function Qs(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...U(n)})}function eu(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...U(n)})}function mo(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...U(n)})}function tu(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...U(n)})}function nu(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...U(n)})}function ru(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...U(n)})}function iu(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...U(n)})}function ou(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...U(n)})}function au(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...U(n)})}function su(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...U(n)})}function uu(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...U(n)})}function lu(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...U(n)})}function _m(e,n){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...U(n)})}function cu(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...U(n)})}function fu(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...U(n)})}function du(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...U(n)})}function hu(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...U(n)})}function pu(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...U(n)})}function mu(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...U(n)})}var ym={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function bm(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...U(n)})}function $m(e,n){return new e({type:"string",format:"date",check:"string_format",...U(n)})}function wm(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...U(n)})}function km(e,n){return new e({type:"string",format:"duration",check:"string_format",...U(n)})}function xm(e,n){return new e({type:"number",checks:[],...U(n)})}function Sm(e,n){return new e({type:"number",coerce:!0,checks:[],...U(n)})}function Im(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...U(n)})}function zm(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...U(n)})}function Om(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...U(n)})}function Pm(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...U(n)})}function Tm(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...U(n)})}function Em(e,n){return new e({type:"boolean",...U(n)})}function Nm(e,n){return new e({type:"boolean",coerce:!0,...U(n)})}function Um(e,n){return new e({type:"bigint",...U(n)})}function Am(e,n){return new e({type:"bigint",coerce:!0,...U(n)})}function jm(e,n){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...U(n)})}function Zm(e,n){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...U(n)})}function Cm(e,n){return new e({type:"symbol",...U(n)})}function Dm(e,n){return new e({type:"undefined",...U(n)})}function Rm(e,n){return new e({type:"null",...U(n)})}function Mm(e){return new e({type:"any"})}function Lm(e){return new e({type:"unknown"})}function Fm(e,n){return new e({type:"never",...U(n)})}function qm(e,n){return new e({type:"void",...U(n)})}function Jm(e,n){return new e({type:"date",...U(n)})}function Hm(e,n){return new e({type:"date",coerce:!0,...U(n)})}function Vm(e,n){return new e({type:"nan",...U(n)})}function Bt(e,n){return new Rs({check:"less_than",...U(n),value:e,inclusive:!1})}function st(e,n){return new Rs({check:"less_than",...U(n),value:e,inclusive:!0})}function Xt(e,n){return new Ms({check:"greater_than",...U(n),value:e,inclusive:!1})}function qe(e,n){return new Ms({check:"greater_than",...U(n),value:e,inclusive:!0})}function gu(e){return Xt(0,e)}function vu(e){return Bt(0,e)}function _u(e){return st(0,e)}function yu(e){return qe(0,e)}function Un(e,n){return new Eh({check:"multiple_of",...U(n),value:e})}function qn(e,n){return new Ah({check:"max_size",...U(n),maximum:e})}function Kt(e,n){return new jh({check:"min_size",...U(n),minimum:e})}function Fr(e,n){return new Zh({check:"size_equals",...U(n),size:e})}function qr(e,n){return new Ch({check:"max_length",...U(n),maximum:e})}function dn(e,n){return new Dh({check:"min_length",...U(n),minimum:e})}function Jr(e,n){return new Rh({check:"length_equals",...U(n),length:e})}function go(e,n){return new Mh({check:"string_format",format:"regex",...U(n),pattern:e})}function vo(e){return new Lh({check:"string_format",format:"lowercase",...U(e)})}function _o(e){return new Fh({check:"string_format",format:"uppercase",...U(e)})}function yo(e,n){return new qh({check:"string_format",format:"includes",...U(n),includes:e})}function bo(e,n){return new Jh({check:"string_format",format:"starts_with",...U(n),prefix:e})}function $o(e,n){return new Hh({check:"string_format",format:"ends_with",...U(n),suffix:e})}function bu(e,n,r){return new Vh({check:"property",property:e,schema:n,...U(r)})}function wo(e,n){return new Wh({check:"mime_type",mime:e,...U(n)})}function Ft(e){return new Gh({check:"overwrite",tx:e})}function ko(e){return Ft(n=>n.normalize(e))}function xo(){return Ft(e=>e.trim())}function So(){return Ft(e=>e.toLowerCase())}function Io(){return Ft(e=>e.toUpperCase())}function zo(){return Ft(e=>Dd(e))}function Wm(e,n,r){return new e({type:"array",element:n,...U(r)})}function az(e,n,r){return new e({type:"union",options:n,...U(r)})}function sz(e,n,r){return new e({type:"union",options:n,inclusive:!1,...U(r)})}function uz(e,n,r,o){return new e({type:"union",options:r,discriminator:n,...U(o)})}function lz(e,n,r){return new e({type:"intersection",left:n,right:r})}function cz(e,n,r,o){let i=r instanceof Q;return new e({type:"tuple",items:n,rest:i?r:null,...U(i?o:r)})}function fz(e,n,r,o){return new e({type:"record",keyType:n,valueType:r,...U(o)})}function dz(e,n,r,o){return new e({type:"map",keyType:n,valueType:r,...U(o)})}function hz(e,n,r){return new e({type:"set",valueType:n,...U(r)})}function pz(e,n,r){let o=Array.isArray(n)?Object.fromEntries(n.map(i=>[i,i])):n;return new e({type:"enum",entries:o,...U(r)})}function mz(e,n,r){return new e({type:"enum",entries:n,...U(r)})}function gz(e,n,r){return new e({type:"literal",values:Array.isArray(n)?n:[n],...U(r)})}function Gm(e,n){return new e({type:"file",...U(n)})}function vz(e,n){return new e({type:"transform",transform:n})}function _z(e,n){return new e({type:"optional",innerType:n})}function yz(e,n){return new e({type:"nullable",innerType:n})}function bz(e,n,r){return new e({type:"default",innerType:n,get defaultValue(){return typeof r=="function"?r():Md(r)}})}function $z(e,n,r){return new e({type:"nonoptional",innerType:n,...U(r)})}function wz(e,n){return new e({type:"success",innerType:n})}function kz(e,n,r){return new e({type:"catch",innerType:n,catchValue:typeof r=="function"?r:()=>r})}function xz(e,n,r){return new e({type:"pipe",in:n,out:r})}function Sz(e,n){return new e({type:"readonly",innerType:n})}function Iz(e,n,r){return new e({type:"template_literal",parts:n,...U(r)})}function zz(e,n){return new e({type:"lazy",getter:n})}function Oz(e,n){return new e({type:"promise",innerType:n})}function Bm(e,n,r){let o=U(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:n,...o})}function Xm(e,n,r){return new e({type:"custom",check:"custom",fn:n,...U(r)})}function Km(e){let n=Ym(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Zi(o,r.value,n._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(Zi(i))}},e(r.value,r)));return n}function Ym(e,n){let r=new ke({check:"custom",...U(n)});return r._zod.check=e,r}function Qm(e){let n=new ke({check:"describe"});return n._zod.onattach=[r=>{let o=at.get(r)??{};at.add(r,{...o,description:e})}],n._zod.check=()=>{},n}function eg(e){let n=new ke({check:"meta"});return n._zod.onattach=[r=>{let o=at.get(r)??{};at.add(r,{...o,...e})}],n._zod.check=()=>{},n}function tg(e,n){let r=U(n),o=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(h=>typeof h=="string"?h.toLowerCase():h),i=i.map(h=>typeof h=="string"?h.toLowerCase():h));let a=new Set(o),s=new Set(i),u=e.Codec??Ws,l=e.Boolean??qs,c=new(e.String??Lr)({type:"string",error:r.error}),d=new l({type:"boolean",error:r.error}),f=new u({type:"pipe",in:c,out:d,transform:(h,p)=>{let m=h;return r.case!=="sensitive"&&(m=m.toLowerCase()),a.has(m)?!0:s.has(m)?!1:(p.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...s],input:p.value,inst:f,continue:!1}),{})},reverseTransform:(h,p)=>h===!0?o[0]||"true":i[0]||"false",error:r.error});return f}function Hr(e,n,r,o={}){let i=U(o),a={...U(o),check:"string_format",type:"string",format:n,fn:typeof r=="function"?r:s=>r.test(s),...i};return r instanceof RegExp&&(a.pattern=r),new e(a)}function An(e){let n=(e==null?void 0:e.target)??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??at,target:n,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function de(e,n,r={path:[],schemaPath:[]}){var c,d;var o;let i=e._zod.def,a=n.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};n.seen.set(e,s);let u=(d=(c=e._zod).toJSONSchema)==null?void 0:d.call(c);if(u)s.schema=u;else{let f={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,s.schema,f);else{let p=s.schema,m=n.processors[i.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);m(e,n,p,f)}let h=e._zod.parent;h&&(s.ref||(s.ref=h),de(h,n,f),n.seen.get(h).isParent=!0)}let l=n.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),n.io==="input"&&Me(e)&&(delete s.schema.examples,delete s.schema.default),n.io==="input"&&s.schema._prefault&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,n.seen.get(e).schema}function jn(e,n){var s,u,l,c;let r=e.seen.get(n);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let d of e.seen.entries()){let f=(s=e.metadataRegistry.get(d[0]))==null?void 0:s.id;if(f){let h=o.get(f);if(h&&h!==d[0])throw Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(f,d[0])}}let i=d=>{var m;let f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let v=(m=e.external.registry.get(d[0]))==null?void 0:m.id,y=e.external.uri??(w=>w);if(v)return{ref:y(v)};let g=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=g,{defId:g,ref:`${y("__shared")}#/${f}/${g}`}}if(d[1]===r)return{ref:"#"};let h=`#/${f}/`,p=d[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:h+p}},a=d=>{if(d[1].schema.$ref)return;let f=d[1],{ref:h,defId:p}=i(d);f.def={...f.schema},p&&(f.defId=p);let m=f.schema;for(let v in m)delete m[v];m.$ref=h};if(e.cycles==="throw")for(let d of e.seen.entries()){let f=d[1];if(f.cycle)throw Error(`Cycle detected: #/${(u=f.cycle)==null?void 0:u.join("/")}/<root>
84
-
85
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let d of e.seen.entries()){let f=d[1];if(n===d[0]){a(d);continue}if(e.external){let h=(l=e.external.registry.get(d[0]))==null?void 0:l.id;if(n!==d[0]&&h){a(d);continue}}if((c=e.metadataRegistry.get(d[0]))!=null&&c.id){a(d);continue}if(f.cycle){a(d);continue}if(f.count>1&&e.reused==="ref"){a(d);continue}}}function Zn(e,n){var s,u,l;let r=e.seen.get(n);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=c=>{let d=e.seen.get(c);if(d.ref===null)return;let f=d.def??d.schema,h={...f},p=d.ref;if(d.ref=null,p){o(p);let v=e.seen.get(p),y=v.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(y)):Object.assign(f,y),Object.assign(f,h),c._zod.parent===p)for(let g in f)g==="$ref"||g==="allOf"||g in h||delete f[g];if(y.$ref)for(let g in f)g==="$ref"||g==="allOf"||g in v.def&&JSON.stringify(f[g])===JSON.stringify(v.def[g])&&delete f[g]}let m=c._zod.parent;if(m&&m!==p){o(m);let v=e.seen.get(m);if(v!=null&&v.schema.$ref&&(f.$ref=v.schema.$ref,v.def))for(let y in f)y==="$ref"||y==="allOf"||y in v.def&&JSON.stringify(f[y])===JSON.stringify(v.def[y])&&delete f[y]}e.override({zodSchema:c,jsonSchema:f,path:d.path??[]})};for(let c of[...e.seen.entries()].reverse())o(c[0]);let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,(s=e.external)!=null&&s.uri){let c=(u=e.external.registry.get(n))==null?void 0:u.id;if(!c)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(c)}Object.assign(i,r.def??r.schema);let a=((l=e.external)==null?void 0:l.defs)??{};for(let c of e.seen.entries()){let d=c[1];d.def&&d.defId&&(a[d.defId]=d.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{let c=JSON.parse(JSON.stringify(i));return Object.defineProperty(c,"~standard",{value:{...n["~standard"],jsonSchema:{input:dr(n,"input",e.processors),output:dr(n,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw Error("Error converting schema to JSON.")}}function Me(e,n){let r=n??{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 Me(o.element,r);if(o.type==="set")return Me(o.valueType,r);if(o.type==="lazy")return Me(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")return Me(o.innerType,r);if(o.type==="intersection")return Me(o.left,r)||Me(o.right,r);if(o.type==="record"||o.type==="map")return Me(o.keyType,r)||Me(o.valueType,r);if(o.type==="pipe")return Me(o.in,r)||Me(o.out,r);if(o.type==="object"){for(let i in o.shape)if(Me(o.shape[i],r))return!0;return!1}if(o.type==="union"){for(let i of o.options)if(Me(i,r))return!0;return!1}if(o.type==="tuple"){for(let i of o.items)if(Me(i,r))return!0;return!!(o.rest&&Me(o.rest,r))}return!1}var ng=(e,n={})=>r=>{let o=An({...r,processors:n});return de(e,o),jn(o,e),Zn(o,e)},dr=(e,n,r={})=>o=>{let{libraryOptions:i,target:a}=o??{},s=An({...i??{},target:a,io:n,processors:r});return de(e,s),jn(s,e),Zn(s,e)},Pz={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},rg=(e,n,r,o)=>{let i=r;i.type="string";let{minimum:a,maximum:s,format:u,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof s=="number"&&(i.maxLength=s),u&&(i.format=Pz[u]??u,i.format===""&&delete i.format,u==="time"&&delete i.format),c&&(i.contentEncoding=c),l&&l.size>0){let d=[...l];d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(f=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},ig=(e,n,r,o)=>{let i=r,{minimum:a,maximum:s,format:u,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:d}=e._zod.bag;typeof u=="string"&&u.includes("int")?i.type="integer":i.type="number",typeof d=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(i.minimum=d,i.exclusiveMinimum=!0):i.exclusiveMinimum=d),typeof a=="number"&&(i.minimum=a,typeof d=="number"&&n.target!=="draft-04"&&(d>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof c=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c),typeof s=="number"&&(i.maximum=s,typeof c=="number"&&n.target!=="draft-04"&&(c<=s?delete i.maximum:delete i.exclusiveMaximum)),typeof l=="number"&&(i.multipleOf=l)},og=(e,n,r,o)=>{r.type="boolean"},ag=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},sg=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},ug=(e,n,r,o)=>{n.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},lg=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},cg=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},fg=(e,n,r,o)=>{r.not={}},dg=(e,n,r,o)=>{},hg=(e,n,r,o)=>{},pg=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},mg=(e,n,r,o)=>{let i=e._zod.def,a=xs(i.entries);a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),r.enum=a},gg=(e,n,r,o)=>{let i=e._zod.def,a=[];for(let s of i.values)if(s===void 0){if(n.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(n.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(s))}else a.push(s);if(a.length!==0)if(a.length===1){let s=a[0];r.type=s===null?"null":typeof s,n.target==="draft-04"||n.target==="openapi-3.0"?r.enum=[s]:r.const=s}else a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),a.every(s=>typeof s=="boolean")&&(r.type="boolean"),a.every(s=>s===null)&&(r.type="null"),r.enum=a},vg=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},_g=(e,n,r,o)=>{let i=r,a=e._zod.pattern;if(!a)throw Error("Pattern not found in template literal");i.type="string",i.pattern=a.source},yg=(e,n,r,o)=>{let i=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:u,mime:l}=e._zod.bag;s!==void 0&&(a.minLength=s),u!==void 0&&(a.maxLength=u),l?l.length===1?(a.contentMediaType=l[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=l.map(c=>({contentMediaType:c}))):Object.assign(i,a)},bg=(e,n,r,o)=>{r.type="boolean"},$g=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},wg=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},kg=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},xg=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},Sg=(e,n,r,o)=>{if(n.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},Ig=(e,n,r,o)=>{let i=r,a=e._zod.def,{minimum:s,maximum:u}=e._zod.bag;typeof s=="number"&&(i.minItems=s),typeof u=="number"&&(i.maxItems=u),i.type="array",i.items=de(a.element,n,{...o,path:[...o.path,"items"]})},zg=(e,n,r,o)=>{var c;let i=r,a=e._zod.def;i.type="object",i.properties={};let s=a.shape;for(let d in s)i.properties[d]=de(s[d],n,{...o,path:[...o.path,"properties",d]});let u=new Set(Object.keys(s)),l=new Set([...u].filter(d=>{let f=a.shape[d]._zod;return n.io==="input"?f.optin===void 0:f.optout===void 0}));l.size>0&&(i.required=Array.from(l)),((c=a.catchall)==null?void 0:c._zod.def.type)==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=de(a.catchall,n,{...o,path:[...o.path,"additionalProperties"]})):n.io==="output"&&(i.additionalProperties=!1)},$u=(e,n,r,o)=>{let i=e._zod.def,a=i.inclusive===!1,s=i.options.map((u,l)=>de(u,n,{...o,path:[...o.path,a?"oneOf":"anyOf",l]}));a?r.oneOf=s:r.anyOf=s},Og=(e,n,r,o)=>{let i=e._zod.def,a=de(i.left,n,{...o,path:[...o.path,"allOf",0]}),s=de(i.right,n,{...o,path:[...o.path,"allOf",1]}),u=c=>"allOf"in c&&Object.keys(c).length===1,l=[...u(a)?a.allOf:[a],...u(s)?s.allOf:[s]];r.allOf=l},Pg=(e,n,r,o)=>{let i=r,a=e._zod.def;i.type="array";let s=n.target==="draft-2020-12"?"prefixItems":"items",u=n.target==="draft-2020-12"||n.target==="openapi-3.0"?"items":"additionalItems",l=a.items.map((h,p)=>de(h,n,{...o,path:[...o.path,s,p]})),c=a.rest?de(a.rest,n,{...o,path:[...o.path,u,...n.target==="openapi-3.0"?[a.items.length]:[]]}):null;n.target==="draft-2020-12"?(i.prefixItems=l,c&&(i.items=c)):n.target==="openapi-3.0"?(i.items={anyOf:l},c&&i.items.anyOf.push(c),i.minItems=l.length,!c&&(i.maxItems=l.length)):(i.items=l,c&&(i.additionalItems=c));let{minimum:d,maximum:f}=e._zod.bag;typeof d=="number"&&(i.minItems=d),typeof f=="number"&&(i.maxItems=f)},Tg=(e,n,r,o)=>{var c;let i=r,a=e._zod.def;i.type="object";let s=a.keyType,u=(c=s._zod.bag)==null?void 0:c.patterns;if(a.mode==="loose"&&u&&u.size>0){let d=de(a.valueType,n,{...o,path:[...o.path,"patternProperties","*"]});i.patternProperties={};for(let f of u)i.patternProperties[f.source]=d}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(i.propertyNames=de(a.keyType,n,{...o,path:[...o.path,"propertyNames"]})),i.additionalProperties=de(a.valueType,n,{...o,path:[...o.path,"additionalProperties"]});let l=s._zod.values;if(l){let d=[...l].filter(f=>typeof f=="string"||typeof f=="number");d.length>0&&(i.required=d)}},Eg=(e,n,r,o)=>{let i=e._zod.def,a=de(i.innerType,n,o),s=n.seen.get(e);n.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},Ng=(e,n,r,o)=>{let i=e._zod.def;de(i.innerType,n,o);let a=n.seen.get(e);a.ref=i.innerType},Ug=(e,n,r,o)=>{let i=e._zod.def;de(i.innerType,n,o);let a=n.seen.get(e);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},Ag=(e,n,r,o)=>{let i=e._zod.def;de(i.innerType,n,o);let a=n.seen.get(e);a.ref=i.innerType,n.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},jg=(e,n,r,o)=>{let i=e._zod.def;de(i.innerType,n,o);let a=n.seen.get(e);a.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},Zg=(e,n,r,o)=>{let i=e._zod.def,a=n.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;de(a,n,o);let s=n.seen.get(e);s.ref=a},Cg=(e,n,r,o)=>{let i=e._zod.def;de(i.innerType,n,o);let a=n.seen.get(e);a.ref=i.innerType,r.readOnly=!0},Dg=(e,n,r,o)=>{let i=e._zod.def;de(i.innerType,n,o);let a=n.seen.get(e);a.ref=i.innerType},wu=(e,n,r,o)=>{let i=e._zod.def;de(i.innerType,n,o);let a=n.seen.get(e);a.ref=i.innerType},Rg=(e,n,r,o)=>{let i=e._zod.innerType;de(i,n,o);let a=n.seen.get(e);a.ref=i},Pa={string:rg,number:ig,boolean:og,bigint:ag,symbol:sg,null:ug,undefined:lg,void:cg,never:fg,any:dg,unknown:hg,date:pg,enum:mg,literal:gg,nan:vg,template_literal:_g,file:yg,success:bg,custom:$g,function:wg,transform:kg,map:xg,set:Sg,array:Ig,object:zg,union:$u,intersection:Og,tuple:Pg,record:Tg,nullable:Eg,nonoptional:Ng,default:Ug,prefault:Ag,catch:jg,pipe:Zg,readonly:Cg,promise:Dg,optional:wu,lazy:Rg};function Mg(e,n){if("_idmap"in e){let o=e,i=An({...n,processors:Pa}),a={};for(let l of o._idmap.entries()){let[c,d]=l;de(d,i)}let s={},u={registry:o,uri:n==null?void 0:n.uri,defs:a};i.external=u;for(let l of o._idmap.entries()){let[c,d]=l;jn(i,d),s[c]=Zn(i,d)}if(Object.keys(a).length>0){let l=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:a}}return{schemas:s}}let r=An({...n,processors:Pa});return de(e,r),jn(r,e),Zn(r,e)}class Tz{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(n){this.ctx.counter=n}get seen(){return this.ctx.seen}constructor(n){let r=(n==null?void 0:n.target)??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=An({processors:Pa,target:r,...(n==null?void 0:n.metadata)&&{metadata:n.metadata},...(n==null?void 0:n.unrepresentable)&&{unrepresentable:n.unrepresentable},...(n==null?void 0:n.override)&&{override:n.override},...(n==null?void 0:n.io)&&{io:n.io}})}process(n,r={path:[],schemaPath:[]}){return de(n,this.ctx,r)}emit(n,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),jn(this.ctx,n);let o=Zn(this.ctx,n),{"~standard":i,...a}=o;return a}}var Ez={},Lg={};Mt(Lg,{xor:()=>Xv,xid:()=>yv,void:()=>Jv,uuidv7:()=>fv,uuidv6:()=>cv,uuidv4:()=>lv,uuid:()=>uv,url:()=>dv,unknown:()=>hn,union:()=>Go,undefined:()=>Fv,ulid:()=>_v,uint64:()=>Mv,uint32:()=>Cv,tuple:()=>Hu,transform:()=>Xo,templateLiteral:()=>l_,symbol:()=>Lv,superRefine:()=>_l,success:()=>a_,stringbool:()=>g_,stringFormat:()=>Tv,string:()=>Ri,strictObject:()=>Gv,set:()=>t_,refine:()=>vl,record:()=>Vu,readonly:()=>fl,promise:()=>c_,preprocess:()=>__,prefault:()=>il,pipe:()=>gr,partialRecord:()=>Yv,optional:()=>pr,object:()=>Wv,number:()=>Pu,nullish:()=>o_,nullable:()=>mr,null:()=>Au,nonoptional:()=>ol,never:()=>Vo,nativeEnum:()=>n_,nanoid:()=>mv,nan:()=>s_,meta:()=>p_,map:()=>e_,mac:()=>wv,looseRecord:()=>Qv,looseObject:()=>Bv,literal:()=>r_,lazy:()=>pl,ksuid:()=>bv,keyof:()=>Vv,jwt:()=>Pv,json:()=>v_,ipv6:()=>kv,ipv4:()=>$v,intersection:()=>qu,int64:()=>Rv,int32:()=>Zv,int:()=>Mi,instanceof:()=>m_,httpUrl:()=>hv,hostname:()=>Ev,hex:()=>Nv,hash:()=>Uv,guid:()=>sv,function:()=>Li,float64:()=>jv,float32:()=>Av,file:()=>i_,exactOptional:()=>Qu,enum:()=>Bo,emoji:()=>pv,email:()=>av,e164:()=>Ov,discriminatedUnion:()=>Kv,describe:()=>h_,date:()=>Hv,custom:()=>d_,cuid2:()=>vv,cuid:()=>gv,codec:()=>u_,cidrv6:()=>Sv,cidrv4:()=>xv,check:()=>f_,catch:()=>ul,boolean:()=>Tu,bigint:()=>Dv,base64url:()=>zv,base64:()=>Iv,array:()=>Kr,any:()=>qv,_function:()=>Li,_default:()=>nl,_ZodString:()=>Oo,ZodXor:()=>Mu,ZodXID:()=>jo,ZodVoid:()=>Du,ZodUnknown:()=>Zu,ZodUnion:()=>Qr,ZodUndefined:()=>Nu,ZodUUID:()=>xt,ZodURL:()=>Wr,ZodULID:()=>Ao,ZodType:()=>ee,ZodTuple:()=>Ju,ZodTransform:()=>Ku,ZodTemplateLiteral:()=>dl,ZodSymbol:()=>Eu,ZodSuccess:()=>al,ZodStringFormat:()=>me,ZodString:()=>Vr,ZodSet:()=>Gu,ZodRecord:()=>ei,ZodReadonly:()=>cl,ZodPromise:()=>ml,ZodPrefault:()=>rl,ZodPipe:()=>Qo,ZodOptional:()=>Ko,ZodObject:()=>Yr,ZodNumberFormat:()=>yn,ZodNumber:()=>Gr,ZodNullable:()=>el,ZodNull:()=>Uu,ZodNonOptional:()=>Yo,ZodNever:()=>Cu,ZodNanoID:()=>Eo,ZodNaN:()=>ll,ZodMap:()=>Wu,ZodMAC:()=>Ou,ZodLiteral:()=>Bu,ZodLazy:()=>hl,ZodKSUID:()=>Zo,ZodJWT:()=>Jo,ZodIntersection:()=>Fu,ZodIPv6:()=>Do,ZodIPv4:()=>Co,ZodGUID:()=>hr,ZodFunction:()=>gl,ZodFile:()=>Xu,ZodExactOptional:()=>Yu,ZodEnum:()=>Cn,ZodEmoji:()=>To,ZodEmail:()=>Po,ZodE164:()=>qo,ZodDiscriminatedUnion:()=>Lu,ZodDefault:()=>tl,ZodDate:()=>Wo,ZodCustomStringFormat:()=>Jn,ZodCustom:()=>ti,ZodCodec:()=>ea,ZodCatch:()=>sl,ZodCUID2:()=>Uo,ZodCUID:()=>No,ZodCIDRv6:()=>Mo,ZodCIDRv4:()=>Ro,ZodBoolean:()=>Br,ZodBigIntFormat:()=>Ho,ZodBigInt:()=>Xr,ZodBase64URL:()=>Fo,ZodBase64:()=>Lo,ZodArray:()=>Ru,ZodAny:()=>ju});var Fg={};Mt(Fg,{uppercase:()=>_o,trim:()=>xo,toUpperCase:()=>Io,toLowerCase:()=>So,startsWith:()=>bo,slugify:()=>zo,size:()=>Fr,regex:()=>go,property:()=>bu,positive:()=>gu,overwrite:()=>Ft,normalize:()=>ko,nonpositive:()=>_u,nonnegative:()=>yu,negative:()=>vu,multipleOf:()=>Un,minSize:()=>Kt,minLength:()=>dn,mime:()=>wo,maxSize:()=>qn,maxLength:()=>qr,lte:()=>st,lt:()=>Bt,lowercase:()=>vo,length:()=>Jr,includes:()=>yo,gte:()=>qe,gt:()=>Xt,endsWith:()=>$o});var ku={};Mt(ku,{time:()=>Hg,duration:()=>Vg,datetime:()=>qg,date:()=>Jg,ZodISOTime:()=>Iu,ZodISODuration:()=>zu,ZodISODateTime:()=>xu,ZodISODate:()=>Su});var xu=S("ZodISODateTime",(e,n)=>{up.init(e,n),me.init(e,n)});function qg(e){return bm(xu,e)}var Su=S("ZodISODate",(e,n)=>{lp.init(e,n),me.init(e,n)});function Jg(e){return $m(Su,e)}var Iu=S("ZodISOTime",(e,n)=>{cp.init(e,n),me.init(e,n)});function Hg(e){return wm(Iu,e)}var zu=S("ZodISODuration",(e,n)=>{fp.init(e,n),me.init(e,n)});function Vg(e){return km(zu,e)}var Wg=(e,n)=>{Is.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Os(e,r)},flatten:{value:r=>zs(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ai,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ai,2)}},isEmpty:{get(){return e.issues.length===0}}})},Nz=S("ZodError",Wg),et=S("ZodError",Wg,{Parent:Error}),Gg=Ar(et),Bg=jr(et),Xg=Zr(et),Kg=Cr(et),Yg=Ps(et),Qg=Ts(et),ev=Es(et),tv=Ns(et),nv=Us(et),rv=As(et),iv=js(et),ov=Zs(et),ee=S("ZodType",(e,n)=>(Q.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:dr(e,"input"),output:dr(e,"output")}}),e.toJSONSchema=ng(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...r)=>e.clone(re.mergeDefs(n,{checks:[...n.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(r,o)=>ht(e,r,o),e.brand=()=>e,e.register=(r,o)=>(r.add(e,o),e),e.parse=(r,o)=>Gg(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Xg(e,r,o),e.parseAsync=async(r,o)=>Bg(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Kg(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Yg(e,r,o),e.decode=(r,o)=>Qg(e,r,o),e.encodeAsync=async(r,o)=>ev(e,r,o),e.decodeAsync=async(r,o)=>tv(e,r,o),e.safeEncode=(r,o)=>nv(e,r,o),e.safeDecode=(r,o)=>rv(e,r,o),e.safeEncodeAsync=async(r,o)=>iv(e,r,o),e.safeDecodeAsync=async(r,o)=>ov(e,r,o),e.refine=(r,o)=>e.check(vl(r,o)),e.superRefine=r=>e.check(_l(r)),e.overwrite=r=>e.check(Ft(r)),e.optional=()=>pr(e),e.exactOptional=()=>Qu(e),e.nullable=()=>mr(e),e.nullish=()=>pr(mr(e)),e.nonoptional=r=>ol(e,r),e.array=()=>Kr(e),e.or=r=>Go([e,r]),e.and=r=>qu(e,r),e.transform=r=>gr(e,Xo(r)),e.default=r=>nl(e,r),e.prefault=r=>il(e,r),e.catch=r=>ul(e,r),e.pipe=r=>gr(e,r),e.readonly=()=>fl(e),e.describe=r=>{let o=e.clone();return at.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){var r;return(r=at.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return at.get(e);let o=e.clone();return at.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),Oo=S("_ZodString",(e,n)=>{Lr.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(o,i,a)=>rg(e,o,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(go(...o)),e.includes=(...o)=>e.check(yo(...o)),e.startsWith=(...o)=>e.check(bo(...o)),e.endsWith=(...o)=>e.check($o(...o)),e.min=(...o)=>e.check(dn(...o)),e.max=(...o)=>e.check(qr(...o)),e.length=(...o)=>e.check(Jr(...o)),e.nonempty=(...o)=>e.check(dn(1,...o)),e.lowercase=o=>e.check(vo(o)),e.uppercase=o=>e.check(_o(o)),e.trim=()=>e.check(xo()),e.normalize=(...o)=>e.check(ko(...o)),e.toLowerCase=()=>e.check(So()),e.toUpperCase=()=>e.check(Io()),e.slugify=()=>e.check(zo())}),Vr=S("ZodString",(e,n)=>{Lr.init(e,n),Oo.init(e,n),e.email=r=>e.check(Xs(Po,r)),e.url=r=>e.check(mo(Wr,r)),e.jwt=r=>e.check(mu(Jo,r)),e.emoji=r=>e.check(tu(To,r)),e.guid=r=>e.check(Di(hr,r)),e.uuid=r=>e.check(Ks(xt,r)),e.uuidv4=r=>e.check(Ys(xt,r)),e.uuidv6=r=>e.check(Qs(xt,r)),e.uuidv7=r=>e.check(eu(xt,r)),e.nanoid=r=>e.check(nu(Eo,r)),e.guid=r=>e.check(Di(hr,r)),e.cuid=r=>e.check(ru(No,r)),e.cuid2=r=>e.check(iu(Uo,r)),e.ulid=r=>e.check(ou(Ao,r)),e.base64=r=>e.check(du(Lo,r)),e.base64url=r=>e.check(hu(Fo,r)),e.xid=r=>e.check(au(jo,r)),e.ksuid=r=>e.check(su(Zo,r)),e.ipv4=r=>e.check(uu(Co,r)),e.ipv6=r=>e.check(lu(Do,r)),e.cidrv4=r=>e.check(cu(Ro,r)),e.cidrv6=r=>e.check(fu(Mo,r)),e.e164=r=>e.check(pu(qo,r)),e.datetime=r=>e.check(qg(r)),e.date=r=>e.check(Jg(r)),e.time=r=>e.check(Hg(r)),e.duration=r=>e.check(Vg(r))});function Ri(e){return gm(Vr,e)}var me=S("ZodStringFormat",(e,n)=>{pe.init(e,n),Oo.init(e,n)}),Po=S("ZodEmail",(e,n)=>{Qh.init(e,n),me.init(e,n)});function av(e){return Xs(Po,e)}var hr=S("ZodGUID",(e,n)=>{Kh.init(e,n),me.init(e,n)});function sv(e){return Di(hr,e)}var xt=S("ZodUUID",(e,n)=>{Yh.init(e,n),me.init(e,n)});function uv(e){return Ks(xt,e)}function lv(e){return Ys(xt,e)}function cv(e){return Qs(xt,e)}function fv(e){return eu(xt,e)}var Wr=S("ZodURL",(e,n)=>{ep.init(e,n),me.init(e,n)});function dv(e){return mo(Wr,e)}function hv(e){return mo(Wr,{protocol:/^https?$/,hostname:_n.domain,...re.normalizeParams(e)})}var To=S("ZodEmoji",(e,n)=>{tp.init(e,n),me.init(e,n)});function pv(e){return tu(To,e)}var Eo=S("ZodNanoID",(e,n)=>{np.init(e,n),me.init(e,n)});function mv(e){return nu(Eo,e)}var No=S("ZodCUID",(e,n)=>{rp.init(e,n),me.init(e,n)});function gv(e){return ru(No,e)}var Uo=S("ZodCUID2",(e,n)=>{ip.init(e,n),me.init(e,n)});function vv(e){return iu(Uo,e)}var Ao=S("ZodULID",(e,n)=>{op.init(e,n),me.init(e,n)});function _v(e){return ou(Ao,e)}var jo=S("ZodXID",(e,n)=>{ap.init(e,n),me.init(e,n)});function yv(e){return au(jo,e)}var Zo=S("ZodKSUID",(e,n)=>{sp.init(e,n),me.init(e,n)});function bv(e){return su(Zo,e)}var Co=S("ZodIPv4",(e,n)=>{dp.init(e,n),me.init(e,n)});function $v(e){return uu(Co,e)}var Ou=S("ZodMAC",(e,n)=>{pp.init(e,n),me.init(e,n)});function wv(e){return _m(Ou,e)}var Do=S("ZodIPv6",(e,n)=>{hp.init(e,n),me.init(e,n)});function kv(e){return lu(Do,e)}var Ro=S("ZodCIDRv4",(e,n)=>{mp.init(e,n),me.init(e,n)});function xv(e){return cu(Ro,e)}var Mo=S("ZodCIDRv6",(e,n)=>{gp.init(e,n),me.init(e,n)});function Sv(e){return fu(Mo,e)}var Lo=S("ZodBase64",(e,n)=>{vp.init(e,n),me.init(e,n)});function Iv(e){return du(Lo,e)}var Fo=S("ZodBase64URL",(e,n)=>{yp.init(e,n),me.init(e,n)});function zv(e){return hu(Fo,e)}var qo=S("ZodE164",(e,n)=>{bp.init(e,n),me.init(e,n)});function Ov(e){return pu(qo,e)}var Jo=S("ZodJWT",(e,n)=>{wp.init(e,n),me.init(e,n)});function Pv(e){return mu(Jo,e)}var Jn=S("ZodCustomStringFormat",(e,n)=>{kp.init(e,n),me.init(e,n)});function Tv(e,n,r={}){return Hr(Jn,e,n,r)}function Ev(e){return Hr(Jn,"hostname",_n.hostname,e)}function Nv(e){return Hr(Jn,"hex",_n.hex,e)}function Uv(e,n){let r=(n==null?void 0:n.enc)??"hex",o=`${e}_${r}`,i=_n[o];if(!i)throw Error(`Unrecognized hash format: ${o}`);return Hr(Jn,o,i,n)}var Gr=S("ZodNumber",(e,n)=>{Fs.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(o,i,a)=>ig(e,o,i),e.gt=(o,i)=>e.check(Xt(o,i)),e.gte=(o,i)=>e.check(qe(o,i)),e.min=(o,i)=>e.check(qe(o,i)),e.lt=(o,i)=>e.check(Bt(o,i)),e.lte=(o,i)=>e.check(st(o,i)),e.max=(o,i)=>e.check(st(o,i)),e.int=o=>e.check(Mi(o)),e.safe=o=>e.check(Mi(o)),e.positive=o=>e.check(Xt(0,o)),e.nonnegative=o=>e.check(qe(0,o)),e.negative=o=>e.check(Bt(0,o)),e.nonpositive=o=>e.check(st(0,o)),e.multipleOf=(o,i)=>e.check(Un(o,i)),e.step=(o,i)=>e.check(Un(o,i)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Pu(e){return xm(Gr,e)}var yn=S("ZodNumberFormat",(e,n)=>{xp.init(e,n),Gr.init(e,n)});function Mi(e){return Im(yn,e)}function Av(e){return zm(yn,e)}function jv(e){return Om(yn,e)}function Zv(e){return Pm(yn,e)}function Cv(e){return Tm(yn,e)}var Br=S("ZodBoolean",(e,n)=>{qs.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>og(e,r,o)});function Tu(e){return Em(Br,e)}var Xr=S("ZodBigInt",(e,n)=>{Js.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(o,i,a)=>ag(e,o),e.gte=(o,i)=>e.check(qe(o,i)),e.min=(o,i)=>e.check(qe(o,i)),e.gt=(o,i)=>e.check(Xt(o,i)),e.gte=(o,i)=>e.check(qe(o,i)),e.min=(o,i)=>e.check(qe(o,i)),e.lt=(o,i)=>e.check(Bt(o,i)),e.lte=(o,i)=>e.check(st(o,i)),e.max=(o,i)=>e.check(st(o,i)),e.positive=o=>e.check(Xt(BigInt(0),o)),e.negative=o=>e.check(Bt(BigInt(0),o)),e.nonpositive=o=>e.check(st(BigInt(0),o)),e.nonnegative=o=>e.check(qe(BigInt(0),o)),e.multipleOf=(o,i)=>e.check(Un(o,i));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Dv(e){return Um(Xr,e)}var Ho=S("ZodBigIntFormat",(e,n)=>{Sp.init(e,n),Xr.init(e,n)});function Rv(e){return jm(Ho,e)}function Mv(e){return Zm(Ho,e)}var Eu=S("ZodSymbol",(e,n)=>{Ip.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>sg(e,r)});function Lv(e){return Cm(Eu,e)}var Nu=S("ZodUndefined",(e,n)=>{zp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>lg(e,r)});function Fv(e){return Dm(Nu,e)}var Uu=S("ZodNull",(e,n)=>{Op.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>ug(e,r,o)});function Au(e){return Rm(Uu,e)}var ju=S("ZodAny",(e,n)=>{Pp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>dg()});function qv(){return Mm(ju)}var Zu=S("ZodUnknown",(e,n)=>{Tp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>hg()});function hn(){return Lm(Zu)}var Cu=S("ZodNever",(e,n)=>{Ep.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>fg(e,r,o)});function Vo(e){return Fm(Cu,e)}var Du=S("ZodVoid",(e,n)=>{Np.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>cg(e,r)});function Jv(e){return qm(Du,e)}var Wo=S("ZodDate",(e,n)=>{Up.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(o,i,a)=>pg(e,o),e.min=(o,i)=>e.check(qe(o,i)),e.max=(o,i)=>e.check(st(o,i));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function Hv(e){return Jm(Wo,e)}var Ru=S("ZodArray",(e,n)=>{Ap.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Ig(e,r,o,i),e.element=n.element,e.min=(r,o)=>e.check(dn(r,o)),e.nonempty=r=>e.check(dn(1,r)),e.max=(r,o)=>e.check(qr(r,o)),e.length=(r,o)=>e.check(Jr(r,o)),e.unwrap=()=>e.element});function Kr(e,n){return Wm(Ru,e,n)}function Vv(e){let n=e._zod.def.shape;return Bo(Object.keys(n))}var Yr=S("ZodObject",(e,n)=>{Dp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>zg(e,r,o,i),re.defineLazy(e,"shape",()=>n.shape),e.keyof=()=>Bo(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:hn()}),e.loose=()=>e.clone({...e._zod.def,catchall:hn()}),e.strict=()=>e.clone({...e._zod.def,catchall:Vo()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>re.extend(e,r),e.safeExtend=r=>re.safeExtend(e,r),e.merge=r=>re.merge(e,r),e.pick=r=>re.pick(e,r),e.omit=r=>re.omit(e,r),e.partial=(...r)=>re.partial(Ko,e,r[0]),e.required=(...r)=>re.required(Yo,e,r[0])});function Wv(e,n){let r={type:"object",shape:e??{},...re.normalizeParams(n)};return new Yr(r)}function Gv(e,n){return new Yr({type:"object",shape:e,catchall:Vo(),...re.normalizeParams(n)})}function Bv(e,n){return new Yr({type:"object",shape:e,catchall:hn(),...re.normalizeParams(n)})}var Qr=S("ZodUnion",(e,n)=>{po.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>$u(e,r,o,i),e.options=n.options});function Go(e,n){return new Qr({type:"union",options:e,...re.normalizeParams(n)})}var Mu=S("ZodXor",(e,n)=>{Qr.init(e,n),Rp.init(e,n),e._zod.processJSONSchema=(r,o,i)=>$u(e,r,o,i),e.options=n.options});function Xv(e,n){return new Mu({type:"union",options:e,inclusive:!1,...re.normalizeParams(n)})}var Lu=S("ZodDiscriminatedUnion",(e,n)=>{Qr.init(e,n),Mp.init(e,n)});function Kv(e,n,r){return new Lu({type:"union",options:n,discriminator:e,...re.normalizeParams(r)})}var Fu=S("ZodIntersection",(e,n)=>{Lp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Og(e,r,o,i)});function qu(e,n){return new Fu({type:"intersection",left:e,right:n})}var Ju=S("ZodTuple",(e,n)=>{Hs.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Pg(e,r,o,i),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Hu(e,n,r){let o=n instanceof Q,i=o?r:n;return new Ju({type:"tuple",items:e,rest:o?n:null,...re.normalizeParams(i)})}var ei=S("ZodRecord",(e,n)=>{Fp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Tg(e,r,o,i),e.keyType=n.keyType,e.valueType=n.valueType});function Vu(e,n,r){return new ei({type:"record",keyType:e,valueType:n,...re.normalizeParams(r)})}function Yv(e,n,r){let o=ht(e);return o._zod.values=void 0,new ei({type:"record",keyType:o,valueType:n,...re.normalizeParams(r)})}function Qv(e,n,r){return new ei({type:"record",keyType:e,valueType:n,mode:"loose",...re.normalizeParams(r)})}var Wu=S("ZodMap",(e,n)=>{qp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>xg(e,r),e.keyType=n.keyType,e.valueType=n.valueType,e.min=(...r)=>e.check(Kt(...r)),e.nonempty=r=>e.check(Kt(1,r)),e.max=(...r)=>e.check(qn(...r)),e.size=(...r)=>e.check(Fr(...r))});function e_(e,n,r){return new Wu({type:"map",keyType:e,valueType:n,...re.normalizeParams(r)})}var Gu=S("ZodSet",(e,n)=>{Jp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Sg(e,r),e.min=(...r)=>e.check(Kt(...r)),e.nonempty=r=>e.check(Kt(1,r)),e.max=(...r)=>e.check(qn(...r)),e.size=(...r)=>e.check(Fr(...r))});function t_(e,n){return new Gu({type:"set",valueType:e,...re.normalizeParams(n)})}var Cn=S("ZodEnum",(e,n)=>{Hp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(o,i,a)=>mg(e,o,i),e.enum=n.entries,e.options=Object.values(n.entries);let r=new Set(Object.keys(n.entries));e.extract=(o,i)=>{let a={};for(let s of o)if(r.has(s))a[s]=n.entries[s];else throw Error(`Key ${s} not found in enum`);return new Cn({...n,checks:[],...re.normalizeParams(i),entries:a})},e.exclude=(o,i)=>{let a={...n.entries};for(let s of o)if(r.has(s))delete a[s];else throw Error(`Key ${s} not found in enum`);return new Cn({...n,checks:[],...re.normalizeParams(i),entries:a})}});function Bo(e,n){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Cn({type:"enum",entries:r,...re.normalizeParams(n)})}function n_(e,n){return new Cn({type:"enum",entries:e,...re.normalizeParams(n)})}var Bu=S("ZodLiteral",(e,n)=>{Vp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>gg(e,r,o),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function r_(e,n){return new Bu({type:"literal",values:Array.isArray(e)?e:[e],...re.normalizeParams(n)})}var Xu=S("ZodFile",(e,n)=>{Wp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>yg(e,r,o),e.min=(r,o)=>e.check(Kt(r,o)),e.max=(r,o)=>e.check(qn(r,o)),e.mime=(r,o)=>e.check(wo(Array.isArray(r)?r:[r],o))});function i_(e){return Gm(Xu,e)}var Ku=S("ZodTransform",(e,n)=>{Gp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>kg(e,r),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new lo(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(re.issue(a,r.value,n));else{let s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(re.issue(s))}};let i=n.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r)):(r.value=i,r)}});function Xo(e){return new Ku({type:"transform",transform:e})}var Ko=S("ZodOptional",(e,n)=>{Vs.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>wu(e,r,o,i),e.unwrap=()=>e._zod.def.innerType});function pr(e){return new Ko({type:"optional",innerType:e})}var Yu=S("ZodExactOptional",(e,n)=>{Bp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>wu(e,r,o,i),e.unwrap=()=>e._zod.def.innerType});function Qu(e){return new Yu({type:"optional",innerType:e})}var el=S("ZodNullable",(e,n)=>{Xp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Eg(e,r,o,i),e.unwrap=()=>e._zod.def.innerType});function mr(e){return new el({type:"nullable",innerType:e})}function o_(e){return pr(mr(e))}var tl=S("ZodDefault",(e,n)=>{Kp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Ug(e,r,o,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function nl(e,n){return new tl({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():re.shallowClone(n)}})}var rl=S("ZodPrefault",(e,n)=>{Yp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Ag(e,r,o,i),e.unwrap=()=>e._zod.def.innerType});function il(e,n){return new rl({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():re.shallowClone(n)}})}var Yo=S("ZodNonOptional",(e,n)=>{Qp.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Ng(e,r,o,i),e.unwrap=()=>e._zod.def.innerType});function ol(e,n){return new Yo({type:"nonoptional",innerType:e,...re.normalizeParams(n)})}var al=S("ZodSuccess",(e,n)=>{em.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>bg(e,r,o),e.unwrap=()=>e._zod.def.innerType});function a_(e){return new al({type:"success",innerType:e})}var sl=S("ZodCatch",(e,n)=>{tm.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>jg(e,r,o,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ul(e,n){return new sl({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}var ll=S("ZodNaN",(e,n)=>{nm.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>vg(e,r)});function s_(e){return Vm(ll,e)}var Qo=S("ZodPipe",(e,n)=>{rm.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Zg(e,r,o,i),e.in=n.in,e.out=n.out});function gr(e,n){return new Qo({type:"pipe",in:e,out:n})}var ea=S("ZodCodec",(e,n)=>{Qo.init(e,n),Ws.init(e,n)});function u_(e,n,r){return new ea({type:"pipe",in:e,out:n,transform:r.decode,reverseTransform:r.encode})}var cl=S("ZodReadonly",(e,n)=>{im.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Cg(e,r,o,i),e.unwrap=()=>e._zod.def.innerType});function fl(e){return new cl({type:"readonly",innerType:e})}var dl=S("ZodTemplateLiteral",(e,n)=>{om.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>_g(e,r,o)});function l_(e,n){return new dl({type:"template_literal",parts:e,...re.normalizeParams(n)})}var hl=S("ZodLazy",(e,n)=>{um.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Rg(e,r,o,i),e.unwrap=()=>e._zod.def.getter()});function pl(e){return new hl({type:"lazy",getter:e})}var ml=S("ZodPromise",(e,n)=>{sm.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>Dg(e,r,o,i),e.unwrap=()=>e._zod.def.innerType});function c_(e){return new ml({type:"promise",innerType:e})}var gl=S("ZodFunction",(e,n)=>{am.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>wg(e,r)});function Li(e){return new gl({type:"function",input:Array.isArray(e==null?void 0:e.input)?Hu(e==null?void 0:e.input):(e==null?void 0:e.input)??Kr(hn()),output:(e==null?void 0:e.output)??hn()})}var ti=S("ZodCustom",(e,n)=>{lm.init(e,n),ee.init(e,n),e._zod.processJSONSchema=(r,o,i)=>$g(e,r)});function f_(e){let n=new ke({check:"custom"});return n._zod.check=e,n}function d_(e,n){return Bm(ti,e??(()=>!0),n)}function vl(e,n={}){return Xm(ti,e,n)}function _l(e){return Km(e)}var h_=Qm,p_=eg;function m_(e,n={}){let r=new ti({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...re.normalizeParams(n)});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}var g_=(...e)=>tg({Codec:ea,Boolean:Br,String:Vr},...e);function v_(e){let n=pl(()=>Go([Ri(e),Pu(),Tu(),Au(),Kr(n),Vu(Ri(),n)]));return n}function __(e,n){return gr(Xo(e),n)}var Uz={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Az(e){De({customError:e})}function jz(){return De().customError}var Ta;Ta||(Ta={});var M={...Lg,...Fg,iso:ku},Zz=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Cz(e,n){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":n??"draft-2020-12"}function Dz(e,n){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return n.rootSchema;let o=n.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let i=r[1];if(!i||!n.defs[i])throw Error(`Reference not found: ${e}`);return n.defs[i]}throw Error(`Reference not found: ${e}`)}function y_(e,n){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return M.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let i=e.$ref;if(n.refs.has(i))return n.refs.get(i);if(n.processing.has(i))return M.lazy(()=>{if(!n.refs.has(i))throw Error(`Circular reference not resolved: ${i}`);return n.refs.get(i)});n.processing.add(i);let a=Dz(i,n),s=Ce(a,n);return n.refs.set(i,s),n.processing.delete(i),s}if(e.enum!==void 0){let i=e.enum;if(n.version==="openapi-3.0"&&e.nullable===!0&&i.length===1&&i[0]===null)return M.null();if(i.length===0)return M.never();if(i.length===1)return M.literal(i[0]);if(i.every(s=>typeof s=="string"))return M.enum(i);let a=i.map(s=>M.literal(s));return a.length<2?a[0]:M.union([a[0],a[1],...a.slice(2)])}if(e.const!==void 0)return M.literal(e.const);let r=e.type;if(Array.isArray(r)){let i=r.map(a=>{let s={...e,type:a};return y_(s,n)});return i.length===0?M.never():i.length===1?i[0]:M.union(i)}if(!r)return M.any();let o;switch(r){case"string":{let i=M.string();if(e.format){let a=e.format;a==="email"?i=i.check(M.email()):a==="uri"||a==="uri-reference"?i=i.check(M.url()):a==="uuid"||a==="guid"?i=i.check(M.uuid()):a==="date-time"?i=i.check(M.iso.datetime()):a==="date"?i=i.check(M.iso.date()):a==="time"?i=i.check(M.iso.time()):a==="duration"?i=i.check(M.iso.duration()):a==="ipv4"?i=i.check(M.ipv4()):a==="ipv6"?i=i.check(M.ipv6()):a==="mac"?i=i.check(M.mac()):a==="cidr"?i=i.check(M.cidrv4()):a==="cidr-v6"?i=i.check(M.cidrv6()):a==="base64"?i=i.check(M.base64()):a==="base64url"?i=i.check(M.base64url()):a==="e164"?i=i.check(M.e164()):a==="jwt"?i=i.check(M.jwt()):a==="emoji"?i=i.check(M.emoji()):a==="nanoid"?i=i.check(M.nanoid()):a==="cuid"?i=i.check(M.cuid()):a==="cuid2"?i=i.check(M.cuid2()):a==="ulid"?i=i.check(M.ulid()):a==="xid"?i=i.check(M.xid()):a==="ksuid"&&(i=i.check(M.ksuid()))}typeof e.minLength=="number"&&(i=i.min(e.minLength)),typeof e.maxLength=="number"&&(i=i.max(e.maxLength)),e.pattern&&(i=i.regex(new RegExp(e.pattern))),o=i;break}case"number":case"integer":{let i=r==="integer"?M.number().int():M.number();typeof e.minimum=="number"&&(i=i.min(e.minimum)),typeof e.maximum=="number"&&(i=i.max(e.maximum)),typeof e.exclusiveMinimum=="number"?i=i.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(i=i.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?i=i.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(i=i.lt(e.maximum)),typeof e.multipleOf=="number"&&(i=i.multipleOf(e.multipleOf)),o=i;break}case"boolean":{o=M.boolean();break}case"null":{o=M.null();break}case"object":{let i={},a=e.properties||{},s=new Set(e.required||[]);for(let[l,c]of Object.entries(a)){let d=Ce(c,n);i[l]=s.has(l)?d:d.optional()}if(e.propertyNames){let l=Ce(e.propertyNames,n),c=e.additionalProperties&&typeof e.additionalProperties=="object"?Ce(e.additionalProperties,n):M.any();if(Object.keys(i).length===0){o=M.record(l,c);break}let d=M.object(i).passthrough(),f=M.looseRecord(l,c);o=M.intersection(d,f);break}if(e.patternProperties){let l=e.patternProperties,c=Object.keys(l),d=[];for(let h of c){let p=Ce(l[h],n),m=M.string().regex(new RegExp(h));d.push(M.looseRecord(m,p))}let f=[];if(Object.keys(i).length>0&&f.push(M.object(i).passthrough()),f.push(...d),f.length===0)o=M.object({}).passthrough();else if(f.length===1)o=f[0];else{let h=M.intersection(f[0],f[1]);for(let p=2;p<f.length;p++)h=M.intersection(h,f[p]);o=h}break}let u=M.object(i);e.additionalProperties===!1?o=u.strict():typeof e.additionalProperties=="object"?o=u.catchall(Ce(e.additionalProperties,n)):o=u.passthrough();break}case"array":{let{prefixItems:i,items:a}=e;if(i&&Array.isArray(i)){let s=i.map(l=>Ce(l,n)),u=a&&typeof a=="object"&&!Array.isArray(a)?Ce(a,n):void 0;u?o=M.tuple(s).rest(u):o=M.tuple(s),typeof e.minItems=="number"&&(o=o.check(M.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(M.maxLength(e.maxItems)))}else if(Array.isArray(a)){let s=a.map(l=>Ce(l,n)),u=e.additionalItems&&typeof e.additionalItems=="object"?Ce(e.additionalItems,n):void 0;u?o=M.tuple(s).rest(u):o=M.tuple(s),typeof e.minItems=="number"&&(o=o.check(M.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(M.maxLength(e.maxItems)))}else if(a!==void 0){let s=Ce(a,n),u=M.array(s);typeof e.minItems=="number"&&(u=u.min(e.minItems)),typeof e.maxItems=="number"&&(u=u.max(e.maxItems)),o=u}else o=M.array(M.any());break}default:throw Error(`Unsupported type: ${r}`)}return e.description&&(o=o.describe(e.description)),e.default!==void 0&&(o=o.default(e.default)),o}function Ce(e,n){if(typeof e=="boolean")return e?M.any():M.never();let r=y_(e,n),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let u=e.anyOf.map(c=>Ce(c,n)),l=M.union(u);r=o?M.intersection(r,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let u=e.oneOf.map(c=>Ce(c,n)),l=M.xor(u);r=o?M.intersection(r,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:M.any();else{let u=o?r:Ce(e.allOf[0],n),l=o?0:1;for(let c=l;c<e.allOf.length;c++)u=M.intersection(u,Ce(e.allOf[c],n));r=u}e.nullable===!0&&n.version==="openapi-3.0"&&(r=M.nullable(r)),e.readOnly===!0&&(r=M.readonly(r));let i={},a=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let u of a)u in e&&(i[u]=e[u]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let u of s)u in e&&(i[u]=e[u]);for(let u of Object.keys(e))Zz.has(u)||(i[u]=e[u]);return Object.keys(i).length>0&&n.registry.add(r,i),r}function Rz(e,n){if(typeof e=="boolean")return e?M.any():M.never();let r=Cz(e,n==null?void 0:n.defaultTarget),o=e.$defs||e.definitions||{},i={version:r,defs:o,refs:new Map,processing:new Set,rootSchema:e,registry:(n==null?void 0:n.registry)??at};return Ce(e,i)}var b_={};Mt(b_,{string:()=>Mz,number:()=>Lz,date:()=>Jz,boolean:()=>Fz,bigint:()=>qz});function Mz(e){return vm(Vr,e)}function Lz(e){return Sm(Gr,e)}function Fz(e){return Nm(Br,e)}function qz(e){return Am(Xr,e)}function Jz(e){return Hm(Wo,e)}De(cm());var Hz=_.union([_.literal("light"),_.literal("dark")]).describe("Color theme preference for the host environment."),vr=_.union([_.literal("inline"),_.literal("fullscreen"),_.literal("pip")]).describe("Display mode for UI presentation."),Vz=_.union([_.literal("--color-background-primary"),_.literal("--color-background-secondary"),_.literal("--color-background-tertiary"),_.literal("--color-background-inverse"),_.literal("--color-background-ghost"),_.literal("--color-background-info"),_.literal("--color-background-danger"),_.literal("--color-background-success"),_.literal("--color-background-warning"),_.literal("--color-background-disabled"),_.literal("--color-text-primary"),_.literal("--color-text-secondary"),_.literal("--color-text-tertiary"),_.literal("--color-text-inverse"),_.literal("--color-text-ghost"),_.literal("--color-text-info"),_.literal("--color-text-danger"),_.literal("--color-text-success"),_.literal("--color-text-warning"),_.literal("--color-text-disabled"),_.literal("--color-text-ghost"),_.literal("--color-border-primary"),_.literal("--color-border-secondary"),_.literal("--color-border-tertiary"),_.literal("--color-border-inverse"),_.literal("--color-border-ghost"),_.literal("--color-border-info"),_.literal("--color-border-danger"),_.literal("--color-border-success"),_.literal("--color-border-warning"),_.literal("--color-border-disabled"),_.literal("--color-ring-primary"),_.literal("--color-ring-secondary"),_.literal("--color-ring-inverse"),_.literal("--color-ring-info"),_.literal("--color-ring-danger"),_.literal("--color-ring-success"),_.literal("--color-ring-warning"),_.literal("--font-sans"),_.literal("--font-mono"),_.literal("--font-weight-normal"),_.literal("--font-weight-medium"),_.literal("--font-weight-semibold"),_.literal("--font-weight-bold"),_.literal("--font-text-xs-size"),_.literal("--font-text-sm-size"),_.literal("--font-text-md-size"),_.literal("--font-text-lg-size"),_.literal("--font-heading-xs-size"),_.literal("--font-heading-sm-size"),_.literal("--font-heading-md-size"),_.literal("--font-heading-lg-size"),_.literal("--font-heading-xl-size"),_.literal("--font-heading-2xl-size"),_.literal("--font-heading-3xl-size"),_.literal("--font-text-xs-line-height"),_.literal("--font-text-sm-line-height"),_.literal("--font-text-md-line-height"),_.literal("--font-text-lg-line-height"),_.literal("--font-heading-xs-line-height"),_.literal("--font-heading-sm-line-height"),_.literal("--font-heading-md-line-height"),_.literal("--font-heading-lg-line-height"),_.literal("--font-heading-xl-line-height"),_.literal("--font-heading-2xl-line-height"),_.literal("--font-heading-3xl-line-height"),_.literal("--border-radius-xs"),_.literal("--border-radius-sm"),_.literal("--border-radius-md"),_.literal("--border-radius-lg"),_.literal("--border-radius-xl"),_.literal("--border-radius-full"),_.literal("--border-width-regular"),_.literal("--shadow-hairline"),_.literal("--shadow-sm"),_.literal("--shadow-md"),_.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),Wz=_.record(Vz.describe(`Style variables for theming MCP apps.
46
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const h of e.seen.entries()){const f=h[1];if(n===h[0]){s(h);continue}if(e.external){const p=(c=e.external.registry.get(h[0]))==null?void 0:c.id;if(n!==h[0]&&p){s(h);continue}}if((l=e.metadataRegistry.get(h[0]))==null?void 0:l.id){s(h);continue}if(f.cycle){s(h);continue}if(f.count>1&&e.reused==="ref"){s(h);continue}}}function ua(e,n){var a,u,c;const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=l=>{const h=e.seen.get(l);if(h.ref===null)return;const f=h.def??h.schema,d={...f},p=h.ref;if(h.ref=null,p){i(p);const _=e.seen.get(p),y=_.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(y)):Object.assign(f,y),Object.assign(f,d),l._zod.parent===p)for(const w in f)w==="$ref"||w==="allOf"||w in d||delete f[w];if(y.$ref)for(const w in f)w==="$ref"||w==="allOf"||w in _.def&&JSON.stringify(f[w])===JSON.stringify(_.def[w])&&delete f[w]}const g=l._zod.parent;if(g&&g!==p){i(g);const _=e.seen.get(g);if(_!=null&&_.schema.$ref&&(f.$ref=_.schema.$ref,_.def))for(const y in f)y==="$ref"||y==="allOf"||y in _.def&&JSON.stringify(f[y])===JSON.stringify(_.def[y])&&delete f[y]}e.override({zodSchema:l,jsonSchema:f,path:h.path??[]})};for(const l of[...e.seen.entries()].reverse())i(l[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const l=(u=e.external.registry.get(n))==null?void 0:u.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Object.assign(o,r.def??r.schema);const s=((c=e.external)==null?void 0:c.defs)??{};for(const l of e.seen.entries()){const h=l[1];h.def&&h.defId&&(s[h.defId]=h.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...n["~standard"],jsonSchema:{input:Kn(n,"input",e.processors),output:Kn(n,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function xe(e,n){const r=n??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return xe(i.element,r);if(i.type==="set")return xe(i.valueType,r);if(i.type==="lazy")return xe(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return xe(i.innerType,r);if(i.type==="intersection")return xe(i.left,r)||xe(i.right,r);if(i.type==="record"||i.type==="map")return xe(i.keyType,r)||xe(i.valueType,r);if(i.type==="pipe")return xe(i.in,r)||xe(i.out,r);if(i.type==="object"){for(const o in i.shape)if(xe(i.shape[o],r))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(xe(o,r))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(xe(o,r))return!0;return!!(i.rest&&xe(i.rest,r))}return!1}const rh=(e,n={})=>r=>{const i=sa({...r,processors:n});return ge(e,i),aa(i,e),ua(i,e)},Kn=(e,n,r={})=>i=>{const{libraryOptions:o,target:s}=i??{},a=sa({...o??{},target:s,io:n,processors:r});return ge(e,a),aa(a,e),ua(a,e)},ih={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oh=(e,n,r,i)=>{const o=r;o.type="string";const{minimum:s,maximum:a,format:u,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof a=="number"&&(o.maxLength=a),u&&(o.format=ih[u]??u,o.format===""&&delete o.format,u==="time"&&delete o.format),l&&(o.contentEncoding=l),c&&c.size>0){const h=[...c];h.length===1?o.pattern=h[0].source:h.length>1&&(o.allOf=[...h.map(f=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},sh=(e,n,r,i)=>{const o=r,{minimum:s,maximum:a,format:u,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:h}=e._zod.bag;typeof u=="string"&&u.includes("int")?o.type="integer":o.type="number",typeof h=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(o.minimum=h,o.exclusiveMinimum=!0):o.exclusiveMinimum=h),typeof s=="number"&&(o.minimum=s,typeof h=="number"&&n.target!=="draft-04"&&(h>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof l=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(o.maximum=l,o.exclusiveMaximum=!0):o.exclusiveMaximum=l),typeof a=="number"&&(o.maximum=a,typeof l=="number"&&n.target!=="draft-04"&&(l<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof c=="number"&&(o.multipleOf=c)},ah=(e,n,r,i)=>{r.type="boolean"},uh=(e,n,r,i)=>{n.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},ch=(e,n,r,i)=>{if(n.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},lh=(e,n,r,i)=>{r.not={}},fh=(e,n,r,i)=>{},hh=(e,n,r,i)=>{const o=e._zod.def,s=js(o.entries);s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},dh=(e,n,r,i)=>{const o=e._zod.def,s=[];for(const a of o.values)if(a===void 0){if(n.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(n.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];r.type=a===null?"null":typeof a,n.target==="draft-04"||n.target==="openapi-3.0"?r.enum=[a]:r.const=a}else s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),s.every(a=>typeof a=="boolean")&&(r.type="boolean"),s.every(a=>a===null)&&(r.type="null"),r.enum=s},ph=(e,n,r,i)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},gh=(e,n,r,i)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},mh=(e,n,r,i)=>{const o=r,s=e._zod.def,{minimum:a,maximum:u}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof u=="number"&&(o.maxItems=u),o.type="array",o.items=ge(s.element,n,{...i,path:[...i.path,"items"]})},_h=(e,n,r,i)=>{var l;const o=r,s=e._zod.def;o.type="object",o.properties={};const a=s.shape;for(const h in a)o.properties[h]=ge(a[h],n,{...i,path:[...i.path,"properties",h]});const u=new Set(Object.keys(a)),c=new Set([...u].filter(h=>{const f=s.shape[h]._zod;return n.io==="input"?f.optin===void 0:f.optout===void 0}));c.size>0&&(o.required=Array.from(c)),((l=s.catchall)==null?void 0:l._zod.def.type)==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=ge(s.catchall,n,{...i,path:[...i.path,"additionalProperties"]})):n.io==="output"&&(o.additionalProperties=!1)},yh=(e,n,r,i)=>{const o=e._zod.def,s=o.inclusive===!1,a=o.options.map((u,c)=>ge(u,n,{...i,path:[...i.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=a:r.anyOf=a},vh=(e,n,r,i)=>{const o=e._zod.def,s=ge(o.left,n,{...i,path:[...i.path,"allOf",0]}),a=ge(o.right,n,{...i,path:[...i.path,"allOf",1]}),u=l=>"allOf"in l&&Object.keys(l).length===1,c=[...u(s)?s.allOf:[s],...u(a)?a.allOf:[a]];r.allOf=c},bh=(e,n,r,i)=>{const o=r,s=e._zod.def;o.type="object";const a=s.keyType,u=a._zod.bag,c=u==null?void 0:u.patterns;if(s.mode==="loose"&&c&&c.size>0){const h=ge(s.valueType,n,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const f of c)o.patternProperties[f.source]=h}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(o.propertyNames=ge(s.keyType,n,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=ge(s.valueType,n,{...i,path:[...i.path,"additionalProperties"]});const l=a._zod.values;if(l){const h=[...l].filter(f=>typeof f=="string"||typeof f=="number");h.length>0&&(o.required=h)}},wh=(e,n,r,i)=>{const o=e._zod.def,s=ge(o.innerType,n,i),a=n.seen.get(e);n.target==="openapi-3.0"?(a.ref=o.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},xh=(e,n,r,i)=>{const o=e._zod.def;ge(o.innerType,n,i);const s=n.seen.get(e);s.ref=o.innerType},kh=(e,n,r,i)=>{const o=e._zod.def;ge(o.innerType,n,i);const s=n.seen.get(e);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},Sh=(e,n,r,i)=>{const o=e._zod.def;ge(o.innerType,n,i);const s=n.seen.get(e);s.ref=o.innerType,n.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},zh=(e,n,r,i)=>{const o=e._zod.def;ge(o.innerType,n,i);const s=n.seen.get(e);s.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Th=(e,n,r,i)=>{const o=e._zod.def,s=n.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;ge(s,n,i);const a=n.seen.get(e);a.ref=s},Ch=(e,n,r,i)=>{const o=e._zod.def;ge(o.innerType,n,i);const s=n.seen.get(e);s.ref=o.innerType,r.readOnly=!0},ca=(e,n,r,i)=>{const o=e._zod.def;ge(o.innerType,n,i);const s=n.seen.get(e);s.ref=o.innerType};function yi(e){return!!e._zod}function la(e,n){return yi(e)?Hs(e,n):e.safeParse(n)}function Ph(e){var r,i;if(!e)return;let n;if(yi(e)?n=(i=(r=e._zod)==null?void 0:r.def)==null?void 0:i.shape:n=e.shape,!!n){if(typeof n=="function")try{return n()}catch{return}return n}}function Eh(e){var o;if(yi(e)){const a=(o=e._zod)==null?void 0:o.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}const r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}const i=e.value;if(i!==void 0)return i}const Ah=A("ZodISODateTime",(e,n)=>{wl.init(e,n),de.init(e,n)});function fa(e){return Af(Ah,e)}const Rh=A("ZodISODate",(e,n)=>{xl.init(e,n),de.init(e,n)});function $h(e){return Rf(Rh,e)}const Ih=A("ZodISOTime",(e,n)=>{kl.init(e,n),de.init(e,n)});function Mh(e){return $f(Ih,e)}const Oh=A("ZodISODuration",(e,n)=>{Sl.init(e,n),de.init(e,n)});function Nh(e){return If(Oh,e)}const Dh=(e,n)=>{Ls.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>dc(e,r)},flatten:{value:r=>hc(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ur,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ur,2)}},isEmpty:{get(){return e.issues.length===0}}})},qe=A("ZodError",Dh,{Parent:Error}),jh=gi(qe),Zh=mi(qe),qh=pr(qe),Uh=gr(qe),Lh=gc(qe),Fh=mc(qe),Hh=_c(qe),Vh=yc(qe),Bh=vc(qe),Wh=bc(qe),Jh=wc(qe),Gh=xc(qe),ue=A("ZodType",(e,n)=>(ae.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:Kn(e,"input"),output:Kn(e,"output")}}),e.toJSONSchema=rh(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...r)=>e.clone(yt(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(r,i)=>vt(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.parse=(r,i)=>jh(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>qh(e,r,i),e.parseAsync=async(r,i)=>Zh(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Uh(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>Lh(e,r,i),e.decode=(r,i)=>Fh(e,r,i),e.encodeAsync=async(r,i)=>Hh(e,r,i),e.decodeAsync=async(r,i)=>Vh(e,r,i),e.safeEncode=(r,i)=>Bh(e,r,i),e.safeDecode=(r,i)=>Wh(e,r,i),e.safeEncodeAsync=async(r,i)=>Jh(e,r,i),e.safeDecodeAsync=async(r,i)=>Gh(e,r,i),e.refine=(r,i)=>e.check(Ud(r,i)),e.superRefine=r=>e.check(Ld(r)),e.overwrite=r=>e.check(Ft(r)),e.optional=()=>pe(e),e.exactOptional=()=>Pd(e),e.nullable=()=>Co(e),e.nullish=()=>pe(Co(e)),e.nonoptional=r=>Md(e,r),e.array=()=>B(e),e.or=r=>G([e,r]),e.and=r=>vi(e,r),e.transform=r=>Vr(e,ya(r)),e.default=r=>Rd(e,r),e.prefault=r=>Id(e,r),e.catch=r=>Nd(e,r),e.pipe=r=>Vr(e,r),e.readonly=()=>Zd(e),e.describe=r=>{const i=e.clone();return Qt.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){var r;return(r=Qt.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Qt.get(e);const i=e.clone();return Qt.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),ha=A("_ZodString",(e,n)=>{_i.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(i,o,s)=>oh(e,i,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(Uf(...i)),e.includes=(...i)=>e.check(Hf(...i)),e.startsWith=(...i)=>e.check(Vf(...i)),e.endsWith=(...i)=>e.check(Bf(...i)),e.min=(...i)=>e.check(Xn(...i)),e.max=(...i)=>e.check(ia(...i)),e.length=(...i)=>e.check(oa(...i)),e.nonempty=(...i)=>e.check(Xn(1,...i)),e.lowercase=i=>e.check(Lf(i)),e.uppercase=i=>e.check(Ff(i)),e.trim=()=>e.check(Jf()),e.normalize=(...i)=>e.check(Wf(...i)),e.toLowerCase=()=>e.check(Gf()),e.toUpperCase=()=>e.check(Xf()),e.slugify=()=>e.check(Kf())}),Xh=A("ZodString",(e,n)=>{_i.init(e,n),ha.init(e,n),e.email=r=>e.check(cf(Kh,r)),e.url=r=>e.check(pf(Yh,r)),e.jwt=r=>e.check(Ef(dd,r)),e.emoji=r=>e.check(gf(Qh,r)),e.guid=r=>e.check(wo(zo,r)),e.uuid=r=>e.check(lf(Mn,r)),e.uuidv4=r=>e.check(ff(Mn,r)),e.uuidv6=r=>e.check(hf(Mn,r)),e.uuidv7=r=>e.check(df(Mn,r)),e.nanoid=r=>e.check(mf(ed,r)),e.guid=r=>e.check(wo(zo,r)),e.cuid=r=>e.check(_f(td,r)),e.cuid2=r=>e.check(yf(nd,r)),e.ulid=r=>e.check(vf(rd,r)),e.base64=r=>e.check(Tf(ld,r)),e.base64url=r=>e.check(Cf(fd,r)),e.xid=r=>e.check(bf(id,r)),e.ksuid=r=>e.check(wf(od,r)),e.ipv4=r=>e.check(xf(sd,r)),e.ipv6=r=>e.check(kf(ad,r)),e.cidrv4=r=>e.check(Sf(ud,r)),e.cidrv6=r=>e.check(zf(cd,r)),e.e164=r=>e.check(Pf(hd,r)),e.datetime=r=>e.check(fa(r)),e.date=r=>e.check($h(r)),e.time=r=>e.check(Mh(r)),e.duration=r=>e.check(Nh(r))});function T(e){return uf(Xh,e)}const de=A("ZodStringFormat",(e,n)=>{fe.init(e,n),ha.init(e,n)}),Kh=A("ZodEmail",(e,n)=>{hl.init(e,n),de.init(e,n)}),zo=A("ZodGUID",(e,n)=>{ll.init(e,n),de.init(e,n)}),Mn=A("ZodUUID",(e,n)=>{fl.init(e,n),de.init(e,n)}),Yh=A("ZodURL",(e,n)=>{dl.init(e,n),de.init(e,n)}),Qh=A("ZodEmoji",(e,n)=>{pl.init(e,n),de.init(e,n)}),ed=A("ZodNanoID",(e,n)=>{gl.init(e,n),de.init(e,n)}),td=A("ZodCUID",(e,n)=>{ml.init(e,n),de.init(e,n)}),nd=A("ZodCUID2",(e,n)=>{_l.init(e,n),de.init(e,n)}),rd=A("ZodULID",(e,n)=>{yl.init(e,n),de.init(e,n)}),id=A("ZodXID",(e,n)=>{vl.init(e,n),de.init(e,n)}),od=A("ZodKSUID",(e,n)=>{bl.init(e,n),de.init(e,n)}),sd=A("ZodIPv4",(e,n)=>{zl.init(e,n),de.init(e,n)}),ad=A("ZodIPv6",(e,n)=>{Tl.init(e,n),de.init(e,n)}),ud=A("ZodCIDRv4",(e,n)=>{Cl.init(e,n),de.init(e,n)}),cd=A("ZodCIDRv6",(e,n)=>{Pl.init(e,n),de.init(e,n)}),ld=A("ZodBase64",(e,n)=>{El.init(e,n),de.init(e,n)}),fd=A("ZodBase64URL",(e,n)=>{Rl.init(e,n),de.init(e,n)}),hd=A("ZodE164",(e,n)=>{$l.init(e,n),de.init(e,n)}),dd=A("ZodJWT",(e,n)=>{Ml.init(e,n),de.init(e,n)}),da=A("ZodNumber",(e,n)=>{Qs.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(i,o,s)=>sh(e,i,o),e.gt=(i,o)=>e.check(ko(i,o)),e.gte=(i,o)=>e.check(Er(i,o)),e.min=(i,o)=>e.check(Er(i,o)),e.lt=(i,o)=>e.check(xo(i,o)),e.lte=(i,o)=>e.check(Pr(i,o)),e.max=(i,o)=>e.check(Pr(i,o)),e.int=i=>e.check(To(i)),e.safe=i=>e.check(To(i)),e.positive=i=>e.check(ko(0,i)),e.nonnegative=i=>e.check(Er(0,i)),e.negative=i=>e.check(xo(0,i)),e.nonpositive=i=>e.check(Pr(0,i)),e.multipleOf=(i,o)=>e.check(So(i,o)),e.step=(i,o)=>e.check(So(i,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function J(e){return Mf(da,e)}const pd=A("ZodNumberFormat",(e,n)=>{Ol.init(e,n),da.init(e,n)});function To(e){return Of(pd,e)}const gd=A("ZodBoolean",(e,n)=>{Nl.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>ah(e,r,i)});function oe(e){return Nf(gd,e)}const md=A("ZodUndefined",(e,n)=>{Dl.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>ch(e,r)});function Fr(e){return Df(md,e)}const _d=A("ZodNull",(e,n)=>{jl.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>uh(e,r,i)});function pa(e){return jf(_d,e)}const yd=A("ZodUnknown",(e,n)=>{Zl.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>fh()});function ie(){return Zf(yd)}const vd=A("ZodNever",(e,n)=>{ql.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>lh(e,r,i)});function bd(e){return qf(vd,e)}const wd=A("ZodArray",(e,n)=>{Ul.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>mh(e,r,i,o),e.element=n.element,e.min=(r,i)=>e.check(Xn(r,i)),e.nonempty=r=>e.check(Xn(1,r)),e.max=(r,i)=>e.check(ia(r,i)),e.length=(r,i)=>e.check(oa(r,i)),e.unwrap=()=>e.element});function B(e,n){return Yf(wd,e,n)}const ga=A("ZodObject",(e,n)=>{Fl.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>_h(e,r,i,o),Q(e,"shape",()=>n.shape),e.keyof=()=>$e(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ie()}),e.loose=()=>e.clone({...e._zod.def,catchall:ie()}),e.strict=()=>e.clone({...e._zod.def,catchall:bd()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>ac(e,r),e.safeExtend=r=>uc(e,r),e.merge=r=>cc(e,r),e.pick=r=>oc(e,r),e.omit=r=>sc(e,r),e.partial=(...r)=>lc(va,e,r[0]),e.required=(...r)=>fc(ba,e,r[0])});function E(e,n){const r={type:"object",shape:e??{},...Z(n)};return new ga(r)}function ze(e,n){return new ga({type:"object",shape:e,catchall:ie(),...Z(n)})}const ma=A("ZodUnion",(e,n)=>{na.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>yh(e,r,i,o),e.options=n.options});function G(e,n){return new ma({type:"union",options:e,...Z(n)})}const xd=A("ZodDiscriminatedUnion",(e,n)=>{ma.init(e,n),Hl.init(e,n)});function _a(e,n,r){return new xd({type:"union",options:n,discriminator:e,...Z(r)})}const kd=A("ZodIntersection",(e,n)=>{Vl.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>vh(e,r,i,o)});function vi(e,n){return new kd({type:"intersection",left:e,right:n})}const Sd=A("ZodRecord",(e,n)=>{Bl.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>bh(e,r,i,o),e.keyType=n.keyType,e.valueType=n.valueType});function ne(e,n,r){return new Sd({type:"record",keyType:e,valueType:n,...Z(r)})}const Hr=A("ZodEnum",(e,n)=>{Wl.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(i,o,s)=>hh(e,i,o),e.enum=n.entries,e.options=Object.values(n.entries);const r=new Set(Object.keys(n.entries));e.extract=(i,o)=>{const s={};for(const a of i)if(r.has(a))s[a]=n.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Hr({...n,checks:[],...Z(o),entries:s})},e.exclude=(i,o)=>{const s={...n.entries};for(const a of i)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new Hr({...n,checks:[],...Z(o),entries:s})}});function $e(e,n){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Hr({type:"enum",entries:r,...Z(n)})}const zd=A("ZodLiteral",(e,n)=>{Jl.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>dh(e,r,i),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function S(e,n){return new zd({type:"literal",values:Array.isArray(e)?e:[e],...Z(n)})}const Td=A("ZodTransform",(e,n)=>{Gl.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>gh(e,r),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ns(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(ln(s,r.value,n));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(ln(a))}};const o=n.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function ya(e){return new Td({type:"transform",transform:e})}const va=A("ZodOptional",(e,n)=>{ra.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>ca(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function pe(e){return new va({type:"optional",innerType:e})}const Cd=A("ZodExactOptional",(e,n)=>{Xl.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>ca(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function Pd(e){return new Cd({type:"optional",innerType:e})}const Ed=A("ZodNullable",(e,n)=>{Kl.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>wh(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function Co(e){return new Ed({type:"nullable",innerType:e})}const Ad=A("ZodDefault",(e,n)=>{Yl.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>kh(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Rd(e,n){return new Ad({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():qs(n)}})}const $d=A("ZodPrefault",(e,n)=>{Ql.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>Sh(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function Id(e,n){return new $d({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():qs(n)}})}const ba=A("ZodNonOptional",(e,n)=>{ef.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>xh(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function Md(e,n){return new ba({type:"nonoptional",innerType:e,...Z(n)})}const Od=A("ZodCatch",(e,n)=>{tf.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>zh(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Nd(e,n){return new Od({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const Dd=A("ZodPipe",(e,n)=>{nf.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>Th(e,r,i,o),e.in=n.in,e.out=n.out});function Vr(e,n){return new Dd({type:"pipe",in:e,out:n})}const jd=A("ZodReadonly",(e,n)=>{rf.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>Ch(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});function Zd(e){return new jd({type:"readonly",innerType:e})}const wa=A("ZodCustom",(e,n)=>{of.init(e,n),ue.init(e,n),e._zod.processJSONSchema=(r,i,o)=>ph(e,r)});function qd(e,n){return Qf(wa,e??(()=>!0),n)}function Ud(e,n={}){return eh(wa,e,n)}function Ld(e){return th(e)}function xa(e,n){return Vr(ya(e),n)}const xt="io.modelcontextprotocol/related-task",_r="2.0",me=qd(e=>e!==null&&(typeof e=="object"||typeof e=="function")),ka=G([T(),J().int()]),Sa=T();ze({ttl:G([J(),pa()]).optional(),pollInterval:J().optional()});const Fd=E({ttl:J().optional()}),Hd=E({taskId:T()}),bi=ze({progressToken:ka.optional(),[xt]:Hd.optional()}),Ie=E({_meta:bi.optional()}),vn=Ie.extend({task:Fd.optional()}),Vd=e=>vn.safeParse(e).success,_e=E({method:T(),params:Ie.loose().optional()}),Ue=E({_meta:bi.optional()}),Le=E({method:T(),params:Ue.loose().optional()}),ye=ze({_meta:bi.optional()}),bn=G([T(),J().int()]),za=E({jsonrpc:S(_r),id:bn,..._e.shape}).strict(),Po=e=>za.safeParse(e).success,Ta=E({jsonrpc:S(_r),...Le.shape}).strict(),Bd=e=>Ta.safeParse(e).success,wi=E({jsonrpc:S(_r),id:bn,result:ye}).strict(),On=e=>wi.safeParse(e).success;var te;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(te||(te={}));const xi=E({jsonrpc:S(_r),id:bn.optional(),error:E({code:J().int(),message:T(),data:ie().optional()})}).strict(),Wd=e=>xi.safeParse(e).success,Jd=G([za,Ta,wi,xi]);G([wi,xi]);const ki=ye.strict(),Gd=Ue.extend({requestId:bn.optional(),reason:T().optional()}),Si=Le.extend({method:S("notifications/cancelled"),params:Gd}),Xd=E({src:T(),mimeType:T().optional(),sizes:B(T()).optional(),theme:$e(["light","dark"]).optional()}),wn=E({icons:B(Xd).optional()}),Zt=E({name:T(),title:T().optional()}),yr=Zt.extend({...Zt.shape,...wn.shape,version:T(),websiteUrl:T().optional(),description:T().optional()}),Kd=vi(E({applyDefaults:oe().optional()}),ne(T(),ie())),Yd=xa(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,vi(E({form:Kd.optional(),url:me.optional()}),ne(T(),ie()).optional())),Qd=ze({list:me.optional(),cancel:me.optional(),requests:ze({sampling:ze({createMessage:me.optional()}).optional(),elicitation:ze({create:me.optional()}).optional()}).optional()}),ep=ze({list:me.optional(),cancel:me.optional(),requests:ze({tools:ze({call:me.optional()}).optional()}).optional()}),tp=E({experimental:ne(T(),me).optional(),sampling:E({context:me.optional(),tools:me.optional()}).optional(),elicitation:Yd.optional(),roots:E({listChanged:oe().optional()}).optional(),tasks:Qd.optional()}),np=Ie.extend({protocolVersion:T(),capabilities:tp,clientInfo:yr}),rp=_e.extend({method:S("initialize"),params:np}),ip=E({experimental:ne(T(),me).optional(),logging:me.optional(),completions:me.optional(),prompts:E({listChanged:oe().optional()}).optional(),resources:E({subscribe:oe().optional(),listChanged:oe().optional()}).optional(),tools:E({listChanged:oe().optional()}).optional(),tasks:ep.optional()}),op=ye.extend({protocolVersion:T(),capabilities:ip,serverInfo:yr,instructions:T().optional()}),sp=Le.extend({method:S("notifications/initialized"),params:Ue.optional()}),vr=_e.extend({method:S("ping"),params:Ie.optional()}),ap=E({progress:J(),total:pe(J()),message:pe(T())}),up=E({...Ue.shape,...ap.shape,progressToken:ka}),zi=Le.extend({method:S("notifications/progress"),params:up}),cp=Ie.extend({cursor:Sa.optional()}),xn=_e.extend({params:cp.optional()}),kn=ye.extend({nextCursor:Sa.optional()}),lp=$e(["working","input_required","completed","failed","cancelled"]),Sn=E({taskId:T(),status:lp,ttl:G([J(),pa()]),createdAt:T(),lastUpdatedAt:T(),pollInterval:pe(J()),statusMessage:pe(T())}),Ti=ye.extend({task:Sn}),fp=Ue.merge(Sn),Yn=Le.extend({method:S("notifications/tasks/status"),params:fp}),Ci=_e.extend({method:S("tasks/get"),params:Ie.extend({taskId:T()})}),Pi=ye.merge(Sn),Ei=_e.extend({method:S("tasks/result"),params:Ie.extend({taskId:T()})});ye.loose();const Ai=xn.extend({method:S("tasks/list")}),Ri=kn.extend({tasks:B(Sn)}),$i=_e.extend({method:S("tasks/cancel"),params:Ie.extend({taskId:T()})}),hp=ye.merge(Sn),Ca=E({uri:T(),mimeType:pe(T()),_meta:ne(T(),ie()).optional()}),Pa=Ca.extend({text:T()}),Ii=T().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ea=Ca.extend({blob:Ii}),zn=$e(["user","assistant"]),Ht=E({audience:B(zn).optional(),priority:J().min(0).max(1).optional(),lastModified:fa({offset:!0}).optional()}),Aa=E({...Zt.shape,...wn.shape,uri:T(),description:pe(T()),mimeType:pe(T()),annotations:Ht.optional(),_meta:pe(ze({}))}),dp=E({...Zt.shape,...wn.shape,uriTemplate:T(),description:pe(T()),mimeType:pe(T()),annotations:Ht.optional(),_meta:pe(ze({}))}),pp=xn.extend({method:S("resources/list")}),Ra=kn.extend({resources:B(Aa)}),gp=xn.extend({method:S("resources/templates/list")}),mp=kn.extend({resourceTemplates:B(dp)}),Mi=Ie.extend({uri:T()}),_p=Mi,yp=_e.extend({method:S("resources/read"),params:_p}),$a=ye.extend({contents:B(G([Pa,Ea]))}),vp=Le.extend({method:S("notifications/resources/list_changed"),params:Ue.optional()}),bp=Mi,wp=_e.extend({method:S("resources/subscribe"),params:bp}),xp=Mi,kp=_e.extend({method:S("resources/unsubscribe"),params:xp}),Sp=Ue.extend({uri:T()}),zp=Le.extend({method:S("notifications/resources/updated"),params:Sp}),Tp=E({name:T(),description:pe(T()),required:pe(oe())}),Cp=E({...Zt.shape,...wn.shape,description:pe(T()),arguments:pe(B(Tp)),_meta:pe(ze({}))}),Pp=xn.extend({method:S("prompts/list")}),Ep=kn.extend({prompts:B(Cp)}),Ap=Ie.extend({name:T(),arguments:ne(T(),T()).optional()}),Rp=_e.extend({method:S("prompts/get"),params:Ap}),Oi=E({type:S("text"),text:T(),annotations:Ht.optional(),_meta:ne(T(),ie()).optional()}),Ni=E({type:S("image"),data:Ii,mimeType:T(),annotations:Ht.optional(),_meta:ne(T(),ie()).optional()}),Di=E({type:S("audio"),data:Ii,mimeType:T(),annotations:Ht.optional(),_meta:ne(T(),ie()).optional()}),$p=E({type:S("tool_use"),name:T(),id:T(),input:ne(T(),ie()),_meta:ne(T(),ie()).optional()}),Ia=E({type:S("resource"),resource:G([Pa,Ea]),annotations:Ht.optional(),_meta:ne(T(),ie()).optional()}),Ma=Aa.extend({type:S("resource_link")}),Tn=G([Oi,Ni,Di,Ma,Ia]),Ip=E({role:zn,content:Tn}),Mp=ye.extend({description:T().optional(),messages:B(Ip)}),Op=Le.extend({method:S("notifications/prompts/list_changed"),params:Ue.optional()}),Np=E({title:T().optional(),readOnlyHint:oe().optional(),destructiveHint:oe().optional(),idempotentHint:oe().optional(),openWorldHint:oe().optional()}),Dp=E({taskSupport:$e(["required","optional","forbidden"]).optional()}),ji=E({...Zt.shape,...wn.shape,description:T().optional(),inputSchema:E({type:S("object"),properties:ne(T(),me).optional(),required:B(T()).optional()}).catchall(ie()),outputSchema:E({type:S("object"),properties:ne(T(),me).optional(),required:B(T()).optional()}).catchall(ie()).optional(),annotations:Np.optional(),execution:Dp.optional(),_meta:ne(T(),ie()).optional()}),Oa=xn.extend({method:S("tools/list")}),jp=kn.extend({tools:B(ji)}),br=ye.extend({content:B(Tn).default([]),structuredContent:ne(T(),ie()).optional(),isError:oe().optional()});br.or(ye.extend({toolResult:ie()}));const Zp=vn.extend({name:T(),arguments:ne(T(),ie()).optional()}),Na=_e.extend({method:S("tools/call"),params:Zp}),qp=Le.extend({method:S("notifications/tools/list_changed"),params:Ue.optional()});E({autoRefresh:oe().default(!0),debounceMs:J().int().nonnegative().default(300)});const Da=$e(["debug","info","notice","warning","error","critical","alert","emergency"]),Up=Ie.extend({level:Da}),Lp=_e.extend({method:S("logging/setLevel"),params:Up}),Fp=Ue.extend({level:Da,logger:T().optional(),data:ie()}),Hp=Le.extend({method:S("notifications/message"),params:Fp}),Vp=E({name:T().optional()}),Bp=E({hints:B(Vp).optional(),costPriority:J().min(0).max(1).optional(),speedPriority:J().min(0).max(1).optional(),intelligencePriority:J().min(0).max(1).optional()}),Wp=E({mode:$e(["auto","required","none"]).optional()}),Jp=E({type:S("tool_result"),toolUseId:T().describe("The unique identifier for the corresponding tool call."),content:B(Tn).default([]),structuredContent:E({}).loose().optional(),isError:oe().optional(),_meta:ne(T(),ie()).optional()}),Gp=_a("type",[Oi,Ni,Di]),Qn=_a("type",[Oi,Ni,Di,$p,Jp]),Xp=E({role:zn,content:G([Qn,B(Qn)]),_meta:ne(T(),ie()).optional()}),Kp=vn.extend({messages:B(Xp),modelPreferences:Bp.optional(),systemPrompt:T().optional(),includeContext:$e(["none","thisServer","allServers"]).optional(),temperature:J().optional(),maxTokens:J().int(),stopSequences:B(T()).optional(),metadata:me.optional(),tools:B(ji).optional(),toolChoice:Wp.optional()}),Yp=_e.extend({method:S("sampling/createMessage"),params:Kp}),Qp=ye.extend({model:T(),stopReason:pe($e(["endTurn","stopSequence","maxTokens"]).or(T())),role:zn,content:Gp}),eg=ye.extend({model:T(),stopReason:pe($e(["endTurn","stopSequence","maxTokens","toolUse"]).or(T())),role:zn,content:G([Qn,B(Qn)])}),tg=E({type:S("boolean"),title:T().optional(),description:T().optional(),default:oe().optional()}),ng=E({type:S("string"),title:T().optional(),description:T().optional(),minLength:J().optional(),maxLength:J().optional(),format:$e(["email","uri","date","date-time"]).optional(),default:T().optional()}),rg=E({type:$e(["number","integer"]),title:T().optional(),description:T().optional(),minimum:J().optional(),maximum:J().optional(),default:J().optional()}),ig=E({type:S("string"),title:T().optional(),description:T().optional(),enum:B(T()),default:T().optional()}),og=E({type:S("string"),title:T().optional(),description:T().optional(),oneOf:B(E({const:T(),title:T()})),default:T().optional()}),sg=E({type:S("string"),title:T().optional(),description:T().optional(),enum:B(T()),enumNames:B(T()).optional(),default:T().optional()}),ag=G([ig,og]),ug=E({type:S("array"),title:T().optional(),description:T().optional(),minItems:J().optional(),maxItems:J().optional(),items:E({type:S("string"),enum:B(T())}),default:B(T()).optional()}),cg=E({type:S("array"),title:T().optional(),description:T().optional(),minItems:J().optional(),maxItems:J().optional(),items:E({anyOf:B(E({const:T(),title:T()}))}),default:B(T()).optional()}),lg=G([ug,cg]),fg=G([sg,ag,lg]),hg=G([fg,tg,ng,rg]),dg=vn.extend({mode:S("form").optional(),message:T(),requestedSchema:E({type:S("object"),properties:ne(T(),hg),required:B(T()).optional()})}),pg=vn.extend({mode:S("url"),message:T(),elicitationId:T(),url:T().url()}),gg=G([dg,pg]),mg=_e.extend({method:S("elicitation/create"),params:gg}),_g=Ue.extend({elicitationId:T()}),yg=Le.extend({method:S("notifications/elicitation/complete"),params:_g}),vg=ye.extend({action:$e(["accept","decline","cancel"]),content:xa(e=>e===null?void 0:e,ne(T(),G([T(),J(),oe(),B(T())])).optional())}),bg=E({type:S("ref/resource"),uri:T()}),wg=E({type:S("ref/prompt"),name:T()}),xg=Ie.extend({ref:G([wg,bg]),argument:E({name:T(),value:T()}),context:E({arguments:ne(T(),T()).optional()}).optional()}),kg=_e.extend({method:S("completion/complete"),params:xg}),Sg=ye.extend({completion:ze({values:B(T()).max(100),total:pe(J().int()),hasMore:pe(oe())})}),zg=E({uri:T().startsWith("file://"),name:T().optional(),_meta:ne(T(),ie()).optional()}),Tg=_e.extend({method:S("roots/list"),params:Ie.optional()}),Cg=ye.extend({roots:B(zg)}),Pg=Le.extend({method:S("notifications/roots/list_changed"),params:Ue.optional()});G([vr,rp,kg,Lp,Rp,Pp,pp,gp,yp,wp,kp,Na,Oa,Ci,Ei,Ai,$i]);G([Si,zi,sp,Pg,Yn]);G([ki,Qp,eg,vg,Cg,Pi,Ri,Ti]);G([vr,Yp,mg,Tg,Ci,Ei,Ai,$i]);G([Si,zi,Hp,zp,vp,qp,Op,Yn,yg]);G([ki,op,Sg,Mp,Ep,Ra,mp,$a,br,jp,Pi,Ri,Ti]);class X extends Error{constructor(n,r,i){super(`MCP error ${n}: ${r}`),this.code=n,this.data=i,this.name="McpError"}static fromError(n,r,i){if(n===te.UrlElicitationRequired&&i){const o=i;if(o.elicitations)return new Eg(o.elicitations,r)}return new X(n,r,i)}}class Eg extends X{constructor(n,r=`URL elicitation${n.length>1?"s":""} required`){super(te.UrlElicitationRequired,r,{elicitations:n})}get elicitations(){var n;return((n=this.data)==null?void 0:n.elicitations)??[]}}function bt(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Eo(e){const n=Ph(e),r=n==null?void 0:n.method;if(!r)throw new Error("Schema is missing a method literal");const i=Eh(r);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function Ao(e,n){const r=la(e,n);if(!r.success)throw r.error;return r.data}const Ag=6e4;class Rg{constructor(n){this._options=n,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(Si,r=>{this._oncancel(r)}),this.setNotificationHandler(zi,r=>{this._onprogress(r)}),this.setRequestHandler(vr,r=>({})),this._taskStore=n==null?void 0:n.taskStore,this._taskMessageQueue=n==null?void 0:n.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Ci,async(r,i)=>{const o=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!o)throw new X(te.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Ei,async(r,i)=>{const o=async()=>{var u;const s=r.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(s,i.sessionId);){if(c.type==="response"||c.type==="error"){const l=c.message,h=l.id,f=this._requestResolvers.get(h);if(f)if(this._requestResolvers.delete(h),c.type==="response")f(l);else{const d=l,p=new X(d.error.code,d.error.message,d.error.data);f(p)}else{const d=c.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${h}`))}continue}await((u=this._transport)==null?void 0:u.send(c.message,{relatedRequestId:i.requestId}))}}const a=await this._taskStore.getTask(s,i.sessionId);if(!a)throw new X(te.InvalidParams,`Task not found: ${s}`);if(!bt(a.status))return await this._waitForTaskUpdate(s,i.signal),await o();if(bt(a.status)){const c=await this._taskStore.getTaskResult(s,i.sessionId);return this._clearTaskQueue(s),{...c,_meta:{...c._meta,[xt]:{taskId:s}}}}return await o()};return await o()}),this.setRequestHandler(Ai,async(r,i)=>{var o;try{const{tasks:s,nextCursor:a}=await this._taskStore.listTasks((o=r.params)==null?void 0:o.cursor,i.sessionId);return{tasks:s,nextCursor:a,_meta:{}}}catch(s){throw new X(te.InvalidParams,`Failed to list tasks: ${s instanceof Error?s.message:String(s)}`)}}),this.setRequestHandler($i,async(r,i)=>{try{const o=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!o)throw new X(te.InvalidParams,`Task not found: ${r.params.taskId}`);if(bt(o.status))throw new X(te.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",i.sessionId),this._clearTaskQueue(r.params.taskId);const s=await this._taskStore.getTask(r.params.taskId,i.sessionId);if(!s)throw new X(te.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof X?o:new X(te.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(n){if(!n.params.requestId)return;const r=this._requestHandlerAbortControllers.get(n.params.requestId);r==null||r.abort(n.params.reason)}_setupTimeout(n,r,i,o,s=!1){this._timeoutInfo.set(n,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:i,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(n){const r=this._timeoutInfo.get(n);if(!r)return!1;const i=Date.now()-r.startTime;if(r.maxTotalTimeout&&i>=r.maxTotalTimeout)throw this._timeoutInfo.delete(n),X.fromError(te.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:i});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(n){const r=this._timeoutInfo.get(n);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(n))}async connect(n){var s,a,u;this._transport=n;const r=(s=this.transport)==null?void 0:s.onclose;this._transport.onclose=()=>{r==null||r(),this._onclose()};const i=(a=this.transport)==null?void 0:a.onerror;this._transport.onerror=c=>{i==null||i(c),this._onerror(c)};const o=(u=this._transport)==null?void 0:u.onmessage;this._transport.onmessage=(c,l)=>{o==null||o(c,l),On(c)||Wd(c)?this._onresponse(c):Po(c)?this._onrequest(c,l):Bd(c)?this._onnotification(c):this._onerror(new Error(`Unknown message type: ${JSON.stringify(c)}`))},await this._transport.start()}_onclose(){var i;const n=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();const r=X.fromError(te.ConnectionClosed,"Connection closed");this._transport=void 0,(i=this.onclose)==null||i.call(this);for(const o of n.values())o(r)}_onerror(n){var r;(r=this.onerror)==null||r.call(this,n)}_onnotification(n){const r=this._notificationHandlers.get(n.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(n)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(n,r){var h,f,d,p;const i=this._requestHandlers.get(n.method)??this.fallbackRequestHandler,o=this._transport,s=(d=(f=(h=n.params)==null?void 0:h._meta)==null?void 0:f[xt])==null?void 0:d.taskId;if(i===void 0){const g={jsonrpc:"2.0",id:n.id,error:{code:te.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:g,timestamp:Date.now()},o==null?void 0:o.sessionId).catch(_=>this._onerror(new Error(`Failed to enqueue error response: ${_}`))):o==null||o.send(g).catch(_=>this._onerror(new Error(`Failed to send an error response: ${_}`)));return}const a=new AbortController;this._requestHandlerAbortControllers.set(n.id,a);const u=Vd(n.params)?n.params.task:void 0,c=this._taskStore?this.requestTaskStore(n,o==null?void 0:o.sessionId):void 0,l={signal:a.signal,sessionId:o==null?void 0:o.sessionId,_meta:(p=n.params)==null?void 0:p._meta,sendNotification:async g=>{const _={relatedRequestId:n.id};s&&(_.relatedTask={taskId:s}),await this.notification(g,_)},sendRequest:async(g,_,y)=>{var C;const m={...y,relatedRequestId:n.id};s&&!m.relatedTask&&(m.relatedTask={taskId:s});const w=((C=m.relatedTask)==null?void 0:C.taskId)??s;return w&&c&&await c.updateTaskStatus(w,"input_required"),await this.request(g,_,m)},authInfo:r==null?void 0:r.authInfo,requestId:n.id,requestInfo:r==null?void 0:r.requestInfo,taskId:s,taskStore:c,taskRequestedTtl:u==null?void 0:u.ttl,closeSSEStream:r==null?void 0:r.closeSSEStream,closeStandaloneSSEStream:r==null?void 0:r.closeStandaloneSSEStream};Promise.resolve().then(()=>{u&&this.assertTaskHandlerCapability(n.method)}).then(()=>i(n,l)).then(async g=>{if(a.signal.aborted)return;const _={result:g,jsonrpc:"2.0",id:n.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:_,timestamp:Date.now()},o==null?void 0:o.sessionId):await(o==null?void 0:o.send(_))},async g=>{if(a.signal.aborted)return;const _={jsonrpc:"2.0",id:n.id,error:{code:Number.isSafeInteger(g.code)?g.code:te.InternalError,message:g.message??"Internal error",...g.data!==void 0&&{data:g.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:_,timestamp:Date.now()},o==null?void 0:o.sessionId):await(o==null?void 0:o.send(_))}).catch(g=>this._onerror(new Error(`Failed to send response: ${g}`))).finally(()=>{this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(n){const{progressToken:r,...i}=n.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(n)}`));return}const a=this._responseHandlers.get(o),u=this._timeoutInfo.get(o);if(u&&a&&u.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),a(c);return}s(i)}_onresponse(n){const r=Number(n.id),i=this._requestResolvers.get(r);if(i){if(this._requestResolvers.delete(r),On(n))i(n);else{const a=new X(n.error.code,n.error.message,n.error.data);i(a)}return}const o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(n)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(On(n)&&n.result&&typeof n.result=="object"){const a=n.result;if(a.task&&typeof a.task=="object"){const u=a.task;typeof u.taskId=="string"&&(s=!0,this._taskProgressTokens.set(u.taskId,r))}}if(s||this._progressHandlers.delete(r),On(n))o(n);else{const a=X.fromError(n.error.code,n.error.message,n.error.data);o(a)}}get transport(){return this._transport}async close(){var n;await((n=this._transport)==null?void 0:n.close())}async*requestStream(n,r,i){var a,u;const{task:o}=i??{};if(!o){try{yield{type:"result",result:await this.request(n,r,i)}}catch(c){yield{type:"error",error:c instanceof X?c:new X(te.InternalError,String(c))}}return}let s;try{const c=await this.request(n,Ti,i);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new X(te.InternalError,"Task creation did not return a task");for(;;){const l=await this.getTask({taskId:s},i);if(yield{type:"taskStatus",task:l},bt(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,i)}:l.status==="failed"?yield{type:"error",error:new X(te.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new X(te.InternalError,`Task ${s} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,i)};return}const h=l.pollInterval??((a=this._options)==null?void 0:a.defaultTaskPollInterval)??1e3;await new Promise(f=>setTimeout(f,h)),(u=i==null?void 0:i.signal)==null||u.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof X?c:new X(te.InternalError,String(c))}}}request(n,r,i){const{relatedRequestId:o,resumptionToken:s,onresumptiontoken:a,task:u,relatedTask:c}=i??{};return new Promise((l,h)=>{var w,C,b,v,k;const f=x=>{h(x)};if(!this._transport){f(new Error("Not connected"));return}if(((w=this._options)==null?void 0:w.enforceStrictCapabilities)===!0)try{this.assertCapabilityForMethod(n.method),u&&this.assertTaskCapability(n.method)}catch(x){f(x);return}(C=i==null?void 0:i.signal)==null||C.throwIfAborted();const d=this._requestMessageId++,p={...n,jsonrpc:"2.0",id:d};i!=null&&i.onprogress&&(this._progressHandlers.set(d,i.onprogress),p.params={...n.params,_meta:{...((b=n.params)==null?void 0:b._meta)||{},progressToken:d}}),u&&(p.params={...p.params,task:u}),c&&(p.params={...p.params,_meta:{...((v=p.params)==null?void 0:v._meta)||{},[xt]:c}});const g=x=>{var M;this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),(M=this._transport)==null||M.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String(x)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:a}).catch($=>this._onerror(new Error(`Failed to send cancellation: ${$}`)));const P=x instanceof X?x:new X(te.RequestTimeout,String(x));h(P)};this._responseHandlers.set(d,x=>{var P;if(!((P=i==null?void 0:i.signal)!=null&&P.aborted)){if(x instanceof Error)return h(x);try{const M=la(r,x.result);M.success?l(M.data):h(M.error)}catch(M){h(M)}}}),(k=i==null?void 0:i.signal)==null||k.addEventListener("abort",()=>{var x;g((x=i==null?void 0:i.signal)==null?void 0:x.reason)});const _=(i==null?void 0:i.timeout)??Ag,y=()=>g(X.fromError(te.RequestTimeout,"Request timed out",{timeout:_}));this._setupTimeout(d,_,i==null?void 0:i.maxTotalTimeout,y,(i==null?void 0:i.resetTimeoutOnProgress)??!1);const m=c==null?void 0:c.taskId;if(m){const x=P=>{const M=this._responseHandlers.get(d);M?M(P):this._onerror(new Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,x),this._enqueueTaskMessage(m,{type:"request",message:p,timestamp:Date.now()}).catch(P=>{this._cleanupTimeout(d),h(P)})}else this._transport.send(p,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:a}).catch(x=>{this._cleanupTimeout(d),h(x)})})}async getTask(n,r){return this.request({method:"tasks/get",params:n},Pi,r)}async getTaskResult(n,r,i){return this.request({method:"tasks/result",params:n},r,i)}async listTasks(n,r){return this.request({method:"tasks/list",params:n},Ri,r)}async cancelTask(n,r){return this.request({method:"tasks/cancel",params:n},hp,r)}async notification(n,r){var u,c,l,h;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(n.method);const i=(u=r==null?void 0:r.relatedTask)==null?void 0:u.taskId;if(i){const f={...n,jsonrpc:"2.0",params:{...n.params,_meta:{...((c=n.params)==null?void 0:c._meta)||{},[xt]:r.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:f,timestamp:Date.now()});return}if((((l=this._options)==null?void 0:l.debouncedNotificationMethods)??[]).includes(n.method)&&!n.params&&!(r!=null&&r.relatedRequestId)&&!(r!=null&&r.relatedTask)){if(this._pendingDebouncedNotifications.has(n.method))return;this._pendingDebouncedNotifications.add(n.method),Promise.resolve().then(()=>{var d,p;if(this._pendingDebouncedNotifications.delete(n.method),!this._transport)return;let f={...n,jsonrpc:"2.0"};r!=null&&r.relatedTask&&(f={...f,params:{...f.params,_meta:{...((d=f.params)==null?void 0:d._meta)||{},[xt]:r.relatedTask}}}),(p=this._transport)==null||p.send(f,r).catch(g=>this._onerror(g))});return}let a={...n,jsonrpc:"2.0"};r!=null&&r.relatedTask&&(a={...a,params:{...a.params,_meta:{...((h=a.params)==null?void 0:h._meta)||{},[xt]:r.relatedTask}}}),await this._transport.send(a,r)}setRequestHandler(n,r){const i=Eo(n);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(o,s)=>{const a=Ao(n,o);return Promise.resolve(r(a,s))})}removeRequestHandler(n){this._requestHandlers.delete(n)}assertCanSetRequestHandler(n){if(this._requestHandlers.has(n))throw new Error(`A request handler for ${n} already exists, which would be overridden`)}setNotificationHandler(n,r){const i=Eo(n);this._notificationHandlers.set(i,o=>{const s=Ao(n,o);return Promise.resolve(r(s))})}removeNotificationHandler(n){this._notificationHandlers.delete(n)}_cleanupTaskProgressHandler(n){const r=this._taskProgressTokens.get(n);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(n))}async _enqueueTaskMessage(n,r,i){var s;if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const o=(s=this._options)==null?void 0:s.maxTaskQueueSize;await this._taskMessageQueue.enqueue(n,r,i,o)}async _clearTaskQueue(n,r){if(this._taskMessageQueue){const i=await this._taskMessageQueue.dequeueAll(n,r);for(const o of i)if(o.type==="request"&&Po(o.message)){const s=o.message.id,a=this._requestResolvers.get(s);a?(a(new X(te.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${n} cleanup`))}}}async _waitForTaskUpdate(n,r){var o,s;let i=((o=this._options)==null?void 0:o.defaultTaskPollInterval)??1e3;try{const a=await((s=this._taskStore)==null?void 0:s.getTask(n));a!=null&&a.pollInterval&&(i=a.pollInterval)}catch{}return new Promise((a,u)=>{if(r.aborted){u(new X(te.InvalidRequest,"Request cancelled"));return}const c=setTimeout(a,i);r.addEventListener("abort",()=>{clearTimeout(c),u(new X(te.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(n,r){const i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:async o=>{if(!n)throw new Error("No request provided");return await i.createTask(o,n.id,{method:n.method,params:n.params},r)},getTask:async o=>{const s=await i.getTask(o,r);if(!s)throw new X(te.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(o,s,a)=>{await i.storeTaskResult(o,s,a,r);const u=await i.getTask(o,r);if(u){const c=Yn.parse({method:"notifications/tasks/status",params:u});await this.notification(c),bt(u.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>i.getTaskResult(o,r),updateTaskStatus:async(o,s,a)=>{const u=await i.getTask(o,r);if(!u)throw new X(te.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(bt(u.status))throw new X(te.InvalidParams,`Cannot update task "${o}" from terminal status "${u.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(o,s,a,r);const c=await i.getTask(o,r);if(c){const l=Yn.parse({method:"notifications/tasks/status",params:c});await this.notification(l),bt(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>i.listTasks(o,r)}}}var $g="2026-01-26",Ig="ui/notifications/tool-input-partial";let Mg=class{constructor(n=window.parent,r){be(this,"eventTarget");be(this,"eventSource");be(this,"messageListener");be(this,"onclose");be(this,"onerror");be(this,"onmessage");be(this,"sessionId");be(this,"setProtocolVersion");this.eventTarget=n,this.eventSource=r,this.messageListener=i=>{var s,a,u;if(r&&i.source!==this.eventSource){console.debug("Ignoring message from unknown source",i);return}let o=Jd.safeParse(i.data);o.success?(console.debug("Parsed message",o.data),(s=this.onmessage)==null||s.call(this,o.data)):((a=i.data)==null?void 0:a.jsonrpc)!=="2.0"?console.debug("Ignoring non-JSON-RPC message",o.error.message,i):(console.error("Failed to parse message",o.error.message,i),(u=this.onerror)==null||u.call(this,Error("Invalid JSON-RPC message received: "+o.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(n,r){n.method!==Ig&&console.debug("Sending message",n),this.eventTarget.postMessage(n,"*")}async close(){var n;window.removeEventListener("message",this.messageListener),(n=this.onclose)==null||n.call(this)}};var Og=G([S("light"),S("dark")]).describe("Color theme preference for the host environment."),fn=G([S("inline"),S("fullscreen"),S("pip")]).describe("Display mode for UI presentation."),Ng=G([S("--color-background-primary"),S("--color-background-secondary"),S("--color-background-tertiary"),S("--color-background-inverse"),S("--color-background-ghost"),S("--color-background-info"),S("--color-background-danger"),S("--color-background-success"),S("--color-background-warning"),S("--color-background-disabled"),S("--color-text-primary"),S("--color-text-secondary"),S("--color-text-tertiary"),S("--color-text-inverse"),S("--color-text-ghost"),S("--color-text-info"),S("--color-text-danger"),S("--color-text-success"),S("--color-text-warning"),S("--color-text-disabled"),S("--color-border-primary"),S("--color-border-secondary"),S("--color-border-tertiary"),S("--color-border-inverse"),S("--color-border-ghost"),S("--color-border-info"),S("--color-border-danger"),S("--color-border-success"),S("--color-border-warning"),S("--color-border-disabled"),S("--color-ring-primary"),S("--color-ring-secondary"),S("--color-ring-inverse"),S("--color-ring-info"),S("--color-ring-danger"),S("--color-ring-success"),S("--color-ring-warning"),S("--font-sans"),S("--font-mono"),S("--font-weight-normal"),S("--font-weight-medium"),S("--font-weight-semibold"),S("--font-weight-bold"),S("--font-text-xs-size"),S("--font-text-sm-size"),S("--font-text-md-size"),S("--font-text-lg-size"),S("--font-heading-xs-size"),S("--font-heading-sm-size"),S("--font-heading-md-size"),S("--font-heading-lg-size"),S("--font-heading-xl-size"),S("--font-heading-2xl-size"),S("--font-heading-3xl-size"),S("--font-text-xs-line-height"),S("--font-text-sm-line-height"),S("--font-text-md-line-height"),S("--font-text-lg-line-height"),S("--font-heading-xs-line-height"),S("--font-heading-sm-line-height"),S("--font-heading-md-line-height"),S("--font-heading-lg-line-height"),S("--font-heading-xl-line-height"),S("--font-heading-2xl-line-height"),S("--font-heading-3xl-line-height"),S("--border-radius-xs"),S("--border-radius-sm"),S("--border-radius-md"),S("--border-radius-lg"),S("--border-radius-xl"),S("--border-radius-full"),S("--border-width-regular"),S("--shadow-hairline"),S("--shadow-sm"),S("--shadow-md"),S("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),Dg=ne(Ng.describe(`Style variables for theming MCP apps.
86
47
 
87
48
  Individual style keys are optional - hosts may provide any subset of these values.
88
49
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
89
50
 
90
51
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
91
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),_.union([_.string(),_.undefined()]).describe(`Style variables for theming MCP apps.
52
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),G([T(),Fr()]).describe(`Style variables for theming MCP apps.
92
53
 
93
54
  Individual style keys are optional - hosts may provide any subset of these values.
94
55
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
@@ -100,10 +61,10 @@ Individual style keys are optional - hosts may provide any subset of these value
100
61
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
101
62
 
102
63
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
103
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);_.object({method:_.literal("ui/open-link"),params:_.object({url:_.string().describe("URL to open in the host's browser")})});var Gz=_.object({isError:_.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),Bz=_.object({isError:_.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),Xz=_.object({isError:_.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();_.object({method:_.literal("ui/notifications/sandbox-proxy-ready"),params:_.object({})});var yl=_.object({connectDomains:_.array(_.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
64
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);E({method:S("ui/open-link"),params:E({url:T().describe("URL to open in the host's browser")})});var jg=E({isError:oe().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),Zg=E({isError:oe().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),qg=E({isError:oe().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();E({method:S("ui/notifications/sandbox-proxy-ready"),params:E({})});var Zi=E({connectDomains:B(T()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
104
65
 
105
66
  - Maps to CSP \`connect-src\` directive
106
- - Empty or omitted → no network connections (secure default)`),resourceDomains:_.array(_.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:_.array(_.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:_.array(_.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),bl=_.object({camera:_.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:_.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:_.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:_.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")});_.object({method:_.literal("ui/notifications/size-changed"),params:_.object({width:_.number().optional().describe("New width in pixels."),height:_.number().optional().describe("New height in pixels.")})});var Kz=_.object({method:_.literal("ui/notifications/tool-input"),params:_.object({arguments:_.record(_.string(),_.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),Yz=_.object({method:_.literal("ui/notifications/tool-input-partial"),params:_.object({arguments:_.record(_.string(),_.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),Qz=_.object({method:_.literal("ui/notifications/tool-cancelled"),params:_.object({reason:_.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),e2=_.object({fonts:_.string().optional()}),t2=_.object({variables:Wz.optional().describe("CSS variables for theming the app."),css:e2.optional().describe("CSS blocks that apps can inject.")}),n2=_.object({method:_.literal("ui/resource-teardown"),params:_.object({})});_.record(_.string(),_.unknown());var Oc=_.object({text:_.object({}).optional().describe("Host supports text content blocks."),image:_.object({}).optional().describe("Host supports image content blocks."),audio:_.object({}).optional().describe("Host supports audio content blocks."),resource:_.object({}).optional().describe("Host supports resource content blocks."),resourceLink:_.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:_.object({}).optional().describe("Host supports structured content.")}),r2=_.object({experimental:_.object({}).optional().describe("Experimental features (structure TBD)."),openLinks:_.object({}).optional().describe("Host supports opening external URLs."),downloadFile:_.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:_.object({listChanged:_.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:_.object({listChanged:_.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:_.object({}).optional().describe("Host accepts log messages."),sandbox:_.object({permissions:bl.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:yl.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:Oc.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:Oc.optional().describe("Host supports receiving content messages (ui/message) from the view.")}),i2=_.object({experimental:_.object({}).optional().describe("Experimental features (structure TBD)."),tools:_.object({listChanged:_.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:_.array(vr).optional().describe("Display modes the app supports.")});_.object({method:_.literal("ui/notifications/initialized"),params:_.object({}).optional()});_.object({csp:yl.optional().describe("Content Security Policy configuration for UI resources."),permissions:bl.optional().describe("Sandbox permissions requested by the UI resource."),domain:_.string().optional().describe(`Dedicated origin for view sandbox.
67
+ - Empty or omitted → no network connections (secure default)`),resourceDomains:B(T()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:B(T()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:B(T()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),qi=E({camera:E({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:E({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:E({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:E({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")});E({method:S("ui/notifications/size-changed"),params:E({width:J().optional().describe("New width in pixels."),height:J().optional().describe("New height in pixels.")})});var Ug=E({method:S("ui/notifications/tool-input"),params:E({arguments:ne(T(),ie().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),Lg=E({method:S("ui/notifications/tool-input-partial"),params:E({arguments:ne(T(),ie().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),Fg=E({method:S("ui/notifications/tool-cancelled"),params:E({reason:T().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),Hg=E({fonts:T().optional()}),Vg=E({variables:Dg.optional().describe("CSS variables for theming the app."),css:Hg.optional().describe("CSS blocks that apps can inject.")}),Bg=E({method:S("ui/resource-teardown"),params:E({})});ne(T(),ie());var Ro=E({text:E({}).optional().describe("Host supports text content blocks."),image:E({}).optional().describe("Host supports image content blocks."),audio:E({}).optional().describe("Host supports audio content blocks."),resource:E({}).optional().describe("Host supports resource content blocks."),resourceLink:E({}).optional().describe("Host supports resource link content blocks."),structuredContent:E({}).optional().describe("Host supports structured content.")}),Wg=E({experimental:E({}).optional().describe("Experimental features (structure TBD)."),openLinks:E({}).optional().describe("Host supports opening external URLs."),downloadFile:E({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:E({listChanged:oe().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:E({listChanged:oe().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:E({}).optional().describe("Host accepts log messages."),sandbox:E({permissions:qi.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:Zi.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:Ro.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:Ro.optional().describe("Host supports receiving content messages (ui/message) from the view.")}),Jg=E({experimental:E({}).optional().describe("Experimental features (structure TBD)."),tools:E({listChanged:oe().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:B(fn).optional().describe("Display modes the app supports.")});E({method:S("ui/notifications/initialized"),params:E({}).optional()});E({csp:Zi.optional().describe("Content Security Policy configuration for UI resources."),permissions:qi.optional().describe("Sandbox permissions requested by the UI resource."),domain:T().optional().describe(`Dedicated origin for view sandbox.
107
68
 
108
69
  Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
109
70
 
@@ -111,19 +72,19 @@ Useful when views need stable, dedicated origins for OAuth callbacks, CORS polic
111
72
  - Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
112
73
  - URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
113
74
 
114
- If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:_.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.
75
+ If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:oe().optional().describe(`Visual boundary preference - true if view prefers a visible border.
115
76
 
116
77
  Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
117
78
 
118
79
  - \`true\`: request visible border + background
119
80
  - \`false\`: request no visible border + background
120
- - omitted: host decides border`)});_.object({method:_.literal("ui/request-display-mode"),params:_.object({mode:vr.describe("The display mode being requested.")})});var o2=_.object({mode:vr.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),a2=_.union([_.literal("model"),_.literal("app")]).describe("Tool visibility scope - who can access the tool.");_.object({resourceUri:_.string().optional(),visibility:_.array(a2).optional().describe(`Who can access this tool. Default: ["model", "app"]
81
+ - omitted: host decides border`)});E({method:S("ui/request-display-mode"),params:E({mode:fn.describe("The display mode being requested.")})});var Gg=E({mode:fn.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),Xg=G([S("model"),S("app")]).describe("Tool visibility scope - who can access the tool.");E({resourceUri:T().optional(),visibility:B(Xg).optional().describe(`Who can access this tool. Default: ["model", "app"]
121
82
  - "model": Tool visible to and callable by the agent
122
- - "app": Tool callable by the app from this server only`)});_.object({mimeTypes:_.array(_.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});_.object({method:_.literal("ui/download-file"),params:_.object({contents:_.array(_.union([Pd,Td])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});_.object({method:_.literal("ui/message"),params:_.object({role:_.literal("user").describe('Message role, currently only "user" is supported.'),content:_.array(Nr).describe("Message content blocks (text, image, etc.).")})});_.object({method:_.literal("ui/notifications/sandbox-resource-ready"),params:_.object({html:_.string().describe("HTML content to load into the inner iframe."),sandbox:_.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:yl.optional().describe("CSP configuration from resource metadata."),permissions:bl.optional().describe("Sandbox permissions from resource metadata.")})});var s2=_.object({method:_.literal("ui/notifications/tool-result"),params:uo.describe("Standard MCP tool execution result.")}),$_=_.object({toolInfo:_.object({id:Ir.optional().describe("JSON-RPC id of the tools/call request."),tool:ks.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:Hz.optional().describe("Current color theme preference."),styles:t2.optional().describe("Style configuration for theming the app."),displayMode:vr.optional().describe("How the UI is currently displayed."),availableDisplayModes:_.array(vr).optional().describe("Display modes the host supports."),containerDimensions:_.union([_.object({height:_.number().describe("Fixed container height in pixels.")}),_.object({maxHeight:_.union([_.number(),_.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(_.union([_.object({width:_.number().describe("Fixed container width in pixels.")}),_.object({maxWidth:_.union([_.number(),_.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
123
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:_.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:_.string().optional().describe("User's timezone in IANA format."),userAgent:_.string().optional().describe("Host application identifier."),platform:_.union([_.literal("web"),_.literal("desktop"),_.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:_.object({touch:_.boolean().optional().describe("Whether the device supports touch input."),hover:_.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:_.object({top:_.number().describe("Top safe area inset in pixels."),right:_.number().describe("Right safe area inset in pixels."),bottom:_.number().describe("Bottom safe area inset in pixels."),left:_.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),u2=_.object({method:_.literal("ui/notifications/host-context-changed"),params:$_.describe("Partial context update containing only changed fields.")});_.object({method:_.literal("ui/update-model-context"),params:_.object({content:_.array(Nr).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:_.record(_.string(),_.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});_.object({method:_.literal("ui/initialize"),params:_.object({appInfo:ao.describe("App identification (name and version)."),appCapabilities:i2.describe("Features and capabilities this app provides."),protocolVersion:_.string().describe("Protocol version this app supports.")})});var l2=_.object({protocolVersion:_.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:ao.describe("Host application identification and version."),hostCapabilities:r2.describe("Features and capabilities provided by the host."),hostContext:$_.describe("Rich context about the host environment.")}).passthrough();class c2 extends c1{constructor(r,o={},i={autoResize:!0}){super(i);je(this,"_appInfo");je(this,"_capabilities");je(this,"options");je(this,"_hostCapabilities");je(this,"_hostInfo");je(this,"_hostContext");je(this,"sendOpenLink",this.openLink);this._appInfo=r,this._capabilities=o,this.options=i,this.setRequestHandler(so,a=>(console.log("Received ping:",a.params),{})),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput(r){this.setNotificationHandler(Kz,o=>r(o.params))}set ontoolinputpartial(r){this.setNotificationHandler(Yz,o=>r(o.params))}set ontoolresult(r){this.setNotificationHandler(s2,o=>r(o.params))}set ontoolcancelled(r){this.setNotificationHandler(Qz,o=>r(o.params))}set onhostcontextchanged(r){this.setNotificationHandler(u2,o=>{this._hostContext={...this._hostContext,...o.params},r(o.params)})}set onteardown(r){this.setRequestHandler(n2,(o,i)=>r(o.params,i))}set oncalltool(r){this.setRequestHandler(Nd,(o,i)=>r(o.params,i))}set onlisttools(r){this.setRequestHandler(Ed,(o,i)=>r(o.params,i))}assertCapabilityForMethod(r){}assertRequestHandlerCapability(r){switch(r){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${r})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${r} registered`)}}assertNotificationCapability(r){}assertTaskCapability(r){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(r){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(r,o){if(typeof r=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${r}"). Did you mean: callServerTool({ name: "${r}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:r},uo,o)}sendMessage(r,o){return this.request({method:"ui/message",params:r},Xz,o)}sendLog(r){return this.notification({method:"notifications/message",params:r})}updateModelContext(r,o){return this.request({method:"ui/update-model-context",params:r},us,o)}openLink(r,o){return this.request({method:"ui/open-link",params:r},Gz,o)}downloadFile(r,o){return this.request({method:"ui/download-file",params:r},Bz,o)}requestDisplayMode(r,o){return this.request({method:"ui/request-display-mode",params:r},o2,o)}sendSizeChanged(r){return this.notification({method:"ui/notifications/size-changed",params:r})}setupSizeChangedNotifications(){let r=!1,o=0,i=0,a=()=>{r||(r=!0,requestAnimationFrame(()=>{r=!1;let u=document.documentElement,l=u.style.width,c=u.style.height;u.style.width="fit-content",u.style.height="fit-content";let d=u.getBoundingClientRect();u.style.width=l,u.style.height=c;let f=window.innerWidth-u.clientWidth,h=Math.ceil(d.width+f),p=Math.ceil(d.height);(h!==o||p!==i)&&(o=h,i=p,this.sendSizeChanged({width:h,height:p}))}))};a();let s=new ResizeObserver(a);return s.observe(document.documentElement),s.observe(document.body),()=>s.disconnect()}async connect(r=new d1(window.parent,window.parent),o){var i;if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(r);try{let a=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:h1}},l2,o);if(a===void 0)throw Error(`Server sent invalid initialize result: ${a}`);this._hostCapabilities=a.hostCapabilities,this._hostInfo=a.hostInfo,this._hostContext=a.hostContext,await this.notification({method:"ui/notifications/initialized"}),(i=this.options)!=null&&i.autoResize&&this.setupSizeChangedNotifications()}catch(a){throw this.close(),a}}}function w_(e,n,r){var o,i=1;e==null&&(e=0),n==null&&(n=0),r==null&&(r=0);function a(){var s,u=o.length,l,c=0,d=0,f=0;for(s=0;s<u;++s)l=o[s],c+=l.x||0,d+=l.y||0,f+=l.z||0;for(c=(c/u-e)*i,d=(d/u-n)*i,f=(f/u-r)*i,s=0;s<u;++s)l=o[s],c&&(l.x-=c),d&&(l.y-=d),f&&(l.z-=f)}return a.initialize=function(s){o=s},a.x=function(s){return arguments.length?(e=+s,a):e},a.y=function(s){return arguments.length?(n=+s,a):n},a.z=function(s){return arguments.length?(r=+s,a):r},a.strength=function(s){return arguments.length?(i=+s,a):i},a}function f2(e){const n=+this._x.call(null,e);return k_(this.cover(n),n,e)}function k_(e,n,r){if(isNaN(n))return e;var o,i=e._root,a={data:r},s=e._x0,u=e._x1,l,c,d,f,h;if(!i)return e._root=a,e;for(;i.length;)if((d=n>=(l=(s+u)/2))?s=l:u=l,o=i,!(i=i[f=+d]))return o[f]=a,e;if(c=+e._x.call(null,i.data),n===c)return a.next=i,o?o[f]=a:e._root=a,e;do o=o?o[f]=new Array(2):e._root=new Array(2),(d=n>=(l=(s+u)/2))?s=l:u=l;while((f=+d)==(h=+(c>=l)));return o[h]=i,o[f]=a,e}function d2(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n);let o=1/0,i=-1/0;for(let a=0,s;a<n;++a)isNaN(s=+this._x.call(null,e[a]))||(r[a]=s,s<o&&(o=s),s>i&&(i=s));if(o>i)return this;this.cover(o).cover(i);for(let a=0;a<n;++a)k_(this,r[a],e[a]);return this}function h2(e){if(isNaN(e=+e))return this;var n=this._x0,r=this._x1;if(isNaN(n))r=(n=Math.floor(e))+1;else{for(var o=r-n||1,i=this._root,a,s;n>e||e>=r;)switch(s=+(e<n),a=new Array(2),a[s]=i,i=a,o*=2,s){case 0:r=n+o;break;case 1:n=r-o;break}this._root&&this._root.length&&(this._root=i)}return this._x0=n,this._x1=r,this}function p2(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function m2(e){return arguments.length?this.cover(+e[0][0]).cover(+e[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function Zt(e,n,r){this.node=e,this.x0=n,this.x1=r}function g2(e,n){var r,o=this._x0,i,a,s=this._x1,u=[],l=this._root,c,d;for(l&&u.push(new Zt(l,o,s)),n==null?n=1/0:(o=e-n,s=e+n);c=u.pop();)if(!(!(l=c.node)||(i=c.x0)>s||(a=c.x1)<o))if(l.length){var f=(i+a)/2;u.push(new Zt(l[1],f,a),new Zt(l[0],i,f)),(d=+(e>=f))&&(c=u[u.length-1],u[u.length-1]=u[u.length-1-d],u[u.length-1-d]=c)}else{var h=Math.abs(e-+this._x.call(null,l.data));h<n&&(n=h,o=e-h,s=e+h,r=l.data)}return r}function v2(e){if(isNaN(l=+this._x.call(null,e)))return this;var n,r=this._root,o,i,a,s=this._x0,u=this._x1,l,c,d,f,h;if(!r)return this;if(r.length)for(;;){if((d=l>=(c=(s+u)/2))?s=c:u=c,n=r,!(r=r[f=+d]))return this;if(!r.length)break;n[f+1&1]&&(o=n,h=f)}for(;r.data!==e;)if(i=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,i?(a?i.next=a:delete i.next,this):n?(a?n[f]=a:delete n[f],(r=n[0]||n[1])&&r===(n[1]||n[0])&&!r.length&&(o?o[h]=r:this._root=r),this):(this._root=a,this)}function _2(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function y2(){return this._root}function b2(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function $2(e){var n=[],r,o=this._root,i,a,s;for(o&&n.push(new Zt(o,this._x0,this._x1));r=n.pop();)if(!e(o=r.node,a=r.x0,s=r.x1)&&o.length){var u=(a+s)/2;(i=o[1])&&n.push(new Zt(i,u,s)),(i=o[0])&&n.push(new Zt(i,a,u))}return this}function w2(e){var n=[],r=[],o;for(this._root&&n.push(new Zt(this._root,this._x0,this._x1));o=n.pop();){var i=o.node;if(i.length){var a,s=o.x0,u=o.x1,l=(s+u)/2;(a=i[0])&&n.push(new Zt(a,s,l)),(a=i[1])&&n.push(new Zt(a,l,u))}r.push(o)}for(;o=r.pop();)e(o.node,o.x0,o.x1);return this}function k2(e){return e[0]}function x2(e){return arguments.length?(this._x=e,this):this._x}function $l(e,n){var r=new wl(n??k2,NaN,NaN);return e==null?r:r.addAll(e)}function wl(e,n,r){this._x=e,this._x0=n,this._x1=r,this._root=void 0}function Pc(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var We=$l.prototype=wl.prototype;We.copy=function(){var e=new wl(this._x,this._x0,this._x1),n=this._root,r,o;if(!n)return e;if(!n.length)return e._root=Pc(n),e;for(r=[{source:n,target:e._root=new Array(2)}];n=r.pop();)for(var i=0;i<2;++i)(o=n.source[i])&&(o.length?r.push({source:o,target:n.target[i]=new Array(2)}):n.target[i]=Pc(o));return e};We.add=f2;We.addAll=d2;We.cover=h2;We.data=p2;We.extent=m2;We.find=g2;We.remove=v2;We.removeAll=_2;We.root=y2;We.size=b2;We.visit=$2;We.visitAfter=w2;We.x=x2;function S2(e){const n=+this._x.call(null,e),r=+this._y.call(null,e);return x_(this.cover(n,r),n,r,e)}function x_(e,n,r,o){if(isNaN(n)||isNaN(r))return e;var i,a=e._root,s={data:o},u=e._x0,l=e._y0,c=e._x1,d=e._y1,f,h,p,m,v,y,g,w;if(!a)return e._root=s,e;for(;a.length;)if((v=n>=(f=(u+c)/2))?u=f:c=f,(y=r>=(h=(l+d)/2))?l=h:d=h,i=a,!(a=a[g=y<<1|v]))return i[g]=s,e;if(p=+e._x.call(null,a.data),m=+e._y.call(null,a.data),n===p&&r===m)return s.next=a,i?i[g]=s:e._root=s,e;do i=i?i[g]=new Array(4):e._root=new Array(4),(v=n>=(f=(u+c)/2))?u=f:c=f,(y=r>=(h=(l+d)/2))?l=h:d=h;while((g=y<<1|v)===(w=(m>=h)<<1|p>=f));return i[w]=a,i[g]=s,e}function I2(e){var n,r,o=e.length,i,a,s=new Array(o),u=new Array(o),l=1/0,c=1/0,d=-1/0,f=-1/0;for(r=0;r<o;++r)isNaN(i=+this._x.call(null,n=e[r]))||isNaN(a=+this._y.call(null,n))||(s[r]=i,u[r]=a,i<l&&(l=i),i>d&&(d=i),a<c&&(c=a),a>f&&(f=a));if(l>d||c>f)return this;for(this.cover(l,c).cover(d,f),r=0;r<o;++r)x_(this,s[r],u[r],e[r]);return this}function z2(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,o=this._y0,i=this._x1,a=this._y1;if(isNaN(r))i=(r=Math.floor(e))+1,a=(o=Math.floor(n))+1;else{for(var s=i-r||1,u=this._root,l,c;r>e||e>=i||o>n||n>=a;)switch(c=(n<o)<<1|e<r,l=new Array(4),l[c]=u,u=l,s*=2,c){case 0:i=r+s,a=o+s;break;case 1:r=i-s,a=o+s;break;case 2:i=r+s,o=a-s;break;case 3:r=i-s,o=a-s;break}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=o,this._x1=i,this._y1=a,this}function O2(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function P2(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Le(e,n,r,o,i){this.node=e,this.x0=n,this.y0=r,this.x1=o,this.y1=i}function T2(e,n,r){var o,i=this._x0,a=this._y0,s,u,l,c,d=this._x1,f=this._y1,h=[],p=this._root,m,v;for(p&&h.push(new Le(p,i,a,d,f)),r==null?r=1/0:(i=e-r,a=n-r,d=e+r,f=n+r,r*=r);m=h.pop();)if(!(!(p=m.node)||(s=m.x0)>d||(u=m.y0)>f||(l=m.x1)<i||(c=m.y1)<a))if(p.length){var y=(s+l)/2,g=(u+c)/2;h.push(new Le(p[3],y,g,l,c),new Le(p[2],s,g,y,c),new Le(p[1],y,u,l,g),new Le(p[0],s,u,y,g)),(v=(n>=g)<<1|e>=y)&&(m=h[h.length-1],h[h.length-1]=h[h.length-1-v],h[h.length-1-v]=m)}else{var w=e-+this._x.call(null,p.data),z=n-+this._y.call(null,p.data),$=w*w+z*z;if($<r){var b=Math.sqrt(r=$);i=e-b,a=n-b,d=e+b,f=n+b,o=p.data}}return o}function E2(e){if(isNaN(d=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var n,r=this._root,o,i,a,s=this._x0,u=this._y0,l=this._x1,c=this._y1,d,f,h,p,m,v,y,g;if(!r)return this;if(r.length)for(;;){if((m=d>=(h=(s+l)/2))?s=h:l=h,(v=f>=(p=(u+c)/2))?u=p:c=p,n=r,!(r=r[y=v<<1|m]))return this;if(!r.length)break;(n[y+1&3]||n[y+2&3]||n[y+3&3])&&(o=n,g=y)}for(;r.data!==e;)if(i=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,i?(a?i.next=a:delete i.next,this):n?(a?n[y]=a:delete n[y],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(o?o[g]=r:this._root=r),this):(this._root=a,this)}function N2(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function U2(){return this._root}function A2(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function j2(e){var n=[],r,o=this._root,i,a,s,u,l;for(o&&n.push(new Le(o,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(o=r.node,a=r.x0,s=r.y0,u=r.x1,l=r.y1)&&o.length){var c=(a+u)/2,d=(s+l)/2;(i=o[3])&&n.push(new Le(i,c,d,u,l)),(i=o[2])&&n.push(new Le(i,a,d,c,l)),(i=o[1])&&n.push(new Le(i,c,s,u,d)),(i=o[0])&&n.push(new Le(i,a,s,c,d))}return this}function Z2(e){var n=[],r=[],o;for(this._root&&n.push(new Le(this._root,this._x0,this._y0,this._x1,this._y1));o=n.pop();){var i=o.node;if(i.length){var a,s=o.x0,u=o.y0,l=o.x1,c=o.y1,d=(s+l)/2,f=(u+c)/2;(a=i[0])&&n.push(new Le(a,s,u,d,f)),(a=i[1])&&n.push(new Le(a,d,u,l,f)),(a=i[2])&&n.push(new Le(a,s,f,d,c)),(a=i[3])&&n.push(new Le(a,d,f,l,c))}r.push(o)}for(;o=r.pop();)e(o.node,o.x0,o.y0,o.x1,o.y1);return this}function C2(e){return e[0]}function D2(e){return arguments.length?(this._x=e,this):this._x}function R2(e){return e[1]}function M2(e){return arguments.length?(this._y=e,this):this._y}function kl(e,n,r){var o=new xl(n??C2,r??R2,NaN,NaN,NaN,NaN);return e==null?o:o.addAll(e)}function xl(e,n,r,o,i,a){this._x=e,this._y=n,this._x0=r,this._y0=o,this._x1=i,this._y1=a,this._root=void 0}function Tc(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var Fe=kl.prototype=xl.prototype;Fe.copy=function(){var e=new xl(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,r,o;if(!n)return e;if(!n.length)return e._root=Tc(n),e;for(r=[{source:n,target:e._root=new Array(4)}];n=r.pop();)for(var i=0;i<4;++i)(o=n.source[i])&&(o.length?r.push({source:o,target:n.target[i]=new Array(4)}):n.target[i]=Tc(o));return e};Fe.add=S2;Fe.addAll=I2;Fe.cover=z2;Fe.data=O2;Fe.extent=P2;Fe.find=T2;Fe.remove=E2;Fe.removeAll=N2;Fe.root=U2;Fe.size=A2;Fe.visit=j2;Fe.visitAfter=Z2;Fe.x=D2;Fe.y=M2;function L2(e){const n=+this._x.call(null,e),r=+this._y.call(null,e),o=+this._z.call(null,e);return S_(this.cover(n,r,o),n,r,o,e)}function S_(e,n,r,o,i){if(isNaN(n)||isNaN(r)||isNaN(o))return e;var a,s=e._root,u={data:i},l=e._x0,c=e._y0,d=e._z0,f=e._x1,h=e._y1,p=e._z1,m,v,y,g,w,z,$,b,k,x,O;if(!s)return e._root=u,e;for(;s.length;)if(($=n>=(m=(l+f)/2))?l=m:f=m,(b=r>=(v=(c+h)/2))?c=v:h=v,(k=o>=(y=(d+p)/2))?d=y:p=y,a=s,!(s=s[x=k<<2|b<<1|$]))return a[x]=u,e;if(g=+e._x.call(null,s.data),w=+e._y.call(null,s.data),z=+e._z.call(null,s.data),n===g&&r===w&&o===z)return u.next=s,a?a[x]=u:e._root=u,e;do a=a?a[x]=new Array(8):e._root=new Array(8),($=n>=(m=(l+f)/2))?l=m:f=m,(b=r>=(v=(c+h)/2))?c=v:h=v,(k=o>=(y=(d+p)/2))?d=y:p=y;while((x=k<<2|b<<1|$)===(O=(z>=y)<<2|(w>=v)<<1|g>=m));return a[O]=s,a[x]=u,e}function F2(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n),o=new Float64Array(n),i=new Float64Array(n);let a=1/0,s=1/0,u=1/0,l=-1/0,c=-1/0,d=-1/0;for(let f=0,h,p,m,v;f<n;++f)isNaN(p=+this._x.call(null,h=e[f]))||isNaN(m=+this._y.call(null,h))||isNaN(v=+this._z.call(null,h))||(r[f]=p,o[f]=m,i[f]=v,p<a&&(a=p),p>l&&(l=p),m<s&&(s=m),m>c&&(c=m),v<u&&(u=v),v>d&&(d=v));if(a>l||s>c||u>d)return this;this.cover(a,s,u).cover(l,c,d);for(let f=0;f<n;++f)S_(this,r[f],o[f],i[f],e[f]);return this}function q2(e,n,r){if(isNaN(e=+e)||isNaN(n=+n)||isNaN(r=+r))return this;var o=this._x0,i=this._y0,a=this._z0,s=this._x1,u=this._y1,l=this._z1;if(isNaN(o))s=(o=Math.floor(e))+1,u=(i=Math.floor(n))+1,l=(a=Math.floor(r))+1;else{for(var c=s-o||1,d=this._root,f,h;o>e||e>=s||i>n||n>=u||a>r||r>=l;)switch(h=(r<a)<<2|(n<i)<<1|e<o,f=new Array(8),f[h]=d,d=f,c*=2,h){case 0:s=o+c,u=i+c,l=a+c;break;case 1:o=s-c,u=i+c,l=a+c;break;case 2:s=o+c,i=u-c,l=a+c;break;case 3:o=s-c,i=u-c,l=a+c;break;case 4:s=o+c,u=i+c,a=l-c;break;case 5:o=s-c,u=i+c,a=l-c;break;case 6:s=o+c,i=u-c,a=l-c;break;case 7:o=s-c,i=u-c,a=l-c;break}this._root&&this._root.length&&(this._root=d)}return this._x0=o,this._y0=i,this._z0=a,this._x1=s,this._y1=u,this._z1=l,this}function J2(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function H2(e){return arguments.length?this.cover(+e[0][0],+e[0][1],+e[0][2]).cover(+e[1][0],+e[1][1],+e[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function he(e,n,r,o,i,a,s){this.node=e,this.x0=n,this.y0=r,this.z0=o,this.x1=i,this.y1=a,this.z1=s}function V2(e,n,r,o){var i,a=this._x0,s=this._y0,u=this._z0,l,c,d,f,h,p,m=this._x1,v=this._y1,y=this._z1,g=[],w=this._root,z,$;for(w&&g.push(new he(w,a,s,u,m,v,y)),o==null?o=1/0:(a=e-o,s=n-o,u=r-o,m=e+o,v=n+o,y=r+o,o*=o);z=g.pop();)if(!(!(w=z.node)||(l=z.x0)>m||(c=z.y0)>v||(d=z.z0)>y||(f=z.x1)<a||(h=z.y1)<s||(p=z.z1)<u))if(w.length){var b=(l+f)/2,k=(c+h)/2,x=(d+p)/2;g.push(new he(w[7],b,k,x,f,h,p),new he(w[6],l,k,x,b,h,p),new he(w[5],b,c,x,f,k,p),new he(w[4],l,c,x,b,k,p),new he(w[3],b,k,d,f,h,x),new he(w[2],l,k,d,b,h,x),new he(w[1],b,c,d,f,k,x),new he(w[0],l,c,d,b,k,x)),($=(r>=x)<<2|(n>=k)<<1|e>=b)&&(z=g[g.length-1],g[g.length-1]=g[g.length-1-$],g[g.length-1-$]=z)}else{var O=e-+this._x.call(null,w.data),Z=n-+this._y.call(null,w.data),A=r-+this._z.call(null,w.data),D=O*O+Z*Z+A*A;if(D<o){var R=Math.sqrt(o=D);a=e-R,s=n-R,u=r-R,m=e+R,v=n+R,y=r+R,i=w.data}}return i}const W2=(e,n,r,o,i,a)=>Math.sqrt((e-o)**2+(n-i)**2+(r-a)**2);function G2(e,n,r,o){const i=[],a=e-o,s=n-o,u=r-o,l=e+o,c=n+o,d=r+o;return this.visit((f,h,p,m,v,y,g)=>{if(!f.length)do{const w=f.data;W2(e,n,r,this._x(w),this._y(w),this._z(w))<=o&&i.push(w)}while(f=f.next);return h>l||p>c||m>d||v<a||y<s||g<u}),i}function B2(e){if(isNaN(h=+this._x.call(null,e))||isNaN(p=+this._y.call(null,e))||isNaN(m=+this._z.call(null,e)))return this;var n,r=this._root,o,i,a,s=this._x0,u=this._y0,l=this._z0,c=this._x1,d=this._y1,f=this._z1,h,p,m,v,y,g,w,z,$,b,k;if(!r)return this;if(r.length)for(;;){if((w=h>=(v=(s+c)/2))?s=v:c=v,(z=p>=(y=(u+d)/2))?u=y:d=y,($=m>=(g=(l+f)/2))?l=g:f=g,n=r,!(r=r[b=$<<2|z<<1|w]))return this;if(!r.length)break;(n[b+1&7]||n[b+2&7]||n[b+3&7]||n[b+4&7]||n[b+5&7]||n[b+6&7]||n[b+7&7])&&(o=n,k=b)}for(;r.data!==e;)if(i=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,i?(a?i.next=a:delete i.next,this):n?(a?n[b]=a:delete n[b],(r=n[0]||n[1]||n[2]||n[3]||n[4]||n[5]||n[6]||n[7])&&r===(n[7]||n[6]||n[5]||n[4]||n[3]||n[2]||n[1]||n[0])&&!r.length&&(o?o[k]=r:this._root=r),this):(this._root=a,this)}function X2(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function K2(){return this._root}function Y2(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function Q2(e){var n=[],r,o=this._root,i,a,s,u,l,c,d;for(o&&n.push(new he(o,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));r=n.pop();)if(!e(o=r.node,a=r.x0,s=r.y0,u=r.z0,l=r.x1,c=r.y1,d=r.z1)&&o.length){var f=(a+l)/2,h=(s+c)/2,p=(u+d)/2;(i=o[7])&&n.push(new he(i,f,h,p,l,c,d)),(i=o[6])&&n.push(new he(i,a,h,p,f,c,d)),(i=o[5])&&n.push(new he(i,f,s,p,l,h,d)),(i=o[4])&&n.push(new he(i,a,s,p,f,h,d)),(i=o[3])&&n.push(new he(i,f,h,u,l,c,p)),(i=o[2])&&n.push(new he(i,a,h,u,f,c,p)),(i=o[1])&&n.push(new he(i,f,s,u,l,h,p)),(i=o[0])&&n.push(new he(i,a,s,u,f,h,p))}return this}function e4(e){var n=[],r=[],o;for(this._root&&n.push(new he(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));o=n.pop();){var i=o.node;if(i.length){var a,s=o.x0,u=o.y0,l=o.z0,c=o.x1,d=o.y1,f=o.z1,h=(s+c)/2,p=(u+d)/2,m=(l+f)/2;(a=i[0])&&n.push(new he(a,s,u,l,h,p,m)),(a=i[1])&&n.push(new he(a,h,u,l,c,p,m)),(a=i[2])&&n.push(new he(a,s,p,l,h,d,m)),(a=i[3])&&n.push(new he(a,h,p,l,c,d,m)),(a=i[4])&&n.push(new he(a,s,u,m,h,p,f)),(a=i[5])&&n.push(new he(a,h,u,m,c,p,f)),(a=i[6])&&n.push(new he(a,s,p,m,h,d,f)),(a=i[7])&&n.push(new he(a,h,p,m,c,d,f))}r.push(o)}for(;o=r.pop();)e(o.node,o.x0,o.y0,o.z0,o.x1,o.y1,o.z1);return this}function t4(e){return e[0]}function n4(e){return arguments.length?(this._x=e,this):this._x}function r4(e){return e[1]}function i4(e){return arguments.length?(this._y=e,this):this._y}function o4(e){return e[2]}function a4(e){return arguments.length?(this._z=e,this):this._z}function Sl(e,n,r,o){var i=new Il(n??t4,r??r4,o??o4,NaN,NaN,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Il(e,n,r,o,i,a,s,u,l){this._x=e,this._y=n,this._z=r,this._x0=o,this._y0=i,this._z0=a,this._x1=s,this._y1=u,this._z1=l,this._root=void 0}function Ec(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var Ae=Sl.prototype=Il.prototype;Ae.copy=function(){var e=new Il(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),n=this._root,r,o;if(!n)return e;if(!n.length)return e._root=Ec(n),e;for(r=[{source:n,target:e._root=new Array(8)}];n=r.pop();)for(var i=0;i<8;++i)(o=n.source[i])&&(o.length?r.push({source:o,target:n.target[i]=new Array(8)}):n.target[i]=Ec(o));return e};Ae.add=L2;Ae.addAll=F2;Ae.cover=q2;Ae.data=J2;Ae.extent=H2;Ae.find=V2;Ae.findAllWithinRadius=G2;Ae.remove=B2;Ae.removeAll=X2;Ae.root=K2;Ae.size=Y2;Ae.visit=Q2;Ae.visitAfter=e4;Ae.x=n4;Ae.y=i4;Ae.z=a4;function yt(e){return function(){return e}}function rt(e){return(e()-.5)*1e-6}function ca(e){return e.x+e.vx}function Nc(e){return e.y+e.vy}function s4(e){return e.z+e.vz}function u4(e){var n,r,o,i,a=1,s=1;typeof e!="function"&&(e=yt(e==null?1:+e));function u(){for(var d,f=n.length,h,p,m,v,y,g,w,z=0;z<s;++z)for(h=(r===1?$l(n,ca):r===2?kl(n,ca,Nc):r===3?Sl(n,ca,Nc,s4):null).visitAfter(l),d=0;d<f;++d)p=n[d],g=o[p.index],w=g*g,m=p.x+p.vx,r>1&&(v=p.y+p.vy),r>2&&(y=p.z+p.vz),h.visit($);function $(b,k,x,O,Z,A,D){var R=[k,x,O,Z,A,D],X=R[0],I=R[1],C=R[2],E=R[r],F=R[r+1],B=R[r+2],J=b.data,K=b.r,W=g+K;if(J){if(J.index>p.index){var te=m-J.x-J.vx,le=r>1?v-J.y-J.vy:0,ae=r>2?y-J.z-J.vz:0,xe=te*te+le*le+ae*ae;xe<W*W&&(te===0&&(te=rt(i),xe+=te*te),r>1&&le===0&&(le=rt(i),xe+=le*le),r>2&&ae===0&&(ae=rt(i),xe+=ae*ae),xe=(W-(xe=Math.sqrt(xe)))/xe*a,p.vx+=(te*=xe)*(W=(K*=K)/(w+K)),r>1&&(p.vy+=(le*=xe)*W),r>2&&(p.vz+=(ae*=xe)*W),J.vx-=te*(W=1-W),r>1&&(J.vy-=le*W),r>2&&(J.vz-=ae*W))}return}return X>m+W||E<m-W||r>1&&(I>v+W||F<v-W)||r>2&&(C>y+W||B<y-W)}}function l(d){if(d.data)return d.r=o[d.data.index];for(var f=d.r=0;f<Math.pow(2,r);++f)d[f]&&d[f].r>d.r&&(d.r=d[f].r)}function c(){if(n){var d,f=n.length,h;for(o=new Array(f),d=0;d<f;++d)h=n[d],o[h.index]=+e(h,d,n)}}return u.initialize=function(d,...f){n=d,i=f.find(h=>typeof h=="function")||Math.random,r=f.find(h=>[1,2,3].includes(h))||2,c()},u.iterations=function(d){return arguments.length?(s=+d,u):s},u.strength=function(d){return arguments.length?(a=+d,u):a},u.radius=function(d){return arguments.length?(e=typeof d=="function"?d:yt(+d),c(),u):e},u}function l4(e){return e.index}function Uc(e,n){var r=e.get(n);if(!r)throw new Error("node not found: "+n);return r}function I_(e){var n=l4,r=h,o,i=yt(30),a,s,u,l,c,d,f=1;e==null&&(e=[]);function h(g){return 1/Math.min(l[g.source.index],l[g.target.index])}function p(g){for(var w=0,z=e.length;w<f;++w)for(var $=0,b,k,x,O=0,Z=0,A=0,D,R;$<z;++$)b=e[$],k=b.source,x=b.target,O=x.x+x.vx-k.x-k.vx||rt(d),u>1&&(Z=x.y+x.vy-k.y-k.vy||rt(d)),u>2&&(A=x.z+x.vz-k.z-k.vz||rt(d)),D=Math.sqrt(O*O+Z*Z+A*A),D=(D-a[$])/D*g*o[$],O*=D,Z*=D,A*=D,x.vx-=O*(R=c[$]),u>1&&(x.vy-=Z*R),u>2&&(x.vz-=A*R),k.vx+=O*(R=1-R),u>1&&(k.vy+=Z*R),u>2&&(k.vz+=A*R)}function m(){if(s){var g,w=s.length,z=e.length,$=new Map(s.map((k,x)=>[n(k,x,s),k])),b;for(g=0,l=new Array(w);g<z;++g)b=e[g],b.index=g,typeof b.source!="object"&&(b.source=Uc($,b.source)),typeof b.target!="object"&&(b.target=Uc($,b.target)),l[b.source.index]=(l[b.source.index]||0)+1,l[b.target.index]=(l[b.target.index]||0)+1;for(g=0,c=new Array(z);g<z;++g)b=e[g],c[g]=l[b.source.index]/(l[b.source.index]+l[b.target.index]);o=new Array(z),v(),a=new Array(z),y()}}function v(){if(s)for(var g=0,w=e.length;g<w;++g)o[g]=+r(e[g],g,e)}function y(){if(s)for(var g=0,w=e.length;g<w;++g)a[g]=+i(e[g],g,e)}return p.initialize=function(g,...w){s=g,d=w.find(z=>typeof z=="function")||Math.random,u=w.find(z=>[1,2,3].includes(z))||2,m()},p.links=function(g){return arguments.length?(e=g,m(),p):e},p.id=function(g){return arguments.length?(n=g,p):n},p.iterations=function(g){return arguments.length?(f=+g,p):f},p.strength=function(g){return arguments.length?(r=typeof g=="function"?g:yt(+g),v(),p):r},p.distance=function(g){return arguments.length?(i=typeof g=="function"?g:yt(+g),y(),p):i},p}var c4={value:()=>{}};function ni(){for(var e=0,n=arguments.length,r={},o;e<n;++e){if(!(o=arguments[e]+"")||o in r||/[\s.]/.test(o))throw new Error("illegal type: "+o);r[o]=[]}return new ki(r)}function ki(e){this._=e}function f4(e,n){return e.trim().split(/^|\s+/).map(function(r){var o="",i=r.indexOf(".");if(i>=0&&(o=r.slice(i+1),r=r.slice(0,i)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:o}})}ki.prototype=ni.prototype={constructor:ki,on:function(e,n){var r=this._,o=f4(e+"",r),i,a=-1,s=o.length;if(arguments.length<2){for(;++a<s;)if((i=(e=o[a]).type)&&(i=d4(r[i],e.name)))return i;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++a<s;)if(i=(e=o[a]).type)r[i]=Ac(r[i],e.name,n);else if(n==null)for(i in r)r[i]=Ac(r[i],e.name,null);return this},copy:function(){var e={},n=this._;for(var r in n)e[r]=n[r].slice();return new ki(e)},call:function(e,n){if((i=arguments.length-2)>0)for(var r=new Array(i),o=0,i,a;o<i;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],o=0,i=a.length;o<i;++o)a[o].value.apply(n,r)},apply:function(e,n,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,a=o.length;i<a;++i)o[i].value.apply(n,r)}};function d4(e,n){for(var r=0,o=e.length,i;r<o;++r)if((i=e[r]).name===n)return i.value}function Ac(e,n,r){for(var o=0,i=e.length;o<i;++o)if(e[o].name===n){e[o]=c4,e=e.slice(0,o).concat(e.slice(o+1));break}return r!=null&&e.push({name:n,value:r}),e}var Dn=0,nr=0,Vn=0,z_=1e3,Fi,rr,qi=0,pn=0,ta=0,_r=typeof performance=="object"&&performance.now?performance:Date,O_=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function zl(){return pn||(O_(h4),pn=_r.now()+ta)}function h4(){pn=0}function Ji(){this._call=this._time=this._next=null}Ji.prototype=Ol.prototype={constructor:Ji,restart:function(e,n,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?zl():+r)+(n==null?0:+n),!this._next&&rr!==this&&(rr?rr._next=this:Fi=this,rr=this),this._call=e,this._time=r,Ea()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ea())}};function Ol(e,n,r){var o=new Ji;return o.restart(e,n,r),o}function p4(){zl(),++Dn;for(var e=Fi,n;e;)(n=pn-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Dn}function jc(){pn=(qi=_r.now())+ta,Dn=nr=0;try{p4()}finally{Dn=0,g4(),pn=0}}function m4(){var e=_r.now(),n=e-qi;n>z_&&(ta-=n,qi=e)}function g4(){for(var e,n=Fi,r,o=1/0;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:Fi=r);rr=e,Ea(o)}function Ea(e){if(!Dn){nr&&(nr=clearTimeout(nr));var n=e-pn;n>24?(e<1/0&&(nr=setTimeout(jc,e-_r.now()-ta)),Vn&&(Vn=clearInterval(Vn))):(Vn||(qi=_r.now(),Vn=setInterval(m4,z_)),Dn=1,O_(jc))}}function Zc(e,n,r){var o=new Ji;return n=n==null?0:+n,o.restart(i=>{o.stop(),e(i+n)},n,r),o}const v4=1664525,_4=1013904223,Cc=4294967296;function y4(){let e=1;return()=>(e=(v4*e+_4)%Cc)/Cc}var Dc=3;function fa(e){return e.x}function Rc(e){return e.y}function b4(e){return e.z}var $4=10,w4=Math.PI*(3-Math.sqrt(5)),k4=Math.PI*20/(9+Math.sqrt(221));function x4(e,n){n=n||2;var r=Math.min(Dc,Math.max(1,Math.round(n))),o,i=1,a=.001,s=1-Math.pow(a,1/300),u=0,l=.6,c=new Map,d=Ol(p),f=ni("tick","end"),h=y4();e==null&&(e=[]);function p(){m(),f.call("tick",o),i<a&&(d.stop(),f.call("end",o))}function m(g){var w,z=e.length,$;g===void 0&&(g=1);for(var b=0;b<g;++b)for(i+=(u-i)*s,c.forEach(function(k){k(i)}),w=0;w<z;++w)$=e[w],$.fx==null?$.x+=$.vx*=l:($.x=$.fx,$.vx=0),r>1&&($.fy==null?$.y+=$.vy*=l:($.y=$.fy,$.vy=0)),r>2&&($.fz==null?$.z+=$.vz*=l:($.z=$.fz,$.vz=0));return o}function v(){for(var g=0,w=e.length,z;g<w;++g){if(z=e[g],z.index=g,z.fx!=null&&(z.x=z.fx),z.fy!=null&&(z.y=z.fy),z.fz!=null&&(z.z=z.fz),isNaN(z.x)||r>1&&isNaN(z.y)||r>2&&isNaN(z.z)){var $=$4*(r>2?Math.cbrt(.5+g):r>1?Math.sqrt(.5+g):g),b=g*w4,k=g*k4;r===1?z.x=$:r===2?(z.x=$*Math.cos(b),z.y=$*Math.sin(b)):(z.x=$*Math.sin(b)*Math.cos(k),z.y=$*Math.cos(b),z.z=$*Math.sin(b)*Math.sin(k))}(isNaN(z.vx)||r>1&&isNaN(z.vy)||r>2&&isNaN(z.vz))&&(z.vx=0,r>1&&(z.vy=0),r>2&&(z.vz=0))}}function y(g){return g.initialize&&g.initialize(e,h,r),g}return v(),o={tick:m,restart:function(){return d.restart(p),o},stop:function(){return d.stop(),o},numDimensions:function(g){return arguments.length?(r=Math.min(Dc,Math.max(1,Math.round(g))),c.forEach(y),o):r},nodes:function(g){return arguments.length?(e=g,v(),c.forEach(y),o):e},alpha:function(g){return arguments.length?(i=+g,o):i},alphaMin:function(g){return arguments.length?(a=+g,o):a},alphaDecay:function(g){return arguments.length?(s=+g,o):+s},alphaTarget:function(g){return arguments.length?(u=+g,o):u},velocityDecay:function(g){return arguments.length?(l=1-g,o):1-l},randomSource:function(g){return arguments.length?(h=g,c.forEach(y),o):h},force:function(g,w){return arguments.length>1?(w==null?c.delete(g):c.set(g,y(w)),o):c.get(g)},find:function(){var g=Array.prototype.slice.call(arguments),w=g.shift()||0,z=(r>1?g.shift():null)||0,$=(r>2?g.shift():null)||0,b=g.shift()||1/0,k=0,x=e.length,O,Z,A,D,R,X;for(b*=b,k=0;k<x;++k)R=e[k],O=w-R.x,Z=z-(R.y||0),A=$-(R.z||0),D=O*O+Z*Z+A*A,D<b&&(X=R,b=D);return X},on:function(g,w){return arguments.length>1?(f.on(g,w),o):f.on(g)}}}function P_(){var e,n,r,o,i,a=yt(-30),s,u=1,l=1/0,c=.81;function d(m){var v,y=e.length,g=(n===1?$l(e,fa):n===2?kl(e,fa,Rc):n===3?Sl(e,fa,Rc,b4):null).visitAfter(h);for(i=m,v=0;v<y;++v)r=e[v],g.visit(p)}function f(){if(e){var m,v=e.length,y;for(s=new Array(v),m=0;m<v;++m)y=e[m],s[y.index]=+a(y,m,e)}}function h(m){var v=0,y,g,w=0,z,$,b,k,x=m.length;if(x){for(z=$=b=k=0;k<x;++k)(y=m[k])&&(g=Math.abs(y.value))&&(v+=y.value,w+=g,z+=g*(y.x||0),$+=g*(y.y||0),b+=g*(y.z||0));v*=Math.sqrt(4/x),m.x=z/w,n>1&&(m.y=$/w),n>2&&(m.z=b/w)}else{y=m,y.x=y.data.x,n>1&&(y.y=y.data.y),n>2&&(y.z=y.data.z);do v+=s[y.data.index];while(y=y.next)}m.value=v}function p(m,v,y,g,w){if(!m.value)return!0;var z=[y,g,w][n-1],$=m.x-r.x,b=n>1?m.y-r.y:0,k=n>2?m.z-r.z:0,x=z-v,O=$*$+b*b+k*k;if(x*x/c<O)return O<l&&($===0&&($=rt(o),O+=$*$),n>1&&b===0&&(b=rt(o),O+=b*b),n>2&&k===0&&(k=rt(o),O+=k*k),O<u&&(O=Math.sqrt(u*O)),r.vx+=$*m.value*i/O,n>1&&(r.vy+=b*m.value*i/O),n>2&&(r.vz+=k*m.value*i/O)),!0;if(m.length||O>=l)return;(m.data!==r||m.next)&&($===0&&($=rt(o),O+=$*$),n>1&&b===0&&(b=rt(o),O+=b*b),n>2&&k===0&&(k=rt(o),O+=k*k),O<u&&(O=Math.sqrt(u*O)));do m.data!==r&&(x=s[m.data.index]*i/O,r.vx+=$*x,n>1&&(r.vy+=b*x),n>2&&(r.vz+=k*x));while(m=m.next)}return d.initialize=function(m,...v){e=m,o=v.find(y=>typeof y=="function")||Math.random,n=v.find(y=>[1,2,3].includes(y))||2,f()},d.strength=function(m){return arguments.length?(a=typeof m=="function"?m:yt(+m),f(),d):a},d.distanceMin=function(m){return arguments.length?(u=m*m,d):Math.sqrt(u)},d.distanceMax=function(m){return arguments.length?(l=m*m,d):Math.sqrt(l)},d.theta=function(m){return arguments.length?(c=m*m,d):Math.sqrt(c)},d}function S4(e,n,r,o){var i,a,s=yt(.1),u,l;typeof e!="function"&&(e=yt(+e)),n==null&&(n=0),r==null&&(r=0),o==null&&(o=0);function c(f){for(var h=0,p=i.length;h<p;++h){var m=i[h],v=m.x-n||1e-6,y=(m.y||0)-r||1e-6,g=(m.z||0)-o||1e-6,w=Math.sqrt(v*v+y*y+g*g),z=(l[h]-w)*u[h]*f/w;m.vx+=v*z,a>1&&(m.vy+=y*z),a>2&&(m.vz+=g*z)}}function d(){if(i){var f,h=i.length;for(u=new Array(h),l=new Array(h),f=0;f<h;++f)l[f]=+e(i[f],f,i),u[f]=isNaN(l[f])?0:+s(i[f],f,i)}}return c.initialize=function(f,...h){i=f,a=h.find(p=>[1,2,3].includes(p))||2,d()},c.strength=function(f){return arguments.length?(s=typeof f=="function"?f:yt(+f),d(),c):s},c.radius=function(f){return arguments.length?(e=typeof f=="function"?f:yt(+f),d(),c):e},c.x=function(f){return arguments.length?(n=+f,c):n},c.y=function(f){return arguments.length?(r=+f,c):r},c.z=function(f){return arguments.length?(o=+f,c):o},c}var Na="http://www.w3.org/1999/xhtml";const Mc={svg:"http://www.w3.org/2000/svg",xhtml:Na,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function na(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Mc.hasOwnProperty(n)?{space:Mc[n],local:e}:e}function I4(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===Na&&n.documentElement.namespaceURI===Na?n.createElement(e):n.createElementNS(r,e)}}function z4(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function T_(e){var n=na(e);return(n.local?z4:I4)(n)}function O4(){}function Pl(e){return e==null?O4:function(){return this.querySelector(e)}}function P4(e){typeof e!="function"&&(e=Pl(e));for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i)for(var a=n[i],s=a.length,u=o[i]=new Array(s),l,c,d=0;d<s;++d)(l=a[d])&&(c=e.call(l,l.__data__,d,a))&&("__data__"in l&&(c.__data__=l.__data__),u[d]=c);return new Be(o,this._parents)}function T4(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function E4(){return[]}function E_(e){return e==null?E4:function(){return this.querySelectorAll(e)}}function N4(e){return function(){return T4(e.apply(this,arguments))}}function U4(e){typeof e=="function"?e=N4(e):e=E_(e);for(var n=this._groups,r=n.length,o=[],i=[],a=0;a<r;++a)for(var s=n[a],u=s.length,l,c=0;c<u;++c)(l=s[c])&&(o.push(e.call(l,l.__data__,c,s)),i.push(l));return new Be(o,i)}function N_(e){return function(){return this.matches(e)}}function U_(e){return function(n){return n.matches(e)}}var A4=Array.prototype.find;function j4(e){return function(){return A4.call(this.children,e)}}function Z4(){return this.firstElementChild}function C4(e){return this.select(e==null?Z4:j4(typeof e=="function"?e:U_(e)))}var D4=Array.prototype.filter;function R4(){return Array.from(this.children)}function M4(e){return function(){return D4.call(this.children,e)}}function L4(e){return this.selectAll(e==null?R4:M4(typeof e=="function"?e:U_(e)))}function F4(e){typeof e!="function"&&(e=N_(e));for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i)for(var a=n[i],s=a.length,u=o[i]=[],l,c=0;c<s;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&u.push(l);return new Be(o,this._parents)}function A_(e){return new Array(e.length)}function q4(){return new Be(this._enter||this._groups.map(A_),this._parents)}function Hi(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Hi.prototype={constructor:Hi,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function J4(e){return function(){return e}}function H4(e,n,r,o,i,a){for(var s=0,u,l=n.length,c=a.length;s<c;++s)(u=n[s])?(u.__data__=a[s],o[s]=u):r[s]=new Hi(e,a[s]);for(;s<l;++s)(u=n[s])&&(i[s]=u)}function V4(e,n,r,o,i,a,s){var u,l,c=new Map,d=n.length,f=a.length,h=new Array(d),p;for(u=0;u<d;++u)(l=n[u])&&(h[u]=p=s.call(l,l.__data__,u,n)+"",c.has(p)?i[u]=l:c.set(p,l));for(u=0;u<f;++u)p=s.call(e,a[u],u,a)+"",(l=c.get(p))?(o[u]=l,l.__data__=a[u],c.delete(p)):r[u]=new Hi(e,a[u]);for(u=0;u<d;++u)(l=n[u])&&c.get(h[u])===l&&(i[u]=l)}function W4(e){return e.__data__}function G4(e,n){if(!arguments.length)return Array.from(this,W4);var r=n?V4:H4,o=this._parents,i=this._groups;typeof e!="function"&&(e=J4(e));for(var a=i.length,s=new Array(a),u=new Array(a),l=new Array(a),c=0;c<a;++c){var d=o[c],f=i[c],h=f.length,p=B4(e.call(d,d&&d.__data__,c,o)),m=p.length,v=u[c]=new Array(m),y=s[c]=new Array(m),g=l[c]=new Array(h);r(d,f,v,y,g,p,n);for(var w=0,z=0,$,b;w<m;++w)if($=v[w]){for(w>=z&&(z=w+1);!(b=y[z])&&++z<m;);$._next=b||null}}return s=new Be(s,o),s._enter=u,s._exit=l,s}function B4(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function X4(){return new Be(this._exit||this._groups.map(A_),this._parents)}function K4(e,n,r){var o=this.enter(),i=this,a=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),n!=null&&(i=n(i),i&&(i=i.selection())),r==null?a.remove():r(a),o&&i?o.merge(i).order():i}function Y4(e){for(var n=e.selection?e.selection():e,r=this._groups,o=n._groups,i=r.length,a=o.length,s=Math.min(i,a),u=new Array(i),l=0;l<s;++l)for(var c=r[l],d=o[l],f=c.length,h=u[l]=new Array(f),p,m=0;m<f;++m)(p=c[m]||d[m])&&(h[m]=p);for(;l<i;++l)u[l]=r[l];return new Be(u,this._parents)}function Q4(){for(var e=this._groups,n=-1,r=e.length;++n<r;)for(var o=e[n],i=o.length-1,a=o[i],s;--i>=0;)(s=o[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function e6(e){e||(e=t6);function n(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a){for(var s=r[a],u=s.length,l=i[a]=new Array(u),c,d=0;d<u;++d)(c=s[d])&&(l[d]=c);l.sort(n)}return new Be(i,this._parents).order()}function t6(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function n6(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function r6(){return Array.from(this)}function i6(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o=e[n],i=0,a=o.length;i<a;++i){var s=o[i];if(s)return s}return null}function o6(){let e=0;for(const n of this)++e;return e}function a6(){return!this.node()}function s6(e){for(var n=this._groups,r=0,o=n.length;r<o;++r)for(var i=n[r],a=0,s=i.length,u;a<s;++a)(u=i[a])&&e.call(u,u.__data__,a,i);return this}function u6(e){return function(){this.removeAttribute(e)}}function l6(e){return function(){this.removeAttributeNS(e.space,e.local)}}function c6(e,n){return function(){this.setAttribute(e,n)}}function f6(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function d6(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function h6(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function p6(e,n){var r=na(e);if(arguments.length<2){var o=this.node();return r.local?o.getAttributeNS(r.space,r.local):o.getAttribute(r)}return this.each((n==null?r.local?l6:u6:typeof n=="function"?r.local?h6:d6:r.local?f6:c6)(r,n))}function j_(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function m6(e){return function(){this.style.removeProperty(e)}}function g6(e,n,r){return function(){this.style.setProperty(e,n,r)}}function v6(e,n,r){return function(){var o=n.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,r)}}function _6(e,n,r){return arguments.length>1?this.each((n==null?m6:typeof n=="function"?v6:g6)(e,n,r??"")):Rn(this.node(),e)}function Rn(e,n){return e.style.getPropertyValue(n)||j_(e).getComputedStyle(e,null).getPropertyValue(n)}function y6(e){return function(){delete this[e]}}function b6(e,n){return function(){this[e]=n}}function $6(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function w6(e,n){return arguments.length>1?this.each((n==null?y6:typeof n=="function"?$6:b6)(e,n)):this.node()[e]}function Z_(e){return e.trim().split(/^|\s+/)}function Tl(e){return e.classList||new C_(e)}function C_(e){this._node=e,this._names=Z_(e.getAttribute("class")||"")}C_.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function D_(e,n){for(var r=Tl(e),o=-1,i=n.length;++o<i;)r.add(n[o])}function R_(e,n){for(var r=Tl(e),o=-1,i=n.length;++o<i;)r.remove(n[o])}function k6(e){return function(){D_(this,e)}}function x6(e){return function(){R_(this,e)}}function S6(e,n){return function(){(n.apply(this,arguments)?D_:R_)(this,e)}}function I6(e,n){var r=Z_(e+"");if(arguments.length<2){for(var o=Tl(this.node()),i=-1,a=r.length;++i<a;)if(!o.contains(r[i]))return!1;return!0}return this.each((typeof n=="function"?S6:n?k6:x6)(r,n))}function z6(){this.textContent=""}function O6(e){return function(){this.textContent=e}}function P6(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function T6(e){return arguments.length?this.each(e==null?z6:(typeof e=="function"?P6:O6)(e)):this.node().textContent}function E6(){this.innerHTML=""}function N6(e){return function(){this.innerHTML=e}}function U6(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function A6(e){return arguments.length?this.each(e==null?E6:(typeof e=="function"?U6:N6)(e)):this.node().innerHTML}function j6(){this.nextSibling&&this.parentNode.appendChild(this)}function Z6(){return this.each(j6)}function C6(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function D6(){return this.each(C6)}function R6(e){var n=typeof e=="function"?e:T_(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function M6(){return null}function L6(e,n){var r=typeof e=="function"?e:T_(e),o=n==null?M6:typeof n=="function"?n:Pl(n);return this.select(function(){return this.insertBefore(r.apply(this,arguments),o.apply(this,arguments)||null)})}function F6(){var e=this.parentNode;e&&e.removeChild(this)}function q6(){return this.each(F6)}function J6(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function H6(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function V6(e){return this.select(e?H6:J6)}function W6(e){return arguments.length?this.property("__data__",e):this.node().__data__}function G6(e){return function(n){e.call(this,n,this.__data__)}}function B6(e){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");return o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),{type:n,name:r}})}function X6(e){return function(){var n=this.__on;if(n){for(var r=0,o=-1,i=n.length,a;r<i;++r)a=n[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):n[++o]=a;++o?n.length=o:delete this.__on}}}function K6(e,n,r){return function(){var o=this.__on,i,a=G6(n);if(o){for(var s=0,u=o.length;s<u;++s)if((i=o[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=r),i.value=n;return}}this.addEventListener(e.type,a,r),i={type:e.type,name:e.name,value:n,listener:a,options:r},o?o.push(i):this.__on=[i]}}function Y6(e,n,r){var o=B6(e+""),i,a=o.length,s;if(arguments.length<2){var u=this.node().__on;if(u){for(var l=0,c=u.length,d;l<c;++l)for(i=0,d=u[l];i<a;++i)if((s=o[i]).type===d.type&&s.name===d.name)return d.value}return}for(u=n?K6:X6,i=0;i<a;++i)this.each(u(o[i],n,r));return this}function M_(e,n,r){var o=j_(e),i=o.CustomEvent;typeof i=="function"?i=new i(n,r):(i=o.document.createEvent("Event"),r?(i.initEvent(n,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(n,!1,!1)),e.dispatchEvent(i)}function Q6(e,n){return function(){return M_(this,e,n)}}function eO(e,n){return function(){return M_(this,e,n.apply(this,arguments))}}function tO(e,n){return this.each((typeof n=="function"?eO:Q6)(e,n))}function*nO(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o=e[n],i=0,a=o.length,s;i<a;++i)(s=o[i])&&(yield s)}var L_=[null];function Be(e,n){this._groups=e,this._parents=n}function ri(){return new Be([[document.documentElement]],L_)}function rO(){return this}Be.prototype=ri.prototype={constructor:Be,select:P4,selectAll:U4,selectChild:C4,selectChildren:L4,filter:F4,data:G4,enter:q4,exit:X4,join:K4,merge:Y4,selection:rO,order:Q4,sort:e6,call:n6,nodes:r6,node:i6,size:o6,empty:a6,each:s6,attr:p6,style:_6,property:w6,classed:I6,text:T6,html:A6,raise:Z6,lower:D6,append:R6,insert:L6,remove:q6,clone:V6,datum:W6,on:Y6,dispatch:tO,[Symbol.iterator]:nO};function it(e){return typeof e=="string"?new Be([[document.querySelector(e)]],[document.documentElement]):new Be([[e]],L_)}function iO(e){let n;for(;n=e.sourceEvent;)e=n;return e}function kt(e,n){if(e=iO(e),n===void 0&&(n=e.currentTarget),n){var r=n.ownerSVGElement||n;if(r.createSVGPoint){var o=r.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(n.getScreenCTM().inverse()),[o.x,o.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[e.clientX-i.left-n.clientLeft,e.clientY-i.top-n.clientTop]}}return[e.pageX,e.pageY]}const oO={passive:!1},yr={capture:!0,passive:!1};function da(e){e.stopImmediatePropagation()}function In(e){e.preventDefault(),e.stopImmediatePropagation()}function F_(e){var n=e.document.documentElement,r=it(e).on("dragstart.drag",In,yr);"onselectstart"in n?r.on("selectstart.drag",In,yr):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function q_(e,n){var r=e.document.documentElement,o=it(e).on("dragstart.drag",null);n&&(o.on("click.drag",In,yr),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in r?o.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const mi=e=>()=>e;function Ua(e,{sourceEvent:n,subject:r,target:o,identifier:i,active:a,x:s,y:u,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}Ua.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function aO(e){return!e.ctrlKey&&!e.button}function sO(){return this.parentNode}function uO(e,n){return n??{x:e.x,y:e.y}}function lO(){return navigator.maxTouchPoints||"ontouchstart"in this}function cO(){var e=aO,n=sO,r=uO,o=lO,i={},a=ni("start","drag","end"),s=0,u,l,c,d,f=0;function h($){$.on("mousedown.drag",p).filter(o).on("touchstart.drag",y).on("touchmove.drag",g,oO).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p($,b){if(!(d||!e.call(this,$,b))){var k=z(this,n.call(this,$,b),$,b,"mouse");k&&(it($.view).on("mousemove.drag",m,yr).on("mouseup.drag",v,yr),F_($.view),da($),c=!1,u=$.clientX,l=$.clientY,k("start",$))}}function m($){if(In($),!c){var b=$.clientX-u,k=$.clientY-l;c=b*b+k*k>f}i.mouse("drag",$)}function v($){it($.view).on("mousemove.drag mouseup.drag",null),q_($.view,c),In($),i.mouse("end",$)}function y($,b){if(e.call(this,$,b)){var k=$.changedTouches,x=n.call(this,$,b),O=k.length,Z,A;for(Z=0;Z<O;++Z)(A=z(this,x,$,b,k[Z].identifier,k[Z]))&&(da($),A("start",$,k[Z]))}}function g($){var b=$.changedTouches,k=b.length,x,O;for(x=0;x<k;++x)(O=i[b[x].identifier])&&(In($),O("drag",$,b[x]))}function w($){var b=$.changedTouches,k=b.length,x,O;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),x=0;x<k;++x)(O=i[b[x].identifier])&&(da($),O("end",$,b[x]))}function z($,b,k,x,O,Z){var A=a.copy(),D=kt(Z||k,b),R,X,I;if((I=r.call($,new Ua("beforestart",{sourceEvent:k,target:h,identifier:O,active:s,x:D[0],y:D[1],dx:0,dy:0,dispatch:A}),x))!=null)return R=I.x-D[0]||0,X=I.y-D[1]||0,function C(E,F,B){var J=D,K;switch(E){case"start":i[O]=C,K=s++;break;case"end":delete i[O],--s;case"drag":D=kt(B||F,b),K=s;break}A.call(E,$,new Ua(E,{sourceEvent:F,subject:I,target:h,identifier:O,active:K,x:D[0]+R,y:D[1]+X,dx:D[0]-J[0],dy:D[1]-J[1],dispatch:A}),x)}}return h.filter=function($){return arguments.length?(e=typeof $=="function"?$:mi(!!$),h):e},h.container=function($){return arguments.length?(n=typeof $=="function"?$:mi($),h):n},h.subject=function($){return arguments.length?(r=typeof $=="function"?$:mi($),h):r},h.touchable=function($){return arguments.length?(o=typeof $=="function"?$:mi(!!$),h):o},h.on=function(){var $=a.on.apply(a,arguments);return $===a?h:$},h.clickDistance=function($){return arguments.length?(f=($=+$)*$,h):Math.sqrt(f)},h}function El(e,n,r){e.prototype=n.prototype=r,r.constructor=e}function J_(e,n){var r=Object.create(e.prototype);for(var o in n)r[o]=n[o];return r}function ii(){}var br=.7,Vi=1/br,zn="\\s*([+-]?\\d+)\\s*",$r="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",It="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fO=/^#([0-9a-f]{3,8})$/,dO=new RegExp(`^rgb\\(${zn},${zn},${zn}\\)$`),hO=new RegExp(`^rgb\\(${It},${It},${It}\\)$`),pO=new RegExp(`^rgba\\(${zn},${zn},${zn},${$r}\\)$`),mO=new RegExp(`^rgba\\(${It},${It},${It},${$r}\\)$`),gO=new RegExp(`^hsl\\(${$r},${It},${It}\\)$`),vO=new RegExp(`^hsla\\(${$r},${It},${It},${$r}\\)$`),Lc={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};El(ii,wr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fc,formatHex:Fc,formatHex8:_O,formatHsl:yO,formatRgb:qc,toString:qc});function Fc(){return this.rgb().formatHex()}function _O(){return this.rgb().formatHex8()}function yO(){return H_(this).formatHsl()}function qc(){return this.rgb().formatRgb()}function wr(e){var n,r;return e=(e+"").trim().toLowerCase(),(n=fO.exec(e))?(r=n[1].length,n=parseInt(n[1],16),r===6?Jc(n):r===3?new He(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):r===8?gi(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):r===4?gi(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=dO.exec(e))?new He(n[1],n[2],n[3],1):(n=hO.exec(e))?new He(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=pO.exec(e))?gi(n[1],n[2],n[3],n[4]):(n=mO.exec(e))?gi(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=gO.exec(e))?Wc(n[1],n[2]/100,n[3]/100,1):(n=vO.exec(e))?Wc(n[1],n[2]/100,n[3]/100,n[4]):Lc.hasOwnProperty(e)?Jc(Lc[e]):e==="transparent"?new He(NaN,NaN,NaN,0):null}function Jc(e){return new He(e>>16&255,e>>8&255,e&255,1)}function gi(e,n,r,o){return o<=0&&(e=n=r=NaN),new He(e,n,r,o)}function bO(e){return e instanceof ii||(e=wr(e)),e?(e=e.rgb(),new He(e.r,e.g,e.b,e.opacity)):new He}function Aa(e,n,r,o){return arguments.length===1?bO(e):new He(e,n,r,o??1)}function He(e,n,r,o){this.r=+e,this.g=+n,this.b=+r,this.opacity=+o}El(He,Aa,J_(ii,{brighter(e){return e=e==null?Vi:Math.pow(Vi,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?br:Math.pow(br,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new He(ln(this.r),ln(this.g),ln(this.b),Wi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Hc,formatHex:Hc,formatHex8:$O,formatRgb:Vc,toString:Vc}));function Hc(){return`#${sn(this.r)}${sn(this.g)}${sn(this.b)}`}function $O(){return`#${sn(this.r)}${sn(this.g)}${sn(this.b)}${sn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Vc(){const e=Wi(this.opacity);return`${e===1?"rgb(":"rgba("}${ln(this.r)}, ${ln(this.g)}, ${ln(this.b)}${e===1?")":`, ${e})`}`}function Wi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ln(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function sn(e){return e=ln(e),(e<16?"0":"")+e.toString(16)}function Wc(e,n,r,o){return o<=0?e=n=r=NaN:r<=0||r>=1?e=n=NaN:n<=0&&(e=NaN),new vt(e,n,r,o)}function H_(e){if(e instanceof vt)return new vt(e.h,e.s,e.l,e.opacity);if(e instanceof ii||(e=wr(e)),!e)return new vt;if(e instanceof vt)return e;e=e.rgb();var n=e.r/255,r=e.g/255,o=e.b/255,i=Math.min(n,r,o),a=Math.max(n,r,o),s=NaN,u=a-i,l=(a+i)/2;return u?(n===a?s=(r-o)/u+(r<o)*6:r===a?s=(o-n)/u+2:s=(n-r)/u+4,u/=l<.5?a+i:2-a-i,s*=60):u=l>0&&l<1?0:s,new vt(s,u,l,e.opacity)}function wO(e,n,r,o){return arguments.length===1?H_(e):new vt(e,n,r,o??1)}function vt(e,n,r,o){this.h=+e,this.s=+n,this.l=+r,this.opacity=+o}El(vt,wO,J_(ii,{brighter(e){return e=e==null?Vi:Math.pow(Vi,e),new vt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?br:Math.pow(br,e),new vt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,o=r+(r<.5?r:1-r)*n,i=2*r-o;return new He(ha(e>=240?e-240:e+120,i,o),ha(e,i,o),ha(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new vt(Gc(this.h),vi(this.s),vi(this.l),Wi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Wi(this.opacity);return`${e===1?"hsl(":"hsla("}${Gc(this.h)}, ${vi(this.s)*100}%, ${vi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Gc(e){return e=(e||0)%360,e<0?e+360:e}function vi(e){return Math.max(0,Math.min(1,e||0))}function ha(e,n,r){return(e<60?n+(r-n)*e/60:e<180?r:e<240?n+(r-n)*(240-e)/60:n)*255}const V_=e=>()=>e;function kO(e,n){return function(r){return e+r*n}}function xO(e,n,r){return e=Math.pow(e,r),n=Math.pow(n,r)-e,r=1/r,function(o){return Math.pow(e+o*n,r)}}function SO(e){return(e=+e)==1?W_:function(n,r){return r-n?xO(n,r,e):V_(isNaN(n)?r:n)}}function W_(e,n){var r=n-e;return r?kO(e,r):V_(isNaN(e)?n:e)}const Bc=(function e(n){var r=SO(n);function o(i,a){var s=r((i=Aa(i)).r,(a=Aa(a)).r),u=r(i.g,a.g),l=r(i.b,a.b),c=W_(i.opacity,a.opacity);return function(d){return i.r=s(d),i.g=u(d),i.b=l(d),i.opacity=c(d),i+""}}return o.gamma=e,o})(1);function Ht(e,n){return e=+e,n=+n,function(r){return e*(1-r)+n*r}}var ja=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pa=new RegExp(ja.source,"g");function IO(e){return function(){return e}}function zO(e){return function(n){return e(n)+""}}function OO(e,n){var r=ja.lastIndex=pa.lastIndex=0,o,i,a,s=-1,u=[],l=[];for(e=e+"",n=n+"";(o=ja.exec(e))&&(i=pa.exec(n));)(a=i.index)>r&&(a=n.slice(r,a),u[s]?u[s]+=a:u[++s]=a),(o=o[0])===(i=i[0])?u[s]?u[s]+=i:u[++s]=i:(u[++s]=null,l.push({i:s,x:Ht(o,i)})),r=pa.lastIndex;return r<n.length&&(a=n.slice(r),u[s]?u[s]+=a:u[++s]=a),u.length<2?l[0]?zO(l[0].x):IO(n):(n=l.length,function(c){for(var d=0,f;d<n;++d)u[(f=l[d]).i]=f.x(c);return u.join("")})}var Xc=180/Math.PI,Za={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function G_(e,n,r,o,i,a){var s,u,l;return(s=Math.sqrt(e*e+n*n))&&(e/=s,n/=s),(l=e*r+n*o)&&(r-=e*l,o-=n*l),(u=Math.sqrt(r*r+o*o))&&(r/=u,o/=u,l/=u),e*o<n*r&&(e=-e,n=-n,l=-l,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(n,e)*Xc,skewX:Math.atan(l)*Xc,scaleX:s,scaleY:u}}var _i;function PO(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Za:G_(n.a,n.b,n.c,n.d,n.e,n.f)}function TO(e){return e==null||(_i||(_i=document.createElementNS("http://www.w3.org/2000/svg","g")),_i.setAttribute("transform",e),!(e=_i.transform.baseVal.consolidate()))?Za:(e=e.matrix,G_(e.a,e.b,e.c,e.d,e.e,e.f))}function B_(e,n,r,o){function i(c){return c.length?c.pop()+" ":""}function a(c,d,f,h,p,m){if(c!==f||d!==h){var v=p.push("translate(",null,n,null,r);m.push({i:v-4,x:Ht(c,f)},{i:v-2,x:Ht(d,h)})}else(f||h)&&p.push("translate("+f+n+h+r)}function s(c,d,f,h){c!==d?(c-d>180?d+=360:d-c>180&&(c+=360),h.push({i:f.push(i(f)+"rotate(",null,o)-2,x:Ht(c,d)})):d&&f.push(i(f)+"rotate("+d+o)}function u(c,d,f,h){c!==d?h.push({i:f.push(i(f)+"skewX(",null,o)-2,x:Ht(c,d)}):d&&f.push(i(f)+"skewX("+d+o)}function l(c,d,f,h,p,m){if(c!==f||d!==h){var v=p.push(i(p)+"scale(",null,",",null,")");m.push({i:v-4,x:Ht(c,f)},{i:v-2,x:Ht(d,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(c,d){var f=[],h=[];return c=e(c),d=e(d),a(c.translateX,c.translateY,d.translateX,d.translateY,f,h),s(c.rotate,d.rotate,f,h),u(c.skewX,d.skewX,f,h),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,f,h),c=d=null,function(p){for(var m=-1,v=h.length,y;++m<v;)f[(y=h[m]).i]=y.x(p);return f.join("")}}}var EO=B_(PO,"px, ","px)","deg)"),NO=B_(TO,", ",")",")"),UO=1e-12;function Kc(e){return((e=Math.exp(e))+1/e)/2}function AO(e){return((e=Math.exp(e))-1/e)/2}function jO(e){return((e=Math.exp(2*e))-1)/(e+1)}const ZO=(function e(n,r,o){function i(a,s){var u=a[0],l=a[1],c=a[2],d=s[0],f=s[1],h=s[2],p=d-u,m=f-l,v=p*p+m*m,y,g;if(v<UO)g=Math.log(h/c)/n,y=function(x){return[u+x*p,l+x*m,c*Math.exp(n*x*g)]};else{var w=Math.sqrt(v),z=(h*h-c*c+o*v)/(2*c*r*w),$=(h*h-c*c-o*v)/(2*h*r*w),b=Math.log(Math.sqrt(z*z+1)-z),k=Math.log(Math.sqrt($*$+1)-$);g=(k-b)/n,y=function(x){var O=x*g,Z=Kc(b),A=c/(r*w)*(Z*jO(n*O+b)-AO(b));return[u+A*p,l+A*m,c*Z/Kc(n*O+b)]}}return y.duration=g*1e3*n/Math.SQRT2,y}return i.rho=function(a){var s=Math.max(.001,+a),u=s*s,l=u*u;return e(s,u,l)},i})(Math.SQRT2,2,4);var CO=ni("start","end","cancel","interrupt"),DO=[],X_=0,Yc=1,Ca=2,xi=3,Qc=4,Da=5,Si=6;function ra(e,n,r,o,i,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;RO(e,r,{name:n,index:o,group:i,on:CO,tween:DO,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:X_})}function Nl(e,n){var r=$t(e,n);if(r.state>X_)throw new Error("too late; already scheduled");return r}function Ot(e,n){var r=$t(e,n);if(r.state>xi)throw new Error("too late; already running");return r}function $t(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function RO(e,n,r){var o=e.__transition,i;o[n]=r,r.timer=Ol(a,0,r.time);function a(c){r.state=Yc,r.timer.restart(s,r.delay,r.time),r.delay<=c&&s(c-r.delay)}function s(c){var d,f,h,p;if(r.state!==Yc)return l();for(d in o)if(p=o[d],p.name===r.name){if(p.state===xi)return Zc(s);p.state===Qc?(p.state=Si,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete o[d]):+d<n&&(p.state=Si,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete o[d])}if(Zc(function(){r.state===xi&&(r.state=Qc,r.timer.restart(u,r.delay,r.time),u(c))}),r.state=Ca,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Ca){for(r.state=xi,i=new Array(h=r.tween.length),d=0,f=-1;d<h;++d)(p=r.tween[d].value.call(e,e.__data__,r.index,r.group))&&(i[++f]=p);i.length=f+1}}function u(c){for(var d=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=Da,1),f=-1,h=i.length;++f<h;)i[f].call(e,d);r.state===Da&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=Si,r.timer.stop(),delete o[n];for(var c in o)return;delete e.__transition}}function Ii(e,n){var r=e.__transition,o,i,a=!0,s;if(r){n=n==null?null:n+"";for(s in r){if((o=r[s]).name!==n){a=!1;continue}i=o.state>Ca&&o.state<Da,o.state=Si,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete r[s]}a&&delete e.__transition}}function MO(e){return this.each(function(){Ii(this,e)})}function LO(e,n){var r,o;return function(){var i=Ot(this,e),a=i.tween;if(a!==r){o=r=a;for(var s=0,u=o.length;s<u;++s)if(o[s].name===n){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function FO(e,n,r){var o,i;if(typeof r!="function")throw new Error;return function(){var a=Ot(this,e),s=a.tween;if(s!==o){i=(o=s).slice();for(var u={name:n,value:r},l=0,c=i.length;l<c;++l)if(i[l].name===n){i[l]=u;break}l===c&&i.push(u)}a.tween=i}}function qO(e,n){var r=this._id;if(e+="",arguments.length<2){for(var o=$t(this.node(),r).tween,i=0,a=o.length,s;i<a;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((n==null?LO:FO)(r,e,n))}function Ul(e,n,r){var o=e._id;return e.each(function(){var i=Ot(this,o);(i.value||(i.value={}))[n]=r.apply(this,arguments)}),function(i){return $t(i,o).value[n]}}function K_(e,n){var r;return(typeof n=="number"?Ht:n instanceof wr?Bc:(r=wr(n))?(n=r,Bc):OO)(e,n)}function JO(e){return function(){this.removeAttribute(e)}}function HO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function VO(e,n,r){var o,i=r+"",a;return function(){var s=this.getAttribute(e);return s===i?null:s===o?a:a=n(o=s,r)}}function WO(e,n,r){var o,i=r+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?a:a=n(o=s,r)}}function GO(e,n,r){var o,i,a;return function(){var s,u=r(this),l;return u==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=u+"",s===l?null:s===o&&l===i?a:(i=l,a=n(o=s,u)))}}function BO(e,n,r){var o,i,a;return function(){var s,u=r(this),l;return u==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=u+"",s===l?null:s===o&&l===i?a:(i=l,a=n(o=s,u)))}}function XO(e,n){var r=na(e),o=r==="transform"?NO:K_;return this.attrTween(e,typeof n=="function"?(r.local?BO:GO)(r,o,Ul(this,"attr."+e,n)):n==null?(r.local?HO:JO)(r):(r.local?WO:VO)(r,o,n))}function KO(e,n){return function(r){this.setAttribute(e,n.call(this,r))}}function YO(e,n){return function(r){this.setAttributeNS(e.space,e.local,n.call(this,r))}}function QO(e,n){var r,o;function i(){var a=n.apply(this,arguments);return a!==o&&(r=(o=a)&&YO(e,a)),r}return i._value=n,i}function eP(e,n){var r,o;function i(){var a=n.apply(this,arguments);return a!==o&&(r=(o=a)&&KO(e,a)),r}return i._value=n,i}function tP(e,n){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;var o=na(e);return this.tween(r,(o.local?QO:eP)(o,n))}function nP(e,n){return function(){Nl(this,e).delay=+n.apply(this,arguments)}}function rP(e,n){return n=+n,function(){Nl(this,e).delay=n}}function iP(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?nP:rP)(n,e)):$t(this.node(),n).delay}function oP(e,n){return function(){Ot(this,e).duration=+n.apply(this,arguments)}}function aP(e,n){return n=+n,function(){Ot(this,e).duration=n}}function sP(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?oP:aP)(n,e)):$t(this.node(),n).duration}function uP(e,n){if(typeof n!="function")throw new Error;return function(){Ot(this,e).ease=n}}function lP(e){var n=this._id;return arguments.length?this.each(uP(n,e)):$t(this.node(),n).ease}function cP(e,n){return function(){var r=n.apply(this,arguments);if(typeof r!="function")throw new Error;Ot(this,e).ease=r}}function fP(e){if(typeof e!="function")throw new Error;return this.each(cP(this._id,e))}function dP(e){typeof e!="function"&&(e=N_(e));for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i)for(var a=n[i],s=a.length,u=o[i]=[],l,c=0;c<s;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&u.push(l);return new Dt(o,this._parents,this._name,this._id)}function hP(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,r=e._groups,o=n.length,i=r.length,a=Math.min(o,i),s=new Array(o),u=0;u<a;++u)for(var l=n[u],c=r[u],d=l.length,f=s[u]=new Array(d),h,p=0;p<d;++p)(h=l[p]||c[p])&&(f[p]=h);for(;u<o;++u)s[u]=n[u];return new Dt(s,this._parents,this._name,this._id)}function pP(e){return(e+"").trim().split(/^|\s+/).every(function(n){var r=n.indexOf(".");return r>=0&&(n=n.slice(0,r)),!n||n==="start"})}function mP(e,n,r){var o,i,a=pP(n)?Nl:Ot;return function(){var s=a(this,e),u=s.on;u!==o&&(i=(o=u).copy()).on(n,r),s.on=i}}function gP(e,n){var r=this._id;return arguments.length<2?$t(this.node(),r).on.on(e):this.each(mP(r,e,n))}function vP(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function _P(){return this.on("end.remove",vP(this._id))}function yP(e){var n=this._name,r=this._id;typeof e!="function"&&(e=Pl(e));for(var o=this._groups,i=o.length,a=new Array(i),s=0;s<i;++s)for(var u=o[s],l=u.length,c=a[s]=new Array(l),d,f,h=0;h<l;++h)(d=u[h])&&(f=e.call(d,d.__data__,h,u))&&("__data__"in d&&(f.__data__=d.__data__),c[h]=f,ra(c[h],n,r,h,c,$t(d,r)));return new Dt(a,this._parents,n,r)}function bP(e){var n=this._name,r=this._id;typeof e!="function"&&(e=E_(e));for(var o=this._groups,i=o.length,a=[],s=[],u=0;u<i;++u)for(var l=o[u],c=l.length,d,f=0;f<c;++f)if(d=l[f]){for(var h=e.call(d,d.__data__,f,l),p,m=$t(d,r),v=0,y=h.length;v<y;++v)(p=h[v])&&ra(p,n,r,v,h,m);a.push(h),s.push(d)}return new Dt(a,s,n,r)}var $P=ri.prototype.constructor;function wP(){return new $P(this._groups,this._parents)}function kP(e,n){var r,o,i;return function(){var a=Rn(this,e),s=(this.style.removeProperty(e),Rn(this,e));return a===s?null:a===r&&s===o?i:i=n(r=a,o=s)}}function Y_(e){return function(){this.style.removeProperty(e)}}function xP(e,n,r){var o,i=r+"",a;return function(){var s=Rn(this,e);return s===i?null:s===o?a:a=n(o=s,r)}}function SP(e,n,r){var o,i,a;return function(){var s=Rn(this,e),u=r(this),l=u+"";return u==null&&(l=u=(this.style.removeProperty(e),Rn(this,e))),s===l?null:s===o&&l===i?a:(i=l,a=n(o=s,u))}}function IP(e,n){var r,o,i,a="style."+n,s="end."+a,u;return function(){var l=Ot(this,e),c=l.on,d=l.value[a]==null?u||(u=Y_(n)):void 0;(c!==r||i!==d)&&(o=(r=c).copy()).on(s,i=d),l.on=o}}function zP(e,n,r){var o=(e+="")=="transform"?EO:K_;return n==null?this.styleTween(e,kP(e,o)).on("end.style."+e,Y_(e)):typeof n=="function"?this.styleTween(e,SP(e,o,Ul(this,"style."+e,n))).each(IP(this._id,e)):this.styleTween(e,xP(e,o,n),r).on("end.style."+e,null)}function OP(e,n,r){return function(o){this.style.setProperty(e,n.call(this,o),r)}}function PP(e,n,r){var o,i;function a(){var s=n.apply(this,arguments);return s!==i&&(o=(i=s)&&OP(e,s,r)),o}return a._value=n,a}function TP(e,n,r){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(n==null)return this.tween(o,null);if(typeof n!="function")throw new Error;return this.tween(o,PP(e,n,r??""))}function EP(e){return function(){this.textContent=e}}function NP(e){return function(){var n=e(this);this.textContent=n??""}}function UP(e){return this.tween("text",typeof e=="function"?NP(Ul(this,"text",e)):EP(e==null?"":e+""))}function AP(e){return function(n){this.textContent=e.call(this,n)}}function jP(e){var n,r;function o(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&AP(i)),n}return o._value=e,o}function ZP(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,jP(e))}function CP(){for(var e=this._name,n=this._id,r=Q_(),o=this._groups,i=o.length,a=0;a<i;++a)for(var s=o[a],u=s.length,l,c=0;c<u;++c)if(l=s[c]){var d=$t(l,n);ra(l,e,r,c,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Dt(o,this._parents,e,r)}function DP(){var e,n,r=this,o=r._id,i=r.size();return new Promise(function(a,s){var u={value:s},l={value:function(){--i===0&&a()}};r.each(function(){var c=Ot(this,o),d=c.on;d!==e&&(n=(e=d).copy(),n._.cancel.push(u),n._.interrupt.push(u),n._.end.push(l)),c.on=n}),i===0&&a()})}var RP=0;function Dt(e,n,r,o){this._groups=e,this._parents=n,this._name=r,this._id=o}function Q_(){return++RP}var Et=ri.prototype;Dt.prototype={constructor:Dt,select:yP,selectAll:bP,selectChild:Et.selectChild,selectChildren:Et.selectChildren,filter:dP,merge:hP,selection:wP,transition:CP,call:Et.call,nodes:Et.nodes,node:Et.node,size:Et.size,empty:Et.empty,each:Et.each,on:gP,attr:XO,attrTween:tP,style:zP,styleTween:TP,text:UP,textTween:ZP,remove:_P,tween:qO,delay:iP,duration:sP,ease:lP,easeVarying:fP,end:DP,[Symbol.iterator]:Et[Symbol.iterator]};function MP(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var LP={time:null,delay:0,duration:250,ease:MP};function FP(e,n){for(var r;!(r=e.__transition)||!(r=r[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return r}function qP(e){var n,r;e instanceof Dt?(n=e._id,e=e._name):(n=Q_(),(r=LP).time=zl(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,a=0;a<i;++a)for(var s=o[a],u=s.length,l,c=0;c<u;++c)(l=s[c])&&ra(l,e,n,c,s,r||FP(l,n));return new Dt(o,this._parents,e,n)}ri.prototype.interrupt=MO;ri.prototype.transition=qP;const yi=e=>()=>e;function JP(e,{sourceEvent:n,target:r,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function jt(e,n,r){this.k=e,this.x=n,this.y=r}jt.prototype={constructor:jt,scale:function(e){return e===1?this:new jt(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new jt(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Al=new jt(1,0,0);wt.prototype=jt.prototype;function wt(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Al;return e.__zoom}function ma(e){e.stopImmediatePropagation()}function Wn(e){e.preventDefault(),e.stopImmediatePropagation()}function HP(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function VP(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ef(){return this.__zoom||Al}function WP(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function GP(){return navigator.maxTouchPoints||"ontouchstart"in this}function BP(e,n,r){var o=e.invertX(n[0][0])-r[0][0],i=e.invertX(n[1][0])-r[1][0],a=e.invertY(n[0][1])-r[0][1],s=e.invertY(n[1][1])-r[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function XP(){var e=HP,n=VP,r=BP,o=WP,i=GP,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],u=250,l=ZO,c=ni("start","zoom","end"),d,f,h,p=500,m=150,v=0,y=10;function g(I){I.property("__zoom",ef).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",Z).on("dblclick.zoom",A).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",X).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(I,C,E,F){var B=I.selection?I.selection():I;B.property("__zoom",ef),I!==B?b(I,C,E,F):B.interrupt().each(function(){k(this,arguments).event(F).start().zoom(null,typeof C=="function"?C.apply(this,arguments):C).end()})},g.scaleBy=function(I,C,E,F){g.scaleTo(I,function(){var B=this.__zoom.k,J=typeof C=="function"?C.apply(this,arguments):C;return B*J},E,F)},g.scaleTo=function(I,C,E,F){g.transform(I,function(){var B=n.apply(this,arguments),J=this.__zoom,K=E==null?$(B):typeof E=="function"?E.apply(this,arguments):E,W=J.invert(K),te=typeof C=="function"?C.apply(this,arguments):C;return r(z(w(J,te),K,W),B,s)},E,F)},g.translateBy=function(I,C,E,F){g.transform(I,function(){return r(this.__zoom.translate(typeof C=="function"?C.apply(this,arguments):C,typeof E=="function"?E.apply(this,arguments):E),n.apply(this,arguments),s)},null,F)},g.translateTo=function(I,C,E,F,B){g.transform(I,function(){var J=n.apply(this,arguments),K=this.__zoom,W=F==null?$(J):typeof F=="function"?F.apply(this,arguments):F;return r(Al.translate(W[0],W[1]).scale(K.k).translate(typeof C=="function"?-C.apply(this,arguments):-C,typeof E=="function"?-E.apply(this,arguments):-E),J,s)},F,B)};function w(I,C){return C=Math.max(a[0],Math.min(a[1],C)),C===I.k?I:new jt(C,I.x,I.y)}function z(I,C,E){var F=C[0]-E[0]*I.k,B=C[1]-E[1]*I.k;return F===I.x&&B===I.y?I:new jt(I.k,F,B)}function $(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function b(I,C,E,F){I.on("start.zoom",function(){k(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(F).end()}).tween("zoom",function(){var B=this,J=arguments,K=k(B,J).event(F),W=n.apply(B,J),te=E==null?$(W):typeof E=="function"?E.apply(B,J):E,le=Math.max(W[1][0]-W[0][0],W[1][1]-W[0][1]),ae=B.__zoom,xe=typeof C=="function"?C.apply(B,J):C,Pt=l(ae.invert(te).concat(le/ae.k),xe.invert(te).concat(le/xe.k));return function(pt){if(pt===1)pt=xe;else{var Tt=Pt(pt),sa=le/Tt[2];pt=new jt(sa,te[0]-Tt[0]*sa,te[1]-Tt[1]*sa)}K.zoom(null,pt)}})}function k(I,C,E){return!E&&I.__zooming||new x(I,C)}function x(I,C){this.that=I,this.args=C,this.active=0,this.sourceEvent=null,this.extent=n.apply(I,C),this.taps=0}x.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,C){return this.mouse&&I!=="mouse"&&(this.mouse[1]=C.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=C.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=C.invert(this.touch1[0])),this.that.__zoom=C,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var C=it(this.that).datum();c.call(I,this.that,new JP(I,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:c}),C)}};function O(I,...C){if(!e.apply(this,arguments))return;var E=k(this,C).event(I),F=this.__zoom,B=Math.max(a[0],Math.min(a[1],F.k*Math.pow(2,o.apply(this,arguments)))),J=kt(I);if(E.wheel)(E.mouse[0][0]!==J[0]||E.mouse[0][1]!==J[1])&&(E.mouse[1]=F.invert(E.mouse[0]=J)),clearTimeout(E.wheel);else{if(F.k===B)return;E.mouse=[J,F.invert(J)],Ii(this),E.start()}Wn(I),E.wheel=setTimeout(K,m),E.zoom("mouse",r(z(w(F,B),E.mouse[0],E.mouse[1]),E.extent,s));function K(){E.wheel=null,E.end()}}function Z(I,...C){if(h||!e.apply(this,arguments))return;var E=I.currentTarget,F=k(this,C,!0).event(I),B=it(I.view).on("mousemove.zoom",te,!0).on("mouseup.zoom",le,!0),J=kt(I,E),K=I.clientX,W=I.clientY;F_(I.view),ma(I),F.mouse=[J,this.__zoom.invert(J)],Ii(this),F.start();function te(ae){if(Wn(ae),!F.moved){var xe=ae.clientX-K,Pt=ae.clientY-W;F.moved=xe*xe+Pt*Pt>v}F.event(ae).zoom("mouse",r(z(F.that.__zoom,F.mouse[0]=kt(ae,E),F.mouse[1]),F.extent,s))}function le(ae){B.on("mousemove.zoom mouseup.zoom",null),q_(ae.view,F.moved),Wn(ae),F.event(ae).end()}}function A(I,...C){if(e.apply(this,arguments)){var E=this.__zoom,F=kt(I.changedTouches?I.changedTouches[0]:I,this),B=E.invert(F),J=E.k*(I.shiftKey?.5:2),K=r(z(w(E,J),F,B),n.apply(this,C),s);Wn(I),u>0?it(this).transition().duration(u).call(b,K,F,I):it(this).call(g.transform,K,F,I)}}function D(I,...C){if(e.apply(this,arguments)){var E=I.touches,F=E.length,B=k(this,C,I.changedTouches.length===F).event(I),J,K,W,te;for(ma(I),K=0;K<F;++K)W=E[K],te=kt(W,this),te=[te,this.__zoom.invert(te),W.identifier],B.touch0?!B.touch1&&B.touch0[2]!==te[2]&&(B.touch1=te,B.taps=0):(B.touch0=te,J=!0,B.taps=1+!!d);d&&(d=clearTimeout(d)),J&&(B.taps<2&&(f=te[0],d=setTimeout(function(){d=null},p)),Ii(this),B.start())}}function R(I,...C){if(this.__zooming){var E=k(this,C).event(I),F=I.changedTouches,B=F.length,J,K,W,te;for(Wn(I),J=0;J<B;++J)K=F[J],W=kt(K,this),E.touch0&&E.touch0[2]===K.identifier?E.touch0[0]=W:E.touch1&&E.touch1[2]===K.identifier&&(E.touch1[0]=W);if(K=E.that.__zoom,E.touch1){var le=E.touch0[0],ae=E.touch0[1],xe=E.touch1[0],Pt=E.touch1[1],pt=(pt=xe[0]-le[0])*pt+(pt=xe[1]-le[1])*pt,Tt=(Tt=Pt[0]-ae[0])*Tt+(Tt=Pt[1]-ae[1])*Tt;K=w(K,Math.sqrt(pt/Tt)),W=[(le[0]+xe[0])/2,(le[1]+xe[1])/2],te=[(ae[0]+Pt[0])/2,(ae[1]+Pt[1])/2]}else if(E.touch0)W=E.touch0[0],te=E.touch0[1];else return;E.zoom("touch",r(z(K,W,te),E.extent,s))}}function X(I,...C){if(this.__zooming){var E=k(this,C).event(I),F=I.changedTouches,B=F.length,J,K;for(ma(I),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),J=0;J<B;++J)K=F[J],E.touch0&&E.touch0[2]===K.identifier?delete E.touch0:E.touch1&&E.touch1[2]===K.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(K=kt(K,this),Math.hypot(f[0]-K[0],f[1]-K[1])<y)){var W=it(this).on("dblclick.zoom");W&&W.apply(this,arguments)}}}return g.wheelDelta=function(I){return arguments.length?(o=typeof I=="function"?I:yi(+I),g):o},g.filter=function(I){return arguments.length?(e=typeof I=="function"?I:yi(!!I),g):e},g.touchable=function(I){return arguments.length?(i=typeof I=="function"?I:yi(!!I),g):i},g.extent=function(I){return arguments.length?(n=typeof I=="function"?I:yi([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),g):n},g.scaleExtent=function(I){return arguments.length?(a[0]=+I[0],a[1]=+I[1],g):[a[0],a[1]]},g.translateExtent=function(I){return arguments.length?(s[0][0]=+I[0][0],s[1][0]=+I[1][0],s[0][1]=+I[0][1],s[1][1]=+I[1][1],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(I){return arguments.length?(r=I,g):r},g.duration=function(I){return arguments.length?(u=+I,g):u},g.interpolate=function(I){return arguments.length?(l=I,g):l},g.on=function(){var I=c.on.apply(c,arguments);return I===c?g:I},g.clickDistance=function(I){return arguments.length?(v=(I=+I)*I,g):Math.sqrt(v)},g.tapDistance=function(I){return arguments.length?(y=+I,g):y},g}class tf extends Map{constructor(n,r=QP){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),n!=null)for(const[o,i]of n)this.set(o,i)}get(n){return super.get(nf(this,n))}has(n){return super.has(nf(this,n))}set(n,r){return super.set(KP(this,n),r)}delete(n){return super.delete(YP(this,n))}}function nf({_intern:e,_key:n},r){const o=n(r);return e.has(o)?e.get(o):r}function KP({_intern:e,_key:n},r){const o=n(r);return e.has(o)?e.get(o):(e.set(o,r),r)}function YP({_intern:e,_key:n},r){const o=n(r);return e.has(o)&&(r=e.get(o),e.delete(o)),r}function QP(e){return e!==null&&typeof e=="object"?e.valueOf():e}function rf(e,n){let r;if(n===void 0)for(const o of e)o!=null&&(r<o||r===void 0&&o>=o)&&(r=o);else{let o=-1;for(let i of e)(i=n(i,++o,e))!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}return r}function of(e,n){let r;if(n===void 0)for(const o of e)o!=null&&(r>o||r===void 0&&o>=o)&&(r=o);else{let o=-1;for(let i of e)(i=n(i,++o,e))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function eT(e,n){let r=0;for(let o of e)(o=+o)&&(r+=o);return r}var tT=typeof global=="object"&&global&&global.Object===Object&&global,nT=typeof self=="object"&&self&&self.Object===Object&&self,ey=tT||nT||Function("return this")(),Gi=ey.Symbol,ty=Object.prototype,rT=ty.hasOwnProperty,iT=ty.toString,Gn=Gi?Gi.toStringTag:void 0;function oT(e){var n=rT.call(e,Gn),r=e[Gn];try{e[Gn]=void 0;var o=!0}catch{}var i=iT.call(e);return o&&(n?e[Gn]=r:delete e[Gn]),i}var aT=Object.prototype,sT=aT.toString;function uT(e){return sT.call(e)}var lT="[object Null]",cT="[object Undefined]",af=Gi?Gi.toStringTag:void 0;function fT(e){return e==null?e===void 0?cT:lT:af&&af in Object(e)?oT(e):uT(e)}function dT(e){return e!=null&&typeof e=="object"}var hT="[object Symbol]";function pT(e){return typeof e=="symbol"||dT(e)&&fT(e)==hT}var mT=/\s/;function gT(e){for(var n=e.length;n--&&mT.test(e.charAt(n)););return n}var vT=/^\s+/;function _T(e){return e&&e.slice(0,gT(e)+1).replace(vT,"")}function Bi(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var sf=NaN,yT=/^[-+]0x[0-9a-f]+$/i,bT=/^0b[01]+$/i,$T=/^0o[0-7]+$/i,wT=parseInt;function uf(e){if(typeof e=="number")return e;if(pT(e))return sf;if(Bi(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=Bi(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=_T(e);var r=bT.test(e);return r||$T.test(e)?wT(e.slice(2),r?2:8):yT.test(e)?sf:+e}var ga=function(){return ey.Date.now()},kT="Expected a function",xT=Math.max,ST=Math.min;function ny(e,n,r){var o,i,a,s,u,l,c=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(kT);n=uf(n)||0,Bi(r)&&(d=!!r.leading,f="maxWait"in r,a=f?xT(uf(r.maxWait)||0,n):a,h="trailing"in r?!!r.trailing:h);function p(k){var x=o,O=i;return o=i=void 0,c=k,s=e.apply(O,x),s}function m(k){return c=k,u=setTimeout(g,n),d?p(k):s}function v(k){var x=k-l,O=k-c,Z=n-x;return f?ST(Z,a-O):Z}function y(k){var x=k-l,O=k-c;return l===void 0||x>=n||x<0||f&&O>=a}function g(){var k=ga();if(y(k))return w(k);u=setTimeout(g,v(k))}function w(k){return u=void 0,h&&o?p(k):(o=i=void 0,s)}function z(){u!==void 0&&clearTimeout(u),c=0,o=l=i=u=void 0}function $(){return u===void 0?s:w(ga())}function b(){var k=ga(),x=y(k);if(o=arguments,i=this,l=k,x){if(u===void 0)return m(l);if(f)return clearTimeout(u),u=setTimeout(g,n),p(l)}return u===void 0&&(u=setTimeout(g,n)),s}return b.cancel=z,b.flush=$,b}var IT="Expected a function";function zT(e,n,r){var o=!0,i=!0;if(typeof e!="function")throw new TypeError(IT);return Bi(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),ny(e,n,{leading:o,maxWait:n,trailing:i})}var cn=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-cn.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?cn.Bounce.In(e*2)*.5:cn.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(n){return Math.pow(n,e)},Out:function(n){return 1-Math.pow(1-n,e)},InOut:function(n){return n<.5?Math.pow(n*2,e)/2:(1-Math.pow(2-n*2,e))/2+.5}}}}),ir=function(){return performance.now()},ry=(function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(r){return n._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(n){this._tweens[n.getId()]=n,this._tweensAddedDuringUpdate[n.getId()]=n},e.prototype.remove=function(n){delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]},e.prototype.update=function(n,r){n===void 0&&(n=ir()),r===void 0&&(r=!1);var o=Object.keys(this._tweens);if(o.length===0)return!1;for(;o.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<o.length;i++){var a=this._tweens[o[i]],s=!r;a&&a.update(n,s)===!1&&!r&&delete this._tweens[o[i]]}o=Object.keys(this._tweensAddedDuringUpdate)}return!0},e})(),Ra={Linear:function(e,n){var r=e.length-1,o=r*n,i=Math.floor(o),a=Ra.Utils.Linear;return n<0?a(e[0],e[1],o):n>1?a(e[r],e[r-1],r-o):a(e[i],e[i+1>r?r:i+1],o-i)},Utils:{Linear:function(e,n,r){return(n-e)*r+e}}},iy=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),Ma=new ry,lf=(function(){function e(n,r){r===void 0&&(r=Ma),this._object=n,this._group=r,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=cn.Linear.None,this._interpolationFunction=Ra.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=iy.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(n,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=n,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(n){return n===void 0&&(n=1e3),this._duration=n<0?0:n,this},e.prototype.dynamic=function(n){return n===void 0&&(n=!1),this._isDynamic=n,this},e.prototype.start=function(n,r){if(n===void 0&&(n=ir()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var o in this._valuesStartRepeat)this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var a in this._valuesEnd)i[a]=this._valuesEnd[a];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(n){return this.start(n,!0)},e.prototype._setupProperties=function(n,r,o,i,a){for(var s in o){var u=n[s],l=Array.isArray(u),c=l?"array":typeof u,d=!l&&Array.isArray(o[s]);if(!(c==="undefined"||c==="function")){if(d){var f=o[s];if(f.length===0)continue;for(var h=[u],p=0,m=f.length;p<m;p+=1){var v=this._handleRelativeValue(u,f[p]);if(isNaN(v)){d=!1,console.warn("Found invalid interpolation list. Skipping.");break}h.push(v)}d&&(o[s]=h)}if((c==="object"||l)&&u&&!d){r[s]=l?[]:{};var y=u;for(var g in y)r[s][g]=y[g];i[s]=l?[]:{};var f=o[s];if(!this._isDynamic){var w={};for(var g in f)w[g]=f[g];o[s]=f=w}this._setupProperties(y,r[s],f,i[s],a)}else(typeof r[s]>"u"||a)&&(r[s]=u),l||(r[s]*=1),d?i[s]=o[s].slice().reverse():i[s]=r[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(n){return n===void 0&&(n=ir()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this._group&&this._group.remove(this),this)},e.prototype.resume=function(n){return n===void 0&&(n=ir()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var n=0,r=this._chainedTweens.length;n<r;n++)this._chainedTweens[n].stop();return this},e.prototype.group=function(n){return n===void 0&&(n=Ma),this._group=n,this},e.prototype.delay=function(n){return n===void 0&&(n=0),this._delayTime=n,this},e.prototype.repeat=function(n){return n===void 0&&(n=0),this._initialRepeat=n,this._repeat=n,this},e.prototype.repeatDelay=function(n){return this._repeatDelayTime=n,this},e.prototype.yoyo=function(n){return n===void 0&&(n=!1),this._yoyo=n,this},e.prototype.easing=function(n){return n===void 0&&(n=cn.Linear.None),this._easingFunction=n,this},e.prototype.interpolation=function(n){return n===void 0&&(n=Ra.Linear),this._interpolationFunction=n,this},e.prototype.chain=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return this._chainedTweens=n,this},e.prototype.onStart=function(n){return this._onStartCallback=n,this},e.prototype.onEveryStart=function(n){return this._onEveryStartCallback=n,this},e.prototype.onUpdate=function(n){return this._onUpdateCallback=n,this},e.prototype.onRepeat=function(n){return this._onRepeatCallback=n,this},e.prototype.onComplete=function(n){return this._onCompleteCallback=n,this},e.prototype.onStop=function(n){return this._onStopCallback=n,this},e.prototype.update=function(n,r){var o=this,i;if(n===void 0&&(n=ir()),r===void 0&&(r=!0),this._isPaused)return!0;var a,s=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(n>s)return!1;r&&this.start(n,!0)}if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var u=n-this._startTime,l=this._duration+((i=this._repeatDelayTime)!==null&&i!==void 0?i:this._delayTime),c=this._duration+this._repeat*l,d=function(){if(o._duration===0||u>c)return 1;var y=Math.trunc(u/l),g=u-y*l,w=Math.min(g/o._duration,1);return w===0&&u===o._duration?1:w},f=d(),h=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||u>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((u-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(a in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[a]=="string"&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo&&this._swapEndStartRepeatValues(a),this._valuesStart[a]=this._valuesStartRepeat[a];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var m=0,v=this._chainedTweens.length;m<v;m++)this._chainedTweens[m].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(n,r,o,i){for(var a in o)if(r[a]!==void 0){var s=r[a]||0,u=o[a],l=Array.isArray(n[a]),c=Array.isArray(u),d=!l&&c;d?n[a]=this._interpolationFunction(u,i):typeof u=="object"&&u?this._updateProperties(n[a],s,u,i):(u=this._handleRelativeValue(s,u),typeof u=="number"&&(n[a]=s+(u-s)*i))}},e.prototype._handleRelativeValue=function(n,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?n+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(n){var r=this._valuesStartRepeat[n],o=this._valuesEnd[n];typeof o=="string"?this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(o):this._valuesStartRepeat[n]=this._valuesEnd[n],this._valuesEnd[n]=r},e})();iy.nextId;var zt=Ma;zt.getAll.bind(zt);zt.removeAll.bind(zt);zt.add.bind(zt);zt.remove.bind(zt);zt.update.bind(zt);function cf(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,o=Array(n);r<n;r++)o[r]=e[r];return o}function OT(e){if(Array.isArray(e))return e}function PT(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function TT(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function ET(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o,i,a,s,u=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(l=(o=a.call(r)).done)&&(u.push(o.value),u.length!==n);l=!0);}catch(d){c=!0,i=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return u}}function NT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
124
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UT(e,n){return OT(e)||ET(e,n)||AT(e,n)||NT()}function AT(e,n){if(e){if(typeof e=="string")return cf(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?cf(e,n):void 0}}var jT=TT(function e(n,r){var o=r.default,i=o===void 0?null:o,a=r.triggerUpdate,s=a===void 0?!0:a,u=r.onChange,l=u===void 0?function(c,d){}:u;PT(this,e),this.name=n,this.defaultVal=i,this.triggerUpdate=s,this.onChange=l});function jl(e){var n=e.stateInit,r=n===void 0?function(){return{}}:n,o=e.props,i=o===void 0?{}:o,a=e.methods,s=a===void 0?{}:a,u=e.aliases,l=u===void 0?{}:u,c=e.init,d=c===void 0?function(){}:c,f=e.update,h=f===void 0?function(){}:f,p=Object.keys(i).map(function(m){return new jT(m,i[m])});return function m(){for(var v=arguments.length,y=new Array(v),g=0;g<v;g++)y[g]=arguments[g];var w=!!(this instanceof m&&this.constructor),z=w?y.shift():void 0,$=y[0],b=$===void 0?{}:$,k=Object.assign({},r instanceof Function?r(b):r,{initialised:!1}),x={};function O(D){return Z(D,b),A(),O}var Z=function(R,X){d.call(O,R,k,X),k.initialised=!0},A=ny(function(){k.initialised&&(h.call(O,k,x),x={})},1);return p.forEach(function(D){O[D.name]=R(D);function R(X){var I=X.name,C=X.triggerUpdate,E=C===void 0?!1:C,F=X.onChange,B=F===void 0?function(W,te){}:F,J=X.defaultVal,K=J===void 0?null:J;return function(W){var te=k[I];if(!arguments.length)return te;var le=W===void 0?K:W;return k[I]=le,B.call(O,le,k,te),!x.hasOwnProperty(I)&&(x[I]=te),E&&A(),O}}}),Object.keys(s).forEach(function(D){O[D]=function(){for(var R,X=arguments.length,I=new Array(X),C=0;C<X;C++)I[C]=arguments[C];return(R=s[D]).call.apply(R,[O,k].concat(I))}}),Object.entries(l).forEach(function(D){var R=UT(D,2),X=R[0],I=R[1];return O[X]=O[I]}),O.resetProps=function(){return p.forEach(function(D){O[D.name](D.defaultVal)}),O},O.resetProps(),k._rerender=A,w&&z&&O(z),O}}var se=(function(e){return typeof e=="function"?e:typeof e=="string"?function(n){return n[e]}:function(n){return e}});function Xi(e){"@babel/helpers - typeof";return Xi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Xi(e)}var ZT=/^\s+/,CT=/\s+$/;function H(e,n){if(e=e||"",n=n||{},e instanceof H)return e;if(!(this instanceof H))return new H(e,n);var r=DT(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}H.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var n=this.toRgb(),r,o,i,a,s,u;return r=n.r/255,o=n.g/255,i=n.b/255,r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),i<=.03928?u=i/12.92:u=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*s+.0722*u},setAlpha:function(n){return this._a=oy(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=df(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=df(this._r,this._g,this._b),r=Math.round(n.h*360),o=Math.round(n.s*100),i=Math.round(n.v*100);return this._a==1?"hsv("+r+", "+o+"%, "+i+"%)":"hsva("+r+", "+o+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var n=ff(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=ff(this._r,this._g,this._b),r=Math.round(n.h*360),o=Math.round(n.s*100),i=Math.round(n.l*100);return this._a==1?"hsl("+r+", "+o+"%, "+i+"%)":"hsla("+r+", "+o+"%, "+i+"%, "+this._roundA+")"},toHex:function(n){return hf(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return FT(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(_e(this._r,255)*100)+"%",g:Math.round(_e(this._g,255)*100)+"%",b:Math.round(_e(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(_e(this._r,255)*100)+"%, "+Math.round(_e(this._g,255)*100)+"%, "+Math.round(_e(this._b,255)*100)+"%)":"rgba("+Math.round(_e(this._r,255)*100)+"%, "+Math.round(_e(this._g,255)*100)+"%, "+Math.round(_e(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:eE[hf(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var r="#"+pf(this._r,this._g,this._b,this._a),o=r,i=this._gradientType?"GradientType = 1, ":"";if(n){var a=H(n);o="#"+pf(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+o+")"},toString:function(n){var r=!!n;n=n||this._format;var o=!1,i=this._a<1&&this._a>=0,a=!r&&i&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return a?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(o=this.toRgbString()),n==="prgb"&&(o=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(o=this.toHexString()),n==="hex3"&&(o=this.toHexString(!0)),n==="hex4"&&(o=this.toHex8String(!0)),n==="hex8"&&(o=this.toHex8String()),n==="name"&&(o=this.toName()),n==="hsl"&&(o=this.toHslString()),n==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},clone:function(){return H(this.toString())},_applyModification:function(n,r){var o=n.apply(null,[this].concat([].slice.call(r)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(VT,arguments)},brighten:function(){return this._applyModification(WT,arguments)},darken:function(){return this._applyModification(GT,arguments)},desaturate:function(){return this._applyModification(qT,arguments)},saturate:function(){return this._applyModification(JT,arguments)},greyscale:function(){return this._applyModification(HT,arguments)},spin:function(){return this._applyModification(BT,arguments)},_applyCombination:function(n,r){return n.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(YT,arguments)},complement:function(){return this._applyCombination(XT,arguments)},monochromatic:function(){return this._applyCombination(QT,arguments)},splitcomplement:function(){return this._applyCombination(KT,arguments)},triad:function(){return this._applyCombination(mf,[3])},tetrad:function(){return this._applyCombination(mf,[4])}};H.fromRatio=function(e,n){if(Xi(e)=="object"){var r={};for(var o in e)e.hasOwnProperty(o)&&(o==="a"?r[o]=e[o]:r[o]=or(e[o]));e=r}return H(e,n)};function DT(e){var n={r:0,g:0,b:0},r=1,o=null,i=null,a=null,s=!1,u=!1;return typeof e=="string"&&(e=iE(e)),Xi(e)=="object"&&(Nt(e.r)&&Nt(e.g)&&Nt(e.b)?(n=RT(e.r,e.g,e.b),s=!0,u=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Nt(e.h)&&Nt(e.s)&&Nt(e.v)?(o=or(e.s),i=or(e.v),n=LT(e.h,o,i),s=!0,u="hsv"):Nt(e.h)&&Nt(e.s)&&Nt(e.l)&&(o=or(e.s),a=or(e.l),n=MT(e.h,o,a),s=!0,u="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=oy(r),{ok:s,format:e.format||u,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function RT(e,n,r){return{r:_e(e,255)*255,g:_e(n,255)*255,b:_e(r,255)*255}}function ff(e,n,r){e=_e(e,255),n=_e(n,255),r=_e(r,255);var o=Math.max(e,n,r),i=Math.min(e,n,r),a,s,u=(o+i)/2;if(o==i)a=s=0;else{var l=o-i;switch(s=u>.5?l/(2-o-i):l/(o+i),o){case e:a=(n-r)/l+(n<r?6:0);break;case n:a=(r-e)/l+2;break;case r:a=(e-n)/l+4;break}a/=6}return{h:a,s,l:u}}function MT(e,n,r){var o,i,a;e=_e(e,360),n=_e(n,100),r=_e(r,100);function s(c,d,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?c+(d-c)*6*f:f<1/2?d:f<2/3?c+(d-c)*(2/3-f)*6:c}if(n===0)o=i=a=r;else{var u=r<.5?r*(1+n):r+n-r*n,l=2*r-u;o=s(l,u,e+1/3),i=s(l,u,e),a=s(l,u,e-1/3)}return{r:o*255,g:i*255,b:a*255}}function df(e,n,r){e=_e(e,255),n=_e(n,255),r=_e(r,255);var o=Math.max(e,n,r),i=Math.min(e,n,r),a,s,u=o,l=o-i;if(s=o===0?0:l/o,o==i)a=0;else{switch(o){case e:a=(n-r)/l+(n<r?6:0);break;case n:a=(r-e)/l+2;break;case r:a=(e-n)/l+4;break}a/=6}return{h:a,s,v:u}}function LT(e,n,r){e=_e(e,360)*6,n=_e(n,100),r=_e(r,100);var o=Math.floor(e),i=e-o,a=r*(1-n),s=r*(1-i*n),u=r*(1-(1-i)*n),l=o%6,c=[r,s,a,a,u,r][l],d=[u,r,r,s,a,a][l],f=[a,a,u,r,r,s][l];return{r:c*255,g:d*255,b:f*255}}function hf(e,n,r,o){var i=[bt(Math.round(e).toString(16)),bt(Math.round(n).toString(16)),bt(Math.round(r).toString(16))];return o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function FT(e,n,r,o,i){var a=[bt(Math.round(e).toString(16)),bt(Math.round(n).toString(16)),bt(Math.round(r).toString(16)),bt(ay(o))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function pf(e,n,r,o){var i=[bt(ay(o)),bt(Math.round(e).toString(16)),bt(Math.round(n).toString(16)),bt(Math.round(r).toString(16))];return i.join("")}H.equals=function(e,n){return!e||!n?!1:H(e).toRgbString()==H(n).toRgbString()};H.random=function(){return H.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function qT(e,n){n=n===0?0:n||10;var r=H(e).toHsl();return r.s-=n/100,r.s=ia(r.s),H(r)}function JT(e,n){n=n===0?0:n||10;var r=H(e).toHsl();return r.s+=n/100,r.s=ia(r.s),H(r)}function HT(e){return H(e).desaturate(100)}function VT(e,n){n=n===0?0:n||10;var r=H(e).toHsl();return r.l+=n/100,r.l=ia(r.l),H(r)}function WT(e,n){n=n===0?0:n||10;var r=H(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(n/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(n/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(n/100)))),H(r)}function GT(e,n){n=n===0?0:n||10;var r=H(e).toHsl();return r.l-=n/100,r.l=ia(r.l),H(r)}function BT(e,n){var r=H(e).toHsl(),o=(r.h+n)%360;return r.h=o<0?360+o:o,H(r)}function XT(e){var n=H(e).toHsl();return n.h=(n.h+180)%360,H(n)}function mf(e,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var r=H(e).toHsl(),o=[H(e)],i=360/n,a=1;a<n;a++)o.push(H({h:(r.h+a*i)%360,s:r.s,l:r.l}));return o}function KT(e){var n=H(e).toHsl(),r=n.h;return[H(e),H({h:(r+72)%360,s:n.s,l:n.l}),H({h:(r+216)%360,s:n.s,l:n.l})]}function YT(e,n,r){n=n||6,r=r||30;var o=H(e).toHsl(),i=360/r,a=[H(e)];for(o.h=(o.h-(i*n>>1)+720)%360;--n;)o.h=(o.h+i)%360,a.push(H(o));return a}function QT(e,n){n=n||6;for(var r=H(e).toHsv(),o=r.h,i=r.s,a=r.v,s=[],u=1/n;n--;)s.push(H({h:o,s:i,v:a})),a=(a+u)%1;return s}H.mix=function(e,n,r){r=r===0?0:r||50;var o=H(e).toRgb(),i=H(n).toRgb(),a=r/100,s={r:(i.r-o.r)*a+o.r,g:(i.g-o.g)*a+o.g,b:(i.b-o.b)*a+o.b,a:(i.a-o.a)*a+o.a};return H(s)};H.readability=function(e,n){var r=H(e),o=H(n);return(Math.max(r.getLuminance(),o.getLuminance())+.05)/(Math.min(r.getLuminance(),o.getLuminance())+.05)};H.isReadable=function(e,n,r){var o=H.readability(e,n),i,a;switch(a=!1,i=oE(r),i.level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7;break}return a};H.mostReadable=function(e,n,r){var o=null,i=0,a,s,u,l;r=r||{},s=r.includeFallbackColors,u=r.level,l=r.size;for(var c=0;c<n.length;c++)a=H.readability(e,n[c]),a>i&&(i=a,o=H(n[c]));return H.isReadable(e,o,{level:u,size:l})||!s?o:(r.includeFallbackColors=!1,H.mostReadable(e,["#fff","#000"],r))};var La=H.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},eE=H.hexNames=tE(La);function tE(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function oy(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function _e(e,n){nE(e)&&(e="100%");var r=rE(e);return e=Math.min(n,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),Math.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function ia(e){return Math.min(1,Math.max(0,e))}function Ge(e){return parseInt(e,16)}function nE(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function rE(e){return typeof e=="string"&&e.indexOf("%")!=-1}function bt(e){return e.length==1?"0"+e:""+e}function or(e){return e<=1&&(e=e*100+"%"),e}function ay(e){return Math.round(parseFloat(e)*255).toString(16)}function gf(e){return Ge(e)/255}var mt=(function(){var e="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",r="(?:"+n+")|(?:"+e+")",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+o),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+o),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+o),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function Nt(e){return!!mt.CSS_UNIT.exec(e)}function iE(e){e=e.replace(ZT,"").replace(CT,"").toLowerCase();var n=!1;if(La[e])e=La[e],n=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=mt.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=mt.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=mt.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=mt.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=mt.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=mt.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=mt.hex8.exec(e))?{r:Ge(r[1]),g:Ge(r[2]),b:Ge(r[3]),a:gf(r[4]),format:n?"name":"hex8"}:(r=mt.hex6.exec(e))?{r:Ge(r[1]),g:Ge(r[2]),b:Ge(r[3]),format:n?"name":"hex"}:(r=mt.hex4.exec(e))?{r:Ge(r[1]+""+r[1]),g:Ge(r[2]+""+r[2]),b:Ge(r[3]+""+r[3]),a:gf(r[4]+""+r[4]),format:n?"name":"hex8"}:(r=mt.hex3.exec(e))?{r:Ge(r[1]+""+r[1]),g:Ge(r[2]+""+r[2]),b:Ge(r[3]+""+r[3]),format:n?"name":"hex"}:!1}function oE(e){var n,r;return e=e||{level:"AA",size:"small"},n=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:n,size:r}}function Fa(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,o=Array(n);r<n;r++)o[r]=e[r];return o}function aE(e){if(Array.isArray(e))return Fa(e)}function sy(e,n,r){if(typeof e=="function"?e===n:e.has(n))return arguments.length<3?n:r;throw new TypeError("Private element is not present on this object")}function sE(e,n){if(n.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function uE(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function tt(e,n){return e.get(sy(e,n))}function vf(e,n,r){sE(e,n),n.set(e,r)}function _f(e,n,r){return e.set(sy(e,n),r),r}function lE(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,mE(o.key),o)}}function cE(e,n,r){return n&&lE(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dE(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
125
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hE(e){return aE(e)||fE(e)||gE(e)||dE()}function pE(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function mE(e){var n=pE(e,"string");return typeof n=="symbol"?n:n+""}function gE(e,n){if(e){if(typeof e=="string")return Fa(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Fa(e,n):void 0}}var vE=123,_E=function(n){return"#".concat(Math.min(n,Math.pow(2,24)).toString(16).padStart(6,"0"))},uy=function(n,r,o){return(n<<16)+(r<<8)+o},yE=function(n){var r=H(n).toRgb(),o=r.r,i=r.g,a=r.b;return uy(o,i,a)},yf=function(n,r){return n*vE%Math.pow(2,r)},nn=new WeakMap,Ut=new WeakMap,bE=(function(){function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6;uE(this,e),vf(this,nn,void 0),vf(this,Ut,void 0),_f(Ut,this,n),this.reset()}return cE(e,[{key:"reset",value:function(){_f(nn,this,["__reserved for background__"])}},{key:"register",value:function(r){if(tt(nn,this).length>=Math.pow(2,24-tt(Ut,this)))return null;var o=tt(nn,this).length,i=yf(o,tt(Ut,this)),a=_E(o+(i<<24-tt(Ut,this)));return tt(nn,this).push(r),a}},{key:"lookup",value:function(r){if(!r)return null;var o=typeof r=="string"?yE(r):uy.apply(void 0,hE(r));if(!o)return null;var i=o&Math.pow(2,24-tt(Ut,this))-1,a=o>>24-tt(Ut,this)&Math.pow(2,tt(Ut,this))-1;return yf(i,tt(Ut,this))!==a||i>=tt(nn,this).length?null:tt(nn,this)[i]}}])})(),oi,ye,ly,cy,on,bf,fy,dy,hy,Zl,qa,Ja,kr={},py=[],$E=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,oa=Array.isArray;function St(e,n){for(var r in n)e[r]=n[r];return e}function Cl(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function wE(e,n,r){var o,i,a,s={};for(a in n)a=="key"?o=n[a]:a=="ref"?i=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?oi.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)s[a]===void 0&&(s[a]=e.defaultProps[a]);return sr(e,s,o,i,null)}function sr(e,n,r,o,i){var a={type:e,props:n,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++ly,__i:-1,__u:0};return i==null&&ye.vnode!=null&&ye.vnode(a),a}function aa(e){return e.children}function zi(e,n){this.props=e,this.context=n}function Mn(e,n){if(n==null)return e.__?Mn(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Mn(e):null}function my(e){var n,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,n=0;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return my(e)}}function $f(e){(!e.__d&&(e.__d=!0)&&on.push(e)&&!Ki.__r++||bf!=ye.debounceRendering)&&((bf=ye.debounceRendering)||fy)(Ki)}function Ki(){for(var e,n,r,o,i,a,s,u=1;on.length;)on.length>u&&on.sort(dy),e=on.shift(),u=on.length,e.__d&&(r=void 0,o=void 0,i=(o=(n=e).__v).__e,a=[],s=[],n.__P&&((r=St({},o)).__v=o.__v+1,ye.vnode&&ye.vnode(r),Dl(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[i]:null,a,i??Mn(o),!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,_y(a,r,s),o.__e=o.__=null,r.__e!=i&&my(r)));Ki.__r=0}function gy(e,n,r,o,i,a,s,u,l,c,d){var f,h,p,m,v,y,g,w=o&&o.__k||py,z=n.length;for(l=kE(r,n,w,l,z),f=0;f<z;f++)(p=r.__k[f])!=null&&(h=p.__i==-1?kr:w[p.__i]||kr,p.__i=f,y=Dl(e,p,h,i,a,s,u,l,c,d),m=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Rl(h.ref,null,p),d.push(p.ref,p.__c||m,p)),v==null&&m!=null&&(v=m),(g=!!(4&p.__u))||h.__k===p.__k?l=vy(p,l,e,g):typeof p.type=="function"&&y!==void 0?l=y:m&&(l=m.nextSibling),p.__u&=-7);return r.__e=v,l}function kE(e,n,r,o,i){var a,s,u,l,c,d=r.length,f=d,h=0;for(e.__k=new Array(i),a=0;a<i;a++)(s=n[a])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[a]=sr(null,s,null,null,null):oa(s)?s=e.__k[a]=sr(aa,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[a]=sr(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[a]=s,l=a+h,s.__=e,s.__b=e.__b+1,u=null,(c=s.__i=xE(s,r,l,f))!=-1&&(f--,(u=r[c])&&(u.__u|=2)),u==null||u.__v==null?(c==-1&&(i>d?h--:i<d&&h++),typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,s.__u|=4))):e.__k[a]=null;if(f)for(a=0;a<d;a++)(u=r[a])!=null&&(2&u.__u)==0&&(u.__e==o&&(o=Mn(u)),by(u,u));return o}function vy(e,n,r,o){var i,a;if(typeof e.type=="function"){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,n=vy(i[a],n,r,o));return n}e.__e!=n&&(o&&(n&&e.type&&!n.parentNode&&(n=Mn(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function xE(e,n,r,o){var i,a,s,u=e.key,l=e.type,c=n[r],d=c!=null&&(2&c.__u)==0;if(c===null&&u==null||d&&u==c.key&&l==c.type)return r;if(o>(d?1:0)){for(i=r-1,a=r+1;i>=0||a<n.length;)if((c=n[s=i>=0?i--:a++])!=null&&(2&c.__u)==0&&u==c.key&&l==c.type)return s}return-1}function wf(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||$E.test(n)?r:r+"px"}function bi(e,n,r,o,i){var a,s;e:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(n in o)r&&n in r||wf(e.style,n,"");if(r)for(n in r)o&&r[n]==o[n]||wf(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")a=n!=(n=n.replace(hy,"$1")),s=n.toLowerCase(),n=s in e||n=="onFocusOut"||n=="onFocusIn"?s.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+a]=r,r?o?r.u=o.u:(r.u=Zl,e.addEventListener(n,a?Ja:qa,a)):e.removeEventListener(n,a?Ja:qa,a);else{if(i=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function kf(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=Zl++;else if(n.t<r.u)return;return r(ye.event?ye.event(n):n)}}}function Dl(e,n,r,o,i,a,s,u,l,c){var d,f,h,p,m,v,y,g,w,z,$,b,k,x,O,Z,A,D=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),a=[u=n.__e=r.__e]),(d=ye.__b)&&d(n);e:if(typeof D=="function")try{if(g=n.props,w="prototype"in D&&D.prototype.render,z=(d=D.contextType)&&o[d.__c],$=d?z?z.props.value:d.__:o,r.__c?y=(f=n.__c=r.__c).__=f.__E:(w?n.__c=f=new D(g,$):(n.__c=f=new zi(g,$),f.constructor=D,f.render=IE),z&&z.sub(f),f.state||(f.state={}),f.__n=o,h=f.__d=!0,f.__h=[],f._sb=[]),w&&f.__s==null&&(f.__s=f.state),w&&D.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=St({},f.__s)),St(f.__s,D.getDerivedStateFromProps(g,f.__s))),p=f.props,m=f.state,f.__v=n,h)w&&D.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),w&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(w&&D.getDerivedStateFromProps==null&&g!==p&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(g,$),n.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(g,f.__s,$)===!1){for(n.__v!=r.__v&&(f.props=g,f.state=f.__s,f.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(R){R&&(R.__=n)}),b=0;b<f._sb.length;b++)f.__h.push(f._sb[b]);f._sb=[],f.__h.length&&s.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(g,f.__s,$),w&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(p,m,v)})}if(f.context=$,f.props=g,f.__P=e,f.__e=!1,k=ye.__r,x=0,w){for(f.state=f.__s,f.__d=!1,k&&k(n),d=f.render(f.props,f.state,f.context),O=0;O<f._sb.length;O++)f.__h.push(f._sb[O]);f._sb=[]}else do f.__d=!1,k&&k(n),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++x<25);f.state=f.__s,f.getChildContext!=null&&(o=St(St({},o),f.getChildContext())),w&&!h&&f.getSnapshotBeforeUpdate!=null&&(v=f.getSnapshotBeforeUpdate(p,m)),Z=d,d!=null&&d.type===aa&&d.key==null&&(Z=yy(d.props.children)),u=gy(e,oa(Z)?Z:[Z],n,r,o,i,a,s,u,l,c),f.base=n.__e,n.__u&=-161,f.__h.length&&s.push(f),y&&(f.__E=f.__=null)}catch(R){if(n.__v=null,l||a!=null)if(R.then){for(n.__u|=l?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;a[a.indexOf(u)]=null,n.__e=u}else{for(A=a.length;A--;)Cl(a[A]);Ha(n)}else n.__e=r.__e,n.__k=r.__k,R.then||Ha(n);ye.__e(R,n,r)}else a==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):u=n.__e=SE(r.__e,n,r,o,i,a,s,l,c);return(d=ye.diffed)&&d(n),128&n.__u?void 0:u}function Ha(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Ha)}function _y(e,n,r){for(var o=0;o<r.length;o++)Rl(r[o],r[++o],r[++o]);ye.__c&&ye.__c(n,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(a){a.call(i)})}catch(a){ye.__e(a,i.__v)}})}function yy(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:oa(e)?e.map(yy):St({},e)}function SE(e,n,r,o,i,a,s,u,l){var c,d,f,h,p,m,v,y=r.props||kr,g=n.props,w=n.type;if(w=="svg"?i="http://www.w3.org/2000/svg":w=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),a!=null){for(c=0;c<a.length;c++)if((p=a[c])&&"setAttribute"in p==!!w&&(w?p.localName==w:p.nodeType==3)){e=p,a[c]=null;break}}if(e==null){if(w==null)return document.createTextNode(g);e=document.createElementNS(i,w,g.is&&g),u&&(ye.__m&&ye.__m(n,a),u=!1),a=null}if(w==null)y===g||u&&e.data==g||(e.data=g);else{if(a=a&&oi.call(e.childNodes),!u&&a!=null)for(y={},c=0;c<e.attributes.length;c++)y[(p=e.attributes[c]).name]=p.value;for(c in y)if(p=y[c],c!="children"){if(c=="dangerouslySetInnerHTML")f=p;else if(!(c in g)){if(c=="value"&&"defaultValue"in g||c=="checked"&&"defaultChecked"in g)continue;bi(e,c,null,p,i)}}for(c in g)p=g[c],c=="children"?h=p:c=="dangerouslySetInnerHTML"?d=p:c=="value"?m=p:c=="checked"?v=p:u&&typeof p!="function"||y[c]===p||bi(e,c,p,y[c],i);if(d)u||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),n.__k=[];else if(f&&(e.innerHTML=""),gy(n.type=="template"?e.content:e,oa(h)?h:[h],n,r,o,w=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:r.__k&&Mn(r,0),u,l),a!=null)for(c=a.length;c--;)Cl(a[c]);u||(c="value",w=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[c]||w=="progress"&&!m||w=="option"&&m!=y[c])&&bi(e,c,m,y[c],i),c="checked",v!=null&&v!=e[c]&&bi(e,c,v,y[c],i))}return e}function Rl(e,n,r){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&n==null||(e.__u=e(n))}else e.current=n}catch(i){ye.__e(i,r)}}function by(e,n,r){var o,i;if(ye.unmount&&ye.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Rl(o,null,n)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){ye.__e(a,n)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&by(o[i],n,r||typeof e.type!="function");r||Cl(e.__e),e.__c=e.__=e.__e=void 0}function IE(e,n,r){return this.constructor(e,r)}function zE(e,n,r){var o,i,a,s;n==document&&(n=document.documentElement),ye.__&&ye.__(e,n),i=(o=!1)?null:n.__k,a=[],s=[],Dl(n,e=n.__k=wE(aa,null,[e]),i||kr,kr,n.namespaceURI,i?null:n.firstChild?oi.call(n.childNodes):null,a,i?i.__e:n.firstChild,o,s),_y(a,e,s)}function $y(e,n,r){var o,i,a,s,u=St({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),n)a=="key"?o=n[a]:a=="ref"?i=n[a]:u[a]=n[a]===void 0&&s!=null?s[a]:n[a];return arguments.length>2&&(u.children=arguments.length>3?oi.call(arguments,2):r),sr(e.type,u,o||e.key,i||e.ref,null)}oi=py.slice,ye={__e:function(e,n,r,o){for(var i,a,s;n=n.__;)if((i=n.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,o||{}),s=i.__d),s)return i.__E=i}catch(u){e=u}throw e}},ly=0,cy=function(e){return e!=null&&e.constructor===void 0},zi.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=St({},this.state),typeof e=="function"&&(e=e(St({},r),this.props)),e&&St(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),$f(this))},zi.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$f(this))},zi.prototype.render=aa,on=[],fy=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,dy=function(e,n){return e.__v.__b-n.__v.__b},Ki.__r=0,hy=/(PointerCapture)$|Capture$/i,Zl=0,qa=kf(!1),Ja=kf(!0);function xf(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,o=Array(n);r<n;r++)o[r]=e[r];return o}function OE(e){if(Array.isArray(e))return e}function PE(e,n,r){return(n=jE(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function TE(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o,i,a,s,u=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(l=(o=a.call(r)).done)&&(u.push(o.value),u.length!==n);l=!0);}catch(d){c=!0,i=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return u}}function EE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
126
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sf(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,o)}return r}function NE(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Sf(Object(r),!0).forEach(function(o){PE(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sf(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function UE(e,n){return OE(e)||TE(e,n)||ZE(e,n)||EE()}function AE(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function jE(e){var n=AE(e,"string");return typeof n=="symbol"?n:n+""}function Yi(e){"@babel/helpers - typeof";return Yi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Yi(e)}function ZE(e,n){if(e){if(typeof e=="string")return xf(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xf(e,n):void 0}}var Va=function(n){if(Yi(n)!=="object")return n;var r=$y(n);if(r.props){var o;r.props=NE({},r.props),r!=null&&(o=r.props)!==null&&o!==void 0&&o.children&&(r.props.children=Array.isArray(r.props.children)?r.props.children.map(Va):Va(r.props.children))}return r},CE=function(n){return cy($y(n))},DE=function(n,r){delete r.__k,zE(Va(n),r)};function RE(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>"u")){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",r==="top"&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var ME=`.float-tooltip-kap {
83
+ - "app": Tool callable by the app from this server only`)});E({mimeTypes:B(T()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});E({method:S("ui/download-file"),params:E({contents:B(G([Ia,Ma])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});E({method:S("ui/message"),params:E({role:S("user").describe('Message role, currently only "user" is supported.'),content:B(Tn).describe("Message content blocks (text, image, etc.).")})});E({method:S("ui/notifications/sandbox-resource-ready"),params:E({html:T().describe("HTML content to load into the inner iframe."),sandbox:T().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:Zi.optional().describe("CSP configuration from resource metadata."),permissions:qi.optional().describe("Sandbox permissions from resource metadata.")})});var Kg=E({method:S("ui/notifications/tool-result"),params:br.describe("Standard MCP tool execution result.")}),ja=E({toolInfo:E({id:bn.optional().describe("JSON-RPC id of the tools/call request."),tool:ji.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:Og.optional().describe("Current color theme preference."),styles:Vg.optional().describe("Style configuration for theming the app."),displayMode:fn.optional().describe("How the UI is currently displayed."),availableDisplayModes:B(fn).optional().describe("Display modes the host supports."),containerDimensions:G([E({height:J().describe("Fixed container height in pixels.")}),E({maxHeight:G([J(),Fr()]).optional().describe("Maximum container height in pixels.")})]).and(G([E({width:J().describe("Fixed container width in pixels.")}),E({maxWidth:G([J(),Fr()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
84
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:T().optional().describe("User's language and region preference in BCP 47 format."),timeZone:T().optional().describe("User's timezone in IANA format."),userAgent:T().optional().describe("Host application identifier."),platform:G([S("web"),S("desktop"),S("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:E({touch:oe().optional().describe("Whether the device supports touch input."),hover:oe().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:E({top:J().describe("Top safe area inset in pixels."),right:J().describe("Right safe area inset in pixels."),bottom:J().describe("Bottom safe area inset in pixels."),left:J().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Yg=E({method:S("ui/notifications/host-context-changed"),params:ja.describe("Partial context update containing only changed fields.")});E({method:S("ui/update-model-context"),params:E({content:B(Tn).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:ne(T(),ie().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});E({method:S("ui/initialize"),params:E({appInfo:yr.describe("App identification (name and version)."),appCapabilities:Jg.describe("Features and capabilities this app provides."),protocolVersion:T().describe("Protocol version this app supports.")})});var Qg=E({protocolVersion:T().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:yr.describe("Host application identification and version."),hostCapabilities:Wg.describe("Features and capabilities provided by the host."),hostContext:ja.describe("Rich context about the host environment.")}).passthrough();class em extends Rg{constructor(r,i={},o={autoResize:!0}){super(o);be(this,"_appInfo");be(this,"_capabilities");be(this,"options");be(this,"_hostCapabilities");be(this,"_hostInfo");be(this,"_hostContext");be(this,"sendOpenLink",this.openLink);this._appInfo=r,this._capabilities=i,this.options=o,this.setRequestHandler(vr,s=>(console.log("Received ping:",s.params),{})),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput(r){this.setNotificationHandler(Ug,i=>r(i.params))}set ontoolinputpartial(r){this.setNotificationHandler(Lg,i=>r(i.params))}set ontoolresult(r){this.setNotificationHandler(Kg,i=>r(i.params))}set ontoolcancelled(r){this.setNotificationHandler(Fg,i=>r(i.params))}set onhostcontextchanged(r){this.setNotificationHandler(Yg,i=>{this._hostContext={...this._hostContext,...i.params},r(i.params)})}set onteardown(r){this.setRequestHandler(Bg,(i,o)=>r(i.params,o))}set oncalltool(r){this.setRequestHandler(Na,(i,o)=>r(i.params,o))}set onlisttools(r){this.setRequestHandler(Oa,(i,o)=>r(i.params,o))}assertCapabilityForMethod(r){}assertRequestHandlerCapability(r){switch(r){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${r})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${r} registered`)}}assertNotificationCapability(r){}assertTaskCapability(r){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(r){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(r,i){if(typeof r=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${r}"). Did you mean: callServerTool({ name: "${r}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:r},br,i)}async readServerResource(r,i){return await this.request({method:"resources/read",params:r},$a,i)}async listServerResources(r,i){return await this.request({method:"resources/list",params:r},Ra,i)}sendMessage(r,i){return this.request({method:"ui/message",params:r},qg,i)}sendLog(r){return this.notification({method:"notifications/message",params:r})}updateModelContext(r,i){return this.request({method:"ui/update-model-context",params:r},ki,i)}openLink(r,i){return this.request({method:"ui/open-link",params:r},jg,i)}downloadFile(r,i){return this.request({method:"ui/download-file",params:r},Zg,i)}requestDisplayMode(r,i){return this.request({method:"ui/request-display-mode",params:r},Gg,i)}sendSizeChanged(r){return this.notification({method:"ui/notifications/size-changed",params:r})}setupSizeChangedNotifications(){let r=!1,i=0,o=0,s=()=>{r||(r=!0,requestAnimationFrame(()=>{r=!1;let u=document.documentElement,c=u.style.width,l=u.style.height;u.style.width="fit-content",u.style.height="max-content";let h=u.getBoundingClientRect();u.style.width=c,u.style.height=l;let f=window.innerWidth-u.clientWidth,d=Math.ceil(h.width+f),p=Math.ceil(h.height);(d!==i||p!==o)&&(i=d,o=p,this.sendSizeChanged({width:d,height:p}))}))};s();let a=new ResizeObserver(s);return a.observe(document.documentElement),a.observe(document.body),()=>a.disconnect()}async connect(r=new Mg(window.parent,window.parent),i){var o;if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(r);try{let s=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:$g}},Qg,i);if(s===void 0)throw Error(`Server sent invalid initialize result: ${s}`);this._hostCapabilities=s.hostCapabilities,this._hostInfo=s.hostInfo,this._hostContext=s.hostContext,await this.notification({method:"ui/notifications/initialized"}),(o=this.options)!=null&&o.autoResize&&this.setupSizeChangedNotifications()}catch(s){throw this.close(),s}}}function Za(e,n,r){var i,o=1;e==null&&(e=0),n==null&&(n=0),r==null&&(r=0);function s(){var a,u=i.length,c,l=0,h=0,f=0;for(a=0;a<u;++a)c=i[a],l+=c.x||0,h+=c.y||0,f+=c.z||0;for(l=(l/u-e)*o,h=(h/u-n)*o,f=(f/u-r)*o,a=0;a<u;++a)c=i[a],l&&(c.x-=l),h&&(c.y-=h),f&&(c.z-=f)}return s.initialize=function(a){i=a},s.x=function(a){return arguments.length?(e=+a,s):e},s.y=function(a){return arguments.length?(n=+a,s):n},s.z=function(a){return arguments.length?(r=+a,s):r},s.strength=function(a){return arguments.length?(o=+a,s):o},s}function tm(e){const n=+this._x.call(null,e);return qa(this.cover(n),n,e)}function qa(e,n,r){if(isNaN(n))return e;var i,o=e._root,s={data:r},a=e._x0,u=e._x1,c,l,h,f,d;if(!o)return e._root=s,e;for(;o.length;)if((h=n>=(c=(a+u)/2))?a=c:u=c,i=o,!(o=o[f=+h]))return i[f]=s,e;if(l=+e._x.call(null,o.data),n===l)return s.next=o,i?i[f]=s:e._root=s,e;do i=i?i[f]=new Array(2):e._root=new Array(2),(h=n>=(c=(a+u)/2))?a=c:u=c;while((f=+h)==(d=+(l>=c)));return i[d]=o,i[f]=s,e}function nm(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n);let i=1/0,o=-1/0;for(let s=0,a;s<n;++s)isNaN(a=+this._x.call(null,e[s]))||(r[s]=a,a<i&&(i=a),a>o&&(o=a));if(i>o)return this;this.cover(i).cover(o);for(let s=0;s<n;++s)qa(this,r[s],e[s]);return this}function rm(e){if(isNaN(e=+e))return this;var n=this._x0,r=this._x1;if(isNaN(n))r=(n=Math.floor(e))+1;else{for(var i=r-n||1,o=this._root,s,a;n>e||e>=r;)switch(a=+(e<n),s=new Array(2),s[a]=o,o=s,i*=2,a){case 0:r=n+i;break;case 1:n=r-i;break}this._root&&this._root.length&&(this._root=o)}return this._x0=n,this._x1=r,this}function im(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function om(e){return arguments.length?this.cover(+e[0][0]).cover(+e[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function ct(e,n,r){this.node=e,this.x0=n,this.x1=r}function sm(e,n){var r,i=this._x0,o,s,a=this._x1,u=[],c=this._root,l,h;for(c&&u.push(new ct(c,i,a)),n==null?n=1/0:(i=e-n,a=e+n);l=u.pop();)if(!(!(c=l.node)||(o=l.x0)>a||(s=l.x1)<i))if(c.length){var f=(o+s)/2;u.push(new ct(c[1],f,s),new ct(c[0],o,f)),(h=+(e>=f))&&(l=u[u.length-1],u[u.length-1]=u[u.length-1-h],u[u.length-1-h]=l)}else{var d=Math.abs(e-+this._x.call(null,c.data));d<n&&(n=d,i=e-d,a=e+d,r=c.data)}return r}function am(e){if(isNaN(c=+this._x.call(null,e)))return this;var n,r=this._root,i,o,s,a=this._x0,u=this._x1,c,l,h,f,d;if(!r)return this;if(r.length)for(;;){if((h=c>=(l=(a+u)/2))?a=l:u=l,n=r,!(r=r[f=+h]))return this;if(!r.length)break;n[f+1&1]&&(i=n,d=f)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(s=r.next)&&delete r.next,o?(s?o.next=s:delete o.next,this):n?(s?n[f]=s:delete n[f],(r=n[0]||n[1])&&r===(n[1]||n[0])&&!r.length&&(i?i[d]=r:this._root=r),this):(this._root=s,this)}function um(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function cm(){return this._root}function lm(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function fm(e){var n=[],r,i=this._root,o,s,a;for(i&&n.push(new ct(i,this._x0,this._x1));r=n.pop();)if(!e(i=r.node,s=r.x0,a=r.x1)&&i.length){var u=(s+a)/2;(o=i[1])&&n.push(new ct(o,u,a)),(o=i[0])&&n.push(new ct(o,s,u))}return this}function hm(e){var n=[],r=[],i;for(this._root&&n.push(new ct(this._root,this._x0,this._x1));i=n.pop();){var o=i.node;if(o.length){var s,a=i.x0,u=i.x1,c=(a+u)/2;(s=o[0])&&n.push(new ct(s,a,c)),(s=o[1])&&n.push(new ct(s,c,u))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.x1);return this}function dm(e){return e[0]}function pm(e){return arguments.length?(this._x=e,this):this._x}function Ui(e,n){var r=new Li(n??dm,NaN,NaN);return e==null?r:r.addAll(e)}function Li(e,n,r){this._x=e,this._x0=n,this._x1=r,this._root=void 0}function $o(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var Pe=Ui.prototype=Li.prototype;Pe.copy=function(){var e=new Li(this._x,this._x0,this._x1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=$o(n),e;for(r=[{source:n,target:e._root=new Array(2)}];n=r.pop();)for(var o=0;o<2;++o)(i=n.source[o])&&(i.length?r.push({source:i,target:n.target[o]=new Array(2)}):n.target[o]=$o(i));return e};Pe.add=tm;Pe.addAll=nm;Pe.cover=rm;Pe.data=im;Pe.extent=om;Pe.find=sm;Pe.remove=am;Pe.removeAll=um;Pe.root=cm;Pe.size=lm;Pe.visit=fm;Pe.visitAfter=hm;Pe.x=pm;function gm(e){const n=+this._x.call(null,e),r=+this._y.call(null,e);return Ua(this.cover(n,r),n,r,e)}function Ua(e,n,r,i){if(isNaN(n)||isNaN(r))return e;var o,s=e._root,a={data:i},u=e._x0,c=e._y0,l=e._x1,h=e._y1,f,d,p,g,_,y,m,w;if(!s)return e._root=a,e;for(;s.length;)if((_=n>=(f=(u+l)/2))?u=f:l=f,(y=r>=(d=(c+h)/2))?c=d:h=d,o=s,!(s=s[m=y<<1|_]))return o[m]=a,e;if(p=+e._x.call(null,s.data),g=+e._y.call(null,s.data),n===p&&r===g)return a.next=s,o?o[m]=a:e._root=a,e;do o=o?o[m]=new Array(4):e._root=new Array(4),(_=n>=(f=(u+l)/2))?u=f:l=f,(y=r>=(d=(c+h)/2))?c=d:h=d;while((m=y<<1|_)===(w=(g>=d)<<1|p>=f));return o[w]=s,o[m]=a,e}function mm(e){var n,r,i=e.length,o,s,a=new Array(i),u=new Array(i),c=1/0,l=1/0,h=-1/0,f=-1/0;for(r=0;r<i;++r)isNaN(o=+this._x.call(null,n=e[r]))||isNaN(s=+this._y.call(null,n))||(a[r]=o,u[r]=s,o<c&&(c=o),o>h&&(h=o),s<l&&(l=s),s>f&&(f=s));if(c>h||l>f)return this;for(this.cover(c,l).cover(h,f),r=0;r<i;++r)Ua(this,a[r],u[r],e[r]);return this}function _m(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,o=this._x1,s=this._y1;if(isNaN(r))o=(r=Math.floor(e))+1,s=(i=Math.floor(n))+1;else{for(var a=o-r||1,u=this._root,c,l;r>e||e>=o||i>n||n>=s;)switch(l=(n<i)<<1|e<r,c=new Array(4),c[l]=u,u=c,a*=2,l){case 0:o=r+a,s=i+a;break;case 1:r=o-a,s=i+a;break;case 2:o=r+a,i=s-a;break;case 3:r=o-a,i=s-a;break}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=i,this._x1=o,this._y1=s,this}function ym(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function vm(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function ke(e,n,r,i,o){this.node=e,this.x0=n,this.y0=r,this.x1=i,this.y1=o}function bm(e,n,r){var i,o=this._x0,s=this._y0,a,u,c,l,h=this._x1,f=this._y1,d=[],p=this._root,g,_;for(p&&d.push(new ke(p,o,s,h,f)),r==null?r=1/0:(o=e-r,s=n-r,h=e+r,f=n+r,r*=r);g=d.pop();)if(!(!(p=g.node)||(a=g.x0)>h||(u=g.y0)>f||(c=g.x1)<o||(l=g.y1)<s))if(p.length){var y=(a+c)/2,m=(u+l)/2;d.push(new ke(p[3],y,m,c,l),new ke(p[2],a,m,y,l),new ke(p[1],y,u,c,m),new ke(p[0],a,u,y,m)),(_=(n>=m)<<1|e>=y)&&(g=d[d.length-1],d[d.length-1]=d[d.length-1-_],d[d.length-1-_]=g)}else{var w=e-+this._x.call(null,p.data),C=n-+this._y.call(null,p.data),b=w*w+C*C;if(b<r){var v=Math.sqrt(r=b);o=e-v,s=n-v,h=e+v,f=n+v,i=p.data}}return i}function wm(e){if(isNaN(h=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var n,r=this._root,i,o,s,a=this._x0,u=this._y0,c=this._x1,l=this._y1,h,f,d,p,g,_,y,m;if(!r)return this;if(r.length)for(;;){if((g=h>=(d=(a+c)/2))?a=d:c=d,(_=f>=(p=(u+l)/2))?u=p:l=p,n=r,!(r=r[y=_<<1|g]))return this;if(!r.length)break;(n[y+1&3]||n[y+2&3]||n[y+3&3])&&(i=n,m=y)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(s=r.next)&&delete r.next,o?(s?o.next=s:delete o.next,this):n?(s?n[y]=s:delete n[y],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[m]=r:this._root=r),this):(this._root=s,this)}function xm(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function km(){return this._root}function Sm(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function zm(e){var n=[],r,i=this._root,o,s,a,u,c;for(i&&n.push(new ke(i,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(i=r.node,s=r.x0,a=r.y0,u=r.x1,c=r.y1)&&i.length){var l=(s+u)/2,h=(a+c)/2;(o=i[3])&&n.push(new ke(o,l,h,u,c)),(o=i[2])&&n.push(new ke(o,s,h,l,c)),(o=i[1])&&n.push(new ke(o,l,a,u,h)),(o=i[0])&&n.push(new ke(o,s,a,l,h))}return this}function Tm(e){var n=[],r=[],i;for(this._root&&n.push(new ke(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var o=i.node;if(o.length){var s,a=i.x0,u=i.y0,c=i.x1,l=i.y1,h=(a+c)/2,f=(u+l)/2;(s=o[0])&&n.push(new ke(s,a,u,h,f)),(s=o[1])&&n.push(new ke(s,h,u,c,f)),(s=o[2])&&n.push(new ke(s,a,f,h,l)),(s=o[3])&&n.push(new ke(s,h,f,c,l))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function Cm(e){return e[0]}function Pm(e){return arguments.length?(this._x=e,this):this._x}function Em(e){return e[1]}function Am(e){return arguments.length?(this._y=e,this):this._y}function Fi(e,n,r){var i=new Hi(n??Cm,r??Em,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Hi(e,n,r,i,o,s){this._x=e,this._y=n,this._x0=r,this._y0=i,this._x1=o,this._y1=s,this._root=void 0}function Io(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var Se=Fi.prototype=Hi.prototype;Se.copy=function(){var e=new Hi(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=Io(n),e;for(r=[{source:n,target:e._root=new Array(4)}];n=r.pop();)for(var o=0;o<4;++o)(i=n.source[o])&&(i.length?r.push({source:i,target:n.target[o]=new Array(4)}):n.target[o]=Io(i));return e};Se.add=gm;Se.addAll=mm;Se.cover=_m;Se.data=ym;Se.extent=vm;Se.find=bm;Se.remove=wm;Se.removeAll=xm;Se.root=km;Se.size=Sm;Se.visit=zm;Se.visitAfter=Tm;Se.x=Pm;Se.y=Am;function Rm(e){const n=+this._x.call(null,e),r=+this._y.call(null,e),i=+this._z.call(null,e);return La(this.cover(n,r,i),n,r,i,e)}function La(e,n,r,i,o){if(isNaN(n)||isNaN(r)||isNaN(i))return e;var s,a=e._root,u={data:o},c=e._x0,l=e._y0,h=e._z0,f=e._x1,d=e._y1,p=e._z1,g,_,y,m,w,C,b,v,k,x,P;if(!a)return e._root=u,e;for(;a.length;)if((b=n>=(g=(c+f)/2))?c=g:f=g,(v=r>=(_=(l+d)/2))?l=_:d=_,(k=i>=(y=(h+p)/2))?h=y:p=y,s=a,!(a=a[x=k<<2|v<<1|b]))return s[x]=u,e;if(m=+e._x.call(null,a.data),w=+e._y.call(null,a.data),C=+e._z.call(null,a.data),n===m&&r===w&&i===C)return u.next=a,s?s[x]=u:e._root=u,e;do s=s?s[x]=new Array(8):e._root=new Array(8),(b=n>=(g=(c+f)/2))?c=g:f=g,(v=r>=(_=(l+d)/2))?l=_:d=_,(k=i>=(y=(h+p)/2))?h=y:p=y;while((x=k<<2|v<<1|b)===(P=(C>=y)<<2|(w>=_)<<1|m>=g));return s[P]=a,s[x]=u,e}function $m(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n),i=new Float64Array(n),o=new Float64Array(n);let s=1/0,a=1/0,u=1/0,c=-1/0,l=-1/0,h=-1/0;for(let f=0,d,p,g,_;f<n;++f)isNaN(p=+this._x.call(null,d=e[f]))||isNaN(g=+this._y.call(null,d))||isNaN(_=+this._z.call(null,d))||(r[f]=p,i[f]=g,o[f]=_,p<s&&(s=p),p>c&&(c=p),g<a&&(a=g),g>l&&(l=g),_<u&&(u=_),_>h&&(h=_));if(s>c||a>l||u>h)return this;this.cover(s,a,u).cover(c,l,h);for(let f=0;f<n;++f)La(this,r[f],i[f],o[f],e[f]);return this}function Im(e,n,r){if(isNaN(e=+e)||isNaN(n=+n)||isNaN(r=+r))return this;var i=this._x0,o=this._y0,s=this._z0,a=this._x1,u=this._y1,c=this._z1;if(isNaN(i))a=(i=Math.floor(e))+1,u=(o=Math.floor(n))+1,c=(s=Math.floor(r))+1;else{for(var l=a-i||1,h=this._root,f,d;i>e||e>=a||o>n||n>=u||s>r||r>=c;)switch(d=(r<s)<<2|(n<o)<<1|e<i,f=new Array(8),f[d]=h,h=f,l*=2,d){case 0:a=i+l,u=o+l,c=s+l;break;case 1:i=a-l,u=o+l,c=s+l;break;case 2:a=i+l,o=u-l,c=s+l;break;case 3:i=a-l,o=u-l,c=s+l;break;case 4:a=i+l,u=o+l,s=c-l;break;case 5:i=a-l,u=o+l,s=c-l;break;case 6:a=i+l,o=u-l,s=c-l;break;case 7:i=a-l,o=u-l,s=c-l;break}this._root&&this._root.length&&(this._root=h)}return this._x0=i,this._y0=o,this._z0=s,this._x1=a,this._y1=u,this._z1=c,this}function Mm(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function Om(e){return arguments.length?this.cover(+e[0][0],+e[0][1],+e[0][2]).cover(+e[1][0],+e[1][1],+e[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function re(e,n,r,i,o,s,a){this.node=e,this.x0=n,this.y0=r,this.z0=i,this.x1=o,this.y1=s,this.z1=a}function Nm(e,n,r,i){var o,s=this._x0,a=this._y0,u=this._z0,c,l,h,f,d,p,g=this._x1,_=this._y1,y=this._z1,m=[],w=this._root,C,b;for(w&&m.push(new re(w,s,a,u,g,_,y)),i==null?i=1/0:(s=e-i,a=n-i,u=r-i,g=e+i,_=n+i,y=r+i,i*=i);C=m.pop();)if(!(!(w=C.node)||(c=C.x0)>g||(l=C.y0)>_||(h=C.z0)>y||(f=C.x1)<s||(d=C.y1)<a||(p=C.z1)<u))if(w.length){var v=(c+f)/2,k=(l+d)/2,x=(h+p)/2;m.push(new re(w[7],v,k,x,f,d,p),new re(w[6],c,k,x,v,d,p),new re(w[5],v,l,x,f,k,p),new re(w[4],c,l,x,v,k,p),new re(w[3],v,k,h,f,d,x),new re(w[2],c,k,h,v,d,x),new re(w[1],v,l,h,f,k,x),new re(w[0],c,l,h,v,k,x)),(b=(r>=x)<<2|(n>=k)<<1|e>=v)&&(C=m[m.length-1],m[m.length-1]=m[m.length-1-b],m[m.length-1-b]=C)}else{var P=e-+this._x.call(null,w.data),M=n-+this._y.call(null,w.data),$=r-+this._z.call(null,w.data),N=P*P+M*M+$*$;if(N<i){var D=Math.sqrt(i=N);s=e-D,a=n-D,u=r-D,g=e+D,_=n+D,y=r+D,o=w.data}}return o}const Dm=(e,n,r,i,o,s)=>Math.sqrt((e-i)**2+(n-o)**2+(r-s)**2);function jm(e,n,r,i){const o=[],s=e-i,a=n-i,u=r-i,c=e+i,l=n+i,h=r+i;return this.visit((f,d,p,g,_,y,m)=>{if(!f.length)do{const w=f.data;Dm(e,n,r,this._x(w),this._y(w),this._z(w))<=i&&o.push(w)}while(f=f.next);return d>c||p>l||g>h||_<s||y<a||m<u}),o}function Zm(e){if(isNaN(d=+this._x.call(null,e))||isNaN(p=+this._y.call(null,e))||isNaN(g=+this._z.call(null,e)))return this;var n,r=this._root,i,o,s,a=this._x0,u=this._y0,c=this._z0,l=this._x1,h=this._y1,f=this._z1,d,p,g,_,y,m,w,C,b,v,k;if(!r)return this;if(r.length)for(;;){if((w=d>=(_=(a+l)/2))?a=_:l=_,(C=p>=(y=(u+h)/2))?u=y:h=y,(b=g>=(m=(c+f)/2))?c=m:f=m,n=r,!(r=r[v=b<<2|C<<1|w]))return this;if(!r.length)break;(n[v+1&7]||n[v+2&7]||n[v+3&7]||n[v+4&7]||n[v+5&7]||n[v+6&7]||n[v+7&7])&&(i=n,k=v)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(s=r.next)&&delete r.next,o?(s?o.next=s:delete o.next,this):n?(s?n[v]=s:delete n[v],(r=n[0]||n[1]||n[2]||n[3]||n[4]||n[5]||n[6]||n[7])&&r===(n[7]||n[6]||n[5]||n[4]||n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[k]=r:this._root=r),this):(this._root=s,this)}function qm(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function Um(){return this._root}function Lm(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function Fm(e){var n=[],r,i=this._root,o,s,a,u,c,l,h;for(i&&n.push(new re(i,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));r=n.pop();)if(!e(i=r.node,s=r.x0,a=r.y0,u=r.z0,c=r.x1,l=r.y1,h=r.z1)&&i.length){var f=(s+c)/2,d=(a+l)/2,p=(u+h)/2;(o=i[7])&&n.push(new re(o,f,d,p,c,l,h)),(o=i[6])&&n.push(new re(o,s,d,p,f,l,h)),(o=i[5])&&n.push(new re(o,f,a,p,c,d,h)),(o=i[4])&&n.push(new re(o,s,a,p,f,d,h)),(o=i[3])&&n.push(new re(o,f,d,u,c,l,p)),(o=i[2])&&n.push(new re(o,s,d,u,f,l,p)),(o=i[1])&&n.push(new re(o,f,a,u,c,d,p)),(o=i[0])&&n.push(new re(o,s,a,u,f,d,p))}return this}function Hm(e){var n=[],r=[],i;for(this._root&&n.push(new re(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));i=n.pop();){var o=i.node;if(o.length){var s,a=i.x0,u=i.y0,c=i.z0,l=i.x1,h=i.y1,f=i.z1,d=(a+l)/2,p=(u+h)/2,g=(c+f)/2;(s=o[0])&&n.push(new re(s,a,u,c,d,p,g)),(s=o[1])&&n.push(new re(s,d,u,c,l,p,g)),(s=o[2])&&n.push(new re(s,a,p,c,d,h,g)),(s=o[3])&&n.push(new re(s,d,p,c,l,h,g)),(s=o[4])&&n.push(new re(s,a,u,g,d,p,f)),(s=o[5])&&n.push(new re(s,d,u,g,l,p,f)),(s=o[6])&&n.push(new re(s,a,p,g,d,h,f)),(s=o[7])&&n.push(new re(s,d,p,g,l,h,f))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.z0,i.x1,i.y1,i.z1);return this}function Vm(e){return e[0]}function Bm(e){return arguments.length?(this._x=e,this):this._x}function Wm(e){return e[1]}function Jm(e){return arguments.length?(this._y=e,this):this._y}function Gm(e){return e[2]}function Xm(e){return arguments.length?(this._z=e,this):this._z}function Vi(e,n,r,i){var o=new Bi(n??Vm,r??Wm,i??Gm,NaN,NaN,NaN,NaN,NaN,NaN);return e==null?o:o.addAll(e)}function Bi(e,n,r,i,o,s,a,u,c){this._x=e,this._y=n,this._z=r,this._x0=i,this._y0=o,this._z0=s,this._x1=a,this._y1=u,this._z1=c,this._root=void 0}function Mo(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var ve=Vi.prototype=Bi.prototype;ve.copy=function(){var e=new Bi(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=Mo(n),e;for(r=[{source:n,target:e._root=new Array(8)}];n=r.pop();)for(var o=0;o<8;++o)(i=n.source[o])&&(i.length?r.push({source:i,target:n.target[o]=new Array(8)}):n.target[o]=Mo(i));return e};ve.add=Rm;ve.addAll=$m;ve.cover=Im;ve.data=Mm;ve.extent=Om;ve.find=Nm;ve.findAllWithinRadius=jm;ve.remove=Zm;ve.removeAll=qm;ve.root=Um;ve.size=Lm;ve.visit=Fm;ve.visitAfter=Hm;ve.x=Bm;ve.y=Jm;ve.z=Xm;function We(e){return function(){return e}}function Ne(e){return(e()-.5)*1e-6}function Ar(e){return e.x+e.vx}function Oo(e){return e.y+e.vy}function Km(e){return e.z+e.vz}function Ym(e){var n,r,i,o,s=1,a=1;typeof e!="function"&&(e=We(e==null?1:+e));function u(){for(var h,f=n.length,d,p,g,_,y,m,w,C=0;C<a;++C)for(d=(r===1?Ui(n,Ar):r===2?Fi(n,Ar,Oo):r===3?Vi(n,Ar,Oo,Km):null).visitAfter(c),h=0;h<f;++h)p=n[h],m=i[p.index],w=m*m,g=p.x+p.vx,r>1&&(_=p.y+p.vy),r>2&&(y=p.z+p.vz),d.visit(b);function b(v,k,x,P,M,$,N){var D=[k,x,P,M,$,N],H=D[0],z=D[1],O=D[2],R=D[r],j=D[r+1],F=D[r+2],q=v.data,V=v.r,L=m+V;if(q){if(q.index>p.index){var W=g-q.x-q.vx,ee=r>1?_-q.y-q.vy:0,K=r>2?y-q.z-q.vz:0,he=W*W+ee*ee+K*K;he<L*L&&(W===0&&(W=Ne(o),he+=W*W),r>1&&ee===0&&(ee=Ne(o),he+=ee*ee),r>2&&K===0&&(K=Ne(o),he+=K*K),he=(L-(he=Math.sqrt(he)))/he*s,p.vx+=(W*=he)*(L=(V*=V)/(w+V)),r>1&&(p.vy+=(ee*=he)*L),r>2&&(p.vz+=(K*=he)*L),q.vx-=W*(L=1-L),r>1&&(q.vy-=ee*L),r>2&&(q.vz-=K*L))}return}return H>g+L||R<g-L||r>1&&(z>_+L||j<_-L)||r>2&&(O>y+L||F<y-L)}}function c(h){if(h.data)return h.r=i[h.data.index];for(var f=h.r=0;f<Math.pow(2,r);++f)h[f]&&h[f].r>h.r&&(h.r=h[f].r)}function l(){if(n){var h,f=n.length,d;for(i=new Array(f),h=0;h<f;++h)d=n[h],i[d.index]=+e(d,h,n)}}return u.initialize=function(h,...f){n=h,o=f.find(d=>typeof d=="function")||Math.random,r=f.find(d=>[1,2,3].includes(d))||2,l()},u.iterations=function(h){return arguments.length?(a=+h,u):a},u.strength=function(h){return arguments.length?(s=+h,u):s},u.radius=function(h){return arguments.length?(e=typeof h=="function"?h:We(+h),l(),u):e},u}function Qm(e){return e.index}function No(e,n){var r=e.get(n);if(!r)throw new Error("node not found: "+n);return r}function Fa(e){var n=Qm,r=d,i,o=We(30),s,a,u,c,l,h,f=1;e==null&&(e=[]);function d(m){return 1/Math.min(c[m.source.index],c[m.target.index])}function p(m){for(var w=0,C=e.length;w<f;++w)for(var b=0,v,k,x,P=0,M=0,$=0,N,D;b<C;++b)v=e[b],k=v.source,x=v.target,P=x.x+x.vx-k.x-k.vx||Ne(h),u>1&&(M=x.y+x.vy-k.y-k.vy||Ne(h)),u>2&&($=x.z+x.vz-k.z-k.vz||Ne(h)),N=Math.sqrt(P*P+M*M+$*$),N=(N-s[b])/N*m*i[b],P*=N,M*=N,$*=N,x.vx-=P*(D=l[b]),u>1&&(x.vy-=M*D),u>2&&(x.vz-=$*D),k.vx+=P*(D=1-D),u>1&&(k.vy+=M*D),u>2&&(k.vz+=$*D)}function g(){if(a){var m,w=a.length,C=e.length,b=new Map(a.map((k,x)=>[n(k,x,a),k])),v;for(m=0,c=new Array(w);m<C;++m)v=e[m],v.index=m,typeof v.source!="object"&&(v.source=No(b,v.source)),typeof v.target!="object"&&(v.target=No(b,v.target)),c[v.source.index]=(c[v.source.index]||0)+1,c[v.target.index]=(c[v.target.index]||0)+1;for(m=0,l=new Array(C);m<C;++m)v=e[m],l[m]=c[v.source.index]/(c[v.source.index]+c[v.target.index]);i=new Array(C),_(),s=new Array(C),y()}}function _(){if(a)for(var m=0,w=e.length;m<w;++m)i[m]=+r(e[m],m,e)}function y(){if(a)for(var m=0,w=e.length;m<w;++m)s[m]=+o(e[m],m,e)}return p.initialize=function(m,...w){a=m,h=w.find(C=>typeof C=="function")||Math.random,u=w.find(C=>[1,2,3].includes(C))||2,g()},p.links=function(m){return arguments.length?(e=m,g(),p):e},p.id=function(m){return arguments.length?(n=m,p):n},p.iterations=function(m){return arguments.length?(f=+m,p):f},p.strength=function(m){return arguments.length?(r=typeof m=="function"?m:We(+m),_(),p):r},p.distance=function(m){return arguments.length?(o=typeof m=="function"?m:We(+m),y(),p):o},p}var e_={value:()=>{}};function Cn(){for(var e=0,n=arguments.length,r={},i;e<n;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new Hn(r)}function Hn(e){this._=e}function t_(e,n){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}Hn.prototype=Cn.prototype={constructor:Hn,on:function(e,n){var r=this._,i=t_(e+"",r),o,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((o=(e=i[s]).type)&&(o=n_(r[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++s<a;)if(o=(e=i[s]).type)r[o]=Do(r[o],e.name,n);else if(n==null)for(o in r)r[o]=Do(r[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var r in n)e[r]=n[r].slice();return new Hn(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,s;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,o=s.length;i<o;++i)s[i].value.apply(n,r)},apply:function(e,n,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,s=i.length;o<s;++o)i[o].value.apply(n,r)}};function n_(e,n){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===n)return o.value}function Do(e,n,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===n){e[i]=e_,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:n,value:r}),e}var qt=0,en=0,Vt=0,Ha=1e3,er,tn,tr=0,Ct=0,wr=0,hn=typeof performance=="object"&&performance.now?performance:Date,Va=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Wi(){return Ct||(Va(r_),Ct=hn.now()+wr)}function r_(){Ct=0}function nr(){this._call=this._time=this._next=null}nr.prototype=Ji.prototype={constructor:nr,restart:function(e,n,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Wi():+r)+(n==null?0:+n),!this._next&&tn!==this&&(tn?tn._next=this:er=this,tn=this),this._call=e,this._time=r,Br()},stop:function(){this._call&&(this._call=null,this._time=1/0,Br())}};function Ji(e,n,r){var i=new nr;return i.restart(e,n,r),i}function i_(){Wi(),++qt;for(var e=er,n;e;)(n=Ct-e._time)>=0&&e._call.call(void 0,n),e=e._next;--qt}function jo(){Ct=(tr=hn.now())+wr,qt=en=0;try{i_()}finally{qt=0,s_(),Ct=0}}function o_(){var e=hn.now(),n=e-tr;n>Ha&&(wr-=n,tr=e)}function s_(){for(var e,n=er,r,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:er=r);tn=e,Br(i)}function Br(e){if(!qt){en&&(en=clearTimeout(en));var n=e-Ct;n>24?(e<1/0&&(en=setTimeout(jo,e-hn.now()-wr)),Vt&&(Vt=clearInterval(Vt))):(Vt||(tr=hn.now(),Vt=setInterval(o_,Ha)),qt=1,Va(jo))}}function Zo(e,n,r){var i=new nr;return n=n==null?0:+n,i.restart(o=>{i.stop(),e(o+n)},n,r),i}const a_=1664525,u_=1013904223,qo=4294967296;function c_(){let e=1;return()=>(e=(a_*e+u_)%qo)/qo}var Uo=3;function Rr(e){return e.x}function Lo(e){return e.y}function l_(e){return e.z}var f_=10,h_=Math.PI*(3-Math.sqrt(5)),d_=Math.PI*20/(9+Math.sqrt(221));function p_(e,n){n=n||2;var r=Math.min(Uo,Math.max(1,Math.round(n))),i,o=1,s=.001,a=1-Math.pow(s,1/300),u=0,c=.6,l=new Map,h=Ji(p),f=Cn("tick","end"),d=c_();e==null&&(e=[]);function p(){g(),f.call("tick",i),o<s&&(h.stop(),f.call("end",i))}function g(m){var w,C=e.length,b;m===void 0&&(m=1);for(var v=0;v<m;++v)for(o+=(u-o)*a,l.forEach(function(k){k(o)}),w=0;w<C;++w)b=e[w],b.fx==null?b.x+=b.vx*=c:(b.x=b.fx,b.vx=0),r>1&&(b.fy==null?b.y+=b.vy*=c:(b.y=b.fy,b.vy=0)),r>2&&(b.fz==null?b.z+=b.vz*=c:(b.z=b.fz,b.vz=0));return i}function _(){for(var m=0,w=e.length,C;m<w;++m){if(C=e[m],C.index=m,C.fx!=null&&(C.x=C.fx),C.fy!=null&&(C.y=C.fy),C.fz!=null&&(C.z=C.fz),isNaN(C.x)||r>1&&isNaN(C.y)||r>2&&isNaN(C.z)){var b=f_*(r>2?Math.cbrt(.5+m):r>1?Math.sqrt(.5+m):m),v=m*h_,k=m*d_;r===1?C.x=b:r===2?(C.x=b*Math.cos(v),C.y=b*Math.sin(v)):(C.x=b*Math.sin(v)*Math.cos(k),C.y=b*Math.cos(v),C.z=b*Math.sin(v)*Math.sin(k))}(isNaN(C.vx)||r>1&&isNaN(C.vy)||r>2&&isNaN(C.vz))&&(C.vx=0,r>1&&(C.vy=0),r>2&&(C.vz=0))}}function y(m){return m.initialize&&m.initialize(e,d,r),m}return _(),i={tick:g,restart:function(){return h.restart(p),i},stop:function(){return h.stop(),i},numDimensions:function(m){return arguments.length?(r=Math.min(Uo,Math.max(1,Math.round(m))),l.forEach(y),i):r},nodes:function(m){return arguments.length?(e=m,_(),l.forEach(y),i):e},alpha:function(m){return arguments.length?(o=+m,i):o},alphaMin:function(m){return arguments.length?(s=+m,i):s},alphaDecay:function(m){return arguments.length?(a=+m,i):+a},alphaTarget:function(m){return arguments.length?(u=+m,i):u},velocityDecay:function(m){return arguments.length?(c=1-m,i):1-c},randomSource:function(m){return arguments.length?(d=m,l.forEach(y),i):d},force:function(m,w){return arguments.length>1?(w==null?l.delete(m):l.set(m,y(w)),i):l.get(m)},find:function(){var m=Array.prototype.slice.call(arguments),w=m.shift()||0,C=(r>1?m.shift():null)||0,b=(r>2?m.shift():null)||0,v=m.shift()||1/0,k=0,x=e.length,P,M,$,N,D,H;for(v*=v,k=0;k<x;++k)D=e[k],P=w-D.x,M=C-(D.y||0),$=b-(D.z||0),N=P*P+M*M+$*$,N<v&&(H=D,v=N);return H},on:function(m,w){return arguments.length>1?(f.on(m,w),i):f.on(m)}}}function Ba(){var e,n,r,i,o,s=We(-30),a,u=1,c=1/0,l=.81;function h(g){var _,y=e.length,m=(n===1?Ui(e,Rr):n===2?Fi(e,Rr,Lo):n===3?Vi(e,Rr,Lo,l_):null).visitAfter(d);for(o=g,_=0;_<y;++_)r=e[_],m.visit(p)}function f(){if(e){var g,_=e.length,y;for(a=new Array(_),g=0;g<_;++g)y=e[g],a[y.index]=+s(y,g,e)}}function d(g){var _=0,y,m,w=0,C,b,v,k,x=g.length;if(x){for(C=b=v=k=0;k<x;++k)(y=g[k])&&(m=Math.abs(y.value))&&(_+=y.value,w+=m,C+=m*(y.x||0),b+=m*(y.y||0),v+=m*(y.z||0));_*=Math.sqrt(4/x),g.x=C/w,n>1&&(g.y=b/w),n>2&&(g.z=v/w)}else{y=g,y.x=y.data.x,n>1&&(y.y=y.data.y),n>2&&(y.z=y.data.z);do _+=a[y.data.index];while(y=y.next)}g.value=_}function p(g,_,y,m,w){if(!g.value)return!0;var C=[y,m,w][n-1],b=g.x-r.x,v=n>1?g.y-r.y:0,k=n>2?g.z-r.z:0,x=C-_,P=b*b+v*v+k*k;if(x*x/l<P)return P<c&&(b===0&&(b=Ne(i),P+=b*b),n>1&&v===0&&(v=Ne(i),P+=v*v),n>2&&k===0&&(k=Ne(i),P+=k*k),P<u&&(P=Math.sqrt(u*P)),r.vx+=b*g.value*o/P,n>1&&(r.vy+=v*g.value*o/P),n>2&&(r.vz+=k*g.value*o/P)),!0;if(g.length||P>=c)return;(g.data!==r||g.next)&&(b===0&&(b=Ne(i),P+=b*b),n>1&&v===0&&(v=Ne(i),P+=v*v),n>2&&k===0&&(k=Ne(i),P+=k*k),P<u&&(P=Math.sqrt(u*P)));do g.data!==r&&(x=a[g.data.index]*o/P,r.vx+=b*x,n>1&&(r.vy+=v*x),n>2&&(r.vz+=k*x));while(g=g.next)}return h.initialize=function(g,..._){e=g,i=_.find(y=>typeof y=="function")||Math.random,n=_.find(y=>[1,2,3].includes(y))||2,f()},h.strength=function(g){return arguments.length?(s=typeof g=="function"?g:We(+g),f(),h):s},h.distanceMin=function(g){return arguments.length?(u=g*g,h):Math.sqrt(u)},h.distanceMax=function(g){return arguments.length?(c=g*g,h):Math.sqrt(c)},h.theta=function(g){return arguments.length?(l=g*g,h):Math.sqrt(l)},h}function g_(e,n,r,i){var o,s,a=We(.1),u,c;typeof e!="function"&&(e=We(+e)),n==null&&(n=0),r==null&&(r=0),i==null&&(i=0);function l(f){for(var d=0,p=o.length;d<p;++d){var g=o[d],_=g.x-n||1e-6,y=(g.y||0)-r||1e-6,m=(g.z||0)-i||1e-6,w=Math.sqrt(_*_+y*y+m*m),C=(c[d]-w)*u[d]*f/w;g.vx+=_*C,s>1&&(g.vy+=y*C),s>2&&(g.vz+=m*C)}}function h(){if(o){var f,d=o.length;for(u=new Array(d),c=new Array(d),f=0;f<d;++f)c[f]=+e(o[f],f,o),u[f]=isNaN(c[f])?0:+a(o[f],f,o)}}return l.initialize=function(f,...d){o=f,s=d.find(p=>[1,2,3].includes(p))||2,h()},l.strength=function(f){return arguments.length?(a=typeof f=="function"?f:We(+f),h(),l):a},l.radius=function(f){return arguments.length?(e=typeof f=="function"?f:We(+f),h(),l):e},l.x=function(f){return arguments.length?(n=+f,l):n},l.y=function(f){return arguments.length?(r=+f,l):r},l.z=function(f){return arguments.length?(i=+f,l):i},l}var Wr="http://www.w3.org/1999/xhtml";const Fo={svg:"http://www.w3.org/2000/svg",xhtml:Wr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function xr(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Fo.hasOwnProperty(n)?{space:Fo[n],local:e}:e}function m_(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===Wr&&n.documentElement.namespaceURI===Wr?n.createElement(e):n.createElementNS(r,e)}}function __(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Wa(e){var n=xr(e);return(n.local?__:m_)(n)}function y_(){}function Gi(e){return e==null?y_:function(){return this.querySelector(e)}}function v_(e){typeof e!="function"&&(e=Gi(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var s=n[o],a=s.length,u=i[o]=new Array(a),c,l,h=0;h<a;++h)(c=s[h])&&(l=e.call(c,c.__data__,h,s))&&("__data__"in c&&(l.__data__=c.__data__),u[h]=l);return new Ae(i,this._parents)}function b_(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function w_(){return[]}function Ja(e){return e==null?w_:function(){return this.querySelectorAll(e)}}function x_(e){return function(){return b_(e.apply(this,arguments))}}function k_(e){typeof e=="function"?e=x_(e):e=Ja(e);for(var n=this._groups,r=n.length,i=[],o=[],s=0;s<r;++s)for(var a=n[s],u=a.length,c,l=0;l<u;++l)(c=a[l])&&(i.push(e.call(c,c.__data__,l,a)),o.push(c));return new Ae(i,o)}function Ga(e){return function(){return this.matches(e)}}function Xa(e){return function(n){return n.matches(e)}}var S_=Array.prototype.find;function z_(e){return function(){return S_.call(this.children,e)}}function T_(){return this.firstElementChild}function C_(e){return this.select(e==null?T_:z_(typeof e=="function"?e:Xa(e)))}var P_=Array.prototype.filter;function E_(){return Array.from(this.children)}function A_(e){return function(){return P_.call(this.children,e)}}function R_(e){return this.selectAll(e==null?E_:A_(typeof e=="function"?e:Xa(e)))}function $_(e){typeof e!="function"&&(e=Ga(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var s=n[o],a=s.length,u=i[o]=[],c,l=0;l<a;++l)(c=s[l])&&e.call(c,c.__data__,l,s)&&u.push(c);return new Ae(i,this._parents)}function Ka(e){return new Array(e.length)}function I_(){return new Ae(this._enter||this._groups.map(Ka),this._parents)}function rr(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}rr.prototype={constructor:rr,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function M_(e){return function(){return e}}function O_(e,n,r,i,o,s){for(var a=0,u,c=n.length,l=s.length;a<l;++a)(u=n[a])?(u.__data__=s[a],i[a]=u):r[a]=new rr(e,s[a]);for(;a<c;++a)(u=n[a])&&(o[a]=u)}function N_(e,n,r,i,o,s,a){var u,c,l=new Map,h=n.length,f=s.length,d=new Array(h),p;for(u=0;u<h;++u)(c=n[u])&&(d[u]=p=a.call(c,c.__data__,u,n)+"",l.has(p)?o[u]=c:l.set(p,c));for(u=0;u<f;++u)p=a.call(e,s[u],u,s)+"",(c=l.get(p))?(i[u]=c,c.__data__=s[u],l.delete(p)):r[u]=new rr(e,s[u]);for(u=0;u<h;++u)(c=n[u])&&l.get(d[u])===c&&(o[u]=c)}function D_(e){return e.__data__}function j_(e,n){if(!arguments.length)return Array.from(this,D_);var r=n?N_:O_,i=this._parents,o=this._groups;typeof e!="function"&&(e=M_(e));for(var s=o.length,a=new Array(s),u=new Array(s),c=new Array(s),l=0;l<s;++l){var h=i[l],f=o[l],d=f.length,p=Z_(e.call(h,h&&h.__data__,l,i)),g=p.length,_=u[l]=new Array(g),y=a[l]=new Array(g),m=c[l]=new Array(d);r(h,f,_,y,m,p,n);for(var w=0,C=0,b,v;w<g;++w)if(b=_[w]){for(w>=C&&(C=w+1);!(v=y[C])&&++C<g;);b._next=v||null}}return a=new Ae(a,i),a._enter=u,a._exit=c,a}function Z_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function q_(){return new Ae(this._exit||this._groups.map(Ka),this._parents)}function U_(e,n,r){var i=this.enter(),o=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),r==null?s.remove():r(s),i&&o?i.merge(o).order():o}function L_(e){for(var n=e.selection?e.selection():e,r=this._groups,i=n._groups,o=r.length,s=i.length,a=Math.min(o,s),u=new Array(o),c=0;c<a;++c)for(var l=r[c],h=i[c],f=l.length,d=u[c]=new Array(f),p,g=0;g<f;++g)(p=l[g]||h[g])&&(d[g]=p);for(;c<o;++c)u[c]=r[c];return new Ae(u,this._parents)}function F_(){for(var e=this._groups,n=-1,r=e.length;++n<r;)for(var i=e[n],o=i.length-1,s=i[o],a;--o>=0;)(a=i[o])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function H_(e){e||(e=V_);function n(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s){for(var a=r[s],u=a.length,c=o[s]=new Array(u),l,h=0;h<u;++h)(l=a[h])&&(c[h]=l);c.sort(n)}return new Ae(o,this._parents).order()}function V_(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function B_(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function W_(){return Array.from(this)}function J_(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length;o<s;++o){var a=i[o];if(a)return a}return null}function G_(){let e=0;for(const n of this)++e;return e}function X_(){return!this.node()}function K_(e){for(var n=this._groups,r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length,u;s<a;++s)(u=o[s])&&e.call(u,u.__data__,s,o);return this}function Y_(e){return function(){this.removeAttribute(e)}}function Q_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function e0(e,n){return function(){this.setAttribute(e,n)}}function t0(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function n0(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function r0(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function i0(e,n){var r=xr(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((n==null?r.local?Q_:Y_:typeof n=="function"?r.local?r0:n0:r.local?t0:e0)(r,n))}function Ya(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function o0(e){return function(){this.style.removeProperty(e)}}function s0(e,n,r){return function(){this.style.setProperty(e,n,r)}}function a0(e,n,r){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function u0(e,n,r){return arguments.length>1?this.each((n==null?o0:typeof n=="function"?a0:s0)(e,n,r??"")):Ut(this.node(),e)}function Ut(e,n){return e.style.getPropertyValue(n)||Ya(e).getComputedStyle(e,null).getPropertyValue(n)}function c0(e){return function(){delete this[e]}}function l0(e,n){return function(){this[e]=n}}function f0(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function h0(e,n){return arguments.length>1?this.each((n==null?c0:typeof n=="function"?f0:l0)(e,n)):this.node()[e]}function Qa(e){return e.trim().split(/^|\s+/)}function Xi(e){return e.classList||new eu(e)}function eu(e){this._node=e,this._names=Qa(e.getAttribute("class")||"")}eu.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function tu(e,n){for(var r=Xi(e),i=-1,o=n.length;++i<o;)r.add(n[i])}function nu(e,n){for(var r=Xi(e),i=-1,o=n.length;++i<o;)r.remove(n[i])}function d0(e){return function(){tu(this,e)}}function p0(e){return function(){nu(this,e)}}function g0(e,n){return function(){(n.apply(this,arguments)?tu:nu)(this,e)}}function m0(e,n){var r=Qa(e+"");if(arguments.length<2){for(var i=Xi(this.node()),o=-1,s=r.length;++o<s;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof n=="function"?g0:n?d0:p0)(r,n))}function _0(){this.textContent=""}function y0(e){return function(){this.textContent=e}}function v0(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function b0(e){return arguments.length?this.each(e==null?_0:(typeof e=="function"?v0:y0)(e)):this.node().textContent}function w0(){this.innerHTML=""}function x0(e){return function(){this.innerHTML=e}}function k0(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function S0(e){return arguments.length?this.each(e==null?w0:(typeof e=="function"?k0:x0)(e)):this.node().innerHTML}function z0(){this.nextSibling&&this.parentNode.appendChild(this)}function T0(){return this.each(z0)}function C0(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function P0(){return this.each(C0)}function E0(e){var n=typeof e=="function"?e:Wa(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function A0(){return null}function R0(e,n){var r=typeof e=="function"?e:Wa(e),i=n==null?A0:typeof n=="function"?n:Gi(n);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function $0(){var e=this.parentNode;e&&e.removeChild(this)}function I0(){return this.each($0)}function M0(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function O0(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function N0(e){return this.select(e?O0:M0)}function D0(e){return arguments.length?this.property("__data__",e):this.node().__data__}function j0(e){return function(n){e.call(this,n,this.__data__)}}function Z0(e){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");return i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),{type:n,name:r}})}function q0(e){return function(){var n=this.__on;if(n){for(var r=0,i=-1,o=n.length,s;r<o;++r)s=n[r],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):n[++i]=s;++i?n.length=i:delete this.__on}}}function U0(e,n,r){return function(){var i=this.__on,o,s=j0(n);if(i){for(var a=0,u=i.length;a<u;++a)if((o=i[a]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=r),o.value=n;return}}this.addEventListener(e.type,s,r),o={type:e.type,name:e.name,value:n,listener:s,options:r},i?i.push(o):this.__on=[o]}}function L0(e,n,r){var i=Z0(e+""),o,s=i.length,a;if(arguments.length<2){var u=this.node().__on;if(u){for(var c=0,l=u.length,h;c<l;++c)for(o=0,h=u[c];o<s;++o)if((a=i[o]).type===h.type&&a.name===h.name)return h.value}return}for(u=n?U0:q0,o=0;o<s;++o)this.each(u(i[o],n,r));return this}function ru(e,n,r){var i=Ya(e),o=i.CustomEvent;typeof o=="function"?o=new o(n,r):(o=i.document.createEvent("Event"),r?(o.initEvent(n,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function F0(e,n){return function(){return ru(this,e,n)}}function H0(e,n){return function(){return ru(this,e,n.apply(this,arguments))}}function V0(e,n){return this.each((typeof n=="function"?H0:F0)(e,n))}function*B0(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&(yield a)}var iu=[null];function Ae(e,n){this._groups=e,this._parents=n}function Pn(){return new Ae([[document.documentElement]],iu)}function W0(){return this}Ae.prototype=Pn.prototype={constructor:Ae,select:v_,selectAll:k_,selectChild:C_,selectChildren:R_,filter:$_,data:j_,enter:I_,exit:q_,join:U_,merge:L_,selection:W0,order:F_,sort:H_,call:B_,nodes:W_,node:J_,size:G_,empty:X_,each:K_,attr:i0,style:u0,property:h0,classed:m0,text:b0,html:S0,raise:T0,lower:P0,append:E0,insert:R0,remove:I0,clone:N0,datum:D0,on:L0,dispatch:V0,[Symbol.iterator]:B0};function De(e){return typeof e=="string"?new Ae([[document.querySelector(e)]],[document.documentElement]):new Ae([[e]],iu)}function J0(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Ke(e,n){if(e=J0(e),n===void 0&&(n=e.currentTarget),n){var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}const G0={passive:!1},dn={capture:!0,passive:!1};function $r(e){e.stopImmediatePropagation()}function Ot(e){e.preventDefault(),e.stopImmediatePropagation()}function ou(e){var n=e.document.documentElement,r=De(e).on("dragstart.drag",Ot,dn);"onselectstart"in n?r.on("selectstart.drag",Ot,dn):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function su(e,n){var r=e.document.documentElement,i=De(e).on("dragstart.drag",null);n&&(i.on("click.drag",Ot,dn),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Nn=e=>()=>e;function Jr(e,{sourceEvent:n,subject:r,target:i,identifier:o,active:s,x:a,y:u,dx:c,dy:l,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:h}})}Jr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function X0(e){return!e.ctrlKey&&!e.button}function K0(){return this.parentNode}function Y0(e,n){return n??{x:e.x,y:e.y}}function Q0(){return navigator.maxTouchPoints||"ontouchstart"in this}function ey(){var e=X0,n=K0,r=Y0,i=Q0,o={},s=Cn("start","drag","end"),a=0,u,c,l,h,f=0;function d(b){b.on("mousedown.drag",p).filter(i).on("touchstart.drag",y).on("touchmove.drag",m,G0).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(b,v){if(!(h||!e.call(this,b,v))){var k=C(this,n.call(this,b,v),b,v,"mouse");k&&(De(b.view).on("mousemove.drag",g,dn).on("mouseup.drag",_,dn),ou(b.view),$r(b),l=!1,u=b.clientX,c=b.clientY,k("start",b))}}function g(b){if(Ot(b),!l){var v=b.clientX-u,k=b.clientY-c;l=v*v+k*k>f}o.mouse("drag",b)}function _(b){De(b.view).on("mousemove.drag mouseup.drag",null),su(b.view,l),Ot(b),o.mouse("end",b)}function y(b,v){if(e.call(this,b,v)){var k=b.changedTouches,x=n.call(this,b,v),P=k.length,M,$;for(M=0;M<P;++M)($=C(this,x,b,v,k[M].identifier,k[M]))&&($r(b),$("start",b,k[M]))}}function m(b){var v=b.changedTouches,k=v.length,x,P;for(x=0;x<k;++x)(P=o[v[x].identifier])&&(Ot(b),P("drag",b,v[x]))}function w(b){var v=b.changedTouches,k=v.length,x,P;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),x=0;x<k;++x)(P=o[v[x].identifier])&&($r(b),P("end",b,v[x]))}function C(b,v,k,x,P,M){var $=s.copy(),N=Ke(M||k,v),D,H,z;if((z=r.call(b,new Jr("beforestart",{sourceEvent:k,target:d,identifier:P,active:a,x:N[0],y:N[1],dx:0,dy:0,dispatch:$}),x))!=null)return D=z.x-N[0]||0,H=z.y-N[1]||0,function O(R,j,F){var q=N,V;switch(R){case"start":o[P]=O,V=a++;break;case"end":delete o[P],--a;case"drag":N=Ke(F||j,v),V=a;break}$.call(R,b,new Jr(R,{sourceEvent:j,subject:z,target:d,identifier:P,active:V,x:N[0]+D,y:N[1]+H,dx:N[0]-q[0],dy:N[1]-q[1],dispatch:$}),x)}}return d.filter=function(b){return arguments.length?(e=typeof b=="function"?b:Nn(!!b),d):e},d.container=function(b){return arguments.length?(n=typeof b=="function"?b:Nn(b),d):n},d.subject=function(b){return arguments.length?(r=typeof b=="function"?b:Nn(b),d):r},d.touchable=function(b){return arguments.length?(i=typeof b=="function"?b:Nn(!!b),d):i},d.on=function(){var b=s.on.apply(s,arguments);return b===s?d:b},d.clickDistance=function(b){return arguments.length?(f=(b=+b)*b,d):Math.sqrt(f)},d}function Ki(e,n,r){e.prototype=n.prototype=r,r.constructor=e}function au(e,n){var r=Object.create(e.prototype);for(var i in n)r[i]=n[i];return r}function En(){}var pn=.7,ir=1/pn,Nt="\\s*([+-]?\\d+)\\s*",gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ty=/^#([0-9a-f]{3,8})$/,ny=new RegExp(`^rgb\\(${Nt},${Nt},${Nt}\\)$`),ry=new RegExp(`^rgb\\(${Qe},${Qe},${Qe}\\)$`),iy=new RegExp(`^rgba\\(${Nt},${Nt},${Nt},${gn}\\)$`),oy=new RegExp(`^rgba\\(${Qe},${Qe},${Qe},${gn}\\)$`),sy=new RegExp(`^hsl\\(${gn},${Qe},${Qe}\\)$`),ay=new RegExp(`^hsla\\(${gn},${Qe},${Qe},${gn}\\)$`),Ho={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ki(En,mn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Vo,formatHex:Vo,formatHex8:uy,formatHsl:cy,formatRgb:Bo,toString:Bo});function Vo(){return this.rgb().formatHex()}function uy(){return this.rgb().formatHex8()}function cy(){return uu(this).formatHsl()}function Bo(){return this.rgb().formatRgb()}function mn(e){var n,r;return e=(e+"").trim().toLowerCase(),(n=ty.exec(e))?(r=n[1].length,n=parseInt(n[1],16),r===6?Wo(n):r===3?new Te(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):r===8?Dn(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):r===4?Dn(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=ny.exec(e))?new Te(n[1],n[2],n[3],1):(n=ry.exec(e))?new Te(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=iy.exec(e))?Dn(n[1],n[2],n[3],n[4]):(n=oy.exec(e))?Dn(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=sy.exec(e))?Xo(n[1],n[2]/100,n[3]/100,1):(n=ay.exec(e))?Xo(n[1],n[2]/100,n[3]/100,n[4]):Ho.hasOwnProperty(e)?Wo(Ho[e]):e==="transparent"?new Te(NaN,NaN,NaN,0):null}function Wo(e){return new Te(e>>16&255,e>>8&255,e&255,1)}function Dn(e,n,r,i){return i<=0&&(e=n=r=NaN),new Te(e,n,r,i)}function ly(e){return e instanceof En||(e=mn(e)),e?(e=e.rgb(),new Te(e.r,e.g,e.b,e.opacity)):new Te}function Gr(e,n,r,i){return arguments.length===1?ly(e):new Te(e,n,r,i??1)}function Te(e,n,r,i){this.r=+e,this.g=+n,this.b=+r,this.opacity=+i}Ki(Te,Gr,au(En,{brighter(e){return e=e==null?ir:Math.pow(ir,e),new Te(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?pn:Math.pow(pn,e),new Te(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Te(zt(this.r),zt(this.g),zt(this.b),or(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Jo,formatHex:Jo,formatHex8:fy,formatRgb:Go,toString:Go}));function Jo(){return`#${St(this.r)}${St(this.g)}${St(this.b)}`}function fy(){return`#${St(this.r)}${St(this.g)}${St(this.b)}${St((isNaN(this.opacity)?1:this.opacity)*255)}`}function Go(){const e=or(this.opacity);return`${e===1?"rgb(":"rgba("}${zt(this.r)}, ${zt(this.g)}, ${zt(this.b)}${e===1?")":`, ${e})`}`}function or(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function St(e){return e=zt(e),(e<16?"0":"")+e.toString(16)}function Xo(e,n,r,i){return i<=0?e=n=r=NaN:r<=0||r>=1?e=n=NaN:n<=0&&(e=NaN),new Be(e,n,r,i)}function uu(e){if(e instanceof Be)return new Be(e.h,e.s,e.l,e.opacity);if(e instanceof En||(e=mn(e)),!e)return new Be;if(e instanceof Be)return e;e=e.rgb();var n=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(n,r,i),s=Math.max(n,r,i),a=NaN,u=s-o,c=(s+o)/2;return u?(n===s?a=(r-i)/u+(r<i)*6:r===s?a=(i-n)/u+2:a=(n-r)/u+4,u/=c<.5?s+o:2-s-o,a*=60):u=c>0&&c<1?0:a,new Be(a,u,c,e.opacity)}function hy(e,n,r,i){return arguments.length===1?uu(e):new Be(e,n,r,i??1)}function Be(e,n,r,i){this.h=+e,this.s=+n,this.l=+r,this.opacity=+i}Ki(Be,hy,au(En,{brighter(e){return e=e==null?ir:Math.pow(ir,e),new Be(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?pn:Math.pow(pn,e),new Be(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*n,o=2*r-i;return new Te(Ir(e>=240?e-240:e+120,o,i),Ir(e,o,i),Ir(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Be(Ko(this.h),jn(this.s),jn(this.l),or(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=or(this.opacity);return`${e===1?"hsl(":"hsla("}${Ko(this.h)}, ${jn(this.s)*100}%, ${jn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ko(e){return e=(e||0)%360,e<0?e+360:e}function jn(e){return Math.max(0,Math.min(1,e||0))}function Ir(e,n,r){return(e<60?n+(r-n)*e/60:e<180?r:e<240?n+(r-n)*(240-e)/60:n)*255}const cu=e=>()=>e;function dy(e,n){return function(r){return e+r*n}}function py(e,n,r){return e=Math.pow(e,r),n=Math.pow(n,r)-e,r=1/r,function(i){return Math.pow(e+i*n,r)}}function gy(e){return(e=+e)==1?lu:function(n,r){return r-n?py(n,r,e):cu(isNaN(n)?r:n)}}function lu(e,n){var r=n-e;return r?dy(e,r):cu(isNaN(e)?n:e)}const Yo=(function e(n){var r=gy(n);function i(o,s){var a=r((o=Gr(o)).r,(s=Gr(s)).r),u=r(o.g,s.g),c=r(o.b,s.b),l=lu(o.opacity,s.opacity);return function(h){return o.r=a(h),o.g=u(h),o.b=c(h),o.opacity=l(h),o+""}}return i.gamma=e,i})(1);function pt(e,n){return e=+e,n=+n,function(r){return e*(1-r)+n*r}}var Xr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Mr=new RegExp(Xr.source,"g");function my(e){return function(){return e}}function _y(e){return function(n){return e(n)+""}}function yy(e,n){var r=Xr.lastIndex=Mr.lastIndex=0,i,o,s,a=-1,u=[],c=[];for(e=e+"",n=n+"";(i=Xr.exec(e))&&(o=Mr.exec(n));)(s=o.index)>r&&(s=n.slice(r,s),u[a]?u[a]+=s:u[++a]=s),(i=i[0])===(o=o[0])?u[a]?u[a]+=o:u[++a]=o:(u[++a]=null,c.push({i:a,x:pt(i,o)})),r=Mr.lastIndex;return r<n.length&&(s=n.slice(r),u[a]?u[a]+=s:u[++a]=s),u.length<2?c[0]?_y(c[0].x):my(n):(n=c.length,function(l){for(var h=0,f;h<n;++h)u[(f=c[h]).i]=f.x(l);return u.join("")})}var Qo=180/Math.PI,Kr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function fu(e,n,r,i,o,s){var a,u,c;return(a=Math.sqrt(e*e+n*n))&&(e/=a,n/=a),(c=e*r+n*i)&&(r-=e*c,i-=n*c),(u=Math.sqrt(r*r+i*i))&&(r/=u,i/=u,c/=u),e*i<n*r&&(e=-e,n=-n,c=-c,a=-a),{translateX:o,translateY:s,rotate:Math.atan2(n,e)*Qo,skewX:Math.atan(c)*Qo,scaleX:a,scaleY:u}}var Zn;function vy(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Kr:fu(n.a,n.b,n.c,n.d,n.e,n.f)}function by(e){return e==null||(Zn||(Zn=document.createElementNS("http://www.w3.org/2000/svg","g")),Zn.setAttribute("transform",e),!(e=Zn.transform.baseVal.consolidate()))?Kr:(e=e.matrix,fu(e.a,e.b,e.c,e.d,e.e,e.f))}function hu(e,n,r,i){function o(l){return l.length?l.pop()+" ":""}function s(l,h,f,d,p,g){if(l!==f||h!==d){var _=p.push("translate(",null,n,null,r);g.push({i:_-4,x:pt(l,f)},{i:_-2,x:pt(h,d)})}else(f||d)&&p.push("translate("+f+n+d+r)}function a(l,h,f,d){l!==h?(l-h>180?h+=360:h-l>180&&(l+=360),d.push({i:f.push(o(f)+"rotate(",null,i)-2,x:pt(l,h)})):h&&f.push(o(f)+"rotate("+h+i)}function u(l,h,f,d){l!==h?d.push({i:f.push(o(f)+"skewX(",null,i)-2,x:pt(l,h)}):h&&f.push(o(f)+"skewX("+h+i)}function c(l,h,f,d,p,g){if(l!==f||h!==d){var _=p.push(o(p)+"scale(",null,",",null,")");g.push({i:_-4,x:pt(l,f)},{i:_-2,x:pt(h,d)})}else(f!==1||d!==1)&&p.push(o(p)+"scale("+f+","+d+")")}return function(l,h){var f=[],d=[];return l=e(l),h=e(h),s(l.translateX,l.translateY,h.translateX,h.translateY,f,d),a(l.rotate,h.rotate,f,d),u(l.skewX,h.skewX,f,d),c(l.scaleX,l.scaleY,h.scaleX,h.scaleY,f,d),l=h=null,function(p){for(var g=-1,_=d.length,y;++g<_;)f[(y=d[g]).i]=y.x(p);return f.join("")}}}var wy=hu(vy,"px, ","px)","deg)"),xy=hu(by,", ",")",")"),ky=1e-12;function es(e){return((e=Math.exp(e))+1/e)/2}function Sy(e){return((e=Math.exp(e))-1/e)/2}function zy(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ty=(function e(n,r,i){function o(s,a){var u=s[0],c=s[1],l=s[2],h=a[0],f=a[1],d=a[2],p=h-u,g=f-c,_=p*p+g*g,y,m;if(_<ky)m=Math.log(d/l)/n,y=function(x){return[u+x*p,c+x*g,l*Math.exp(n*x*m)]};else{var w=Math.sqrt(_),C=(d*d-l*l+i*_)/(2*l*r*w),b=(d*d-l*l-i*_)/(2*d*r*w),v=Math.log(Math.sqrt(C*C+1)-C),k=Math.log(Math.sqrt(b*b+1)-b);m=(k-v)/n,y=function(x){var P=x*m,M=es(v),$=l/(r*w)*(M*zy(n*P+v)-Sy(v));return[u+$*p,c+$*g,l*M/es(n*P+v)]}}return y.duration=m*1e3*n/Math.SQRT2,y}return o.rho=function(s){var a=Math.max(.001,+s),u=a*a,c=u*u;return e(a,u,c)},o})(Math.SQRT2,2,4);var Cy=Cn("start","end","cancel","interrupt"),Py=[],du=0,ts=1,Yr=2,Vn=3,ns=4,Qr=5,Bn=6;function kr(e,n,r,i,o,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;Ey(e,r,{name:n,index:i,group:o,on:Cy,tween:Py,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:du})}function Yi(e,n){var r=Ge(e,n);if(r.state>du)throw new Error("too late; already scheduled");return r}function tt(e,n){var r=Ge(e,n);if(r.state>Vn)throw new Error("too late; already running");return r}function Ge(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function Ey(e,n,r){var i=e.__transition,o;i[n]=r,r.timer=Ji(s,0,r.time);function s(l){r.state=ts,r.timer.restart(a,r.delay,r.time),r.delay<=l&&a(l-r.delay)}function a(l){var h,f,d,p;if(r.state!==ts)return c();for(h in i)if(p=i[h],p.name===r.name){if(p.state===Vn)return Zo(a);p.state===ns?(p.state=Bn,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[h]):+h<n&&(p.state=Bn,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete i[h])}if(Zo(function(){r.state===Vn&&(r.state=ns,r.timer.restart(u,r.delay,r.time),u(l))}),r.state=Yr,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Yr){for(r.state=Vn,o=new Array(d=r.tween.length),h=0,f=-1;h<d;++h)(p=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(o[++f]=p);o.length=f+1}}function u(l){for(var h=l<r.duration?r.ease.call(null,l/r.duration):(r.timer.restart(c),r.state=Qr,1),f=-1,d=o.length;++f<d;)o[f].call(e,h);r.state===Qr&&(r.on.call("end",e,e.__data__,r.index,r.group),c())}function c(){r.state=Bn,r.timer.stop(),delete i[n];for(var l in i)return;delete e.__transition}}function Wn(e,n){var r=e.__transition,i,o,s=!0,a;if(r){n=n==null?null:n+"";for(a in r){if((i=r[a]).name!==n){s=!1;continue}o=i.state>Yr&&i.state<Qr,i.state=Bn,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[a]}s&&delete e.__transition}}function Ay(e){return this.each(function(){Wn(this,e)})}function Ry(e,n){var r,i;return function(){var o=tt(this,e),s=o.tween;if(s!==r){i=r=s;for(var a=0,u=i.length;a<u;++a)if(i[a].name===n){i=i.slice(),i.splice(a,1);break}}o.tween=i}}function $y(e,n,r){var i,o;if(typeof r!="function")throw new Error;return function(){var s=tt(this,e),a=s.tween;if(a!==i){o=(i=a).slice();for(var u={name:n,value:r},c=0,l=o.length;c<l;++c)if(o[c].name===n){o[c]=u;break}c===l&&o.push(u)}s.tween=o}}function Iy(e,n){var r=this._id;if(e+="",arguments.length<2){for(var i=Ge(this.node(),r).tween,o=0,s=i.length,a;o<s;++o)if((a=i[o]).name===e)return a.value;return null}return this.each((n==null?Ry:$y)(r,e,n))}function Qi(e,n,r){var i=e._id;return e.each(function(){var o=tt(this,i);(o.value||(o.value={}))[n]=r.apply(this,arguments)}),function(o){return Ge(o,i).value[n]}}function pu(e,n){var r;return(typeof n=="number"?pt:n instanceof mn?Yo:(r=mn(n))?(n=r,Yo):yy)(e,n)}function My(e){return function(){this.removeAttribute(e)}}function Oy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ny(e,n,r){var i,o=r+"",s;return function(){var a=this.getAttribute(e);return a===o?null:a===i?s:s=n(i=a,r)}}function Dy(e,n,r){var i,o=r+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===o?null:a===i?s:s=n(i=a,r)}}function jy(e,n,r){var i,o,s;return function(){var a,u=r(this),c;return u==null?void this.removeAttribute(e):(a=this.getAttribute(e),c=u+"",a===c?null:a===i&&c===o?s:(o=c,s=n(i=a,u)))}}function Zy(e,n,r){var i,o,s;return function(){var a,u=r(this),c;return u==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),c=u+"",a===c?null:a===i&&c===o?s:(o=c,s=n(i=a,u)))}}function qy(e,n){var r=xr(e),i=r==="transform"?xy:pu;return this.attrTween(e,typeof n=="function"?(r.local?Zy:jy)(r,i,Qi(this,"attr."+e,n)):n==null?(r.local?Oy:My)(r):(r.local?Dy:Ny)(r,i,n))}function Uy(e,n){return function(r){this.setAttribute(e,n.call(this,r))}}function Ly(e,n){return function(r){this.setAttributeNS(e.space,e.local,n.call(this,r))}}function Fy(e,n){var r,i;function o(){var s=n.apply(this,arguments);return s!==i&&(r=(i=s)&&Ly(e,s)),r}return o._value=n,o}function Hy(e,n){var r,i;function o(){var s=n.apply(this,arguments);return s!==i&&(r=(i=s)&&Uy(e,s)),r}return o._value=n,o}function Vy(e,n){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;var i=xr(e);return this.tween(r,(i.local?Fy:Hy)(i,n))}function By(e,n){return function(){Yi(this,e).delay=+n.apply(this,arguments)}}function Wy(e,n){return n=+n,function(){Yi(this,e).delay=n}}function Jy(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?By:Wy)(n,e)):Ge(this.node(),n).delay}function Gy(e,n){return function(){tt(this,e).duration=+n.apply(this,arguments)}}function Xy(e,n){return n=+n,function(){tt(this,e).duration=n}}function Ky(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?Gy:Xy)(n,e)):Ge(this.node(),n).duration}function Yy(e,n){if(typeof n!="function")throw new Error;return function(){tt(this,e).ease=n}}function Qy(e){var n=this._id;return arguments.length?this.each(Yy(n,e)):Ge(this.node(),n).ease}function ev(e,n){return function(){var r=n.apply(this,arguments);if(typeof r!="function")throw new Error;tt(this,e).ease=r}}function tv(e){if(typeof e!="function")throw new Error;return this.each(ev(this._id,e))}function nv(e){typeof e!="function"&&(e=Ga(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var s=n[o],a=s.length,u=i[o]=[],c,l=0;l<a;++l)(c=s[l])&&e.call(c,c.__data__,l,s)&&u.push(c);return new lt(i,this._parents,this._name,this._id)}function rv(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),u=0;u<s;++u)for(var c=n[u],l=r[u],h=c.length,f=a[u]=new Array(h),d,p=0;p<h;++p)(d=c[p]||l[p])&&(f[p]=d);for(;u<i;++u)a[u]=n[u];return new lt(a,this._parents,this._name,this._id)}function iv(e){return(e+"").trim().split(/^|\s+/).every(function(n){var r=n.indexOf(".");return r>=0&&(n=n.slice(0,r)),!n||n==="start"})}function ov(e,n,r){var i,o,s=iv(n)?Yi:tt;return function(){var a=s(this,e),u=a.on;u!==i&&(o=(i=u).copy()).on(n,r),a.on=o}}function sv(e,n){var r=this._id;return arguments.length<2?Ge(this.node(),r).on.on(e):this.each(ov(r,e,n))}function av(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function uv(){return this.on("end.remove",av(this._id))}function cv(e){var n=this._name,r=this._id;typeof e!="function"&&(e=Gi(e));for(var i=this._groups,o=i.length,s=new Array(o),a=0;a<o;++a)for(var u=i[a],c=u.length,l=s[a]=new Array(c),h,f,d=0;d<c;++d)(h=u[d])&&(f=e.call(h,h.__data__,d,u))&&("__data__"in h&&(f.__data__=h.__data__),l[d]=f,kr(l[d],n,r,d,l,Ge(h,r)));return new lt(s,this._parents,n,r)}function lv(e){var n=this._name,r=this._id;typeof e!="function"&&(e=Ja(e));for(var i=this._groups,o=i.length,s=[],a=[],u=0;u<o;++u)for(var c=i[u],l=c.length,h,f=0;f<l;++f)if(h=c[f]){for(var d=e.call(h,h.__data__,f,c),p,g=Ge(h,r),_=0,y=d.length;_<y;++_)(p=d[_])&&kr(p,n,r,_,d,g);s.push(d),a.push(h)}return new lt(s,a,n,r)}var fv=Pn.prototype.constructor;function hv(){return new fv(this._groups,this._parents)}function dv(e,n){var r,i,o;return function(){var s=Ut(this,e),a=(this.style.removeProperty(e),Ut(this,e));return s===a?null:s===r&&a===i?o:o=n(r=s,i=a)}}function gu(e){return function(){this.style.removeProperty(e)}}function pv(e,n,r){var i,o=r+"",s;return function(){var a=Ut(this,e);return a===o?null:a===i?s:s=n(i=a,r)}}function gv(e,n,r){var i,o,s;return function(){var a=Ut(this,e),u=r(this),c=u+"";return u==null&&(c=u=(this.style.removeProperty(e),Ut(this,e))),a===c?null:a===i&&c===o?s:(o=c,s=n(i=a,u))}}function mv(e,n){var r,i,o,s="style."+n,a="end."+s,u;return function(){var c=tt(this,e),l=c.on,h=c.value[s]==null?u||(u=gu(n)):void 0;(l!==r||o!==h)&&(i=(r=l).copy()).on(a,o=h),c.on=i}}function _v(e,n,r){var i=(e+="")=="transform"?wy:pu;return n==null?this.styleTween(e,dv(e,i)).on("end.style."+e,gu(e)):typeof n=="function"?this.styleTween(e,gv(e,i,Qi(this,"style."+e,n))).each(mv(this._id,e)):this.styleTween(e,pv(e,i,n),r).on("end.style."+e,null)}function yv(e,n,r){return function(i){this.style.setProperty(e,n.call(this,i),r)}}function vv(e,n,r){var i,o;function s(){var a=n.apply(this,arguments);return a!==o&&(i=(o=a)&&yv(e,a,r)),i}return s._value=n,s}function bv(e,n,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,vv(e,n,r??""))}function wv(e){return function(){this.textContent=e}}function xv(e){return function(){var n=e(this);this.textContent=n??""}}function kv(e){return this.tween("text",typeof e=="function"?xv(Qi(this,"text",e)):wv(e==null?"":e+""))}function Sv(e){return function(n){this.textContent=e.call(this,n)}}function zv(e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Sv(o)),n}return i._value=e,i}function Tv(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,zv(e))}function Cv(){for(var e=this._name,n=this._id,r=mu(),i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],u=a.length,c,l=0;l<u;++l)if(c=a[l]){var h=Ge(c,n);kr(c,e,r,l,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new lt(i,this._parents,e,r)}function Pv(){var e,n,r=this,i=r._id,o=r.size();return new Promise(function(s,a){var u={value:a},c={value:function(){--o===0&&s()}};r.each(function(){var l=tt(this,i),h=l.on;h!==e&&(n=(e=h).copy(),n._.cancel.push(u),n._.interrupt.push(u),n._.end.push(c)),l.on=n}),o===0&&s()})}var Ev=0;function lt(e,n,r,i){this._groups=e,this._parents=n,this._name=r,this._id=i}function mu(){return++Ev}var it=Pn.prototype;lt.prototype={constructor:lt,select:cv,selectAll:lv,selectChild:it.selectChild,selectChildren:it.selectChildren,filter:nv,merge:rv,selection:hv,transition:Cv,call:it.call,nodes:it.nodes,node:it.node,size:it.size,empty:it.empty,each:it.each,on:sv,attr:qy,attrTween:Vy,style:_v,styleTween:bv,text:kv,textTween:Tv,remove:uv,tween:Iy,delay:Jy,duration:Ky,ease:Qy,easeVarying:tv,end:Pv,[Symbol.iterator]:it[Symbol.iterator]};function Av(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Rv={time:null,delay:0,duration:250,ease:Av};function $v(e,n){for(var r;!(r=e.__transition)||!(r=r[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return r}function Iv(e){var n,r;e instanceof lt?(n=e._id,e=e._name):(n=mu(),(r=Rv).time=Wi(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],u=a.length,c,l=0;l<u;++l)(c=a[l])&&kr(c,e,n,l,a,r||$v(c,n));return new lt(i,this._parents,e,n)}Pn.prototype.interrupt=Ay;Pn.prototype.transition=Iv;const qn=e=>()=>e;function Mv(e,{sourceEvent:n,target:r,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function ut(e,n,r){this.k=e,this.x=n,this.y=r}ut.prototype={constructor:ut,scale:function(e){return e===1?this:new ut(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new ut(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var eo=new ut(1,0,0);Xe.prototype=ut.prototype;function Xe(e){for(;!e.__zoom;)if(!(e=e.parentNode))return eo;return e.__zoom}function Or(e){e.stopImmediatePropagation()}function Bt(e){e.preventDefault(),e.stopImmediatePropagation()}function Ov(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Nv(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function rs(){return this.__zoom||eo}function Dv(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function jv(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zv(e,n,r){var i=e.invertX(n[0][0])-r[0][0],o=e.invertX(n[1][0])-r[1][0],s=e.invertY(n[0][1])-r[0][1],a=e.invertY(n[1][1])-r[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function qv(){var e=Ov,n=Nv,r=Zv,i=Dv,o=jv,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],u=250,c=Ty,l=Cn("start","zoom","end"),h,f,d,p=500,g=150,_=0,y=10;function m(z){z.property("__zoom",rs).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",$).filter(o).on("touchstart.zoom",N).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(z,O,R,j){var F=z.selection?z.selection():z;F.property("__zoom",rs),z!==F?v(z,O,R,j):F.interrupt().each(function(){k(this,arguments).event(j).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},m.scaleBy=function(z,O,R,j){m.scaleTo(z,function(){var F=this.__zoom.k,q=typeof O=="function"?O.apply(this,arguments):O;return F*q},R,j)},m.scaleTo=function(z,O,R,j){m.transform(z,function(){var F=n.apply(this,arguments),q=this.__zoom,V=R==null?b(F):typeof R=="function"?R.apply(this,arguments):R,L=q.invert(V),W=typeof O=="function"?O.apply(this,arguments):O;return r(C(w(q,W),V,L),F,a)},R,j)},m.translateBy=function(z,O,R,j){m.transform(z,function(){return r(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof R=="function"?R.apply(this,arguments):R),n.apply(this,arguments),a)},null,j)},m.translateTo=function(z,O,R,j,F){m.transform(z,function(){var q=n.apply(this,arguments),V=this.__zoom,L=j==null?b(q):typeof j=="function"?j.apply(this,arguments):j;return r(eo.translate(L[0],L[1]).scale(V.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof R=="function"?-R.apply(this,arguments):-R),q,a)},j,F)};function w(z,O){return O=Math.max(s[0],Math.min(s[1],O)),O===z.k?z:new ut(O,z.x,z.y)}function C(z,O,R){var j=O[0]-R[0]*z.k,F=O[1]-R[1]*z.k;return j===z.x&&F===z.y?z:new ut(z.k,j,F)}function b(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function v(z,O,R,j){z.on("start.zoom",function(){k(this,arguments).event(j).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(j).end()}).tween("zoom",function(){var F=this,q=arguments,V=k(F,q).event(j),L=n.apply(F,q),W=R==null?b(L):typeof R=="function"?R.apply(F,q):R,ee=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),K=F.__zoom,he=typeof O=="function"?O.apply(F,q):O,nt=c(K.invert(W).concat(ee/K.k),he.invert(W).concat(ee/he.k));return function(Fe){if(Fe===1)Fe=he;else{var rt=nt(Fe),Cr=ee/rt[2];Fe=new ut(Cr,W[0]-rt[0]*Cr,W[1]-rt[1]*Cr)}V.zoom(null,Fe)}})}function k(z,O,R){return!R&&z.__zooming||new x(z,O)}function x(z,O){this.that=z,this.args=O,this.active=0,this.sourceEvent=null,this.extent=n.apply(z,O),this.taps=0}x.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,O){return this.mouse&&z!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var O=De(this.that).datum();l.call(z,this.that,new Mv(z,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:l}),O)}};function P(z,...O){if(!e.apply(this,arguments))return;var R=k(this,O).event(z),j=this.__zoom,F=Math.max(s[0],Math.min(s[1],j.k*Math.pow(2,i.apply(this,arguments)))),q=Ke(z);if(R.wheel)(R.mouse[0][0]!==q[0]||R.mouse[0][1]!==q[1])&&(R.mouse[1]=j.invert(R.mouse[0]=q)),clearTimeout(R.wheel);else{if(j.k===F)return;R.mouse=[q,j.invert(q)],Wn(this),R.start()}Bt(z),R.wheel=setTimeout(V,g),R.zoom("mouse",r(C(w(j,F),R.mouse[0],R.mouse[1]),R.extent,a));function V(){R.wheel=null,R.end()}}function M(z,...O){if(d||!e.apply(this,arguments))return;var R=z.currentTarget,j=k(this,O,!0).event(z),F=De(z.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",ee,!0),q=Ke(z,R),V=z.clientX,L=z.clientY;ou(z.view),Or(z),j.mouse=[q,this.__zoom.invert(q)],Wn(this),j.start();function W(K){if(Bt(K),!j.moved){var he=K.clientX-V,nt=K.clientY-L;j.moved=he*he+nt*nt>_}j.event(K).zoom("mouse",r(C(j.that.__zoom,j.mouse[0]=Ke(K,R),j.mouse[1]),j.extent,a))}function ee(K){F.on("mousemove.zoom mouseup.zoom",null),su(K.view,j.moved),Bt(K),j.event(K).end()}}function $(z,...O){if(e.apply(this,arguments)){var R=this.__zoom,j=Ke(z.changedTouches?z.changedTouches[0]:z,this),F=R.invert(j),q=R.k*(z.shiftKey?.5:2),V=r(C(w(R,q),j,F),n.apply(this,O),a);Bt(z),u>0?De(this).transition().duration(u).call(v,V,j,z):De(this).call(m.transform,V,j,z)}}function N(z,...O){if(e.apply(this,arguments)){var R=z.touches,j=R.length,F=k(this,O,z.changedTouches.length===j).event(z),q,V,L,W;for(Or(z),V=0;V<j;++V)L=R[V],W=Ke(L,this),W=[W,this.__zoom.invert(W),L.identifier],F.touch0?!F.touch1&&F.touch0[2]!==W[2]&&(F.touch1=W,F.taps=0):(F.touch0=W,q=!0,F.taps=1+!!h);h&&(h=clearTimeout(h)),q&&(F.taps<2&&(f=W[0],h=setTimeout(function(){h=null},p)),Wn(this),F.start())}}function D(z,...O){if(this.__zooming){var R=k(this,O).event(z),j=z.changedTouches,F=j.length,q,V,L,W;for(Bt(z),q=0;q<F;++q)V=j[q],L=Ke(V,this),R.touch0&&R.touch0[2]===V.identifier?R.touch0[0]=L:R.touch1&&R.touch1[2]===V.identifier&&(R.touch1[0]=L);if(V=R.that.__zoom,R.touch1){var ee=R.touch0[0],K=R.touch0[1],he=R.touch1[0],nt=R.touch1[1],Fe=(Fe=he[0]-ee[0])*Fe+(Fe=he[1]-ee[1])*Fe,rt=(rt=nt[0]-K[0])*rt+(rt=nt[1]-K[1])*rt;V=w(V,Math.sqrt(Fe/rt)),L=[(ee[0]+he[0])/2,(ee[1]+he[1])/2],W=[(K[0]+nt[0])/2,(K[1]+nt[1])/2]}else if(R.touch0)L=R.touch0[0],W=R.touch0[1];else return;R.zoom("touch",r(C(V,L,W),R.extent,a))}}function H(z,...O){if(this.__zooming){var R=k(this,O).event(z),j=z.changedTouches,F=j.length,q,V;for(Or(z),d&&clearTimeout(d),d=setTimeout(function(){d=null},p),q=0;q<F;++q)V=j[q],R.touch0&&R.touch0[2]===V.identifier?delete R.touch0:R.touch1&&R.touch1[2]===V.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(V=Ke(V,this),Math.hypot(f[0]-V[0],f[1]-V[1])<y)){var L=De(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return m.wheelDelta=function(z){return arguments.length?(i=typeof z=="function"?z:qn(+z),m):i},m.filter=function(z){return arguments.length?(e=typeof z=="function"?z:qn(!!z),m):e},m.touchable=function(z){return arguments.length?(o=typeof z=="function"?z:qn(!!z),m):o},m.extent=function(z){return arguments.length?(n=typeof z=="function"?z:qn([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),m):n},m.scaleExtent=function(z){return arguments.length?(s[0]=+z[0],s[1]=+z[1],m):[s[0],s[1]]},m.translateExtent=function(z){return arguments.length?(a[0][0]=+z[0][0],a[1][0]=+z[1][0],a[0][1]=+z[0][1],a[1][1]=+z[1][1],m):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},m.constrain=function(z){return arguments.length?(r=z,m):r},m.duration=function(z){return arguments.length?(u=+z,m):u},m.interpolate=function(z){return arguments.length?(c=z,m):c},m.on=function(){var z=l.on.apply(l,arguments);return z===l?m:z},m.clickDistance=function(z){return arguments.length?(_=(z=+z)*z,m):Math.sqrt(_)},m.tapDistance=function(z){return arguments.length?(y=+z,m):y},m}class is extends Map{constructor(n,r=Fv){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),n!=null)for(const[i,o]of n)this.set(i,o)}get(n){return super.get(os(this,n))}has(n){return super.has(os(this,n))}set(n,r){return super.set(Uv(this,n),r)}delete(n){return super.delete(Lv(this,n))}}function os({_intern:e,_key:n},r){const i=n(r);return e.has(i)?e.get(i):r}function Uv({_intern:e,_key:n},r){const i=n(r);return e.has(i)?e.get(i):(e.set(i,r),r)}function Lv({_intern:e,_key:n},r){const i=n(r);return e.has(i)&&(r=e.get(i),e.delete(i)),r}function Fv(e){return e!==null&&typeof e=="object"?e.valueOf():e}function ss(e,n){let r;if(n===void 0)for(const i of e)i!=null&&(r<i||r===void 0&&i>=i)&&(r=i);else{let i=-1;for(let o of e)(o=n(o,++i,e))!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}return r}function as(e,n){let r;if(n===void 0)for(const i of e)i!=null&&(r>i||r===void 0&&i>=i)&&(r=i);else{let i=-1;for(let o of e)(o=n(o,++i,e))!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}return r}function Hv(e,n){let r=0;for(let i of e)(i=+i)&&(r+=i);return r}var Vv=typeof global=="object"&&global&&global.Object===Object&&global,Bv=typeof self=="object"&&self&&self.Object===Object&&self,_u=Vv||Bv||Function("return this")(),sr=_u.Symbol,yu=Object.prototype,Wv=yu.hasOwnProperty,Jv=yu.toString,Wt=sr?sr.toStringTag:void 0;function Gv(e){var n=Wv.call(e,Wt),r=e[Wt];try{e[Wt]=void 0;var i=!0}catch{}var o=Jv.call(e);return i&&(n?e[Wt]=r:delete e[Wt]),o}var Xv=Object.prototype,Kv=Xv.toString;function Yv(e){return Kv.call(e)}var Qv="[object Null]",eb="[object Undefined]",us=sr?sr.toStringTag:void 0;function tb(e){return e==null?e===void 0?eb:Qv:us&&us in Object(e)?Gv(e):Yv(e)}function nb(e){return e!=null&&typeof e=="object"}var rb="[object Symbol]";function ib(e){return typeof e=="symbol"||nb(e)&&tb(e)==rb}var ob=/\s/;function sb(e){for(var n=e.length;n--&&ob.test(e.charAt(n)););return n}var ab=/^\s+/;function ub(e){return e&&e.slice(0,sb(e)+1).replace(ab,"")}function ar(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var cs=NaN,cb=/^[-+]0x[0-9a-f]+$/i,lb=/^0b[01]+$/i,fb=/^0o[0-7]+$/i,hb=parseInt;function ls(e){if(typeof e=="number")return e;if(ib(e))return cs;if(ar(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=ar(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ub(e);var r=lb.test(e);return r||fb.test(e)?hb(e.slice(2),r?2:8):cb.test(e)?cs:+e}var Nr=function(){return _u.Date.now()},db="Expected a function",pb=Math.max,gb=Math.min;function vu(e,n,r){var i,o,s,a,u,c,l=0,h=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(db);n=ls(n)||0,ar(r)&&(h=!!r.leading,f="maxWait"in r,s=f?pb(ls(r.maxWait)||0,n):s,d="trailing"in r?!!r.trailing:d);function p(k){var x=i,P=o;return i=o=void 0,l=k,a=e.apply(P,x),a}function g(k){return l=k,u=setTimeout(m,n),h?p(k):a}function _(k){var x=k-c,P=k-l,M=n-x;return f?gb(M,s-P):M}function y(k){var x=k-c,P=k-l;return c===void 0||x>=n||x<0||f&&P>=s}function m(){var k=Nr();if(y(k))return w(k);u=setTimeout(m,_(k))}function w(k){return u=void 0,d&&i?p(k):(i=o=void 0,a)}function C(){u!==void 0&&clearTimeout(u),l=0,i=c=o=u=void 0}function b(){return u===void 0?a:w(Nr())}function v(){var k=Nr(),x=y(k);if(i=arguments,o=this,c=k,x){if(u===void 0)return g(c);if(f)return clearTimeout(u),u=setTimeout(m,n),p(c)}return u===void 0&&(u=setTimeout(m,n)),a}return v.cancel=C,v.flush=b,v}var mb="Expected a function";function _b(e,n,r){var i=!0,o=!0;if(typeof e!="function")throw new TypeError(mb);return ar(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),vu(e,n,{leading:i,maxWait:n,trailing:o})}var Tt=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Tt.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Tt.Bounce.In(e*2)*.5:Tt.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(n){return Math.pow(n,e)},Out:function(n){return 1-Math.pow(1-n,e)},InOut:function(n){return n<.5?Math.pow(n*2,e)/2:(1-Math.pow(2-n*2,e))/2+.5}}}}),nn=function(){return performance.now()},bu=(function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(r){return n._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(n){this._tweens[n.getId()]=n,this._tweensAddedDuringUpdate[n.getId()]=n},e.prototype.remove=function(n){delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]},e.prototype.update=function(n,r){n===void 0&&(n=nn()),r===void 0&&(r=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var s=this._tweens[i[o]],a=!r;s&&s.update(n,a)===!1&&!r&&delete this._tweens[i[o]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},e})(),ei={Linear:function(e,n){var r=e.length-1,i=r*n,o=Math.floor(i),s=ei.Utils.Linear;return n<0?s(e[0],e[1],i):n>1?s(e[r],e[r-1],r-i):s(e[o],e[o+1>r?r:o+1],i-o)},Utils:{Linear:function(e,n,r){return(n-e)*r+e}}},wu=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),ti=new bu,fs=(function(){function e(n,r){r===void 0&&(r=ti),this._object=n,this._group=r,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Tt.Linear.None,this._interpolationFunction=ei.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=wu.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(n,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=n,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(n){return n===void 0&&(n=1e3),this._duration=n<0?0:n,this},e.prototype.dynamic=function(n){return n===void 0&&(n=!1),this._isDynamic=n,this},e.prototype.start=function(n,r){if(n===void 0&&(n=nn()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var s in this._valuesEnd)o[s]=this._valuesEnd[s];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(n){return this.start(n,!0)},e.prototype._setupProperties=function(n,r,i,o,s){for(var a in i){var u=n[a],c=Array.isArray(u),l=c?"array":typeof u,h=!c&&Array.isArray(i[a]);if(!(l==="undefined"||l==="function")){if(h){var f=i[a];if(f.length===0)continue;for(var d=[u],p=0,g=f.length;p<g;p+=1){var _=this._handleRelativeValue(u,f[p]);if(isNaN(_)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}d.push(_)}h&&(i[a]=d)}if((l==="object"||c)&&u&&!h){r[a]=c?[]:{};var y=u;for(var m in y)r[a][m]=y[m];o[a]=c?[]:{};var f=i[a];if(!this._isDynamic){var w={};for(var m in f)w[m]=f[m];i[a]=f=w}this._setupProperties(y,r[a],f,o[a],s)}else(typeof r[a]>"u"||s)&&(r[a]=u),c||(r[a]*=1),h?o[a]=i[a].slice().reverse():o[a]=r[a]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(n){return n===void 0&&(n=nn()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this._group&&this._group.remove(this),this)},e.prototype.resume=function(n){return n===void 0&&(n=nn()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var n=0,r=this._chainedTweens.length;n<r;n++)this._chainedTweens[n].stop();return this},e.prototype.group=function(n){return n===void 0&&(n=ti),this._group=n,this},e.prototype.delay=function(n){return n===void 0&&(n=0),this._delayTime=n,this},e.prototype.repeat=function(n){return n===void 0&&(n=0),this._initialRepeat=n,this._repeat=n,this},e.prototype.repeatDelay=function(n){return this._repeatDelayTime=n,this},e.prototype.yoyo=function(n){return n===void 0&&(n=!1),this._yoyo=n,this},e.prototype.easing=function(n){return n===void 0&&(n=Tt.Linear.None),this._easingFunction=n,this},e.prototype.interpolation=function(n){return n===void 0&&(n=ei.Linear),this._interpolationFunction=n,this},e.prototype.chain=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return this._chainedTweens=n,this},e.prototype.onStart=function(n){return this._onStartCallback=n,this},e.prototype.onEveryStart=function(n){return this._onEveryStartCallback=n,this},e.prototype.onUpdate=function(n){return this._onUpdateCallback=n,this},e.prototype.onRepeat=function(n){return this._onRepeatCallback=n,this},e.prototype.onComplete=function(n){return this._onCompleteCallback=n,this},e.prototype.onStop=function(n){return this._onStopCallback=n,this},e.prototype.update=function(n,r){var i=this,o;if(n===void 0&&(n=nn()),r===void 0&&(r=!0),this._isPaused)return!0;var s,a=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(n>a)return!1;r&&this.start(n,!0)}if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var u=n-this._startTime,c=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),l=this._duration+this._repeat*c,h=function(){if(i._duration===0||u>l)return 1;var y=Math.trunc(u/c),m=u-y*c,w=Math.min(m/i._duration,1);return w===0&&u===i._duration?1:w},f=h(),d=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||u>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((u-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,_=this._chainedTweens.length;g<_;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(n,r,i,o){for(var s in i)if(r[s]!==void 0){var a=r[s]||0,u=i[s],c=Array.isArray(n[s]),l=Array.isArray(u),h=!c&&l;h?n[s]=this._interpolationFunction(u,o):typeof u=="object"&&u?this._updateProperties(n[s],a,u,o):(u=this._handleRelativeValue(a,u),typeof u=="number"&&(n[s]=a+(u-a)*o))}},e.prototype._handleRelativeValue=function(n,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?n+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(n){var r=this._valuesStartRepeat[n],i=this._valuesEnd[n];typeof i=="string"?this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(i):this._valuesStartRepeat[n]=this._valuesEnd[n],this._valuesEnd[n]=r},e})();wu.nextId;var et=ti;et.getAll.bind(et);et.removeAll.bind(et);et.add.bind(et);et.remove.bind(et);et.update.bind(et);function hs(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function yb(e){if(Array.isArray(e))return e}function vb(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function bb(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function wb(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,s,a,u=[],c=!0,l=!1;try{if(s=(r=r.call(e)).next,n!==0)for(;!(c=(i=s.call(r)).done)&&(u.push(i.value),u.length!==n);c=!0);}catch(h){l=!0,o=h}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}function xb(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
85
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kb(e,n){return yb(e)||wb(e,n)||Sb(e,n)||xb()}function Sb(e,n){if(e){if(typeof e=="string")return hs(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hs(e,n):void 0}}var zb=bb(function e(n,r){var i=r.default,o=i===void 0?null:i,s=r.triggerUpdate,a=s===void 0?!0:s,u=r.onChange,c=u===void 0?function(l,h){}:u;vb(this,e),this.name=n,this.defaultVal=o,this.triggerUpdate=a,this.onChange=c});function to(e){var n=e.stateInit,r=n===void 0?function(){return{}}:n,i=e.props,o=i===void 0?{}:i,s=e.methods,a=s===void 0?{}:s,u=e.aliases,c=u===void 0?{}:u,l=e.init,h=l===void 0?function(){}:l,f=e.update,d=f===void 0?function(){}:f,p=Object.keys(o).map(function(g){return new zb(g,o[g])});return function g(){for(var _=arguments.length,y=new Array(_),m=0;m<_;m++)y[m]=arguments[m];var w=!!(this instanceof g&&this.constructor),C=w?y.shift():void 0,b=y[0],v=b===void 0?{}:b,k=Object.assign({},r instanceof Function?r(v):r,{initialised:!1}),x={};function P(N){return M(N,v),$(),P}var M=function(D,H){h.call(P,D,k,H),k.initialised=!0},$=vu(function(){k.initialised&&(d.call(P,k,x),x={})},1);return p.forEach(function(N){P[N.name]=D(N);function D(H){var z=H.name,O=H.triggerUpdate,R=O===void 0?!1:O,j=H.onChange,F=j===void 0?function(L,W){}:j,q=H.defaultVal,V=q===void 0?null:q;return function(L){var W=k[z];if(!arguments.length)return W;var ee=L===void 0?V:L;return k[z]=ee,F.call(P,ee,k,W),!x.hasOwnProperty(z)&&(x[z]=W),R&&$(),P}}}),Object.keys(a).forEach(function(N){P[N]=function(){for(var D,H=arguments.length,z=new Array(H),O=0;O<H;O++)z[O]=arguments[O];return(D=a[N]).call.apply(D,[P,k].concat(z))}}),Object.entries(c).forEach(function(N){var D=kb(N,2),H=D[0],z=D[1];return P[H]=P[z]}),P.resetProps=function(){return p.forEach(function(N){P[N.name](N.defaultVal)}),P},P.resetProps(),k._rerender=$,w&&C&&P(C),P}}var Y=(function(e){return typeof e=="function"?e:typeof e=="string"?function(n){return n[e]}:function(n){return e}});function ur(e){"@babel/helpers - typeof";return ur=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ur(e)}var Tb=/^\s+/,Cb=/\s+$/;function U(e,n){if(e=e||"",n=n||{},e instanceof U)return e;if(!(this instanceof U))return new U(e,n);var r=Pb(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}U.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var n=this.toRgb(),r,i,o,s,a,u;return r=n.r/255,i=n.g/255,o=n.b/255,r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),o<=.03928?u=o/12.92:u=Math.pow((o+.055)/1.055,2.4),.2126*s+.7152*a+.0722*u},setAlpha:function(n){return this._a=xu(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=ps(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=ps(this._r,this._g,this._b),r=Math.round(n.h*360),i=Math.round(n.s*100),o=Math.round(n.v*100);return this._a==1?"hsv("+r+", "+i+"%, "+o+"%)":"hsva("+r+", "+i+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var n=ds(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=ds(this._r,this._g,this._b),r=Math.round(n.h*360),i=Math.round(n.s*100),o=Math.round(n.l*100);return this._a==1?"hsl("+r+", "+i+"%, "+o+"%)":"hsla("+r+", "+i+"%, "+o+"%, "+this._roundA+")"},toHex:function(n){return gs(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return $b(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(ce(this._r,255)*100)+"%",g:Math.round(ce(this._g,255)*100)+"%",b:Math.round(ce(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(ce(this._r,255)*100)+"%, "+Math.round(ce(this._g,255)*100)+"%, "+Math.round(ce(this._b,255)*100)+"%)":"rgba("+Math.round(ce(this._r,255)*100)+"%, "+Math.round(ce(this._g,255)*100)+"%, "+Math.round(ce(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:Hb[gs(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var r="#"+ms(this._r,this._g,this._b,this._a),i=r,o=this._gradientType?"GradientType = 1, ":"";if(n){var s=U(n);i="#"+ms(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+r+",endColorstr="+i+")"},toString:function(n){var r=!!n;n=n||this._format;var i=!1,o=this._a<1&&this._a>=0,s=!r&&o&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return s?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(i=this.toRgbString()),n==="prgb"&&(i=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(i=this.toHexString()),n==="hex3"&&(i=this.toHexString(!0)),n==="hex4"&&(i=this.toHex8String(!0)),n==="hex8"&&(i=this.toHex8String()),n==="name"&&(i=this.toName()),n==="hsl"&&(i=this.toHslString()),n==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return U(this.toString())},_applyModification:function(n,r){var i=n.apply(null,[this].concat([].slice.call(r)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(Nb,arguments)},brighten:function(){return this._applyModification(Db,arguments)},darken:function(){return this._applyModification(jb,arguments)},desaturate:function(){return this._applyModification(Ib,arguments)},saturate:function(){return this._applyModification(Mb,arguments)},greyscale:function(){return this._applyModification(Ob,arguments)},spin:function(){return this._applyModification(Zb,arguments)},_applyCombination:function(n,r){return n.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(Lb,arguments)},complement:function(){return this._applyCombination(qb,arguments)},monochromatic:function(){return this._applyCombination(Fb,arguments)},splitcomplement:function(){return this._applyCombination(Ub,arguments)},triad:function(){return this._applyCombination(_s,[3])},tetrad:function(){return this._applyCombination(_s,[4])}};U.fromRatio=function(e,n){if(ur(e)=="object"){var r={};for(var i in e)e.hasOwnProperty(i)&&(i==="a"?r[i]=e[i]:r[i]=rn(e[i]));e=r}return U(e,n)};function Pb(e){var n={r:0,g:0,b:0},r=1,i=null,o=null,s=null,a=!1,u=!1;return typeof e=="string"&&(e=Jb(e)),ur(e)=="object"&&(ot(e.r)&&ot(e.g)&&ot(e.b)?(n=Eb(e.r,e.g,e.b),a=!0,u=String(e.r).substr(-1)==="%"?"prgb":"rgb"):ot(e.h)&&ot(e.s)&&ot(e.v)?(i=rn(e.s),o=rn(e.v),n=Rb(e.h,i,o),a=!0,u="hsv"):ot(e.h)&&ot(e.s)&&ot(e.l)&&(i=rn(e.s),s=rn(e.l),n=Ab(e.h,i,s),a=!0,u="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=xu(r),{ok:a,format:e.format||u,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function Eb(e,n,r){return{r:ce(e,255)*255,g:ce(n,255)*255,b:ce(r,255)*255}}function ds(e,n,r){e=ce(e,255),n=ce(n,255),r=ce(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),s,a,u=(i+o)/2;if(i==o)s=a=0;else{var c=i-o;switch(a=u>.5?c/(2-i-o):c/(i+o),i){case e:s=(n-r)/c+(n<r?6:0);break;case n:s=(r-e)/c+2;break;case r:s=(e-n)/c+4;break}s/=6}return{h:s,s:a,l:u}}function Ab(e,n,r){var i,o,s;e=ce(e,360),n=ce(n,100),r=ce(r,100);function a(l,h,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?l+(h-l)*6*f:f<1/2?h:f<2/3?l+(h-l)*(2/3-f)*6:l}if(n===0)i=o=s=r;else{var u=r<.5?r*(1+n):r+n-r*n,c=2*r-u;i=a(c,u,e+1/3),o=a(c,u,e),s=a(c,u,e-1/3)}return{r:i*255,g:o*255,b:s*255}}function ps(e,n,r){e=ce(e,255),n=ce(n,255),r=ce(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),s,a,u=i,c=i-o;if(a=i===0?0:c/i,i==o)s=0;else{switch(i){case e:s=(n-r)/c+(n<r?6:0);break;case n:s=(r-e)/c+2;break;case r:s=(e-n)/c+4;break}s/=6}return{h:s,s:a,v:u}}function Rb(e,n,r){e=ce(e,360)*6,n=ce(n,100),r=ce(r,100);var i=Math.floor(e),o=e-i,s=r*(1-n),a=r*(1-o*n),u=r*(1-(1-o)*n),c=i%6,l=[r,a,s,s,u,r][c],h=[u,r,r,a,s,s][c],f=[s,s,u,r,r,a][c];return{r:l*255,g:h*255,b:f*255}}function gs(e,n,r,i){var o=[Je(Math.round(e).toString(16)),Je(Math.round(n).toString(16)),Je(Math.round(r).toString(16))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function $b(e,n,r,i,o){var s=[Je(Math.round(e).toString(16)),Je(Math.round(n).toString(16)),Je(Math.round(r).toString(16)),Je(ku(i))];return o&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function ms(e,n,r,i){var o=[Je(ku(i)),Je(Math.round(e).toString(16)),Je(Math.round(n).toString(16)),Je(Math.round(r).toString(16))];return o.join("")}U.equals=function(e,n){return!e||!n?!1:U(e).toRgbString()==U(n).toRgbString()};U.random=function(){return U.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Ib(e,n){n=n===0?0:n||10;var r=U(e).toHsl();return r.s-=n/100,r.s=Sr(r.s),U(r)}function Mb(e,n){n=n===0?0:n||10;var r=U(e).toHsl();return r.s+=n/100,r.s=Sr(r.s),U(r)}function Ob(e){return U(e).desaturate(100)}function Nb(e,n){n=n===0?0:n||10;var r=U(e).toHsl();return r.l+=n/100,r.l=Sr(r.l),U(r)}function Db(e,n){n=n===0?0:n||10;var r=U(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(n/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(n/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(n/100)))),U(r)}function jb(e,n){n=n===0?0:n||10;var r=U(e).toHsl();return r.l-=n/100,r.l=Sr(r.l),U(r)}function Zb(e,n){var r=U(e).toHsl(),i=(r.h+n)%360;return r.h=i<0?360+i:i,U(r)}function qb(e){var n=U(e).toHsl();return n.h=(n.h+180)%360,U(n)}function _s(e,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var r=U(e).toHsl(),i=[U(e)],o=360/n,s=1;s<n;s++)i.push(U({h:(r.h+s*o)%360,s:r.s,l:r.l}));return i}function Ub(e){var n=U(e).toHsl(),r=n.h;return[U(e),U({h:(r+72)%360,s:n.s,l:n.l}),U({h:(r+216)%360,s:n.s,l:n.l})]}function Lb(e,n,r){n=n||6,r=r||30;var i=U(e).toHsl(),o=360/r,s=[U(e)];for(i.h=(i.h-(o*n>>1)+720)%360;--n;)i.h=(i.h+o)%360,s.push(U(i));return s}function Fb(e,n){n=n||6;for(var r=U(e).toHsv(),i=r.h,o=r.s,s=r.v,a=[],u=1/n;n--;)a.push(U({h:i,s:o,v:s})),s=(s+u)%1;return a}U.mix=function(e,n,r){r=r===0?0:r||50;var i=U(e).toRgb(),o=U(n).toRgb(),s=r/100,a={r:(o.r-i.r)*s+i.r,g:(o.g-i.g)*s+i.g,b:(o.b-i.b)*s+i.b,a:(o.a-i.a)*s+i.a};return U(a)};U.readability=function(e,n){var r=U(e),i=U(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)};U.isReadable=function(e,n,r){var i=U.readability(e,n),o,s;switch(s=!1,o=Gb(r),o.level+o.size){case"AAsmall":case"AAAlarge":s=i>=4.5;break;case"AAlarge":s=i>=3;break;case"AAAsmall":s=i>=7;break}return s};U.mostReadable=function(e,n,r){var i=null,o=0,s,a,u,c;r=r||{},a=r.includeFallbackColors,u=r.level,c=r.size;for(var l=0;l<n.length;l++)s=U.readability(e,n[l]),s>o&&(o=s,i=U(n[l]));return U.isReadable(e,i,{level:u,size:c})||!a?i:(r.includeFallbackColors=!1,U.mostReadable(e,["#fff","#000"],r))};var ni=U.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Hb=U.hexNames=Vb(ni);function Vb(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function xu(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ce(e,n){Bb(e)&&(e="100%");var r=Wb(e);return e=Math.min(n,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),Math.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function Sr(e){return Math.min(1,Math.max(0,e))}function Ee(e){return parseInt(e,16)}function Bb(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Wb(e){return typeof e=="string"&&e.indexOf("%")!=-1}function Je(e){return e.length==1?"0"+e:""+e}function rn(e){return e<=1&&(e=e*100+"%"),e}function ku(e){return Math.round(parseFloat(e)*255).toString(16)}function ys(e){return Ee(e)/255}var He=(function(){var e="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",r="(?:"+n+")|(?:"+e+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function ot(e){return!!He.CSS_UNIT.exec(e)}function Jb(e){e=e.replace(Tb,"").replace(Cb,"").toLowerCase();var n=!1;if(ni[e])e=ni[e],n=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=He.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=He.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=He.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=He.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=He.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=He.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=He.hex8.exec(e))?{r:Ee(r[1]),g:Ee(r[2]),b:Ee(r[3]),a:ys(r[4]),format:n?"name":"hex8"}:(r=He.hex6.exec(e))?{r:Ee(r[1]),g:Ee(r[2]),b:Ee(r[3]),format:n?"name":"hex"}:(r=He.hex4.exec(e))?{r:Ee(r[1]+""+r[1]),g:Ee(r[2]+""+r[2]),b:Ee(r[3]+""+r[3]),a:ys(r[4]+""+r[4]),format:n?"name":"hex8"}:(r=He.hex3.exec(e))?{r:Ee(r[1]+""+r[1]),g:Ee(r[2]+""+r[2]),b:Ee(r[3]+""+r[3]),format:n?"name":"hex"}:!1}function Gb(e){var n,r;return e=e||{level:"AA",size:"small"},n=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:n,size:r}}function ri(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function Xb(e){if(Array.isArray(e))return ri(e)}function Su(e,n,r){if(typeof e=="function"?e===n:e.has(n))return arguments.length<3?n:r;throw new TypeError("Private element is not present on this object")}function Kb(e,n){if(n.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yb(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Me(e,n){return e.get(Su(e,n))}function vs(e,n,r){Kb(e,n),n.set(e,r)}function bs(e,n,r){return e.set(Su(e,n),r),r}function Qb(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o1(i.key),i)}}function e1(e,n,r){return n&&Qb(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function t1(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function n1(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
86
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r1(e){return Xb(e)||t1(e)||s1(e)||n1()}function i1(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function o1(e){var n=i1(e,"string");return typeof n=="symbol"?n:n+""}function s1(e,n){if(e){if(typeof e=="string")return ri(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ri(e,n):void 0}}var a1=123,u1=function(n){return"#".concat(Math.min(n,Math.pow(2,24)).toString(16).padStart(6,"0"))},zu=function(n,r,i){return(n<<16)+(r<<8)+i},c1=function(n){var r=U(n).toRgb(),i=r.r,o=r.g,s=r.b;return zu(i,o,s)},ws=function(n,r){return n*a1%Math.pow(2,r)},wt=new WeakMap,st=new WeakMap,l1=(function(){function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6;Yb(this,e),vs(this,wt,void 0),vs(this,st,void 0),bs(st,this,n),this.reset()}return e1(e,[{key:"reset",value:function(){bs(wt,this,["__reserved for background__"])}},{key:"register",value:function(r){if(Me(wt,this).length>=Math.pow(2,24-Me(st,this)))return null;var i=Me(wt,this).length,o=ws(i,Me(st,this)),s=u1(i+(o<<24-Me(st,this)));return Me(wt,this).push(r),s}},{key:"lookup",value:function(r){if(!r)return null;var i=typeof r=="string"?c1(r):zu.apply(void 0,r1(r));if(!i)return null;var o=i&Math.pow(2,24-Me(st,this))-1,s=i>>24-Me(st,this)&Math.pow(2,Me(st,this))-1;return ws(o,Me(st,this))!==s||o>=Me(wt,this).length?null:Me(wt,this)[o]}}])})(),An,le,Tu,Cu,kt,xs,Pu,Eu,Au,no,ii,oi,_n={},Ru=[],f1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,zr=Array.isArray;function Ye(e,n){for(var r in n)e[r]=n[r];return e}function ro(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function h1(e,n,r){var i,o,s,a={};for(s in n)s=="key"?i=n[s]:s=="ref"?o=n[s]:a[s]=n[s];if(arguments.length>2&&(a.children=arguments.length>3?An.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)a[s]===void 0&&(a[s]=e.defaultProps[s]);return sn(e,a,i,o,null)}function sn(e,n,r,i,o){var s={type:e,props:n,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Tu,__i:-1,__u:0};return o==null&&le.vnode!=null&&le.vnode(s),s}function Tr(e){return e.children}function Jn(e,n){this.props=e,this.context=n}function Lt(e,n){if(n==null)return e.__?Lt(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Lt(e):null}function $u(e){var n,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,n=0;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return $u(e)}}function ks(e){(!e.__d&&(e.__d=!0)&&kt.push(e)&&!cr.__r++||xs!=le.debounceRendering)&&((xs=le.debounceRendering)||Pu)(cr)}function cr(){for(var e,n,r,i,o,s,a,u=1;kt.length;)kt.length>u&&kt.sort(Eu),e=kt.shift(),u=kt.length,e.__d&&(r=void 0,i=void 0,o=(i=(n=e).__v).__e,s=[],a=[],n.__P&&((r=Ye({},i)).__v=i.__v+1,le.vnode&&le.vnode(r),io(n.__P,r,i,n.__n,n.__P.namespaceURI,32&i.__u?[o]:null,s,o??Lt(i),!!(32&i.__u),a),r.__v=i.__v,r.__.__k[r.__i]=r,Ou(s,r,a),i.__e=i.__=null,r.__e!=o&&$u(r)));cr.__r=0}function Iu(e,n,r,i,o,s,a,u,c,l,h){var f,d,p,g,_,y,m,w=i&&i.__k||Ru,C=n.length;for(c=d1(r,n,w,c,C),f=0;f<C;f++)(p=r.__k[f])!=null&&(d=p.__i==-1?_n:w[p.__i]||_n,p.__i=f,y=io(e,p,d,o,s,a,u,c,l,h),g=p.__e,p.ref&&d.ref!=p.ref&&(d.ref&&oo(d.ref,null,p),h.push(p.ref,p.__c||g,p)),_==null&&g!=null&&(_=g),(m=!!(4&p.__u))||d.__k===p.__k?c=Mu(p,c,e,m):typeof p.type=="function"&&y!==void 0?c=y:g&&(c=g.nextSibling),p.__u&=-7);return r.__e=_,c}function d1(e,n,r,i,o){var s,a,u,c,l,h=r.length,f=h,d=0;for(e.__k=new Array(o),s=0;s<o;s++)(a=n[s])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[s]=sn(null,a,null,null,null):zr(a)?a=e.__k[s]=sn(Tr,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[s]=sn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[s]=a,c=s+d,a.__=e,a.__b=e.__b+1,u=null,(l=a.__i=p1(a,r,c,f))!=-1&&(f--,(u=r[l])&&(u.__u|=2)),u==null||u.__v==null?(l==-1&&(o>h?d--:o<h&&d++),typeof a.type!="function"&&(a.__u|=4)):l!=c&&(l==c-1?d--:l==c+1?d++:(l>c?d--:d++,a.__u|=4))):e.__k[s]=null;if(f)for(s=0;s<h;s++)(u=r[s])!=null&&(2&u.__u)==0&&(u.__e==i&&(i=Lt(u)),Du(u,u));return i}function Mu(e,n,r,i){var o,s;if(typeof e.type=="function"){for(o=e.__k,s=0;o&&s<o.length;s++)o[s]&&(o[s].__=e,n=Mu(o[s],n,r,i));return n}e.__e!=n&&(i&&(n&&e.type&&!n.parentNode&&(n=Lt(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function p1(e,n,r,i){var o,s,a,u=e.key,c=e.type,l=n[r],h=l!=null&&(2&l.__u)==0;if(l===null&&u==null||h&&u==l.key&&c==l.type)return r;if(i>(h?1:0)){for(o=r-1,s=r+1;o>=0||s<n.length;)if((l=n[a=o>=0?o--:s++])!=null&&(2&l.__u)==0&&u==l.key&&c==l.type)return a}return-1}function Ss(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||f1.test(n)?r:r+"px"}function Un(e,n,r,i,o){var s,a;e:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(n in i)r&&n in r||Ss(e.style,n,"");if(r)for(n in r)i&&r[n]==i[n]||Ss(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")s=n!=(n=n.replace(Au,"$1")),a=n.toLowerCase(),n=a in e||n=="onFocusOut"||n=="onFocusIn"?a.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+s]=r,r?i?r.u=i.u:(r.u=no,e.addEventListener(n,s?oi:ii,s)):e.removeEventListener(n,s?oi:ii,s);else{if(o=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function zs(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n.t==null)n.t=no++;else if(n.t<r.u)return;return r(le.event?le.event(n):n)}}}function io(e,n,r,i,o,s,a,u,c,l){var h,f,d,p,g,_,y,m,w,C,b,v,k,x,P,M,$,N=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),s=[u=n.__e=r.__e]),(h=le.__b)&&h(n);e:if(typeof N=="function")try{if(m=n.props,w="prototype"in N&&N.prototype.render,C=(h=N.contextType)&&i[h.__c],b=h?C?C.props.value:h.__:i,r.__c?y=(f=n.__c=r.__c).__=f.__E:(w?n.__c=f=new N(m,b):(n.__c=f=new Jn(m,b),f.constructor=N,f.render=m1),C&&C.sub(f),f.state||(f.state={}),f.__n=i,d=f.__d=!0,f.__h=[],f._sb=[]),w&&f.__s==null&&(f.__s=f.state),w&&N.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Ye({},f.__s)),Ye(f.__s,N.getDerivedStateFromProps(m,f.__s))),p=f.props,g=f.state,f.__v=n,d)w&&N.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),w&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(w&&N.getDerivedStateFromProps==null&&m!==p&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(m,b),n.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(m,f.__s,b)===!1){for(n.__v!=r.__v&&(f.props=m,f.state=f.__s,f.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(D){D&&(D.__=n)}),v=0;v<f._sb.length;v++)f.__h.push(f._sb[v]);f._sb=[],f.__h.length&&a.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(m,f.__s,b),w&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(p,g,_)})}if(f.context=b,f.props=m,f.__P=e,f.__e=!1,k=le.__r,x=0,w){for(f.state=f.__s,f.__d=!1,k&&k(n),h=f.render(f.props,f.state,f.context),P=0;P<f._sb.length;P++)f.__h.push(f._sb[P]);f._sb=[]}else do f.__d=!1,k&&k(n),h=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++x<25);f.state=f.__s,f.getChildContext!=null&&(i=Ye(Ye({},i),f.getChildContext())),w&&!d&&f.getSnapshotBeforeUpdate!=null&&(_=f.getSnapshotBeforeUpdate(p,g)),M=h,h!=null&&h.type===Tr&&h.key==null&&(M=Nu(h.props.children)),u=Iu(e,zr(M)?M:[M],n,r,i,o,s,a,u,c,l),f.base=n.__e,n.__u&=-161,f.__h.length&&a.push(f),y&&(f.__E=f.__=null)}catch(D){if(n.__v=null,c||s!=null)if(D.then){for(n.__u|=c?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;s[s.indexOf(u)]=null,n.__e=u}else{for($=s.length;$--;)ro(s[$]);si(n)}else n.__e=r.__e,n.__k=r.__k,D.then||si(n);le.__e(D,n,r)}else s==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):u=n.__e=g1(r.__e,n,r,i,o,s,a,c,l);return(h=le.diffed)&&h(n),128&n.__u?void 0:u}function si(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(si)}function Ou(e,n,r){for(var i=0;i<r.length;i++)oo(r[i],r[++i],r[++i]);le.__c&&le.__c(n,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(s){s.call(o)})}catch(s){le.__e(s,o.__v)}})}function Nu(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:zr(e)?e.map(Nu):Ye({},e)}function g1(e,n,r,i,o,s,a,u,c){var l,h,f,d,p,g,_,y=r.props||_n,m=n.props,w=n.type;if(w=="svg"?o="http://www.w3.org/2000/svg":w=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),s!=null){for(l=0;l<s.length;l++)if((p=s[l])&&"setAttribute"in p==!!w&&(w?p.localName==w:p.nodeType==3)){e=p,s[l]=null;break}}if(e==null){if(w==null)return document.createTextNode(m);e=document.createElementNS(o,w,m.is&&m),u&&(le.__m&&le.__m(n,s),u=!1),s=null}if(w==null)y===m||u&&e.data==m||(e.data=m);else{if(s=s&&An.call(e.childNodes),!u&&s!=null)for(y={},l=0;l<e.attributes.length;l++)y[(p=e.attributes[l]).name]=p.value;for(l in y)if(p=y[l],l!="children"){if(l=="dangerouslySetInnerHTML")f=p;else if(!(l in m)){if(l=="value"&&"defaultValue"in m||l=="checked"&&"defaultChecked"in m)continue;Un(e,l,null,p,o)}}for(l in m)p=m[l],l=="children"?d=p:l=="dangerouslySetInnerHTML"?h=p:l=="value"?g=p:l=="checked"?_=p:u&&typeof p!="function"||y[l]===p||Un(e,l,p,y[l],o);if(h)u||f&&(h.__html==f.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),n.__k=[];else if(f&&(e.innerHTML=""),Iu(n.type=="template"?e.content:e,zr(d)?d:[d],n,r,i,w=="foreignObject"?"http://www.w3.org/1999/xhtml":o,s,a,s?s[0]:r.__k&&Lt(r,0),u,c),s!=null)for(l=s.length;l--;)ro(s[l]);u||(l="value",w=="progress"&&g==null?e.removeAttribute("value"):g!=null&&(g!==e[l]||w=="progress"&&!g||w=="option"&&g!=y[l])&&Un(e,l,g,y[l],o),l="checked",_!=null&&_!=e[l]&&Un(e,l,_,y[l],o))}return e}function oo(e,n,r){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(o){le.__e(o,r)}}function Du(e,n,r){var i,o;if(le.unmount&&le.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||oo(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){le.__e(s,n)}i.base=i.__P=null}if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&Du(i[o],n,r||typeof e.type!="function");r||ro(e.__e),e.__c=e.__=e.__e=void 0}function m1(e,n,r){return this.constructor(e,r)}function _1(e,n,r){var i,o,s,a;n==document&&(n=document.documentElement),le.__&&le.__(e,n),o=(i=!1)?null:n.__k,s=[],a=[],io(n,e=n.__k=h1(Tr,null,[e]),o||_n,_n,n.namespaceURI,o?null:n.firstChild?An.call(n.childNodes):null,s,o?o.__e:n.firstChild,i,a),Ou(s,e,a)}function ju(e,n,r){var i,o,s,a,u=Ye({},e.props);for(s in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),n)s=="key"?i=n[s]:s=="ref"?o=n[s]:u[s]=n[s]===void 0&&a!=null?a[s]:n[s];return arguments.length>2&&(u.children=arguments.length>3?An.call(arguments,2):r),sn(e.type,u,i||e.key,o||e.ref,null)}An=Ru.slice,le={__e:function(e,n,r,i){for(var o,s,a;n=n.__;)if((o=n.__c)&&!o.__)try{if((s=o.constructor)&&s.getDerivedStateFromError!=null&&(o.setState(s.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,i||{}),a=o.__d),a)return o.__E=o}catch(u){e=u}throw e}},Tu=0,Cu=function(e){return e!=null&&e.constructor===void 0},Jn.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ye({},this.state),typeof e=="function"&&(e=e(Ye({},r),this.props)),e&&Ye(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),ks(this))},Jn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ks(this))},Jn.prototype.render=Tr,kt=[],Pu=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Eu=function(e,n){return e.__v.__b-n.__v.__b},cr.__r=0,Au=/(PointerCapture)$|Capture$/i,no=0,ii=zs(!1),oi=zs(!0);function Ts(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function y1(e){if(Array.isArray(e))return e}function v1(e,n,r){return(n=z1(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function b1(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,s,a,u=[],c=!0,l=!1;try{if(s=(r=r.call(e)).next,n!==0)for(;!(c=(i=s.call(r)).done)&&(u.push(i.value),u.length!==n);c=!0);}catch(h){l=!0,o=h}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}function w1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
87
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cs(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function x1(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Cs(Object(r),!0).forEach(function(i){v1(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cs(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function k1(e,n){return y1(e)||b1(e,n)||T1(e,n)||w1()}function S1(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function z1(e){var n=S1(e,"string");return typeof n=="symbol"?n:n+""}function lr(e){"@babel/helpers - typeof";return lr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},lr(e)}function T1(e,n){if(e){if(typeof e=="string")return Ts(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ts(e,n):void 0}}var ai=function(n){if(lr(n)!=="object")return n;var r=ju(n);if(r.props){var i;r.props=x1({},r.props),r!=null&&(i=r.props)!==null&&i!==void 0&&i.children&&(r.props.children=Array.isArray(r.props.children)?r.props.children.map(ai):ai(r.props.children))}return r},C1=function(n){return Cu(ju(n))},P1=function(n,r){delete r.__k,_1(ai(n),r)};function E1(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r==="top"&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var A1=`.float-tooltip-kap {
127
88
  position: absolute;
128
89
  width: max-content; /* prevent shrinking near right edge */
129
90
  max-width: max(50%, 150px);
@@ -134,9 +95,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
134
95
  background: rgba(0,0,0,0.6);
135
96
  pointer-events: none;
136
97
  }
137
- `;RE(ME);var LE=jl({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=o.style,a=i===void 0?{}:i,s=!!n&&Yi(n)==="object"&&!!n.node&&typeof n.node=="function",u=it(s?n.node():n);u.style("position")==="static"&&u.style("position","relative"),r.tooltipEl=u.append("div").attr("class","float-tooltip-kap"),Object.entries(a).forEach(function(c){var d=UE(c,2),f=d[0],h=d[1];return r.tooltipEl.style(f,h)}),r.tooltipEl.style("left","-10000px").style("display","none");var l="tooltip-".concat(Math.round(Math.random()*1e12));r.mouseInside=!1,u.on("mousemove.".concat(l),function(c){r.mouseInside=!0;var d=kt(c),f=u.node(),h=f.offsetWidth,p=f.offsetHeight,m=[r.offsetX===null||r.offsetX===void 0?"-".concat(d[0]/h*100,"%"):typeof r.offsetX=="number"?"calc(-50% + ".concat(r.offsetX,"px)"):r.offsetX,r.offsetY===null||r.offsetY===void 0?p>130&&p-d[1]<100?"calc(-100% - 6px)":"21px":typeof r.offsetY=="number"?r.offsetY<0?"calc(-100% - ".concat(Math.abs(r.offsetY),"px)"):"".concat(r.offsetY,"px"):r.offsetY];r.tooltipEl.style("left",d[0]+"px").style("top",d[1]+"px").style("transform","translate(".concat(m.join(","),")")),r.content&&r.tooltipEl.style("display","inline")}),u.on("mouseover.".concat(l),function(){r.mouseInside=!0,r.content&&r.tooltipEl.style("display","inline")}),u.on("mouseout.".concat(l),function(){r.mouseInside=!1,r.tooltipEl.style("display","none")})},update:function(n){n.tooltipEl.style("display",n.content&&n.mouseInside?"inline":"none"),n.content?n.content instanceof HTMLElement?(n.tooltipEl.text(""),n.tooltipEl.append(function(){return n.content})):typeof n.content=="string"?n.tooltipEl.html(n.content):CE(n.content)?(n.tooltipEl.text(""),DE(n.content,n.tooltipEl.node())):(n.tooltipEl.style("display","none"),console.warn("Tooltip content is invalid, skipping.",n.content,n.content.toString())):n.tooltipEl.text("")}});const{abs:Bn,cos:At,sin:$n,acos:FE,atan2:Xn,sqrt:qt,pow:nt}=Math;function Kn(e){return e<0?-nt(-e,1/3):nt(e,1/3)}const wy=Math.PI,$i=2*wy,Jt=wy/2,qE=1e-6,va=Number.MAX_SAFE_INTEGER||9007199254740991,_a=Number.MIN_SAFE_INTEGER||-9007199254740991,JE={x:0,y:0,z:0},j={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(e,n){const r=n(e);let o=r.x*r.x+r.y*r.y;return typeof r.z<"u"&&(o+=r.z*r.z),qt(o)},compute:function(e,n,r){if(e===0)return n[0].t=0,n[0];const o=n.length-1;if(e===1)return n[o].t=1,n[o];const i=1-e;let a=n;if(o===0)return n[0].t=e,n[0];if(o===1){const u={x:i*a[0].x+e*a[1].x,y:i*a[0].y+e*a[1].y,t:e};return r&&(u.z=i*a[0].z+e*a[1].z),u}if(o<4){let u=i*i,l=e*e,c,d,f,h=0;o===2?(a=[a[0],a[1],a[2],JE],c=u,d=i*e*2,f=l):o===3&&(c=u*i,d=u*e*3,f=i*l*3,h=e*l);const p={x:c*a[0].x+d*a[1].x+f*a[2].x+h*a[3].x,y:c*a[0].y+d*a[1].y+f*a[2].y+h*a[3].y,t:e};return r&&(p.z=c*a[0].z+d*a[1].z+f*a[2].z+h*a[3].z),p}const s=JSON.parse(JSON.stringify(n));for(;s.length>1;){for(let u=0;u<s.length-1;u++)s[u]={x:s[u].x+(s[u+1].x-s[u].x)*e,y:s[u].y+(s[u+1].y-s[u].y)*e},typeof s[u].z<"u"&&(s[u].z=s[u].z+(s[u+1].z-s[u].z)*e);s.splice(s.length-1,1)}return s[0].t=e,s[0]},computeWithRatios:function(e,n,r,o){const i=1-e,a=r,s=n;let u=a[0],l=a[1],c=a[2],d=a[3],f;if(u*=i,l*=e,s.length===2)return f=u+l,{x:(u*s[0].x+l*s[1].x)/f,y:(u*s[0].y+l*s[1].y)/f,z:o?(u*s[0].z+l*s[1].z)/f:!1,t:e};if(u*=i,l*=2*i,c*=e*e,s.length===3)return f=u+l+c,{x:(u*s[0].x+l*s[1].x+c*s[2].x)/f,y:(u*s[0].y+l*s[1].y+c*s[2].y)/f,z:o?(u*s[0].z+l*s[1].z+c*s[2].z)/f:!1,t:e};if(u*=i,l*=1.5*i,c*=3*i,d*=e*e*e,s.length===4)return f=u+l+c+d,{x:(u*s[0].x+l*s[1].x+c*s[2].x+d*s[3].x)/f,y:(u*s[0].y+l*s[1].y+c*s[2].y+d*s[3].y)/f,z:o?(u*s[0].z+l*s[1].z+c*s[2].z+d*s[3].z)/f:!1,t:e}},derive:function(e,n){const r=[];for(let o=e,i=o.length,a=i-1;i>1;i--,a--){const s=[];for(let u=0,l;u<a;u++)l={x:a*(o[u+1].x-o[u].x),y:a*(o[u+1].y-o[u].y)},n&&(l.z=a*(o[u+1].z-o[u].z)),s.push(l);r.push(s),o=s}return r},between:function(e,n,r){return n<=e&&e<=r||j.approximately(e,n)||j.approximately(e,r)},approximately:function(e,n,r){return Bn(e-n)<=(r||qE)},length:function(e){const r=j.Tvalues.length;let o=0;for(let i=0,a;i<r;i++)a=.5*j.Tvalues[i]+.5,o+=j.Cvalues[i]*j.arcfn(a,e);return .5*o},map:function(e,n,r,o,i){const a=r-n,s=i-o,u=e-n,l=u/a;return o+s*l},lerp:function(e,n,r){const o={x:n.x+e*(r.x-n.x),y:n.y+e*(r.y-n.y)};return n.z!==void 0&&r.z!==void 0&&(o.z=n.z+e*(r.z-n.z)),o},pointToString:function(e){let n=e.x+"/"+e.y;return typeof e.z<"u"&&(n+="/"+e.z),n},pointsToString:function(e){return"["+e.map(j.pointToString).join(", ")+"]"},copy:function(e){return JSON.parse(JSON.stringify(e))},angle:function(e,n,r){const o=n.x-e.x,i=n.y-e.y,a=r.x-e.x,s=r.y-e.y,u=o*s-i*a,l=o*a+i*s;return Xn(u,l)},round:function(e,n){const r=""+e,o=r.indexOf(".");return parseFloat(r.substring(0,o+1+n))},dist:function(e,n){const r=e.x-n.x,o=e.y-n.y;return qt(r*r+o*o)},closest:function(e,n){let r=nt(2,63),o,i;return e.forEach(function(a,s){i=j.dist(n,a),i<r&&(r=i,o=s)}),{mdist:r,mpos:o}},abcratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=nt(e,n)+nt(1-e,n),o=r-1;return Bn(o/r)},projectionratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=nt(1-e,n),o=nt(e,n)+r;return r/o},lli8:function(e,n,r,o,i,a,s,u){const l=(e*o-n*r)*(i-s)-(e-r)*(i*u-a*s),c=(e*o-n*r)*(a-u)-(n-o)*(i*u-a*s),d=(e-r)*(a-u)-(n-o)*(i-s);return d==0?!1:{x:l/d,y:c/d}},lli4:function(e,n,r,o){const i=e.x,a=e.y,s=n.x,u=n.y,l=r.x,c=r.y,d=o.x,f=o.y;return j.lli8(i,a,s,u,l,c,d,f)},lli:function(e,n){return j.lli4(e,e.c,n,n.c)},makeline:function(e,n){return new ge(e.x,e.y,(e.x+n.x)/2,(e.y+n.y)/2,n.x,n.y)},findbbox:function(e){let n=va,r=va,o=_a,i=_a;return e.forEach(function(a){const s=a.bbox();n>s.x.min&&(n=s.x.min),r>s.y.min&&(r=s.y.min),o<s.x.max&&(o=s.x.max),i<s.y.max&&(i=s.y.max)}),{x:{min:n,mid:(n+o)/2,max:o,size:o-n},y:{min:r,mid:(r+i)/2,max:i,size:i-r}}},shapeintersections:function(e,n,r,o,i){if(!j.bboxoverlap(n,o))return[];const a=[],s=[e.startcap,e.forward,e.back,e.endcap],u=[r.startcap,r.forward,r.back,r.endcap];return s.forEach(function(l){l.virtual||u.forEach(function(c){if(c.virtual)return;const d=l.intersects(c,i);d.length>0&&(d.c1=l,d.c2=c,d.s1=e,d.s2=r,a.push(d))})}),a},makeshape:function(e,n,r){const o=n.points.length,i=e.points.length,a=j.makeline(n.points[o-1],e.points[0]),s=j.makeline(e.points[i-1],n.points[0]),u={startcap:a,forward:e,back:n,endcap:s,bbox:j.findbbox([a,e,n,s])};return u.intersections=function(l){return j.shapeintersections(u,u.bbox,l,l.bbox,r)},u},getminmax:function(e,n,r){if(!r)return{min:0,max:0};let o=va,i=_a,a,s;r.indexOf(0)===-1&&(r=[0].concat(r)),r.indexOf(1)===-1&&r.push(1);for(let u=0,l=r.length;u<l;u++)a=r[u],s=e.get(a),s[n]<o&&(o=s[n]),s[n]>i&&(i=s[n]);return{min:o,mid:(o+i)/2,max:i,size:i-o}},align:function(e,n){const r=n.p1.x,o=n.p1.y,i=-Xn(n.p2.y-o,n.p2.x-r),a=function(s){return{x:(s.x-r)*At(i)-(s.y-o)*$n(i),y:(s.x-r)*$n(i)+(s.y-o)*At(i)}};return e.map(a)},roots:function(e,n){n=n||{p1:{x:0,y:0},p2:{x:1,y:0}};const r=e.length-1,o=j.align(e,n),i=function(x){return 0<=x&&x<=1};if(r===2){const x=o[0].y,O=o[1].y,Z=o[2].y,A=x-2*O+Z;if(A!==0){const D=-qt(O*O-x*Z),R=-x+O,X=-(D+R)/A,I=-(-D+R)/A;return[X,I].filter(i)}else if(O!==Z&&A===0)return[(2*O-Z)/(2*O-2*Z)].filter(i);return[]}const a=o[0].y,s=o[1].y,u=o[2].y,l=o[3].y;let c=-a+3*s-3*u+l,d=3*a-6*s+3*u,f=-3*a+3*s,h=a;if(j.approximately(c,0)){if(j.approximately(d,0))return j.approximately(f,0)?[]:[-h/f].filter(i);const x=qt(f*f-4*d*h),O=2*d;return[(x-f)/O,(-f-x)/O].filter(i)}d/=c,f/=c,h/=c;const p=(3*f-d*d)/3,m=p/3,v=(2*d*d*d-9*d*f+27*h)/27,y=v/2,g=y*y+m*m*m;let w,z,$,b,k;if(g<0){const x=-p/3,O=x*x*x,Z=qt(O),A=-v/(2*Z),D=A<-1?-1:A>1?1:A,R=FE(D),X=Kn(Z),I=2*X;return $=I*At(R/3)-d/3,b=I*At((R+$i)/3)-d/3,k=I*At((R+2*$i)/3)-d/3,[$,b,k].filter(i)}else{if(g===0)return w=y<0?Kn(-y):-Kn(y),$=2*w-d/3,b=-w-d/3,[$,b].filter(i);{const x=qt(g);return w=Kn(-y+x),z=Kn(y+x),[w-z-d/3].filter(i)}}},droots:function(e){if(e.length===3){const n=e[0],r=e[1],o=e[2],i=n-2*r+o;if(i!==0){const a=-qt(r*r-n*o),s=-n+r,u=-(a+s)/i,l=-(-a+s)/i;return[u,l]}else if(r!==o&&i===0)return[(2*r-o)/(2*(r-o))];return[]}if(e.length===2){const n=e[0],r=e[1];return n!==r?[n/(n-r)]:[]}return[]},curvature:function(e,n,r,o,i){let a,s,u,l,c=0,d=0;const f=j.compute(e,n),h=j.compute(e,r),p=f.x*f.x+f.y*f.y;if(o?(a=qt(nt(f.y*h.z-h.y*f.z,2)+nt(f.z*h.x-h.z*f.x,2)+nt(f.x*h.y-h.x*f.y,2)),s=nt(p+f.z*f.z,3/2)):(a=f.x*h.y-f.y*h.x,s=nt(p,3/2)),a===0||s===0)return{k:0,r:0};if(c=a/s,d=s/a,!i){const m=j.curvature(e-.001,n,r,o,!0).k,v=j.curvature(e+.001,n,r,o,!0).k;l=(v-c+(c-m))/2,u=(Bn(v-c)+Bn(c-m))/2}return{k:c,r:d,dk:l,adk:u}},inflections:function(e){if(e.length<4)return[];const n=j.align(e,{p1:e[0],p2:e.slice(-1)[0]}),r=n[2].x*n[1].y,o=n[3].x*n[1].y,i=n[1].x*n[2].y,a=n[3].x*n[2].y,s=18*(-3*r+2*o+3*i-a),u=18*(3*r-o-3*i),l=18*(i-r);if(j.approximately(s,0)){if(!j.approximately(u,0)){let h=-l/u;if(0<=h&&h<=1)return[h]}return[]}const c=2*s;if(j.approximately(c,0))return[];const d=u*u-4*s*l;if(d<0)return[];const f=Math.sqrt(d);return[(f-u)/c,-(u+f)/c].filter(function(h){return 0<=h&&h<=1})},bboxoverlap:function(e,n){const r=["x","y"],o=r.length;for(let i=0,a,s,u,l;i<o;i++)if(a=r[i],s=e[a].mid,u=n[a].mid,l=(e[a].size+n[a].size)/2,Bn(s-u)>=l)return!1;return!0},expandbox:function(e,n){n.x.min<e.x.min&&(e.x.min=n.x.min),n.y.min<e.y.min&&(e.y.min=n.y.min),n.z&&n.z.min<e.z.min&&(e.z.min=n.z.min),n.x.max>e.x.max&&(e.x.max=n.x.max),n.y.max>e.y.max&&(e.y.max=n.y.max),n.z&&n.z.max>e.z.max&&(e.z.max=n.z.max),e.x.mid=(e.x.min+e.x.max)/2,e.y.mid=(e.y.min+e.y.max)/2,e.z&&(e.z.mid=(e.z.min+e.z.max)/2),e.x.size=e.x.max-e.x.min,e.y.size=e.y.max-e.y.min,e.z&&(e.z.size=e.z.max-e.z.min)},pairiteration:function(e,n,r){const o=e.bbox(),i=n.bbox(),a=1e5,s=r||.5;if(o.x.size+o.y.size<s&&i.x.size+i.y.size<s)return[(a*(e._t1+e._t2)/2|0)/a+"/"+(a*(n._t1+n._t2)/2|0)/a];let u=e.split(.5),l=n.split(.5),c=[{left:u.left,right:l.left},{left:u.left,right:l.right},{left:u.right,right:l.right},{left:u.right,right:l.left}];c=c.filter(function(f){return j.bboxoverlap(f.left.bbox(),f.right.bbox())});let d=[];return c.length===0||(c.forEach(function(f){d=d.concat(j.pairiteration(f.left,f.right,s))}),d=d.filter(function(f,h){return d.indexOf(f)===h})),d},getccenter:function(e,n,r){const o=n.x-e.x,i=n.y-e.y,a=r.x-n.x,s=r.y-n.y,u=o*At(Jt)-i*$n(Jt),l=o*$n(Jt)+i*At(Jt),c=a*At(Jt)-s*$n(Jt),d=a*$n(Jt)+s*At(Jt),f=(e.x+n.x)/2,h=(e.y+n.y)/2,p=(n.x+r.x)/2,m=(n.y+r.y)/2,v=f+u,y=h+l,g=p+c,w=m+d,z=j.lli8(f,h,v,y,p,m,g,w),$=j.dist(z,e);let b=Xn(e.y-z.y,e.x-z.x),k=Xn(n.y-z.y,n.x-z.x),x=Xn(r.y-z.y,r.x-z.x),O;return b<x?((b>k||k>x)&&(b+=$i),b>x&&(O=x,x=b,b=O)):x<k&&k<b?(O=x,x=b,b=O):x+=$i,z.s=b,z.e=x,z.r=$,z},numberSort:function(e,n){return e-n}};class ur{constructor(n){this.curves=[],this._3d=!1,n&&(this.curves=n,this._3d=this.curves[0]._3d)}valueOf(){return this.toString()}toString(){return"["+this.curves.map(function(n){return j.pointsToString(n.points)}).join(", ")+"]"}addCurve(n){this.curves.push(n),this._3d=this._3d||n._3d}length(){return this.curves.map(function(n){return n.length()}).reduce(function(n,r){return n+r})}curve(n){return this.curves[n]}bbox(){const n=this.curves;for(var r=n[0].bbox(),o=1;o<n.length;o++)j.expandbox(r,n[o].bbox());return r}offset(n){const r=[];return this.curves.forEach(function(o){r.push(...o.offset(n))}),new ur(r)}}const{abs:Yn,min:If,max:zf,cos:HE,sin:VE,acos:WE,sqrt:Qn}=Math,GE=Math.PI;class ge{constructor(n){let r=n&&n.forEach?n:Array.from(arguments).slice(),o=!1;if(typeof r[0]=="object"){o=r.length;const p=[];r.forEach(function(m){["x","y","z"].forEach(function(v){typeof m[v]<"u"&&p.push(m[v])})}),r=p}let i=!1;const a=r.length;if(o){if(o>4){if(arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");i=!0}}else if(a!==6&&a!==8&&a!==9&&a!==12&&arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");const s=this._3d=!i&&(a===9||a===12)||n&&n[0]&&typeof n[0].z<"u",u=this.points=[];for(let p=0,m=s?3:2;p<a;p+=m){var l={x:r[p],y:r[p+1]};s&&(l.z=r[p+2]),u.push(l)}const c=this.order=u.length-1,d=this.dims=["x","y"];s&&d.push("z"),this.dimlen=d.length;const f=j.align(u,{p1:u[0],p2:u[c]}),h=j.dist(u[0],u[c]);this._linear=f.reduce((p,m)=>p+Yn(m.y),0)<h/50,this._lut=[],this._t1=0,this._t2=1,this.update()}static quadraticFromPoints(n,r,o,i){if(typeof i>"u"&&(i=.5),i===0)return new ge(r,r,o);if(i===1)return new ge(n,r,r);const a=ge.getABC(2,n,r,o,i);return new ge(n,a.A,o)}static cubicFromPoints(n,r,o,i,a){typeof i>"u"&&(i=.5);const s=ge.getABC(3,n,r,o,i);typeof a>"u"&&(a=j.dist(r,s.C));const u=a*(1-i)/i,l=j.dist(n,o),c=(o.x-n.x)/l,d=(o.y-n.y)/l,f=a*c,h=a*d,p=u*c,m=u*d,v={x:r.x-f,y:r.y-h},y={x:r.x+p,y:r.y+m},g=s.A,w={x:g.x+(v.x-g.x)/(1-i),y:g.y+(v.y-g.y)/(1-i)},z={x:g.x+(y.x-g.x)/i,y:g.y+(y.y-g.y)/i},$={x:n.x+(w.x-n.x)/i,y:n.y+(w.y-n.y)/i},b={x:o.x+(z.x-o.x)/(1-i),y:o.y+(z.y-o.y)/(1-i)};return new ge(n,$,b,o)}static getUtils(){return j}getUtils(){return ge.getUtils()}static get PolyBezier(){return ur}valueOf(){return this.toString()}toString(){return j.pointsToString(this.points)}toSVG(){if(this._3d)return!1;const n=this.points,r=n[0].x,o=n[0].y,i=["M",r,o,this.order===2?"Q":"C"];for(let a=1,s=n.length;a<s;a++)i.push(n[a].x),i.push(n[a].y);return i.join(" ")}setRatios(n){if(n.length!==this.points.length)throw new Error("incorrect number of ratio values");this.ratios=n,this._lut=[]}verify(){const n=this.coordDigest();n!==this._print&&(this._print=n,this.update())}coordDigest(){return this.points.map(function(n,r){return""+r+n.x+n.y+(n.z?n.z:0)}).join("")}update(){this._lut=[],this.dpoints=j.derive(this.points,this._3d),this.computedirection()}computedirection(){const n=this.points,r=j.angle(n[0],n[this.order],n[1]);this.clockwise=r>0}length(){return j.length(this.derivative.bind(this))}static getABC(n=2,r,o,i,a=.5){const s=j.projectionratio(a,n),u=1-s,l={x:s*r.x+u*i.x,y:s*r.y+u*i.y},c=j.abcratio(a,n);return{A:{x:o.x+(o.x-l.x)/c,y:o.y+(o.y-l.y)/c},B:o,C:l,S:r,E:i}}getABC(n,r){r=r||this.get(n);let o=this.points[0],i=this.points[this.order];return ge.getABC(this.order,o,r,i,n)}getLUT(n){if(this.verify(),n=n||100,this._lut.length===n+1)return this._lut;this._lut=[],n++,this._lut=[];for(let r=0,o,i;r<n;r++)i=r/(n-1),o=this.compute(i),o.t=i,this._lut.push(o);return this._lut}on(n,r){r=r||5;const o=this.getLUT(),i=[];for(let a=0,s,u=0;a<o.length;a++)s=o[a],j.dist(s,n)<r&&(i.push(s),u+=a/o.length);return i.length?t/=i.length:!1}project(n){const r=this.getLUT(),o=r.length-1,i=j.closest(r,n),a=i.mpos,s=(a-1)/o,u=(a+1)/o,l=.1/o;let c=i.mdist,d=s,f=d,h;c+=1;for(let p;d<u+l;d+=l)h=this.compute(d),p=j.dist(n,h),p<c&&(c=p,f=d);return f=f<0?0:f>1?1:f,h=this.compute(f),h.t=f,h.d=c,h}get(n){return this.compute(n)}point(n){return this.points[n]}compute(n){return this.ratios?j.computeWithRatios(n,this.points,this.ratios,this._3d):j.compute(n,this.points,this._3d,this.ratios)}raise(){const n=this.points,r=[n[0]],o=n.length;for(let i=1,a,s;i<o;i++)a=n[i],s=n[i-1],r[i]={x:(o-i)/o*a.x+i/o*s.x,y:(o-i)/o*a.y+i/o*s.y};return r[o]=n[o-1],new ge(r)}derivative(n){return j.compute(n,this.dpoints[0],this._3d)}dderivative(n){return j.compute(n,this.dpoints[1],this._3d)}align(){let n=this.points;return new ge(j.align(n,{p1:n[0],p2:n[n.length-1]}))}curvature(n){return j.curvature(n,this.dpoints[0],this.dpoints[1],this._3d)}inflections(){return j.inflections(this.points)}normal(n){return this._3d?this.__normal3(n):this.__normal2(n)}__normal2(n){const r=this.derivative(n),o=Qn(r.x*r.x+r.y*r.y);return{t:n,x:-r.y/o,y:r.x/o}}__normal3(n){const r=this.derivative(n),o=this.derivative(n+.01),i=Qn(r.x*r.x+r.y*r.y+r.z*r.z),a=Qn(o.x*o.x+o.y*o.y+o.z*o.z);r.x/=i,r.y/=i,r.z/=i,o.x/=a,o.y/=a,o.z/=a;const s={x:o.y*r.z-o.z*r.y,y:o.z*r.x-o.x*r.z,z:o.x*r.y-o.y*r.x},u=Qn(s.x*s.x+s.y*s.y+s.z*s.z);s.x/=u,s.y/=u,s.z/=u;const l=[s.x*s.x,s.x*s.y-s.z,s.x*s.z+s.y,s.x*s.y+s.z,s.y*s.y,s.y*s.z-s.x,s.x*s.z-s.y,s.y*s.z+s.x,s.z*s.z];return{t:n,x:l[0]*r.x+l[1]*r.y+l[2]*r.z,y:l[3]*r.x+l[4]*r.y+l[5]*r.z,z:l[6]*r.x+l[7]*r.y+l[8]*r.z}}hull(n){let r=this.points,o=[],i=[],a=0;for(i[a++]=r[0],i[a++]=r[1],i[a++]=r[2],this.order===3&&(i[a++]=r[3]);r.length>1;){o=[];for(let s=0,u,l=r.length-1;s<l;s++)u=j.lerp(n,r[s],r[s+1]),i[a++]=u,o.push(u);r=o}return i}split(n,r){if(n===0&&r)return this.split(r).left;if(r===1)return this.split(n).right;const o=this.hull(n),i={left:this.order===2?new ge([o[0],o[3],o[5]]):new ge([o[0],o[4],o[7],o[9]]),right:this.order===2?new ge([o[5],o[4],o[2]]):new ge([o[9],o[8],o[6],o[3]]),span:o};return i.left._t1=j.map(0,0,1,this._t1,this._t2),i.left._t2=j.map(n,0,1,this._t1,this._t2),i.right._t1=j.map(n,0,1,this._t1,this._t2),i.right._t2=j.map(1,0,1,this._t1,this._t2),r?(r=j.map(r,n,1,0,1),i.right.split(r).left):i}extrema(){const n={};let r=[];return this.dims.forEach((function(o){let i=function(s){return s[o]},a=this.dpoints[0].map(i);n[o]=j.droots(a),this.order===3&&(a=this.dpoints[1].map(i),n[o]=n[o].concat(j.droots(a))),n[o]=n[o].filter(function(s){return s>=0&&s<=1}),r=r.concat(n[o].sort(j.numberSort))}).bind(this)),n.values=r.sort(j.numberSort).filter(function(o,i){return r.indexOf(o)===i}),n}bbox(){const n=this.extrema(),r={};return this.dims.forEach((function(o){r[o]=j.getminmax(this,o,n[o])}).bind(this)),r}overlaps(n){const r=this.bbox(),o=n.bbox();return j.bboxoverlap(r,o)}offset(n,r){if(typeof r<"u"){const o=this.get(n),i=this.normal(n),a={c:o,n:i,x:o.x+i.x*r,y:o.y+i.y*r};return this._3d&&(a.z=o.z+i.z*r),a}if(this._linear){const o=this.normal(0),i=this.points.map(function(a){const s={x:a.x+n*o.x,y:a.y+n*o.y};return a.z&&o.z&&(s.z=a.z+n*o.z),s});return[new ge(i)]}return this.reduce().map(function(o){return o._linear?o.offset(n)[0]:o.scale(n)})}simple(){if(this.order===3){const i=j.angle(this.points[0],this.points[3],this.points[1]),a=j.angle(this.points[0],this.points[3],this.points[2]);if(i>0&&a<0||i<0&&a>0)return!1}const n=this.normal(0),r=this.normal(1);let o=n.x*r.x+n.y*r.y;return this._3d&&(o+=n.z*r.z),Yn(WE(o))<GE/3}reduce(){let n,r=0,o=0,i=.01,a,s=[],u=[],l=this.extrema().values;for(l.indexOf(0)===-1&&(l=[0].concat(l)),l.indexOf(1)===-1&&l.push(1),r=l[0],n=1;n<l.length;n++)o=l[n],a=this.split(r,o),a._t1=r,a._t2=o,s.push(a),r=o;return s.forEach(function(c){for(r=0,o=0;o<=1;)for(o=r+i;o<=1+i;o+=i)if(a=c.split(r,o),!a.simple()){if(o-=i,Yn(r-o)<i)return[];a=c.split(r,o),a._t1=j.map(r,0,1,c._t1,c._t2),a._t2=j.map(o,0,1,c._t1,c._t2),u.push(a),r=o;break}r<1&&(a=c.split(r,1),a._t1=j.map(r,0,1,c._t1,c._t2),a._t2=c._t2,u.push(a))}),u}translate(n,r,o){o=typeof o=="number"?o:r;const i=this.order;let a=this.points.map((s,u)=>(1-u/i)*r+u/i*o);return new ge(this.points.map((s,u)=>({x:s.x+n.x*a[u],y:s.y+n.y*a[u]})))}scale(n){const r=this.order;let o=!1;if(typeof n=="function"&&(o=n),o&&r===2)return this.raise().scale(o);const i=this.clockwise,a=this.points;if(this._linear)return this.translate(this.normal(0),o?o(0):n,o?o(1):n);const s=o?o(0):n,u=o?o(1):n,l=[this.offset(0,10),this.offset(1,10)],c=[],d=j.lli4(l[0],l[0].c,l[1],l[1].c);if(!d)throw new Error("cannot scale this curve. Try reducing it first.");return[0,1].forEach(function(f){const h=c[f*r]=j.copy(a[f*r]);h.x+=(f?u:s)*l[f].n.x,h.y+=(f?u:s)*l[f].n.y}),o?([0,1].forEach(function(f){if(!(r===2&&f)){var h=a[f+1],p={x:h.x-d.x,y:h.y-d.y},m=o?o((f+1)/r):n;o&&!i&&(m=-m);var v=Qn(p.x*p.x+p.y*p.y);p.x/=v,p.y/=v,c[f+1]={x:h.x+m*p.x,y:h.y+m*p.y}}}),new ge(c)):([0,1].forEach(f=>{if(r===2&&f)return;const h=c[f*r],p=this.derivative(f),m={x:h.x+p.x,y:h.y+p.y};c[f+1]=j.lli4(h,m,d,a[f+1])}),new ge(c))}outline(n,r,o,i){if(r=r===void 0?n:r,this._linear){const b=this.normal(0),k=this.points[0],x=this.points[this.points.length-1];let O,Z,A;o===void 0&&(o=n,i=r),O={x:k.x+b.x*n,y:k.y+b.y*n},A={x:x.x+b.x*o,y:x.y+b.y*o},Z={x:(O.x+A.x)/2,y:(O.y+A.y)/2};const D=[O,Z,A];O={x:k.x-b.x*r,y:k.y-b.y*r},A={x:x.x-b.x*i,y:x.y-b.y*i},Z={x:(O.x+A.x)/2,y:(O.y+A.y)/2};const R=[A,Z,O],X=j.makeline(R[2],D[0]),I=j.makeline(D[2],R[0]),C=[X,new ge(D),I,new ge(R)];return new ur(C)}const a=this.reduce(),s=a.length,u=[];let l=[],c,d=0,f=this.length();const h=typeof o<"u"&&typeof i<"u";function p(b,k,x,O,Z){return function(A){const D=O/x,R=(O+Z)/x,X=k-b;return j.map(A,0,1,b+D*X,b+R*X)}}a.forEach(function(b){const k=b.length();h?(u.push(b.scale(p(n,o,f,d,k))),l.push(b.scale(p(-r,-i,f,d,k)))):(u.push(b.scale(n)),l.push(b.scale(-r))),d+=k}),l=l.map(function(b){return c=b.points,c[3]?b.points=[c[3],c[2],c[1],c[0]]:b.points=[c[2],c[1],c[0]],b}).reverse();const m=u[0].points[0],v=u[s-1].points[u[s-1].points.length-1],y=l[s-1].points[l[s-1].points.length-1],g=l[0].points[0],w=j.makeline(y,m),z=j.makeline(v,g),$=[w].concat(u).concat([z]).concat(l);return new ur($)}outlineshapes(n,r,o){r=r||n;const i=this.outline(n,r).curves,a=[];for(let s=1,u=i.length;s<u/2;s++){const l=j.makeshape(i[s],i[u-s],o);l.startcap.virtual=s>1,l.endcap.virtual=s<u/2-1,a.push(l)}return a}intersects(n,r){return n?n.p1&&n.p2?this.lineIntersects(n):(n instanceof ge&&(n=n.reduce()),this.curveintersects(this.reduce(),n,r)):this.selfintersects(r)}lineIntersects(n){const r=If(n.p1.x,n.p2.x),o=If(n.p1.y,n.p2.y),i=zf(n.p1.x,n.p2.x),a=zf(n.p1.y,n.p2.y);return j.roots(this.points,n).filter(s=>{var u=this.get(s);return j.between(u.x,r,i)&&j.between(u.y,o,a)})}selfintersects(n){const r=this.reduce(),o=r.length-2,i=[];for(let a=0,s,u,l;a<o;a++)u=r.slice(a,a+1),l=r.slice(a+2),s=this.curveintersects(u,l,n),i.push(...s);return i}curveintersects(n,r,o){const i=[];n.forEach(function(s){r.forEach(function(u){s.overlaps(u)&&i.push({left:s,right:u})})});let a=[];return i.forEach(function(s){const u=j.pairiteration(s.left,s.right,o);u.length>0&&(a=a.concat(u))}),a}arcs(n){return n=n||.5,this._iterate(n,[])}_error(n,r,o,i){const a=(i-o)/4,s=this.get(o+a),u=this.get(i-a),l=j.dist(n,r),c=j.dist(n,s),d=j.dist(n,u);return Yn(c-l)+Yn(d-l)}_iterate(n,r){let o=0,i=1,a;do{a=0,i=1;let s=this.get(o),u,l,c,d,f=!1,h=!1,p,m=i,v=1;do if(h=f,d=c,m=(o+i)/2,u=this.get(m),l=this.get(i),c=j.getccenter(s,u,l),c.interval={start:o,end:i},f=this._error(c,s,o,i)<=n,p=h&&!f,p||(v=i),f){if(i>=1){if(c.interval.end=v=1,d=c,i>1){let g={x:c.x+c.r*HE(c.e),y:c.y+c.r*VE(c.e)};c.e+=j.angle({x:c.x,y:c.y},g,this.get(1))}break}i=i+(i-o)/2}else i=m;while(!p&&a++<100);if(a>=100)break;d=d||c,r.push(d),o=v}while(i<1);return r}}function Wa(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,o=Array(n);r<n;r++)o[r]=e[r];return o}function BE(e){if(Array.isArray(e))return e}function XE(e){if(Array.isArray(e))return Wa(e)}function KE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function YE(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o,i,a,s,u=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(l=(o=a.call(r)).done)&&(u.push(o.value),u.length!==n);l=!0);}catch(d){c=!0,i=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return u}}function QE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
138
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
139
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tN(e,n){if(e==null)return{};var r,o,i=nN(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],n.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function nN(e,n){if(e==null)return{};var r={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(n.includes(o))continue;r[o]=e[o]}return r}function rN(e,n){return BE(e)||YE(e,n)||ky(e,n)||QE()}function iN(e){return XE(e)||KE(e)||ky(e)||eN()}function oN(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function aN(e){var n=oN(e,"string");return typeof n=="symbol"?n:n+""}function ky(e,n){if(e){if(typeof e=="string")return Wa(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Wa(e,n):void 0}}var sN=(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=(n instanceof Array?n.length?n:[void 0]:[n]).map(function(u){return{keyAccessor:u,isProp:!(u instanceof Function)}}),a=e.reduce(function(u,l){var c=u,d=l;return i.forEach(function(f,h){var p=f.keyAccessor,m=f.isProp,v;if(m){var y=d,g=y[p],w=tN(y,[p].map(aN));v=g,d=w}else v=p(d,h);h+1<i.length?(c.hasOwnProperty(v)||(c[v]={}),c=c[v]):r?(c.hasOwnProperty(v)||(c[v]=[]),c[v].push(d)):c[v]=d}),u},{});r instanceof Function&&(function u(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;c===i.length?Object.keys(l).forEach(function(d){return l[d]=r(l[d])}):Object.values(l).forEach(function(d){return u(d,c+1)})})(a);var s=a;return o&&(s=[],(function u(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];c.length===i.length?s.push({keys:c,vals:l}):Object.entries(l).forEach(function(d){var f=rN(d,2),h=f[0],p=f[1];return u(p,[].concat(iN(c),[h]))})})(a),n instanceof Array&&n.length===0&&s.length===1&&(s[0].keys=[])),s});function uN(e,n){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(n).domain(e);break}return this}const Of=Symbol("implicit");function xy(){var e=new tf,n=[],r=[],o=Of;function i(a){let s=e.get(a);if(s===void 0){if(o!==Of)return o;e.set(a,s=n.push(a)-1)}return r[s%r.length]}return i.domain=function(a){if(!arguments.length)return n.slice();n=[],e=new tf;for(const s of a)e.has(s)||e.set(s,n.push(s)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(o=a,i):o},i.copy=function(){return xy(n,r).unknown(o)},uN.apply(i,arguments),i}function lN(e){for(var n=e.length/6|0,r=new Array(n),o=0;o<n;)r[o]="#"+e.slice(o*6,++o*6);return r}const cN=lN("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");function fN(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>"u")){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",r==="top"&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var dN=`.force-graph-container canvas {
98
+ `;E1(A1);var R1=to({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i.style,s=o===void 0?{}:o,a=!!n&&lr(n)==="object"&&!!n.node&&typeof n.node=="function",u=De(a?n.node():n);u.style("position")==="static"&&u.style("position","relative"),r.tooltipEl=u.append("div").attr("class","float-tooltip-kap"),Object.entries(s).forEach(function(l){var h=k1(l,2),f=h[0],d=h[1];return r.tooltipEl.style(f,d)}),r.tooltipEl.style("left","-10000px").style("display","none");var c="tooltip-".concat(Math.round(Math.random()*1e12));r.mouseInside=!1,u.on("mousemove.".concat(c),function(l){r.mouseInside=!0;var h=Ke(l),f=u.node(),d=f.offsetWidth,p=f.offsetHeight,g=[r.offsetX===null||r.offsetX===void 0?"-".concat(h[0]/d*100,"%"):typeof r.offsetX=="number"?"calc(-50% + ".concat(r.offsetX,"px)"):r.offsetX,r.offsetY===null||r.offsetY===void 0?p>130&&p-h[1]<100?"calc(-100% - 6px)":"21px":typeof r.offsetY=="number"?r.offsetY<0?"calc(-100% - ".concat(Math.abs(r.offsetY),"px)"):"".concat(r.offsetY,"px"):r.offsetY];r.tooltipEl.style("left",h[0]+"px").style("top",h[1]+"px").style("transform","translate(".concat(g.join(","),")")),r.content&&r.tooltipEl.style("display","inline")}),u.on("mouseover.".concat(c),function(){r.mouseInside=!0,r.content&&r.tooltipEl.style("display","inline")}),u.on("mouseout.".concat(c),function(){r.mouseInside=!1,r.tooltipEl.style("display","none")})},update:function(n){n.tooltipEl.style("display",n.content&&n.mouseInside?"inline":"none"),n.content?n.content instanceof HTMLElement?(n.tooltipEl.text(""),n.tooltipEl.append(function(){return n.content})):typeof n.content=="string"?n.tooltipEl.html(n.content):C1(n.content)?(n.tooltipEl.text(""),P1(n.content,n.tooltipEl.node())):(n.tooltipEl.style("display","none"),console.warn("Tooltip content is invalid, skipping.",n.content,n.content.toString())):n.tooltipEl.text("")}});const{abs:Jt,cos:at,sin:At,acos:$1,atan2:Gt,sqrt:ht,pow:Oe}=Math;function Xt(e){return e<0?-Oe(-e,1/3):Oe(e,1/3)}const Zu=Math.PI,Ln=2*Zu,dt=Zu/2,I1=1e-6,Dr=Number.MAX_SAFE_INTEGER||9007199254740991,jr=Number.MIN_SAFE_INTEGER||-9007199254740991,M1={x:0,y:0,z:0},I={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(e,n){const r=n(e);let i=r.x*r.x+r.y*r.y;return typeof r.z<"u"&&(i+=r.z*r.z),ht(i)},compute:function(e,n,r){if(e===0)return n[0].t=0,n[0];const i=n.length-1;if(e===1)return n[i].t=1,n[i];const o=1-e;let s=n;if(i===0)return n[0].t=e,n[0];if(i===1){const u={x:o*s[0].x+e*s[1].x,y:o*s[0].y+e*s[1].y,t:e};return r&&(u.z=o*s[0].z+e*s[1].z),u}if(i<4){let u=o*o,c=e*e,l,h,f,d=0;i===2?(s=[s[0],s[1],s[2],M1],l=u,h=o*e*2,f=c):i===3&&(l=u*o,h=u*e*3,f=o*c*3,d=e*c);const p={x:l*s[0].x+h*s[1].x+f*s[2].x+d*s[3].x,y:l*s[0].y+h*s[1].y+f*s[2].y+d*s[3].y,t:e};return r&&(p.z=l*s[0].z+h*s[1].z+f*s[2].z+d*s[3].z),p}const a=JSON.parse(JSON.stringify(n));for(;a.length>1;){for(let u=0;u<a.length-1;u++)a[u]={x:a[u].x+(a[u+1].x-a[u].x)*e,y:a[u].y+(a[u+1].y-a[u].y)*e},typeof a[u].z<"u"&&(a[u].z=a[u].z+(a[u+1].z-a[u].z)*e);a.splice(a.length-1,1)}return a[0].t=e,a[0]},computeWithRatios:function(e,n,r,i){const o=1-e,s=r,a=n;let u=s[0],c=s[1],l=s[2],h=s[3],f;if(u*=o,c*=e,a.length===2)return f=u+c,{x:(u*a[0].x+c*a[1].x)/f,y:(u*a[0].y+c*a[1].y)/f,z:i?(u*a[0].z+c*a[1].z)/f:!1,t:e};if(u*=o,c*=2*o,l*=e*e,a.length===3)return f=u+c+l,{x:(u*a[0].x+c*a[1].x+l*a[2].x)/f,y:(u*a[0].y+c*a[1].y+l*a[2].y)/f,z:i?(u*a[0].z+c*a[1].z+l*a[2].z)/f:!1,t:e};if(u*=o,c*=1.5*o,l*=3*o,h*=e*e*e,a.length===4)return f=u+c+l+h,{x:(u*a[0].x+c*a[1].x+l*a[2].x+h*a[3].x)/f,y:(u*a[0].y+c*a[1].y+l*a[2].y+h*a[3].y)/f,z:i?(u*a[0].z+c*a[1].z+l*a[2].z+h*a[3].z)/f:!1,t:e}},derive:function(e,n){const r=[];for(let i=e,o=i.length,s=o-1;o>1;o--,s--){const a=[];for(let u=0,c;u<s;u++)c={x:s*(i[u+1].x-i[u].x),y:s*(i[u+1].y-i[u].y)},n&&(c.z=s*(i[u+1].z-i[u].z)),a.push(c);r.push(a),i=a}return r},between:function(e,n,r){return n<=e&&e<=r||I.approximately(e,n)||I.approximately(e,r)},approximately:function(e,n,r){return Jt(e-n)<=(r||I1)},length:function(e){const r=I.Tvalues.length;let i=0;for(let o=0,s;o<r;o++)s=.5*I.Tvalues[o]+.5,i+=I.Cvalues[o]*I.arcfn(s,e);return .5*i},map:function(e,n,r,i,o){const s=r-n,a=o-i,u=e-n,c=u/s;return i+a*c},lerp:function(e,n,r){const i={x:n.x+e*(r.x-n.x),y:n.y+e*(r.y-n.y)};return n.z!==void 0&&r.z!==void 0&&(i.z=n.z+e*(r.z-n.z)),i},pointToString:function(e){let n=e.x+"/"+e.y;return typeof e.z<"u"&&(n+="/"+e.z),n},pointsToString:function(e){return"["+e.map(I.pointToString).join(", ")+"]"},copy:function(e){return JSON.parse(JSON.stringify(e))},angle:function(e,n,r){const i=n.x-e.x,o=n.y-e.y,s=r.x-e.x,a=r.y-e.y,u=i*a-o*s,c=i*s+o*a;return Gt(u,c)},round:function(e,n){const r=""+e,i=r.indexOf(".");return parseFloat(r.substring(0,i+1+n))},dist:function(e,n){const r=e.x-n.x,i=e.y-n.y;return ht(r*r+i*i)},closest:function(e,n){let r=Oe(2,63),i,o;return e.forEach(function(s,a){o=I.dist(n,s),o<r&&(r=o,i=a)}),{mdist:r,mpos:i}},abcratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=Oe(e,n)+Oe(1-e,n),i=r-1;return Jt(i/r)},projectionratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=Oe(1-e,n),i=Oe(e,n)+r;return r/i},lli8:function(e,n,r,i,o,s,a,u){const c=(e*i-n*r)*(o-a)-(e-r)*(o*u-s*a),l=(e*i-n*r)*(s-u)-(n-i)*(o*u-s*a),h=(e-r)*(s-u)-(n-i)*(o-a);return h==0?!1:{x:c/h,y:l/h}},lli4:function(e,n,r,i){const o=e.x,s=e.y,a=n.x,u=n.y,c=r.x,l=r.y,h=i.x,f=i.y;return I.lli8(o,s,a,u,c,l,h,f)},lli:function(e,n){return I.lli4(e,e.c,n,n.c)},makeline:function(e,n){return new se(e.x,e.y,(e.x+n.x)/2,(e.y+n.y)/2,n.x,n.y)},findbbox:function(e){let n=Dr,r=Dr,i=jr,o=jr;return e.forEach(function(s){const a=s.bbox();n>a.x.min&&(n=a.x.min),r>a.y.min&&(r=a.y.min),i<a.x.max&&(i=a.x.max),o<a.y.max&&(o=a.y.max)}),{x:{min:n,mid:(n+i)/2,max:i,size:i-n},y:{min:r,mid:(r+o)/2,max:o,size:o-r}}},shapeintersections:function(e,n,r,i,o){if(!I.bboxoverlap(n,i))return[];const s=[],a=[e.startcap,e.forward,e.back,e.endcap],u=[r.startcap,r.forward,r.back,r.endcap];return a.forEach(function(c){c.virtual||u.forEach(function(l){if(l.virtual)return;const h=c.intersects(l,o);h.length>0&&(h.c1=c,h.c2=l,h.s1=e,h.s2=r,s.push(h))})}),s},makeshape:function(e,n,r){const i=n.points.length,o=e.points.length,s=I.makeline(n.points[i-1],e.points[0]),a=I.makeline(e.points[o-1],n.points[0]),u={startcap:s,forward:e,back:n,endcap:a,bbox:I.findbbox([s,e,n,a])};return u.intersections=function(c){return I.shapeintersections(u,u.bbox,c,c.bbox,r)},u},getminmax:function(e,n,r){if(!r)return{min:0,max:0};let i=Dr,o=jr,s,a;r.indexOf(0)===-1&&(r=[0].concat(r)),r.indexOf(1)===-1&&r.push(1);for(let u=0,c=r.length;u<c;u++)s=r[u],a=e.get(s),a[n]<i&&(i=a[n]),a[n]>o&&(o=a[n]);return{min:i,mid:(i+o)/2,max:o,size:o-i}},align:function(e,n){const r=n.p1.x,i=n.p1.y,o=-Gt(n.p2.y-i,n.p2.x-r),s=function(a){return{x:(a.x-r)*at(o)-(a.y-i)*At(o),y:(a.x-r)*At(o)+(a.y-i)*at(o)}};return e.map(s)},roots:function(e,n){n=n||{p1:{x:0,y:0},p2:{x:1,y:0}};const r=e.length-1,i=I.align(e,n),o=function(x){return 0<=x&&x<=1};if(r===2){const x=i[0].y,P=i[1].y,M=i[2].y,$=x-2*P+M;if($!==0){const N=-ht(P*P-x*M),D=-x+P,H=-(N+D)/$,z=-(-N+D)/$;return[H,z].filter(o)}else if(P!==M&&$===0)return[(2*P-M)/(2*P-2*M)].filter(o);return[]}const s=i[0].y,a=i[1].y,u=i[2].y,c=i[3].y;let l=-s+3*a-3*u+c,h=3*s-6*a+3*u,f=-3*s+3*a,d=s;if(I.approximately(l,0)){if(I.approximately(h,0))return I.approximately(f,0)?[]:[-d/f].filter(o);const x=ht(f*f-4*h*d),P=2*h;return[(x-f)/P,(-f-x)/P].filter(o)}h/=l,f/=l,d/=l;const p=(3*f-h*h)/3,g=p/3,_=(2*h*h*h-9*h*f+27*d)/27,y=_/2,m=y*y+g*g*g;let w,C,b,v,k;if(m<0){const x=-p/3,P=x*x*x,M=ht(P),$=-_/(2*M),N=$<-1?-1:$>1?1:$,D=$1(N),H=Xt(M),z=2*H;return b=z*at(D/3)-h/3,v=z*at((D+Ln)/3)-h/3,k=z*at((D+2*Ln)/3)-h/3,[b,v,k].filter(o)}else{if(m===0)return w=y<0?Xt(-y):-Xt(y),b=2*w-h/3,v=-w-h/3,[b,v].filter(o);{const x=ht(m);return w=Xt(-y+x),C=Xt(y+x),[w-C-h/3].filter(o)}}},droots:function(e){if(e.length===3){const n=e[0],r=e[1],i=e[2],o=n-2*r+i;if(o!==0){const s=-ht(r*r-n*i),a=-n+r,u=-(s+a)/o,c=-(-s+a)/o;return[u,c]}else if(r!==i&&o===0)return[(2*r-i)/(2*(r-i))];return[]}if(e.length===2){const n=e[0],r=e[1];return n!==r?[n/(n-r)]:[]}return[]},curvature:function(e,n,r,i,o){let s,a,u,c,l=0,h=0;const f=I.compute(e,n),d=I.compute(e,r),p=f.x*f.x+f.y*f.y;if(i?(s=ht(Oe(f.y*d.z-d.y*f.z,2)+Oe(f.z*d.x-d.z*f.x,2)+Oe(f.x*d.y-d.x*f.y,2)),a=Oe(p+f.z*f.z,3/2)):(s=f.x*d.y-f.y*d.x,a=Oe(p,3/2)),s===0||a===0)return{k:0,r:0};if(l=s/a,h=a/s,!o){const g=I.curvature(e-.001,n,r,i,!0).k,_=I.curvature(e+.001,n,r,i,!0).k;c=(_-l+(l-g))/2,u=(Jt(_-l)+Jt(l-g))/2}return{k:l,r:h,dk:c,adk:u}},inflections:function(e){if(e.length<4)return[];const n=I.align(e,{p1:e[0],p2:e.slice(-1)[0]}),r=n[2].x*n[1].y,i=n[3].x*n[1].y,o=n[1].x*n[2].y,s=n[3].x*n[2].y,a=18*(-3*r+2*i+3*o-s),u=18*(3*r-i-3*o),c=18*(o-r);if(I.approximately(a,0)){if(!I.approximately(u,0)){let d=-c/u;if(0<=d&&d<=1)return[d]}return[]}const l=2*a;if(I.approximately(l,0))return[];const h=u*u-4*a*c;if(h<0)return[];const f=Math.sqrt(h);return[(f-u)/l,-(u+f)/l].filter(function(d){return 0<=d&&d<=1})},bboxoverlap:function(e,n){const r=["x","y"],i=r.length;for(let o=0,s,a,u,c;o<i;o++)if(s=r[o],a=e[s].mid,u=n[s].mid,c=(e[s].size+n[s].size)/2,Jt(a-u)>=c)return!1;return!0},expandbox:function(e,n){n.x.min<e.x.min&&(e.x.min=n.x.min),n.y.min<e.y.min&&(e.y.min=n.y.min),n.z&&n.z.min<e.z.min&&(e.z.min=n.z.min),n.x.max>e.x.max&&(e.x.max=n.x.max),n.y.max>e.y.max&&(e.y.max=n.y.max),n.z&&n.z.max>e.z.max&&(e.z.max=n.z.max),e.x.mid=(e.x.min+e.x.max)/2,e.y.mid=(e.y.min+e.y.max)/2,e.z&&(e.z.mid=(e.z.min+e.z.max)/2),e.x.size=e.x.max-e.x.min,e.y.size=e.y.max-e.y.min,e.z&&(e.z.size=e.z.max-e.z.min)},pairiteration:function(e,n,r){const i=e.bbox(),o=n.bbox(),s=1e5,a=r||.5;if(i.x.size+i.y.size<a&&o.x.size+o.y.size<a)return[(s*(e._t1+e._t2)/2|0)/s+"/"+(s*(n._t1+n._t2)/2|0)/s];let u=e.split(.5),c=n.split(.5),l=[{left:u.left,right:c.left},{left:u.left,right:c.right},{left:u.right,right:c.right},{left:u.right,right:c.left}];l=l.filter(function(f){return I.bboxoverlap(f.left.bbox(),f.right.bbox())});let h=[];return l.length===0||(l.forEach(function(f){h=h.concat(I.pairiteration(f.left,f.right,a))}),h=h.filter(function(f,d){return h.indexOf(f)===d})),h},getccenter:function(e,n,r){const i=n.x-e.x,o=n.y-e.y,s=r.x-n.x,a=r.y-n.y,u=i*at(dt)-o*At(dt),c=i*At(dt)+o*at(dt),l=s*at(dt)-a*At(dt),h=s*At(dt)+a*at(dt),f=(e.x+n.x)/2,d=(e.y+n.y)/2,p=(n.x+r.x)/2,g=(n.y+r.y)/2,_=f+u,y=d+c,m=p+l,w=g+h,C=I.lli8(f,d,_,y,p,g,m,w),b=I.dist(C,e);let v=Gt(e.y-C.y,e.x-C.x),k=Gt(n.y-C.y,n.x-C.x),x=Gt(r.y-C.y,r.x-C.x),P;return v<x?((v>k||k>x)&&(v+=Ln),v>x&&(P=x,x=v,v=P)):x<k&&k<v?(P=x,x=v,v=P):x+=Ln,C.s=v,C.e=x,C.r=b,C},numberSort:function(e,n){return e-n}};class an{constructor(n){this.curves=[],this._3d=!1,n&&(this.curves=n,this._3d=this.curves[0]._3d)}valueOf(){return this.toString()}toString(){return"["+this.curves.map(function(n){return I.pointsToString(n.points)}).join(", ")+"]"}addCurve(n){this.curves.push(n),this._3d=this._3d||n._3d}length(){return this.curves.map(function(n){return n.length()}).reduce(function(n,r){return n+r})}curve(n){return this.curves[n]}bbox(){const n=this.curves;for(var r=n[0].bbox(),i=1;i<n.length;i++)I.expandbox(r,n[i].bbox());return r}offset(n){const r=[];return this.curves.forEach(function(i){r.push(...i.offset(n))}),new an(r)}}const{abs:Kt,min:Ps,max:Es,cos:O1,sin:N1,acos:D1,sqrt:Yt}=Math,j1=Math.PI;class se{constructor(n){let r=n&&n.forEach?n:Array.from(arguments).slice(),i=!1;if(typeof r[0]=="object"){i=r.length;const p=[];r.forEach(function(g){["x","y","z"].forEach(function(_){typeof g[_]<"u"&&p.push(g[_])})}),r=p}let o=!1;const s=r.length;if(i){if(i>4){if(arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");o=!0}}else if(s!==6&&s!==8&&s!==9&&s!==12&&arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");const a=this._3d=!o&&(s===9||s===12)||n&&n[0]&&typeof n[0].z<"u",u=this.points=[];for(let p=0,g=a?3:2;p<s;p+=g){var c={x:r[p],y:r[p+1]};a&&(c.z=r[p+2]),u.push(c)}const l=this.order=u.length-1,h=this.dims=["x","y"];a&&h.push("z"),this.dimlen=h.length;const f=I.align(u,{p1:u[0],p2:u[l]}),d=I.dist(u[0],u[l]);this._linear=f.reduce((p,g)=>p+Kt(g.y),0)<d/50,this._lut=[],this._t1=0,this._t2=1,this.update()}static quadraticFromPoints(n,r,i,o){if(typeof o>"u"&&(o=.5),o===0)return new se(r,r,i);if(o===1)return new se(n,r,r);const s=se.getABC(2,n,r,i,o);return new se(n,s.A,i)}static cubicFromPoints(n,r,i,o,s){typeof o>"u"&&(o=.5);const a=se.getABC(3,n,r,i,o);typeof s>"u"&&(s=I.dist(r,a.C));const u=s*(1-o)/o,c=I.dist(n,i),l=(i.x-n.x)/c,h=(i.y-n.y)/c,f=s*l,d=s*h,p=u*l,g=u*h,_={x:r.x-f,y:r.y-d},y={x:r.x+p,y:r.y+g},m=a.A,w={x:m.x+(_.x-m.x)/(1-o),y:m.y+(_.y-m.y)/(1-o)},C={x:m.x+(y.x-m.x)/o,y:m.y+(y.y-m.y)/o},b={x:n.x+(w.x-n.x)/o,y:n.y+(w.y-n.y)/o},v={x:i.x+(C.x-i.x)/(1-o),y:i.y+(C.y-i.y)/(1-o)};return new se(n,b,v,i)}static getUtils(){return I}getUtils(){return se.getUtils()}static get PolyBezier(){return an}valueOf(){return this.toString()}toString(){return I.pointsToString(this.points)}toSVG(){if(this._3d)return!1;const n=this.points,r=n[0].x,i=n[0].y,o=["M",r,i,this.order===2?"Q":"C"];for(let s=1,a=n.length;s<a;s++)o.push(n[s].x),o.push(n[s].y);return o.join(" ")}setRatios(n){if(n.length!==this.points.length)throw new Error("incorrect number of ratio values");this.ratios=n,this._lut=[]}verify(){const n=this.coordDigest();n!==this._print&&(this._print=n,this.update())}coordDigest(){return this.points.map(function(n,r){return""+r+n.x+n.y+(n.z?n.z:0)}).join("")}update(){this._lut=[],this.dpoints=I.derive(this.points,this._3d),this.computedirection()}computedirection(){const n=this.points,r=I.angle(n[0],n[this.order],n[1]);this.clockwise=r>0}length(){return I.length(this.derivative.bind(this))}static getABC(n=2,r,i,o,s=.5){const a=I.projectionratio(s,n),u=1-a,c={x:a*r.x+u*o.x,y:a*r.y+u*o.y},l=I.abcratio(s,n);return{A:{x:i.x+(i.x-c.x)/l,y:i.y+(i.y-c.y)/l},B:i,C:c,S:r,E:o}}getABC(n,r){r=r||this.get(n);let i=this.points[0],o=this.points[this.order];return se.getABC(this.order,i,r,o,n)}getLUT(n){if(this.verify(),n=n||100,this._lut.length===n+1)return this._lut;this._lut=[],n++,this._lut=[];for(let r=0,i,o;r<n;r++)o=r/(n-1),i=this.compute(o),i.t=o,this._lut.push(i);return this._lut}on(n,r){r=r||5;const i=this.getLUT(),o=[];for(let s=0,a,u=0;s<i.length;s++)a=i[s],I.dist(a,n)<r&&(o.push(a),u+=s/i.length);return o.length?t/=o.length:!1}project(n){const r=this.getLUT(),i=r.length-1,o=I.closest(r,n),s=o.mpos,a=(s-1)/i,u=(s+1)/i,c=.1/i;let l=o.mdist,h=a,f=h,d;l+=1;for(let p;h<u+c;h+=c)d=this.compute(h),p=I.dist(n,d),p<l&&(l=p,f=h);return f=f<0?0:f>1?1:f,d=this.compute(f),d.t=f,d.d=l,d}get(n){return this.compute(n)}point(n){return this.points[n]}compute(n){return this.ratios?I.computeWithRatios(n,this.points,this.ratios,this._3d):I.compute(n,this.points,this._3d,this.ratios)}raise(){const n=this.points,r=[n[0]],i=n.length;for(let o=1,s,a;o<i;o++)s=n[o],a=n[o-1],r[o]={x:(i-o)/i*s.x+o/i*a.x,y:(i-o)/i*s.y+o/i*a.y};return r[i]=n[i-1],new se(r)}derivative(n){return I.compute(n,this.dpoints[0],this._3d)}dderivative(n){return I.compute(n,this.dpoints[1],this._3d)}align(){let n=this.points;return new se(I.align(n,{p1:n[0],p2:n[n.length-1]}))}curvature(n){return I.curvature(n,this.dpoints[0],this.dpoints[1],this._3d)}inflections(){return I.inflections(this.points)}normal(n){return this._3d?this.__normal3(n):this.__normal2(n)}__normal2(n){const r=this.derivative(n),i=Yt(r.x*r.x+r.y*r.y);return{t:n,x:-r.y/i,y:r.x/i}}__normal3(n){const r=this.derivative(n),i=this.derivative(n+.01),o=Yt(r.x*r.x+r.y*r.y+r.z*r.z),s=Yt(i.x*i.x+i.y*i.y+i.z*i.z);r.x/=o,r.y/=o,r.z/=o,i.x/=s,i.y/=s,i.z/=s;const a={x:i.y*r.z-i.z*r.y,y:i.z*r.x-i.x*r.z,z:i.x*r.y-i.y*r.x},u=Yt(a.x*a.x+a.y*a.y+a.z*a.z);a.x/=u,a.y/=u,a.z/=u;const c=[a.x*a.x,a.x*a.y-a.z,a.x*a.z+a.y,a.x*a.y+a.z,a.y*a.y,a.y*a.z-a.x,a.x*a.z-a.y,a.y*a.z+a.x,a.z*a.z];return{t:n,x:c[0]*r.x+c[1]*r.y+c[2]*r.z,y:c[3]*r.x+c[4]*r.y+c[5]*r.z,z:c[6]*r.x+c[7]*r.y+c[8]*r.z}}hull(n){let r=this.points,i=[],o=[],s=0;for(o[s++]=r[0],o[s++]=r[1],o[s++]=r[2],this.order===3&&(o[s++]=r[3]);r.length>1;){i=[];for(let a=0,u,c=r.length-1;a<c;a++)u=I.lerp(n,r[a],r[a+1]),o[s++]=u,i.push(u);r=i}return o}split(n,r){if(n===0&&r)return this.split(r).left;if(r===1)return this.split(n).right;const i=this.hull(n),o={left:this.order===2?new se([i[0],i[3],i[5]]):new se([i[0],i[4],i[7],i[9]]),right:this.order===2?new se([i[5],i[4],i[2]]):new se([i[9],i[8],i[6],i[3]]),span:i};return o.left._t1=I.map(0,0,1,this._t1,this._t2),o.left._t2=I.map(n,0,1,this._t1,this._t2),o.right._t1=I.map(n,0,1,this._t1,this._t2),o.right._t2=I.map(1,0,1,this._t1,this._t2),r?(r=I.map(r,n,1,0,1),o.right.split(r).left):o}extrema(){const n={};let r=[];return this.dims.forEach((function(i){let o=function(a){return a[i]},s=this.dpoints[0].map(o);n[i]=I.droots(s),this.order===3&&(s=this.dpoints[1].map(o),n[i]=n[i].concat(I.droots(s))),n[i]=n[i].filter(function(a){return a>=0&&a<=1}),r=r.concat(n[i].sort(I.numberSort))}).bind(this)),n.values=r.sort(I.numberSort).filter(function(i,o){return r.indexOf(i)===o}),n}bbox(){const n=this.extrema(),r={};return this.dims.forEach((function(i){r[i]=I.getminmax(this,i,n[i])}).bind(this)),r}overlaps(n){const r=this.bbox(),i=n.bbox();return I.bboxoverlap(r,i)}offset(n,r){if(typeof r<"u"){const i=this.get(n),o=this.normal(n),s={c:i,n:o,x:i.x+o.x*r,y:i.y+o.y*r};return this._3d&&(s.z=i.z+o.z*r),s}if(this._linear){const i=this.normal(0),o=this.points.map(function(s){const a={x:s.x+n*i.x,y:s.y+n*i.y};return s.z&&i.z&&(a.z=s.z+n*i.z),a});return[new se(o)]}return this.reduce().map(function(i){return i._linear?i.offset(n)[0]:i.scale(n)})}simple(){if(this.order===3){const o=I.angle(this.points[0],this.points[3],this.points[1]),s=I.angle(this.points[0],this.points[3],this.points[2]);if(o>0&&s<0||o<0&&s>0)return!1}const n=this.normal(0),r=this.normal(1);let i=n.x*r.x+n.y*r.y;return this._3d&&(i+=n.z*r.z),Kt(D1(i))<j1/3}reduce(){let n,r=0,i=0,o=.01,s,a=[],u=[],c=this.extrema().values;for(c.indexOf(0)===-1&&(c=[0].concat(c)),c.indexOf(1)===-1&&c.push(1),r=c[0],n=1;n<c.length;n++)i=c[n],s=this.split(r,i),s._t1=r,s._t2=i,a.push(s),r=i;return a.forEach(function(l){for(r=0,i=0;i<=1;)for(i=r+o;i<=1+o;i+=o)if(s=l.split(r,i),!s.simple()){if(i-=o,Kt(r-i)<o)return[];s=l.split(r,i),s._t1=I.map(r,0,1,l._t1,l._t2),s._t2=I.map(i,0,1,l._t1,l._t2),u.push(s),r=i;break}r<1&&(s=l.split(r,1),s._t1=I.map(r,0,1,l._t1,l._t2),s._t2=l._t2,u.push(s))}),u}translate(n,r,i){i=typeof i=="number"?i:r;const o=this.order;let s=this.points.map((a,u)=>(1-u/o)*r+u/o*i);return new se(this.points.map((a,u)=>({x:a.x+n.x*s[u],y:a.y+n.y*s[u]})))}scale(n){const r=this.order;let i=!1;if(typeof n=="function"&&(i=n),i&&r===2)return this.raise().scale(i);const o=this.clockwise,s=this.points;if(this._linear)return this.translate(this.normal(0),i?i(0):n,i?i(1):n);const a=i?i(0):n,u=i?i(1):n,c=[this.offset(0,10),this.offset(1,10)],l=[],h=I.lli4(c[0],c[0].c,c[1],c[1].c);if(!h)throw new Error("cannot scale this curve. Try reducing it first.");return[0,1].forEach(function(f){const d=l[f*r]=I.copy(s[f*r]);d.x+=(f?u:a)*c[f].n.x,d.y+=(f?u:a)*c[f].n.y}),i?([0,1].forEach(function(f){if(!(r===2&&f)){var d=s[f+1],p={x:d.x-h.x,y:d.y-h.y},g=i?i((f+1)/r):n;i&&!o&&(g=-g);var _=Yt(p.x*p.x+p.y*p.y);p.x/=_,p.y/=_,l[f+1]={x:d.x+g*p.x,y:d.y+g*p.y}}}),new se(l)):([0,1].forEach(f=>{if(r===2&&f)return;const d=l[f*r],p=this.derivative(f),g={x:d.x+p.x,y:d.y+p.y};l[f+1]=I.lli4(d,g,h,s[f+1])}),new se(l))}outline(n,r,i,o){if(r=r===void 0?n:r,this._linear){const v=this.normal(0),k=this.points[0],x=this.points[this.points.length-1];let P,M,$;i===void 0&&(i=n,o=r),P={x:k.x+v.x*n,y:k.y+v.y*n},$={x:x.x+v.x*i,y:x.y+v.y*i},M={x:(P.x+$.x)/2,y:(P.y+$.y)/2};const N=[P,M,$];P={x:k.x-v.x*r,y:k.y-v.y*r},$={x:x.x-v.x*o,y:x.y-v.y*o},M={x:(P.x+$.x)/2,y:(P.y+$.y)/2};const D=[$,M,P],H=I.makeline(D[2],N[0]),z=I.makeline(N[2],D[0]),O=[H,new se(N),z,new se(D)];return new an(O)}const s=this.reduce(),a=s.length,u=[];let c=[],l,h=0,f=this.length();const d=typeof i<"u"&&typeof o<"u";function p(v,k,x,P,M){return function($){const N=P/x,D=(P+M)/x,H=k-v;return I.map($,0,1,v+N*H,v+D*H)}}s.forEach(function(v){const k=v.length();d?(u.push(v.scale(p(n,i,f,h,k))),c.push(v.scale(p(-r,-o,f,h,k)))):(u.push(v.scale(n)),c.push(v.scale(-r))),h+=k}),c=c.map(function(v){return l=v.points,l[3]?v.points=[l[3],l[2],l[1],l[0]]:v.points=[l[2],l[1],l[0]],v}).reverse();const g=u[0].points[0],_=u[a-1].points[u[a-1].points.length-1],y=c[a-1].points[c[a-1].points.length-1],m=c[0].points[0],w=I.makeline(y,g),C=I.makeline(_,m),b=[w].concat(u).concat([C]).concat(c);return new an(b)}outlineshapes(n,r,i){r=r||n;const o=this.outline(n,r).curves,s=[];for(let a=1,u=o.length;a<u/2;a++){const c=I.makeshape(o[a],o[u-a],i);c.startcap.virtual=a>1,c.endcap.virtual=a<u/2-1,s.push(c)}return s}intersects(n,r){return n?n.p1&&n.p2?this.lineIntersects(n):(n instanceof se&&(n=n.reduce()),this.curveintersects(this.reduce(),n,r)):this.selfintersects(r)}lineIntersects(n){const r=Ps(n.p1.x,n.p2.x),i=Ps(n.p1.y,n.p2.y),o=Es(n.p1.x,n.p2.x),s=Es(n.p1.y,n.p2.y);return I.roots(this.points,n).filter(a=>{var u=this.get(a);return I.between(u.x,r,o)&&I.between(u.y,i,s)})}selfintersects(n){const r=this.reduce(),i=r.length-2,o=[];for(let s=0,a,u,c;s<i;s++)u=r.slice(s,s+1),c=r.slice(s+2),a=this.curveintersects(u,c,n),o.push(...a);return o}curveintersects(n,r,i){const o=[];n.forEach(function(a){r.forEach(function(u){a.overlaps(u)&&o.push({left:a,right:u})})});let s=[];return o.forEach(function(a){const u=I.pairiteration(a.left,a.right,i);u.length>0&&(s=s.concat(u))}),s}arcs(n){return n=n||.5,this._iterate(n,[])}_error(n,r,i,o){const s=(o-i)/4,a=this.get(i+s),u=this.get(o-s),c=I.dist(n,r),l=I.dist(n,a),h=I.dist(n,u);return Kt(l-c)+Kt(h-c)}_iterate(n,r){let i=0,o=1,s;do{s=0,o=1;let a=this.get(i),u,c,l,h,f=!1,d=!1,p,g=o,_=1;do if(d=f,h=l,g=(i+o)/2,u=this.get(g),c=this.get(o),l=I.getccenter(a,u,c),l.interval={start:i,end:o},f=this._error(l,a,i,o)<=n,p=d&&!f,p||(_=o),f){if(o>=1){if(l.interval.end=_=1,h=l,o>1){let m={x:l.x+l.r*O1(l.e),y:l.y+l.r*N1(l.e)};l.e+=I.angle({x:l.x,y:l.y},m,this.get(1))}break}o=o+(o-i)/2}else o=g;while(!p&&s++<100);if(s>=100)break;h=h||l,r.push(h),i=_}while(o<1);return r}}function ui(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function Z1(e){if(Array.isArray(e))return e}function q1(e){if(Array.isArray(e))return ui(e)}function U1(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function L1(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,s,a,u=[],c=!0,l=!1;try{if(s=(r=r.call(e)).next,n!==0)for(;!(c=(i=s.call(r)).done)&&(u.push(i.value),u.length!==n);c=!0);}catch(h){l=!0,o=h}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}function F1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
99
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function H1(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
100
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V1(e,n){if(e==null)return{};var r,i,o=B1(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],n.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function B1(e,n){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(n.includes(i))continue;r[i]=e[i]}return r}function W1(e,n){return Z1(e)||L1(e,n)||qu(e,n)||F1()}function J1(e){return q1(e)||U1(e)||qu(e)||H1()}function G1(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function X1(e){var n=G1(e,"string");return typeof n=="symbol"?n:n+""}function qu(e,n){if(e){if(typeof e=="string")return ui(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ui(e,n):void 0}}var K1=(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=(n instanceof Array?n.length?n:[void 0]:[n]).map(function(u){return{keyAccessor:u,isProp:!(u instanceof Function)}}),s=e.reduce(function(u,c){var l=u,h=c;return o.forEach(function(f,d){var p=f.keyAccessor,g=f.isProp,_;if(g){var y=h,m=y[p],w=V1(y,[p].map(X1));_=m,h=w}else _=p(h,d);d+1<o.length?(l.hasOwnProperty(_)||(l[_]={}),l=l[_]):r?(l.hasOwnProperty(_)||(l[_]=[]),l[_].push(h)):l[_]=h}),u},{});r instanceof Function&&(function u(c){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;l===o.length?Object.keys(c).forEach(function(h){return c[h]=r(c[h])}):Object.values(c).forEach(function(h){return u(h,l+1)})})(s);var a=s;return i&&(a=[],(function u(c){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];l.length===o.length?a.push({keys:l,vals:c}):Object.entries(c).forEach(function(h){var f=W1(h,2),d=f[0],p=f[1];return u(p,[].concat(J1(l),[d]))})})(s),n instanceof Array&&n.length===0&&a.length===1&&(a[0].keys=[])),a});function Y1(e,n){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(n).domain(e);break}return this}const As=Symbol("implicit");function Uu(){var e=new is,n=[],r=[],i=As;function o(s){let a=e.get(s);if(a===void 0){if(i!==As)return i;e.set(s,a=n.push(s)-1)}return r[a%r.length]}return o.domain=function(s){if(!arguments.length)return n.slice();n=[],e=new is;for(const a of s)e.has(a)||e.set(a,n.push(a)-1);return o},o.range=function(s){return arguments.length?(r=Array.from(s),o):r.slice()},o.unknown=function(s){return arguments.length?(i=s,o):i},o.copy=function(){return Uu(n,r).unknown(i)},Y1.apply(o,arguments),o}function Q1(e){for(var n=e.length/6|0,r=new Array(n),i=0;i<n;)r[i]="#"+e.slice(i*6,++i*6);return r}const ew=Q1("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");function tw(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r==="top"&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var nw=`.force-graph-container canvas {
140
101
  display: block;
141
102
  user-select: none;
142
103
  outline: none;
@@ -159,9 +120,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
159
120
  cursor: -moz-grabbing;
160
121
  cursor: -webkit-grabbing;
161
122
  }
162
- `;fN(dN);function Ga(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,o=Array(n);r<n;r++)o[r]=e[r];return o}function hN(e){if(Array.isArray(e))return e}function pN(e){if(Array.isArray(e))return Ga(e)}function Pf(e,n,r){if(Sy())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,n);var i=new(e.bind.apply(e,o));return i}function xr(e,n,r){return(n=bN(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Sy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Sy=function(){return!!e})()}function mN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gN(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o,i,a,s,u=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(l=(o=a.call(r)).done)&&(u.push(o.value),u.length!==n);l=!0);}catch(d){c=!0,i=d}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return u}}function vN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
163
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _N(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
164
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tf(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,o)}return r}function wn(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Tf(Object(r),!0).forEach(function(o){xr(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tf(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function lr(e,n){return hN(e)||gN(e,n)||Iy(e,n)||vN()}function ot(e){return pN(e)||mN(e)||Iy(e)||_N()}function yN(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function bN(e){var n=yN(e,"string");return typeof n=="symbol"?n:n+""}function Ba(e){"@babel/helpers - typeof";return Ba=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ba(e)}function Iy(e,n){if(e){if(typeof e=="string")return Ga(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ga(e,n):void 0}}var $N=xy(cN);function Ef(e,n,r){!n||typeof r!="string"||e.filter(function(o){return!o[r]}).forEach(function(o){o[r]=$N(n(o))})}function wN(e,n){var r=e.nodes,o=e.links,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.nodeFilter,s=a===void 0?function(){return!0}:a,u=i.onLoopError,l=u===void 0?function(p){throw"Invalid DAG structure! Found cycle in node path: ".concat(p.join(" -> "),".")}:u,c={};r.forEach(function(p){return c[n(p)]={data:p,out:[],depth:-1,skip:!s(p)}}),o.forEach(function(p){var m=p.source,v=p.target,y=$(m),g=$(v);if(!c.hasOwnProperty(y))throw"Missing source node with id: ".concat(y);if(!c.hasOwnProperty(g))throw"Missing target node with id: ".concat(g);var w=c[y],z=c[g];w.out.push(z);function $(b){return Ba(b)==="object"?n(b):b}});var d=[];h(Object.values(c));var f=Object.assign.apply(Object,[{}].concat(ot(Object.entries(c).filter(function(p){var m=lr(p,2),v=m[1];return!v.skip}).map(function(p){var m=lr(p,2),v=m[0],y=m[1];return xr({},v,y.depth)}))));return f;function h(p){for(var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,y=function(){var $=p[g];if(m.indexOf($)!==-1){var b=[].concat(ot(m.slice(m.indexOf($))),[$]).map(function(k){return n(k.data)});return d.some(function(k){return k.length===b.length&&k.every(function(x,O){return x===b[O]})})||(d.push(b),l(b)),1}v>$.depth&&($.depth=v,h($.out,[].concat(ot(m),[$]),v+($.skip?0:1)))},g=0,w=p.length;g<w;g++)y()}}var kN=2,Ze=function(n,r){return r.onNeedsRedraw&&r.onNeedsRedraw()},Nf=function(n,r){if(!r.isShadow){var o=se(r.linkDirectionalParticles);r.graphData.links.forEach(function(i){var a=Math.round(Math.abs(o(i)));a?i.__photons=ot(Array(a)).map(function(){return{}}):delete i.__photons})}},Qi=jl({props:{graphData:{default:{nodes:[],links:[]},onChange:function(n,r){r.engineRunning=!1,Nf(n,r)}},dagMode:{onChange:function(n,r){!n&&(r.graphData.nodes||[]).forEach(function(o){return o.fx=o.fy=void 0})}},dagLevelDistance:{},dagNodeFilter:{default:function(n){return!0}},onDagError:{triggerUpdate:!1},nodeRelSize:{default:4,triggerUpdate:!1,onChange:Ze},nodeId:{default:"id"},nodeVal:{default:"val",triggerUpdate:!1,onChange:Ze},nodeColor:{default:"color",triggerUpdate:!1,onChange:Ze},nodeAutoColorBy:{},nodeCanvasObject:{triggerUpdate:!1,onChange:Ze},nodeCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:Ze},nodeVisibility:{default:!0,triggerUpdate:!1,onChange:Ze},linkSource:{default:"source"},linkTarget:{default:"target"},linkVisibility:{default:!0,triggerUpdate:!1,onChange:Ze},linkColor:{default:"color",triggerUpdate:!1,onChange:Ze},linkAutoColorBy:{},linkLineDash:{triggerUpdate:!1,onChange:Ze},linkWidth:{default:1,triggerUpdate:!1,onChange:Ze},linkCurvature:{default:0,triggerUpdate:!1,onChange:Ze},linkCanvasObject:{triggerUpdate:!1,onChange:Ze},linkCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:Ze},linkDirectionalArrowLength:{default:0,triggerUpdate:!1,onChange:Ze},linkDirectionalArrowColor:{triggerUpdate:!1,onChange:Ze},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1,onChange:Ze},linkDirectionalParticles:{default:0,triggerUpdate:!1,onChange:Nf},linkDirectionalParticleSpeed:{default:.01,triggerUpdate:!1},linkDirectionalParticleOffset:{default:0,triggerUpdate:!1},linkDirectionalParticleWidth:{default:4,triggerUpdate:!1},linkDirectionalParticleColor:{triggerUpdate:!1},linkDirectionalParticleCanvasObject:{triggerUpdate:!1},globalScale:{default:1,triggerUpdate:!1},d3AlphaMin:{default:0,triggerUpdate:!1},d3AlphaDecay:{default:.0228,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaDecay(n)}},d3AlphaTarget:{default:0,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaTarget(n)}},d3VelocityDecay:{default:.4,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.velocityDecay(n)}},warmupTicks:{default:0,triggerUpdate:!1},cooldownTicks:{default:1/0,triggerUpdate:!1},cooldownTime:{default:15e3,triggerUpdate:!1},onUpdate:{default:function(){},triggerUpdate:!1},onFinishUpdate:{default:function(){},triggerUpdate:!1},onEngineTick:{default:function(){},triggerUpdate:!1},onEngineStop:{default:function(){},triggerUpdate:!1},onNeedsRedraw:{triggerUpdate:!1},isShadow:{default:!1,triggerUpdate:!1}},methods:{d3Force:function(n,r,o){return o===void 0?n.forceLayout.force(r):(n.forceLayout.force(r,o),this)},d3ReheatSimulation:function(n){return n.forceLayout.alpha(1),this.resetCountdown(),this},resetCountdown:function(n){return n.cntTicks=0,n.startTickTime=new Date,n.engineRunning=!0,this},isEngineRunning:function(n){return!!n.engineRunning},tickFrame:function(n){return!n.isShadow&&r(),i(),!n.isShadow&&a(),!n.isShadow&&s(),o(),this;function r(){n.engineRunning&&(++n.cntTicks>n.cooldownTicks||new Date-n.startTickTime>n.cooldownTime||n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin?(n.engineRunning=!1,n.onEngineStop()):(n.forceLayout.tick(),n.onEngineTick()))}function o(){var u=se(n.nodeVisibility),l=se(n.nodeVal),c=se(n.nodeColor),d=se(n.nodeCanvasObjectMode),f=n.ctx,h=n.isShadow/n.globalScale,p=n.graphData.nodes.filter(u);f.save(),p.forEach(function(m){var v=d(m);if(n.nodeCanvasObject&&(v==="before"||v==="replace")&&(n.nodeCanvasObject(m,f,n.globalScale),v==="replace")){f.restore();return}var y=Math.sqrt(Math.max(0,l(m)||1))*n.nodeRelSize+h;f.beginPath(),f.arc(m.x,m.y,y,0,2*Math.PI,!1),f.fillStyle=c(m)||"rgba(31, 120, 180, 0.92)",f.fill(),n.nodeCanvasObject&&v==="after"&&n.nodeCanvasObject(m,n.ctx,n.globalScale)}),f.restore()}function i(){var u=se(n.linkVisibility),l=se(n.linkColor),c=se(n.linkWidth),d=se(n.linkLineDash),f=se(n.linkCurvature),h=se(n.linkCanvasObjectMode),p=n.ctx,m=n.isShadow*2,v=n.graphData.links.filter(u);v.forEach(k);var y=[],g=[],w=v;if(n.linkCanvasObject){var z=[],$=[];v.forEach(function(x){return({before:y,after:g,replace:z}[h(x)]||$).push(x)}),w=[].concat(ot(y),g,$),y=y.concat(z)}p.save(),y.forEach(function(x){return n.linkCanvasObject(x,p,n.globalScale)}),p.restore();var b=sN(w,[l,c,d]);p.save(),Object.entries(b).forEach(function(x){var O=lr(x,2),Z=O[0],A=O[1],D=!Z||Z==="undefined"?"rgba(0,0,0,0.15)":Z;Object.entries(A).forEach(function(R){var X=lr(R,2),I=X[0],C=X[1],E=(I||1)/n.globalScale+m;Object.entries(C).forEach(function(F){var B=lr(F,2);B[0];var J=B[1],K=d(J[0]);p.beginPath(),J.forEach(function(W){var te=W.source,le=W.target;if(!(!te||!le||!te.hasOwnProperty("x")||!le.hasOwnProperty("x"))){p.moveTo(te.x,te.y);var ae=W.__controlPoints;ae?p[ae.length===2?"quadraticCurveTo":"bezierCurveTo"].apply(p,ot(ae).concat([le.x,le.y])):p.lineTo(le.x,le.y)}}),p.strokeStyle=D,p.lineWidth=E,p.setLineDash(K||[]),p.stroke()})})}),p.restore(),p.save(),g.forEach(function(x){return n.linkCanvasObject(x,p,n.globalScale)}),p.restore();function k(x){var O=f(x);if(!O){x.__controlPoints=null;return}var Z=x.source,A=x.target;if(!(!Z||!A||!Z.hasOwnProperty("x")||!A.hasOwnProperty("x"))){var D=Math.sqrt(Math.pow(A.x-Z.x,2)+Math.pow(A.y-Z.y,2));if(D>0){var R=Math.atan2(A.y-Z.y,A.x-Z.x),X=D*O,I={x:(Z.x+A.x)/2+X*Math.cos(R-Math.PI/2),y:(Z.y+A.y)/2+X*Math.sin(R-Math.PI/2)};x.__controlPoints=[I.x,I.y]}else{var C=O*70;x.__controlPoints=[A.x,A.y-C,A.x+C,A.y]}}}}function a(){var u=1.6,l=.2,c=se(n.linkDirectionalArrowLength),d=se(n.linkDirectionalArrowRelPos),f=se(n.linkVisibility),h=se(n.linkDirectionalArrowColor||n.linkColor),p=se(n.nodeVal),m=n.ctx;m.save(),n.graphData.links.filter(f).forEach(function(v){var y=c(v);if(!(!y||y<0)){var g=v.source,w=v.target;if(!(!g||!w||!g.hasOwnProperty("x")||!w.hasOwnProperty("x"))){var z=Math.sqrt(Math.max(0,p(g)||1))*n.nodeRelSize,$=Math.sqrt(Math.max(0,p(w)||1))*n.nodeRelSize,b=Math.min(1,Math.max(0,d(v))),k=h(v)||"rgba(0,0,0,0.28)",x=y/u/2,O=v.__controlPoints&&Pf(ge,[g.x,g.y].concat(ot(v.__controlPoints),[w.x,w.y])),Z=O?function(E){return O.get(E)}:function(E){return{x:g.x+(w.x-g.x)*E||0,y:g.y+(w.y-g.y)*E||0}},A=O?O.length():Math.sqrt(Math.pow(w.x-g.x,2)+Math.pow(w.y-g.y,2)),D=z+y+(A-z-$-y)*b,R=Z(D/A),X=Z((D-y)/A),I=Z((D-y*(1-l))/A),C=Math.atan2(R.y-X.y,R.x-X.x)-Math.PI/2;m.beginPath(),m.moveTo(R.x,R.y),m.lineTo(X.x+x*Math.cos(C),X.y+x*Math.sin(C)),m.lineTo(I.x,I.y),m.lineTo(X.x-x*Math.cos(C),X.y-x*Math.sin(C)),m.fillStyle=k,m.fill()}}}),m.restore()}function s(){var u=se(n.linkDirectionalParticles),l=se(n.linkDirectionalParticleSpeed),c=se(n.linkDirectionalParticleOffset),d=se(n.linkDirectionalParticleWidth),f=se(n.linkVisibility),h=se(n.linkDirectionalParticleColor||n.linkColor),p=n.ctx;p.save(),n.graphData.links.filter(f).forEach(function(m){var v=u(m);if(!(!m.hasOwnProperty("__photons")||!m.__photons.length)){var y=m.source,g=m.target;if(!(!y||!g||!y.hasOwnProperty("x")||!g.hasOwnProperty("x"))){var w=l(m),z=Math.abs(c(m)),$=m.__photons||[],b=Math.max(0,d(m)/2)/Math.sqrt(n.globalScale),k=h(m)||"rgba(0,0,0,0.28)";p.fillStyle=k;var x=m.__controlPoints?Pf(ge,[y.x,y.y].concat(ot(m.__controlPoints),[g.x,g.y])):null,O=0,Z=!1;$.forEach(function(A){var D=!!A.__singleHop;if(A.hasOwnProperty("__progressRatio")||(A.__progressRatio=D?0:(O+z)/v),!D&&O++,A.__progressRatio+=w,A.__progressRatio>=1)if(!D)A.__progressRatio=A.__progressRatio%1;else{Z=!0;return}var R=A.__progressRatio,X=x?x.get(R):{x:y.x+(g.x-y.x)*R||0,y:y.y+(g.y-y.y)*R||0};n.linkDirectionalParticleCanvasObject?n.linkDirectionalParticleCanvasObject(X.x,X.y,m,p,n.globalScale):(p.beginPath(),p.arc(X.x,X.y,b,0,2*Math.PI,!1),p.fill())}),Z&&(m.__photons=m.__photons.filter(function(A){return!A.__singleHop||A.__progressRatio<=1}))}}}),p.restore()}},emitParticle:function(n,r){return r&&(!r.__photons&&(r.__photons=[]),r.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:x4().force("link",I_()).force("charge",P_()).force("center",w_()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(n,r){r.ctx=n},update:function(n,r){n.engineRunning=!1,n.onUpdate(),n.nodeAutoColorBy!==null&&Ef(n.graphData.nodes,se(n.nodeAutoColorBy),n.nodeColor),n.linkAutoColorBy!==null&&Ef(n.graphData.links,se(n.linkAutoColorBy),n.linkColor),n.graphData.links.forEach(function(h){h.source=h[n.linkSource],h.target=h[n.linkTarget]}),n.forceLayout.stop().alpha(1).nodes(n.graphData.nodes);var o=n.forceLayout.force("link");o&&o.id(function(h){return h[n.nodeId]}).links(n.graphData.links);var i=n.dagMode&&wN(n.graphData,function(h){return h[n.nodeId]},{nodeFilter:n.dagNodeFilter,onLoopError:n.onDagError||void 0}),a=Math.max.apply(Math,ot(Object.values(i||[]))),s=n.dagLevelDistance||n.graphData.nodes.length/(a||1)*kN*(["radialin","radialout"].indexOf(n.dagMode)!==-1?.7:1);if(["lr","rl","td","bu"].includes(r.dagMode)){var u=["lr","rl"].includes(r.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(h){return delete h[u]})}if(["lr","rl","td","bu"].includes(n.dagMode)){var l=["rl","bu"].includes(n.dagMode),c=function(p){return(i[p[n.nodeId]]-a/2)*s*(l?-1:1)},d=["lr","rl"].includes(n.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(h){return h[d]=c(h)})}n.forceLayout.force("dagRadial",["radialin","radialout"].indexOf(n.dagMode)!==-1?S4(function(h){var p=i[h[n.nodeId]]||-1;return(n.dagMode==="radialin"?a-p:p)*s}).strength(function(h){return n.dagNodeFilter(h)?1:0}):null);for(var f=0;f<n.warmupTicks&&!(n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin);f++)n.forceLayout.tick();this.resetCountdown(),n.onFinishUpdate()}});function zy(e,n){var r=e instanceof Array?e:[e],o=new n;return o._destructor&&o._destructor(),{linkProp:function(a){return{default:o[a](),onChange:function(u,l){r.forEach(function(c){return l[c][a](u)})},triggerUpdate:!1}},linkMethod:function(a){return function(s){for(var u=arguments.length,l=new Array(u>1?u-1:0),c=1;c<u;c++)l[c-1]=arguments[c];var d=[];return r.forEach(function(f){var h=s[f],p=h[a].apply(h,l);p!==h&&d.push(p)}),d.length?d[0]:this}}}}var xN=800,SN=4,IN=5,Oy=zy("forceGraph",Qi),zN=zy(["forceGraph","shadowGraph"],Qi),ON=Object.assign.apply(Object,ot(["nodeColor","nodeAutoColorBy","nodeCanvasObject","nodeCanvasObjectMode","linkColor","linkAutoColorBy","linkLineDash","linkWidth","linkCanvasObject","linkCanvasObjectMode","linkDirectionalArrowLength","linkDirectionalArrowColor","linkDirectionalArrowRelPos","linkDirectionalParticles","linkDirectionalParticleSpeed","linkDirectionalParticleOffset","linkDirectionalParticleWidth","linkDirectionalParticleColor","linkDirectionalParticleCanvasObject","dagMode","dagLevelDistance","dagNodeFilter","onDagError","d3AlphaMin","d3AlphaDecay","d3VelocityDecay","warmupTicks","cooldownTicks","cooldownTime","onEngineTick","onEngineStop"].map(function(e){return xr({},e,Oy.linkProp(e))})).concat(ot(["nodeRelSize","nodeId","nodeVal","nodeVisibility","linkSource","linkTarget","linkVisibility","linkCurvature"].map(function(e){return xr({},e,zN.linkProp(e))})))),PN=Object.assign.apply(Object,ot(["d3Force","d3ReheatSimulation","emitParticle"].map(function(e){return xr({},e,Oy.linkMethod(e))})));function ya(e){if(e.canvas){var n=e.canvas.width,r=e.canvas.height;n===300&&r===150&&(n=r=0);var o=window.devicePixelRatio;n/=o,r/=o,[e.canvas,e.shadowCanvas].forEach(function(a){a.style.width="".concat(e.width,"px"),a.style.height="".concat(e.height,"px"),a.width=e.width*o,a.height=e.height*o,!n&&!r&&a.getContext("2d").scale(o,o)});var i=wt(e.canvas).k;e.zoom.translateBy(e.zoom.__baseElem,(e.width-n)/2/i,(e.height-r)/2/i),e.needsRedraw=!0}}function Py(e){var n=window.devicePixelRatio;e.setTransform(n,0,0,n,0,0)}function Uf(e,n,r){e.save(),Py(e),e.clearRect(0,0,n,r),e.restore()}var TN=jl({props:wn({width:{default:window.innerWidth,onChange:function(n,r){return ya(r)},triggerUpdate:!1},height:{default:window.innerHeight,onChange:function(n,r){return ya(r)},triggerUpdate:!1},graphData:{default:{nodes:[],links:[]},onChange:function(n,r){[n.nodes,n.links].every(function(i){return(i||[]).every(function(a){return!a.hasOwnProperty("__indexColor")})})&&r.colorTracker.reset(),[{type:"Node",objs:n.nodes},{type:"Link",objs:n.links}].forEach(o),r.forceGraph.graphData(n),r.shadowGraph.graphData(n);function o(i){var a=i.type,s=i.objs;s.filter(function(u){if(!u.hasOwnProperty("__indexColor"))return!0;var l=r.colorTracker.lookup(u.__indexColor);return!l||!l.hasOwnProperty("d")||l.d!==u}).forEach(function(u){u.__indexColor=r.colorTracker.register({type:a,d:u})})}},triggerUpdate:!1},backgroundColor:{onChange:function(n,r){r.canvas&&n&&(r.canvas.style.background=n)},triggerUpdate:!1},nodeLabel:{default:"name",triggerUpdate:!1},nodePointerAreaPaint:{onChange:function(n,r){r.shadowGraph.nodeCanvasObject(n?function(o,i,a){return n(o,o.__indexColor,i,a)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkPointerAreaPaint:{onChange:function(n,r){r.shadowGraph.linkCanvasObject(n?function(o,i,a){return n(o,o.__indexColor,i,a)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkLabel:{default:"name",triggerUpdate:!1},linkHoverPrecision:{default:4,triggerUpdate:!1},minZoom:{default:.01,onChange:function(n,r){r.zoom.scaleExtent([n,r.zoom.scaleExtent()[1]])},triggerUpdate:!1},maxZoom:{default:1e3,onChange:function(n,r){r.zoom.scaleExtent([r.zoom.scaleExtent()[0],n])},triggerUpdate:!1},enableNodeDrag:{default:!0,triggerUpdate:!1},enableZoomInteraction:{default:!0,triggerUpdate:!1},enablePanInteraction:{default:!0,triggerUpdate:!1},enableZoomPanInteraction:{default:!0,triggerUpdate:!1},enablePointerInteraction:{default:!0,onChange:function(n,r){r.hoverObj=null},triggerUpdate:!1},autoPauseRedraw:{default:!0,triggerUpdate:!1},onNodeDrag:{default:function(){},triggerUpdate:!1},onNodeDragEnd:{default:function(){},triggerUpdate:!1},onNodeClick:{triggerUpdate:!1},onNodeRightClick:{triggerUpdate:!1},onNodeHover:{triggerUpdate:!1},onLinkClick:{triggerUpdate:!1},onLinkRightClick:{triggerUpdate:!1},onLinkHover:{triggerUpdate:!1},onBackgroundClick:{triggerUpdate:!1},onBackgroundRightClick:{triggerUpdate:!1},showPointerCursor:{default:!0,triggerUpdate:!1},onZoom:{triggerUpdate:!1},onZoomEnd:{triggerUpdate:!1},onRenderFramePre:{triggerUpdate:!1},onRenderFramePost:{triggerUpdate:!1}},ON),aliases:{stopAnimation:"pauseAnimation"},methods:wn({graph2ScreenCoords:function(n,r,o){var i=wt(n.canvas);return{x:r*i.k+i.x,y:o*i.k+i.y}},screen2GraphCoords:function(n,r,o){var i=wt(n.canvas);return{x:(r-i.x)/i.k,y:(o-i.y)/i.k}},centerAt:function(n,r,o,i){if(!n.canvas)return null;if(r!==void 0||o!==void 0){var a=Object.assign({},r!==void 0?{x:r}:{},o!==void 0?{y:o}:{});return i?n.tweenGroup.add(new lf(s()).to(a,i).easing(cn.Quadratic.Out).onUpdate(u).start()):u(a),this}return s();function s(){var l=wt(n.canvas);return{x:(n.width/2-l.x)/l.k,y:(n.height/2-l.y)/l.k}}function u(l){var c=l.x,d=l.y;n.zoom.translateTo(n.zoom.__baseElem,c===void 0?s().x:c,d===void 0?s().y:d),n.needsRedraw=!0}},zoom:function(n,r,o){if(!n.canvas)return null;if(r!==void 0)return o?n.tweenGroup.add(new lf({k:i()}).to({k:r},o).easing(cn.Quadratic.Out).onUpdate(function(s){var u=s.k;return a(u)}).start()):a(r),this;return i();function i(){return wt(n.canvas).k}function a(s){n.zoom.scaleTo(n.zoom.__baseElem,s),n.needsRedraw=!0}},zoomToFit:function(n){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,i=arguments.length,a=new Array(i>3?i-3:0),s=3;s<i;s++)a[s-3]=arguments[s];var u=this.getGraphBbox.apply(this,a);if(u){var l={x:(u.x[0]+u.x[1])/2,y:(u.y[0]+u.y[1])/2},c=Math.max(1e-12,Math.min(1e12,(n.width-o*2)/(u.x[1]-u.x[0]),(n.height-o*2)/(u.y[1]-u.y[0])));this.centerAt(l.x,l.y,r),this.zoom(c,r)}return this},getGraphBbox:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},o=se(n.nodeVal),i=function(u){return Math.sqrt(Math.max(0,o(u)||1))*n.nodeRelSize},a=n.graphData.nodes.filter(r).map(function(s){return{x:s.x,y:s.y,r:i(s)}});return a.length?{x:[of(a,function(s){return s.x-s.r}),rf(a,function(s){return s.x+s.r})],y:[of(a,function(s){return s.y-s.r}),rf(a,function(s){return s.y+s.r})]}:null},pauseAnimation:function(n){return n.animationFrameRequestId&&(cancelAnimationFrame(n.animationFrameRequestId),n.animationFrameRequestId=null),this},resumeAnimation:function(n){return n.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},PN),stateInit:function(){return{lastSetZoom:1,zoom:XP(),forceGraph:new Qi,shadowGraph:new Qi().cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new bE,tweenGroup:new ry}},init:function(n,r){var o=this;n.innerHTML="";var i=document.createElement("div");i.classList.add("force-graph-container"),i.style.position="relative",n.appendChild(i),r.canvas=document.createElement("canvas"),r.backgroundColor&&(r.canvas.style.background=r.backgroundColor),i.appendChild(r.canvas),r.shadowCanvas=document.createElement("canvas");var a=r.canvas.getContext("2d"),s=r.shadowCanvas.getContext("2d",{willReadFrequently:!0}),u={x:-1e12,y:-1e12},l=function(){var f=null,h=window.devicePixelRatio,p=u.x>0&&u.y>0?s.getImageData(u.x*h,u.y*h,1,1):null;return p&&(f=r.colorTracker.lookup(p.data)),f};it(r.canvas).call(cO().subject(function(){if(!r.enableNodeDrag)return null;var d=l();return d&&d.type==="Node"?d.d:null}).on("start",function(d){var f=d.subject;f.__initialDragPos={x:f.x,y:f.y,fx:f.fx,fy:f.fy},d.active||(f.fx=f.x,f.fy=f.y),r.canvas.classList.add("grabbable")}).on("drag",function(d){var f=d.subject,h=f.__initialDragPos,p=d,m=wt(r.canvas).k,v={x:h.x+(p.x-h.x)/m-f.x,y:h.y+(p.y-h.y)/m-f.y};["x","y"].forEach(function(y){return f["f".concat(y)]=f[y]=h[y]+(p[y]-h[y])/m}),!(!f.__dragged&&IN>=Math.sqrt(eT(["x","y"].map(function(y){return Math.pow(d[y]-h[y],2)}))))&&(r.forceGraph.d3AlphaTarget(.3).resetCountdown(),r.isPointerDragging=!0,f.__dragged=!0,r.onNodeDrag(f,v))}).on("end",function(d){var f=d.subject,h=f.__initialDragPos,p={x:f.x-h.x,y:f.y-h.y};h.fx===void 0&&(f.fx=void 0),h.fy===void 0&&(f.fy=void 0),delete f.__initialDragPos,r.forceGraph.d3AlphaTarget()&&r.forceGraph.d3AlphaTarget(0).resetCountdown(),r.canvas.classList.remove("grabbable"),r.isPointerDragging=!1,f.__dragged&&(delete f.__dragged,r.onNodeDragEnd(f,p))})),r.zoom(r.zoom.__baseElem=it(r.canvas)),r.zoom.__baseElem.on("dblclick.zoom",null),r.zoom.filter(function(d){return!d.button&&r.enableZoomPanInteraction&&(d.type!=="wheel"||se(r.enableZoomInteraction)(d))&&(d.type==="wheel"||se(r.enablePanInteraction)(d))}).on("zoom",function(d){var f=d.transform;[a,s].forEach(function(h){Py(h),h.translate(f.x,f.y),h.scale(f.k,f.k)}),r.isPointerDragging=!0,r.onZoom&&r.onZoom(wn(wn({},f),o.centerAt())),r.needsRedraw=!0}).on("end",function(d){r.isPointerDragging=!1,r.onZoomEnd&&r.onZoomEnd(wn(wn({},d.transform),o.centerAt()))}),ya(r),r.forceGraph.onNeedsRedraw(function(){return r.needsRedraw=!0}).onFinishUpdate(function(){wt(r.canvas).k===r.lastSetZoom&&r.graphData.nodes.length&&(r.zoom.scaleTo(r.zoom.__baseElem,r.lastSetZoom=SN/Math.cbrt(r.graphData.nodes.length)),r.needsRedraw=!0)}),r.tooltip=new LE(i),["pointermove","pointerdown"].forEach(function(d){return i.addEventListener(d,function(f){d==="pointerdown"&&(r.isPointerPressed=!0,r.pointerDownEvent=f),!r.isPointerDragging&&f.type==="pointermove"&&r.onBackgroundClick&&(f.pressure>0||r.isPointerPressed)&&(f.pointerType==="mouse"||f.movementX===void 0||[f.movementX,f.movementY].some(function(m){return Math.abs(m)>1}))&&(r.isPointerDragging=!0);var h=p(i);u.x=f.pageX-h.left,u.y=f.pageY-h.top;function p(m){var v=m.getBoundingClientRect(),y=window.pageXOffset||document.documentElement.scrollLeft,g=window.pageYOffset||document.documentElement.scrollTop;return{top:v.top+g,left:v.left+y}}},{passive:!0})}),i.addEventListener("pointerup",function(d){if(r.isPointerPressed){if(r.isPointerPressed=!1,r.isPointerDragging){r.isPointerDragging=!1;return}var f=[d,r.pointerDownEvent];requestAnimationFrame(function(){if(d.button===0)if(r.hoverObj){var h=r["on".concat(r.hoverObj.type,"Click")];h&&h.apply(void 0,[r.hoverObj.d].concat(f))}else r.onBackgroundClick&&r.onBackgroundClick.apply(r,f);if(d.button===2)if(r.hoverObj){var p=r["on".concat(r.hoverObj.type,"RightClick")];p&&p.apply(void 0,[r.hoverObj.d].concat(f))}else r.onBackgroundRightClick&&r.onBackgroundRightClick.apply(r,f)})}},{passive:!0}),i.addEventListener("contextmenu",function(d){return!r.onBackgroundRightClick&&!r.onNodeRightClick&&!r.onLinkRightClick?!0:(d.preventDefault(),!1)}),r.forceGraph(a),r.shadowGraph(s);var c=zT(function(){Uf(s,r.width,r.height),r.shadowGraph.linkWidth(function(f){return se(r.linkWidth)(f)+r.linkHoverPrecision});var d=wt(r.canvas);r.shadowGraph.globalScale(d.k).tickFrame()},xN);r.flushShadowCanvas=c.flush,(this._animationCycle=function d(){var f=!r.autoPauseRedraw||!!r.needsRedraw||r.forceGraph.isEngineRunning()||r.graphData.links.some(function(z){return z.__photons&&z.__photons.length});if(r.needsRedraw=!1,r.enablePointerInteraction){var h=r.isPointerDragging?null:l();if(h!==r.hoverObj){var p=r.hoverObj,m=p?p.type:null,v=h?h.type:null;if(m&&m!==v){var y=r["on".concat(m,"Hover")];y&&y(null,p.d)}if(v){var g=r["on".concat(v,"Hover")];g&&g(h.d,m===v?p.d:null)}r.tooltip.content(h&&se(r["".concat(h.type.toLowerCase(),"Label")])(h.d)||null),r.canvas.classList[(h&&r["on".concat(v,"Click")]||!h&&r.onBackgroundClick)&&se(r.showPointerCursor)(h==null?void 0:h.d)?"add":"remove"]("clickable"),r.hoverObj=h}f&&c()}if(f){Uf(a,r.width,r.height);var w=wt(r.canvas).k;r.onRenderFramePre&&r.onRenderFramePre(a,w),r.forceGraph.globalScale(w).tickFrame(),r.onRenderFramePost&&r.onRenderFramePost(a,w)}r.tweenGroup.update(),r.animationFrameRequestId=requestAnimationFrame(d)})()},update:function(n){}});function wi(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()||"#000"}const Xe={nodes:[],links:[]};let mn=null,ar=null;const Ty=document.getElementById("graph"),Vt=document.getElementById("popup"),EN=Vt.querySelector(".popup-title"),ba=Vt.querySelector(".popup-error"),NN=document.getElementById("open-btn"),gt=document.getElementById("expand-btn"),UN=document.getElementById("zoom-in"),AN=document.getElementById("zoom-out"),jN=document.getElementById("reset-graph"),lt=new TN(Ty).nodeId("url").nodeLabel("title").nodeColor(e=>{switch(e.state){case"expanded":return wi("--node-expanded");case"error":return wi("--node-error");default:return wi("--node-default")}}).nodeVal(8).linkDirectionalArrowLength(6).linkDirectionalArrowRelPos(1).linkColor(()=>wi("--link-color")).onNodeClick(RN).onBackgroundClick(()=>ai()).d3Force("charge",P_().strength(-80)).d3Force("link",I_().distance(60)).d3Force("collide",u4(12)).d3Force("center",w_()).d3VelocityDecay(.3).cooldownTime(1/0).d3AlphaMin(0).d3Force("ambient",()=>{for(const e of Xe.nodes)e.vx!==void 0&&e.vy!==void 0&&(e.vx+=(Math.random()-.5)*.1,e.vy+=(Math.random()-.5)*.1)}).graphData(Xe);function Ey(){const{width:e,height:n}=Ty.getBoundingClientRect();lt.width(e).height(n)}window.addEventListener("resize",Ey);Ey();function eo(e,n,r="default",o){if(Xe.nodes.find(s=>s.url===e))return!1;const a={url:e,title:n,state:r};return o&&(a.x=o.x+(Math.random()-.5)*20,a.y=o.y+(Math.random()-.5)*20),Xe.nodes.push(a),!0}function ZN(e,n){const r=Xe.nodes.find(o=>o.url===e);r&&(r.title=n)}function Xa(e,n,r){const o=Xe.nodes.find(i=>i.url===e);o&&(o.state=n,o.errorMessage=r)}function CN(e,n){return Xe.links.find(o=>{const i=typeof o.source=="string"?o.source:o.source.url,a=typeof o.target=="string"?o.target:o.target.url;return i===e&&a===n})?!1:(Xe.links.push({source:e,target:n}),!0)}function Ml(){lt.graphData({nodes:[...Xe.nodes],links:[...Xe.links]})}function DN(e,n,r){EN.textContent=e.title,e.state==="error"?(ba.textContent=e.errorMessage||"Failed to load page",ba.style.display="block",gt.style.display="none"):(ba.style.display="none",gt.style.display="inline-block",e.state==="expanded"?(gt.setAttribute("disabled","true"),gt.textContent="Expanded"):(gt.removeAttribute("disabled"),gt.textContent="Expand")),Vt.style.display="block";const o=Vt.getBoundingClientRect(),i=15,a=n<window.innerWidth/2?n+i:n-o.width-i,s=r<window.innerHeight/2?r+i:r-o.height-i;Vt.style.left=`${a}px`,Vt.style.top=`${s}px`}function ai(){Vt.style.display="none",mn=null}function RN(e,n){if(mn===e.url){ai();return}mn=e.url,DN(e,n.clientX,n.clientY)}document.addEventListener("keydown",e=>{e.key==="Escape"&&Vt.style.display==="block"&&ai()});const Ny=1.5;UN.addEventListener("click",()=>{const e=lt.zoom();lt.zoom(e*Ny,200)});AN.addEventListener("click",()=>{const e=lt.zoom();lt.zoom(e/Ny,200)});const Rt=new c2({name:"Wiki Explorer",version:"1.0.0"});jN.addEventListener("click",async()=>{if(!ar)return;const e=await Rt.callServerTool({name:"get-first-degree-links",arguments:{url:ar}});Xe.nodes=[],Xe.links=[],eo(ar,ar,"default",{x:0,y:0}),lt.warmupTicks(100),Ll(e),lt.centerAt(0,0,500)});NN.addEventListener("click",async()=>{mn&&(await Rt.openLink({url:mn}),ai())});gt.addEventListener("click",async()=>{if(!mn)return;const e=mn;gt.setAttribute("disabled","true"),gt.textContent="Loading...";try{const n=await Rt.callServerTool({name:"get-first-degree-links",arguments:{url:e}});lt.warmupTicks(0),Ll(n)}catch(n){console.error("Expand error:",n),Xa(e,"error","Request failed"),Ml()}finally{gt.removeAttribute("disabled"),gt.textContent="Expand",ai()}});Rt.ontoolinput=e=>{const n=e.arguments;n!=null&&n.url&&(ar=n.url,eo(n.url,n.url,"default",{x:0,y:0}),lt.warmupTicks(100),Ml(),lt.centerAt(0,0,500))};Rt.ontoolresult=e=>{lt.warmupTicks(100),Ll(e)};function Ll(e){if(e.isError){console.error("Tool result error:",e);return}const n=e.structuredContent,{page:r,links:o,error:i}=n;if(eo(r.url,r.title),ZN(r.url,r.title),i)Xa(r.url,"error",i);else{const a=Xe.nodes.find(u=>u.url===r.url),s=a?{x:a.x??0,y:a.y??0}:void 0;for(const u of o)eo(u.url,u.title,"default",s),CN(r.url,u.url);Xa(r.url,"expanded")}Ml()}Rt.onerror=e=>{console.error("[Wiki Explorer] App error:",e)};function Uy(e){e.safeAreaInsets&&(document.body.style.paddingTop=`${e.safeAreaInsets.top}px`,document.body.style.paddingRight=`${e.safeAreaInsets.right}px`,document.body.style.paddingBottom=`${e.safeAreaInsets.bottom}px`,document.body.style.paddingLeft=`${e.safeAreaInsets.left}px`)}Rt.onhostcontextchanged=Uy;Rt.connect().then(()=>{const e=Rt.getHostContext();e&&Uy(e)});</script>
123
+ `;tw(nw);function ci(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function rw(e){if(Array.isArray(e))return e}function iw(e){if(Array.isArray(e))return ci(e)}function Rs(e,n,r){if(Lu())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,n);var o=new(e.bind.apply(e,i));return o}function yn(e,n,r){return(n=lw(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Lu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Lu=function(){return!!e})()}function ow(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sw(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,s,a,u=[],c=!0,l=!1;try{if(s=(r=r.call(e)).next,n!==0)for(;!(c=(i=s.call(r)).done)&&(u.push(i.value),u.length!==n);c=!0);}catch(h){l=!0,o=h}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}function aw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
124
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uw(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
125
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $s(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function Rt(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?$s(Object(r),!0).forEach(function(i){yn(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$s(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function un(e,n){return rw(e)||sw(e,n)||Fu(e,n)||aw()}function je(e){return iw(e)||ow(e)||Fu(e)||uw()}function cw(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function lw(e){var n=cw(e,"string");return typeof n=="symbol"?n:n+""}function li(e){"@babel/helpers - typeof";return li=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},li(e)}function Fu(e,n){if(e){if(typeof e=="string")return ci(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ci(e,n):void 0}}var fw=Uu(ew);function Is(e,n,r){!n||typeof r!="string"||e.filter(function(i){return!i[r]}).forEach(function(i){i[r]=fw(n(i))})}function hw(e,n){var r=e.nodes,i=e.links,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=o.nodeFilter,a=s===void 0?function(){return!0}:s,u=o.onLoopError,c=u===void 0?function(p){throw"Invalid DAG structure! Found cycle in node path: ".concat(p.join(" -> "),".")}:u,l={};r.forEach(function(p){return l[n(p)]={data:p,out:[],depth:-1,skip:!a(p)}}),i.forEach(function(p){var g=p.source,_=p.target,y=b(g),m=b(_);if(!l.hasOwnProperty(y))throw"Missing source node with id: ".concat(y);if(!l.hasOwnProperty(m))throw"Missing target node with id: ".concat(m);var w=l[y],C=l[m];w.out.push(C);function b(v){return li(v)==="object"?n(v):v}});var h=[];d(Object.values(l));var f=Object.assign.apply(Object,[{}].concat(je(Object.entries(l).filter(function(p){var g=un(p,2),_=g[1];return!_.skip}).map(function(p){var g=un(p,2),_=g[0],y=g[1];return yn({},_,y.depth)}))));return f;function d(p){for(var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,y=function(){var b=p[m];if(g.indexOf(b)!==-1){var v=[].concat(je(g.slice(g.indexOf(b))),[b]).map(function(k){return n(k.data)});return h.some(function(k){return k.length===v.length&&k.every(function(x,P){return x===v[P]})})||(h.push(v),c(v)),1}_>b.depth&&(b.depth=_,d(b.out,[].concat(je(g),[b]),_+(b.skip?0:1)))},m=0,w=p.length;m<w;m++)y()}}var dw=2,we=function(n,r){return r.onNeedsRedraw&&r.onNeedsRedraw()},Ms=function(n,r){if(!r.isShadow){var i=Y(r.linkDirectionalParticles);r.graphData.links.forEach(function(o){var s=Math.round(Math.abs(i(o)));s?o.__photons=je(Array(s)).map(function(){return{}}):delete o.__photons})}},fr=to({props:{graphData:{default:{nodes:[],links:[]},onChange:function(n,r){r.engineRunning=!1,Ms(n,r)}},dagMode:{onChange:function(n,r){!n&&(r.graphData.nodes||[]).forEach(function(i){return i.fx=i.fy=void 0})}},dagLevelDistance:{},dagNodeFilter:{default:function(n){return!0}},onDagError:{triggerUpdate:!1},nodeRelSize:{default:4,triggerUpdate:!1,onChange:we},nodeId:{default:"id"},nodeVal:{default:"val",triggerUpdate:!1,onChange:we},nodeColor:{default:"color",triggerUpdate:!1,onChange:we},nodeAutoColorBy:{},nodeCanvasObject:{triggerUpdate:!1,onChange:we},nodeCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:we},nodeVisibility:{default:!0,triggerUpdate:!1,onChange:we},linkSource:{default:"source"},linkTarget:{default:"target"},linkVisibility:{default:!0,triggerUpdate:!1,onChange:we},linkColor:{default:"color",triggerUpdate:!1,onChange:we},linkAutoColorBy:{},linkLineDash:{triggerUpdate:!1,onChange:we},linkWidth:{default:1,triggerUpdate:!1,onChange:we},linkCurvature:{default:0,triggerUpdate:!1,onChange:we},linkCanvasObject:{triggerUpdate:!1,onChange:we},linkCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:we},linkDirectionalArrowLength:{default:0,triggerUpdate:!1,onChange:we},linkDirectionalArrowColor:{triggerUpdate:!1,onChange:we},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1,onChange:we},linkDirectionalParticles:{default:0,triggerUpdate:!1,onChange:Ms},linkDirectionalParticleSpeed:{default:.01,triggerUpdate:!1},linkDirectionalParticleOffset:{default:0,triggerUpdate:!1},linkDirectionalParticleWidth:{default:4,triggerUpdate:!1},linkDirectionalParticleColor:{triggerUpdate:!1},linkDirectionalParticleCanvasObject:{triggerUpdate:!1},globalScale:{default:1,triggerUpdate:!1},d3AlphaMin:{default:0,triggerUpdate:!1},d3AlphaDecay:{default:.0228,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaDecay(n)}},d3AlphaTarget:{default:0,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaTarget(n)}},d3VelocityDecay:{default:.4,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.velocityDecay(n)}},warmupTicks:{default:0,triggerUpdate:!1},cooldownTicks:{default:1/0,triggerUpdate:!1},cooldownTime:{default:15e3,triggerUpdate:!1},onUpdate:{default:function(){},triggerUpdate:!1},onFinishUpdate:{default:function(){},triggerUpdate:!1},onEngineTick:{default:function(){},triggerUpdate:!1},onEngineStop:{default:function(){},triggerUpdate:!1},onNeedsRedraw:{triggerUpdate:!1},isShadow:{default:!1,triggerUpdate:!1}},methods:{d3Force:function(n,r,i){return i===void 0?n.forceLayout.force(r):(n.forceLayout.force(r,i),this)},d3ReheatSimulation:function(n){return n.forceLayout.alpha(1),this.resetCountdown(),this},resetCountdown:function(n){return n.cntTicks=0,n.startTickTime=new Date,n.engineRunning=!0,this},isEngineRunning:function(n){return!!n.engineRunning},tickFrame:function(n){return!n.isShadow&&r(),o(),!n.isShadow&&s(),!n.isShadow&&a(),i(),this;function r(){n.engineRunning&&(++n.cntTicks>n.cooldownTicks||new Date-n.startTickTime>n.cooldownTime||n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin?(n.engineRunning=!1,n.onEngineStop()):(n.forceLayout.tick(),n.onEngineTick()))}function i(){var u=Y(n.nodeVisibility),c=Y(n.nodeVal),l=Y(n.nodeColor),h=Y(n.nodeCanvasObjectMode),f=n.ctx,d=n.isShadow/n.globalScale,p=n.graphData.nodes.filter(u);f.save(),p.forEach(function(g){var _=h(g);if(n.nodeCanvasObject&&(_==="before"||_==="replace")&&(n.nodeCanvasObject(g,f,n.globalScale),_==="replace")){f.restore();return}var y=Math.sqrt(Math.max(0,c(g)||1))*n.nodeRelSize+d;f.beginPath(),f.arc(g.x,g.y,y,0,2*Math.PI,!1),f.fillStyle=l(g)||"rgba(31, 120, 180, 0.92)",f.fill(),n.nodeCanvasObject&&_==="after"&&n.nodeCanvasObject(g,n.ctx,n.globalScale)}),f.restore()}function o(){var u=Y(n.linkVisibility),c=Y(n.linkColor),l=Y(n.linkWidth),h=Y(n.linkLineDash),f=Y(n.linkCurvature),d=Y(n.linkCanvasObjectMode),p=n.ctx,g=n.isShadow*2,_=n.graphData.links.filter(u);_.forEach(k);var y=[],m=[],w=_;if(n.linkCanvasObject){var C=[],b=[];_.forEach(function(x){return({before:y,after:m,replace:C}[d(x)]||b).push(x)}),w=[].concat(je(y),m,b),y=y.concat(C)}p.save(),y.forEach(function(x){return n.linkCanvasObject(x,p,n.globalScale)}),p.restore();var v=K1(w,[c,l,h]);p.save(),Object.entries(v).forEach(function(x){var P=un(x,2),M=P[0],$=P[1],N=!M||M==="undefined"?"rgba(0,0,0,0.15)":M;Object.entries($).forEach(function(D){var H=un(D,2),z=H[0],O=H[1],R=(z||1)/n.globalScale+g;Object.entries(O).forEach(function(j){var F=un(j,2);F[0];var q=F[1],V=h(q[0]);p.beginPath(),q.forEach(function(L){var W=L.source,ee=L.target;if(!(!W||!ee||!W.hasOwnProperty("x")||!ee.hasOwnProperty("x"))){p.moveTo(W.x,W.y);var K=L.__controlPoints;K?p[K.length===2?"quadraticCurveTo":"bezierCurveTo"].apply(p,je(K).concat([ee.x,ee.y])):p.lineTo(ee.x,ee.y)}}),p.strokeStyle=N,p.lineWidth=R,p.setLineDash(V||[]),p.stroke()})})}),p.restore(),p.save(),m.forEach(function(x){return n.linkCanvasObject(x,p,n.globalScale)}),p.restore();function k(x){var P=f(x);if(!P){x.__controlPoints=null;return}var M=x.source,$=x.target;if(!(!M||!$||!M.hasOwnProperty("x")||!$.hasOwnProperty("x"))){var N=Math.sqrt(Math.pow($.x-M.x,2)+Math.pow($.y-M.y,2));if(N>0){var D=Math.atan2($.y-M.y,$.x-M.x),H=N*P,z={x:(M.x+$.x)/2+H*Math.cos(D-Math.PI/2),y:(M.y+$.y)/2+H*Math.sin(D-Math.PI/2)};x.__controlPoints=[z.x,z.y]}else{var O=P*70;x.__controlPoints=[$.x,$.y-O,$.x+O,$.y]}}}}function s(){var u=1.6,c=.2,l=Y(n.linkDirectionalArrowLength),h=Y(n.linkDirectionalArrowRelPos),f=Y(n.linkVisibility),d=Y(n.linkDirectionalArrowColor||n.linkColor),p=Y(n.nodeVal),g=n.ctx;g.save(),n.graphData.links.filter(f).forEach(function(_){var y=l(_);if(!(!y||y<0)){var m=_.source,w=_.target;if(!(!m||!w||!m.hasOwnProperty("x")||!w.hasOwnProperty("x"))){var C=Math.sqrt(Math.max(0,p(m)||1))*n.nodeRelSize,b=Math.sqrt(Math.max(0,p(w)||1))*n.nodeRelSize,v=Math.min(1,Math.max(0,h(_))),k=d(_)||"rgba(0,0,0,0.28)",x=y/u/2,P=_.__controlPoints&&Rs(se,[m.x,m.y].concat(je(_.__controlPoints),[w.x,w.y])),M=P?function(R){return P.get(R)}:function(R){return{x:m.x+(w.x-m.x)*R||0,y:m.y+(w.y-m.y)*R||0}},$=P?P.length():Math.sqrt(Math.pow(w.x-m.x,2)+Math.pow(w.y-m.y,2)),N=C+y+($-C-b-y)*v,D=M(N/$),H=M((N-y)/$),z=M((N-y*(1-c))/$),O=Math.atan2(D.y-H.y,D.x-H.x)-Math.PI/2;g.beginPath(),g.moveTo(D.x,D.y),g.lineTo(H.x+x*Math.cos(O),H.y+x*Math.sin(O)),g.lineTo(z.x,z.y),g.lineTo(H.x-x*Math.cos(O),H.y-x*Math.sin(O)),g.fillStyle=k,g.fill()}}}),g.restore()}function a(){var u=Y(n.linkDirectionalParticles),c=Y(n.linkDirectionalParticleSpeed),l=Y(n.linkDirectionalParticleOffset),h=Y(n.linkDirectionalParticleWidth),f=Y(n.linkVisibility),d=Y(n.linkDirectionalParticleColor||n.linkColor),p=n.ctx;p.save(),n.graphData.links.filter(f).forEach(function(g){var _=u(g);if(!(!g.hasOwnProperty("__photons")||!g.__photons.length)){var y=g.source,m=g.target;if(!(!y||!m||!y.hasOwnProperty("x")||!m.hasOwnProperty("x"))){var w=c(g),C=Math.abs(l(g)),b=g.__photons||[],v=Math.max(0,h(g)/2)/Math.sqrt(n.globalScale),k=d(g)||"rgba(0,0,0,0.28)";p.fillStyle=k;var x=g.__controlPoints?Rs(se,[y.x,y.y].concat(je(g.__controlPoints),[m.x,m.y])):null,P=0,M=!1;b.forEach(function($){var N=!!$.__singleHop;if($.hasOwnProperty("__progressRatio")||($.__progressRatio=N?0:(P+C)/_),!N&&P++,$.__progressRatio+=w,$.__progressRatio>=1)if(!N)$.__progressRatio=$.__progressRatio%1;else{M=!0;return}var D=$.__progressRatio,H=x?x.get(D):{x:y.x+(m.x-y.x)*D||0,y:y.y+(m.y-y.y)*D||0};n.linkDirectionalParticleCanvasObject?n.linkDirectionalParticleCanvasObject(H.x,H.y,g,p,n.globalScale):(p.beginPath(),p.arc(H.x,H.y,v,0,2*Math.PI,!1),p.fill())}),M&&(g.__photons=g.__photons.filter(function($){return!$.__singleHop||$.__progressRatio<=1}))}}}),p.restore()}},emitParticle:function(n,r){return r&&(!r.__photons&&(r.__photons=[]),r.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:p_().force("link",Fa()).force("charge",Ba()).force("center",Za()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(n,r){r.ctx=n},update:function(n,r){n.engineRunning=!1,n.onUpdate(),n.nodeAutoColorBy!==null&&Is(n.graphData.nodes,Y(n.nodeAutoColorBy),n.nodeColor),n.linkAutoColorBy!==null&&Is(n.graphData.links,Y(n.linkAutoColorBy),n.linkColor),n.graphData.links.forEach(function(d){d.source=d[n.linkSource],d.target=d[n.linkTarget]}),n.forceLayout.stop().alpha(1).nodes(n.graphData.nodes);var i=n.forceLayout.force("link");i&&i.id(function(d){return d[n.nodeId]}).links(n.graphData.links);var o=n.dagMode&&hw(n.graphData,function(d){return d[n.nodeId]},{nodeFilter:n.dagNodeFilter,onLoopError:n.onDagError||void 0}),s=Math.max.apply(Math,je(Object.values(o||[]))),a=n.dagLevelDistance||n.graphData.nodes.length/(s||1)*dw*(["radialin","radialout"].indexOf(n.dagMode)!==-1?.7:1);if(["lr","rl","td","bu"].includes(r.dagMode)){var u=["lr","rl"].includes(r.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return delete d[u]})}if(["lr","rl","td","bu"].includes(n.dagMode)){var c=["rl","bu"].includes(n.dagMode),l=function(p){return(o[p[n.nodeId]]-s/2)*a*(c?-1:1)},h=["lr","rl"].includes(n.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return d[h]=l(d)})}n.forceLayout.force("dagRadial",["radialin","radialout"].indexOf(n.dagMode)!==-1?g_(function(d){var p=o[d[n.nodeId]]||-1;return(n.dagMode==="radialin"?s-p:p)*a}).strength(function(d){return n.dagNodeFilter(d)?1:0}):null);for(var f=0;f<n.warmupTicks&&!(n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin);f++)n.forceLayout.tick();this.resetCountdown(),n.onFinishUpdate()}});function Hu(e,n){var r=e instanceof Array?e:[e],i=new n;return i._destructor&&i._destructor(),{linkProp:function(s){return{default:i[s](),onChange:function(u,c){r.forEach(function(l){return c[l][s](u)})},triggerUpdate:!1}},linkMethod:function(s){return function(a){for(var u=arguments.length,c=new Array(u>1?u-1:0),l=1;l<u;l++)c[l-1]=arguments[l];var h=[];return r.forEach(function(f){var d=a[f],p=d[s].apply(d,c);p!==d&&h.push(p)}),h.length?h[0]:this}}}}var pw=800,gw=4,mw=5,Vu=Hu("forceGraph",fr),_w=Hu(["forceGraph","shadowGraph"],fr),yw=Object.assign.apply(Object,je(["nodeColor","nodeAutoColorBy","nodeCanvasObject","nodeCanvasObjectMode","linkColor","linkAutoColorBy","linkLineDash","linkWidth","linkCanvasObject","linkCanvasObjectMode","linkDirectionalArrowLength","linkDirectionalArrowColor","linkDirectionalArrowRelPos","linkDirectionalParticles","linkDirectionalParticleSpeed","linkDirectionalParticleOffset","linkDirectionalParticleWidth","linkDirectionalParticleColor","linkDirectionalParticleCanvasObject","dagMode","dagLevelDistance","dagNodeFilter","onDagError","d3AlphaMin","d3AlphaDecay","d3VelocityDecay","warmupTicks","cooldownTicks","cooldownTime","onEngineTick","onEngineStop"].map(function(e){return yn({},e,Vu.linkProp(e))})).concat(je(["nodeRelSize","nodeId","nodeVal","nodeVisibility","linkSource","linkTarget","linkVisibility","linkCurvature"].map(function(e){return yn({},e,_w.linkProp(e))})))),vw=Object.assign.apply(Object,je(["d3Force","d3ReheatSimulation","emitParticle"].map(function(e){return yn({},e,Vu.linkMethod(e))})));function Zr(e){if(e.canvas){var n=e.canvas.width,r=e.canvas.height;n===300&&r===150&&(n=r=0);var i=window.devicePixelRatio;n/=i,r/=i,[e.canvas,e.shadowCanvas].forEach(function(s){s.style.width="".concat(e.width,"px"),s.style.height="".concat(e.height,"px"),s.width=e.width*i,s.height=e.height*i,!n&&!r&&s.getContext("2d").scale(i,i)});var o=Xe(e.canvas).k;e.zoom.translateBy(e.zoom.__baseElem,(e.width-n)/2/o,(e.height-r)/2/o),e.needsRedraw=!0}}function Bu(e){var n=window.devicePixelRatio;e.setTransform(n,0,0,n,0,0)}function Os(e,n,r){e.save(),Bu(e),e.clearRect(0,0,n,r),e.restore()}var bw=to({props:Rt({width:{default:window.innerWidth,onChange:function(n,r){return Zr(r)},triggerUpdate:!1},height:{default:window.innerHeight,onChange:function(n,r){return Zr(r)},triggerUpdate:!1},graphData:{default:{nodes:[],links:[]},onChange:function(n,r){[n.nodes,n.links].every(function(o){return(o||[]).every(function(s){return!s.hasOwnProperty("__indexColor")})})&&r.colorTracker.reset(),[{type:"Node",objs:n.nodes},{type:"Link",objs:n.links}].forEach(i),r.forceGraph.graphData(n),r.shadowGraph.graphData(n);function i(o){var s=o.type,a=o.objs;a.filter(function(u){if(!u.hasOwnProperty("__indexColor"))return!0;var c=r.colorTracker.lookup(u.__indexColor);return!c||!c.hasOwnProperty("d")||c.d!==u}).forEach(function(u){u.__indexColor=r.colorTracker.register({type:s,d:u})})}},triggerUpdate:!1},backgroundColor:{onChange:function(n,r){r.canvas&&n&&(r.canvas.style.background=n)},triggerUpdate:!1},nodeLabel:{default:"name",triggerUpdate:!1},nodePointerAreaPaint:{onChange:function(n,r){r.shadowGraph.nodeCanvasObject(n?function(i,o,s){return n(i,i.__indexColor,o,s)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkPointerAreaPaint:{onChange:function(n,r){r.shadowGraph.linkCanvasObject(n?function(i,o,s){return n(i,i.__indexColor,o,s)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkLabel:{default:"name",triggerUpdate:!1},linkHoverPrecision:{default:4,triggerUpdate:!1},minZoom:{default:.01,onChange:function(n,r){r.zoom.scaleExtent([n,r.zoom.scaleExtent()[1]])},triggerUpdate:!1},maxZoom:{default:1e3,onChange:function(n,r){r.zoom.scaleExtent([r.zoom.scaleExtent()[0],n])},triggerUpdate:!1},enableNodeDrag:{default:!0,triggerUpdate:!1},enableZoomInteraction:{default:!0,triggerUpdate:!1},enablePanInteraction:{default:!0,triggerUpdate:!1},enableZoomPanInteraction:{default:!0,triggerUpdate:!1},enablePointerInteraction:{default:!0,onChange:function(n,r){r.hoverObj=null},triggerUpdate:!1},autoPauseRedraw:{default:!0,triggerUpdate:!1},onNodeDrag:{default:function(){},triggerUpdate:!1},onNodeDragEnd:{default:function(){},triggerUpdate:!1},onNodeClick:{triggerUpdate:!1},onNodeRightClick:{triggerUpdate:!1},onNodeHover:{triggerUpdate:!1},onLinkClick:{triggerUpdate:!1},onLinkRightClick:{triggerUpdate:!1},onLinkHover:{triggerUpdate:!1},onBackgroundClick:{triggerUpdate:!1},onBackgroundRightClick:{triggerUpdate:!1},showPointerCursor:{default:!0,triggerUpdate:!1},onZoom:{triggerUpdate:!1},onZoomEnd:{triggerUpdate:!1},onRenderFramePre:{triggerUpdate:!1},onRenderFramePost:{triggerUpdate:!1}},yw),aliases:{stopAnimation:"pauseAnimation"},methods:Rt({graph2ScreenCoords:function(n,r,i){var o=Xe(n.canvas);return{x:r*o.k+o.x,y:i*o.k+o.y}},screen2GraphCoords:function(n,r,i){var o=Xe(n.canvas);return{x:(r-o.x)/o.k,y:(i-o.y)/o.k}},centerAt:function(n,r,i,o){if(!n.canvas)return null;if(r!==void 0||i!==void 0){var s=Object.assign({},r!==void 0?{x:r}:{},i!==void 0?{y:i}:{});return o?n.tweenGroup.add(new fs(a()).to(s,o).easing(Tt.Quadratic.Out).onUpdate(u).start()):u(s),this}return a();function a(){var c=Xe(n.canvas);return{x:(n.width/2-c.x)/c.k,y:(n.height/2-c.y)/c.k}}function u(c){var l=c.x,h=c.y;n.zoom.translateTo(n.zoom.__baseElem,l===void 0?a().x:l,h===void 0?a().y:h),n.needsRedraw=!0}},zoom:function(n,r,i){if(!n.canvas)return null;if(r!==void 0)return i?n.tweenGroup.add(new fs({k:o()}).to({k:r},i).easing(Tt.Quadratic.Out).onUpdate(function(a){var u=a.k;return s(u)}).start()):s(r),this;return o();function o(){return Xe(n.canvas).k}function s(a){n.zoom.scaleTo(n.zoom.__baseElem,a),n.needsRedraw=!0}},zoomToFit:function(n){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,o=arguments.length,s=new Array(o>3?o-3:0),a=3;a<o;a++)s[a-3]=arguments[a];var u=this.getGraphBbox.apply(this,s);if(u){var c={x:(u.x[0]+u.x[1])/2,y:(u.y[0]+u.y[1])/2},l=Math.max(1e-12,Math.min(1e12,(n.width-i*2)/(u.x[1]-u.x[0]),(n.height-i*2)/(u.y[1]-u.y[0])));this.centerAt(c.x,c.y,r),this.zoom(l,r)}return this},getGraphBbox:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},i=Y(n.nodeVal),o=function(u){return Math.sqrt(Math.max(0,i(u)||1))*n.nodeRelSize},s=n.graphData.nodes.filter(r).map(function(a){return{x:a.x,y:a.y,r:o(a)}});return s.length?{x:[as(s,function(a){return a.x-a.r}),ss(s,function(a){return a.x+a.r})],y:[as(s,function(a){return a.y-a.r}),ss(s,function(a){return a.y+a.r})]}:null},pauseAnimation:function(n){return n.animationFrameRequestId&&(cancelAnimationFrame(n.animationFrameRequestId),n.animationFrameRequestId=null),this},resumeAnimation:function(n){return n.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},vw),stateInit:function(){return{lastSetZoom:1,zoom:qv(),forceGraph:new fr,shadowGraph:new fr().cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new l1,tweenGroup:new bu}},init:function(n,r){var i=this;n.innerHTML="";var o=document.createElement("div");o.classList.add("force-graph-container"),o.style.position="relative",n.appendChild(o),r.canvas=document.createElement("canvas"),r.backgroundColor&&(r.canvas.style.background=r.backgroundColor),o.appendChild(r.canvas),r.shadowCanvas=document.createElement("canvas");var s=r.canvas.getContext("2d"),a=r.shadowCanvas.getContext("2d",{willReadFrequently:!0}),u={x:-1e12,y:-1e12},c=function(){var f=null,d=window.devicePixelRatio,p=u.x>0&&u.y>0?a.getImageData(u.x*d,u.y*d,1,1):null;return p&&(f=r.colorTracker.lookup(p.data)),f};De(r.canvas).call(ey().subject(function(){if(!r.enableNodeDrag)return null;var h=c();return h&&h.type==="Node"?h.d:null}).on("start",function(h){var f=h.subject;f.__initialDragPos={x:f.x,y:f.y,fx:f.fx,fy:f.fy},h.active||(f.fx=f.x,f.fy=f.y),r.canvas.classList.add("grabbable")}).on("drag",function(h){var f=h.subject,d=f.__initialDragPos,p=h,g=Xe(r.canvas).k,_={x:d.x+(p.x-d.x)/g-f.x,y:d.y+(p.y-d.y)/g-f.y};["x","y"].forEach(function(y){return f["f".concat(y)]=f[y]=d[y]+(p[y]-d[y])/g}),!(!f.__dragged&&mw>=Math.sqrt(Hv(["x","y"].map(function(y){return Math.pow(h[y]-d[y],2)}))))&&(r.forceGraph.d3AlphaTarget(.3).resetCountdown(),r.isPointerDragging=!0,f.__dragged=!0,r.onNodeDrag(f,_))}).on("end",function(h){var f=h.subject,d=f.__initialDragPos,p={x:f.x-d.x,y:f.y-d.y};d.fx===void 0&&(f.fx=void 0),d.fy===void 0&&(f.fy=void 0),delete f.__initialDragPos,r.forceGraph.d3AlphaTarget()&&r.forceGraph.d3AlphaTarget(0).resetCountdown(),r.canvas.classList.remove("grabbable"),r.isPointerDragging=!1,f.__dragged&&(delete f.__dragged,r.onNodeDragEnd(f,p))})),r.zoom(r.zoom.__baseElem=De(r.canvas)),r.zoom.__baseElem.on("dblclick.zoom",null),r.zoom.filter(function(h){return!h.button&&r.enableZoomPanInteraction&&(h.type!=="wheel"||Y(r.enableZoomInteraction)(h))&&(h.type==="wheel"||Y(r.enablePanInteraction)(h))}).on("zoom",function(h){var f=h.transform;[s,a].forEach(function(d){Bu(d),d.translate(f.x,f.y),d.scale(f.k,f.k)}),r.isPointerDragging=!0,r.onZoom&&r.onZoom(Rt(Rt({},f),i.centerAt())),r.needsRedraw=!0}).on("end",function(h){r.isPointerDragging=!1,r.onZoomEnd&&r.onZoomEnd(Rt(Rt({},h.transform),i.centerAt()))}),Zr(r),r.forceGraph.onNeedsRedraw(function(){return r.needsRedraw=!0}).onFinishUpdate(function(){Xe(r.canvas).k===r.lastSetZoom&&r.graphData.nodes.length&&(r.zoom.scaleTo(r.zoom.__baseElem,r.lastSetZoom=gw/Math.cbrt(r.graphData.nodes.length)),r.needsRedraw=!0)}),r.tooltip=new R1(o),["pointermove","pointerdown"].forEach(function(h){return o.addEventListener(h,function(f){h==="pointerdown"&&(r.isPointerPressed=!0,r.pointerDownEvent=f),!r.isPointerDragging&&f.type==="pointermove"&&r.onBackgroundClick&&(f.pressure>0||r.isPointerPressed)&&(f.pointerType==="mouse"||f.movementX===void 0||[f.movementX,f.movementY].some(function(g){return Math.abs(g)>1}))&&(r.isPointerDragging=!0);var d=p(o);u.x=f.pageX-d.left,u.y=f.pageY-d.top;function p(g){var _=g.getBoundingClientRect(),y=window.pageXOffset||document.documentElement.scrollLeft,m=window.pageYOffset||document.documentElement.scrollTop;return{top:_.top+m,left:_.left+y}}},{passive:!0})}),o.addEventListener("pointerup",function(h){if(r.isPointerPressed){if(r.isPointerPressed=!1,r.isPointerDragging){r.isPointerDragging=!1;return}var f=[h,r.pointerDownEvent];requestAnimationFrame(function(){if(h.button===0)if(r.hoverObj){var d=r["on".concat(r.hoverObj.type,"Click")];d&&d.apply(void 0,[r.hoverObj.d].concat(f))}else r.onBackgroundClick&&r.onBackgroundClick.apply(r,f);if(h.button===2)if(r.hoverObj){var p=r["on".concat(r.hoverObj.type,"RightClick")];p&&p.apply(void 0,[r.hoverObj.d].concat(f))}else r.onBackgroundRightClick&&r.onBackgroundRightClick.apply(r,f)})}},{passive:!0}),o.addEventListener("contextmenu",function(h){return!r.onBackgroundRightClick&&!r.onNodeRightClick&&!r.onLinkRightClick?!0:(h.preventDefault(),!1)}),r.forceGraph(s),r.shadowGraph(a);var l=_b(function(){Os(a,r.width,r.height),r.shadowGraph.linkWidth(function(f){return Y(r.linkWidth)(f)+r.linkHoverPrecision});var h=Xe(r.canvas);r.shadowGraph.globalScale(h.k).tickFrame()},pw);r.flushShadowCanvas=l.flush,(this._animationCycle=function h(){var f=!r.autoPauseRedraw||!!r.needsRedraw||r.forceGraph.isEngineRunning()||r.graphData.links.some(function(C){return C.__photons&&C.__photons.length});if(r.needsRedraw=!1,r.enablePointerInteraction){var d=r.isPointerDragging?null:c();if(d!==r.hoverObj){var p=r.hoverObj,g=p?p.type:null,_=d?d.type:null;if(g&&g!==_){var y=r["on".concat(g,"Hover")];y&&y(null,p.d)}if(_){var m=r["on".concat(_,"Hover")];m&&m(d.d,g===_?p.d:null)}r.tooltip.content(d&&Y(r["".concat(d.type.toLowerCase(),"Label")])(d.d)||null),r.canvas.classList[(d&&r["on".concat(_,"Click")]||!d&&r.onBackgroundClick)&&Y(r.showPointerCursor)(d==null?void 0:d.d)?"add":"remove"]("clickable"),r.hoverObj=d}f&&l()}if(f){Os(s,r.width,r.height);var w=Xe(r.canvas).k;r.onRenderFramePre&&r.onRenderFramePre(s,w),r.forceGraph.globalScale(w).tickFrame(),r.onRenderFramePost&&r.onRenderFramePost(s,w)}r.tweenGroup.update(),r.animationFrameRequestId=requestAnimationFrame(h)})()},update:function(n){}});function Fn(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()||"#000"}const Re={nodes:[],links:[]};let Pt=null,on=null;const Wu=document.getElementById("graph"),gt=document.getElementById("popup"),ww=gt.querySelector(".popup-title"),qr=gt.querySelector(".popup-error"),xw=document.getElementById("open-btn"),Ve=document.getElementById("expand-btn"),kw=document.getElementById("zoom-in"),Sw=document.getElementById("zoom-out"),zw=document.getElementById("reset-graph"),Ze=new bw(Wu).nodeId("url").nodeLabel("title").nodeColor(e=>{switch(e.state){case"expanded":return Fn("--node-expanded");case"error":return Fn("--node-error");default:return Fn("--node-default")}}).nodeVal(8).linkDirectionalArrowLength(6).linkDirectionalArrowRelPos(1).linkColor(()=>Fn("--link-color")).onNodeClick(Ew).onBackgroundClick(()=>Rn()).d3Force("charge",Ba().strength(-80)).d3Force("link",Fa().distance(60)).d3Force("collide",Ym(12)).d3Force("center",Za()).d3VelocityDecay(.3).cooldownTime(1/0).d3AlphaMin(0).d3Force("ambient",()=>{for(const e of Re.nodes)e.vx!==void 0&&e.vy!==void 0&&(e.vx+=(Math.random()-.5)*.1,e.vy+=(Math.random()-.5)*.1)}).graphData(Re);function Ju(){const{width:e,height:n}=Wu.getBoundingClientRect();Ze.width(e).height(n)}window.addEventListener("resize",Ju);Ju();function hr(e,n,r="default",i){if(Re.nodes.find(a=>a.url===e))return!1;const s={url:e,title:n,state:r};return i&&(s.x=i.x+(Math.random()-.5)*20,s.y=i.y+(Math.random()-.5)*20),Re.nodes.push(s),!0}function Tw(e,n){const r=Re.nodes.find(i=>i.url===e);r&&(r.title=n)}function fi(e,n,r){const i=Re.nodes.find(o=>o.url===e);i&&(i.state=n,i.errorMessage=r)}function Cw(e,n){return Re.links.find(i=>{const o=typeof i.source=="string"?i.source:i.source.url,s=typeof i.target=="string"?i.target:i.target.url;return o===e&&s===n})?!1:(Re.links.push({source:e,target:n}),!0)}function so(){Ze.graphData({nodes:[...Re.nodes],links:[...Re.links]})}function Pw(e,n,r){ww.textContent=e.title,e.state==="error"?(qr.textContent=e.errorMessage||"Failed to load page",qr.style.display="block",Ve.style.display="none"):(qr.style.display="none",Ve.style.display="inline-block",e.state==="expanded"?(Ve.setAttribute("disabled","true"),Ve.textContent="Expanded"):(Ve.removeAttribute("disabled"),Ve.textContent="Expand")),gt.style.display="block";const i=gt.getBoundingClientRect(),o=15,s=n<window.innerWidth/2?n+o:n-i.width-o,a=r<window.innerHeight/2?r+o:r-i.height-o;gt.style.left=`${s}px`,gt.style.top=`${a}px`}function Rn(){gt.style.display="none",Pt=null}function Ew(e,n){if(Pt===e.url){Rn();return}Pt=e.url,Pw(e,n.clientX,n.clientY)}document.addEventListener("keydown",e=>{e.key==="Escape"&&gt.style.display==="block"&&Rn()});const Gu=1.5;kw.addEventListener("click",()=>{const e=Ze.zoom();Ze.zoom(e*Gu,200)});Sw.addEventListener("click",()=>{const e=Ze.zoom();Ze.zoom(e/Gu,200)});const ft=new em({name:"Wiki Explorer",version:"1.0.0"});zw.addEventListener("click",async()=>{if(!on)return;const e=await ft.callServerTool({name:"get-first-degree-links",arguments:{url:on}});Re.nodes=[],Re.links=[],hr(on,on,"default",{x:0,y:0}),Ze.warmupTicks(100),ao(e),Ze.centerAt(0,0,500)});xw.addEventListener("click",async()=>{Pt&&(await ft.openLink({url:Pt}),Rn())});Ve.addEventListener("click",async()=>{if(!Pt)return;const e=Pt;Ve.setAttribute("disabled","true"),Ve.textContent="Loading...";try{const n=await ft.callServerTool({name:"get-first-degree-links",arguments:{url:e}});Ze.warmupTicks(0),ao(n)}catch(n){console.error("Expand error:",n),fi(e,"error","Request failed"),so()}finally{Ve.removeAttribute("disabled"),Ve.textContent="Expand",Rn()}});ft.ontoolinput=e=>{const n=e.arguments;n!=null&&n.url&&(on=n.url,hr(n.url,n.url,"default",{x:0,y:0}),Ze.warmupTicks(100),so(),Ze.centerAt(0,0,500))};ft.ontoolresult=e=>{Ze.warmupTicks(100),ao(e)};function ao(e){if(e.isError){console.error("Tool result error:",e);return}const n=e.structuredContent,{page:r,links:i,error:o}=n;if(hr(r.url,r.title),Tw(r.url,r.title),o)fi(r.url,"error",o);else{const s=Re.nodes.find(u=>u.url===r.url),a=s?{x:s.x??0,y:s.y??0}:void 0;for(const u of i)hr(u.url,u.title,"default",a),Cw(r.url,u.url);fi(r.url,"expanded")}so()}ft.onerror=e=>{console.error("[Wiki Explorer] App error:",e)};function Xu(e){e.safeAreaInsets&&(document.body.style.paddingTop=`${e.safeAreaInsets.top}px`,document.body.style.paddingRight=`${e.safeAreaInsets.right}px`,document.body.style.paddingBottom=`${e.safeAreaInsets.bottom}px`,document.body.style.paddingLeft=`${e.safeAreaInsets.left}px`)}ft.onhostcontextchanged=Xu;ft.connect().then(()=>{const e=ft.getHostContext();e&&Xu(e)});</script>
165
126
  <style rel="stylesheet" crossorigin>*{box-sizing:border-box;margin:0;padding:0}html,body{font-family:system-ui,-apple-system,sans-serif;font-size:1rem;width:100%;height:100%;overflow:hidden}:root{--bg-color: #ffffff;--text-color: #333333;--border-color: #dddddd;--node-default: #4a90d9;--node-expanded: #2ecc71;--node-error: #e74c3c;--link-color: rgba(128, 128, 128, .5)}@media(prefers-color-scheme:dark){:root{--bg-color: #1e1e1e;--text-color: #e0e0e0;--border-color: #444444}}body{background-color:var(--bg-color);color:var(--text-color)}#graph{width:100%;height:100vh}#popup{display:none;position:fixed;background:var(--bg-color);border:1px solid var(--border-color);border-radius:8px;padding:16px;box-shadow:0 4px 12px #00000026;z-index:100;min-width:200px;max-width:400px}.popup-title{font-weight:600;margin-bottom:12px;word-wrap:break-word;color:var(--text-color)}.popup-error{display:none;color:var(--node-error);font-size:14px;padding:8px 0;border-top:1px solid var(--border-color);margin-bottom:8px}.popup-buttons{display:flex;gap:8px}.popup-buttons button{flex:1;padding:8px 16px;border:none;border-radius:6px;font-weight:600;cursor:pointer;transition:opacity .2s}.popup-buttons button:hover{opacity:.9}#open-btn{background-color:var(--node-default);color:#fff}#expand-btn{background-color:var(--node-expanded);color:#fff}.popup-buttons button:disabled{opacity:.5;cursor:not-allowed}#controls{position:fixed;bottom:24px;right:24px;display:flex;flex-direction:row;align-items:flex-end;gap:8px;z-index:100}#reset-graph{width:40px;height:40px;background:var(--bg-color);border:1px solid var(--border-color);border-radius:4px;color:var(--text-color);font-size:20px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 6px #0000004d;transition:background-color .15s}#reset-graph:hover{background:var(--border-color)}#reset-graph:active{background:var(--border-color);opacity:.8}#zoom-controls{display:flex;flex-direction:column;box-shadow:0 2px 6px #0000004d;border-radius:4px}#zoom-controls button{width:40px;height:40px;background:var(--bg-color);border:1px solid var(--border-color);color:var(--text-color);font-size:20px;font-weight:600;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color .15s}#zoom-controls button:hover{background:var(--border-color)}#zoom-controls button:active{background:var(--border-color);opacity:.8}#zoom-in{border-radius:4px 4px 0 0;border-bottom:none}#zoom-out{border-radius:0 0 4px 4px}</style>
166
127
  </head>
167
128
  <body>